/* =========================================================================
   ADP · FDE 认证课程 —— 本地阅读器
   设计要点：冷中性纸 + 深松绿；中文苹方无衬线，Latin 数字用 Georgia 衬线；
   正文左侧一条"进度脊"是全页唯一的重元素，其余一律收声。
   ========================================================================= */

:root {
  /* 色板 —— 浅色 */
  --paper:        #f7f8f8;
  --paper-raised: #ffffff;
  --paper-sunken: #eef0f1;
  --ink:          #16181c;
  --ink-2:        #5a6270;
  --ink-3:        #878f9c;
  --rule:         #e1e5ea;
  --rule-strong:  #cdd4dc;
  --accent:       #2f6f5e;
  --accent-ink:   #23594b;
  --accent-soft:  #e6efec;
  --ochre:        #9a6a1e;
  --ochre-soft:   #f5eedf;
  --shadow:       0 1px 2px rgba(22, 24, 28, .05);

  /* 字体 */
  /* 四套正文字体，都是 macOS 自带，不联网 */
  --font-sans:  "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-serif: "Songti SC", "STSong", "Source Han Serif SC", Georgia, serif;
  --font-kai:   "Kaiti SC", "STKaiti", "楷体-简", serif;
  --font-hei:   "Hiragino Sans GB", "Heiti SC", "PingFang SC", sans-serif;
  --font-cjk: var(--font-sans);
  --font-ui:  -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, var(--font-cjk);
  --font-num: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;

  /* 字阶：17px 正文，1.25 小三度。--t-scale 由阅读设置统一缩放，层级关系不变 */
  --t-scale: 1;
  --t-xs:   calc(13px   * var(--t-scale));
  --t-sm:   calc(14.5px * var(--t-scale));
  --t-base: calc(17px   * var(--t-scale));
  --t-md:   calc(19px   * var(--t-scale));
  --t-lg:   calc(21px   * var(--t-scale));
  --t-xl:   calc(27px   * var(--t-scale));
  --t-2xl:  calc(34px   * var(--t-scale));
  --t-3xl:  calc(42px   * var(--t-scale));

  --lh-body: 1.9;
  --wt-body: 400;
  --measure: calc(680px * var(--t-scale));  /* 正文行宽，约 40 汉字。用绝对值，否则不同字号会各自算出不同宽度。
                        宽屏下逐档放开，见下方断点 */
  --wide: var(--measure);  /* 图、表、视频的宽度。默认与正文同宽；
                              想让图冲出正文栏，改成 1080px 之类的固定值即可 */
  --toc-w: 282px;
  --radius: 6px;
}

:root[data-theme="dark"] {
  --paper:        #14161a;
  --paper-raised: #1b1e24;
  --paper-sunken: #101216;
  --ink:          #e6e8ec;
  --ink-2:        #97a0ae;
  --ink-3:        #6e7784;
  --rule:         #262a31;
  --rule-strong:  #363c45;
  --accent:       #6fbfa3;
  --accent-ink:   #8fd3ba;
  --accent-soft:  #1b2a25;
  --ochre:        #d7a95c;
  --ochre-soft:   #2a2519;
  --shadow:       0 1px 2px rgba(0, 0, 0, .4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:        #14161a;
    --paper-raised: #1b1e24;
    --paper-sunken: #101216;
    --ink:          #e6e8ec;
    --ink-2:        #97a0ae;
    --ink-3:        #6e7784;
    --rule:         #262a31;
    --rule-strong:  #363c45;
    --accent:       #6fbfa3;
    --accent-ink:   #8fd3ba;
    --accent-soft:  #1b2a25;
    --ochre:        #d7a95c;
    --ochre-soft:   #2a2519;
    --shadow:       0 1px 2px rgba(0, 0, 0, .4);
  }
}

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

