﻿/* ============================================================
   ch09「循环神经网络 RNN：序列建模的时序之剑」章节专属样式
   境界：筑基四层·序列寻踪 · 流光青 var(--ch-ok)
   Boss：遗忘之流 · 灰雾 #64748B
   顿悟：突破金 var(--ch-epiphany)（理解发生之处/金光裂纹/顿悟脉冲）
   直觉冲突：赤红 var(--ch-boss)
   时序之链：流光青碎片 var(--ch-ok)
   背景：暖深蓝灰 var(--ch-bg-warm)（禁止纯黑）
   全部色值走 tokens 变量；玻璃态卡片；发光仅限边框/背景。
   ============================================================ */

/* ---------- 章节境界色覆写：流光青 ---------- */
:root, :root[data-theme="light"] {
  --accent: #0891B2;
  --accent-ink: #0E7490;
  --accent-soft: rgba(6, 182, 212, 0.12);
  --glass-line: rgba(6, 182, 212, 0.22);
  --glow: 0 0 18px rgba(6, 182, 212, 0.28);
  --on-accent: #FFFFFF;
  --r-xs: 4px;
}
:root[data-theme="dark"] {
  --accent: #22D3EE;
  --accent-ink: #06B6D4;
  --accent-soft: rgba(6, 182, 212, 0.16);
  --glass-line: rgba(34, 211, 238, 0.22);
  --glow: 0 0 22px rgba(6, 182, 212, 0.34);
  --on-accent: #031016;
  --r-xs: 4px;
}

/* ---------- 章节专用叙事色 ---------- */
:root {
  --ch-boss: #64748B;          /* 遗忘之流 · 灰雾 */
  --ch-boss-ink: #94A3B8;      /* 雾灰亮 */
  --ch-boss-soft: rgba(100, 116, 139, 0.22);
  --ch-boss-line: rgba(100, 116, 139, 0.42);
  --ch-epiphany: var(--ch-epiphany);      /* 顿悟突破金（理解发生之处） */
  --ch-epiphany-soft: rgba(251, 191, 36, 0.16);
  --ch-epiphany-ink: #D97706;
  --ch-conflict: var(--ch-boss);      /* 直觉冲突赤红 */
  --ch-conflict-soft: rgba(239, 68, 68, 0.14);
  --ch-conflict-ink: #DC2626;
  --ch-cyan: #06B6D4;          /* 流光青 */
  --ch-cyan-soft: rgba(6, 182, 212, 0.14);
  --ch-cyan-ink: #0E7490;
  /* 三条贯穿机制色 */
  --debt-red: var(--ch-boss);         /* 遗忘债赤红光页 */
  --debt-soft: rgba(239, 68, 68, 0.12);
  --carve-mark: #06B6D4;       /* 排除刻痕流光青微光 */
  --carve-soft: rgba(6, 182, 212, 0.14);
  --chain-shard: #06B6D4;      /* 时序之链碎片青 */
  --chain-crack: #F87171;      /* 时序之链断裂红 */
  /* 序列模型功能色 */
  --rnn-flow: #06B6D4;         /* RNN 递推流青 */
  --rnn-input: #67E8F9;        /* 输入粒子亮青 */
  --grad-gold: var(--ch-epiphany);        /* 梯度金流 */
  --grad-fade: #475569;        /* 衰减灰 */
  --lstm-forget: #64748B;      /* 遗忘门灰蓝 */
  --lstm-input: #06B6D4;       /* 输入门青 */
  --lstm-output: #D4A853;      /* 输出门金 */
  --lstm-cell: #0EA5E9;        /* cell state 蓝 */
  --gru-update: #22D3EE;       /* GRU 更新门亮青 */
  --gru-reset: #A78BFA;        /* GRU 重置门紫 */
  --bidir-fwd: #06B6D4;        /* 前向青 */
  --bidir-bwd: #A78BFA;        /* 后向紫 */
  --embed-purple: #A78BFA;     /* 词嵌入紫 */
  --seq2seq-enc: #22C55E;      /* 编码器绿 */
  --seq2seq-ctx: var(--ch-boss);      /* 瓶颈红 */
  --seq2seq-dec: #67E8F9;      /* 解码器亮青 */
  --attention-gold: var(--ch-epiphany);   /* 注意力金 */
  /* S0 五场景色 */
  --case-translate: var(--ch-epiphany);   /* 机器翻译金 */
  --case-asr: #06B6D4;         /* 语音识别青 */
  --case-music: #A78BFA;       /* 音乐生成紫 */
  --case-stock: #22C55E;       /* 股票预测绿 */
  --case-sentiment: #F87171;   /* 情感分析红 */
  /* S9 Boss */
  --boss-face: #64748B;        /* 雾脸灰 */
  --answer-correct: #06B6D4;   /* 正解流光青光 */
  --answer-wrong: var(--ch-boss);     /* 错答红 */
  --answer-eliminated: #475569;/* 被刻痕划去选项灰 */
  --net-gold: var(--ch-epiphany);         /* 收网金光 */
  --breakthrough: #FBBF24;     /* 突破金光 */
  /* 选项/状态色 */
  --opt-correct: #06B6D4;
  --opt-wrong: var(--ch-boss);
  --opt-excluded: #475569;
  --ch-ok: #06B6D4;
  --ch-warn: var(--ch-boss);
  --ch-bg-warm: var(--ch-bg-warm);       /* 暖深蓝灰背景 */
}

