/* ==========================================================================
   常设非常规事务总署 · 设计系统 L1
   theme.css — tokens / reset / typography / layout primitives
   --------------------------------------------------------------------------
   方向：B 低温库房为主骨架，A 朱印档案为文书语言，C 观测窗口为局部暗色。
   约束：零外链、系统字体栈、无圆角、无故障特效；所有动效尊重系统减弱动态。
   使用：theme.css → components.css；页面内容由 03a/03b 文案包驱动。
   ========================================================================== */

/* ==========================================================================
   1. TOKENS
   ========================================================================== */

:root {
  /* ---- 1.1 基础色：B 低温库房 ---- */
  --paper: #e7e8e3;          /* 页面底 / 库房墙面 */
  --paper-deep: #d9dcd6;     /* 页面下沉区 */
  --surface: #f7f6f0;        /* 卡片 / 档案盒 */
  --surface-2: #eeefe9;      /* 条带 / 次级面 */
  --white: #fbfaf4;          /* 抬升纸面 */
  --ink: #202825;            /* 主文字 / 主按钮 */
  --ink-2: #39443f;          /* 次级文字 */
  --muted: #4f625d;          /* 说明文字（对 paper ≥ 4.5:1） */
  --steel: #5a706c;          /* 编号 / 辅助标记（大字号或装饰） */
  --steel-pale: #b9c4be;     /* 分隔 / 弱标记 */
  --rust: #a3472f;           /* 唯一强调色：在库 / 警示 / 关键状态 */
  --rust-deep: #8f3b26;      /* 强调色文字态（对 paper ≥ 4.5:1） */

  /* ---- 1.2 线 / 透明层 ---- */
  --line: rgba(32, 40, 37, 0.18);
  --line-strong: rgba(32, 40, 37, 0.46);
  --line-faint: rgba(32, 40, 37, 0.10);
  --wash: rgba(32, 40, 37, 0.055);
  --wash-strong: rgba(32, 40, 37, 0.10);

  /* ---- 1.3 A 叠加：朱印档案 ---- */
  --doc: #f4eddc;            /* 公文纸 */
  --doc-2: #efe6cf;          /* 卷宗卡 */
  --doc-ink: #1d1a14;        /* 公文墨 */
  --doc-muted: #6d6452;      /* 公文次要信息 */
  --doc-line: rgba(90, 70, 30, 0.30);
  --stamp: #a33322;          /* 印章朱 */
  --stamp-deep: #7e2a1e;     /* 叠印朱 */

  /* ---- 1.4 C 叠加：观测窗口（局部暗色） ---- */
  --obs-bg: #191c18;         /* 沥青底 */
  --obs-panel: #22261f;      /* 仪表面板 */
  --obs-panel-2: #1d211b;    /* 次级面板 */
  --obs-amber: #d3b981;      /* 磷光 */
  --obs-bone: #ddd5c2;       /* 暗底正文 */
  --obs-signal: #bf4a33;     /* 信号红 */
  --obs-line: rgba(211, 185, 129, 0.24);
  --obs-line-strong: rgba(211, 185, 129, 0.50);
  --obs-muted: #a9a28e;

  /* ---- 1.5 字体：系统栈，离线可用 ---- */
  --font-serif: "Songti SC", "SimSun", "STSong", serif;
  --font-fangsong: "FangSong", "STFangsong", "SimFang", "Songti SC", serif;
  --font-sans: "DengXian", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  --font-hei: "SimHei", "Heiti SC", "Microsoft YaHei", sans-serif;
  --font-mono: "Consolas", "Courier New", monospace;
  --font-geo: Georgia, "Times New Roman", serif;

  /* ---- 1.6 字号 / 行高：流体，桌面到 390 连续缩放 ---- */
  --text-display: clamp(3.25rem, 7.4vw, 6.75rem);   /* 门厅 H1，两行 */
  --text-h1: clamp(2.6rem, 4.6vw, 4.5rem);
  --text-h2: clamp(1.75rem, 2.8vw, 2.75rem);
  --text-h3: clamp(1.125rem, 1.35vw, 1.375rem);
  --text-lead: clamp(1.35rem, 2.35vw, 2.45rem);
  --text-body: clamp(0.9375rem, 0.95vw, 1.0625rem); /* 15–17px */
  --text-small: 0.8125rem;   /* 13px */
  --text-micro: 0.6875rem;   /* 11px */
  --text-mono: 0.625rem;     /* 10px */
  --text-mono-lg: 0.75rem;   /* 12px */

  --leading-tight: 1.06;
  --leading-title: 1.18;
  --leading-body: 1.8;
  --leading-doc: 1.95;

  --tracking-tight: -0.015em;
  --tracking-normal: 0.01em;
  --tracking-wide: 0.08em;
  --tracking-mono: 0.14em;
  --tracking-caps: 0.18em;

  /* ---- 1.7 间距：4px 基准 ---- */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 40px;
  --s-9: 48px;
  --s-10: 64px;
  --s-11: 80px;
  --s-12: 96px;
  --s-13: 120px;
  --s-14: 160px;

  /* ---- 1.8 布局 ---- */
  --page-max: 1460px;
  --gutter: clamp(20px, 4.2vw, 64px);
  --section-y: clamp(64px, 8.2vw, 124px);
  --grid-gap: clamp(16px, 2vw, 28px);
  --measure: 62ch;
  --rail-w: 320px;
  --header-h: 52px;

  /* ---- 1.9 形状 / 阴影：直角，纸的层次，不发光 ---- */
  --radius: 0;
  --radius-sm: 2px;
  --shadow-card: 0 18px 40px -30px rgba(20, 30, 26, 0.45);
  --shadow-lift: 0 28px 60px -36px rgba(20, 30, 26, 0.55);
  --shadow-doc: 0 24px 50px -38px rgba(60, 45, 15, 0.62), 0 1px 0 #fff inset;
  --shadow-inset: inset 0 0 0 1px rgba(255, 255, 255, 0.35);

  /* ---- 1.10 动效：短、无回弹、可关闭 ---- */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur-1: 160ms;
  --dur-2: 220ms;
  --dur-3: 320ms;
  --dur-drawer: 240ms;

  /* ---- 1.11 层级 ---- */
  --z-base: 1;
  --z-sticky: 20;
  --z-nav: 40;
  --z-toast: 80;
  --z-dialog: 100;

  /* ---- 1.12 纸纹：内联 SVG，零请求 ---- */
  --texture-paper: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

/* ---- 1.13 局部暗色：C 观测窗口 ------------------------------------------
   在任意容器加 .theme-observation，内部所有组件自动切换到暗色语义 token。
   不改变页面全局主题；可嵌套在 B 的亮色页面中作为“实验入口”区块。
   ------------------------------------------------------------------------ */
.theme-observation {
  --paper: var(--obs-bg);
  --paper-deep: #121512;
  --surface: var(--obs-panel);
  --surface-2: var(--obs-panel-2);
  --white: #22261f;
  --ink: var(--obs-bone);
  --ink-2: var(--obs-bone);
  --muted: var(--obs-muted);
  --steel: var(--obs-amber);
  --steel-pale: #5a513d;
  --rust: var(--obs-signal);
  --rust-deep: #d06a50;
  --line: var(--obs-line);
  --line-strong: var(--obs-line-strong);
  --line-faint: rgba(211, 185, 129, 0.12);
  --wash: rgba(211, 185, 129, 0.06);
  --wash-strong: rgba(211, 185, 129, 0.12);
  background: var(--paper);
  color: var(--ink);
}

/* ==========================================================================
   2. RESET
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; }
img, svg { 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-underline-offset: 0.28em; text-decoration-thickness: 1px; }
table { border-collapse: collapse; width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }
::selection { background: var(--ink); color: var(--paper); }
:target { scroll-margin-top: calc(var(--header-h) + 24px); }

:focus-visible {
  outline: 3px solid var(--rust-deep);
  outline-offset: 4px;
}

/* ==========================================================================
   3. TYPOGRAPHY
   ========================================================================== */

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: var(--leading-title);
  letter-spacing: var(--tracking-normal);
}