html { scroll-behavior: smooth; scroll-padding-top: 32px; background: var(--paper); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-cjk);
  font-size: var(--t-base);
  line-height: var(--lh-body);
  font-weight: var(--wt-body);
  /* 不设 -webkit-font-smoothing：antialiased 会让 macOS 上的中文笔画变细发虚，
     系统默认的次像素渲染对中文长文更友好 */
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

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

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

.layout { display: grid; grid-template-columns: var(--toc-w) minmax(0, 1fr); min-height: 100vh; }

/* ---------- 左侧常驻目录 ---------- */

.toc {
  position: sticky; top: 0; align-self: start;
  height: 100vh; display: flex; flex-direction: column;
  background: var(--paper-sunken);
  border-right: 1px solid var(--rule);
}

.toc-home {
  display: block; padding: 26px 24px 20px;
  border-bottom: 1px solid var(--rule); text-decoration: none;
}
.toc-home-title {
  display: block; font-family: var(--font-num);
  font-size: var(--t-md); letter-spacing: .04em; color: var(--ink);
}
.toc-home-sub { display: block; font-size: var(--t-xs); color: var(--ink-3); margin-top: 2px; }

.toc-body { flex: 1; overflow-y: auto; padding: 14px 0 28px; overscroll-behavior: contain; }

.toc-chapter { padding: 4px 0; }
.toc-chapter + .toc-chapter { border-top: 1px solid var(--rule); }

.toc-chapter-link {
  display: grid; grid-template-columns: 26px 1fr auto; align-items: baseline;
  gap: 8px; padding: 12px 20px 8px; text-decoration: none; color: var(--ink-2);
}
.toc-chapter-link:hover { color: var(--ink); }
.toc-num {
  font-family: var(--font-num); font-size: var(--t-lg); line-height: 1;
  color: var(--ink-3); font-variant-numeric: lining-nums;
}
.toc-chapter.is-current .toc-num,
.toc-chapter.is-current .toc-chapter-text { color: var(--accent); }
.toc-chapter-text { font-size: var(--t-sm); line-height: 1.5; }
.toc-chapter-pct {
  font-family: var(--font-num); font-size: var(--t-xs); color: var(--ink-3);
  font-variant-numeric: lining-nums; white-space: nowrap;
}

.toc-lessons { list-style: none; margin: 0; padding: 0 20px 10px 26px; }
.toc-lesson {
  position: relative; display: grid; grid-template-columns: 14px 1fr; gap: 8px;
  align-items: start; padding: 6px 0; text-decoration: none;
  color: var(--ink-2); font-size: var(--t-sm); line-height: 1.55;
}
.toc-lesson:hover { color: var(--ink); }
.toc-dot {
  width: 6px; height: 6px; margin-top: .62em; border-radius: 50%;
  border: 1px solid var(--rule-strong); background: transparent;
  transition: background-color .15s, border-color .15s, transform .15s;
}
.toc-lesson.is-read .toc-dot { background: var(--rule-strong); border-color: var(--rule-strong); }
.toc-lesson.is-active { color: var(--accent); }
.toc-lesson.is-active .toc-dot { background: var(--accent); border-color: var(--accent); transform: scale(1.25); }
.toc-lesson-text { min-width: 0; }

.toc-foot {
  position: relative;  /* 阅读设置浮层的定位基准 */
  padding: 12px 16px; border-top: 1px solid var(--rule); background: var(--paper-sunken);
}
.toc-actions { display: flex; gap: 6px; }
.toc-actions button { flex: 1; }

