/* ==========================================================================
   杏运平台 · 共享站点样式 /assets/site.css
   分区：reset → 变量 → 中文排版 → 工具类 → 头部 → 目录树 → 移动导航
        → 页脚 → 按钮 → 章节与版式 → 卡片与数据 → 图像容器 → 动效
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body,
h1, h2, h3, h4, h5, p, ul, ol, li, figure, blockquote, dl, dd, address { margin: 0; }

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

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

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

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

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

table { border-collapse: collapse; width: 100%; }

[hidden] { display: none !important; }

/* 2. 变量 ------------------------------------------------------------------ */
:root {
  --apricot: #F08A3C;
  --apricot-deep: #C4601A;
  --amber: #E8A93A;
  --lake: #1E6F8C;
  --lake-deep: #123A4C;
  --mist: #E9ECEE;
  --paper: #FBF9F6;
  --violet: #4B3F6E;
  --wine: #8A3B3B;
  --ink: #22303A;
  --rock: #6B7780;

  --line-ink: rgba(18, 58, 76, 0.22);
  --line-soft: rgba(18, 58, 76, 0.12);
  --line-paper: rgba(251, 249, 246, 0.26);

  --font-display: "Source Han Serif SC", "Noto Serif SC", Georgia, "Songti SC", serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "Noto Sans Mono", ui-monospace, "Courier New", monospace;

  --shell: 1200px;
  --bar-h: 62px;
  --pad-x: clamp(16px, 4vw, 40px);
  --radius: 2px;

  --shadow-card: 0 12px 26px -20px rgba(18, 58, 76, 0.6);
  --shadow-lift: 0 20px 42px -24px rgba(18, 58, 76, 0.65);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* 3. 中文排版与页面底纹 ---------------------------------------------------- */
body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    repeating-radial-gradient(circle at 4% -6%, rgba(30, 111, 140, 0.07) 0 1px, transparent 1px 22px),
    repeating-radial-gradient(circle at 103% 88%, rgba(240, 138, 60, 0.07) 0 1px, transparent 1px 26px);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: 0.01em;
  color: var(--ink);
}

h1 { font-size: clamp(30px, 5vw, 52px); }
h2 { font-size: clamp(24px, 3.4vw, 34px); }
h3 { font-size: clamp(18px, 2vw, 20px); }

p { max-width: 72ch; }

strong { color: var(--apricot-deep); }

:focus-visible {
  outline: 3px solid var(--apricot-deep);
  outline-offset: 2px;
  border-radius: 2px;
}

