﻿/* ============================================================
   ch06「雷渊驯劫」章节专属样式
   境界色：炼气期翠绿 var(--accent)（炼气六层·雷渊驯劫）
   点亮色：电弧青 #6FD3E0（渊面奔雷 / 演出读数）
   对立色：幽影墨蓝 #2E2E3E（散逸幽影 · 熵魔第一阶段）
   漂移侠鎏金独立变量 --px：保持其金甲不褪色
   一切基础色值仍走 tokens 变量；以下仅做本章变量映射与组件样式。
   ============================================================ */

/* ---------- 本章变量映射（仅影响本页，不改 tokens.css） ---------- */
/* 境界色：炼气期翠绿 #10B981 */
:root, :root[data-theme="light"] {
  --accent: #10B981;                     /* 炼气翠绿 · 境界色 */
  --accent-ink: #0D8A63;                 /* 翠绿·亮底文字级 */
  --accent-soft: rgba(16, 185, 129, 0.13);
  --glow: 0 0 18px rgba(16, 185, 129, 0.25);
  --mist: #2E2E3E;                       /* 幽影墨蓝 */
  --mist-ink: #4A4A5E;                   /* 墨蓝·亮底文字级 */
  --mist-soft: rgba(46, 46, 62, 0.18);
  --calc: #6FD3E0;                       /* 电弧青（演出/读数） */
  --calc-ink: #2A8A95;
  --calc-soft: rgba(111, 211, 224, 0.16);
  --waterline: #3E6C8E;                  /* 实测/合法标记（沿用） */
  --waterline-ink: #3E6C8E;
  --color-correct: #1FA866;
  --color-insight: #0D8A63;
  --px: #9E7A2E;                         /* 漂移侠鎏金（独立于 --accent） */
  --px-ink: #9E7A2E;
  --px-soft: rgba(158, 122, 46, 0.13);
  --youying-glow: #E8E8F0;               /* 熵魔之眼虚白（全章仅 S9 用一次） */
  /* ---- 规格书 Design Tokens（交互组件） ---- */
  --curve-linear: var(--accent);               /* 线性外推·翠绿虚线 */
  --curve-saturation: #EF4444;           /* 饱和实测·红实线 */
  --curve-nonlinear: #F59E0B;            /* 弯曲区·金 */
  --fit-curve: #0891B2;                  /* 拟合曲线·青蓝 */
  --data-points: #6366F1;                /* 实测数据点·靛蓝 */
  --velocity-marker: #F59E0B;            /* 速度标记·金 */
  --electron-color: #6FD3E0;             /* 电子·电弧青 */
  --hole-color: #FCD34D;                 /* 空穴·暖金 */
  --alpha-curve: var(--accent);                /* α曲线·翠绿 */
  --threshold-line: #EF4444;             /* 阈能线·红 */
  --option-correct: var(--accent);             /* 正确选项·翠绿 */
  --option-wrong: #EF4444;               /* 错误选项·红 */
  --option-distract: #6366F1;            /* 干扰项·靛蓝 */
  --grid-line: rgba(16, 185, 129, 0.08);  /* 网格背景线 */
}
:root[data-theme="dark"] {
  --accent: #10B981;
  --accent-ink: #34D399;                 /* 翠绿·暗底提亮（文字级） */
  --accent-soft: rgba(16, 185, 129, 0.32);
  --glow: 0 0 22px rgba(52, 211, 153, 0.35);
  --mist: #2E2E3E;
  --mist-ink: #8E8EA8;                   /* 墨蓝·暗底提亮 */
  --mist-soft: rgba(46, 46, 62, 0.20);
  --calc: #6FD3E0;
  --calc-ink: #9DE3EC;
  --calc-soft: rgba(111, 211, 224, 0.18);
  --waterline: #7FA8E0;
  --waterline-ink: #7FA8E0;
  --color-correct: #2BC47E;
  --color-insight: #34D399;
  --px: #9E7A2E;
  --px-ink: #E0C07A;                     /* 鎏金·暗底提亮 */
  --px-soft: rgba(158, 122, 46, 0.22);
  --youying-glow: #E8E8F0;
  /* ---- 规格书 Design Tokens（交互组件·暗底提亮） ---- */
  --curve-linear: var(--accent);
  --curve-saturation: #F87171;
  --curve-nonlinear: #FBBF24;
  --fit-curve: #22D3EE;
  --data-points: #818CF8;
  --velocity-marker: #FBBF24;
  --electron-color: #6FD3E0;
  --hole-color: #FCD34D;
  --alpha-curve: #34D399;
  --threshold-line: #F87171;
  --option-correct: #34D399;
  --option-wrong: #F87171;
  --option-distract: #818CF8;
  --grid-line: rgba(16, 185, 129, 0.08);
}
/* ---------- 漂移侠对话框（鎏金经典宗 · 独立于本章 --accent） ---------- */
.dlg.piaoxia { border-left-color: var(--px); box-shadow: var(--shadow), 0 0 18px var(--px-soft); }
.dlg.piaoxia .who { background: var(--px-ink); color: #FBF6E8; }
.dlg.piaoxia .avatar { border-color: var(--px); }
:root[data-theme="dark"] .dlg.piaoxia .who { color: #241A08; background: var(--px-ink); }
.dlg.piaoxia em { color: var(--px-ink); font-style: normal; font-weight: 700; }

/* ---------- 散逸幽影对话框（幽影墨蓝 · 熵魔第一阶段） ---------- */
.dlg.youying { border-left-color: var(--mist); box-shadow: var(--shadow), 0 0 18px var(--mist-soft); }
.dlg.youying .who { background: var(--mist-ink); color: #F0F0F4; }
.dlg.youying .avatar { border-color: var(--mist); filter: hue-rotate(200deg) saturate(0.7) brightness(0.8); }
:root[data-theme="dark"] .dlg.youying .who { color: #16161E; background: var(--mist-ink); }
.dlg.youying em { color: var(--mist-ink); font-style: normal; font-weight: 700; }
/* ---------- 物品栏：本命石 / 高场谱系 / 匀速纹章 / 铜马 / 半纹符 ---------- */
#inventory {
  position: fixed; left: var(--sp-3); bottom: var(--sp-3); z-index: 110;
  display: flex; gap: var(--sp-2); align-items: flex-end;
}
#silk-panel {
  position: absolute; left: 0; bottom: 70px; width: min(78vw, 320px);
  padding: var(--sp-4); max-height: 50vh; overflow-y: auto;
}
#silk-panel h3 { font-size: var(--fs-sub); margin-bottom: var(--sp-2); }
.silk-item {
  font-family: var(--font-serif);
  color: var(--mist-ink);
  border-bottom: 1px solid var(--line);
  padding: var(--sp-2) 0;
  font-size: var(--fs-small);
  animation: carve-in 0.8s var(--ease-out);
}
.silk-item b { color: var(--accent-ink); }
.lattice-cv, .curve-cv {
  width: 100%; max-width: 680px; border-radius: var(--r-md);
  background: var(--bg-sunk); border: 1px solid var(--line);
  touch-action: none;
}
/* ---------- 石碑（外推之碑 / 天劫门槛碑） ---------- */
.stele {
  width: 100%; max-width: 520px; margin: var(--sp-2) auto 0;
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--accent); border-radius: var(--r-md);
  background:
    linear-gradient(180deg, var(--accent-soft), transparent 60%),
    var(--bg-sunk);
  text-align: center; font-family: var(--font-serif);
  box-shadow: inset 0 0 24px rgba(0,0,0,0.18), var(--glow);
  animation: carve-in 1s var(--ease-out);
}
.stele-line s { color: var(--danger); text-decoration-thickness: 2px; }
/* ---------- S10 收束演出 ---------- */
.s10-wrap { display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); width: 100%; }
.s10-ctl { display: flex; align-items: center; gap: var(--sp-3); width: 100%; max-width: 620px; flex-wrap: wrap; justify-content: center; }
.s10-ctl input[type="range"] { flex: 1; min-width: 140px; }
.s10-lb { font-family: var(--font-mono); font-size: var(--fs-small); color: var(--text-2); }
.s10-read { font-family: var(--font-mono); font-size: var(--fs-small); color: var(--calc-ink); text-align: center; }
.s10-msg { font-size: var(--fs-small); color: var(--text-2); line-height: 1.8; max-width: 40rem; text-align: center; }
.s10-msg.ok { color: var(--color-correct); font-family: var(--font-serif); }
.s10-progress { font-family: var(--font-mono); color: var(--accent-ink); font-size: var(--fs-sub); }
.s10-wrap canvas, .stage canvas {
  width: 100%; max-width: 680px; border-radius: var(--r-md);
  background: var(--bg-sunk); border: 1px solid var(--line);
  touch-action: none;
}
.btn-row { display: flex; gap: var(--sp-3); justify-content: center; margin-top: var(--sp-4); flex-wrap: wrap; }
.corner-break { animation: cornerBreak 1.1s var(--ease-out); }
@keyframes cornerBreak {
  0% { filter: brightness(1); transform: none; }
  35% { filter: brightness(1.5) saturate(0.4); transform: rotate(-0.6deg); }
  100% { filter: brightness(1); transform: none; }
}
.spark-burn { animation: sparkBurn 1s var(--ease-out); }
@keyframes sparkBurn {
  0% { filter: brightness(1); }
  30% { filter: brightness(2.2) saturate(1.6) hue-rotate(-24deg); }
  100% { filter: brightness(1); }
}