/* 阅读设置做成浮层而不是内联展开，免得挤动目录 */
.prefs {
  position: absolute; bottom: calc(100% - 4px); left: 12px; right: 12px; z-index: 20;
  display: grid; gap: 11px; padding: 14px;
  background: var(--paper-raised); border: 1px solid var(--rule-strong);
  border-radius: var(--radius); box-shadow: 0 6px 24px rgba(0, 0, 0, .16);
}
.prefs[hidden] { display: none; }
.prefs-head { font-size: var(--t-xs); font-weight: 600; color: var(--ink); }
.prefs-row { display: grid; gap: 5px; }
.prefs-label { font-size: var(--t-xs); color: var(--ink-3); }
.prefs-opts { display: flex; gap: 4px; }
.prefs-opts button {
  flex: 1; min-width: 0; font: inherit; font-size: var(--t-xs); cursor: pointer;
  color: var(--ink-2); background: var(--paper);
  border: 1px solid var(--rule-strong); border-radius: 4px; padding: 6px 2px;
}
.prefs-opts button:hover { color: var(--ink); }
.prefs-opts button[aria-pressed="true"] {
  color: var(--accent); border-color: var(--accent); background: var(--accent-soft);
}
.prefs-foot {
  display: flex; gap: 6px; padding-top: 10px; border-top: 1px solid var(--rule);
}
.prefs-foot button {
  flex: 1; font: inherit; font-size: var(--t-xs); cursor: pointer;
  color: var(--ink-3); background: transparent;
  border: 1px solid var(--rule); border-radius: 4px; padding: 6px 4px;
}
.prefs-foot button:hover { color: var(--accent); border-color: var(--accent); }

.prefs-toggle-mark {
  font-family: var(--font-num); font-size: 1.05em; margin-right: 5px; opacity: .75;
}

.prefs-toggle, .theme-toggle, .reset-progress {
  font: inherit; font-size: var(--t-xs); font-family: var(--font-ui);
  color: var(--ink-2); background: transparent;
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
  padding: 6px 8px; cursor: pointer;
}
.prefs-toggle:hover, .theme-toggle:hover, .reset-progress:hover { color: var(--ink); border-color: var(--ink-3); }
.prefs-toggle[aria-expanded="true"] { color: var(--accent); border-color: var(--accent); }

.toc-toggle { display: none; }

/* ---------- 顶部进度条（窄屏下顶替进度脊） ---------- */

.topbar {
  display: none; position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  height: 3px; background: var(--rule);
}
.topbar-fill { height: 100%; width: 0; background: var(--accent); }

/* ---------- 正文容器与进度脊 ---------- */

.reader { min-width: 0; }

.article-shell {
  display: grid; grid-template-columns: 4px minmax(0, 1fr);
  gap: 40px; max-width: calc(max(var(--measure), var(--wide)) + 160px);
  margin: 0 auto; padding: 72px 40px 120px;
}

.spine { position: sticky; top: 72px; height: calc(100vh - 160px); }
.spine::before {
  content: ""; position: absolute; inset: 0; width: 2px; left: 1px;
  background: var(--rule); border-radius: 2px;
}
.spine-fill {
  position: absolute; top: 0; left: 0; width: 4px; height: 0;
  background: var(--accent); border-radius: 2px;
}
.spine-ticks { position: absolute; inset: 0; }
.spine-ticks i {
  position: absolute; left: 0; width: 10px; height: 1px;
  background: var(--rule-strong);
}

.article { min-width: 0; }
/* 正文一律收在 40 字以内 —— 中文一行再宽就难读了 */
.article > * { max-width: var(--measure); }
/* 图、表、视频和互动块的宽度由 --wide 控制，默认跟正文同宽，等比缩放不裁切 */
.article > .shot-img,
.article > .table-wrap,
.article > .video-frame,
.article > .ix-block,
.article > .pager { max-width: var(--wide); }
/* 图注跟着正文的可读宽度走，不跟图走 */
.article > .shot-img > figcaption,
.article > .video-frame > figcaption,
.article > .ix-block > figcaption { max-width: var(--measure); }

/* ---------- 正文排版 ---------- */

.kicker-group { margin: 64px 0 10px; }
.article > .kicker-group:first-child { margin-top: 0; }
.kicker {
  font-family: var(--font-num); font-size: var(--t-xs);
  color: var(--ink-3); letter-spacing: .05em; font-variant-numeric: lining-nums;
}

.sec-title {
  font-size: var(--t-3xl); line-height: 1.3; font-weight: 600;
  margin: 6px 0 20px; letter-spacing: -.01em;
}

