/* =========================================================
   欢乐龙城 · 共享站点层 /site.css
   命令栏 · 长卷页脚 · 纸感组件 · 编辑部网格
   ========================================================= */

/* ---------- reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body,
h1, h2, h3, h4, h5, h6,
p, ul, ol, li, figure, figcaption, blockquote {
  margin: 0;
}

ul, ol { padding: 0; list-style: none; }

a { color: inherit; text-decoration: none; }

img, svg, picture { display: block; max-width: 100%; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

input, textarea, select { font: inherit; color: inherit; }

[hidden] { display: none !important; }

/* ---------- 变量 ---------- */
:root {
  /* 品牌色 */
  --gold: #D4A24C;
  --gold-light: #E8C87A;
  --ink: #0E1B2C;
  --abyss: #07111C;
  --tide: #1B3A4B;
  --cinnabar: #C8402F;
  --cinnabar-dark: #A6301F;
  --paper: #F4EBDD;
  --slate: #6E7C8C;
  --bronze: #8C6B2F;
  --haihe: #2E6E7E;

  /* 分区可变前景 */
  --fg: #F4EBDD;
  --muted: rgba(244, 235, 221, 0.62);
  --line: rgba(140, 107, 47, 0.5);

  /* 字体 */
  --font-display: "Noto Serif SC", "Source Han Serif SC", "Songti SC", STSong, "SimSun", serif;
  --font-body: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* 尺度 */
  --header-h: 64px;
  --gap-card: 32px;
  --gap-block: clamp(56px, 8vw, 96px);
  --pad-inline: clamp(16px, 4vw, 48px);
  --max-w: 1240px;
  --max-w-wide: 1440px;

  /* 动效 */
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* ---------- 基础排版 ---------- */
body {
  padding-top: var(--header-h);
  background: var(--ink);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

p { line-height: 1.9; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.24;
  letter-spacing: -0.01em;
}

.mono,
.version-badge,
.footer-meta,
.card-meta {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- 跳转链接 ---------- */
.skip-link {
  position: absolute;
  left: var(--pad-inline);
  top: -72px;
  z-index: 300;
  display: inline-block;
  padding: 10px 18px;
  background: var(--gold);
  color: var(--ink);
  font-size: 14px;
  letter-spacing: 0.04em;
  border-radius: 2px;
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 12px;
}

/* ---------- 命令栏 ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 200;
  background: rgba(14, 27, 44, 0.96);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--bronze);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(10px, 2vw, 32px);
  height: 100%;
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding-inline: var(--pad-inline);
}

/* 品牌署名 */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  transition: transform 0.22s var(--ease);
}

.brand:hover { transform: translateY(-2px); }

.brand-seal {
  position: relative;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(14, 27, 44, 0.9), inset 0 0 0 3px rgba(212, 162, 76, 0.55);
}

.brand-seal::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--gold);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 19px;
  letter-spacing: 0.1em;
  color: var(--paper);
  transition: color 0.2s var(--ease);
}

.brand:hover .brand-name { color: var(--gold-light); }

.brand-sub {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.26em;
  color: var(--gold);
  opacity: 0.85;
}

/* 主导航 */
.primary-nav {
  flex: 0 1 auto;
}

.nav-index {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-index a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  font-size: 14px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  color: rgba(244, 235, 221, 0.78);
  transition: color 0.2s var(--ease), transform 0.2s var(--ease);
}

.nav-index a:hover {
  color: var(--gold-light);
  transform: translateY(-2px);
}

.nav-num {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--slate);
  transition: color 0.2s var(--ease);
}

.nav-index a[aria-current="page"] {
  color: var(--gold);
}

.nav-index a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 2px;
  height: 1.5px;
  background: var(--gold);
}

.nav-index a[aria-current="page"] .nav-num {
  color: var(--cinnabar);
}

/* 右端工具 */
.header-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.version-badge {
  padding: 4px 9px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--gold);
  background: rgba(212, 162, 76, 0.09);
  border: 1px solid var(--bronze);
  border-radius: 2px;
  white-space: nowrap;
}