h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); line-height: 1.4; }
h4 { font-size: var(--text-body); font-family: var(--font-sans); font-weight: 700; }

.display {
  font-family: var(--font-serif);
  font-size: var(--text-display);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  font-weight: 700;
}

.lead {
  font-family: var(--font-serif);
  font-size: var(--text-lead);
  line-height: 1.4;
  letter-spacing: var(--tracking-normal);
}

.body { font-size: var(--text-body); line-height: var(--leading-body); }
.small { font-size: var(--text-small); line-height: 1.75; }
.micro {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  line-height: 1.6;
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
}
.mono { font-family: var(--font-mono); letter-spacing: var(--tracking-wide); }
.geo { font-family: var(--font-geo); font-variant-numeric: oldstyle-nums; }
.fangsong { font-family: var(--font-fangsong); }
.serif { font-family: var(--font-serif); }
.hei { font-family: var(--font-hei); }
.muted { color: var(--muted); }
.ink-2 { color: var(--ink-2); }
.stamp-ink { color: var(--stamp); }
.rust { color: var(--rust-deep); }
.measure { max-width: var(--measure); }
.nowrap { white-space: nowrap; }

/* ==========================================================================
   4. LAYOUT
   ========================================================================== */

.shell {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); }
.section--tight { padding-block: clamp(40px, 5vw, 72px); }
.section--flush { padding-block: 0; }
.rule { border-top: 1px solid var(--line); }
.rule--strong { border-top: 1px solid var(--line-strong); }
.rule--ink { border-top: 1px solid var(--ink); }

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--grid-gap);
}
.col-2 { grid-column: span 2; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; }
.col-12 { grid-column: 1 / -1; }