/* ---------- 导师高斯老祖对话框变体 ---------- */
.dlg.gauss {
  border-left-color: var(--accent);
  box-shadow: var(--shadow), 0 0 18px var(--accent-soft);
}
.dlg.gauss .who {
  background: var(--accent); color: var(--on-accent);
}
.dlg.gauss .avatar {
  border-color: var(--accent);
}
.dlg.gauss p {
  color: var(--text-1);
}

/* ---------- 开场（opening） ---------- */
#opening {
  position: relative; z-index: 2;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--sp-5); text-align: center;
  padding: calc(var(--nav-h) + var(--sp-6)) var(--sp-4) var(--sp-7);
  background: radial-gradient(ellipse at center, var(--ch-bg-warm, #0A1822) 0%, var(--ch-bg-warm) 70%);
}
.op-title span {
  display: inline-block; opacity: 0;
  text-shadow: 0 0 60px var(--accent-soft), 0 0 24px var(--ch-cyan-soft);
}
.inv-crack {
  display: inline-block; margin-left: var(--sp-1);
  font-size: 0.65rem; color: var(--chain-crack);
  background: rgba(248,113,113,0.14); padding: 0 4px; border-radius: 3px;
}
#carve-panel, #chain-panel {
  position: absolute; right: 0; bottom: calc(100% + var(--sp-1));
  width: 280px; padding: var(--sp-3); z-index: 85;
}
#carve-panel h3, #chain-panel h3 { font-size: 0.9rem; margin-bottom: var(--sp-2); color: var(--ch-cyan-ink); }
#carve-list p { font-size: 0.8rem; color: var(--ch-cyan); margin: var(--sp-1) 0; }
#chain-list p { font-size: 0.8rem; color: var(--chain-shard); margin: var(--sp-1) 0; }
.option.excluded { opacity: 0.3; cursor: default; transform: none; text-decoration: line-through; border-color: var(--opt-excluded); background: rgba(71,85,105,0.16); }
.sim-range, input[type="range"], .knob-range, select { accent-color: var(--accent); }
.btn-warn { border-color: var(--ch-warn); color: var(--ch-warn); }
.btn-warn:hover { background: rgba(239,68,68,0.12); }
.btn.on { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }

/* ---------- 通用 knob 旋钮 ---------- */
.knob-row { display: flex; gap: var(--sp-3); justify-content: center; flex-wrap: wrap; }
.knob-unit {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-1);
  padding: var(--sp-2) var(--sp-3); border: 1px solid var(--glass-line); border-radius: var(--r-sm);
  background: var(--bg-sunk); min-width: 120px; transition: all 300ms cubic-bezier(0.22,1,0.36,1);
}
.knob-unit:hover { border-color: var(--accent); }
.knob-label { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-2); letter-spacing: 0.1em; }

/* ============================================================
   S0 时序之河 · 记忆之赌
   ============================================================ */