/* 通用按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 2px;
  font-size: 14px;
  letter-spacing: 0.05em;
  line-height: 1.4;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease),
    color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-ghost {
  border: 1px solid var(--cinnabar);
  color: var(--paper);
  background: rgba(200, 64, 47, 0.08);
}

.btn-ghost:hover {
  background: var(--cinnabar);
  border-color: var(--cinnabar);
  color: #fff;
}

.btn-solid {
  background: var(--cinnabar);
  border: 1px solid var(--cinnabar);
  color: #fff;
}

.btn-solid:hover {
  background: var(--cinnabar-dark);
  border-color: var(--cinnabar-dark);
}

/* 移动导航按钮 */
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--bronze);
  border-radius: 2px;
  transition: border-color 0.2s var(--ease);
}

.nav-toggle:hover { border-color: var(--gold); }

.nav-toggle-bars {
  position: relative;
  display: block;
  width: 18px;
  height: 2px;
  background: var(--paper);
  transition: background 0.2s var(--ease);
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: var(--paper);
  transition: transform 0.24s var(--ease);
}

.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }

.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

/* 滚动进度 */
.scroll-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 2px;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--gold), var(--cinnabar));
  pointer-events: none;
}

/* ---------- 长卷页脚 ---------- */
.site-footer {
  position: relative;
  overflow: hidden;
  background: var(--abyss);
  border-top: 1px solid var(--bronze);
  color: rgba(244, 235, 221, 0.8);
}

.footer-scroll {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 64px);
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: clamp(44px, 6vw, 80px) var(--pad-inline) clamp(32px, 4vw, 56px);
}

.footer-brand { min-width: 0; }

.footer-scales {
  display: block;
  width: 132px;
  height: 52px;
  border-bottom: 1px solid var(--bronze);
  background-image:
    repeating-linear-gradient(135deg, transparent 0 10px, rgba(212, 162, 76, 0.34) 10px 11px),
    repeating-linear-gradient(45deg, transparent 0 10px, rgba(46, 110, 126, 0.34) 10px 11px);
}

.footer-motto {
  margin-top: 18px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 0.08em;
  color: var(--paper);
}

.footer-line {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.8;
  color: rgba(244, 235, 221, 0.5);
  max-width: 22em;
}

.footer-heading {
  margin-bottom: 14px;
  font-size: 15px;
  letter-spacing: 0.14em;
  color: var(--gold);
}

.footer-heading::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 9px;
  vertical-align: 1px;
  background: var(--gold);
  transform: rotate(45deg);
}

.footer-sub { min-width: 0; }

.footer-note {
  margin-bottom: 14px;
  max-width: 32em;
  font-size: 13px;
  line-height: 1.8;
  color: rgba(244, 235, 221, 0.55);
}

.subscribe {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
}

.subscribe-input {
  flex: 1 1 190px;
  min-width: 0;
  padding: 10px 13px;
  color: var(--paper);
  background: rgba(244, 235, 221, 0.06);
  border: 1px solid var(--bronze);
  border-radius: 2px;
  font-size: 14px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.subscribe-input::placeholder { color: rgba(110, 124, 140, 0.9); }

.subscribe-input:hover { border-color: var(--gold); }

.subscribe-input:focus-visible {
  border-color: var(--gold);
  background: rgba(244, 235, 221, 0.1);
}

.subscribe .btn { flex: 0 0 auto; }

.subscribe-feedback {
  min-height: 1.6em;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: 0.03em;
  color: var(--gold-light);
}

.footer-index { min-width: 0; }

.footer-links li + li { margin-top: 8px; }

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: rgba(244, 235, 221, 0.72);
  transition: color 0.2s var(--ease), transform 0.2s var(--ease);
}

.footer-links a::before {
  content: attr(data-num);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--slate);
  transition: color 0.2s var(--ease);
}

.footer-links a:hover {
  color: var(--gold-light);
  transform: translateX(2px);
}

.footer-links a:hover::before { color: var(--cinnabar); }

.footer-policy {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(140, 107, 47, 0.42);
}

.footer-policy a {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: rgba(244, 235, 221, 0.55);
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.footer-policy a:hover {
  color: var(--gold-light);
  border-bottom-color: var(--gold);
}

/* 页脚联系信息条 */
.footer-bottom {
  background: var(--abyss);
  border-top: 1px solid rgba(140, 107, 47, 0.42);
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 26px;
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: 16px var(--pad-inline);
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--slate);
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.meta-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: rgba(110, 124, 140, 0.85);
}

