/* ==========================================================================
   货币创造学习页 · 样式
   设计取向：纸张、账本、批注；正文可读优先，交互控件克制。
   ========================================================================== */

:root {
  --paper: #f5f2ea;
  --surface: #fffdf8;
  --surface-2: #ece7dc;
  --surface-3: #f9f6ef;
  --ink: #1b1a17;
  --ink-2: #55524a;
  --muted: #7b776c;
  --rule: #d9d3c5;
  --rule-strong: #b9b2a1;
  --accent: #1f5c8b;
  --accent-strong: #164568;
  --accent-soft: #e2edf5;
  --brick: #a8452e;
  --brick-soft: #f6e5de;
  --good: #2f6b46;
  --good-soft: #e3efe6;
  --warn: #80560f;
  --warn-soft: #f7ecd7;
  --focus: #1f5c8b;
  --chart-line: #2a78d6;
  --chart-fill: rgba(42, 120, 214, 0.10);
  --chart-grid: #e1e0d9;
  --chart-axis: #c3c2b7;
  --chart-text: #52514e;
  --chart-surface: #fffdf8;
  --shadow: 0 1px 0 rgba(40, 32, 18, 0.04), 0 24px 60px -38px rgba(40, 32, 18, 0.45);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  --mono: "Cascadia Code", "SF Mono", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
  --radius: 10px;
  --max: 1120px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --paper: #131310;
  --surface: #1b1a16;
  --surface-2: #25231d;
  --surface-3: #201e19;
  --ink: #f1ede3;
  --ink-2: #c9c3b5;
  --muted: #9d978a;
  --rule: #34312a;
  --rule-strong: #4a463c;
  --accent: #83b7de;
  --accent-strong: #aed3ee;
  --accent-soft: #1d2d39;
  --brick: #e29a81;
  --brick-soft: #33231e;
  --good: #79bd91;
  --good-soft: #1d2d23;
  --warn: #e0b567;
  --warn-soft: #332a1a;
  --focus: #83b7de;
  --chart-line: #3987e5;
  --chart-fill: rgba(57, 135, 229, 0.14);
  --chart-grid: #2c2c2a;
  --chart-axis: #4a4740;
  --chart-text: #c3c2b7;
  --chart-surface: #1b1a16;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.25), 0 28px 70px -40px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

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

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image:
    linear-gradient(to right, rgba(120, 110, 90, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(120, 110, 90, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
}

html[data-theme="dark"] body::before { opacity: 0.25; }

::selection { background: var(--accent-soft); color: var(--ink); }

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: var(--accent-strong); }

strong { font-weight: 650; }
em { font-style: normal; color: var(--brick); }

p { margin: 0 0 1em; }
q { quotes: "“" "”" "‘" "’"; }

.wrap {
  width: min(100% - 48px, var(--max));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 100;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

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

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

/* --------------------------------------------------------------------------
   顶栏与进度
   -------------------------------------------------------------------------- */

.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  background: transparent;
  z-index: 60;
}
.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.1s linear;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
}
@supports not (background: color-mix(in srgb, red, blue)) {
  .site-header { background: var(--paper); }
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  font-size: 15px;
  color: var(--brick);
  background: var(--surface);
}
.brand-text { font-size: 16px; }
.brand-text span { color: var(--muted); font-weight: 400; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
}
.site-nav a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 13.5px;
  letter-spacing: 0.02em;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.site-nav a:hover,
.site-nav a.is-active {
  color: var(--ink);
  border-color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  padding: 0;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-moon { display: none; }
html[data-theme="dark"] .icon-sun { display: none; }
html[data-theme="dark"] .icon-moon { display: block; }
.nav-toggle { display: none; }

/* --------------------------------------------------------------------------
   通用文本与按钮
   -------------------------------------------------------------------------- */

.eyebrow,
.section-num,
.fig-label,
.myth-tag,
.quiz-num,
.assumption-title,
.why-hard-label {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.section {
  padding: 88px 0 96px;
  border-top: 1px solid var(--rule);
}

.section-head { max-width: 760px; margin-bottom: 40px; }
.section-head h2 {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3.1vw, 2.45rem);
  line-height: 1.28;
  letter-spacing: -0.015em;
  margin: 10px 0 16px;
  font-weight: 700;
}
.section-lead {
  font-size: 17px;
  color: var(--ink-2);
  line-height: 1.85;
  margin: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--rule-strong);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}
.btn:hover { border-color: var(--ink-2); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
html[data-theme="dark"] .btn-primary { color: #131310; }
html[data-theme="dark"] .btn-primary:hover { color: #131310; }
.btn-ghost { background: transparent; }
.btn-small { padding: 7px 14px; font-size: 13px; }
.btn[disabled] { opacity: 0.55; cursor: wait; transform: none; }

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  white-space: nowrap;
  flex: none;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 64px;
  align-items: center;
  padding: 96px 0 90px;
  min-height: calc(100vh - 64px);
}

.hero-copy .eyebrow { margin-bottom: 22px; }
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5.4vw, 4.35rem);
  line-height: 1.16;
  letter-spacing: -0.035em;
  font-weight: 700;
  margin: 0 0 24px;
}
.hero-sub {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  color: var(--brick);
  margin: 0 0 20px;
  line-height: 1.6;
}
.hero-intro {
  font-size: 16.5px;
  color: var(--ink-2);
  max-width: 580px;
  line-height: 1.9;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 0;
  margin: 26px 0 30px;
  color: var(--muted);
  font-size: 13px;
}
.hero-meta span + span::before {
  content: "·";
  margin: 0 10px;
  color: var(--rule-strong);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-visual { position: relative; }
.ledger-card {
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  box-shadow: var(--shadow);
  padding: 22px 24px 18px;
  transform: rotate(-1.1deg);
  transition: transform 0.5s cubic-bezier(.2,.8,.2,1);
  position: relative;
}
.ledger-card::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  pointer-events: none;
}
.ledger-card:hover { transform: rotate(0deg) translateY(-3px); }
.ledger-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: var(--ink-2);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.ledger-stamp {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--brick);
  border: 1px solid var(--brick);
  border-radius: 3px;
  padding: 2px 7px;
  transform: rotate(2deg);
}
.ledger-card-grid {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 18px;
  padding: 20px 0 14px;
}
.ledger-divider { background: var(--rule); }
.ledger-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 0 0 12px;
}
.ledger-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--serif);
  font-size: 17px;
  margin: 0 0 8px;
  padding-bottom: 5px;
  border-bottom: 1px dotted var(--rule);
}
.ledger-line span {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.ledger-line.ledger-add { color: var(--ink); font-weight: 700; }
.ledger-line.ledger-add span { color: var(--brick); font-weight: 700; }
.ledger-foot {
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  font-size: 12.5px;
  color: var(--muted);
}
.hero-caption {
  margin: 18px 4px 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   学习目标条
   -------------------------------------------------------------------------- */

.goals-strip {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 24px;
  align-items: start;
  padding: 20px 0 26px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-top: -24px;
}
.goals-label {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  padding-top: 3px;
}
.goals-strip ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 28px;
}
.goals-strip li {
  position: relative;
  padding-left: 16px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.65;
}
.goals-strip li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border: 1px solid var(--accent);
  border-radius: 50%;
}