.cmp-river-bet { width: 100%; display: flex; flex-direction: column; gap: var(--sp-3); }
.bet-question {
  text-align: center; font-size: 1rem; color: var(--ch-boss-ink);
  padding: var(--sp-2); letter-spacing: 0.06em; font-style: italic;
}
.case-silhouettes { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--sp-2); }
.case-card {
  padding: var(--sp-2); border: 1px solid var(--glass-line); border-radius: var(--r-sm);
  background: var(--bg-sunk); cursor: pointer; text-align: center;
  transition: all 300ms cubic-bezier(0.22,1,0.36,1); min-height: 80px; opacity: 0.6;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.case-card:hover { opacity: 1; border-color: var(--accent); transform: translateY(-2px); }
.case-card.guessed { opacity: 1; border-color: var(--debt-red); background: var(--debt-soft); }
.case-card .cc-name { font-family: var(--font-mono); font-size: 0.74rem; font-weight: 600; color: var(--text-1); }
.case-card .cc-icon { font-size: 1.1rem; }
.case-card[data-case="translate"] { border-left: 3px solid var(--case-translate); }
.case-card[data-case="asr"] { border-left: 3px solid var(--case-asr); }
.case-card[data-case="music"] { border-left: 3px solid var(--case-music); }
.case-card[data-case="stock"] { border-left: 3px solid var(--case-stock); }
.case-card[data-case="sentiment"] { border-left: 3px solid var(--case-sentiment); }
.debt-account {
  width: 100%; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--debt-red);
  border-radius: var(--r-sm); background: var(--debt-soft);
  font-size: 0.82rem; color: var(--text-2); font-style: italic;
  animation: riftOpen 500ms cubic-bezier(0.22,1,0.36,1);
}
.debt-account .acct-line { margin: var(--sp-1) 0; }
.debt-account .acct-line b { color: var(--debt-red); font-style: normal; }
.sequence-map {
  width: 100%; padding: var(--sp-3); border: 1px solid var(--accent); border-radius: var(--r-sm);
  background: var(--accent-soft); animation: riftOpen 600ms cubic-bezier(0.22,1,0.36,1);
}
.sequence-map h4 { font-size: 0.85rem; color: var(--accent-ink); margin-bottom: var(--sp-2); text-align: center; }
.sequence-map .map-nodes { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--sp-1); }
.map-node {
  padding: var(--sp-1) 4px; border: 1px solid var(--glass-line); border-radius: var(--r-xs);
  background: var(--bg-elev); font-size: 0.66rem; text-align: center; color: var(--text-3);
  transition: all 400ms cubic-bezier(0.22,1,0.36,1);
}
.map-node.lit { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }

/* ============================================================
   S1 序列之眼 · 水镜词牌重排
   ============================================================ */
.cmp-sequence-eye { width: 100%; display: flex; flex-direction: column; gap: var(--sp-3); }
.bet-toggle { display: flex; gap: var(--sp-2); justify-content: center; }
.bet-toggle .btn { min-width: 160px; }
.bet-toggle .btn.on { border-style: solid; }
.mirror-zone {
  width: 100%; padding: var(--sp-2); border: 1px solid var(--glass-line); border-radius: var(--r-sm);
  background: var(--bg-sunk); animation: riftOpen 500ms cubic-bezier(0.22,1,0.36,1);
}
.mirror-zone canvas { width: 100%; max-width: 480px; height: auto; border: 1px solid var(--glass-line); border-radius: var(--r-xs); background: var(--bg-elev); display: block; margin: 0 auto var(--sp-2); }
.word-tray, .word-track {
  display: flex; gap: var(--sp-1); flex-wrap: wrap; justify-content: center; min-height: 44px;
  padding: var(--sp-1); border: 1px dashed var(--glass-line); border-radius: var(--r-xs); background: var(--bg-elev);
}
.word-track { border-style: solid; min-height: 50px; }
.word-tile {
  padding: 4px 10px; border: 1px solid var(--accent); border-radius: var(--r-xs);
  background: var(--accent-soft); font-family: var(--font-mono); font-size: 0.82rem; color: var(--accent-ink);
  cursor: pointer; transition: all 200ms cubic-bezier(0.22,1,0.36,1); user-select: none;
}
.word-tile:hover { transform: translateY(-2px); box-shadow: var(--glow); }
.word-tile.scrambled { border-color: var(--ch-conflict); color: var(--ch-conflict); background: var(--ch-conflict-soft); }
.varlen-zone {
  width: 100%; padding: var(--sp-3); border: 1px solid var(--glass-line); border-radius: var(--r-sm);
  background: var(--bg-sunk); animation: riftOpen 500ms cubic-bezier(0.22,1,0.36,1);
}
.varlen-zone h4 { font-size: 0.85rem; color: var(--accent-ink); margin-bottom: var(--sp-2); text-align: center; }
.varlen-zone canvas { width: 100%; max-width: 480px; height: auto; border: 1px solid var(--glass-line); border-radius: var(--r-xs); background: var(--bg-elev); display: block; margin: 0 auto; }
.varlen-controls { display: flex; gap: var(--sp-2); justify-content: center; flex-wrap: wrap; margin-top: var(--sp-2); }
.exclude-mark {
  width: 100%; margin-top: var(--sp-2); padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--ch-epiphany); border-radius: var(--r-sm);
  background: var(--ch-epiphany-soft); font-size: 0.82rem; color: var(--ch-epiphany-ink);
  font-style: italic; animation: riftOpen 500ms cubic-bezier(0.22,1,0.36,1);
}

/* ============================================================
   S2 隐状态殿 · 递推环组装
   ============================================================ */