.meta-value {
  color: rgba(244, 235, 221, 0.78);
  word-break: break-all;
}

.copy-btn {
  padding: 2px 8px;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--gold);
  border: 1px dashed rgba(140, 107, 47, 0.75);
  border-radius: 2px;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.copy-btn:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}

.copy-btn[data-copied] {
  background: var(--cinnabar);
  border-color: var(--cinnabar);
  color: #fff;
}

.footer-icp {
  margin-left: auto;
  color: rgba(110, 124, 140, 0.9);
}

/* ---------- 容器与分区 ---------- */
.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding-inline: var(--pad-inline);
}

.wrap-narrow { max-width: 880px; }

.section {
  padding-block: var(--gap-block);
}

.surface-paper {
  --fg: #16263a;
  --muted: #5b6c7d;
  --line: rgba(140, 107, 47, 0.38);
  background: var(--paper);
  color: var(--fg);
}

.surface-tide {
  --fg: #F4EBDD;
  --muted: rgba(244, 235, 221, 0.62);
  --line: rgba(212, 162, 76, 0.34);
  background: var(--tide);
  color: var(--fg);
}

.surface-ink {
  --fg: #F4EBDD;
  --muted: rgba(244, 235, 221, 0.62);
  --line: rgba(140, 107, 47, 0.5);
  background: var(--ink);
  color: var(--fg);
}

.divider {
  height: 1px;
  border: 0;
  margin-block: clamp(32px, 5vw, 56px);
  background: var(--line);
}

/* ---------- 章节扉页 ---------- */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--gold);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 2fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: end;
  margin-bottom: clamp(32px, 4vw, 56px);
}

.section-title {
  margin-top: 14px;
  font-size: clamp(30px, 4.4vw, 44px);
  color: var(--fg);
}

.section-note {
  padding-left: 14px;
  border-left: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.85;
  color: var(--muted);
}

/* ---------- 文案 ---------- */
.prose {
  max-width: 38em;
  font-size: 17px;
  line-height: 1.9;
  color: var(--fg);
}

.prose p + p { margin-top: 1.1em; }

.prose a {
  color: var(--gold);
  border-bottom: 1px solid rgba(212, 162, 76, 0.45);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.prose a:hover {
  color: var(--cinnabar);
  border-bottom-color: var(--cinnabar);
}

.lede {
  max-width: 30em;
  font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.85;
  color: var(--muted);
}

.note-strip {
  max-width: 42em;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.85;
  color: var(--muted);
}

.display {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(44px, 8vw, 96px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--fg);
}

.display--vertical {
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 0.08em;
  line-height: 1.15;
}

.tag {
  display: inline-block;
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 2px;
}

/* ---------- 网格 ---------- */
.grid {
  display: grid;
  gap: var(--gap-card);
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- 纸感卡片 ---------- */
.card {
  --fg: #16263a;
  --muted: #5b6c7d;
  position: relative;
  padding: clamp(20px, 3vw, 30px);
  background: var(--paper);
  color: var(--fg);
  border: 1px solid var(--bronze);
  border-radius: 2px;
  box-shadow: 6px 6px 0 rgba(7, 17, 28, 0.32);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}

.card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 9px 9px 0 rgba(7, 17, 28, 0.4);
}

.card--tide {
  --fg: #F4EBDD;
  --muted: rgba(244, 235, 221, 0.66);
  background: var(--tide);
  border-color: rgba(212, 162, 76, 0.42);
}

.card-tag {
  position: absolute;
  top: -1px;
  right: -1px;
  padding: 4px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink);
  background: var(--gold);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 12px 100%);
}

.card-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 20px;
  line-height: 1.42;
  color: var(--fg);
}

.card-text {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.82;
  color: var(--muted);
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--gold);
  border-bottom: 1px solid rgba(212, 162, 76, 0.45);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.card-link:hover {
  color: var(--cinnabar);
  border-bottom-color: var(--cinnabar);
}

