:root {
  --ink: #202e28;
  --muted: #5e6e64;
  --line: #dce5de;
  --paper: #f3f6f3;
  --green: #23664e;
  --green-dark: #174c39;
  --green-soft: #e3f0e7;
  --coral: #ac4934;
  --coral-soft: #f9eee9;
  --shadow: 0 12px 36px #16342615;
  font-family: Inter, 'Microsoft YaHei UI', 'PingFang SC', system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: not-allowed; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid #428361;
  outline-offset: 2px;
}

.icon { width: 18px; height: 18px; display: inline-grid; place-items: center; flex: none; vertical-align: middle; }
.icon svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.small, small { font-size: .82rem; color: var(--muted); }
.muted { color: var(--muted); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: .875rem;
  font-weight: 650;
  white-space: nowrap;
}
.button:hover:not(:disabled) { background: var(--green-soft); }
.button.primary { background: var(--green); color: #fff; }
.button.primary:hover:not(:disabled) { background: var(--green-dark); }
.button.outline { border-color: var(--line); background: #fff; }
.button.outline:hover:not(:disabled) { border-color: #8bb39c; }
.button.danger { color: var(--coral); }
.button.danger:hover:not(:disabled) { background: var(--coral-soft); }
.button.danger-solid { background: #a63e31; color: #fff; }
.button.danger-solid:hover:not(:disabled) { background: #843329; }
.button.text { min-height: initial; padding: 3px 5px; color: var(--green); font-size: .8rem; }
.button.text.danger { color: var(--coral); }
.button.icon-only { width: 38px; padding: 0; flex: none; }

.field, .select, .textarea, .role-select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  font-size: .9rem;
}
.textarea { min-height: 106px; resize: vertical; line-height: 1.65; }
.form-field { display: grid; min-width: 0; gap: 7px; font-size: .88rem; font-weight: 650; }
.form-field .small { font-weight: 400; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.notice { padding: 10px 12px; background: var(--green-soft); color: var(--green-dark); border-radius: 7px; font-size: .875rem; }

.site-brand {
  --brand-rose: #963454;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  color: #302630;
  font-size: 1.28rem;
  letter-spacing: 0;
  white-space: nowrap;
}
button.site-brand { min-height: 44px; padding: 0; border: 0; border-radius: 4px; background: transparent; }
button.site-brand:hover .brand-name { color: var(--brand-rose); }
.brand-seal { display: block; width: 44px; height: 44px; flex: none; }
.brand-name {
  display: inline-flex;
  align-items: baseline;
  font-family: 'Noto Serif SC', 'Songti SC', 'STSong', 'SimSun', serif;
  font-weight: 800;
  line-height: 1.2;
}
.brand-wave { padding-inline: .08em; color: var(--brand-rose); font: bold italic .85em/1 Georgia, serif; }
.brand-bbs { position: relative; padding-right: .06em; color: var(--brand-rose); font: bold italic 1em/1 Georgia, serif; }
.brand-bbs::after {
  content: ''; position: absolute; inset: auto 0 -.12em .12em; height: .12em;
  border-radius: 80% 25% 75% 30%; background: #e4a0b4; transform: rotate(-3deg);
}
.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  overflow: hidden;
  border-radius: 50%;
  flex: none;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: .83rem;
  font-weight: 740;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.large { width: 70px; height: 70px; font-size: 1.6rem; }

.topbar { position: sticky; top: 0; z-index: 10; background: #fff; border-bottom: 1px solid var(--line); }
.topbar-inner {
  width: min(1320px, 100%);
  min-height: 66px;
  margin: auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.top-brand { margin-right: 32px; }
.top-search {
  display: flex;
  align-items: center;
  width: min(390px, 100%);
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 9px;
  color: var(--muted);
}
.top-search input { width: 100%; min-width: 0; height: 38px; border: 0; background: transparent; padding: 0 12px; color: var(--ink); font-size: .87rem; }
.top-search .button { color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; flex: none; }
.user-menu { gap: 8px; padding: 4px; min-width: 0; }
.user-menu-name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; }

.app-layout {
  width: min(1320px, 100%);
  margin-inline: auto;
  padding: 28px 24px 50px;
  display: grid;
  grid-template-columns: 174px minmax(0, 1fr) 264px;
  align-items: start;
  gap: 24px;
}
.page-layout { grid-template-columns: 174px minmax(0, 800px); }
.admin-layout { grid-template-columns: 174px minmax(0, 1fr); }
.left-rail, .right-rail { position: sticky; top: 90px; min-width: 0; }
.right-rail { display: grid; gap: 16px; }
.main-column { min-width: 0; }
.side-nav { display: grid; gap: 5px; }
.nav-label { padding: 9px 12px; font-size: .78rem; color: var(--muted); font-weight: 700; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 43px;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 620;
}
.nav-item:hover, .nav-item.selected { background: var(--green-soft); color: var(--green-dark); }
.nav-item.selected { font-weight: 740; }
.count { margin-left: auto; min-width: 20px; text-align: center; padding: 2px 4px; border-radius: 4px; color: var(--coral); background: var(--coral-soft); font-size: .7rem; }
.rail-divider { height: 1px; background: var(--line); margin: 14px 0; }
.mobile-nav, .mobile-compose { display: none; }

.section-heading { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-heading h1 { margin: 0; font-size: 1.65rem; line-height: 1.3; overflow-wrap: anywhere; }
.section-heading p { margin: 6px 0 0; color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.feed-controls { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.filter-list { display: flex; gap: 6px; align-items: center; min-width: 0; overflow-x: auto; scrollbar-width: thin; padding: 4px 3px; }
.filter-button, .feed-sort button {
  flex: none;
  min-height: 34px;
  white-space: nowrap;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 7px;
  padding: 6px 9px;
  font-size: .8rem;
}
.filter-button:hover, .filter-button.selected { background: var(--green-soft); border-color: #9dbfa8; color: var(--green-dark); }
.feed-sort { display: flex; gap: 1px; background: #e9eeea; padding: 3px; border-radius: 9px; margin-left: auto; }
.feed-sort button { border: 0; background: transparent; min-height: 29px; }
.feed-sort button.selected { background: #fff; color: var(--green-dark); font-weight: 700; box-shadow: 0 1px 3px #20342714; }

.post-list { display: grid; gap: 14px; }
.post-card, .page-panel, .side-section, .draft-card {
  min-width: 0;
  padding: 19px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
}
.post-top { display: flex; align-items: center; gap: 9px; min-width: 0; }
.post-author { min-width: 0; overflow-wrap: anywhere; flex: 1; }
.post-author strong { display: block; font-size: .9rem; }
.post-meta { font-size: .77rem; color: var(--muted); margin-top: 3px; }
.post-category, .tag, .pin-label { border-radius: 6px; font-size: .76rem; padding: 4px 7px; background: var(--green-soft); color: var(--green-dark); }
.post-category { white-space: nowrap; }
.pin-label { background: #f7f1dc; color: #705629; white-space: nowrap; }
.pin-label .icon { width: 13px; height: 13px; margin-right: 3px; }
.post-title { font-size: 1.12rem; line-height: 1.5; margin: 13px 0 7px; }
.title-link { display: inline; background: transparent; border: 0; padding: 0; font-weight: 700; text-align: left; color: var(--ink); overflow-wrap: anywhere; }
.title-link:hover { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.post-body { margin: 0; font-size: .92rem; line-height: 1.72; color: #415149; white-space: pre-wrap; overflow-wrap: anywhere; }
.post-tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 11px 0 0; }
.post-image { display: block; width: 100%; max-height: 310px; aspect-ratio: 2 / 1; object-fit: cover; margin-top: 14px; border-radius: 9px; background: var(--green-soft); }
.post-actions { display: flex; gap: 3px; align-items: center; margin-top: 14px; padding-top: 9px; border-top: 1px solid var(--line); }
.post-actions .reaction { color: var(--muted); font-size: .8rem; min-height: 34px; padding: 0 8px; gap: 5px; }
.post-actions .danger, .post-actions .active { color: var(--coral); }
.post-actions .active svg { fill: var(--coral-soft); }
.action-spacer { flex: 1; }

.empty-state { border: 1px dashed #b9cabd; border-radius: 12px; background: #fff; padding: 34px 18px; text-align: center; }
.empty-state p { margin: 7px 0 0; color: var(--muted); font-size: .9rem; }
.side-section { padding: 14px 15px; }
.side-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.side-heading h2 { font-size: .95rem; margin: 0; }
.side-heading h2 .icon { color: var(--green); }
.ranking-list { list-style: none; padding: 0; margin: 8px 0 0; }
.ranking-list li + li { border-top: 1px solid var(--line); }
.trend-row {
  width: 100%; display: flex; align-items: flex-start; gap: 10px; padding: 10px 2px;
  border: 0; background: transparent; text-align: left; color: var(--ink); border-radius: 6px;
}
.trend-row:hover, .topic-item:hover { background: var(--paper); }
.trend-number { color: var(--coral); font-weight: 750; min-width: 20px; }
.trend-copy { overflow-wrap: anywhere; }
.trend-copy strong { display: block; font-size: .84rem; line-height: 1.5; }
.trend-copy span { font-size: .75rem; margin-top: 3px; color: var(--muted); }
.ranking-panel .trend-row { padding: 14px 8px; }
.ranking-panel .trend-copy strong { font-size: 1rem; }
.topic-list { display: grid; gap: 3px; margin-top: 9px; }
.topic-item { display: flex; justify-content: space-between; gap: 10px; padding: 7px 4px; background: transparent; border: 0; border-radius: 6px; color: var(--muted); font-size: .84rem; }
