/* =========================================================================
   app.css —— 版面与视觉
   版面：顶栏 52 ｜ 目录 232 + 中栏（题目卡 + 画布）+ 步骤栏 340 ｜ 控制条 56
   中栏是主角：题目卡可折叠，画布吃掉剩余全部空间。
   ========================================================================= */
:root{
  --bg:#f4f3ef; --panel:#ffffff; --ink:#1f2430; --ink2:#525a68; --muted:#8b8f99;
  --line:#e4e1d9; --line2:#efeee9;
  --accent:#1a1a1a; --accent-soft:#ececec; --accent-line:#cfcfcf;
  --aux:#22c55e; --red:#ef4444; --blue:#3b82f6;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
/* hidden 属性必须压过本文件的 display:flex/grid —— 否则 [hidden] 元素照样显示 */
[hidden]{display:none!important}
html,body{height:100%}
body{
  margin:0;background:var(--bg);color:var(--ink);overflow:hidden;
  font-family:"PingFang SC","Hiragino Sans GB","Microsoft YaHei",system-ui,-apple-system,sans-serif;
  -webkit-font-smoothing:antialiased;
}
.app{display:flex;flex-direction:column;height:100vh;height:100dvh}

/* ---------------- 顶栏 ---------------- */
.hd{
  display:flex;align-items:center;gap:16px;padding:0 18px;flex:0 0 52px;
  background:rgba(255,255,255,.9);backdrop-filter:blur(14px);
  border-bottom:1px solid var(--line);z-index:5;
}
.brand{display:flex;align-items:center;gap:10px;min-width:0}
.logo{
  width:32px;height:32px;border-radius:9px;flex:0 0 auto;
  background:linear-gradient(145deg,#2e2e2e,#111111);color:#fff;
  display:grid;place-items:center;font:600 17px/1 Georgia,serif;
  box-shadow:0 4px 12px rgba(0,0,0,.26);
}
.bt h1{margin:0;font-size:14.5px;font-weight:700;white-space:nowrap}
.crumb{display:flex;align-items:center;gap:7px;font-size:12.5px;color:var(--muted);min-width:0;
  flex:1;margin-left:4px;overflow:hidden}
.crumb .c-topic{font-weight:700;color:var(--ink2);white-space:nowrap;flex:0 0 auto}
.crumb .c-method{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.crumb .c-case{white-space:nowrap;color:var(--accent);font-weight:700;flex:0 0 auto}
.crumb .c-sep{color:#cfd3da;flex:0 0 auto}
.hd-actions{display:flex;gap:6px;margin-left:auto;flex:0 0 auto}
.hamburger{display:none;width:34px;height:34px;border:1px solid var(--line);background:#fff;
  border-radius:8px;cursor:pointer;font-size:15px;color:var(--ink2);place-items:center;flex:0 0 auto}
.scrim{display:none}

/* ---------------- 按钮 ---------------- */
.btn{
  font-family:inherit;font-size:12.5px;font-weight:600;color:var(--ink2);
  background:#fff;border:1px solid var(--line);padding:7px 13px;border-radius:8px;
  cursor:pointer;transition:.15s;
}
.btn:hover{background:#fbfbf9}
.btn:active{transform:translateY(1px)}
.btn.primary{background:var(--accent);border-color:var(--accent);color:#fff;min-width:86px;
  box-shadow:0 4px 12px rgba(0,0,0,.22)}
.btn.primary:hover{background:#000000}
.btn.ghost{color:var(--muted);border-color:transparent;background:transparent}
.btn.ghost:hover{background:#f2f1ec}
.btn[disabled]{opacity:.38;cursor:not-allowed}
.btn#speed{min-width:52px;font-variant-numeric:tabular-nums}

/* ---------------- 三栏 ---------------- */
.main{display:flex;flex:1;min-height:0}

/* 左：专题目录 */
.dir{width:232px;flex:0 0 232px;background:#fbfbf8;border-right:1px solid var(--line);
  display:flex;flex-direction:column;min-height:0}
.dir-head{display:flex;align-items:center;justify-content:space-between;gap:8px;
  padding:11px 14px 9px;border-bottom:1px solid var(--line2);flex:0 0 auto}
.dir-title{font-size:12px;font-weight:700;color:var(--ink2);letter-spacing:.4px}
.dir-stat{font-size:10.5px;color:var(--muted);white-space:nowrap}
.tree{overflow-y:auto;flex:1;min-height:0;padding:6px 8px 20px;scrollbar-width:thin}
.tree::-webkit-scrollbar{width:6px}
.tree::-webkit-scrollbar-thumb{background:#dedcd4;border-radius:3px}
.topic{margin-bottom:2px}
.topic-hd{display:flex;align-items:center;gap:6px;width:100%;background:none;border:0;
  padding:7px 8px;border-radius:7px;cursor:pointer;font-family:inherit;text-align:left}
.topic-hd:hover{background:#f1f0eb}
.topic.current>.topic-hd{background:var(--accent-soft)}
.caret{font-size:9px;color:var(--muted);transition:transform .18s;flex:0 0 auto}
.topic[data-open="1"] .caret{transform:rotate(90deg)}
.tname{font-size:12px;font-weight:700;color:var(--ink2);flex:1;min-width:0;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.topic.current>.topic-hd .tname{color:#111111}
.badge{font-size:10px;color:var(--muted);background:#eeede8;border-radius:5px;
  padding:1px 5px;font-variant-numeric:tabular-nums}
.badge.full{background:#dedede;color:#111111}
.topic-body{display:none;padding:0 0 6px 10px}
.topic[data-open="1"] .topic-body{display:block}
.grp{font-size:10.5px;color:var(--muted);font-weight:700;padding:8px 8px 4px;letter-spacing:.2px}
.method-hd{font-size:10.5px;line-height:1.5;color:var(--muted);padding:5px 8px;
  border-left:2px solid #e6e4dc;margin-left:4px}
.case-list{list-style:none;margin:0;padding:2px 0 2px 4px}
.case-item{display:flex;align-items:center;gap:7px;padding:5px 8px;border-radius:6px;
  cursor:pointer;font-size:11.5px;color:var(--ink2);margin-left:6px}
.case-item:hover{background:#f1f0eb}
.case-item.on{background:var(--accent);color:#fff}
.case-item.on .ci-no,.case-item.on .ci-t{color:#fff}
.ci-no{font-size:10px;color:var(--muted);flex:0 0 auto}
.ci-t{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.case-item.seen .ci-no::after{content:"·";color:var(--accent);font-weight:700}
.case-item.done .ci-no::after{content:"✓";color:var(--accent);font-weight:700}
.case-item.on .ci-no::after{color:#fff}
.case-item.map-item{background:var(--accent-soft);margin:3px 0 5px;padding:6px 8px}
.case-item.map-item:first-child{margin-top:5px}
.case-item.map-item .ci-no{color:var(--accent);font-weight:700}
.case-item.map-item .ci-t{color:var(--accent);font-weight:700}
.case-item.map-item.on{background:var(--accent)}
.case-item.map-item.on .ci-t{color:#fff}

/* 中：题目卡 + 画布 */
.center{flex:1;min-width:0;display:flex;flex-direction:column;min-height:0}

.probcard{
  flex:0 0 auto;background:#fff;border-bottom:1px solid var(--line);
  padding:12px 22px 13px;
}
.pc-top{display:flex;align-items:baseline;gap:10px;margin-bottom:6px}
.pc-no{font-size:15px;font-weight:800;color:var(--accent);letter-spacing:.5px;flex:0 0 auto}
.pc-name{font-size:13px;font-weight:700;color:var(--ink2);flex:0 0 auto}
.pc-method{
  margin-left:auto;font-size:11.5px;color:var(--muted);display:flex;align-items:center;gap:6px;
  max-width:52%;overflow:hidden;
}
.pc-method .k{
  font-size:10px;font-weight:700;color:#15803d;background:#eafaef;
  border:1px solid #d5f5e3;border-radius:4px;padding:1px 5px;flex:0 0 auto;
}
.pc-method .v{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pc-toggle{
  flex:0 0 auto;font-family:inherit;font-size:11px;color:var(--muted);background:none;border:0;
  cursor:pointer;padding:2px 4px;border-radius:5px;margin-left:6px;
}
.pc-toggle:hover{background:#f2f1ec;color:var(--ink2)}
.pc-body{overflow:hidden}
body.pc-fold .pc-body{display:none}
.pc-line{display:flex;gap:9px;font-size:14.5px;line-height:1.85;color:var(--ink)}
.pc-line + .pc-line{margin-top:2px}
.pc-line .lab{
  flex:0 0 auto;font-weight:700;color:var(--ink2);font-size:13px;
  padding-top:2px;letter-spacing:1px;
}
.pc-line .txt{flex:1;min-width:0}
.pc-line .txt b{font-weight:700;color:#111111}
.pc-line.ask .lab{color:var(--red)}
.pc-line.ask .txt{font-weight:600}
.pc-line.lack{display:none}
.pc-line.lack .lab{color:var(--aux)}
.pc-line.lack .txt{font-size:13.5px;color:#15803d}
body.havelack .pc-line.lack{display:flex}
.pc-line.note .lab{color:var(--muted);font-size:12px}
.pc-line.note .txt{font-size:12.5px;color:var(--muted)}

/* 画布 */
.stage{flex:1;min-height:0;position:relative;display:flex;align-items:center;
  justify-content:center;padding:14px 18px 12px}
canvas{
  display:block;border-radius:12px;background:#fff;
  box-shadow:0 1px 2px rgba(31,36,48,.05),0 14px 38px rgba(31,36,48,.07);
  touch-action:none;
}
.caption{
  position:absolute;left:50%;bottom:22px;transform:translateX(-50%);
  display:flex;align-items:center;gap:10px;padding:8px 15px;border-radius:10px;
  background:rgba(255,255,255,.97);border:1px solid var(--line);
  box-shadow:0 8px 24px rgba(31,36,48,.1);pointer-events:none;
  max-width:min(86%,620px);
}
.caption .cp{
  font-size:10.5px;font-weight:700;color:#fff;background:var(--accent);
  padding:2px 7px;border-radius:4px;white-space:nowrap;flex:0 0 auto;
}
.caption .ct{font-size:14px;font-weight:700;color:var(--ink);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.caption .prog{width:44px;height:3px;border-radius:2px;background:#e6e5df;
  overflow:hidden;flex:0 0 auto}
.caption .prog i{display:block;height:100%;width:0;background:var(--accent);border-radius:2px}
/* 字幕切换：淡出上移 120ms → 淡入下移 180ms（阶段 4） */
@keyframes capSwapIn{
  0%{opacity:0;transform:translate(-50%,4px)}
  40%{opacity:1;transform:translate(-50%,-4px)}
  100%{opacity:1;transform:translate(-50%,0)}
}
.caption.cap-in{animation:capSwapIn 300ms ease-out both}
.hint{
  position:absolute;left:20px;top:10px;font-size:11px;color:var(--muted);
  background:rgba(255,255,255,.86);border:1px solid var(--line);
  padding:3px 8px;border-radius:6px;pointer-events:none;opacity:.9;
}
/* 点击图形的即时提示 */
.tip{
  position:absolute;left:0;top:0;transform:translate(-50%,-100%);
  padding:6px 11px;border-radius:8px;background:rgba(31,36,48,.93);color:#fff;
  font-size:12px;font-weight:600;line-height:1.4;white-space:nowrap;
  max-width:78%;overflow:hidden;text-overflow:ellipsis;
  pointer-events:none;opacity:0;transition:opacity .16s;z-index:4;
  box-shadow:0 6px 18px rgba(31,36,48,.22);
}
.tip.on{opacity:1}
.pc-line .txt .tail{font-size:12px;color:var(--muted);font-weight:400;margin-left:4px}

/* 右：解题步骤 */
.steps{
  width:340px;flex:0 0 340px;background:#fff;border-left:1px solid var(--line);
  display:flex;flex-direction:column;min-height:0;
}
.steps-hd{
  flex:0 0 auto;display:flex;align-items:center;gap:8px;
  padding:11px 14px 9px;border-bottom:1px solid var(--line2);
}
.steps-hd .t{font-size:12px;font-weight:700;color:var(--ink2);letter-spacing:.4px}
.steps-hd .n{font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums;margin-left:auto}
/* 步骤 / 解析 双标签 */
.steps-hd .tabs{display:flex;gap:1px;flex:0 0 auto}
.steps-hd .tab{
  font-family:inherit;font-size:12px;font-weight:700;color:var(--muted);
  background:none;border:none;border-bottom:2px solid transparent;
  padding:3px 9px 4px;cursor:pointer;letter-spacing:.3px;transition:color .16s,border-color .16s;
}
.steps-hd .tab:hover{color:var(--ink2)}
.steps-hd .tab.on{color:var(--accent);border-bottom-color:var(--accent)}
.mode-tg{
  font-family:inherit;font-size:10.5px;font-weight:700;color:var(--ink2);
  background:#f5f4ef;border:1px solid var(--line);border-radius:6px;
  padding:3px 7px;cursor:pointer;white-space:nowrap;flex:0 0 auto;
}
.mode-tg:hover{background:#eeede7}
.mode-tg[data-mode="write"]{color:#111111;background:var(--accent-soft);border-color:var(--accent-line)}
.mode-tg[disabled]{opacity:.42;cursor:default;background:#f5f4ef;color:var(--muted)}
.slist{overflow-y:auto;flex:1;min-height:0;padding:6px 10px 28px;position:relative;scrollbar-width:thin}
.slist::-webkit-scrollbar{width:6px}
.slist::-webkit-scrollbar-thumb{background:#dedcd4;border-radius:3px}
.phase{
  display:flex;align-items:center;gap:8px;padding:13px 8px 6px;
  font-size:12.5px;font-weight:800;color:var(--muted);letter-spacing:.4px;
}
.phase .bar{width:3px;height:14px;border-radius:2px;background:#e2e0d9;transition:.25s}
.phase.on{color:var(--accent)}
.phase.on .bar{background:var(--accent);height:17px}
.step{display:flex;gap:10px;padding:8px 10px;border-radius:9px;cursor:pointer;
  margin-bottom:1px;transition:background .16s}
.step:hover{background:#faf9f6}
.step.active{background:var(--accent-soft)}
.step .num{
  flex:0 0 auto;width:21px;height:21px;border-radius:50%;margin-top:1px;
  display:grid;place-items:center;font-size:11px;font-weight:700;
  background:#ecebe5;color:var(--muted);transition:.2s;
}
.step.active .num{background:var(--accent);color:#fff;box-shadow:0 0 0 4px rgba(0,0,0,.1)}
.step.done .num{background:#dedede;color:#111111}
.step .body{min-width:0;flex:1}
.step .st{font-size:13px;font-weight:600;line-height:1.55;color:var(--ink2)}
.step.active .st{color:#111111;font-weight:700}
.step .sd{display:none;font-size:13px;line-height:1.9;color:var(--ink2);margin:6px 0 0}
.step.active .sd{display:block;animation:fadeUp .22s ease-out}
@keyframes fadeUp{from{opacity:0;transform:translateY(3px)}to{opacity:1;transform:none}}
/* 书写式：∵ / ∴ 独立成列 */
.step .sd .ln{display:flex;gap:8px;margin-bottom:2px;align-items:baseline}
.step .sd .op{
  flex:0 0 18px;width:18px;text-align:left;
  font-family:Georgia,"Times New Roman",serif;font-style:normal;
  font-weight:700;font-size:13px;line-height:1.7;color:var(--muted);
  font-variant-numeric:tabular-nums;
}
.step .sd .op.t{color:var(--accent)}
.step .sd .tx{flex:1;min-width:0;overflow-wrap:anywhere;line-height:1.7}
.step .sd em{font-style:normal;font-weight:700;color:var(--red)}
.step .sd i{font-family:Georgia,"Times New Roman",serif;font-style:italic}
.step .sd code{
  font-family:"SF Mono",ui-monospace,Menlo,monospace;font-size:12px;
  background:#f1f0eb;padding:1px 5px;border-radius:4px;color:#111111;
}
.step .note{
  margin-top:7px;padding:6px 9px;border-radius:7px;background:#f7f6f1;
  border:1px solid #e6e3d9;font-size:11.5px;line-height:1.7;color:#7a7f8a;
}
.step .note b{color:#5a6472;font-weight:700}

/* ---- 步骤可视化：角色标签 / 相位计数 / 本步新增解析 ---- */
.phase .ph-count{
  margin-left:auto;font-size:10px;font-weight:600;color:#a9aeb8;letter-spacing:0;
  font-variant-numeric:tabular-nums;
}
/* 标题：角色标签 + 文字 + 右侧增量。用 grid 固定列，文字换行从文字列起点悬挂，不顶到标签下方 */
.step .st{
  display:grid;grid-template-columns:auto minmax(0,1fr) auto;
  align-items:baseline;gap:7px;
}
.step .st .role{grid-column:1;justify-self:start}
.step .st .stx{grid-column:2;min-width:0;overflow-wrap:anywhere}
.step .st .delta{grid-column:3;justify-self:end}
.step.map-step .st{display:block}   /* 导图步骤只有纯文字，无需三列网格 */
.step .role{
  flex:0 0 auto;display:inline-grid;place-items:center;min-width:25px;height:18px;
  padding:0 5px;border-radius:5px;font-size:10.5px;line-height:1;font-weight:800;
  color:#fff;letter-spacing:.5px;transform:translateY(-1px);
}
.step .role.qiu{background:#3b82f6}
.step .role.you{background:#60a5fa}
.step .role.que{background:#22c55e}
.step .role.kan{background:#16a34a}
.step .role.zuo{background:#22c55e}
.step .role.tui{background:#06b6d4}
.step .role.da{background:#a855f7}
.step .stx{flex:1;min-width:0;overflow-wrap:anywhere}
.step .delta{
  flex:0 0 auto;margin-left:auto;font-size:9.5px;font-weight:700;color:#9aa0ab;
  background:#f1f0eb;border-radius:4px;padding:1px 5px;font-variant-numeric:tabular-nums;
}
.step.active .delta{color:#111111;background:#dedede}
.step .subs{
  display:none;margin:8px 0 0;padding:8px 9px 7px;border-radius:8px;
  background:#f7f6f1;border:1px solid #e8e5dc;
}
.step.active .subs{display:block;animation:fadeUp .22s ease-out}
.step .subs-hd{
  display:flex;align-items:center;gap:6px;font-size:10px;font-weight:700;
  color:#8b8f99;letter-spacing:.3px;margin-bottom:4px;
}
.step .subs-hd .n{color:#1a1a1a;background:#ececec;border-radius:4px;padding:0 5px}
.step .sub{display:flex;gap:6px;font-size:12.5px;line-height:1.7;color:#3b4250;padding:1px 0}
.step.active .subs .sub{animation:subIn .2s ease-out both}
.step .sub .sn{
  width:26px;flex:0 0 auto;text-align:right;padding-top:3px;font-size:9.5px;
  color:#a9aeb8;font-variant-numeric:tabular-nums;
}
.step .sub .op{
  width:16px;flex:0 0 16px;text-align:left;
  font-family:Georgia,"Times New Roman",serif;font-style:normal;font-weight:700;font-size:12px;color:#8b8f99;
}
.step .sub .op.t{color:#1a1a1a}
.step .sub .tx{flex:1;min-width:0;overflow-wrap:anywhere;line-height:1.7}
.step .sub .why{font-size:9.5px;color:#a9aeb8;font-style:normal;margin-left:4px;white-space:nowrap}
@keyframes subIn{from{opacity:0;transform:translateY(2px)}to{opacity:1;transform:none}}
/* ?static=1：无头 Chrome 的动画时间轴可能停在首帧，静态页直接落到终态 */
body.static .step .sd,
body.static .step.active .subs,
body.static .step.active .subs .sub{animation:none!important}

/* ---- 解析页：作法块 + 标准解析（∵/∴ 链） ---- */
.sproof{overflow-y:auto;flex:1;min-height:0;padding:10px 12px 22px;scrollbar-width:thin}
.sproof::-webkit-scrollbar{width:6px}
.sproof::-webkit-scrollbar-thumb{background:#dedcd4;border-radius:3px}
.acts{
  display:flex;gap:8px;align-items:flex-start;flex-wrap:wrap;
  padding:8px 11px;border-radius:8px;background:#f4f4f2;
  border:1px solid var(--line);margin-bottom:14px;
  font-size:12.5px;line-height:1.8;color:var(--ink2);
}
.acts .k{
  flex:0 0 auto;font-size:10.5px;font-weight:700;color:#111111;
  background:var(--accent-soft);border:1px solid var(--accent-line);
  border-radius:5px;padding:1px 7px;margin-top:0;line-height:1.8;
}
.acts .v{flex:1;min-width:0;line-height:1.8;padding-top:0}
.acts .v b{color:#111111;font-weight:700;margin-right:1px}
.sol{font-size:13px;line-height:1.95;color:var(--ink)}
.sol .head{font-weight:700;color:var(--ink);margin-bottom:3px}
.sol .head .fig{font-weight:400;color:var(--ink2)}
.sol .ln{
  display:flex;gap:7px;padding:2px 6px;border-radius:6px;margin:1px 0;
  border:1px solid transparent;
  transition:background .2s,opacity .2s,border-color .2s;
}
.sol .ln .op{
  flex:0 0 18px;width:18px;text-align:left;
  font-family:Georgia,"Times New Roman",serif;font-size:14px;line-height:1.7;
  font-style:normal;font-weight:700;color:var(--muted);
}
.sol .ln .op.t{color:var(--accent)}
.sol .ln .tx{flex:1;min-width:0;overflow-wrap:anywhere;line-height:1.7}
.sol .ln .why{font-size:10.5px;line-height:1.5;color:#a9aeb8;margin-left:5px;font-style:normal;white-space:nowrap}
.sol .ln.new{
  background:var(--accent-soft);border:1px solid var(--accent-line);
  padding:2px 6px;box-shadow:0 1px 3px rgba(0,0,0,.04);
  animation:fadeUp .24s ease-out;
}
.sol .ln.pending{display:none}
.sol code{font-family:"SF Mono",ui-monospace,Menlo,monospace;font-size:12px;color:#111111}
.sol i{font-family:Georgia,"Times New Roman",serif;font-style:italic}
.sol em{font-style:normal;font-weight:700;color:var(--red)}
.sol .empty{padding:30px 10px;font-size:12.5px;line-height:2;color:var(--muted);text-align:center}
.sol-ft{
  display:flex;align-items:center;gap:8px;margin:14px 2px 0;
  padding-top:10px;border-top:1px solid var(--line2);
}
.sol-ft .tag{font-size:10.5px;color:var(--muted);font-variant-numeric:tabular-nums}
.sol-ft .spacer{flex:1}
.sol-ft .btn{font-size:11px;padding:4px 9px}
/* 旧钉底结论条已由列表内卡片取代，保留 DOM 但隐藏 */
#answerBox{display:none!important}

/* 旧钉底结论条已由列表内卡片取代，保留 DOM 但隐藏 */
#answerBox{display:none!important}

/* 结论：步骤列表末尾的一张卡片，跟步骤滚在一起、但用底色+左边框区分 */
.step-conclusion{
  margin:10px 0 4px;padding:11px 13px;border-radius:9px;
  background:linear-gradient(135deg,#eafaef,#f0fdf4);
  border:1px solid #b7e4c7;box-shadow:0 1px 3px rgba(0,0,0,.04);
  display:none;opacity:0;transform:translateY(4px);
  transition:opacity .24s ease-out,transform .24s ease-out;
}
.step-conclusion.show{display:block;opacity:1;transform:none;
  animation:conclIn .3s ease-out both}
@keyframes conclIn{
  from{opacity:0;transform:translateY(6px) scale(.98)}
  to{opacity:1;transform:none scale(1)}
}
.step-conclusion .cl-hd{
  display:flex;align-items:center;gap:7px;margin-bottom:5px;
  font-size:11px;font-weight:800;letter-spacing:.3px;color:#15803d;
}
.step-conclusion .cl-hd .ico{
  width:18px;height:18px;border-radius:5px;display:grid;place-items:center;
  background:#16a34a;color:#fff;font-size:11px;font-weight:800;
}
.step-conclusion .cl-tx{font-size:13px;line-height:1.7;color:var(--ink);font-weight:700}
.step-conclusion .cl-tx code{
  font-family:"SF Mono",ui-monospace,Menlo,monospace;font-size:12px;color:#15803d
}
body.static .step-conclusion{animation:none!important;transition:none}

/* ---- 解析入图：答题卷（.board 叠在画布右侧，纸面仍是同一张画布） ---- */
body.board{--board-w:clamp(360px,30vw,400px);--board-res:calc(var(--board-w) + 20px)}
body.board .steps{display:none!important}
body.board .stage .caption{
  left:calc((100% - var(--board-res) + 71px)/2);
  max-width:min(calc(100% - var(--board-res) - 48px),560px);
}
#proofBoard{
  position:absolute;right:18px;top:14px;bottom:12px;
  width:var(--board-w);
  display:flex;flex-direction:column;min-height:0;
  padding-left:20px;border-left:1px dashed var(--line);
  z-index:3;
}
#proofBoard .steps-hd{
  flex:0 0 auto;padding:0 0 9px;border-bottom:1px solid var(--line2);background:none;
}
#proofBoard .sproof{
  flex:1;min-height:0;overflow-y:auto;padding:8px 2px 8px;
  scrollbar-width:thin;
}
#proofBoard .sproof::-webkit-scrollbar{width:6px}
#proofBoard .sproof::-webkit-scrollbar-thumb{background:#dedcd4;border-radius:3px}
#proofBoard .sol-ft{
  position:sticky;bottom:0;margin-top:10px;padding:8px 0 4px;
  background:linear-gradient(rgba(255,255,255,0),#fff 38%);
}

/* ---------------- 控制条 ---------------- */
.ctl{
  flex:0 0 56px;display:flex;align-items:center;gap:9px;padding:0 20px;
  background:rgba(255,255,255,.94);backdrop-filter:blur(14px);border-top:1px solid var(--line);
}
.spacer{flex:1}
.dots{display:flex;gap:5px;align-items:center;flex-wrap:nowrap;overflow:hidden;max-width:46%}
.dot{width:6px;height:6px;border-radius:50%;background:#dcdad3;transition:.2s;cursor:pointer;flex:0 0 auto}
.dot.on{background:var(--accent);width:16px;border-radius:3px}
.counter{font-size:11.5px;color:var(--muted);font-variant-numeric:tabular-nums;
  min-width:44px;text-align:right}

/* 导图没有「缺」这一行 */
body.ismap .pc-line.lack{display:none!important}

/* ---------------- 响应式 ---------------- */
@media (max-width:1200px){
  .dir{position:fixed;left:0;top:0;bottom:0;z-index:60;width:284px;
    transform:translateX(-100%);transition:transform .24s;box-shadow:0 0 40px rgba(0,0,0,.16)}
  body.drawer .dir{transform:none}
  .scrim{display:block;position:fixed;inset:0;background:rgba(20,22,28,.34);z-index:55;
    opacity:0;pointer-events:none;transition:opacity .24s}
  body.drawer .scrim{opacity:1;pointer-events:auto}
  .hamburger{display:grid}
  .crumb{display:none}
  .probcard{padding:11px 18px 12px}
  .pc-line{font-size:13.5px;line-height:1.75}
  .pc-name{font-size:12.5px}
  .pc-method{max-width:44%}
}
@media (max-width:900px){
  .steps{width:300px;flex:0 0 300px}
  .pc-method{display:none}
  .hd-actions{display:none}
  .stage{padding:8px}
  .caption{bottom:14px;padding:6px 11px;max-width:92%}
  .caption .ct{font-size:13px}
  .hint{display:none}
  .ctl{padding:0 12px;gap:6px}
  .btn{padding:7px 11px;font-size:12px}
  .dots{display:none}
}
/* 极窄：步骤栏改到底部 */
@media (max-width:760px){
  .main{flex-direction:column}
  .steps{width:100%;flex:0 0 auto;max-height:38vh;border-left:none;border-top:1px solid var(--line)}
}

/* ============ ?shot=1 调试模式：只渲染画布 ============
   验收脚本 S13 要对截图做像素复核（找结论胶囊的 #1a1a1a 横段）。
   页面别处的强调色元素（目录选中项、字幕条药丸）会污染判定，所以这个模式下
   只留 .stage。日常使用不受影响，只有带 ?shot=1 时才生效。 */
body.shot .hd,body.shot .dir,body.shot .probcard,body.shot .steps,
body.shot .ctl,body.shot .caption,body.shot .hint,body.shot .scrim,
body.shot #proofBoard{display:none!important}
body.shot .main{display:block}
body.shot .center{display:block;height:100%}
body.shot .stage{position:fixed;inset:0;padding:0;display:block}

/* ============ 打印：只印解析（整段标准答案） ============ */
@media print{
  body{background:#fff}
  .hd,.dir,.center,.ctl,.steps-hd,.slist,.ans,.tip,.hint,.scrim{display:none!important}
  .main{display:block}
  .steps{width:auto;border:none;display:block;min-height:0}
  .sproof{overflow:visible;padding:0;display:block!important}
  .sol-ft{display:none}
  .acts{background:none;border-bottom:1px solid #ccc;border-radius:0}
  /* 打印时把还没讲到的行也放出来，否则拿不到完整答案 */
  .sol .ln.pending{display:flex}
  .sol .ln.new{background:none;box-shadow:none;animation:none}
  .step-conclusion{display:block!important;opacity:1;transform:none;animation:none;-webkit-print-color-adjust:exact;print-color-adjust:exact}
}

/* 解析入图时打印：答案在 #proofBoard 里，需要把 .center 重新放出来 */
@media print{
  body.board .center{display:block!important}
  body.board .stage{position:static;display:block;padding:0}
  body.board .stage canvas,
  body.board .stage .caption,
  body.board .stage .hint,
  body.board .stage .tip{display:none!important}
  body.board #proofBoard{
    position:static;display:block;width:auto;min-height:0;
    padding:0;border:0;overflow:visible;
  }
  body.board #proofBoard .sproof{overflow:visible;padding:0;display:block!important}
  body.board #proofBoard .steps-hd{display:none!important}
  body.board #proofBoard .ans{display:none!important}
}

/* ---- 根号排版：√ 后的被开方数加顶横线（渲染层 mathHTML 生成） ---- */
.radic{
  text-decoration:overline;
  text-decoration-color:currentColor;
  padding:0 1px 0 0;
  white-space:nowrap;
}
.radic sup, .radic .sup{text-decoration:none}

/* ---- 原书题目扫描图：题目卡入口按钮 ---- */
.pc-original{
  flex:0 0 auto;font-family:inherit;font-size:10.5px;font-weight:700;
  color:var(--accent);background:var(--accent-soft);
  border:1px solid var(--accent-line);border-radius:5px;
  padding:2px 8px;cursor:pointer;margin-left:6px;white-space:nowrap;
}
.pc-original:hover{background:#e3e3e3}
.pc-original#btnPractice{color:#15803d;background:#eafaef;border-color:#d5f5e3}
.pc-original#btnPractice:hover{background:#d5f5e3}
/* ---- 原书题目扫描图弹层 ---- */
.orig-modal{position:fixed;inset:0;z-index:200;display:flex;align-items:center;justify-content:center}
.orig-backdrop{position:absolute;inset:0;background:rgba(18,20,26,.46);backdrop-filter:blur(2px)}
.orig-dialog{
  position:relative;z-index:1;width:min(880px,92vw);max-height:88vh;display:flex;flex-direction:column;
  background:#fff;border:1px solid var(--line);border-radius:12px;
  box-shadow:0 24px 64px rgba(0,0,0,.28);overflow:hidden;
}
.orig-hd{
  flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;
  padding:11px 16px;border-bottom:1px solid var(--line);background:#fafaf7;
}
.orig-title{font-size:13.5px;font-weight:800;color:var(--ink)}
.orig-close{
  font-family:inherit;font-size:22px;line-height:1;color:var(--muted);
  background:none;border:0;cursor:pointer;padding:0 4px;border-radius:5px;
}
.orig-close:hover{background:#eee;color:var(--ink)}
.orig-body{flex:1 1 auto;overflow:auto;padding:16px;background:#f3f3ef;text-align:center}
.orig-body img{
  max-width:100%;height:auto;display:block;margin:0 auto;
  image-rendering:auto;box-shadow:0 2px 12px rgba(0,0,0,.12);background:#fff;
}
.orig-modal.zoomed .orig-body img{max-width:none;width:auto;cursor:zoom-out}
.orig-ft{
  flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;
  padding:9px 16px;border-top:1px solid var(--line);color:var(--muted);font-size:11px;
}
.orig-ft .btn{padding:5px 14px;font-size:11.5px}
[hidden]{display:none!important}

/* 原书弹层：页签 + 练习翻页 */
.orig-hd .orig-title{margin-right:14px}
.orig-ft{position:relative}
.orig-nav{display:flex;align-items:center;gap:8px;font-size:11px;color:var(--muted)}
.orig-nav .btn{padding:3px 9px;font-size:11px}
.orig-ft #origHint{margin-left:auto;margin-right:12px}