.stack { display: flex; flex-direction: column; gap: var(--s-4); }
.row { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; }
.spread { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-4); }

/* 纸纹：叠加在任意浅色容器上，透明度由 --grain 控制 */
.paper-grain { position: relative; isolation: isolate; }
.paper-grain::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--texture-paper);
  opacity: var(--grain, 0.14);
  mix-blend-mode: multiply;
}
.paper-grain > * { position: relative; z-index: 1; }

/* ==========================================================================
   5. UTILITIES
   ========================================================================== */

.visually-hidden {
  position: absolute !important;
  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;
}

.skip-link {
  position: absolute;
  z-index: var(--z-toast);
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  font: var(--text-small) / 1.4 var(--font-sans);
  text-decoration: none;
  transform: translateY(-220%);
  transition: transform var(--dur-1) var(--ease);
}
.skip-link:focus { transform: none; }

.no-wrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* 纸张卷角 / 折痕：仅用于文书，不用于全站 */
.fold-corner { position: relative; }
.fold-corner::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, transparent 50%, var(--paper-deep) 50%);
  opacity: 0.7;
  pointer-events: none;
}

/* ==========================================================================
   6. MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .ticker__track { animation: none !important; transform: none !important; }
}

/* ==========================================================================
   7. RESPONSIVE BASE
   ========================================================================== */