.standfirst {
  font-size: var(--t-md); line-height: 1.85; color: var(--ink-2);
  margin: 0 0 8px; padding-bottom: 40px; border-bottom: 1px solid var(--rule);
}

.sub-title {
  font-size: var(--t-xl); line-height: 1.45; font-weight: 600;
  margin: 8px 0 18px; scroll-margin-top: 28px;
}
.sub-title > span:first-child {
  display: block; font-family: var(--font-num); font-size: var(--t-lg);
  color: var(--accent); margin-bottom: 4px; font-variant-numeric: lining-nums;
}
.sub-title.sub-sub {
  font-size: var(--t-lg); font-weight: 600; margin: 48px 0 14px;
  padding-left: 14px; border-left: 3px solid var(--accent-soft);
}
.sub-title.sub-sub strong { font-weight: 600; }

h4 { font-size: var(--t-md); font-weight: 600; margin: 32px 0 10px; }

p { margin: 0 0 1.15em; }
.lead { font-size: var(--t-md); color: var(--ink-2); line-height: 1.85; }

strong, b { font-weight: 600; color: var(--ink); }
/* 原文把大量普通句子拆成连续 <strong>，整段加粗会毁掉阅读节奏 —— 降为常规字重。 */
p > strong + strong { font-weight: 400; }

ul, ol { margin: 0 0 1.15em; padding-left: 1.4em; }
li { margin-bottom: .45em; }
li::marker { color: var(--ink-3); }

code {
  font-family: var(--font-mono); font-size: .88em;
  background: var(--paper-sunken); border: 1px solid var(--rule);
  border-radius: 4px; padding: 1px 5px;
}
small { font-size: var(--t-sm); color: var(--ink-2); }

/* ---------- 图与视频 ---------- */

figure { margin: 32px 0; }
.shot-img img {
  /* 宽高都只给上限、不给定值，浏览器自己按原始比例缩放，不会变形。
     限高是为了不让任何一张图独占整屏——总要留出几行正文一起看。 */
  display: block; margin-inline: auto;
  width: auto; height: auto;
  max-width: 100%; max-height: 72vh;
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--paper-raised);
}
figcaption {
  margin-top: 10px; font-size: var(--t-sm); line-height: 1.7;
  color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 8px;
}
.video-frame video {
  display: block; margin-inline: auto;
  width: auto; height: auto; max-width: 100%; max-height: 72vh;
  border: 1px solid var(--rule); border-radius: var(--radius); background: #000;
}

/* ---------- 学习目标 / 提示框 ---------- */

.chapter-meta {
  margin: 28px 0; padding: 20px 22px;
  background: var(--accent-soft); border-radius: var(--radius);
}
.chapter-meta-label { font-size: var(--t-sm); font-weight: 600; color: var(--accent-ink); margin-bottom: 6px; }
.chapter-meta p:last-child { margin-bottom: 0; }

.callout {
  margin: 28px 0; padding: 18px 20px;
  background: var(--ochre-soft); border-left: 3px solid var(--ochre);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: var(--t-sm); line-height: 1.8;
}
.callout-title { font-weight: 600; color: var(--ochre); margin-bottom: 6px; }
.callout p:last-child, .callout ul:last-child, .callout li:last-child { margin-bottom: 0; }

/* ---------- 表格 ---------- */

.table-wrap { margin: 28px 0; overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: var(--t-sm); line-height: 1.7; }
th, td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
thead th { background: var(--paper-sunken); font-weight: 600; white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--paper-sunken); }
.parallel-table td { width: 50%; }

/* ---------- Prompt 卡 ---------- */