/* --------------------------------------------------------------------------
   01 学习困难
   -------------------------------------------------------------------------- */

.myth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-bottom: 30px;
}
.myth-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--brick);
  border-radius: var(--radius);
  padding: 24px 26px 22px;
}
.myth-tag { color: var(--brick); margin: 0 0 12px; }
.myth-card blockquote {
  margin: 0 0 16px;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink);
}
.myth-wrong { font-size: 14.5px; color: var(--ink-2); line-height: 1.8; }
.myth-wrong strong { color: var(--brick); }
.myth-source {
  margin: 0;
  padding-top: 12px;
  border-top: 1px dashed var(--rule);
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.65;
}

.why-hard {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 26px;
  padding: 26px 0 30px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 30px;
}
.why-hard-label { padding-top: 4px; color: var(--muted); }
.why-hard p { font-size: 15px; color: var(--ink-2); line-height: 1.85; }
.why-hard p:last-child { margin-bottom: 0; }

.evidence {
  background: var(--surface-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 24px 28px;
}
.evidence-title {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 14px;
}
.evidence ul { margin: 0; padding-left: 1.2em; }
.evidence li { font-size: 14px; color: var(--ink-2); line-height: 1.8; margin-bottom: 10px; }
.evidence li:last-child { margin-bottom: 0; }
.evidence strong { color: var(--ink); }
.quote-en { font-family: var(--serif); font-style: italic; color: var(--ink); }

/* --------------------------------------------------------------------------
   02 概念
   -------------------------------------------------------------------------- */

.concept-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 36px;
}
.concept-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 24px;
}
.concept-index {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 14px;
}
.concept-card h3 {
  font-family: var(--serif);
  font-size: 17px;
  margin: 0 0 10px;
}
.concept-card p { font-size: 14px; color: var(--ink-2); line-height: 1.78; margin: 0; }