@media (max-width: 900px) {
  :root {
    --section-y: clamp(52px, 11vw, 84px);
    --rail-w: 100%;
  }
  .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9 { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  :root {
    --text-display: clamp(2.5rem, 12.2vw, 3.6rem);
    --text-h1: clamp(2.2rem, 10vw, 3rem);
    --text-h2: clamp(1.6rem, 7vw, 2.1rem);
    --text-lead: clamp(1.25rem, 5.4vw, 1.6rem);
  }
  .section { padding-block: clamp(48px, 12vw, 72px); }
}

/* ==========================================================================
   8. PRINT
   ========================================================================== */

@media print {
  :root { --paper: #fff; --surface: #fff; --ink: #000; --muted: #333; }
  body { background: #fff; color: #000; }
  .status-bar, .primary-nav, .nav-toggle, .ticker, .toast, dialog { display: none !important; }
  a { text-decoration: none; }
  .site-footer::before,
  .org-footer::before { content: "打印件 · 本打印件不构成档案"; display: block; margin-bottom: 8px; }
}

/* ==========================================================================
   v2 共享外壳适配层
   把 assets/js/app.js 渲染的 chrome / footer / document / form 映射到
   design/system 的 B+A+C token。加载顺序：tokens.css → base.css → theme.css
   ========================================================================== */

:root {
  --color-paper: var(--paper);
  --color-surface: var(--surface);
  --color-ink: var(--ink);
  --color-muted: var(--muted);
  --color-line: var(--line);
  --color-accent: var(--steel);
  --font-body: var(--font-sans);
  --font-mono: var(--font-mono);
  --space-page: var(--gutter);
}

html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-underline-offset: 0.28em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 700; line-height: var(--leading-title); }
h1 span, h2 span, h3 span { color: inherit; }
p { overflow-wrap: anywhere; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 3px solid var(--rust-deep); outline-offset: 4px; }
[hidden] { display: none !important; }

.site-shell {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* 跳转链接 */
.skip-link {
  position: absolute;
  z-index: var(--z-toast);
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  transform: translateY(-220%);
}
.skip-link:focus { transform: none; }

/* 状态条：深底三区 */
.status-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  line-height: 1.5;
  letter-spacing: 0.1em;
}
.status-strip span {
  min-width: 0;
  padding-block: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status-strip span:nth-child(2) { text-align: center; opacity: 0.8; }
.status-strip span:nth-child(3) { text-align: right; opacity: 0.8; }
body[data-page="home"] .status-strip span:nth-child(3)::after {
  content: "／ 未承认：1";
  opacity: 0.55;
}
body[data-page="home"] .status-strip span:nth-child(3) {
  overflow: visible;
  text-overflow: clip;
}

/* 紧凑站头 */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 82px;
  padding: 0;
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  font-size: 0;
  line-height: 1;
}
.brand-mark::before {
  content: "SOIA";
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}
.brand strong {
  display: block;
  font-family: var(--font-serif);
  font-size: clamp(19px, 1.8vw, 24px);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.3;
}
.brand small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}
nav[aria-label] {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 22px;
  font-family: var(--font-sans);
  font-size: 13px;
}
nav[aria-label] a {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding-block: 10px;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
}
nav[aria-label] a:hover { color: var(--ink); }
nav[aria-label] a[aria-current="page"] { color: var(--ink); font-weight: 700; }
nav[aria-label] a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--rust);
}

/* 页面导语 */
.page-intro {
  max-width: none;
  padding-block: clamp(36px, 5vw, 64px) clamp(22px, 3vw, 34px);
  border-bottom: 1px solid var(--ink);
}
.page-intro h1 {
  margin: 10px 0 0;
  font-size: clamp(40px, 5.2vw, 72px);
  line-height: 1.04;
  letter-spacing: 0.01em;
}
.page-intro p { max-width: 62em; color: var(--muted); font-size: 13px; }
.page-intro h1 + p { margin-top: 10px; }
.section-label {
  display: block;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  line-height: 1.6;
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
}

/* 通用文书块（非 A 纸；A 纸在 pages 层） */
.document {
  max-width: none;
  padding-block: clamp(26px, 3.5vw, 44px);
  border-top: 1px solid var(--line);
}
.document h2 {
  margin: 0 0 12px;
  font-size: clamp(22px, 2.2vw, 32px);
  line-height: 1.2;
}
.document h3 {
  margin: 18px 0 6px;
  font-size: 18px;
}
.document p {
  max-width: 72ch;
  color: var(--ink-2);
  font-size: var(--text-body);
  line-height: 1.9;
}
.document p + p { margin-top: 8px; }
.document .section-label { margin-bottom: 6px; }
.issuer {
  margin-top: 18px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.8;
}

/* 按钮 / 表单 / 提示 */
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  margin-top: 0;
  padding: 10px 18px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.primary-button:hover { background: var(--rust-deep); border-color: var(--rust-deep); }
