/* ============================================================
   比特币白皮书 · 小吴乐意翻译版
   纯 CSS，零依赖。浅色为默认，支持深色模式（跟随系统 + 手动切换）。
   ============================================================ */

:root {
  --bg: #f7f4ee;
  --surface: #fffdf9;
  --surface-2: #f1ece2;
  --ink: #23201b;
  --ink-2: #57524a;
  --ink-3: #8a8378;
  --line: #e4ddcf;
  --accent: #e8860c;
  --accent-deep: #b56708;
  --accent-soft: #fdf0dc;
  --plain-bg: #eef5f0;
  --plain-edge: #3d7a54;
  --plain-ink: #2c5639;
  --insight-bg: #f3eefb;
  --insight-edge: #7a5cc4;
  --insight-ink: #4c3a80;
  --code-bg: #26231e;
  --code-ink: #ece7dd;
  --good: #2e8b57;
  --bad: #c94040;
  --shadow: 0 1px 2px rgba(35, 32, 27, 0.05), 0 8px 28px rgba(35, 32, 27, 0.07);
  --radius: 14px;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Cascadia Code", Consolas, Menlo, monospace;
}

html[data-theme="dark"] {
  --bg: #14120f;
  --surface: #1d1a16;
  --surface-2: #262219;
  --ink: #ece7dc;
  --ink-2: #b8b0a2;
  --ink-3: #857d6f;
  --line: #322d25;
  --accent: #f7931a;
  --accent-deep: #f8a94b;
  --accent-soft: #2e2415;
  --plain-bg: #1a231c;
  --plain-edge: #5c9b72;
  --plain-ink: #a3c9ae;
  --insight-bg: #221d2c;
  --insight-edge: #9d82e0;
  --insight-ink: #c3b2ee;
  --code-bg: #12100d;
  --code-ink: #d8d2c6;
  --good: #5cb982;
  --bad: #e06a6a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.85;
  transition: background 0.25s ease, color 0.25s ease;
}

a { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

b, strong { font-weight: 650; }

section[id], footer[id] { scroll-margin-top: 76px; }

/* ---------- 阅读进度条 ---------- */
.progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #f2b32c);
  z-index: 100;
  transition: width 0.08s linear;
}

/* ---------- 顶部导航 ---------- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 90;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }
.brand-coin {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 19px;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 45%, transparent);
}
.brand-text {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
  display: flex;
  flex-direction: column;
}
.brand-text small {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}

.nav-links {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.nav-links a {
  color: var(--ink-2);
  font-size: 14.5px;
  padding: 7px 12px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover {
  color: var(--ink);
  background: var(--surface-2);
  text-decoration: none;
}

.theme-toggle {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s, transform 0.15s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
html[data-theme="dark"] .icon-sun { display: none; }
html:not([data-theme="dark"]) .icon-moon { display: none; }

/* ---------- Hero ---------- */
.hero {
  padding: 84px 24px 64px;
  text-align: center;
  background:
    radial-gradient(ellipse 620px 300px at 50% -60px, color-mix(in srgb, var(--accent) 13%, transparent), transparent),
    linear-gradient(var(--bg), var(--bg));
  border-bottom: 1px solid var(--line);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 22px;
  padding: 6px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 13.5px;
  letter-spacing: 0.02em;
}
.badge-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); }
  50% { box-shadow: 0 0 0 6px transparent; }
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(30px, 5.4vw, 52px);
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 10px;
  letter-spacing: 0.01em;
}

.hero-en {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  color: var(--ink-3);
  font-size: clamp(14px, 2vw, 17px);
  margin: 0 0 26px;
}

.hero-meta { color: var(--ink-2); font-size: 14.5px; margin: 0 0 8px; }

.hero-tagline {
  font-family: var(--serif);
  color: var(--ink-2);
  font-size: clamp(15px, 2.2vw, 18px);
  margin: 18px auto 30px;
  max-width: 560px;
}