.ledger-figure {
  margin: 0 0 32px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 24px 26px 20px;
}
.ledger-figure figcaption {
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 18px;
}
.fig-label {
  display: inline-block;
  margin-right: 8px;
  color: var(--brick);
}
.ledger-compare {
  display: grid;
  grid-template-columns: 1fr 34px 1fr;
  align-items: center;
  gap: 12px;
}
.ledger-box {
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-3);
}
.ledger-box-after { border-color: var(--rule-strong); }
.ledger-box-title {
  margin: 0;
  padding: 9px 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
}
.ledger-arrow {
  text-align: center;
  font-size: 20px;
  color: var(--rule-strong);
}
.t-account {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.t-account th {
  text-align: right;
  font-weight: 500;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--rule);
  font-size: 11px;
}
.t-account th:first-child,
.t-account th:nth-child(3) { text-align: left; }
.t-account th:nth-child(3),
.t-account td:nth-child(3) {
  border-left: 1px solid var(--rule);
  padding-left: 14px;
}
.t-account td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--rule);
  text-align: right;
}
.t-account td:first-child,
.t-account td:nth-child(3) { text-align: left; color: var(--ink-2); }
.t-account tr:last-child td { border-bottom: 0; }
.t-account .t-total td { font-weight: 700; background: var(--surface-2); }
.cell-add { color: var(--brick); font-weight: 700; }
.cell-add span {
  font-family: var(--mono);
  font-size: 10px;
  margin-left: 3px;
  padding: 1px 4px;
  border: 1px solid var(--brick);
  border-radius: 2px;
}
.fig-note {
  margin: 16px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.7;
}

.callout {
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 28px 0;
  border: 1px solid var(--rule);
  background: var(--surface-3);
}
.callout-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 8px;
}
.callout p:last-child { margin-bottom: 0; }
.callout-key {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
}
.callout-key .callout-title { color: var(--accent); }
.callout-warn {
  border-left: 3px solid var(--brick);
  background: var(--brick-soft);
}
.callout-warn .callout-title { color: var(--brick); }

.reserve-note {
  max-width: 820px;
  margin-top: 34px;
}
.reserve-note h3 {
  font-family: var(--serif);
  font-size: 20px;
  margin: 0 0 10px;
}
.reserve-note p { font-size: 15px; color: var(--ink-2); line-height: 1.85; }
.reserve-nuance {
  padding-left: 16px;
  border-left: 2px solid var(--rule-strong);
  font-size: 14px !important;
}

/* --------------------------------------------------------------------------
   03 两种叙事
   -------------------------------------------------------------------------- */