.prompt-box {
  position: relative; margin: 28px 0; padding: 20px 22px 20px;
  background: var(--paper-raised); border: 1px solid var(--rule);
  border-radius: var(--radius); box-shadow: var(--shadow);
  font-size: var(--t-sm); line-height: 1.8;
}
.prompt-box p:last-of-type { margin-bottom: 0; }
.copy-btn {
  position: absolute; top: 12px; right: 12px;
  font: inherit; font-size: var(--t-xs); font-family: var(--font-ui);
  color: var(--ink-2); background: var(--paper);
  border: 1px solid var(--rule-strong); border-radius: 4px;
  padding: 3px 10px; cursor: pointer;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.copy-btn[data-copied] { color: var(--accent); border-color: var(--accent); }

/* ---------- 练习题 ---------- */

.quiz {
  margin: 28px 0; padding: 22px;
  background: var(--paper-raised); border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.quiz-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.quiz-tag {
  font-family: var(--font-num); font-size: var(--t-xs); letter-spacing: .06em;
  color: var(--accent); border: 1px solid var(--accent-soft);
  background: var(--accent-soft); border-radius: 3px; padding: 2px 7px;
}
.quiz-num { font-size: var(--t-xs); color: var(--ink-3); font-family: var(--font-num); }
.quiz-q { font-weight: 600; line-height: 1.75; margin-bottom: 14px; }
.quiz-options { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.quiz-opt {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  font: inherit; font-size: var(--t-sm); color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 11px 14px; cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.quiz-opt:hover:not([disabled]) { border-color: var(--ink-3); }
.opt-letter {
  flex: none; width: 24px; height: 24px; display: grid; place-items: center;
  font-family: var(--font-num); font-size: var(--t-xs);
  border: 1px solid var(--rule-strong); border-radius: 50%; color: var(--ink-2);
}
.quiz-opt.is-correct { border-color: var(--accent); background: var(--accent-soft); }
.quiz-opt.is-correct .opt-letter { border-color: var(--accent); color: var(--accent); }
.quiz-opt.is-wrong { border-color: var(--ochre); background: var(--ochre-soft); }
.quiz-opt.is-wrong .opt-letter { border-color: var(--ochre); color: var(--ochre); }
.quiz-opt[disabled] { cursor: default; }

.quiz-feedback {
  margin-top: 14px; padding: 13px 15px; font-size: var(--t-sm); line-height: 1.75;
  background: var(--paper-sunken); border-radius: var(--radius); display: none;
}
.quiz.is-answered .quiz-feedback { display: block; }
.quiz-feedback b { color: var(--accent); margin-right: 6px; }

/* ---------- 互动组件 ---------- */

.ix-block { margin: 28px 0; }
.ix-tag {
  font-size: var(--t-xs); color: var(--accent);
  background: var(--accent-soft); border-radius: 3px; padding: 2px 7px;
}

/* 翻卡 */
.ix-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 24px 0; }
.ix-card {
  position: relative; font: inherit; text-align: left; cursor: pointer;
  background: var(--paper-raised); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 0; overflow: hidden;
  min-height: 116px; display: block; color: inherit;
}
.ix-card:hover { border-color: var(--accent); }
.ix-card-front {
  display: grid; place-content: center; gap: 4px; text-align: center;
  min-height: 116px; padding: 18px;
}
.ix-card-front strong { font-size: var(--t-md); }
.ix-card-front > span { font-family: var(--font-num); font-size: var(--t-xs); color: var(--ink-3); }
.ix-card-back { display: none; padding: 16px 18px; font-size: var(--t-sm); line-height: 1.7; }
.ix-card-back strong { display: block; color: var(--accent); margin-bottom: 6px; }
.ix-card-back p { margin-bottom: .55em; }
.ix-card-back p:last-child { margin-bottom: 0; }
.ix-card.is-flipped .ix-card-front { display: none; }
.ix-card.is-flipped .ix-card-back { display: block; }

/* 步骤 Tab */
.ix-tabs, .ix-flow { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 0; }
.ix-tab {
  flex: 1 1 140px; font: inherit; text-align: left; cursor: pointer; color: inherit;
  background: var(--paper); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 11px 13px;
  display: grid; grid-template-columns: auto 1fr; gap: 2px 10px;
}
.ix-tab > span:first-child {
  grid-row: span 2; align-self: center;
  width: 26px; height: 26px; display: grid; place-items: center;
  font-family: var(--font-num); font-size: var(--t-sm);
  border: 1px solid var(--rule-strong); border-radius: 50%; color: var(--ink-2);
}
.ix-tab strong { font-size: var(--t-sm); }
.ix-tab small { font-size: var(--t-xs); }
.ix-tab.is-active, .ix-tab[data-active] { border-color: var(--accent); background: var(--accent-soft); }
.ix-tab.is-active, .ix-tab[data-active] > span:first-child { border-color: var(--accent); color: var(--accent); }

.ix-panel {
  display: none; margin-top: 12px; padding: 18px 20px;
  background: var(--paper-raised); border: 1px solid var(--rule); border-radius: var(--radius);
  font-size: var(--t-sm); line-height: 1.8;
}
.ix-panel.is-active { display: block; }
.ix-panel-title { margin: 0 0 10px; font-size: var(--t-md); }
.ix-panel-label {
  font-size: var(--t-xs); font-weight: 600; color: var(--accent);
  margin: 12px 0 2px;
}
.ix-panel-label:first-of-type { margin-top: 0; }
.ix-panel p { margin-bottom: 0; }

/* 排序练习 */
.ix-sort { display: grid; gap: 8px; margin: 24px 0 12px; }
.ix-sort-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--paper-raised); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 10px 12px; font-size: var(--t-sm);
}
.ix-sort-item.is-correct { border-color: var(--accent); background: var(--accent-soft); }
.ix-sort-item.is-wrong { border-color: var(--ochre); background: var(--ochre-soft); }
.ix-sort-moves { display: flex; gap: 4px; }
.ix-sort-moves button {
  font: inherit; width: 28px; height: 28px; line-height: 1; cursor: pointer;
  color: var(--ink-2); background: var(--paper);
  border: 1px solid var(--rule-strong); border-radius: 4px;
}
.ix-sort-moves button:hover { color: var(--accent); border-color: var(--accent); }

.ix-sort-check, .ix-sort-reset, .ix-form-toggle {
  font: inherit; font-size: var(--t-sm); cursor: pointer; margin: 0 8px 8px 0;
  color: var(--ink); background: var(--paper);
  border: 1px solid var(--rule-strong); border-radius: var(--radius); padding: 7px 16px;
}
.ix-sort-check:hover, .ix-sort-reset:hover, .ix-form-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* 填写练习 */
.ix-form { display: grid; gap: 12px; margin: 24px 0 14px; }
.ix-field { display: grid; gap: 6px; font-size: var(--t-sm); font-weight: 600; }
.ix-field textarea {
  font: inherit; font-weight: 400; font-size: var(--t-sm); line-height: 1.7;
  color: var(--ink); background: var(--paper-raised);
  border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 10px 12px; min-height: 76px; resize: vertical; width: 100%;
}
.ix-field textarea::placeholder { color: var(--ink-3); }
.ix-form-answer {
  display: none; margin-top: 12px; padding: 18px 20px;
  background: var(--accent-soft); border-radius: var(--radius);
  font-size: var(--t-sm); line-height: 1.8;
}
.ix-form-answer.is-open { display: block; }
.ix-form-answer p:last-child { margin-bottom: 0; }

/* ---------- 补充组件 ---------- */

.ix-app { margin: 24px 0; }
/* 这一组 Tab 只有标题、没有序号，按钮压扁一些 */
.ix-app .ix-tab { flex: 0 1 auto; grid-template-columns: 1fr; padding: 8px 14px; }

.ix-card-reset {
  font: inherit; font-size: var(--t-sm); cursor: pointer; margin-top: 12px;
  color: var(--ink-2); background: var(--paper);
  border: 1px solid var(--rule-strong); border-radius: var(--radius); padding: 7px 16px;
}
.ix-card-reset:hover { color: var(--accent); border-color: var(--accent); }

/* 能力进化链：真的是一条有序链路，所以用箭头串起来 */
.case-flow {
  margin: 28px 0; padding: 20px 22px;
  background: var(--paper-sunken); border-radius: var(--radius);
}
.case-flow-label { font-size: var(--t-sm); color: var(--ink-3); margin-bottom: 12px; }
.case-flow-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 4px;
  font-size: var(--t-sm);
}
.case-flow-list li {
  margin: 0; padding: 6px 12px;
  background: var(--paper-raised); border: 1px solid var(--rule); border-radius: 100px;
}
.case-flow-list li:not(:last-child)::after {
  content: "→"; margin-left: 10px; color: var(--ink-3);
}