/* 4. 工具类 ---------------------------------------------------------------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

.mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.1em;
  color: var(--rock);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--apricot-deep);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.contour-field {
  background-image:
    repeating-radial-gradient(circle at 14% 10%, rgba(30, 111, 140, 0.16) 0 1px, transparent 1px 15px),
    repeating-radial-gradient(circle at 86% 88%, rgba(30, 111, 140, 0.12) 0 1px, transparent 1px 21px);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -70px;
  z-index: 200;
  padding: 10px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  background: var(--lake-deep);
  color: var(--paper);
  border-radius: 0 0 var(--radius) var(--radius);
  transition: top 0.18s var(--ease);
}

.skip-link:focus { top: 0; }

/* 5. 头部命令栏 ------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--paper);
  border-bottom: 2px solid var(--lake-deep);
  transition: box-shadow 0.22s var(--ease);
}

.site-header.is-scrolled { box-shadow: 0 14px 30px -24px rgba(18, 58, 76, 0.95); }

.progress-track {
  height: 3px;
  background: var(--mist);
}

.progress-fill {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--lake), var(--apricot));
}

.header-bar {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.2vw, 18px);
  min-height: var(--bar-h);
  padding-block: 6px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  padding: 4px 0;
  flex: 0 0 auto;
}

.brand-seal {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: #2b1505;
  background: var(--apricot);
  border: 1px solid var(--apricot-deep);
  border-radius: 3px;
  box-shadow: 2px 2px 0 rgba(18, 58, 76, 0.22);
}

.brand-words { display: flex; flex-direction: column; line-height: 1.15; }

.brand-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.brand-note {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--rock);
}

.tree-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--lake-deep);
  background: var(--mist);
  border: 1px dashed var(--line-ink);
  border-radius: var(--radius);
  transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.tree-toggle:hover { background: #dfe4e7; }

.tree-toggle-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(232, 169, 58, 0.28);
}

.tree-toggle[aria-expanded="true"] {
  color: var(--paper);
  background: var(--lake-deep);
  border-style: solid;
  border-color: var(--lake-deep);
}

.header-utility {
  display: none;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--rock);
  white-space: nowrap;
}

.header-utility a {
  padding-bottom: 2px;
  border-bottom: 1px dotted var(--line-ink);
}

.header-utility a:hover {
  color: var(--lake-deep);
  border-bottom-color: var(--lake);
}

.header-cta { white-space: nowrap; padding: 10px 16px; font-size: 12.5px; }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--lake-deep);
  background: var(--paper);
  border: 1px solid var(--line-ink);
  border-radius: var(--radius);
}

.nav-toggle-bars { display: grid; gap: 3px; width: 16px; }
.nav-toggle-bars i { display: block; height: 2px; background: currentColor; }

.nav-toggle[aria-expanded="true"] {
  color: var(--paper);
  background: var(--lake-deep);
  border-color: var(--lake-deep);
}

.nav-toggle-text { line-height: 1; }

/* 6. 移动优先的导航抽屉 ---------------------------------------------------- */
.site-nav {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px var(--pad-x) 20px;
  max-height: calc(100dvh - 76px);
  overflow-y: auto;
  background: var(--paper);
  border-top: 1px solid var(--line-soft);
  border-bottom: 2px solid var(--lake-deep);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s linear;
}

.site-nav[data-open] {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}

.nav-list { display: flex; flex-direction: column; }

.nav-list a {
  display: block;
  padding: 13px 6px;
  font-size: 16px;
  line-height: 1.3;
  color: var(--ink);
  border-bottom: 1px solid var(--line-soft);
  transition: color 0.16s var(--ease), background 0.16s var(--ease), border-color 0.16s var(--ease);
}

.nav-list a:hover { color: var(--lake-deep); background: var(--mist); }

.nav-list a[aria-current="page"] {
  color: var(--lake-deep);
  font-weight: 600;
  background: var(--mist);
  border-bottom-color: var(--apricot);
  box-shadow: inset 3px 0 0 var(--apricot);
}

.nav-foot {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--rock);
}

.nav-foot a { border-bottom: 1px dotted var(--line-ink); }
.nav-foot a:hover { color: var(--lake-deep); }

.nav-cta { align-self: flex-start; margin-top: 14px; }

/* 7. 折叠目录树面板 -------------------------------------------------------- */
.dir-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 5;
  padding: 20px 0 24px;
  background: var(--paper);
  border-bottom: 2px solid var(--lake-deep);
  box-shadow: var(--shadow-lift);
}

.dir-panel-inner {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
}

.dir-hint {
  grid-column: 1 / -1;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--apricot-deep);
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line-ink);
}

.dir-group-title {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  color: var(--lake-deep);
  margin-bottom: 8px;
}

.dir-list li + li { margin-top: 2px; }

.dir-list a {
  display: block;
  padding: 8px 10px;
  font-size: 15px;
  color: var(--ink);
  border-left: 2px solid var(--line-soft);
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease), color 0.16s var(--ease);
}

.dir-list a:hover,
.dir-list a:focus-visible {
  color: var(--lake-deep);
  background: var(--mist);
  border-left-color: var(--amber);
}

/* 8. 页脚 ------------------------------------------------------------------ */
.site-footer {
  margin-top: clamp(48px, 8vw, 96px);
  color: rgba(251, 249, 246, 0.82);
  background: var(--lake-deep);
  border-top: 3px solid var(--apricot);
}