.narrative-shell {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 30px;
}
.tab-row {
  display: flex;
  gap: 4px;
  padding: 8px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--rule);
}
.tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 6px;
  cursor: pointer;
}
.tab:hover { color: var(--ink); }
.tab.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.narrative-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 0;
}
.narrative-steps { padding: 26px 28px; }
.narrative-step {
  display: none;
  animation: fade-in 0.25s ease;
}
.narrative-step.is-active { display: block; }
.narrative-step h3 {
  font-family: var(--serif);
  font-size: 19px;
  margin: 0 0 10px;
}
.narrative-step p { font-size: 14.5px; color: var(--ink-2); line-height: 1.85; }
.narrative-equation {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--surface-3);
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.8;
  overflow-x: auto;
}
.narrative-side {
  border-left: 1px solid var(--rule);
  padding: 26px 22px;
  background: var(--surface-3);
  display: flex;
  flex-direction: column;
}
.narrative-side-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0 0 10px;
}
.narrative-side-text {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
  flex: 1;
}
.narrative-progress {
  display: flex;
  gap: 6px;
  margin: 16px 0;
}
.narrative-progress span {
  display: block;
  height: 3px;
  flex: 1;
  background: var(--rule);
  border-radius: 2px;
}
.narrative-progress span.is-on { background: var(--accent); }
.narrative-controls { display: flex; gap: 8px; }
.narrative-controls .btn { flex: 1; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   04 例子
   -------------------------------------------------------------------------- */

.assumption-box {
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 26px;
  background: var(--surface-3);
}
.assumption-title { margin: 0 0 14px; color: var(--muted); }
.assumption-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.assumption-grid p {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.assumption-grid span { font-size: 12px; color: var(--muted); }
.assumption-grid strong {
  font-family: var(--mono);
  font-size: 16px;
  color: var(--ink);
}
.assumption-foot { margin: 14px 0 0; font-size: 12px; color: var(--muted); }

.formula-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 34px;
}
.formula-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.formula-label { font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.formula {
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--ink);
  margin: 0 0 8px;
  overflow-x: auto;
  white-space: nowrap;
}
.formula-calc {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-2);
  margin: 0;
}
.formula-calc strong { color: var(--brick); }

.rounds {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-bottom: 28px;
}
.rounds-head h3 {
  font-family: var(--serif);
  font-size: 19px;
  margin: 0 0 6px;
}
.rounds-head p { font-size: 13.5px; color: var(--ink-2); }
.table-scroll { overflow-x: auto; margin-top: 16px; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  min-width: 480px;
}
.data-table th {
  text-align: right;
  font-weight: 500;
  font-size: 11.5px;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule-strong);
  white-space: nowrap;
}
.data-table th:first-child,
.data-table td:first-child { text-align: left; }
.data-table td {
  text-align: right;
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
}
.data-table tbody tr:hover { background: var(--surface-3); }
.row-muted td { color: var(--muted); }
.row-total td { font-weight: 700; background: var(--surface-2); border-bottom: 0; }
.table-note { margin: 12px 0 0; font-size: 12px; color: var(--muted); }

/* --------------------------------------------------------------------------
   05 实验室
   -------------------------------------------------------------------------- */

.lab-shell {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.lab-controls {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 22px;
  position: sticky;
  top: 88px;
}
.control { margin-bottom: 22px; }
.control-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.control-head label { font-size: 13.5px; color: var(--ink); font-weight: 600; }
.control-head output {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--brick);
  font-weight: 700;
}
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--rule);
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 1px var(--accent);
}
input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 1px var(--accent);
}
.control-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}
.lab-hint {
  margin: 0;
  padding-top: 14px;
  border-top: 1px dashed var(--rule);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.65;
}
.lab-output { min-width: 0; }
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 14px 14px 12px;
}
.stat-label { margin: 0 0 4px; font-size: 11.5px; color: var(--muted); }
.stat-value {
  margin: 0;
  font-family: var(--sans);
  font-size: 27px;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--ink);
  font-variant-numeric: proportional-nums;
}
.stat-foot { margin: 4px 0 0; font-family: var(--mono); font-size: 10px; color: var(--muted); }

