/* ==========================================================================
   芝士论坛 · 视觉系统
   沿用芝士昱森官网（cheese-official-website）与起司云（cheese-cloud-frontend）的
   芝士色设计语言：暖奶油底、芝士金主色、深咖文字、20/28 圆角、柔和暖阴影。
   ========================================================================== */

:root {
  --surface: #FAF6EB;
  --surface-raised: #FFFDF7;
  --surface-sunken: #F2E8D3;
  --on-surface: #1F1A11;
  --on-surface-muted: #6E6455;
  --brand: #D9A03F;
  --brand-strong: #C0842A;
  --brand-deep: #7E5410;
  --gold-soft: #F6E7C4;
  --line: rgba(31, 26, 17, .08);
  --line-strong: rgba(31, 26, 17, .14);
  --grad-text: linear-gradient(100deg, #C9922F 0%, #E0AE52 55%, #B8802A 100%);
  --shadow-sm: 0 2px 8px rgba(88, 68, 26, .06);
  --shadow-md: 0 14px 34px -14px rgba(88, 68, 26, .24);
  --shadow-lg: 0 34px 64px -34px rgba(88, 68, 26, .38);
  --radius: 20px;
  --radius-lg: 28px;
  --max: 1200px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --danger: #C4453B;
  --success: #5E8C3F;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--on-surface);
  background:
    radial-gradient(1100px 520px at 82% -8%, rgba(246, 231, 196, .85) 0%, rgba(246, 231, 196, 0) 62%),
    radial-gradient(760px 420px at -6% 12%, rgba(255, 253, 247, .9) 0%, rgba(255, 253, 247, 0) 60%),
    var(--surface);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5 { margin: 0; line-height: 1.28; letter-spacing: -.02em; font-weight: 800; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
ul, ol, dl, dd, dt { margin: 0; padding: 0; list-style: none; }
code, pre { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; }
::selection { background: rgba(217, 160, 63, .28); }
:focus-visible { outline: 2px solid var(--brand-strong); outline-offset: 2px; border-radius: 6px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 28px; }
.site-main { min-height: 60vh; padding-bottom: 24px; }
.narrow { max-width: 860px; }
.small { font-size: 13px; }
.dot { color: rgba(31, 26, 17, .3); }

.icon { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: var(--on-surface); color: #FFFDF7; padding: 10px 18px; border-radius: 999px;
  transition: top .2s ease;
}
.skip-link:focus { top: 14px; }

/* ---------------- 顶栏 ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(250, 246, 235, .82);
  border-bottom: 1px solid transparent;
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  transition: border-color .3s ease, box-shadow .3s ease;
}
.site-header.is-stuck { border-bottom-color: var(--line); box-shadow: 0 6px 24px -18px rgba(88, 68, 26, .5); }
.nav { display: flex; align-items: center; gap: 18px; height: 72px; }
.brand { display: flex; align-items: center; gap: 11px; flex: none; }
.brand img { width: 38px; height: 38px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.12; }
.brand-name { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.brand-sub { font-size: 9.5px; font-weight: 700; letter-spacing: .15em; color: var(--brand-strong); text-transform: uppercase; }
.nav-links { display: flex; align-items: center; gap: 2px; margin-left: 6px; }
.nav-links a { padding: 8px 13px; font-size: 14.5px; font-weight: 500; color: var(--on-surface-muted); border-radius: 999px; transition: color .2s ease, background-color .2s ease; }
.nav-links a:hover { color: var(--on-surface); background: rgba(217, 160, 63, .12); }
.nav-links a[aria-current="page"] { color: var(--brand-deep); font-weight: 700; background: rgba(217, 160, 63, .18); }
.nav-search { position: relative; display: flex; align-items: center; margin-left: auto; width: min(260px, 22vw); }
.nav-search .icon { position: absolute; left: 13px; font-size: 16px; color: var(--on-surface-muted); pointer-events: none; }
.nav-search input {
  width: 100%; height: 38px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: rgba(255, 253, 247, .75); padding: 0 14px 0 38px; font-size: 13.5px;
  transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.nav-search input:focus { outline: none; border-color: rgba(192, 132, 42, .5); background: #fff; box-shadow: 0 0 0 4px rgba(217, 160, 63, .12); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: var(--on-surface-muted); position: relative; transition: background-color .2s ease, color .2s ease; }
.icon-btn:hover { background: rgba(217, 160, 63, .14); color: var(--brand-deep); }
.icon-btn .icon { font-size: 19px; }
.badge-dot {
  position: absolute; top: 2px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--surface);
}
.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; display: block; border-radius: 50%; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu-panel {
  position: absolute; right: 0; top: calc(100% + 12px); width: 232px; padding: 10px;
  background: var(--surface-raised); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-lg); display: grid; gap: 2px; z-index: 80;
  animation: popIn .22s var(--ease);
}
.user-menu-head { display: flex; gap: 10px; align-items: center; padding: 10px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.user-menu-head strong { display: block; font-size: 14px; }
.user-menu-head span { display: block; font-size: 12px; color: var(--on-surface-muted); }
.user-menu-panel a, .user-menu-panel button {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px;
  font-size: 13.5px; color: var(--on-surface); width: 100%; text-align: left;
}
.user-menu-panel a:hover, .user-menu-panel button:hover { background: var(--gold-soft); }
.user-menu-panel .icon { font-size: 16px; color: var(--on-surface-muted); }
.user-menu-panel em { margin-left: auto; font-style: normal; background: var(--danger); color: #fff; font-size: 10.5px; padding: 1px 7px; border-radius: 999px; }
.user-menu-panel form { margin: 0; }
.menu-danger { color: var(--danger) !important; }
.nav-toggle { display: none; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line-strong); align-items: center; justify-content: center; }
.nav-toggle .icon { font-size: 20px; }

@keyframes popIn { from { transform: translateY(6px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }

/* 移动抽屉 */
.drawer { position: fixed; inset: 0; z-index: 90; display: none; }
.drawer.is-open { display: block; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(31, 26, 17, .38); backdrop-filter: blur(2px); }
.drawer-panel {
  position: absolute; top: 0; right: 0; width: min(320px, 86vw); height: 100%;
  background: var(--surface-raised); border-left: 1px solid var(--line);
  padding: 22px 20px 30px; display: flex; flex-direction: column; gap: 4px;
  animation: slideIn .3s var(--ease); overflow-y: auto;
}
@keyframes slideIn { from { transform: translateX(26px); opacity: .4; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.drawer-head span { font-weight: 700; color: var(--on-surface-muted); font-size: 14px; }
.drawer-close { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
.drawer-close:hover { background: var(--surface-sunken); }
.drawer-panel > a { padding: 11px 13px; border-radius: 12px; font-size: 15px; font-weight: 600; }
.drawer-panel > a:hover { background: var(--gold-soft); }
.drawer-panel > a[aria-current="page"] { background: var(--gold-soft); color: var(--brand-deep); }
.drawer-foot { margin-top: auto; padding-top: 18px; display: grid; gap: 8px; }

/* ---------------- 通用组件 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px; border-radius: 999px; font-size: 14.5px; font-weight: 600;
  white-space: nowrap; border: 1px solid transparent; cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .25s ease, border-color .25s ease, color .25s ease;
}
.btn .icon { font-size: 17px; }
.btn-primary {
  background: linear-gradient(140deg, #FEF8E4 0%, #FAEDBE 52%, #F5DF9C 100%);
  border-color: rgba(192, 132, 42, .3); color: #4A3810;
  box-shadow: 0 8px 18px -12px rgba(120, 95, 30, .5), inset 0 1px 0 rgba(255, 255, 255, .9);
}
.btn-primary:hover { transform: translateY(-2px); border-color: rgba(192, 132, 42, .45); box-shadow: 0 14px 26px -14px rgba(120, 95, 30, .6), inset 0 1px 0 #fff; }
.btn-outline { background: rgba(255, 253, 247, .7); border-color: var(--line-strong); color: var(--on-surface); }
.btn-outline:hover { background: #fff; border-color: rgba(192, 132, 42, .45); transform: translateY(-2px); }
.btn-ghost { color: var(--on-surface-muted); padding: 0 14px; }
.btn-ghost:hover { color: var(--on-surface); background: rgba(217, 160, 63, .12); }
.btn-danger { background: rgba(196, 69, 59, .08); border-color: rgba(196, 69, 59, .22); color: var(--danger); }
.btn-danger:hover { background: rgba(196, 69, 59, .14); }
.btn-sm { height: 38px; padding: 0 16px; font-size: 13.5px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 14px;
  border-radius: 999px; background: rgba(217, 160, 63, .14); color: var(--brand-deep);
  font-size: 12.5px; font-weight: 700; letter-spacing: .05em;
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px rgba(217, 160, 63, .22); }
.grad-text { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; color: var(--brand-deep); font-weight: 700; font-size: 13.5px; }
.link-arrow .icon { font-size: 15px; transition: transform .25s var(--ease); }
.link-arrow:hover .icon { transform: translateX(3px); }

.avatar {
  --avatar-size: 40px; --avatar-hue: 45;
  width: var(--avatar-size); height: var(--avatar-size); flex: none;
  display: inline-grid; place-items: center; border-radius: 50%;
  background: linear-gradient(145deg, hsl(var(--avatar-hue) 62% 88%), hsl(calc(var(--avatar-hue) + 18) 58% 78%));
  color: hsl(var(--avatar-hue) 46% 28%);
  font-size: calc(var(--avatar-size) * .4); font-weight: 800; letter-spacing: -.02em;
  border: 1px solid rgba(255, 255, 255, .7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
  user-select: none;
}
img.avatar.avatar-img { object-fit: cover; background: var(--surface-sunken); display: inline-block; vertical-align: middle; }
.auth-sso-lead { font-size: 13.5px; color: var(--on-surface-muted); line-height: 1.85; margin-bottom: 18px; }
.auth-sso-lead strong { color: var(--brand-deep); }
.auth-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--on-surface-muted); }
.auth-links a { display: inline-flex; align-items: center; gap: 4px; }
.auth-links a:hover { color: var(--brand-deep); }
.auth-links .icon { font-size: 13px; }
.passport-card { max-width: 640px; margin: 0 auto; }
.passport-profile { display: flex; align-items: center; gap: 18px; padding-bottom: 18px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.passport-profile h2 { font-size: 22px; display: flex; align-items: center; gap: 8px; }
.passport-profile p { font-size: 13px; color: var(--on-surface-muted); margin-top: 2px; }
.passport-card .meta-list { margin: 0 0 18px; }
.passport-card .btn { margin-top: 16px; }
.role-badge { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; vertical-align: middle; }
.role-admin { background: rgba(217, 160, 63, .18); color: var(--brand-deep); }
.role-mod { background: rgba(94, 140, 63, .14); color: #4C7331; }
.tag {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px;
  border-radius: 999px; background: var(--surface-sunken); color: var(--on-surface-muted);
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.tag .icon { font-size: 12px; }
.tag-pin { background: rgba(217, 160, 63, .18); color: var(--brand-deep); }
.tag-feature { background: rgba(192, 84, 42, .12); color: #A6512A; }
.tag-lock { background: rgba(31, 26, 17, .07); color: var(--on-surface-muted); }
a.tag:hover { background: var(--gold-soft); color: var(--brand-deep); }

/* ---------------- 页头 / 版块头 ---------------- */
.page-head { padding: 46px 0 10px; }
.page-head-inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.page-head h1 { margin-top: 14px; font-size: clamp(28px, 3.2vw, 40px); letter-spacing: -.03em; }
.page-head p { margin-top: 10px; max-width: 640px; color: var(--on-surface-muted); font-size: 15px; }
.page-head-actions { display: flex; gap: 10px; padding-bottom: 6px; }

/* ---------------- 首页 ---------------- */
.hero { padding: 58px 0 26px; position: relative; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .8fr); gap: 56px; align-items: center; }
.hero-copy { animation: riseIn .7s var(--ease) both; }
.hero h1 { margin-top: 20px; font-size: clamp(36px, 4.6vw, 58px); line-height: 1.12; font-weight: 900; letter-spacing: -.035em; }
.hero-lead { margin-top: 20px; max-width: 600px; color: var(--on-surface-muted); font-size: 16px; line-height: 1.85; }
.hero-actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 40px; max-width: 560px; }
.hero-stats > div { padding: 12px 16px; border-left: 1px solid var(--line-strong); }
.hero-stats > div:first-child { border-left: 0; padding-left: 0; }
.hero-stats dt { font-size: 12px; color: var(--on-surface-muted); font-weight: 600; }
.hero-stats dd { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.hero-aside { display: grid; gap: 14px; animation: riseIn .8s .1s var(--ease) both; }
.hero-card {
  padding: 26px 26px 22px; border-radius: var(--radius-lg);
  background: linear-gradient(165deg, #FFFDF7 0%, #FBF1DA 100%);
  border: 1px solid rgba(192, 132, 42, .18); box-shadow: var(--shadow-md);
}
.hero-card-label { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--brand-deep); letter-spacing: .04em; }
.hero-card-label .icon { font-size: 15px; }
.hero-card p { margin: 12px 0 16px; font-size: 14.5px; line-height: 1.8; color: #4A4030; }
.hero-note { display: flex; gap: 12px; padding: 18px 20px; border-radius: var(--radius); background: rgba(255, 253, 247, .6); border: 1px solid var(--line); }
.hero-note > span { color: var(--brand-strong); font-size: 20px; }
.hero-note strong { font-size: 14px; display: block; }
.hero-note p { margin-top: 4px; font-size: 12.8px; color: var(--on-surface-muted); line-height: 1.7; }
@keyframes riseIn { from { transform: translateY(18px); } to { transform: none; } }

.section { padding: 64px 0; }
.section-tight { padding: 22px 0 72px; }
.home-section { padding-top: 30px; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 316px; gap: 36px; align-items: start; }
.home-feed { min-width: 0; }
.feed-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.feed-head.compact { align-items: center; margin-bottom: 14px; }
.feed-title { margin-top: 10px; font-size: 26px; letter-spacing: -.03em; }
.feed-count { font-size: 12.5px; color: var(--on-surface-muted); }
.segmented { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: rgba(31, 26, 17, .05); }
.segmented a { padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--on-surface-muted); transition: background-color .2s ease, color .2s ease; }
.segmented a:hover { color: var(--on-surface); }
.segmented a.is-active { background: var(--surface-raised); color: var(--brand-deep); box-shadow: var(--shadow-sm); }

.topic-list { display: grid; border-radius: var(--radius-lg); background: rgba(255, 253, 247, .68); border: 1px solid var(--line); overflow: hidden; box-shadow: var(--shadow-sm); }
.topic-row {
  display: grid; grid-template-columns: 42px minmax(0, 1fr) auto 92px; gap: 14px; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--line); position: relative;
  transition: background-color .2s ease;
}
.topic-row:last-child { border-bottom: 0; }
.topic-row:hover { background: rgba(255, 255, 255, .72); }
.topic-avatar { display: block; }
.topic-main { min-width: 0; display: grid; gap: 5px; }
.topic-title-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.topic-title { font-size: 15.5px; font-weight: 700; color: var(--on-surface); letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.topic-title:hover { color: var(--brand-deep); }
.topic-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--on-surface-muted); }
.topic-cat { --cat-color: var(--brand); display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--cat-color) 14%, transparent); color: color-mix(in srgb, var(--cat-color) 72%, #3A2C12); font-weight: 600; font-size: 11.5px; }
.topic-cat::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--cat-color); }
.topic-stats { display: flex; gap: 10px; }
.topic-stats .stat { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--on-surface-muted); font-variant-numeric: tabular-nums; }
.topic-stats .stat .icon { font-size: 13.5px; }
.topic-last { text-align: right; font-size: 11.5px; color: var(--on-surface-muted); line-height: 1.45; }
.topic-last span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-last time { display: block; color: rgba(110, 100, 85, .8); }