.footer-ridge {
  height: 12px;
  background-color: var(--mist);
  background-image: repeating-linear-gradient(90deg, rgba(30, 111, 140, 0.45) 0 1px, transparent 1px 9px);
  border-bottom: 1px solid rgba(18, 58, 76, 0.5);
}

.footer-main {
  display: grid;
  gap: clamp(26px, 4vw, 48px);
  grid-template-columns: 1fr;
  padding-top: clamp(32px, 5vw, 56px);
  padding-bottom: clamp(26px, 4vw, 44px);
}

.footer-brand-line {
  max-width: 26ch;
  font-family: var(--font-display);
  font-size: clamp(19px, 2.4vw, 23px);
  font-weight: 700;
  line-height: 1.5;
  color: var(--paper);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--amber);
  display: inline-block;
}

.footer-note {
  margin-top: 14px;
  font-size: 15px;
  color: rgba(251, 249, 246, 0.7);
  max-width: 46ch;
}

.footer-contact {
  display: grid;
  gap: 6px;
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.05em;
  font-style: normal;
  color: rgba(251, 249, 246, 0.88);
}

.contact-item { display: flex; flex-wrap: wrap; gap: 10px; }

.contact-label {
  flex: 0 0 auto;
  min-width: 3.4em;
  color: var(--amber);
  letter-spacing: 0.14em;
}

.footer-hours {
  margin-top: 16px;
  font-size: 13px;
  line-height: 1.7;
  color: rgba(251, 249, 246, 0.62);
  max-width: 44ch;
}

.footer-nav-title {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.18em;
  color: var(--amber);
  margin-bottom: 12px;
}

.footer-links { display: grid; gap: 2px; }

.footer-links a {
  display: inline-block;
  padding: 6px 0;
  font-size: 15px;
  color: rgba(251, 249, 246, 0.82);
  border-bottom: 1px solid transparent;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease);
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--paper);
  border-bottom-color: var(--amber);
}

.footer-region {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.region-contour {
  width: 108px;
  height: 60px;
  border: 1px solid var(--line-paper);
  border-radius: var(--radius);
  background-color: rgba(251, 249, 246, 0.06);
  background-image: repeating-radial-gradient(circle at 30% 72%, rgba(232, 169, 58, 0.5) 0 1px, transparent 1px 10px);
}

.region-vertical {
  writing-mode: vertical-rl;
  padding: 12px 6px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.34em;
  color: var(--paper);
  border: 1px solid var(--line-paper);
}

.region-caption {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: rgba(251, 249, 246, 0.6);
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
  padding-block: 18px 22px;
  border-top: 1px solid var(--line-paper);
}

.footer-legal,
.footer-mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: rgba(251, 249, 246, 0.62);
}

/* 9. 按钮 ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 11px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  line-height: 1.2;
  color: var(--lake-deep);
  background: var(--paper);
  border: 1px solid var(--lake-deep);
  border-radius: var(--radius);
  transition: background 0.18s var(--ease), color 0.18s var(--ease),
              transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-card); }

.btn--primary {
  color: #2b1505;
  font-weight: 600;
  background: var(--apricot);
  border-color: var(--apricot-deep);
}

.btn--primary:hover { color: var(--paper); background: var(--apricot-deep); }

.btn--outline { background: transparent; border-style: dashed; }

.btn--quiet {
  color: var(--lake);
  background: transparent;
  border-color: transparent;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* 10. 章节体系与页面版式 --------------------------------------------------- */
main { display: block; }

.section {
  position: relative;
  padding-block: clamp(40px, 6vw, 88px);
}