.quiz-submit {
  font: inherit; font-size: var(--t-sm); cursor: pointer; margin-top: 14px;
  color: #fff; background: var(--accent);
  border: 1px solid var(--accent); border-radius: var(--radius); padding: 8px 20px;
}
:root[data-theme="dark"] .quiz-submit { color: #10201b; }
.quiz-submit:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.quiz-submit[disabled] { opacity: .45; cursor: default; }
.quiz-opt.is-picked { border-color: var(--accent); background: var(--accent-soft); }
.quiz-opt.is-picked .opt-letter { border-color: var(--accent); color: var(--accent); }

.ix-sort-result {
  margin: 4px 0 0; font-size: var(--t-sm); line-height: 1.75;
  color: var(--ochre); display: none;
}
.ix-sort-result.is-shown { display: block; }
.ix-sort-result.is-ok { color: var(--accent); }

/* 需求生成器 */
.ix-form-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 24px 0 8px; font-size: var(--t-sm);
}
.ix-form-copy {
  font: inherit; font-size: var(--t-xs); cursor: pointer;
  color: var(--ink-2); background: var(--paper);
  border: 1px solid var(--rule-strong); border-radius: 4px; padding: 4px 12px;
}
.ix-form-copy:hover { color: var(--accent); border-color: var(--accent); }
.ix-form-output {
  margin: 0; padding: 16px 18px; white-space: pre-wrap; word-break: break-word;
  font-family: var(--font-cjk); font-size: var(--t-sm); line-height: 1.8;
  background: var(--paper-sunken); border: 1px solid var(--rule);
  border-radius: var(--radius); max-height: 380px; overflow-y: auto;
}
.ix-form-output + p { margin-top: 8px; font-size: var(--t-xs); color: var(--accent); }