.cmp-rnn-recurrent { width: 100%; display: flex; flex-direction: column; gap: var(--sp-3); }
.matrix-tray { display: flex; gap: var(--sp-2); justify-content: center; flex-wrap: wrap; }
.matrix-chip {
  padding: var(--sp-2) var(--sp-3); border: 1px solid var(--glass-line); border-radius: var(--r-sm);
  background: var(--bg-elev); cursor: pointer; transition: all 300ms cubic-bezier(0.22,1,0.36,1);
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 90px;
}
.matrix-chip:hover { border-color: var(--accent); transform: translateY(-2px); }
.matrix-chip.placed { opacity: 0.35; cursor: default; border-color: var(--accent); background: var(--accent-soft); }
.matrix-chip .mc-sym { font-family: var(--font-mono); font-size: 0.9rem; font-weight: 600; color: var(--text-1); }
.matrix-chip .mc-desc { font-size: 0.64rem; color: var(--text-3); }
.cmp-rnn-recurrent canvas { width: 100%; max-width: 480px; height: auto; border: 1px solid var(--glass-line); border-radius: var(--r-xs); background: var(--bg-elev); display: block; margin: 0 auto; }
.formula-zone {
  width: 100%; padding: var(--sp-3); border: 1px solid var(--accent); border-radius: var(--r-sm);
  background: var(--accent-soft); animation: riftOpen 500ms cubic-bezier(0.22,1,0.36,1);
}
.formula-zone .fz-line {
  padding: var(--sp-1) var(--sp-2); font-family: var(--font-mono); font-size: 0.82rem; color: var(--accent-ink);
  line-height: 1.8;
}
.step-controls { display: flex; gap: var(--sp-2); justify-content: center; flex-wrap: wrap; }
.step-readout {
  padding: var(--sp-2); font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-2); text-align: center;
  border: 1px solid var(--glass-line); border-radius: var(--r-xs); background: var(--bg-elev);
}

/* ============================================================
   S3 时序回溯 · BPTT 推导
   ============================================================ */
.cmp-bptt-derive { width: 100%; display: flex; flex-direction: column; gap: var(--sp-3); }
.unfold-zone {
  width: 100%; padding: var(--sp-2); border: 1px solid var(--glass-line); border-radius: var(--r-sm);
  background: var(--bg-sunk);
}
.unfold-zone canvas { width: 100%; max-width: 480px; height: auto; border: 1px solid var(--glass-line); border-radius: var(--r-xs); background: var(--bg-elev); display: block; margin: 0 auto; }
.unfold-controls { display: flex; gap: var(--sp-2); justify-content: center; flex-wrap: wrap; margin-top: var(--sp-2); }
.derive-zone {
  width: 100%; padding: var(--sp-3); border: 1px solid var(--grad-gold); border-radius: var(--r-sm);
  background: var(--ch-epiphany-soft); animation: riftOpen 500ms cubic-bezier(0.22,1,0.36,1);
}
.derive-zone h4 { font-size: 0.85rem; color: var(--ch-epiphany-ink); margin-bottom: var(--sp-2); }
.derive-step {
  padding: var(--sp-1) var(--sp-2); margin-bottom: 2px; border-left: 2px solid var(--grad-gold);
  font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-2);
  background: var(--bg-elev); animation: riftOpen 300ms cubic-bezier(0.22,1,0.36,1); line-height: 1.7;
}
.derive-step .ds-tag { font-size: 0.66rem; color: var(--text-3); margin-right: 6px; }
.derive-step.highlight { border-left-color: var(--ch-conflict); color: var(--ch-conflict-ink); box-shadow: 0 0 8px var(--ch-conflict-soft); }
.derive-nav { display: flex; gap: var(--sp-2); justify-content: center; margin-top: var(--sp-2); }

/* ============================================================
   S4 梯度深渊
   ============================================================ */
