/* ==========================================================================
   第3章 智能写作 · 交互实验版
   设计语汇：浅色纸张 / 衬线标题 / 细线分隔 / 印刷编号
   ========================================================================== */

:root {
  --paper: #f8f6f0;
  --paper-2: #fdfbf7;
  --surface: #ffffff;
  --surface-soft: #fbf8f2;

  --ink: #191a1c;
  --ink-2: #3f434a;
  --ink-3: #6b7079;
  --muted: #949aa3;

  --line: #e6e0d2;
  --line-2: #efeade;
  --line-3: #f4f0e6;

  --teal: #1d6a61;
  --teal-deep: #144d47;
  --teal-soft: #e7f0ed;
  --clay: #b4512b;
  --clay-soft: #f9ece4;
  --indigo: #31537c;
  --indigo-soft: #eaeff6;
  --gold: #9a7a3c;
  --gold-soft: #f6efe1;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;

  --shadow-s: 0 1px 2px rgba(30, 24, 12, .04), 0 1px 1px rgba(30, 24, 12, .03);
  --shadow-m: 0 2px 4px rgba(30, 24, 12, .04), 0 16px 32px -24px rgba(30, 24, 12, .25);
  --shadow-l: 0 4px 8px rgba(30, 24, 12, .05), 0 32px 56px -32px rgba(30, 24, 12, .3);

  --serif: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Inter", "Helvetica Neue", -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", "SFMono-Regular", Consolas, monospace;

  --max: 1120px;
  --read: 720px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-image:
    radial-gradient(circle at 12% 0%, rgba(180, 81, 43, .045), transparent 42%),
    radial-gradient(circle at 88% 6%, rgba(29, 106, 97, .05), transparent 40%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

::selection { background: rgba(29, 106, 97, .16); }

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

button:focus:not(:focus-visible) { outline: none; }

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

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

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

/* ---------- 顶栏 ---------- */

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  background: rgba(248, 246, 240, .82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line-2);
}

.topbar-inner {
  max-width: var(--max);
  margin: 0 auto;
  height: 62px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: .02em;
  white-space: nowrap;
}

.brand b { font-weight: 700; }

.brand span {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.nav a {
  position: relative;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--ink-3);
  white-space: nowrap;
  transition: color .18s ease, background .18s ease;
}

.nav a:hover { color: var(--ink); background: rgba(255, 255, 255, .8); }

.nav a.is-active {
  color: var(--teal-deep);
  background: var(--teal-soft);
  font-weight: 600;
}

.nav-close { display: none; }

.topbar-progress {
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--teal), var(--clay));
  transition: width .1s linear;
}

.menu-btn {
  display: none;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
}

/* ---------- 布局 ---------- */

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 28px;
}

main { padding-top: 62px; }

.section {
  padding: 64px 0;
  border-top: 1px solid var(--line-2);
}

.section:first-of-type { border-top: 0; }

.section.tight { padding: 44px 0; }

.read { max-width: var(--read); }

/* ---------- 标题系统 ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 600;
  margin: 0 0 18px;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: .5;
}

.eyebrow.clay { color: var(--clay); }
.eyebrow.indigo { color: var(--indigo); }
.eyebrow.gold { color: var(--gold); }

.display {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(30px, 4.4vw, 52px);
  line-height: 1.28;
  letter-spacing: -.01em;
  margin: 0 0 20px;
}

.display .light {
  color: var(--ink-3);
  font-weight: 400;
}

h2.head {
  font-family: var(--serif);
  font-size: clamp(23px, 2.6vw, 31px);
  line-height: 1.4;
  font-weight: 700;
  margin: 0 0 14px;
  letter-spacing: -.005em;
}

h3.sub {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  margin: 34px 0 12px;
}

h4.mini {
  font-size: 14px;
  letter-spacing: .04em;
  font-weight: 700;
  margin: 22px 0 8px;
  color: var(--ink-2);
}

.lede {
  font-size: 17.5px;
  line-height: 1.85;
  color: var(--ink-2);
  margin: 0 0 12px;
  max-width: 660px;
}

.prose p {
  margin: 0 0 16px;
  color: var(--ink-2);
}

.prose p:last-child { margin-bottom: 0; }

.prose strong { color: var(--ink); font-weight: 600; }

.num-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--muted);
}

/* ---------- 首屏 ---------- */