.text-button {
  min-height: 44px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 0.28em;
}
.text-button:hover { color: var(--rust-deep); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

.catalog-controls {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  margin: 22px 0 26px;
}
.catalog-controls label {
  display: grid;
  gap: 6px;
  flex: 1;
  color: var(--muted);
  font-size: 11px;
}
.catalog-controls label:last-of-type { flex: 0 0 220px; }
.catalog-controls .primary-button { flex: 0 0 auto; margin: 0; }
input, select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--rust-deep);
  outline-offset: 2px;
  border-color: var(--ink);
}
.institution-form {
  display: grid;
  gap: 16px;
  max-width: 760px;
  padding-block: 20px;
}
.institution-form > label { display: grid; gap: 6px; font-size: 13px; }
fieldset { min-width: 0; border: 1px solid var(--line); padding: 14px; }
legend { padding-inline: 6px; color: var(--muted); font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.08em; }
.radio-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.radio-options label { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 7px 10px; border: 1px solid var(--line); font-size: 12px; }
.radio-options input, .checkbox input { width: auto; min-height: 0; accent-color: var(--ink); }
.checkbox { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; }
.hint { color: var(--muted); font-size: 11px; line-height: 1.7; }
.technical-note {
  padding: 10px 12px;
  border-left: 2px solid var(--line-strong);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.8;
}
.empty-state {
  padding: 28px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  text-align: center;
}
.pagination {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: 20px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
}
.pagination .text-button { font-family: var(--font-mono); font-size: 10px; }
#result-count { color: var(--muted); font-family: var(--font-mono); font-size: 10px; }

/* 页脚 */
.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 12px 32px;
  margin-top: 0;
  padding-block: 34px 24px;
  border-top: 1px solid var(--ink);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.75;
}
.site-footer > p:first-child {
  grid-column: 1 / -1;
  max-width: 34em;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(19px, 2vw, 27px);
  line-height: 1.5;
}
.footer-links {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
}
.footer-links a { text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.site-footer > p { margin: 0; }
.site-footer #visited-count { color: var(--ink); }
#audio-control-slot { grid-column: 1 / -1; margin-top: 6px; }
#audio-control-slot:empty { display: none; }
#audio-control-slot button,
#audio-control-slot select { min-height: 36px; width: auto; font-size: 11px; }

/* Toast */
.toast {
  position: fixed;
  left: var(--gutter);
  right: auto;
  bottom: 24px;
  width: min(440px, calc(100vw - 40px));
  padding: 12px 16px;
  border: 0;
  background: var(--ink);
  color: var(--paper);
  box-shadow: var(--shadow-lift);
  z-index: var(--z-toast);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  line-height: 1.7;
}
.toast button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid rgba(231, 232, 227, 0.35);
  background: transparent;
  color: var(--paper);
  font-size: 10px;
}

/* 错误页 / 内容页通用 */
.not-found { padding-block: clamp(52px, 7vw, 96px); max-width: 780px; }
.not-found h1 { font-size: clamp(40px, 6vw, 82px); line-height: 1.05; }
.back-link {
  display: inline-block;
  margin-block: 22px 0;
  padding: 6px 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-decoration: none;
}
.back-link::before { content: "← "; color: var(--steel); }
.noscript { padding: 20px; border: 1px solid var(--line); }

@media (max-width: 900px) {
  .status-strip { grid-template-columns: minmax(0, 1fr) auto; }
  .status-strip span:nth-child(2) { display: none; }
  body[data-page="home"] .status-strip span:nth-child(3)::after { display: none; }
  .site-header { flex-wrap: wrap; min-height: 72px; padding-block: 12px; gap: 10px; }
  nav[aria-label] { width: 100%; gap: 4px 18px; font-size: 12px; }
  nav[aria-label] a { padding-block: 7px; border-bottom: 1px solid var(--line); }
  nav[aria-label] a[aria-current="page"]::after { display: none; }
  .site-footer { grid-template-columns: minmax(0, 1fr); }
  .catalog-controls { flex-direction: column; align-items: stretch; }
  .catalog-controls label:last-of-type { flex: 1; }
  .page-intro h1 { font-size: clamp(34px, 9vw, 52px); }
}
@media (max-width: 640px) {
  .status-strip { grid-template-columns: minmax(0, 1fr); font-size: 8px; letter-spacing: 0.02em; }
  .status-strip span { white-space: normal; }
  .status-strip span:nth-child(3) { display: none; }
  .brand-mark { width: 34px; height: 34px; }
  .brand strong { font-size: 17px; }
  .brand small { font-size: 8px; }
  .site-footer > p:first-child { font-size: 21px; }
  .document { padding-block: 24px; }
  .document p { font-size: 14px; }
  .toast { left: 12px; right: 12px; bottom: 12px; width: auto; }
}