.cmp-gradient-abyss { width: 100%; display: flex; flex-direction: column; gap: var(--sp-3); }
.t-slider-zone, .spectral-zone, .clip-zone {
  width: 100%; padding: var(--sp-3); border: 1px solid var(--glass-line); border-radius: var(--r-sm);
  background: var(--bg-sunk);
}
.t-slider-zone h4, .spectral-zone h4 { font-size: 0.85rem; color: var(--accent-ink); margin-bottom: var(--sp-2); text-align: center; }
.t-slider-zone input[type="range"] { width: 100%; margin-bottom: var(--sp-2); }
.t-slider-zone canvas { width: 100%; max-width: 480px; height: auto; border: 1px solid var(--glass-line); border-radius: var(--r-xs); background: var(--bg-elev); display: block; margin: 0 auto; }
.grad-metrics { margin-top: var(--sp-2); display: flex; flex-direction: column; gap: var(--sp-1); }
.grad-metric { display: flex; align-items: center; gap: var(--sp-2); }
.grad-metric .gm-label { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-3); min-width: 110px; }
.grad-metric .gm-track { flex: 1; height: 8px; border: 1px solid var(--glass-line); border-radius: 4px; background: var(--bg-elev); overflow: hidden; }
.grad-metric .gm-fill { height: 100%; transition: width 400ms cubic-bezier(0.22,1,0.36,1); }
.grad-metric .gm-fill.vanish { background: var(--grad-fade); }
.grad-metric .gm-fill.explode { background: var(--ch-conflict); }
.grad-metric .gm-value { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-2); min-width: 100px; text-align: right; }
.spectral-controls { display: flex; gap: var(--sp-2); justify-content: center; flex-wrap: wrap; }
.clip-zone { animation: riftOpen 500ms cubic-bezier(0.22,1,0.36,1); }
.clip-toggle { display: flex; align-items: center; gap: var(--sp-2); cursor: pointer; font-size: 0.82rem; color: var(--text-2); }
.clip-readout { margin-top: var(--sp-2); padding: var(--sp-1) var(--sp-2); font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-2); }

/* ============================================================
   S5 LSTM 三门
   ============================================================ */
.cmp-lstm-gates { width: 100%; display: flex; flex-direction: column; gap: var(--sp-3); }
.gates-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
.gate-unit {
  padding: var(--sp-2); border: 1px solid var(--glass-line); border-radius: var(--r-sm);
  background: var(--bg-sunk); display: flex; flex-direction: column; gap: 4px;
}
.gate-unit[data-gate="forget"] { border-top: 3px solid var(--lstm-forget); }
.gate-unit[data-gate="input"] { border-top: 3px solid var(--lstm-input); }
.gate-unit[data-gate="output"] { border-top: 3px solid var(--lstm-output); }
.gate-unit .gu-name { font-size: 0.78rem; font-weight: 600; color: var(--text-1); text-align: center; }
.gate-unit .gu-val { font-family: var(--font-mono); font-size: 0.72rem; color: var(--accent-ink); text-align: center; }
.gate-unit input[type="range"] { width: 100%; }
.cmp-lstm-gates canvas { width: 100%; max-width: 480px; height: auto; border: 1px solid var(--glass-line); border-radius: var(--r-xs); background: var(--bg-elev); display: block; margin: 0 auto; }
.cell-readout {
  padding: var(--sp-2); font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-2); text-align: center;
  border: 1px solid var(--glass-line); border-radius: var(--r-xs); background: var(--bg-elev);
}
.cell-readout b { color: var(--accent); }

/* ============================================================
   S6 恒流之核 CEC
   ============================================================ */
.cmp-cec-core { width: 100%; display: flex; flex-direction: column; gap: var(--sp-3); }
.compare-zone {
  width: 100%; padding: var(--sp-2); border: 1px solid var(--glass-line); border-radius: var(--r-sm);
  background: var(--bg-sunk);
}
.compare-zone canvas { width: 100%; max-width: 480px; height: auto; border: 1px solid var(--glass-line); border-radius: var(--r-xs); background: var(--bg-elev); display: block; margin: 0 auto; }
.cec-controls { display: flex; gap: var(--sp-3); justify-content: center; flex-wrap: wrap; }
.cec-slider { display: flex; flex-direction: column; gap: 4px; min-width: 140px; }
.cec-slider label { font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-2); text-align: center; }
.cec-slider input[type="range"] { width: 100%; }
.cec-readout {
  padding: var(--sp-2); font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-2); text-align: center;
  border: 1px solid var(--glass-line); border-radius: var(--r-xs); background: var(--bg-elev); line-height: 1.8;
}
.cec-readout b { color: var(--accent); }
.cec-readout .ce-warn { color: var(--ch-conflict); }

/* ============================================================
   S7 简化与扩展
   ============================================================ */