.chart-figure {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 18px 20px 16px;
}
.chart-figure figcaption {
  font-size: 12.5px;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.chart-unit { color: var(--muted); font-size: 11px; margin-left: 6px; }
.chart-wrap { position: relative; }
#labChart { display: block; width: 100%; height: auto; overflow: visible; }
#labChart text { font-family: var(--sans); font-size: 11px; fill: var(--chart-text); }
#labChart .chart-grid { stroke: var(--chart-grid); stroke-width: 1; }
#labChart .chart-axis { stroke: var(--chart-axis); stroke-width: 1; }
#labChart .chart-line { fill: none; stroke: var(--chart-line); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
#labChart .chart-area { fill: var(--chart-fill); }
#labChart .chart-dot { fill: var(--chart-line); stroke: var(--chart-surface); stroke-width: 2; }
#labChart .chart-label { fill: var(--ink); font-weight: 600; font-size: 12px; }
#labChart .chart-tick { fill: var(--muted); font-size: 10.5px; }
#labChart .chart-hit { fill: transparent; cursor: crosshair; }
#labChart .chart-crosshair { stroke: var(--chart-axis); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-tooltip {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -100%);
  background: var(--ink);
  color: var(--paper);
  padding: 7px 10px;
  border-radius: 5px;
  font-size: 11.5px;
  line-height: 1.5;
  white-space: nowrap;
  transition: opacity 0.12s;
  z-index: 3;
}
.chart-tooltip.is-on { opacity: 1; }
.chart-tooltip strong { color: #fff; }
.chart-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}
.chart-caption { margin: 0; font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.chart-table { margin-top: 12px; }
.data-table-compact { min-width: 0; font-size: 12.5px; }
.data-table-compact th, .data-table-compact td { padding: 6px 10px; }

.predict-box {
  margin-top: 16px;
  background: var(--surface-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.predict-question { font-size: 13.5px; font-weight: 600; margin: 0 0 10px; }
.predict-options { display: flex; flex-wrap: wrap; gap: 8px; }
.predict-btn {
  border: 1px solid var(--rule-strong);
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
}
.predict-btn:hover { border-color: var(--ink-2); color: var(--ink); }
.predict-btn.is-correct { background: var(--good-soft); border-color: var(--good); color: var(--good); }
.predict-btn.is-wrong { background: var(--brick-soft); border-color: var(--brick); color: var(--brick); }
.predict-result { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.7; min-height: 0; }

/* --------------------------------------------------------------------------
   06 练习
   -------------------------------------------------------------------------- */

.quiz { display: grid; gap: 16px; }
.quiz-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.quiz-num { margin: 0 0 6px; color: var(--muted); }
.quiz-card h3 {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.55;
  margin: 0 0 14px;
  font-weight: 600;
}
.quiz-options { display: grid; gap: 8px; }
.quiz-options button {
  text-align: left;
  border: 1px solid var(--rule);
  background: var(--surface-3);
  color: var(--ink-2);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.6;
  padding: 10px 14px;
  border-radius: 7px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.quiz-options button:hover { border-color: var(--rule-strong); background: var(--surface); color: var(--ink); }
.quiz-options button.is-correct { background: var(--good-soft); border-color: var(--good); color: var(--good); }
.quiz-options button.is-wrong { background: var(--brick-soft); border-color: var(--brick); color: var(--brick); }
.quiz-options button[disabled] { cursor: default; }
.quiz-feedback {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px dashed var(--rule);
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.75;
  display: none;
}
.quiz-feedback.is-on { display: block; }
.quiz-score {
  margin: 14px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   07 AI
   -------------------------------------------------------------------------- */

.ai-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: start;
}
.ai-main {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}
.ai-banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 13px 20px;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--rule);
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.6;
}
.ai-banner p { margin: 0; }
.ai-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 7px;
  flex: none;
}
.ai-tabs {
  display: flex;
  gap: 4px;
  padding: 8px;
  border-bottom: 1px solid var(--rule);
}
.ai-tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: 6px;
  cursor: pointer;
}
.ai-tab:hover { color: var(--ink); }
.ai-tab.is-active { background: var(--surface-2); color: var(--ink); }
.ai-panel { padding: 20px; }
.ai-prompt {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.8;
  background: var(--surface-3);
  border: 1px dashed var(--rule-strong);
  border-radius: 7px;
  padding: 12px 14px;
}
.ai-prompt q { font-family: var(--serif); color: var(--ink); }
.ai-input {
  width: 100%;
  resize: vertical;
  min-height: 96px;
  border: 1px solid var(--rule-strong);
  border-radius: 7px;
  background: var(--surface-3);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  line-height: 1.7;
  padding: 12px 14px;
  margin-top: 12px;
}
.ai-input:focus { background: var(--surface); }
.ai-input::placeholder { color: var(--muted); }
.ai-input-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}
.ai-input-foot span { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.ai-hint { margin: 10px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.ai-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.ai-chips button {
  border: 1px solid var(--rule);
  background: var(--surface-3);
  color: var(--ink-2);
  font: inherit;
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
}
.ai-chips button:hover { border-color: var(--accent); color: var(--accent); }

.ai-response {
  margin: 0 20px 20px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface-3);
  padding: 16px 18px;
  min-height: 120px;
}
.ai-empty-title {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--ink-2);
}
.ai-empty p:last-child { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.65; }
.ai-answer p {
  font-size: 14px;
  line-height: 1.8;
  margin: 0 0 10px;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ai-answer p:last-child { margin-bottom: 0; }
.ai-answer .ai-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 8px;
}
.ai-answer .ai-meta {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--rule);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}
.ai-answer.is-error { border-color: var(--brick); background: var(--brick-soft); }
.ai-answer.is-error p { color: var(--brick); }
.ai-question {
  font-family: var(--serif);
  font-size: 13.5px;
  color: var(--ink-2);
  background: var(--surface);
  border-left: 2px solid var(--rule-strong);
  padding: 7px 10px;
  margin: 0 0 14px;
}
.ai-response.is-refusal {
  border-color: var(--warn);
  background: var(--warn-soft);
}
.ai-response.is-refusal .ai-label { color: var(--warn); }
.ai-thinking { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.ai-thinking i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block;
  animation: pulse 1s infinite ease-in-out;
}
.ai-thinking i:nth-child(2) { animation-delay: 0.15s; }
.ai-thinking i:nth-child(3) { animation-delay: 0.3s; }
@keyframes pulse { 0%,100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-2px); } }
.ai-status { margin: 0 20px 18px; font-family: var(--mono); font-size: 10.5px; color: var(--muted); min-height: 1em; }