.hero {
  padding: 84px 0 56px;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 56px;
  align-items: end;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.hero-meta div { min-width: 92px; }

.hero-meta dt {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3px;
}

.hero-meta dd {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
}

.hero-side {
  padding-bottom: 6px;
}

.quote {
  border-left: 2px solid var(--clay);
  padding: 2px 0 2px 18px;
  margin: 0 0 24px;
}

.quote p {
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.95;
  color: var(--ink-2);
  margin: 0;
}

.quote cite {
  display: block;
  margin-top: 10px;
  font-style: normal;
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: .04em;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: translateY(1px) scale(.995); }

.btn-primary {
  background: var(--ink);
  color: #fdfbf6;
  box-shadow: 0 2px 6px rgba(25, 26, 28, .18), 0 14px 28px -18px rgba(25, 26, 28, .8);
}

.btn-primary:hover { background: #000; box-shadow: 0 4px 10px rgba(25, 26, 28, .22), 0 18px 32px -18px rgba(25, 26, 28, .7); }

.btn-accent {
  background: linear-gradient(180deg, #22786d, #1b5f57);
  color: #f7fdfb;
  box-shadow: 0 2px 6px rgba(20, 77, 71, .22), 0 16px 30px -18px rgba(20, 77, 71, .75);
}

.btn-accent:hover { filter: brightness(1.06); }

.btn-ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink-2);
}

.btn-ghost:hover { border-color: #cdc5b3; color: var(--ink); }

.btn-sm { padding: 8px 14px; font-size: 13px; }

.btn[disabled] {
  opacity: .55;
  cursor: not-allowed;
  transform: none !important;
}

.btn .spin {
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}

.btn.is-busy .spin { display: block; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 选项胶囊 ---------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
  font-family: var(--sans);
  text-align: left;
}

.chip:hover { border-color: #cdc5b3; background: #fffdf8; }

.chip.on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.chip.on > span { color: rgba(255, 255, 255, .7) !important; }

.chip:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 卡片 ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-s);
}

.card-pad { padding: 26px 28px; }

.card-soft {
  background: var(--surface-soft);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  padding: 18px 20px;
}

.grid {
  display: grid;
  gap: 18px;
}

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

/* ---------- 章节地图卡 ---------- */

.map-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 26px 24px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-s);
  transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
  position: relative;
  overflow: hidden;
}

.map-card::after {
  content: "";
  position: absolute;
  inset: auto -30% -60% auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow, rgba(29,106,97,.10)), transparent 68%);
  opacity: 0;
  transition: opacity .35s ease;
}

.map-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-m);
  border-color: #d9d2c2;
}

.map-card:hover::after { opacity: 1; }

.map-card .idx {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .18em;
  color: var(--muted);
}

.map-card h3 {
  font-family: var(--serif);
  font-size: 19.5px;
  line-height: 1.45;
  margin: 0;
  font-weight: 700;
}

.map-card p {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink-3);
  margin: 0;
  flex: 1;
}

.map-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.map-card .go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--teal);
  margin-top: 6px;
}

.map-card .go svg { transition: transform .25s ease; }
.map-card:hover .go svg { transform: translateX(4px); }

/* ---------- 标签 ---------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
  background: var(--line-3);
  color: var(--ink-3);
  border: 1px solid transparent;
  white-space: nowrap;
}

.tag.teal { background: var(--teal-soft); color: var(--teal-deep); }
.tag.clay { background: var(--clay-soft); color: #8c3d1f; }
.tag.indigo { background: var(--indigo-soft); color: #27456a; }
.tag.gold { background: var(--gold-soft); color: #7a5f2a; }
.tag.outline { background: transparent; border-color: var(--line); color: var(--ink-3); }
.tag.red { background: #fbeaea; color: #a33a34; }

/* ---------- 表单 ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}

.field > label {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .03em;
  color: var(--ink-2);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.field > label .hint {
  font-weight: 400;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0;
}

.input, .textarea, .select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
  outline: none;
}

.textarea { min-height: 92px; resize: vertical; font-family: var(--sans); line-height: 1.7; }

.input::placeholder, .textarea::placeholder { color: #b3b8bf; }

.input:focus, .textarea:focus, .select:focus {
  border-color: #a9c4bd;
  box-shadow: 0 0 0 3px rgba(29, 106, 97, .1);
  background: #fffefb;
}

.input-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }

.char-count {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  align-self: flex-end;
  margin-top: -3px;
  letter-spacing: .02em;
}

.char-count.over { color: var(--clay); font-weight: 700; }

/* ---------- 实验台 ---------- */