.cmp-simplify-extend { width: 100%; display: flex; flex-direction: column; gap: var(--sp-3); }
.branch-toggle { display: flex; gap: var(--sp-2); justify-content: center; }
.gru-zone, .extend-zone {
  width: 100%; padding: var(--sp-3); border: 1px solid var(--glass-line); border-radius: var(--r-sm);
  background: var(--bg-sunk); animation: riftOpen 400ms cubic-bezier(0.22,1,0.36,1);
}
.gru-tray { display: flex; gap: var(--sp-2); justify-content: center; flex-wrap: wrap; margin-bottom: var(--sp-2); }
.gru-chip {
  padding: var(--sp-2) var(--sp-3); border: 1px solid var(--glass-line); border-radius: var(--r-sm);
  background: var(--bg-elev); cursor: pointer; transition: all 300ms cubic-bezier(0.22,1,0.36,1);
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 90px;
}
.gru-chip:hover { border-color: var(--accent); transform: translateY(-2px); }
.gru-chip.placed { opacity: 0.35; cursor: default; border-color: var(--accent); background: var(--accent-soft); }
.gru-chip .gc-sym { font-family: var(--font-mono); font-size: 0.86rem; font-weight: 600; color: var(--text-1); }
.gru-chip .gc-desc { font-size: 0.64rem; color: var(--text-3); }
.gru-zone canvas, .extend-zone canvas { width: 100%; max-width: 480px; height: auto; border: 1px solid var(--glass-line); border-radius: var(--r-xs); background: var(--bg-elev); display: block; margin: 0 auto; }
.gru-formula {
  margin-top: var(--sp-2); padding: var(--sp-2) var(--sp-3); border: 1px solid var(--accent); border-radius: var(--r-sm);
  background: var(--accent-soft); font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent-ink); line-height: 1.8;
  animation: riftOpen 400ms cubic-bezier(0.22,1,0.36,1);
}
.param-compare {
  margin-top: var(--sp-2); padding: var(--sp-2) var(--sp-3); border: 1px solid var(--ch-epiphany); border-radius: var(--r-sm);
  background: var(--ch-epiphany-soft); font-size: 0.8rem; color: var(--ch-epiphany-ink);
  animation: riftOpen 400ms cubic-bezier(0.22,1,0.36,1);
}
.extend-zone h4 { font-size: 0.85rem; color: var(--accent-ink); margin: var(--sp-2) 0 var(--sp-1); }
.extend-zone input[type="range"] { width: 100%; margin: var(--sp-1) 0; }
.bidir-controls { display: flex; gap: var(--sp-2); justify-content: center; margin: var(--sp-2) 0; }

/* ============================================================
   S8 序列万象
   ============================================================ */
.cmp-sequence-panorama { width: 100%; display: flex; flex-direction: column; gap: var(--sp-3); }
.bench-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-2); }
.bench-tabs .btn { font-size: 0.74rem; padding: var(--sp-1) var(--sp-2); }
.bench-tabs .btn.on { border-style: solid; }
.bench-zone {
  width: 100%; padding: var(--sp-3); border: 1px solid var(--glass-line); border-radius: var(--r-sm);
  background: var(--bg-sunk); animation: riftOpen 400ms cubic-bezier(0.22,1,0.36,1);
}
.bench-zone h4 { font-size: 0.85rem; color: var(--accent-ink); margin-bottom: var(--sp-2); text-align: center; }
.bench-zone canvas { width: 100%; max-width: 480px; height: auto; border: 1px solid var(--glass-line); border-radius: var(--r-xs); background: var(--bg-elev); display: block; margin: 0 auto; }
.lm-toggle, .embed-toggle { display: flex; gap: var(--sp-2); justify-content: center; margin-bottom: var(--sp-2); }
.ppl-readout, .seq2seq-readout {
  margin-top: var(--sp-2); padding: var(--sp-2); font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-2); text-align: center;
  border: 1px solid var(--glass-line); border-radius: var(--r-xs); background: var(--bg-elev); line-height: 1.7;
}
.ppl-readout b { color: var(--accent); }
.seq2seq-readout b { color: var(--accent); }
.seq2seq-readout .warn { color: var(--ch-conflict); }
.embed-controls { margin-top: var(--sp-2); }
.embed-controls label { font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-2); display: block; text-align: center; margin-bottom: 4px; }
.embed-controls input[type="range"] { width: 100%; }
.analogy-input { display: flex; gap: var(--sp-2); justify-content: center; align-items: center; margin-bottom: var(--sp-2); flex-wrap: wrap; }
.analogy-input input[type="text"] {
  padding: var(--sp-1) var(--sp-2); border: 1px solid var(--glass-line); border-radius: var(--r-xs);
  background: var(--bg-elev); font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-1); min-width: 220px;
}
.analogy-result {
  padding: var(--sp-2); font-family: var(--font-mono); font-size: 0.82rem; color: var(--accent-ink); text-align: center;
  border: 1px solid var(--accent); border-radius: var(--r-xs); background: var(--accent-soft); margin-bottom: var(--sp-2);
  animation: riftOpen 400ms cubic-bezier(0.22,1,0.36,1);
}
.seq2seq-controls { margin-top: var(--sp-2); }
.seq2seq-controls label { font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-2); display: block; text-align: center; margin-bottom: 4px; }
.seq2seq-controls input[type="range"] { width: 100%; }