.ai-side {
  background: var(--surface-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.ai-side-title { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; color: var(--muted); margin: 0 0 14px; text-transform: uppercase; }
.material-list { list-style: none; margin: 0; padding: 0; }
.material-list li { padding: 10px 0; border-top: 1px solid var(--rule); }
.material-list li:first-child { border-top: 0; padding-top: 0; }
.material-list a { font-size: 12.5px; font-weight: 600; text-decoration: none; }
.material-list a:hover { text-decoration: underline; }
.material-list span { display: block; font-size: 10.5px; color: var(--muted); line-height: 1.55; margin-top: 3px; }
.ai-side-links { display: flex; gap: 14px; margin: 16px 0 12px; font-size: 11.5px; }
.ai-side-note { margin: 0; padding-top: 12px; border-top: 1px dashed var(--rule); font-size: 11px; color: var(--muted); line-height: 1.65; }

/* --------------------------------------------------------------------------
   08 来源
   -------------------------------------------------------------------------- */

.sources-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 44px;
}
.sources-grid h3 {
  font-family: var(--serif);
  font-size: 18px;
  margin: 0 0 14px;
}
.source-list { margin: 0; padding-left: 1.2em; }
.source-list li { font-size: 13px; color: var(--ink-2); line-height: 1.8; margin-bottom: 16px; }
.source-note { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.limit-list { margin: 0; padding-left: 1.1em; }
.limit-list li { font-size: 13px; color: var(--ink-2); line-height: 1.8; margin-bottom: 12px; }
.limit-list strong { color: var(--ink); }

.author-note {
  margin-top: 48px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 11.5px;
  color: var(--muted);
}
.author-note p { margin: 0; }

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 26px 0 40px;
  background: var(--surface-3);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 11.5px;
  color: var(--muted);
}
.footer-inner p { margin: 0; }
.footer-inner a { text-decoration: none; }

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; min-height: 0; gap: 44px; padding-top: 72px; }
  .hero-visual { max-width: 520px; }
  .concept-grid { grid-template-columns: 1fr 1fr; }
  .concept-card:last-child { grid-column: 1 / -1; }
  .lab-shell { grid-template-columns: 1fr; }
  .lab-controls { position: static; }
  .ai-shell { grid-template-columns: 1fr; }
  .narrative-body { grid-template-columns: 1fr; }
  .narrative-side { border-left: 0; border-top: 1px solid var(--rule); }
  .sources-grid { grid-template-columns: 1fr; gap: 30px; }
}