.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 22px;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 550;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 40%, transparent);
}
.btn-primary:hover { background: var(--accent-deep); }
html[data-theme="dark"] .btn-primary { color: #1d1508; }
.btn-ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink-2);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-deep); }
.btn-small { padding: 8px 16px; font-size: 14px; border-radius: 9px; }

/* ---------- 布局：侧边目录 + 正文 ---------- */
.layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 80px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}

.toc { display: none; }

@media (min-width: 1080px) {
  .layout { grid-template-columns: 196px minmax(0, 1fr); }
  .toc {
    display: block;
    position: sticky;
    top: 92px;
    align-self: start;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding: 20px 0 30px;
    scrollbar-width: thin;
  }
  .toc-title {
    font-size: 12px;
    letter-spacing: 0.14em;
    color: var(--ink-3);
    margin: 0 0 10px;
    padding-left: 14px;
  }
  .toc-nav { display: flex; flex-direction: column; }
  .toc-nav a {
    color: var(--ink-3);
    font-size: 13px;
    line-height: 1.5;
    padding: 4px 14px;
    border-left: 2px solid var(--line);
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .toc-nav a:hover { color: var(--ink); text-decoration: none; }
  .toc-nav a.active {
    color: var(--accent-deep);
    border-left-color: var(--accent);
    font-weight: 600;
  }
}

/* ---------- 章节通用 ---------- */
.section { padding-top: 72px; }
.section:first-child { padding-top: 40px; }

.sec-head { margin-bottom: 26px; }
.sec-chip {
  display: inline-block;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent-deep);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 8px;
  padding: 3px 12px;
  margin-bottom: 14px;
}
.sec-head h2 {
  font-family: var(--serif);
  font-size: clamp(24px, 3.4vw, 32px);
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}
.sec-head h2 small {
  font-family: Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 0.62em;
  color: var(--ink-3);
  margin-left: 10px;
}

.section > p { color: var(--ink-2); max-width: 760px; }

/* ---------- 先说人话 ---------- */
.plain {
  background: var(--plain-bg);
  border-left: 4px solid var(--plain-edge);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 20px 24px 18px;
  margin: 0 0 30px;
  max-width: 780px;
}
.plain-label {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--plain-edge);
}
.plain p:not(.plain-label) {
  margin: 0;
  color: var(--plain-ink);
  font-size: 15.5px;
}
.plain p:not(.plain-label) + p:not(.plain-label) { margin-top: 8px; }

/* ---------- 译文正文 ---------- */
.translation { max-width: 780px; }
.translation p {
  margin: 0 0 20px;
  font-size: 16.5px;
  line-height: 2.05;
  text-align: justify;
}
.translation ol { margin: 0 0 20px; padding-left: 26px; }
.translation ol li { font-size: 16.5px; line-height: 2.05; margin-bottom: 6px; }

.tnote {
  font-size: 12px;
  color: var(--accent-deep);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 5px;
  padding: 1px 6px;
  white-space: nowrap;
}

/* ---------- 英文原文折叠 ---------- */
.orig {
  max-width: 780px;
  margin: 4px 0 34px;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
}
.orig summary {
  cursor: pointer;
  color: var(--ink-3);
  font-size: 13.5px;
  letter-spacing: 0.03em;
  user-select: none;
  transition: color 0.15s;
}
.orig summary:hover { color: var(--accent-deep); }
.orig p {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.85;
  margin: 14px 0 0;
}

/* ---------- 见解框 ---------- */
.insight {
  max-width: 780px;
  background: var(--insight-bg);
  border-left: 4px solid var(--insight-edge);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 18px 24px 16px;
  margin: 0 0 34px;
}
.insight p { margin: 0; color: var(--insight-ink); font-size: 15px; }

.context-box {
  max-width: 780px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 28px 18px;
  margin-top: 40px;
}
.context-box h3 {
  font-family: var(--serif);
  margin: 0 0 10px;
  font-size: 17px;
}
.context-box p { margin: 0; color: var(--ink-2); font-size: 15px; }
.context-box i { color: var(--ink); }