/* 侧栏 */
.side { display: grid; gap: 16px; position: sticky; top: 92px; }
.side-card { padding: 20px 20px 18px; border-radius: var(--radius); background: rgba(255, 253, 247, .78); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.side-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; letter-spacing: .02em; color: var(--on-surface); margin-bottom: 14px; }
.side-title .icon { font-size: 16px; color: var(--brand-strong); }
.side-text { font-size: 13px; color: var(--on-surface-muted); line-height: 1.8; }
.side-cat-list { display: grid; gap: 2px; margin: -4px -6px; }
.side-cat-list a { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 10px; font-size: 13.5px; }
.side-cat-list a:hover { background: var(--surface-sunken); }
.side-cat-icon { --cat-color: var(--brand); width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--cat-color) 14%, transparent); color: var(--cat-color); font-size: 14px; }
.side-cat-list em { margin-left: auto; font-style: normal; font-size: 11.5px; color: var(--on-surface-muted); }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 10px; }
.stat-grid.two { grid-template-columns: repeat(2, 1fr); }
.stat-grid div { padding: 10px 12px; border-radius: 12px; background: rgba(242, 232, 211, .55); }
.stat-grid dt { font-size: 11.5px; color: var(--on-surface-muted); }
.stat-grid dd { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.stat-grid dd.small { font-size: 13px; font-weight: 700; }
.user-list { display: grid; gap: 4px; margin: -4px; }
.user-list a { display: flex; align-items: center; gap: 10px; padding: 7px; border-radius: 12px; }
.user-list a:hover { background: var(--surface-sunken); }
.user-list strong { display: block; font-size: 13.2px; }
.user-list em { display: block; font-style: normal; font-size: 11px; color: var(--on-surface-muted); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-cloud .tag { height: 26px; }
.tag-cloud em { font-style: normal; opacity: .55; margin-left: 3px; }
.related-list { display: grid; gap: 10px; }
.related-list a { font-size: 13.2px; font-weight: 600; display: block; line-height: 1.5; }
.related-list a:hover { color: var(--brand-deep); }
.related-list span { font-size: 11px; color: var(--on-surface-muted); }
.author-card { display: grid; justify-items: center; gap: 6px; text-align: center; }
.author-card strong { margin-top: 4px; font-size: 14px; }
.author-card > span { font-size: 12px; color: var(--on-surface-muted); }
.author-card .btn { margin-top: 10px; }
.meta-list { display: grid; gap: 10px; margin-top: 14px; }
.meta-list li { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; }
.meta-list span { color: var(--on-surface-muted); }
.meta-list strong { font-weight: 600; text-align: right; }
.meta-list.wide { gap: 14px; }
.meta-list.wide li { font-size: 13.5px; }
.tips-list { display: grid; gap: 10px; counter-reset: tips; }
.tips-list li { position: relative; padding-left: 30px; font-size: 12.8px; color: var(--on-surface-muted); line-height: 1.75; }
.tips-list li::before { counter-increment: tips; content: counter(tips); position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%; background: var(--gold-soft); color: var(--brand-deep); font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.tips-list strong { color: var(--on-surface); }

/* ---------------- 版块 ---------------- */
.category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.category-card {
  display: flex; gap: 18px; padding: 24px; border-radius: var(--radius-lg);
  background: rgba(255, 253, 247, .8); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s ease;
}
.category-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: rgba(192, 132, 42, .32); }
.category-icon { --cat-color: var(--brand); width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; background: color-mix(in srgb, var(--cat-color) 15%, transparent); color: color-mix(in srgb, var(--cat-color) 82%, #4A3810); font-size: 23px; flex: none; }
.category-main { min-width: 0; }
.category-main h2 { font-size: 17.5px; letter-spacing: -.02em; }
.category-main p { margin-top: 7px; font-size: 13.2px; color: var(--on-surface-muted); line-height: 1.7; }
.category-meta { display: block; margin-top: 12px; font-size: 11.5px; font-weight: 600; color: rgba(110, 100, 85, .9); }
.category-go { margin-left: auto; align-self: center; color: var(--brand-deep); }
.category-go .icon { font-size: 19px; transition: transform .3s var(--ease); }
.category-card:hover .category-go .icon { transform: translateX(4px); }
.category-foot { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 26px; }
.mini-stat { padding: 18px 20px; border-radius: var(--radius); background: rgba(242, 232, 211, .5); border: 1px solid var(--line); text-align: center; }
.mini-stat strong { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.mini-stat span { font-size: 12px; color: var(--on-surface-muted); }

.category-hero { padding: 44px 0 34px; background: linear-gradient(180deg, rgba(246, 231, 196, .55) 0%, rgba(250, 246, 235, 0) 100%); border-bottom: 1px solid var(--line); }
.category-hero-inner { display: flex; align-items: center; gap: 24px; }
.category-hero-icon { --cat-color: var(--brand); width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: color-mix(in srgb, var(--cat-color) 16%, transparent); color: color-mix(in srgb, var(--cat-color) 80%, #4A3810); font-size: 30px; flex: none; }
.category-hero-copy { flex: 1; min-width: 0; }
.category-hero h1 { margin-top: 10px; font-size: clamp(26px, 3vw, 36px); letter-spacing: -.03em; }
.category-hero p { margin-top: 8px; color: var(--on-surface-muted); font-size: 14.5px; }
.category-hero-meta { display: flex; gap: 16px; margin-top: 12px; font-size: 12px; color: var(--on-surface-muted); }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--on-surface-muted); }
.crumbs a:hover { color: var(--brand-deep); }

/* ---------------- 主题详情 ---------------- */
.topic-crumbs { padding-top: 26px; }
.topic-layout { display: grid; grid-template-columns: minmax(0, 1fr) 316px; gap: 36px; align-items: start; margin-top: 14px; }
.topic-main-col { min-width: 0; }
.topic-detail { background: rgba(255, 253, 247, .82); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.topic-header { padding: 30px 34px 24px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, rgba(246, 231, 196, .4), rgba(255, 253, 247, 0)); }
.topic-badges { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
.topic-header h1 { font-size: clamp(24px, 2.6vw, 32px); line-height: 1.34; letter-spacing: -.025em; }
.topic-byline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; font-size: 12.5px; color: var(--on-surface-muted); }
.topic-byline a { color: var(--on-surface); font-weight: 600; }

.post { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 22px; padding: 26px 34px; border-bottom: 1px solid var(--line); }
.post-author { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.post-author-name { font-size: 13.5px; font-weight: 700; margin-top: 4px; word-break: break-all; }
.post-author-joined { font-size: 10.5px; color: var(--on-surface-muted); background: var(--surface-sunken); padding: 1px 8px; border-radius: 999px; }
.post-body { min-width: 0; }
.post-meta { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--on-surface-muted); margin-bottom: 12px; }
.post-floor { font-weight: 800; color: var(--brand-strong); }
.post-edited { padding: 0 6px; border-radius: 6px; background: var(--surface-sunken); }
.post-meta a { color: var(--brand-deep); }
.post-actions { display: flex; gap: 4px; margin-top: 18px; flex-wrap: wrap; }
.action-btn { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; border-radius: 8px; font-size: 12px; color: var(--on-surface-muted); transition: background-color .2s ease, color .2s ease; }
.action-btn:hover { background: var(--surface-sunken); color: var(--on-surface); }
.action-btn .icon { font-size: 15px; }
.action-btn.is-liked { color: var(--danger); background: rgba(196, 69, 59, .08); }
.action-btn.danger:hover { color: var(--danger); background: rgba(196, 69, 59, .1); }
.replies-head { display: flex; align-items: center; justify-content: space-between; padding: 24px 34px 0; }
.replies-head h2 { font-size: 18px; }
.replies-head h2 span { color: var(--brand-strong); font-size: 14px; margin-left: 4px; }
.replies-order { font-size: 11.5px; color: var(--on-surface-muted); }
.post-list { padding: 0; }
.empty-replies { padding: 36px; text-align: center; color: var(--on-surface-muted); font-size: 13.5px; }
.reply-box { padding: 26px 34px 32px; background: rgba(242, 232, 211, .28); border-top: 1px solid var(--line); }
.reply-box-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.reply-box-head h2 { font-size: 18px; }
.reply-box-head span { font-size: 12px; color: var(--on-surface-muted); }
.reply-locked { display: flex; align-items: center; gap: 10px; padding: 24px 34px; color: var(--on-surface-muted); font-size: 13.5px; border-top: 1px solid var(--line); }
.login-cta { display: flex; align-items: center; gap: 18px; padding: 26px 34px; border-top: 1px solid var(--line); background: rgba(242, 232, 211, .3); flex-wrap: wrap; }
.login-cta > .icon { font-size: 30px; color: var(--brand-strong); }
.login-cta strong { display: block; font-size: 15px; }
.login-cta p { font-size: 13px; color: var(--on-surface-muted); }
.login-cta .btn { margin-left: auto; }
.mod-bar { display: flex; align-items: center; gap: 8px; padding: 16px 34px; border-top: 1px dashed var(--line-strong); background: rgba(31, 26, 17, .025); flex-wrap: wrap; }
.mod-bar > span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--on-surface-muted); margin-right: 4px; }
.mod-bar form { margin: 0; }

/* 正文排版 */
.prose { font-size: 15px; line-height: 1.9; color: #2C251B; overflow-wrap: break-word; }
.prose > *:first-child { margin-top: 0; }
.prose > *:last-child { margin-bottom: 0; }
.prose p { margin: 0 0 14px; }
.prose h2 { font-size: 21px; margin: 26px 0 12px; }
.prose h3 { font-size: 18px; margin: 22px 0 10px; }
.prose h4 { font-size: 16px; margin: 18px 0 8px; }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 22px; }
.prose ul li { list-style: disc; margin: 4px 0; }
.prose ol li { list-style: decimal; margin: 4px 0; }
.prose blockquote { margin: 14px 0; padding: 12px 16px; border-left: 3px solid var(--brand); background: rgba(246, 231, 196, .45); border-radius: 0 12px 12px 0; color: #4A4030; }
.prose code { background: rgba(31, 26, 17, .06); padding: 2px 6px; border-radius: 6px; font-size: .9em; color: #7E5410; }
.prose pre.code-block { margin: 16px 0; padding: 16px 18px; border-radius: 14px; background: #241E17; color: #F3EAD8; overflow-x: auto; font-size: 13px; line-height: 1.7; }
.prose pre.code-block code { background: none; padding: 0; color: inherit; }
.prose img { display: block; margin: 16px 0; border-radius: 14px; border: 1px solid var(--line); max-height: 640px; object-fit: contain; }
.prose a { color: var(--brand-deep); text-decoration: underline; text-decoration-color: rgba(192, 132, 42, .35); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--brand-strong); }
.prose hr { border: 0; border-top: 1px solid var(--line-strong); margin: 24px 0; }
.prose .mention { color: var(--brand-deep); font-weight: 600; text-decoration: none; background: rgba(217, 160, 63, .12); padding: 1px 5px; border-radius: 6px; }
.prose del { color: var(--on-surface-muted); }

/* 编辑器 */
.editor-form { display: grid; gap: 0; }
.editor-toolbar, .editor-tools { display: flex; gap: 2px; align-items: center; }
.editor-toolbar { padding: 6px 8px; border: 1px solid var(--line-strong); border-bottom: 0; border-radius: 14px 14px 0 0; background: rgba(242, 232, 211, .55); }
.tool-btn { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--on-surface-muted); font-size: 15px; }
.tool-btn:hover { background: var(--surface-raised); color: var(--brand-deep); }
.tool-btn .icon { font-size: 16px; }
.tool-btn.js-preview { width: auto; padding: 0 10px; display: inline-flex; gap: 5px; font-size: 12px; margin-left: auto; }
.editor-input {
  display: block; width: 100%; padding: 14px 16px; border: 1px solid var(--line-strong);
  border-radius: 14px; background: rgba(255, 253, 247, .85); resize: vertical; min-height: 120px;
  font-size: 14.5px; line-height: 1.8; transition: border-color .2s ease, box-shadow .2s ease;
}
.editor-toolbar + .editor-input { border-radius: 0 0 14px 14px; }
.editor-input:focus { outline: none; border-color: rgba(192, 132, 42, .5); box-shadow: 0 0 0 4px rgba(217, 160, 63, .1); background: #fff; }
.editor-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.editor-preview { margin-top: 14px; padding: 18px; border-radius: 14px; border: 1px dashed var(--line-strong); background: rgba(255, 253, 247, .7); }

/* 分页 */
.pagination { display: flex; align-items: center; gap: 4px; margin-top: 22px; flex-wrap: wrap; }
.page-btn { min-width: 36px; height: 36px; padding: 0 10px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: var(--on-surface-muted); border: 1px solid transparent; }
.page-btn:hover { background: var(--surface-raised); border-color: var(--line); color: var(--on-surface); }
.page-btn[aria-current="page"] { background: var(--on-surface); color: #FFFDF7; }
.page-btn .icon { font-size: 15px; }
.page-gap { padding: 0 4px; color: var(--on-surface-muted); }

/* 空状态 / 提示 */
.empty-state { padding: 56px 24px; text-align: center; display: grid; justify-items: center; gap: 8px; }
.empty-icon { width: 56px; height: 56px; border-radius: 18px; background: var(--gold-soft); color: var(--brand-deep); display: grid; place-items: center; font-size: 26px; }
.empty-state h3 { font-size: 16px; margin-top: 6px; }
.empty-state p { font-size: 13px; color: var(--on-surface-muted); }
.empty-state .btn { margin-top: 10px; }
.flash { display: flex; align-items: center; gap: 9px; padding: 12px 16px; border-radius: 14px; font-size: 13.5px; margin-bottom: 16px; border: 1px solid transparent; }
.flash .icon { font-size: 17px; flex: none; }
.flash-ok { background: rgba(94, 140, 63, .1); border-color: rgba(94, 140, 63, .22); color: #44662C; }
.flash-err { background: rgba(196, 69, 59, .08); border-color: rgba(196, 69, 59, .2); color: #9B332B; }

/* ---------------- 发帖 ---------------- */
.compose-layout { display: grid; grid-template-columns: minmax(0, 1fr) 316px; gap: 36px; align-items: start; }
.compose-card { padding: 30px 32px 26px; background: rgba(255, 253, 247, .84); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.field { display: grid; gap: 7px; margin-bottom: 20px; }
.field label { font-size: 13px; font-weight: 700; letter-spacing: .01em; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: 12px;
  background: rgba(255, 253, 247, .9); font-size: 14px; transition: border-color .2s ease, box-shadow .2s ease;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: rgba(192, 132, 42, .5); box-shadow: 0 0 0 4px rgba(217, 160, 63, .1); background: #fff; }
.field input:disabled { color: var(--on-surface-muted); background: var(--surface-sunken); }
.field textarea { resize: vertical; line-height: 1.75; }
.field-hint { font-size: 11.5px; color: var(--on-surface-muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 12.8px; color: var(--on-surface-muted); line-height: 1.6; }
.check input { width: 15px; height: 15px; margin-top: 3px; accent-color: var(--brand-strong); }
.check a { color: var(--brand-deep); text-decoration: underline; }
.compose-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 6px; flex-wrap: wrap; }

/* ---------------- 登录注册 ---------------- */
.auth-section { padding: 54px 0 76px; }
.auth-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 64px; align-items: center; }
.auth-brand h1 { margin-top: 18px; font-size: clamp(32px, 3.8vw, 46px); letter-spacing: -.03em; }
.auth-brand > p { margin-top: 16px; max-width: 460px; color: var(--on-surface-muted); font-size: 15px; line-height: 1.85; }
.auth-points { display: grid; gap: 10px; margin-top: 24px; }
.auth-points li { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: #4A4030; }
.auth-points .icon { color: var(--brand-strong); font-size: 16px; }
.auth-illustration { position: relative; height: 190px; margin-top: 32px; border-radius: var(--radius-lg); overflow: hidden; background: linear-gradient(155deg, #FBF1DA, #F6E7C4); border: 1px solid rgba(192, 132, 42, .18); }
.auth-quote { position: absolute; left: 30px; bottom: 26px; font-size: 19px; font-weight: 800; line-height: 1.55; color: #6B4B14; letter-spacing: -.02em; }
.blob { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .8; }
.blob-a { width: 130px; height: 130px; right: -20px; top: -34px; background: radial-gradient(circle at 30% 30%, #FFFDF7, rgba(217, 160, 63, .35)); }
.blob-b { width: 70px; height: 70px; right: 84px; top: 52px; background: radial-gradient(circle at 30% 30%, #FFFDF7, rgba(192, 132, 42, .3)); }
.blob-c { width: 46px; height: 46px; right: 26px; bottom: 28px; background: radial-gradient(circle at 30% 30%, #FFFDF7, rgba(180, 140, 60, .28)); }
.auth-card { padding: 32px; border-radius: var(--radius-lg); background: var(--surface-raised); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.auth-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.auth-card-head h2 { font-size: 22px; }
.auth-card-head span { font-size: 12.5px; color: var(--on-surface-muted); }
.auth-card-head a { color: var(--brand-deep); font-weight: 700; }
.btn-passport {
  background: #1F1A11; border-color: #1F1A11; color: #FFFDF7;
  box-shadow: 0 12px 24px -16px rgba(31, 26, 17, .7);
}
.btn-passport:hover { background: #2C251B; border-color: #2C251B; transform: translateY(-2px); }
.btn-passport .icon { font-size: 18px; color: var(--brand); }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0 16px; color: var(--on-surface-muted); font-size: 11.5px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.auth-form .field { margin-bottom: 16px; }
.auth-form .check { margin: 4px 0 18px; }
.auth-foot { margin-top: 16px; font-size: 11.5px; color: var(--on-surface-muted); text-align: center; line-height: 1.7; }

/* ---------------- 个人主页 ---------------- */
.profile-hero { padding: 48px 0 0; background: linear-gradient(180deg, rgba(246, 231, 196, .6), rgba(250, 246, 235, 0)); border-bottom: 1px solid var(--line); }
.profile-hero-inner { display: flex; align-items: center; gap: 22px; }
.profile-avatar .avatar { width: 84px; height: 84px; border: 3px solid rgba(255, 255, 255, .8); box-shadow: var(--shadow-md); }
.profile-main { flex: 1; min-width: 0; }
.profile-name { display: flex; align-items: center; gap: 10px; font-size: 26px; font-weight: 800; letter-spacing: -.025em; }
.profile-handle { margin-top: 4px; font-size: 12.5px; color: var(--on-surface-muted); }
.profile-bio { margin-top: 10px; font-size: 13.5px; color: #4A4030; max-width: 620px; }
.profile-actions { align-self: flex-start; }
.profile-stats { display: flex; gap: 34px; padding: 22px 0 20px; }
.profile-stats div { display: flex; align-items: baseline; gap: 7px; }
.profile-stats strong { font-size: 22px; }
.profile-stats span { font-size: 12px; color: var(--on-surface-muted); }
.profile-body { display: grid; grid-template-columns: minmax(0, 1fr) 316px; gap: 36px; align-items: start; }
.profile-tabs { margin-bottom: 16px; }
.reply-list { display: grid; gap: 10px; }
.reply-list li { padding: 18px 20px; border-radius: var(--radius); background: rgba(255, 253, 247, .8); border: 1px solid var(--line); }
.reply-list a { font-weight: 700; font-size: 14.5px; }
.reply-list a:hover { color: var(--brand-deep); }
.reply-list .excerpt { margin-top: 6px; font-size: 13px; color: var(--on-surface-muted); max-height: 80px; overflow: hidden; }
.reply-list time { display: block; margin-top: 8px; font-size: 11px; color: rgba(110, 100, 85, .85); }

/* ---------------- 设置 / 通知 / 搜索 ---------------- */
.settings-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.settings-card { padding: 28px 30px; border-radius: var(--radius-lg); background: rgba(255, 253, 247, .84); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.settings-card h2 { font-size: 19px; margin-bottom: 20px; }
.settings-card .btn { margin-top: 4px; }

.notif-list { display: grid; gap: 8px; }
.notif-item { display: flex; gap: 14px; padding: 16px 18px; border-radius: 16px; background: rgba(255, 253, 247, .8); border: 1px solid var(--line); position: relative; align-items: flex-start; }
.notif-item.is-unread { background: rgba(246, 231, 196, .42); border-color: rgba(192, 132, 42, .25); }
.notif-system { width: 38px; height: 38px; border-radius: 50%; background: var(--gold-soft); color: var(--brand-deep); display: grid; place-items: center; font-size: 18px; flex: none; }
.notif-main { flex: 1; min-width: 0; font-size: 13.5px; }
.notif-main strong { font-weight: 700; }
.notif-excerpt { margin-top: 4px; color: var(--on-surface-muted); font-size: 12.8px; }
.notif-meta { display: flex; gap: 12px; margin-top: 6px; font-size: 11.5px; color: var(--on-surface-muted); }
.notif-meta a { color: var(--brand-deep); }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); margin-top: 8px; flex: none; }

.search-layout { display: grid; grid-template-columns: minmax(0, 1fr) 316px; gap: 36px; align-items: start; }
.search-main { min-width: 0; }
.search-big { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 18px; margin-bottom: 20px; border-radius: 999px; background: var(--surface-raised); border: 1px solid var(--line-strong); box-shadow: var(--shadow-sm); }
.search-big > .icon { font-size: 19px; color: var(--on-surface-muted); }
.search-big input { flex: 1; border: 0; background: none; height: 40px; font-size: 15px; }
.search-big input:focus { outline: none; }

/* ---------------- 法务 / 错误 ---------------- */
.legal-card { padding: 36px 40px; border-radius: var(--radius-lg); background: rgba(255, 253, 247, .84); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.legal-card h2 { font-size: 20px; margin: 28px 0 10px; }
.legal-card h2:first-child { margin-top: 0; }
.legal-lead { font-size: 15px; color: #4A4030; }
.legal-card p { margin: 0 0 12px; }
.legal-card ul { margin: 0 0 14px; padding-left: 22px; }
.legal-card li { list-style: disc; margin: 5px 0; }
.legal-card a { color: var(--brand-deep); text-decoration: underline; }
.error-section { padding: 90px 0 110px; }
.error-inner { text-align: center; display: grid; justify-items: center; gap: 10px; }
.error-code { font-size: 96px; font-weight: 900; line-height: 1; letter-spacing: -.05em; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-inner h1 { font-size: 26px; }
.error-inner p { color: var(--on-surface-muted); font-size: 14px; }
.error-actions { display: flex; gap: 10px; margin-top: 14px; }

/* ---------------- 管理后台 ---------------- */
.admin-hero { padding: 42px 0 24px; background: linear-gradient(180deg, rgba(246, 231, 196, .55), rgba(250, 246, 235, 0)); border-bottom: 1px solid var(--line); }
.admin-hero-inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.admin-hero h1 { margin-top: 12px; font-size: clamp(26px, 3vw, 36px); }
.admin-hero p { margin-top: 8px; color: var(--on-surface-muted); font-size: 14px; }
.admin-layout { display: grid; grid-template-columns: 208px minmax(0, 1fr); gap: 28px; align-items: start; }
.admin-nav { display: grid; gap: 4px; padding: 10px; border-radius: var(--radius); background: rgba(255, 253, 247, .8); border: 1px solid var(--line); position: sticky; top: 92px; }
.admin-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--on-surface-muted); }
.admin-nav a:hover { background: var(--surface-sunken); color: var(--on-surface); }
.admin-nav a.is-active { background: var(--on-surface); color: #FFFDF7; }
.admin-nav .icon { font-size: 16px; }
.admin-back { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 14px !important; color: var(--brand-deep) !important; }
.admin-main { min-width: 0; display: grid; gap: 18px; }
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.admin-stat { padding: 18px 20px; border-radius: var(--radius); background: rgba(255, 253, 247, .82); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.admin-stat span { font-size: 12px; color: var(--on-surface-muted); }
.admin-stat strong { display: block; font-size: 26px; letter-spacing: -.02em; margin: 2px 0; }
.admin-stat em { font-style: normal; font-size: 11px; color: rgba(110, 100, 85, .85); }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.admin-card { padding: 22px 24px; border-radius: var(--radius); background: rgba(255, 253, 247, .82); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.admin-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.admin-card-head h2 { font-size: 16px; }
.admin-card-head a, .admin-card-head span { font-size: 12px; color: var(--on-surface-muted); }
.admin-card-head a:hover { color: var(--brand-deep); }
.admin-list { display: grid; gap: 8px; }
.admin-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.admin-list li:last-child { border-bottom: 0; }
.admin-list-main { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.admin-list-main em { font-style: normal; font-size: 11.5px; color: var(--on-surface-muted); }
.admin-list-side { font-size: 11.5px; color: var(--on-surface-muted); flex: none; }
.admin-empty { font-size: 13px; color: var(--on-surface-muted); padding: 8px 0; }
.admin-table-wrap { overflow-x: auto; margin: 0 -8px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th { text-align: left; font-size: 11.5px; font-weight: 700; color: var(--on-surface-muted); padding: 8px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.admin-table td { padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table td em { display: block; font-style: normal; font-size: 11px; color: var(--on-surface-muted); }
.admin-table td code { font-size: 12px; background: var(--surface-sunken); padding: 1px 6px; border-radius: 6px; }
.admin-row-actions { display: flex; gap: 8px; align-items: center; }
.link-danger { color: var(--danger); font-size: 12.5px; }
.link-btn { color: var(--brand-deep); font-size: 12.5px; }
.cat-dot { --cat-color: var(--brand); display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: color-mix(in srgb, var(--cat-color) 16%, transparent); color: var(--cat-color); margin-right: 8px; font-size: 13px; vertical-align: middle; }
.admin-search { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 16px; background: var(--surface-raised); border: 1px solid var(--line-strong); border-radius: 999px; }
.admin-search .icon { color: var(--on-surface-muted); }
.admin-search input { flex: 1; border: 0; background: none; height: 36px; }
.admin-search input:focus { outline: none; }
.admin-form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 14px; align-items: end; }
.admin-form-grid label { display: grid; gap: 5px; font-size: 12px; font-weight: 600; color: var(--on-surface-muted); }
.admin-form-grid input, .admin-form-grid select { padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; font-size: 13px; }
.admin-form-grid .wide { grid-column: span 2; }
.admin-form { display: grid; gap: 14px; }
.admin-form label { display: grid; gap: 6px; font-size: 12.5px; font-weight: 600; }
.admin-form textarea { padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 12px; resize: vertical; }
.inline-form { margin: 0; }
.inline-form select { padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; font-size: 12px; }
.status-pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.status-pill.ok { background: rgba(94, 140, 63, .12); color: #4C7331; }
.status-pill.warn { background: rgba(196, 69, 59, .1); color: #9B332B; }
.report-list { display: grid; gap: 12px; }
.report-item { padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 253, 247, .7); }
.report-head { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--on-surface-muted); flex-wrap: wrap; }
.report-head strong { font-size: 13.5px; color: var(--on-surface); }
.report-body { margin-top: 8px; font-size: 13px; }
.report-topic a { color: var(--brand-deep); font-weight: 600; }
.report-detail { margin-top: 6px; color: var(--on-surface-muted); font-size: 12.5px; }
.report-quote { margin: 8px 0 0; padding: 10px 14px; border-left: 3px solid var(--line-strong); background: var(--surface-sunken); border-radius: 0 10px 10px 0; font-size: 12.5px; color: #4A4030; }
.report-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.report-actions form { margin: 0; }

/* ---------------- 页尾 ---------------- */
.site-footer { background: #1D1912; color: rgba(247, 241, 226, .72); padding: 56px 0 28px; margin-top: 40px; }
.footer-top { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.8fr); gap: 48px; padding-bottom: 38px; border-bottom: 1px solid rgba(247, 241, 226, .12); }
.footer-brand-row { display: flex; align-items: center; gap: 12px; }
.footer-brand-row img { width: 42px; height: 42px; object-fit: contain; }
.footer-brand-name { font-size: 16.5px; font-weight: 800; color: #FBF3E1; line-height: 1.3; }
.footer-brand-en { font-size: 10.5px; font-weight: 700; letter-spacing: .18em; color: var(--brand); text-transform: uppercase; }
.footer-tagline { margin-top: 16px; font-size: 13px; max-width: 320px; line-height: 1.8; }
.footer-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.footer-cols h3 { font-size: 13px; font-weight: 800; color: #FBF3E1; letter-spacing: .04em; margin-bottom: 14px; }
.footer-cols li + li { margin-top: 9px; }
.footer-cols a, .footer-cols span { font-size: 13px; transition: color .2s ease; }
.footer-cols a:hover { color: var(--brand); }
.footer-legal { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 26px; padding-top: 24px; font-size: 12.5px; color: rgba(247, 241, 226, .55); }
.footer-copy { color: rgba(247, 241, 226, .72); }
.legal-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.legal-links li { display: inline-flex; align-items: center; gap: 6px; }
.legal-links a { transition: color .2s ease; }
.legal-links a:hover { color: var(--brand); }

/* ---------------- Toast / Modal ---------------- */
.toast-root { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 120; display: grid; gap: 8px; pointer-events: none; }
.toast { padding: 11px 18px; border-radius: 999px; background: rgba(31, 26, 17, .92); color: #FFFDF7; font-size: 13px; box-shadow: var(--shadow-lg); animation: toastIn .25s var(--ease); }
.toast.is-err { background: rgba(155, 51, 43, .95); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.modal-root { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; padding: 24px; background: rgba(31, 26, 17, .42); backdrop-filter: blur(3px); }
.modal-root[hidden] { display: none; }
.modal-card { width: min(560px, 100%); max-height: 86vh; overflow-y: auto; padding: 24px 26px; border-radius: var(--radius-lg); background: var(--surface-raised); box-shadow: var(--shadow-lg); }
.modal-card h3 { font-size: 18px; margin-bottom: 6px; }
.modal-card p { font-size: 13px; color: var(--on-surface-muted); margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.modal-card label { display: grid; gap: 6px; font-size: 12.5px; font-weight: 600; margin-top: 12px; }
.modal-card textarea, .modal-card input { width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; font-size: 13.5px; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: 1fr; gap: 34px; }
  .hero-aside { grid-template-columns: 1fr 1fr; }
  .home-grid, .topic-layout, .compose-layout, .profile-body, .search-layout { grid-template-columns: 1fr; }
  .side { position: static; grid-template-columns: 1fr 1fr; }
  .side-card { break-inside: avoid; }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .nav-search { margin-left: auto; width: min(300px, 34vw); }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-nav { position: static; grid-template-columns: repeat(5, auto); overflow-x: auto; }
  .admin-back { display: none !important; }
  .admin-stats, .admin-grid { grid-template-columns: 1fr 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .container { padding: 0 20px; }
  .nav-search { display: none; }
  .hero { padding-top: 40px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .hero-stats > div:nth-child(3) { border-left: 0; padding-left: 0; }
  .hero-aside { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: 1fr; }
  .category-foot { grid-template-columns: repeat(2, 1fr); }
  .auth-grid { grid-template-columns: 1fr; gap: 34px; }
  .auth-illustration { display: none; }
  .post { grid-template-columns: 1fr; gap: 14px; padding: 22px 22px; }
  .post-author { flex-direction: row; text-align: left; gap: 10px; align-items: center; }
  .post-author-name { margin-top: 0; }
  .topic-header, .reply-box, .login-cta, .mod-bar { padding-left: 22px; padding-right: 22px; }
  .replies-head { padding-left: 22px; padding-right: 22px; }
  .topic-row { grid-template-columns: 38px minmax(0, 1fr) auto; padding: 14px 16px; }
  .topic-last { display: none; }
  .footer-top { grid-template-columns: 1fr; gap: 30px; }
  .footer-cols { gap: 18px; }
  .admin-form-grid { grid-template-columns: 1fr 1fr; }
  .admin-form-grid .wide { grid-column: span 2; }
  .profile-hero-inner { flex-wrap: wrap; }
  .profile-actions { width: 100%; }
  .legal-card { padding: 26px 22px; }
}
@media (max-width: 620px) {
  body { font-size: 14.5px; }
  .nav { height: 64px; gap: 10px; }
  .brand-name { font-size: 15.5px; }
  .brand-sub { font-size: 8.5px; }
  .brand img { width: 32px; height: 32px; }
  .hero h1 { font-size: 34px; }
  .hero-actions .btn { flex: 1; }
  .hero-stats dd { font-size: 20px; }
  .side { grid-template-columns: 1fr; }
  .topic-row { grid-template-columns: minmax(0, 1fr) auto; }
  .topic-avatar { display: none; }
  .topic-stats { gap: 6px; }
  .topic-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .page-head { padding-top: 30px; }
  .page-head-actions { width: 100%; }
  .section { padding: 40px 0; }
  .section-tight { padding-bottom: 48px; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .footer-legal { flex-direction: column; align-items: flex-start; }
  .auth-card { padding: 24px 20px; }
  .compose-card, .settings-card { padding: 22px 20px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .category-hero-inner { flex-wrap: wrap; }
  .category-hero .btn { width: 100%; }
  .admin-stats, .admin-grid, .admin-form-grid { grid-template-columns: 1fr; }
  .admin-form-grid .wide { grid-column: span 1; }
  .profile-stats { gap: 20px; }
  .post-meta { flex-wrap: wrap; }
  .topic-badges { gap: 5px; }
  .error-code { font-size: 72px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---------------- 板块 / 子分类 / 内容类型 ---------------- */
.kind-chip {
  display: inline-flex; align-items: center; height: 21px; padding: 0 8px; border-radius: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; flex: none;
}
.kind-article { background: rgba(192, 132, 42, .14); color: #7E5410; }
.kind-tutorial { background: rgba(94, 140, 63, .15); color: #4C7331; }
.kind-discussion { background: rgba(110, 140, 160, .16); color: #46627A; }
.topic-sub {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--on-surface-muted); font-size: 11.5px; font-weight: 600;
}
.topic-sub:hover { border-color: rgba(192, 132, 42, .4); color: var(--brand-deep); }
.topic-title-line .kind-chip { margin-right: 2px; }

.section-showcase { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.section-block {
  padding: 22px 24px; border-radius: var(--radius-lg); background: rgba(255, 253, 247, .82);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.section-block:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.section-block-head { display: flex; align-items: center; gap: 14px; }
.section-icon {
  --cat-color: var(--brand); width: 46px; height: 46px; border-radius: 14px; flex: none;
  display: grid; place-items: center; background: color-mix(in srgb, var(--cat-color) 15%, transparent);
  color: color-mix(in srgb, var(--cat-color) 82%, #4A3810); font-size: 22px;
}
.section-block-title { flex: 1; min-width: 0; }
.section-block-title h3 { font-size: 18px; letter-spacing: -.02em; }
.section-block-title p { margin-top: 4px; font-size: 12.5px; color: var(--on-surface-muted); line-height: 1.6; }
.section-block-head > em { font-style: normal; font-size: 11.5px; color: var(--on-surface-muted); flex: none; }
.section-subs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.section-subs a {
  display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 11px;
  border-radius: 999px; background: var(--surface-sunken); color: #5D5344; font-size: 12px; font-weight: 600;
  transition: background-color .2s ease, color .2s ease;
}
.section-subs a:hover { background: var(--gold-soft); color: var(--brand-deep); }
.section-subs em { font-style: normal; font-size: 10.5px; opacity: .6; }

.section-grid { display: grid; gap: 14px; }
.section-card { padding: 22px 24px; border-radius: var(--radius); background: rgba(255, 253, 247, .82); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.section-head { display: flex; align-items: center; gap: 16px; }
.section-title-wrap { flex: 1; min-width: 0; }
.section-title-wrap h2 { font-size: 19px; letter-spacing: -.02em; }
.section-title-wrap p { margin-top: 5px; font-size: 13px; color: var(--on-surface-muted); }
.section-count { font-size: 12px; color: var(--on-surface-muted); flex: none; }
.section-card .section-subs { margin-top: 14px; }

.kind-tabs { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: rgba(31, 26, 17, .05); margin-bottom: 12px; flex-wrap: wrap; }
.kind-tabs a { padding: 7px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--on-surface-muted); }
.kind-tabs a:hover { color: var(--on-surface); }
.kind-tabs a.is-active { background: var(--surface-raised); color: var(--brand-deep); box-shadow: var(--shadow-sm); }
.sub-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.sub-chips a { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 253, 247, .7); font-size: 12px; font-weight: 600; color: var(--on-surface-muted); }
.sub-chips a:hover { border-color: rgba(192, 132, 42, .35); color: var(--brand-deep); }
.sub-chips a.is-active { background: var(--on-surface); border-color: var(--on-surface); color: #FFFDF7; }
.sub-chips em { font-style: normal; font-size: 10.5px; opacity: .65; }
.small-tabs a { padding: 5px 11px; font-size: 12px; }
.kind-legend { display: grid; gap: 8px; margin-top: 14px; font-size: 12px; color: var(--on-surface-muted); }
.kind-legend span { display: flex; align-items: center; gap: 6px; }
.kind-legend b { font-weight: 400; }
.section-page-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }

.kind-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.kind-option { position: relative; display: block; cursor: pointer; }
.kind-option input { position: absolute; opacity: 0; pointer-events: none; }
.kind-option > span { display: block; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: rgba(255, 253, 247, .8); transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease; }
.kind-option strong { display: block; font-size: 13.5px; }
.kind-option em { display: block; margin-top: 3px; font-style: normal; font-size: 11.5px; color: var(--on-surface-muted); line-height: 1.5; }
.kind-option input:checked + span { border-color: rgba(192, 132, 42, .55); background: rgba(246, 231, 196, .5); box-shadow: 0 0 0 3px rgba(217, 160, 63, .12); }
.kind-option input:focus-visible + span { outline: 2px solid var(--brand-strong); outline-offset: 2px; }

.admin-section-list { display: grid; gap: 14px; }
.admin-section-row { padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 253, 247, .6); }
.admin-section-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.admin-section-head em { font-style: normal; font-size: 11.5px; color: var(--on-surface-muted); }
.admin-section-head form { margin-left: auto; }
.admin-sub-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.admin-sub-chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 6px 0 11px; border-radius: 999px; background: var(--surface-sunken); font-size: 12px; }
.admin-sub-chip em { font-style: normal; opacity: .6; font-size: 10.5px; }
.admin-sub-chip button { width: 18px; height: 18px; border-radius: 50%; font-size: 13px; line-height: 1; color: var(--on-surface-muted); }
.admin-sub-chip button:hover { background: rgba(196, 69, 59, .12); color: var(--danger); }

@media (max-width: 1080px) {
  .section-showcase { grid-template-columns: 1fr; }
  .section-page-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .kind-picker { grid-template-columns: 1fr; }
  .section-head { align-items: flex-start; }
  .section-count { display: none; }
}