/* .ix-field 既有 label 包 textarea 的写法，也有 label + input 并列的写法 */
.ix-field input, .ix-field select {
  font: inherit; font-weight: 400; font-size: var(--t-sm);
  color: var(--ink); background: var(--paper-raised);
  border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 9px 12px; width: 100%;
}
.ix-field label { font-weight: 600; }

/* ---------- 章节翻页 ---------- */

.pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-top: 80px; padding-top: 28px; border-top: 1px solid var(--rule);
}
.pager-slot { display: block; }
.pager-link {
  display: grid; gap: 4px; padding: 16px 18px; text-decoration: none;
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--paper-raised);
}
.pager-link:hover { border-color: var(--accent); }
.pager-next { text-align: right; }
.pager-label { font-size: var(--t-xs); color: var(--ink-3); }
.pager-title { font-size: var(--t-sm); font-weight: 600; line-height: 1.6; }

/* ---------- 封面 ---------- */

.cover { max-width: 760px; margin: 0 auto; padding: 96px 40px 120px; }
.cover-eyebrow { font-size: var(--t-sm); color: var(--ink-3); margin-bottom: 14px; }
.cover-title { font-size: var(--t-3xl); line-height: 1.25; font-weight: 600; margin: 0 0 18px; letter-spacing: -.01em; }
.cover-standfirst { font-size: var(--t-md); line-height: 1.85; color: var(--ink-2); max-width: 34em; margin-bottom: 30px; }
.cover-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.cover-cta {
  text-decoration: none; background: var(--accent); color: #fff;
  border-radius: var(--radius); padding: 11px 22px; font-size: var(--t-sm); font-weight: 600;
}
:root[data-theme="dark"] .cover-cta { color: #10201b; }
.cover-cta:hover { background: var(--accent-ink); }
.cover-progress { font-size: var(--t-sm); color: var(--ink-3); }
.cover-progress [data-total-pct] { font-family: var(--font-num); color: var(--ink); }

.cover-list { margin-top: 56px; border-top: 1px solid var(--rule); }
.cover-chapter {
  display: grid; grid-template-columns: 48px 1fr auto; gap: 20px;
  padding: 26px 4px; border-bottom: 1px solid var(--rule); text-decoration: none;
}
.cover-chapter:hover { background: var(--paper-sunken); }
.cover-chapter-num {
  font-family: var(--font-num); font-size: var(--t-2xl); line-height: 1;
  color: var(--ink-3); font-variant-numeric: lining-nums;
}
.cover-chapter:hover .cover-chapter-num { color: var(--accent); }
.cover-chapter-title { display: block; font-size: var(--t-md); font-weight: 600; margin-bottom: 8px; }
.cover-chapter-lessons { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--t-sm); color: var(--ink-3); line-height: 1.7; }
.cover-chapter-pct { font-family: var(--font-num); font-size: var(--t-sm); color: var(--ink-3); align-self: center; }

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