/* ============================================================
   S9 Boss 战 · 遗忘之流
   ============================================================ */
#s9-arena { border-color: var(--ch-boss-line); box-shadow: var(--shadow), 0 0 32px var(--ch-boss-soft); }
.boss-figure { width: 100%; display: flex; justify-content: center; margin-bottom: var(--sp-2); }
#s9-boss-canvas { width: 100%; max-width: 480px; height: auto; border: 1px solid var(--ch-boss-line); border-radius: var(--r-sm); background: var(--bg-elev); }
.q-progress-bar { width: 100%; height: 6px; border: 1px solid var(--glass-line); border-radius: 3px; background: var(--bg-sunk); margin-bottom: var(--sp-2); overflow: hidden; }
.q-progress-fill { height: 100%; width: 0; background: var(--accent); transition: width 600ms cubic-bezier(0.22,1,0.36,1); }
.debt-ledger {
  width: 100%; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--debt-red);
  border-radius: var(--r-sm); background: var(--debt-soft);
  font-size: 0.8rem; color: var(--text-2); margin-bottom: var(--sp-2);
}
.debt-ledger .ledger-line { margin: var(--sp-1) 0; font-style: italic; }
.debt-ledger .ledger-line b { color: var(--debt-red); font-style: normal; }
.q-panel { width: 100%; padding: var(--sp-3); border: 1px solid var(--glass-line); border-radius: var(--r-sm); background: var(--bg-sunk); margin-bottom: var(--sp-2); }
.q-text { font-size: 0.95rem; color: var(--text-1); margin-bottom: var(--sp-2); }
.q-account { font-size: 0.78rem; color: var(--ch-boss-ink); font-style: italic; padding: var(--sp-1) var(--sp-2); border-left: 2px solid var(--ch-boss-line); }
.option-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.q-option {
  padding: var(--sp-2) var(--sp-3); border: 1px solid var(--glass-line); border-radius: var(--r-sm);
  background: var(--bg-elev); cursor: pointer; font-size: 0.82rem; text-align: center;
  transition: all 200ms cubic-bezier(0.22,1,0.36,1); min-height: 50px;
  display: flex; align-items: center; justify-content: center;
}
.q-option:hover { border-color: var(--accent); transform: translateY(-1px); }
.q-option.correct { border-color: var(--answer-correct); background: var(--accent-soft); color: var(--answer-correct); box-shadow: var(--glow); }
.q-option.wrong { border-color: var(--answer-wrong); background: rgba(239,68,68,0.10); color: var(--answer-wrong); }
.q-option.eliminated { opacity: 0.3; cursor: default; text-decoration: line-through; border-color: var(--answer-eliminated); background: rgba(71,85,105,0.16); transform: none; }
.q-feedback {
  padding: var(--sp-2) var(--sp-3); border-radius: var(--r-sm); font-size: 0.85rem; min-height: 32px;
  margin-bottom: var(--sp-2); animation: riftOpen 400ms cubic-bezier(0.22,1,0.36,1);
}
.q-feedback.right { border-color: var(--answer-correct); background: var(--accent-soft); color: var(--answer-correct); }
.q-feedback.wrong { border-color: var(--answer-wrong); background: rgba(239,68,68,0.10); color: var(--answer-wrong); font-style: italic; }
.carve-emergence {
  width: 100%; margin-top: var(--sp-2); padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--carve-mark); border-radius: var(--r-sm);
  background: var(--carve-soft); animation: riftOpen 500ms cubic-bezier(0.22,1,0.36,1);
}
.carve-emergence h4 { font-size: 0.85rem; color: var(--ch-cyan-ink); margin-bottom: var(--sp-2); }
.carve-emergence .carve-item {
  padding: var(--sp-1) var(--sp-2); margin-bottom: var(--sp-1);
  border: 1px solid var(--glass-line); border-radius: var(--r-xs);
  background: var(--bg-elev); font-size: 0.78rem;
  transition: all 300ms cubic-bezier(0.22,1,0.36,1);
}
.carve-emergence .carve-item.lit {
  border-color: var(--carve-mark); color: var(--ch-cyan-ink);
  background: var(--carve-soft); box-shadow: 0 0 8px var(--carve-soft);
}
.carve-emergence .carve-item.net {
  border-color: var(--net-gold); color: var(--ch-epiphany-ink);
  background: var(--ch-epiphany-soft); box-shadow: 0 0 12px var(--ch-epiphany-soft);
}
.attention-net {
  width: 100%; margin-top: var(--sp-2); padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--attention-gold); border-radius: var(--r-sm);
  background: var(--ch-epiphany-soft); animation: riftOpen 600ms cubic-bezier(0.22,1,0.36,1);
}
.attention-net h4 { font-size: 0.85rem; color: var(--ch-epiphany-ink); margin-bottom: var(--sp-2); text-align: center; }
.attention-net canvas { width: 100%; max-width: 480px; height: auto; border: 1px solid var(--attention-gold); border-radius: var(--r-xs); background: var(--bg-elev); display: block; margin: 0 auto; }
.rift-collapse {
  width: 100%; padding: var(--sp-3); border: 1px solid var(--breakthrough); border-radius: var(--r-sm);
  background: var(--ch-epiphany-soft); text-align: center; font-style: italic; color: var(--ch-epiphany-ink);
  animation: shatterIn 800ms cubic-bezier(0.22,1,0.36,1); line-height: 1.8;
}
@keyframes shatterIn {
  0% { opacity: 0; transform: scale(0.8) rotate(-2deg); }
  50% { opacity: 1; transform: scale(1.05) rotate(1deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* ============================================================
   S10 尾声 · 知识图谱
   ============================================================ */
.cmp-finale { width: 100%; display: flex; flex-direction: column; gap: var(--sp-3); }
.graph-zone {
  width: 100%; padding: var(--sp-2); border: 1px solid var(--glass-line); border-radius: var(--r-sm);
  background: var(--bg-sunk);
}
.graph-zone canvas { width: 100%; max-width: 460px; height: auto; border: 1px solid var(--glass-line); border-radius: var(--r-xs); background: var(--bg-elev); display: block; margin: 0 auto; }
.puzzle-area { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: var(--sp-2); }
.puzzle-piece {
  padding: var(--sp-2); border: 1px solid var(--glass-line); border-radius: var(--r-sm);
  background: var(--bg-sunk); text-align: center; cursor: pointer;
  transition: all 400ms cubic-bezier(0.22,1,0.36,1); min-height: 56px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  opacity: 0.3;
}
.puzzle-piece:hover { border-color: var(--accent); transform: translateY(-2px); }
.puzzle-piece.lit { opacity: 1; border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--glow); }
.puzzle-piece .pp-name { font-family: var(--font-mono); font-size: 0.66rem; font-weight: 600; color: var(--text-1); }
.puzzle-piece .pp-tag { font-size: 0.56rem; color: var(--text-3); }
.puzzle-piece.lit .pp-tag { color: var(--accent-ink); }
.depth-readout { padding: var(--sp-2); font-family: var(--font-mono); font-size: 0.82rem; color: var(--accent-ink); text-align: center; min-height: 28px; }
.realm-achieved {
  margin-top: var(--sp-3); text-align: center; padding: var(--sp-3);
  border: 1px solid var(--ch-epiphany); border-radius: var(--r-sm);
  background: var(--ch-epiphany-soft);
}
.realm-glow {
  font-family: var(--font-mono); font-size: 1.1rem; color: var(--ch-epiphany-ink); letter-spacing: 0.2em;
}
@keyframes realmGlow {
  0%, 100% { box-shadow: 0 0 18px var(--accent-soft); }
  50% { box-shadow: 0 0 32px rgba(6,182,212,0.4); }
}
.realm-achieved { animation: realmGlow 3s ease-in-out infinite; }

/* ============================================================
   响应式 · 移动端适配
   ============================================================ */
@media (max-width: 640px) {
  .op-title { font-size: clamp(2rem, 12vw, 3.5rem); }
  .op-sub { letter-spacing: 0.3em; }
  .option-grid { grid-template-columns: 1fr; }
  .case-silhouettes { grid-template-columns: repeat(2, 1fr); }
  .sequence-map .map-nodes { grid-template-columns: repeat(2, 1fr); }
  .gates-row { grid-template-columns: 1fr; }
  .bench-tabs { grid-template-columns: repeat(2, 1fr); }
  .puzzle-area { grid-template-columns: repeat(2, 1fr); }
  .knob-row { flex-direction: column; align-items: stretch; }
  .knob-unit { min-width: auto; }
  .cec-controls { flex-direction: column; align-items: stretch; }
  .cec-slider { min-width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .realm-achieved { animation: none; }
  .debt-account, .sequence-map, .exclude-mark, .mirror-zone, .varlen-zone, .formula-zone,
  .derive-zone, .clip-zone, .gru-formula, .param-compare, .bench-zone, .carve-emergence,
  .attention-net, .rift-collapse, .derive-step, .analogy-result, .step-readout,
  .cell-readout, .cec-readout, .ppl-readout, .seq2seq-readout { animation: none; }
  .case-card:hover, .matrix-chip:hover, .gru-chip:hover, .word-tile:hover, .puzzle-piece:hover { transform: none; }
}