@media (max-width: 780px) {
  html { scroll-padding-top: 72px; }
  .wrap { width: min(100% - 32px, var(--max)); }
  .section { padding: 64px 0 72px; }
  .header-inner { min-height: 58px; }
  .brand-text { font-size: 14px; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 16px 14px;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    box-shadow: 0 12px 24px -18px rgba(0,0,0,.4);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 10px 4px; border-bottom: 1px solid var(--rule); font-size: 14px; }
  .nav-toggle { display: grid; }
  .hero { padding: 52px 0 64px; }
  .hero h1 { font-size: clamp(2.15rem, 9vw, 3rem); }
  .hero-intro { font-size: 15px; }
  .goals-strip { grid-template-columns: 1fr; gap: 10px; margin-top: -12px; }
  .goals-strip ul { grid-template-columns: 1fr; }
  .myth-grid, .concept-grid { grid-template-columns: 1fr; }
  .concept-card:last-child { grid-column: auto; }
  .why-hard { grid-template-columns: 1fr; gap: 8px; }
  .ledger-compare { grid-template-columns: 1fr; }
  .ledger-arrow { transform: rotate(90deg); padding: 4px 0; }
  .assumption-grid { grid-template-columns: 1fr 1fr; }
  .formula-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .chart-foot { flex-direction: column; }
  .author-note { flex-direction: column; gap: 6px; }
  .footer-inner { flex-direction: column; gap: 6px; }
  .t-account { font-size: 11.5px; }
  .t-account th, .t-account td { padding: 7px 7px; }
  .ai-panel { padding: 16px; }
  .ai-response { margin: 0 16px 16px; }
  .ai-status { margin: 0 16px 16px; }
}

@media (max-width: 480px) {
  .hero-meta { font-size: 12px; gap: 4px 14px; }
  .hero-meta span + span::before { content: none; }
  .assumption-grid { grid-template-columns: 1fr; }
  .stat-value { font-size: 23px; }
  .tab { font-size: 12.5px; padding: 9px 8px; }
  .ai-tab { font-size: 12px; }
}

@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;
  }
}

@media print {
  .site-header, .progress, .hero-actions, .narrative-controls, .ai-panel, .ai-tabs, .ai-banner, .site-footer { display: none !important; }
  body { background: #fff; color: #000; }
  body::before { display: none; }
  .section { break-inside: avoid; }
}