/* ---------- 导读卡片 ---------- */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin: 26px 0 40px;
}
.guide-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.guide-card:hover { transform: translateY(-3px); }
.guide-card h3 {
  font-family: var(--serif);
  font-size: 17.5px;
  margin: 0 0 10px;
  color: var(--ink);
}
.guide-card p { margin: 0 0 10px; font-size: 14.5px; color: var(--ink-2); }
.guide-card b { color: var(--ink); }

.roadmap {
  max-width: 780px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 28px 20px;
}
.roadmap h3 { font-family: var(--serif); margin: 0 0 16px; font-size: 17.5px; }
.roadmap-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.roadmap-item {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 14px 16px;
}
.roadmap-time {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-deep);
  background: var(--accent-soft);
  padding: 2px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.roadmap-item p { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.roadmap-note { margin: 16px 0 0; font-size: 13px; color: var(--ink-3); }

/* ---------- 图解 ---------- */
.figure {
  margin: 10px 0 34px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 22px 14px;
  max-width: 860px;
  overflow-x: auto;
}
.figure svg { width: 100%; height: auto; display: block; min-width: 640px; }
.figure figcaption {
  text-align: center;
  font-size: 13px;
  color: var(--ink-3);
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.svg-tx rect {
  fill: var(--surface-2);
  stroke: var(--line);
  stroke-width: 1.2;
}
.svg-tx text { fill: var(--ink-2); font-size: 14px; }
.svg-tx .svg-title { fill: var(--ink); font-weight: 650; font-size: 15px; }
.svg-tx .svg-hash {
  font-family: var(--mono);
  font-size: 12px;
  fill: var(--accent-deep);
}
.svg-key rect { fill: var(--accent-soft); stroke: color-mix(in srgb, var(--accent) 45%, transparent); }
.svg-key text { fill: var(--accent-deep); font-size: 13.5px; font-weight: 550; }
.svg-pill { fill: var(--accent-soft); stroke: color-mix(in srgb, var(--accent) 50%, transparent); }
.svg-hashnode rect { fill: var(--accent-soft); stroke: color-mix(in srgb, var(--accent) 40%, transparent); }
.svg-hashnode text { fill: var(--accent-deep); font-size: 13px; font-family: var(--mono); }
.svg-flow line, .svg-flow path { stroke: var(--ink-3); stroke-width: 1.6; fill: none; }
.svg-flow text { fill: var(--ink-3); font-size: 13px; }
.svg-arrow { fill: var(--ink-3); }
.svg-note { fill: var(--ink-3); font-size: 13.5px; }
.svg-chain circle { fill: var(--surface-2); stroke: var(--ink-3); stroke-width: 1.5; }
.svg-chain circle.svg-node-hot { fill: var(--accent); stroke: var(--accent); }
.svg-chain circle.svg-node-hollow { stroke-dasharray: 3 3; }
.svg-chain line { stroke: var(--ink-3); stroke-width: 1.5; }
.svg-chain text { fill: var(--ink-3); font-size: 13.5px; }

/* ---------- 公式 ---------- */
.formula-vars {
  max-width: 780px;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 16px 24px;
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: 15.5px;
}
.formula-vars p { margin: 4px 0; }

.formula {
  max-width: 780px;
  font-family: var(--serif);
  font-size: 19px;
  text-align: center;
  padding: 22px 16px;
  margin: 0 0 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
  line-height: 2.2;
}
.frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; margin: 0 4px; }
.frac > span:first-child { border-bottom: 1.5px solid var(--ink); padding: 0 6px 2px; }
.frac > span:last-child { padding: 2px 6px 0; }
.cases {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 8px;
  border-left: 2px solid var(--ink);
  padding-left: 4px;
}
.cases .case { display: flex; flex-direction: column; text-align: left; }
.cases .case i { font-style: normal; padding: 2px 8px; font-size: 16px; }
.formula sup, .formula sub { font-size: 0.68em; }

/* ---------- 代码块 ---------- */
.codeblock {
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: var(--radius);
  padding: 20px 24px;
  overflow-x: auto;
  max-width: 780px;
  margin: 0 0 28px;
  box-shadow: var(--shadow);
}
.codeblock code {
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.7;
  white-space: pre;
}

/* ---------- 数据表 ---------- */
.data-table {
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 14px;
  margin: 0 0 28px;
  max-width: 480px;
}
.data-table caption {
  caption-side: top;
  text-align: left;
  font-size: 13px;
  color: var(--ink-3);
  padding: 0 2px 8px;
}
.tables-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  max-width: 780px;
  margin-bottom: 12px;
}
.tables-row .data-table { flex: 1 1 300px; margin-bottom: 16px; }
.data-table.narrow { max-width: 360px; }
.data-table th, .data-table td {
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.data-table thead th {
  background: var(--surface-2);
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 600;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table td { font-family: var(--mono); font-size: 13px; }
.data-table th:first-child, .data-table td:first-child { color: var(--ink-2); }

/* ---------- 交互演示 ---------- */
.demo {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 30px 22px;
  margin: 0 0 26px;
  max-width: 860px;
}
.demo h3 {
  font-family: var(--serif);
  font-size: 19px;
  margin: 0 0 10px;
}
.demo-desc { font-size: 14.5px; color: var(--ink-2); margin: 0 0 18px; }
.demo-body { display: flex; flex-direction: column; gap: 14px; }
.demo-note { font-size: 13.5px; color: var(--ink-3); margin: 0; line-height: 1.8; }
.demo-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--ink-2); }
.field > span { font-size: 13.5px; }
.field textarea, .field select, .field input[type="range"] {
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.15s;
}
.field textarea:focus, .field select:focus { border-color: var(--accent); }
.field input[type="range"] { padding: 0; accent-color: var(--accent); border: none; background: transparent; }