/* 宽屏：正文行宽逐档放开，免得 680px 的字配 1280px 的图显得没写满 */
@media (min-width: 1280px) { :root { --measure: calc(780px * var(--t-scale)); } }
@media (min-width: 1600px) { :root { --measure: calc(860px * var(--t-scale)); } }
@media (min-width: 1900px) { :root { --measure: calc(920px * var(--t-scale)); } }

@media (max-width: 1080px) {
  :root { --toc-w: 240px; }
  .article-shell { padding: 56px 28px 96px; gap: 28px; }
}

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .toc {
    position: fixed; inset: 0 auto 0 0; width: min(86vw, 320px); z-index: 40;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0);
  }
  body.toc-open .toc { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35); }
  .topbar { display: block; }
  .toc-toggle {
    display: flex; align-items: center; justify-content: center;
    position: fixed; z-index: 50;
    right: max(16px, env(safe-area-inset-right));
    bottom: calc(20px + env(safe-area-inset-bottom));
    width: 54px; height: 54px; border-radius: 50%;
    font: inherit; font-size: var(--t-sm); cursor: pointer;
    color: var(--ink); background: var(--paper-raised);
    border: 1px solid var(--rule-strong);
    box-shadow: 0 3px 14px rgba(0, 0, 0, .14);
  }
  body.toc-open .toc-toggle { color: var(--accent); border-color: var(--accent); }
  .toc {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .article-shell {
    grid-template-columns: minmax(0, 1fr);
    padding: calc(28px + env(safe-area-inset-top)) 20px calc(96px + env(safe-area-inset-bottom));
  }
  .article > *, .article > .shot-img, .article > .table-wrap,
  .article > .video-frame, .article > .ix-block, .article > .pager { max-width: 100%; }
  .shot-img img { width: 100%; max-height: none; }
  .spine { display: none; }
  .cover { padding: calc(40px + env(safe-area-inset-top)) 20px calc(96px + env(safe-area-inset-bottom)); }
  .sec-title, .cover-title { font-size: var(--t-2xl); }
  .pager { grid-template-columns: 1fr; }
  .pager-next { text-align: left; }
  .cover-chapter { grid-template-columns: 36px 1fr; }
  .cover-chapter-pct { grid-column: 2; }
}

@media (hover: none) {
  .quiz-opt:hover:not([disabled]), .ix-card:hover, .pager-link:hover,
  .cover-chapter:hover, tbody tr:hover { border-color: inherit; background: inherit; }
  .cover-chapter:hover { background: transparent; }
}

@media print {
  .toc, .toc-toggle, .spine, .pager, .copy-btn { display: none; }
  .layout { display: block; }
  .article-shell { max-width: none; padding: 0; display: block; }
  body { background: #fff; color: #000; }
}