/* ============================================================
   规格书交互组件样式 · S0/S1/S6/S9
   ============================================================ */

/* ---------- 预测选项（S0 速度饱和预测挑战器） ---------- */
.predict-options { display: flex; gap: var(--sp-2); flex-wrap: wrap; justify-content: center; margin: var(--sp-2) 0; }
.predict-opt {
  min-width: 120px; padding: var(--sp-2) var(--sp-3);
  border: 1px dashed var(--glass-line); border-radius: var(--r-md);
  background: var(--glass-bg); color: var(--text-2); cursor: pointer;
  font-family: var(--font-mono); font-size: var(--fs-small); text-align: center;
  transition: border-color var(--dur-fast), background var(--dur-fast), color var(--dur-fast), transform var(--dur-fast);
}
.predict-opt:hover { border-color: var(--accent); transform: translateY(-2px); }
.predict-opt.sel { border-style: solid; border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.predict-opt.right { border-color: var(--option-correct); color: var(--option-correct); background: rgba(16,185,129,0.12); border-style: solid; }
.predict-opt.wrong { border-color: var(--option-wrong); color: var(--option-wrong); background: rgba(239,68,68,0.10); border-style: solid; opacity: 0.6; }
.confirm-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ---------- 弯点标记按钮 ---------- */
.bend-btn { border-color: var(--curve-nonlinear); color: var(--curve-nonlinear); }
.bend-btn.on { border-style: solid; background: rgba(245,158,11,0.12); }

/* ---------- 导师提示区（赌徒风格短句） ---------- */
.mentor-cue {
  width: 100%; max-width: 40rem; margin: var(--sp-3) auto 0;
  padding: var(--sp-3) var(--sp-4);
  border-left: 3px solid var(--accent); border-radius: 0 var(--r-md) var(--r-md) 0;
  background: var(--accent-soft);
  font-family: var(--font-serif); font-style: italic;
  color: var(--accent-ink); letter-spacing: 0.05em; line-height: 1.8;
  opacity: 0; transform: translateX(-8px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
.mentor-cue.show { opacity: 1; transform: none; }
.mentor-cue::before { content: 'mentor · '; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.2em; opacity: 0.6; }

/* ---------- 拟合开关 + 三区高亮（S1 v-E 曲线追踪器） ---------- */
.fit-toggle { display: flex; gap: var(--sp-2); flex-wrap: wrap; justify-content: center; }
.fit-toggle .btn { min-width: 90px; }
.region-btns { display: flex; gap: var(--sp-2); flex-wrap: wrap; justify-content: center; }
.region-btn { min-width: 80px; }
.region-btn.on-linear { border-color: var(--curve-linear); color: var(--curve-linear); border-style: solid; }
.region-btn.on-bend { border-color: var(--curve-nonlinear); color: var(--curve-nonlinear); border-style: solid; }
.region-btn.on-sat { border-color: var(--curve-saturation); color: var(--curve-saturation); border-style: solid; }

/* ---------- 公式面板 ---------- */
.formula-panel { display: flex; flex-direction: column; gap: var(--sp-1); margin: var(--sp-2) 0; }
.formula-row {
  padding: var(--sp-1) var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--bg-sunk); font-size: var(--fs-small); color: var(--text-2);
  transition: border-color var(--dur-fast), background var(--dur-fast), color var(--dur-fast);
}
.formula-row.hi-linear { border-color: var(--curve-linear); color: var(--curve-linear); background: rgba(16,185,129,0.08); }
.formula-row.hi-bend { border-color: var(--curve-nonlinear); color: var(--curve-nonlinear); background: rgba(245,158,11,0.08); }
.formula-row.hi-sat { border-color: var(--curve-saturation); color: var(--curve-saturation); background: rgba(239,68,68,0.08); }
.formula-row .flabel { font-family: var(--font-mono); font-size: 0.7rem; opacity: 0.7; margin-right: var(--sp-2); }

/* ---------- 三旋钮面板（S6 碰撞电离实验台） ---------- */
.knob-panel { display: flex; gap: var(--sp-3); flex-wrap: wrap; justify-content: center; }
.knob-cell { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 160px; flex: 1; max-width: 200px; }
.knob-cell .knob-readout { font-family: var(--font-mono); font-size: var(--fs-small); color: var(--accent-ink); text-align: center; }
.material-btns { display: flex; gap: var(--sp-1); justify-content: center; }
.material-btn { min-width: 60px; padding: 4px 10px; font-size: 0.75rem; }
.material-btn.on { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); border-style: solid; }

/* ---------- 雪崩击穿警告 ---------- */
.breakdown-warn {
  padding: var(--sp-2) var(--sp-3); border: 1px solid var(--danger); border-radius: var(--r-md);
  background: var(--danger-soft); color: var(--danger);
  font-family: var(--font-mono); font-size: var(--fs-small); text-align: center;
  animation: warnPulse 1s ease-in-out infinite;
}
@keyframes warnPulse { 0%,100% { opacity: 0.7; } 50% { opacity: 1; } }

/* ---------- 数字链回收（S9 Boss 收网器） ---------- */
.number-chain { display: flex; gap: var(--sp-2); flex-wrap: wrap; justify-content: center; margin: var(--sp-3) 0; }
.chain-item {
  display: flex; flex-direction: column; gap: 2px; min-width: 140px;
  padding: var(--sp-2) var(--sp-3); border: 1px dashed var(--line); border-radius: var(--r-md);
  background: var(--bg-sunk); color: var(--text-3);
  font-family: var(--font-mono); font-size: var(--fs-small); text-align: center;
  transition: all var(--dur-med) var(--ease-out);
  opacity: 0.4;
}
.chain-item.lit { border-style: solid; border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); box-shadow: var(--glow); opacity: 1; }
.chain-item .chain-label { font-size: 0.7rem; letter-spacing: 0.15em; opacity: 0.7; }
.chain-item .chain-val { font-weight: 600; }
.chain-item .chain-src { font-size: 0.65rem; }
.chain-item.lit .chain-label { color: var(--accent-ink); opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .stage.collapse, .corner-break, .spark-burn { animation: none; }
  .breakdown-warn { animation: none; }
}