.mono { font-family: var(--mono); font-size: 13px; word-break: break-all; }

.hash-out {
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: 10px;
  padding: 14px 18px;
}
.hash-out > span { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 6px; }
.hash-out code { color: var(--code-ink); }

.mine-controls { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.mine-controls .field { flex: 1 1 240px; }
.mine-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.stat {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 12px 14px;
  min-width: 0;
}
.stat > span { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.stat code { font-family: var(--mono); font-size: 12.5px; word-break: break-all; color: var(--ink); }
.stat code.found { color: var(--good); font-weight: 700; }

/* 篡改实验室 */
.chain { display: flex; flex-direction: column; gap: 0; }
.block-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  padding: 14px 16px;
  transition: border-color 0.2s, background 0.2s;
}
.block-card + .block-card { margin-top: 26px; position: relative; }
.block-card + .block-card::before {
  content: "↓ 前块哈希在此";
  position: absolute;
  top: -24px; left: 20px;
  font-size: 11.5px;
  color: var(--ink-3);
}
.block-card.valid { border-color: color-mix(in srgb, var(--good) 55%, var(--line)); }
.block-card.broken {
  border-color: var(--bad);
  background: color-mix(in srgb, var(--bad) 8%, var(--surface-2));
}
.block-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.block-head b { font-size: 14px; }
.block-status {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
}
.block-card.valid .block-status { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.block-card.broken .block-status { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.block-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; font-size: 12px; color: var(--ink-3); }
.block-field input {
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 12px;
  outline: none;
}
.block-field input:focus { border-color: var(--accent); }
.block-hash { font-family: var(--mono); font-size: 12px; color: var(--ink-2); word-break: break-all; }
.block-hash .hl { color: var(--accent-deep); font-weight: 700; }

/* 确认数计算器 */
.confirm-result {
  background: var(--surface-2);
  border-radius: 12px;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.confirm-big { display: flex; align-items: baseline; gap: 8px; }
.confirm-big span {
  font-family: var(--serif);
  font-size: 52px;
  font-weight: 700;
  color: var(--accent-deep);
  line-height: 1;
}
.confirm-big small { font-size: 15px; color: var(--ink-2); }

/* ---------- FAQ ---------- */
.faq-list { max-width: 780px; display: flex; flex-direction: column; gap: 12px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 22px;
  transition: border-color 0.2s;
}
.faq-item[open] { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15.5px;
  padding: 16px 0;
  list-style: none;
  position: relative;
  padding-right: 32px;
  user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  font-weight: 400;
  color: var(--ink-3);
  transition: transform 0.2s;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item p { margin: 0 0 18px; font-size: 14.5px; color: var(--ink-2); }

/* ---------- 术语表 ---------- */
.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  max-width: 900px;
}
.term {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px 10px;
}
.term dt {
  font-weight: 650;
  font-size: 15px;
  margin-bottom: 4px;
}
.term dt i {
  font-family: Georgia, serif;
  font-weight: 400;
  font-style: italic;
  font-size: 12.5px;
  color: var(--ink-3);
  margin-left: 6px;
}
.term dd { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.75; }

/* ---------- 译后记 ---------- */
.afterword-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  max-width: 900px;
}
@media (min-width: 860px) {
  .afterword-cols { grid-template-columns: 1fr 1fr; }
}
.afterword-cols h3 {
  font-family: var(--serif);
  font-size: 17px;
  margin: 26px 0 10px;
}
.afterword-cols h3:first-child { margin-top: 0; }
.afterword-cols p, .afterword-cols li { font-size: 14.5px; color: var(--ink-2); }
.afterword-cols ul { padding-left: 20px; margin: 0 0 10px; }
.afterword-cols li { margin-bottom: 6px; }
.afterword-sign {
  font-family: var(--serif);
  color: var(--ink-3) !important;
  border-top: 1px dashed var(--line);
  padding-top: 14px;
  margin-top: 20px;
  font-size: 15px !important;
}

/* ---------- 参考文献 ---------- */
.refs { padding-left: 24px; max-width: 780px; }
.refs li { font-size: 13.5px; color: var(--ink-2); margin-bottom: 8px; line-height: 1.75; }

/* ---------- 回到顶部 ---------- */
.backtop {
  position: fixed;
  right: 26px;
  bottom: 26px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s, color 0.15s, border-color 0.15s;
  z-index: 80;
}
.backtop.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.backtop:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  margin-top: 40px;
}
.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 24px 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
}
.footer-brand { font-family: var(--serif); font-weight: 700; font-size: 16px; margin: 0 0 8px; }
.footer-head { font-size: 13px; letter-spacing: 0.08em; color: var(--ink-3); margin: 0 0 10px; }
.footer-col a { display: block; font-size: 14px; color: var(--ink-2); margin-bottom: 7px; }
.footer-col a:hover { color: var(--accent-deep); }
.footer-sub { font-size: 13px; color: var(--ink-3); margin: 0 0 6px; line-height: 1.8; }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .nav-inner { padding: 0 14px; gap: 10px; height: 54px; }
  .nav-links {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 6px 9px;
    font-size: 13px;
  }
  .brand-text { display: none; }
  .hero { padding: 56px 18px 44px; }
  .layout { padding: 0 18px 60px; gap: 0; }
  .section { padding-top: 52px; }
  .translation p { font-size: 15.5px; text-align: left; }
  .demo { padding: 22px 18px 18px; }
  .backtop { right: 16px; bottom: 16px; }
}

/* ---------- 打印 ---------- */
@media print {
  .topnav, .progress, .toc, .backtop, .hero-actions, .theme-toggle { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .layout { display: block; padding: 0; max-width: none; }
  .section { padding-top: 24px; page-break-inside: avoid; }
  .orig { display: none !important; }
  .figure, .demo, .guide-card, .roadmap, .data-table { box-shadow: none; }
  a { color: inherit; }
}