.lab {
  background: linear-gradient(180deg, #fffdfa, var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-m);
  overflow: hidden;
  margin: 26px 0 8px;
}

.lab-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line-2);
  background: rgba(251, 248, 242, .7);
  flex-wrap: wrap;
}

.lab-head .dot-strip { display: flex; gap: 5px; }

.lab-head .dot-strip i {
  width: 7px; height: 7px; border-radius: 50%;
  background: #ded7c7;
  display: block;
}

.lab-head .lab-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--ink-2);
  text-transform: uppercase;
  font-family: var(--mono);
}

.lab-head .lab-desc {
  font-size: 12.5px;
  color: var(--muted);
  margin-left: auto;
}

.lab-body { padding: 26px 24px 28px; }

.lab-split {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

.lab-split.wide-left { grid-template-columns: minmax(0, 400px) minmax(0, 1fr); }

.panel-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--muted);
  text-transform: uppercase;
  font-family: var(--mono);
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-title::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line-2);
}

/* ---------- 步骤条 ---------- */

.stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 18px 0 20px;
  position: relative;
}

.stepper .st {
  text-align: center;
  position: relative;
  padding-top: 26px;
  font-size: 11.5px;
  color: var(--muted);
  transition: color .3s ease;
}

.stepper .st::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e6e0d2;
  border: 2px solid #fdfbf7;
  box-shadow: 0 0 0 1px #e6e0d2;
  transition: all .3s ease;
  z-index: 2;
}

.stepper .st::after {
  content: "";
  position: absolute;
  top: 11px;
  left: 50%;
  width: 100%;
  height: 1px;
  background: #eae4d7;
  z-index: 1;
}

.stepper .st:last-child::after { display: none; }

.stepper .st.is-run { color: var(--teal); font-weight: 700; }
.stepper .st.is-run::before {
  background: var(--teal);
  box-shadow: 0 0 0 1px var(--teal), 0 0 0 5px rgba(29, 106, 97, .1);
  animation: pulse 1.2s ease infinite;
}
.stepper .st.is-done { color: var(--ink-2); }
.stepper .st.is-done::before { background: var(--teal); box-shadow: 0 0 0 1px var(--teal); }
.stepper .st.is-done::after { background: #cfe0da; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 1px var(--teal), 0 0 0 5px rgba(29, 106, 97, .12); }
  50% { box-shadow: 0 0 0 1px var(--teal), 0 0 0 9px rgba(29, 106, 97, .04); }
}

/* ---------- 结果卡 ---------- */

.results { display: flex; flex-direction: column; gap: 18px; }

.result {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .5s ease, transform .5s ease, border-color .3s ease;
}

.result.in { opacity: 1; transform: none; }

.result.sel { border-color: #b6cfc8; box-shadow: 0 0 0 3px rgba(29, 106, 97, .08); }

.result-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line-2);
  flex-wrap: wrap;
}

.result-head .ver {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--ink);
  color: #fff;
}

.result-head .ver.a { background: var(--teal-deep); }
.result-head .ver.b { background: var(--indigo); }
.result-head .ver.c { background: var(--clay); }

.result-head .r-title {
  font-family: var(--serif);
  font-size: 15.5px;
  font-weight: 700;
}

.result-head .r-strategy {
  font-size: 11.5px;
  color: var(--muted);
  margin-left: auto;
  font-family: var(--mono);
  letter-spacing: .02em;
}

.result-body {
  padding: 20px 22px 22px;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.95;
  color: #24262a;
  min-height: 60px;
}