.card-meta {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* ---------- 图片容器基础规则 ---------- */
.media {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(160deg, rgba(46, 110, 126, 0.55), rgba(7, 17, 28, 0.95));
  border: 1px solid var(--bronze);
  border-radius: 2px;
}

.media > img,
.media > picture,
.media > picture > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media--wide { aspect-ratio: 16 / 9; }
.media--portrait { aspect-ratio: 3 / 4; }
.media--square { aspect-ratio: 1 / 1; }

.media-caption {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.7;
  color: var(--muted);
}

/* ---------- 筛选 ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 14px 0;
  border-block: 1px solid var(--line);
}

.filter-btn {
  padding: 7px 14px;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease),
    background 0.2s var(--ease), transform 0.2s var(--ease);
}

.filter-btn:hover {
  color: var(--fg);
  border-color: var(--gold);
  transform: translateY(-2px);
}

.filter-btn[aria-pressed="true"] {
  color: #fff;
  background: var(--cinnabar);
  border-color: var(--cinnabar);
}

.filter-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--gold);
}

/* ---------- 面包屑 ---------- */
.breadcrumb {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 6px;
  color: var(--bronze);
}

.breadcrumb a:hover { color: var(--gold); }

/* ---------- 目录锚点 ---------- */
.toc {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  font-size: 13px;
  line-height: 1.7;
}

.toc a {
  display: block;
  padding: 6px 0 6px 12px;
  color: var(--muted);
  border-left: 2px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease),
    padding-left 0.2s var(--ease);
}

.toc a:hover { color: var(--fg); }

.toc a[aria-current="true"] {
  color: var(--gold);
  border-left-color: var(--gold);
  padding-left: 16px;
}

/* ---------- 显现动效 ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.42s var(--ease), transform 0.42s var(--ease);
}

.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* =========================================================
   响应式
   ========================================================= */
@media (max-width: 1080px) {
  .nav-toggle { display: inline-flex; }

  .primary-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    padding: 10px var(--pad-inline) 26px;
    background: var(--ink);
    border-bottom: 1px solid var(--bronze);
    box-shadow: 0 18px 32px rgba(7, 17, 28, 0.6);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.24s var(--ease), transform 0.24s var(--ease),
      visibility 0.24s var(--ease);
  }

  .primary-nav[data-open] {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav-index {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-index li + li { border-top: 1px solid rgba(140, 107, 47, 0.28); }

  .nav-index a {
    padding: 14px 4px;
    font-size: 15px;
  }

  .nav-index a:hover { transform: none; }

  .nav-index a[aria-current="page"]::after {
    left: 4px;
    right: auto;
    width: 22px;
    bottom: 8px;
  }

  body.nav-open { overflow: hidden; }
}

@media (max-width: 900px) {
  .grid-3,
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .section-head {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .section-note {
    max-width: 34em;
  }

  .toc {
    position: static;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
    -webkit-overflow-scrolling: touch;
  }

  .toc a {
    white-space: nowrap;
    padding: 6px 12px;
    border-left: 0;
    border-bottom: 2px solid transparent;
  }

  .toc a[aria-current="true"] {
    padding-left: 12px;
    border-left: 0;
    border-bottom-color: var(--gold);
  }

  .footer-scroll {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
  }

  .footer-icp {
    margin-left: 0;
    width: 100%;
  }
}

@media (max-width: 640px) {
  body { font-size: 16px; }

  :root { --gap-block: 56px; }

  .brand-name { font-size: 17px; }
  .brand-sub { display: none; }
  .header-tools { gap: 8px; }

  .header-cta {
    padding: 7px 11px;
    font-size: 12.5px;
  }

  .version-badge {
    padding: 3px 7px;
    font-size: 11px;
  }

  .grid-2,
  .grid-3,
  .grid-4 { grid-template-columns: minmax(0, 1fr); }

  .footer-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .filter-count { margin-left: 0; width: 100%; }
}

@media (max-width: 400px) {
  .version-badge { display: none; }
}

/* ---------- 动效降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .brand:hover,
  .btn:hover,
  .card:hover,
  .filter-btn:hover,
  .nav-index a:hover,
  .footer-links a:hover {
    transform: none;
  }
}