.section--mist {
  background: var(--mist);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.section--dark { background: var(--lake-deep); color: rgba(251, 249, 246, 0.86); }
.section--dark h1,
.section--dark h2,
.section--dark h3 { color: var(--paper); }
.section--dark .section-note,
.section--dark .mono { color: rgba(251, 249, 246, 0.66); }

.section--apricot { background: var(--apricot); color: #2b1505; }
.section--apricot h2,
.section--apricot h3 { color: #2b1505; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  margin-bottom: clamp(20px, 3vw, 34px);
  border-bottom: 1px solid var(--line-soft);
}

.chapter {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.chapter-num {
  font-family: var(--font-mono);
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--apricot);
  transition: color 0.2s var(--ease), transform 0.2s var(--ease);
}

.chapter-title { font-size: clamp(22px, 3.2vw, 32px); }

.section-note {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--rock);
  max-width: 36ch;
}

[data-chapter] { scroll-margin-top: calc(var(--bar-h) + 26px); }

[data-chapter].is-current .chapter-num {
  color: var(--lake-deep);
  transform: scale(1.08);
}

.page-head {
  padding-block: clamp(32px, 5vw, 64px) clamp(20px, 3vw, 32px);
  background: linear-gradient(180deg, rgba(233, 236, 238, 0.85), rgba(251, 249, 246, 0));
  border-bottom: 3px solid var(--lake-deep);
}

.breadcrumb {
  margin-bottom: 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--rock);
}

.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 8px; }
.breadcrumb li + li::before { content: "›"; margin-right: 8px; color: var(--apricot); }
.breadcrumb a:hover { color: var(--lake-deep); text-decoration: underline; text-underline-offset: 4px; }

.prose { max-width: 72ch; }
.prose p + p { margin-top: 1em; }
.prose h2 { margin-top: 2em; margin-bottom: 0.5em; }
.prose h3 { margin-top: 1.6em; margin-bottom: 0.5em; }
.prose ul { margin: 1em 0; display: grid; gap: 6px; }
.prose li { padding-left: 1.2em; position: relative; }
.prose li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 8px;
  height: 2px;
  background: var(--apricot);
}

.grid { display: grid; gap: clamp(16px, 2.4vw, 28px); grid-template-columns: 1fr; }

.split {
  display: grid;
  gap: clamp(22px, 4vw, 44px);
  grid-template-columns: 1fr;
  align-items: center;
}

.rail {
  position: sticky;
  top: calc(var(--bar-h) + 26px);
}

.rail-list { display: grid; gap: 4px; }

.rail-list a {
  display: block;
  padding: 7px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--rock);
  border-left: 2px solid var(--line-soft);
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease), background 0.16s var(--ease);
}

.rail-list a:hover { color: var(--lake-deep); border-left-color: var(--apricot); }

.rail-list a.is-current {
  color: var(--lake-deep);
  background: var(--mist);
  border-left-color: var(--apricot);
}

/* 11. 卡片、标签与数据展示 ------------------------------------------------- */
.paper-card {
  position: relative;
  padding: clamp(18px, 2.4vw, 28px);
  background: var(--paper);
  border: 1px solid var(--line-ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.paper-card::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 26px;
  height: 14px;
  background: var(--mist);
  border: 1px solid var(--line-ink);
  border-right: 0;
  border-bottom: 0;
  border-radius: 0 0 0 6px;
}

.paper-stack { position: relative; isolation: isolate; }

.paper-stack::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--mist);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  transform: translate(10px, 10px) rotate(0.6deg);
}

.tag {
  display: inline-block;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: var(--lake-deep);
  background: var(--amber);
  border: 1px solid rgba(18, 58, 76, 0.25);
  border-radius: var(--radius);
  transform: rotate(-1.5deg);
}

.tag--lake {
  color: var(--paper);
  background: var(--lake);
  border-color: var(--lake-deep);
  transform: none;
}

.tag--ghost {
  color: var(--lake-deep);
  background: transparent;
  border-style: dashed;
  transform: none;
}

.ledger {
  font-size: 15px;
  background: var(--paper);
  border: 1px solid var(--line-ink);
}

.ledger th,
.ledger td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line-soft);
}

.ledger thead th {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--lake-deep);
  background: var(--mist);
}

.ledger tbody tr:hover { background: rgba(233, 236, 238, 0.55); }

.contrast {
  display: grid;
  grid-template-columns: 1fr;
  background: var(--paper);
  border: 1px solid var(--line-ink);
}

.contrast-side { padding: clamp(18px, 2.4vw, 26px); }

.contrast-side--left {
  background: rgba(75, 63, 110, 0.1);
  border-top: 4px solid var(--violet);
}