.result-body p { margin: 0 0 12px; }
.result-body p:last-child { margin-bottom: 0; }
.result-body .indent { text-indent: 2em; }
.result-body h5 {
  font-family: var(--serif);
  font-size: 16.5px;
  text-align: center;
  margin: 0 0 16px;
  font-weight: 700;
  letter-spacing: .04em;
}
.result-body .doc-end { text-align: right; margin-top: 18px; }
.result-body .doc-end span { display: block; }
.result-body ol, .result-body ul { margin: 0 0 12px; padding-left: 1.6em; }
.result-body li { margin-bottom: 6px; }

.result-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 11px 18px;
  border-top: 1px dashed var(--line-2);
  background: #fffdf9;
  font-size: 11.5px;
  color: var(--muted);
}

.metric {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .01em;
  color: var(--ink-3);
}

.metric b { font-size: 12.5px; color: var(--ink); font-weight: 700; }

.metric.good b { color: var(--teal); }
.metric.bad b { color: var(--clay); }

/* 打字光标 */

.caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  background: var(--teal);
  vertical-align: -2px;
  margin-left: 2px;
  animation: blink .9s step-end infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* 瑕疵标记 */

mark.flaw {
  background: rgba(180, 81, 43, .1);
  color: #8c3d1f;
  border-bottom: 1.5px dotted var(--clay);
  padding: 0 1px;
  border-radius: 2px;
  cursor: help;
  position: relative;
}

/* ---------- 空态 ---------- */

.empty {
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  padding: 34px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  background: repeating-linear-gradient(135deg, #fffdf8, #fffdf8 12px, #fcfaf3 12px, #fcfaf3 24px);
}

.empty svg { margin: 0 auto 12px; opacity: .45; }

/* ---------- 质检 ---------- */

.score-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.score {
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  padding: 16px 16px 14px;
  background: var(--surface);
  text-align: center;
}

.score .label { font-size: 12px; color: var(--ink-3); margin-bottom: 6px; }

.score .ring { position: relative; width: 86px; height: 86px; margin: 0 auto 6px; }

.score .ring svg { transform: rotate(-90deg); }

.score .ring .val {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
}

.score .ring .val small { font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 1px; }

.score .cap { font-size: 11px; color: var(--muted); }

.issue-list { display: flex; flex-direction: column; gap: 10px; }

.issue {
  display: flex;
  gap: 12px;
  padding: 13px 16px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: 13.5px;
  line-height: 1.7;
  animation: fadeUp .5s ease both;
}

.issue .nb {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  background: var(--clay-soft); color: #8c3d1f;
  margin-top: 2px;
}

.issue .txt { flex: 1; }
.issue .txt b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 2px; }
.issue .txt span { color: var(--ink-3); }
.issue .fix {
  display: block;
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--teal-deep);
  background: var(--teal-soft);
  padding: 5px 9px;
  border-radius: 6px;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 书中原图 ---------- */

.origin {
  margin-top: 18px;
  border-top: 1px dashed var(--line);
  padding-top: 14px;
}

.origin-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--ink-3);
  letter-spacing: .02em;
}

.origin-toggle .plus {
  width: 16px; height: 16px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px;
  line-height: 1;
  transition: transform .25s ease;
  color: var(--ink-3);
  background: #fff;
}

.origin-toggle[aria-expanded="true"] .plus { transform: rotate(45deg); }

.origin-body {
  margin-top: 14px;
  display: none;
}

.origin-body.open { display: block; animation: fadeUp .4s ease both; }

.origin-fig {
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  overflow: hidden;
  background: #fff;
}

.origin-fig img { width: 100%; height: auto; }

.origin-cap {
  padding: 8px 12px;
  font-size: 11.5px;
  color: var(--muted);
  border-top: 1px solid var(--line-2);
  background: var(--surface-soft);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

/* ---------- 概念卡 ---------- */

.concept {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface);
}

.concept .k {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--teal);
  font-weight: 700;
  letter-spacing: .05em;
  padding-top: 2px;
}

.concept h4 {
  margin: 0 0 5px;
  font-size: 14.5px;
  font-weight: 700;
}

.concept p {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-3);
}

/* ---------- 引言条 ---------- */

.strip {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-soft);
  font-size: 13.5px;
  color: var(--ink-2);
  flex-wrap: wrap;
}

.strip b { color: var(--ink); }

/* ---------- 页脚 ---------- */

.footer {
  border-top: 1px solid var(--line);
  padding: 40px 0 56px;
  margin-top: 20px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 44px;
  padding-top: 26px;
  border-top: 1px solid var(--line-2);
}

.pager a {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  min-width: 180px;
  transition: border-color .2s ease, transform .2s ease;
}

.pager a:hover { border-color: #cdc5b3; transform: translateY(-2px); }

.pager a .dir { font-size: 11px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.pager a .ttl { font-family: var(--serif); font-size: 14.5px; font-weight: 700; }
.pager a.next { text-align: right; margin-left: auto; }

/* ---------- 目录浮层 ---------- */

.toc-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(24, 22, 18, .32);
  backdrop-filter: blur(3px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 20px 40px;
  overflow-y: auto;
}

.toc-overlay.open { display: flex; }

.toc-card {
  background: var(--paper-2);
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  width: min(720px, 100%);
  padding: 34px 36px;
  box-shadow: var(--shadow-l);
  animation: fadeUp .3s ease both;
}

.toc-card h3 {
  font-family: var(--serif);
  font-size: 22px;
  margin: 0 0 4px;
}

.toc-card .sub { font-size: 13px; color: var(--muted); margin: 0 0 22px; }

.toc-list { display: flex; flex-direction: column; gap: 2px; }

.toc-item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 9px;
  transition: background .18s ease;
}

.toc-item:hover { background: #fff; }

.toc-item .n { font-family: var(--mono); font-size: 11px; color: var(--muted); width: 26px; flex: 0 0 auto; }
.toc-item .t { font-family: var(--serif); font-size: 15px; font-weight: 700; }
.toc-item .d { font-size: 12px; color: var(--muted); margin-left: auto; text-align: right; }

/* ---------- 揭示动画 ---------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .7s cubic-bezier(.22, .61, .36, 1), transform .7s cubic-bezier(.22, .61, .36, 1);
}

.reveal.in { opacity: 1; transform: none; }

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

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .hero { padding: 60px 0 40px; }
  .lab-split, .lab-split.wide-left { grid-template-columns: 1fr; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .score-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
}

@media (max-width: 760px) {
  .wrap { padding: 0 18px; }
  .topbar-inner { padding: 0 16px; height: 56px; gap: 12px; }
  main { padding-top: 56px; }
  .brand span { display: none; }
  .menu-btn { display: inline-flex; }
  .nav {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--paper-2);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    padding: 10px 16px 16px;
    gap: 2px;
    box-shadow: var(--shadow-m);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 11px 12px; border-radius: 8px; font-size: 14.5px; }
  .section { padding: 44px 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .card-pad { padding: 20px; }
  .lab-body { padding: 18px 16px 20px; }
  .lab-head { padding: 13px 16px; }
  .lab-head .lab-desc { display: none; }
  .input-row { grid-template-columns: 1fr; }
  .score-row { grid-template-columns: 1fr; }
  .score { display: flex; align-items: center; gap: 14px; text-align: left; }
  .score .ring { margin: 0; width: 64px; height: 64px; }
  .score .ring .val { font-size: 16px; }
  .result-body { padding: 16px; font-size: 14.5px; }
  .pager { flex-direction: column; }
  .pager a.next { text-align: left; }
  .display { font-size: 29px; }
  .hero-meta { gap: 18px; }
  .stepper .st { font-size: 10.5px; }
}

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

/* ---------- 嵌入模式（iframe） ---------- */

.is-embed .topbar,
.is-embed .footer,
.is-embed .pager { display: none !important; }

.is-embed main { padding-top: 0; }

.is-embed .hero { padding: 44px 0 36px; }

.is-embed .section { padding: 48px 0; }

/* ---------- 打印 ---------- */

@media print {
  .topbar, .cta-row, .menu-btn, .pager, .origin-toggle { display: none !important; }
  body { background: #fff; }
  .lab { box-shadow: none; break-inside: avoid; }
}