.contrast-side--right {
  background: rgba(138, 59, 59, 0.1);
  border-top: 4px solid var(--wine);
}

.sync-path {
  position: relative;
  height: 2px;
  margin: 24px 0;
  background-image: repeating-linear-gradient(90deg, var(--lake) 0 8px, transparent 8px 16px);
}

.sync-path::before,
.sync-path::after {
  content: "";
  position: absolute;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--apricot);
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 1px var(--line-ink);
}

.sync-path::before { left: 0; }
.sync-path::after { right: 0; background: var(--lake); }

.ring {
  width: var(--ring, 200px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--line-ink);
  box-shadow: inset 0 0 0 5px rgba(251, 249, 246, 0.55);
  background:
    radial-gradient(circle at 50% 50%,
      var(--amber) 0 9%,
      var(--paper) 9% 20%,
      var(--apricot) 20% 32%,
      var(--paper) 32% 46%,
      rgba(240, 138, 60, 0.45) 46% 66%,
      rgba(30, 111, 140, 0.22) 66% 88%,
      transparent 88%);
}

/* 12. 图像容器（页面阶段放置图片） ---------------------------------------- */
.media-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--mist);
  border: 1px solid var(--line-ink);
  border-radius: var(--radius);
}

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

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

.media-frame--contour {
  background-color: var(--mist);
  background-image:
    repeating-radial-gradient(circle at 25% 30%, rgba(30, 111, 140, 0.22) 0 1px, transparent 1px 14px),
    repeating-radial-gradient(circle at 78% 74%, rgba(240, 138, 60, 0.2) 0 1px, transparent 1px 18px);
}

.media-frame figcaption {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--lake-deep);
  background: rgba(251, 249, 246, 0.92);
  border: 1px solid var(--line-ink);
}

/* 13. 标签页与进场动效 ----------------------------------------------------- */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line-ink);
}

.tab {
  padding: 9px 14px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: var(--rock);
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
}

.tab:hover { color: var(--lake-deep); background: var(--mist); }

.tab[aria-selected="true"] {
  position: relative;
  top: 1px;
  color: var(--lake-deep);
  background: var(--paper);
  border-color: var(--line-ink);
}

.tab-panel { padding-top: 6px; }

[data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.24s var(--ease), transform 0.24s var(--ease);
}

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

/* 14. 响应式断点 ----------------------------------------------------------- */
@media (min-width: 700px) {
  .dir-panel-inner { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
  .footer-main { grid-template-columns: 1.4fr 1fr; }
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .contrast { grid-template-columns: 1fr 1fr; }
  .contrast-side--left { border-right: 1px solid var(--line-soft); }
}

@media (min-width: 900px) {
  .nav-toggle { display: none; }

  .site-nav {
    position: static;
    flex: 0 1 auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 0;
    max-height: none;
    overflow: visible;
    background: transparent;
    border: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
  }

  .nav-list { flex-direction: row; align-items: center; gap: 2px; }

  .nav-list a {
    padding: 8px 10px;
    font-size: 14px;
    border-bottom: 2px solid transparent;
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .nav-list a[aria-current="page"] { box-shadow: none; }

  .nav-foot,
  .nav-cta { display: none; }
}

@media (min-width: 1020px) {
  .footer-main { grid-template-columns: 1.5fr 1fr 0.8fr; }
  .grid--side { grid-template-columns: 240px 1fr; gap: clamp(24px, 4vw, 56px); }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 980px) {
  .split { grid-template-columns: 5fr 7fr; }
}

@media (min-width: 1200px) {
  .header-utility { display: block; }
}

@media (max-width: 660px) {
  .tree-toggle-text { display: none; }
  .header-cta { display: none; }
  .brand-note { display: none; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .footer-base { flex-direction: column; }
}

/* 15. 降低动效偏好 --------------------------------------------------------- */
@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;
  }

  [data-reveal] { opacity: 1; transform: none; }
  .btn:hover { transform: none; }
  .chapter-num { transition: none; }
}
