:root {
  --realm-color: #FFC64B;
  --realm-glow: #FFC64B33;
  --realm-glow-44: rgba(255, 198, 75, 0.27);
  --realm-glow-55: rgba(255, 198, 75, 0.33);
  --realm-glow-66: rgba(255, 198, 75, 0.40);
  --realm-glow-25: rgba(255, 198, 75, 0.25);
  --realm-faint: rgba(255, 198, 75, 0.06);
  --realm-tint: rgba(255, 198, 75, 0.08);
  --realm-soft-10: rgba(255, 198, 75, 0.10);
  --realm-soft: rgba(255, 198, 75, 0.12);
  --realm-line: rgba(255, 198, 75, 0.15);
  --realm-glow-20: rgba(255, 198, 75, 0.20);
  --realm-glow-50: rgba(255, 198, 75, 0.50);
  --mirror-silver: #C8C8D0;
}
/* focus-breath 呼吸光晕（下一场景按钮引导） */
.focus-breath {
  box-shadow: 0 0 0 0 var(--realm-glow-66);
  animation: ch15Breath 2s ease-in-out infinite;
}

@keyframes ch15Breath {
  0%, 100% { box-shadow: 0 0 0 0 var(--realm-glow-66); }
  50% { box-shadow: 0 0 16px 4px var(--realm-glow-44); }
}

/* S10 镜纹烙印（本命石·第十五痕）——古镜刻有Miller电容，映出差分对双生 */
.s10-scar-mirror {
  display: inline-block;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  vertical-align: middle;
  margin: 0 0.5rem;
  position: relative;
  background:
    radial-gradient(circle at 32% 32%, rgba(255,255,255,.65) 0%, rgba(255,255,255,0) 38%),
    linear-gradient(135deg, var(--realm-color) 0%, var(--realm-color) 48%, var(--mirror-silver) 52%, var(--mirror-silver) 100%);
  border: 2px solid var(--realm-color);
  box-shadow: 0 0 12px var(--realm-glow-55), inset 0 0 8px rgba(0,0,0,.25);
}
.s10-scar-mirror::before {
  content: '';
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  border: 1px dashed rgba(0,0,0,.32);
}
.s10-scar-mirror::after {
  content: '∮';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: rgba(0,0,0,.45);
  font-family: var(--font-mono, monospace);
}

/* S9 Boss 战触发按钮的雌黄描边（线性圣手） */
#s9-start {
  border-color: var(--realm-color);
  color: var(--realm-color);
}
#s9-start:hover {
  background: var(--realm-color);
  color: #1a1a1a;
}

/* S0 双模式波形演示——正弦（暖金）vs 方波（雌黄边） */
.dual-wave-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem;
  margin: .6rem 0;
}
.dual-wave-cell {
  padding: .5rem;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: var(--glass-bg);
  text-align: center;
}
.dual-wave-cell h5 {
  font-size: .8rem;
  color: var(--text-2);
  margin: 0 0 .3rem;
}
.dual-wave-cell .wave-tag {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--text-3);
}

/* S1 五指标雷达图占位 */
.radar-mini {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .4rem;
  margin: .5rem 0;
}
.radar-mini-cell {
  padding: .5rem .3rem;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: var(--glass-bg);
  text-align: center;
  font-size: .72rem;
}
.radar-mini-cell .rm-name { color: var(--text-2); }
.radar-mini-cell .rm-val { color: var(--accent); font-family: var(--font-mono); font-size: .9rem; }
.radar-mini-cell.gain  .rm-val { color: var(--realm-color); }
.radar-mini-cell.bw    .rm-val { color: #4FB0D8; }
.radar-mini-cell.sw    .rm-val { color: #5BC781; }
.radar-mini-cell.pow   .rm-val { color: #D24735; }
.radar-mini-cell.noise .rm-val { color: #A67AD8; }

/* S6 两级运放剖面电路图占位 */
.opamp-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: .5rem;
  margin: .5rem 0;
  font-family: var(--font-mono);
  font-size: .8rem;
}
.opamp-stage {
  padding: .6rem .8rem;
  border-left: 3px solid var(--realm-color);
  background: var(--glass-bg);
  border-radius: 0 6px 6px 0;
}
.opamp-stage.s2 { border-left-color: #A67AD8; }

/* S9 Boss 线性圣手银白镜面提示 */
.boss-mirror-hint {
  background: linear-gradient(135deg, rgba(200,200,208,.15), var(--realm-tint));
  border: 1px solid var(--mirror-silver);
  border-radius: 8px;
  padding: .8rem;
  margin: .6rem 0;
  font-size: .85rem;
  color: var(--text-2);
}

/* ============================================================
   通用交互组件样式 · 结丹期金色主题
   ============================================================ */
.mentor-cue.sac-cue {
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  border-left: 3px solid var(--realm-color);
  background: var(--realm-tint);
  color: #F1F5F9;
  font-size: 0.88rem;
  line-height: 1.6;
  border-radius: 0 8px 8px 0;
}
.frag-node {
  display: inline-block;
  margin: 0.25rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(117,135,138,.3);
  border-radius: 8px;
  background: rgba(30,25,35,.5);
  color: #75878A;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 200ms ease-out;
}
.frag-node:hover { border-color: var(--realm-color); }
.frag-node.lit {
  border-color: var(--realm-color);
  background: var(--realm-soft);
  color: var(--realm-color);
}

/* ============================================================
   S0 数字模拟双模式演示器
   ============================================================ */
.cmp-dual-mode-demo { padding: 0.5rem 0; }
.dmd-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: flex-end;
  margin-bottom: 0.6rem;
}
.dmd-mode-switch, .dmd-input-sel {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}
.dmd-btn {
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(117,135,138,.4);
  border-radius: 6px;
  background: rgba(30,25,35,.5);
  color: #94A3B8;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 200ms ease-out;
}
.dmd-btn:hover { border-color: var(--realm-color); color: var(--realm-color); }
.dmd-btn.active {
  border-color: var(--realm-color);
  background: var(--realm-line);
  color: var(--realm-color);
}
.dmd-amp label {
  display: block;
  font-size: 0.82rem;
  color: #94A3B8;
  margin-bottom: 0.2rem;
}
.dmd-amp label span { color: var(--realm-color); font-family: var(--font-mono, monospace); }
.dmd-amp input[type="range"] { width: 160px; }
.dmd-canvases { display: flex; flex-direction: column; gap: 0.4rem; }
.dmd-canvas-box {
  border: 1px solid var(--realm-line);
  border-radius: 8px;
  padding: 0.4rem;
  background: #1A1520;
}
.dmd-canvas-box h5 {
  font-size: 0.78rem;
  color: #94A3B8;
  margin: 0 0 0.2rem;
}
.dmd-canvas-box canvas { width: 100%; height: auto; display: block; }
.dmd-bias {
  padding: 0.4rem 0.6rem;
  border-left: 3px solid #F59E0B;
  background: rgba(245,158,11,.08);
  color: #F59E0B;
  font-size: 0.82rem;
  border-radius: 0 6px 6px 0;
  margin: 0.3rem 0;
}
.dmd-readout {
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  color: #94A3B8;
  margin-top: 0.3rem;
}
.dmd-wrong-btn {
  margin-top: 0.5rem;
  border-color: #EF444444;
  color: #FCA5A5;
  background: rgba(239,68,68,.06);
}
.dmd-wrong-btn:hover { background: rgba(239,68,68,.12); }
.dmd-wrong-btn:disabled { opacity: 0.5; }

/* ============================================================
   S1 放大器五维指标雷达图
   ============================================================ */
.cmp-amp-radar { padding: 0.5rem 0; }
.radar-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
}
.radar-left { flex: 0 0 280px; }
.radar-left canvas { width: 100%; max-width: 280px; height: auto; }
.radar-right { flex: 1; min-width: 240px; }
.radar-knobs { display: flex; flex-direction: column; gap: 0.4rem; }
.radar-knob label {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: #94A3B8;
}
.radar-knob label span { color: var(--realm-color); font-family: var(--font-mono, monospace); }
.radar-knob input[type="range"] { width: 100%; }
.radar-info { margin-top: 0.6rem; display: flex; flex-direction: column; gap: 0.3rem; }
.gbw-display, .fom-display {
  font-size: 0.85rem;
  color: #94A3B8;
}
.gbw-display span, .fom-display span { color: var(--realm-color); font-weight: bold; }
.conflict-zone { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.2rem; }
.conflict-mark {
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  background: rgba(239,68,68,.12);
  color: #FCA5A5;
  border: 1px solid rgba(239,68,68,.3);
}

/* ============================================================
   S4 电流镜比例实验台
   ============================================================ */
.cmp-current-mirror-bench { padding: 0.5rem 0; }
.cmb-circuit { margin-bottom: 0.5rem; }
.cmb-svg { width: 100%; max-width: 300px; height: auto; }
.cmb-knobs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 0.5rem;
}
.cmb-knob { flex: 1; min-width: 140px; }
.cmb-knob label {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: #94A3B8;
}
.cmb-knob label span { color: var(--realm-color); font-family: var(--font-mono, monospace); }
.cmb-knob input[type="range"] { width: 100%; }
.cmb-plot { margin: 0.4rem 0; }
.cmb-plot canvas { width: 100%; max-width: 320px; height: auto; background: #1A1520; border-radius: 8px; }
.cmb-readout {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  font-size: 0.82rem;
  color: #94A3B8;
  margin-top: 0.3rem;
}
.cmb-readout b { color: var(--realm-color); }
.cmb-error-bar { display: flex; align-items: center; gap: 0.4rem; flex-basis: 100%; }
.err-bar-bg {
  flex: 1;
  height: 8px;
  background: rgba(117,135,138,.2);
  border-radius: 4px;
  overflow: hidden;
}
.err-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #22C55E, #F59E0B, #EF4444);
  transition: width 300ms ease-out;
}
.cmb-wrong-btn {
  margin-top: 0.5rem;
  border-color: #EF444444;
  color: #FCA5A5;
  background: rgba(239,68,68,.06);
}
.cmb-wrong-btn:disabled { opacity: 0.5; }

/* ============================================================
   S7 负反馈Bode图曲线追踪器
   ============================================================ */
.cmp-feedback-bode { padding: 0.5rem 0; }
.fb-bode-plot canvas { width: 100%; max-width: 400px; height: auto; background: #1A1520; border-radius: 8px; }
.fb-beta {
  margin: 0.5rem 0;
}
.fb-beta label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #94A3B8;
}
.fb-beta label span { color: var(--realm-color); font-family: var(--font-mono, monospace); font-size: 1rem; }
.fb-beta input[type="range"] { width: 100%; }
.fb-step canvas { width: 100%; max-width: 400px; height: auto; background: #1A1520; border-radius: 8px; }
.fb-pm-gauge {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0.5rem 0;
}
.pm-gauge-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid #94A3B8;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 300ms ease-out;
}
.pm-gauge-val {
  font-size: 0.78rem;
  font-weight: bold;
  color: #F1F5F9;
}
.pm-gauge-circle.safe { border-color: #22C55E; box-shadow: 0 0 8px #22C55E44; }
.pm-gauge-circle.warn { border-color: #F59E0B; box-shadow: 0 0 8px #F59E0B44; }
.pm-gauge-circle.danger { border-color: #EF4444; box-shadow: 0 0 8px #EF444444; }
.pm-gauge-circle.osc { border-color: #EF4444; box-shadow: 0 0 12px #EF444488; animation: fbOsc 0.4s ease-in-out infinite; }
@keyframes fbOsc { 0%,100% { transform: scale(1); } 50% { transform: scale(1.1); } }
.pm-label { font-size: 0.85rem; color: #94A3B8; }
.fb-osc {
  padding: 0.5rem 0.8rem;
  border-left: 3px solid #EF4444;
  background: rgba(239,68,68,.1);
  color: #FCA5A5;
  font-size: 0.85rem;
  border-radius: 0 8px 8px 0;
  margin-top: 0.3rem;
}
.entropy-shadow { color: #EF4444; font-weight: bold; }

/* ============================================================
   S8 Miller补偿公式组装器
   ============================================================ */
.cmp-miller-builder { padding: 0.5rem 0; }
.mb-tabs {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.mb-tab {
  padding: 0.35rem 0.8rem;
  border: 1px solid rgba(117,135,138,.4);
  border-radius: 6px;
  background: rgba(30,25,35,.5);
  color: #94A3B8;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 200ms ease-out;
}
.mb-tab:hover { border-color: var(--realm-color); }
.mb-tab.active {
  border-color: var(--realm-color);
  background: var(--realm-line);
  color: var(--realm-color);
}
.mb-panel { padding: 0.3rem 0; }
.mb-circuit { margin-bottom: 0.4rem; }
.mb-svg { width: 100%; max-width: 300px; height: auto; }
.mb-cc-ctrl { margin: 0.4rem 0; }
.mb-cc-ctrl label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #94A3B8;
}
.mb-cc-ctrl label span { color: var(--realm-color); font-family: var(--font-mono, monospace); }
.mb-cc-ctrl input[type="range"] { width: 100%; }
.mb-miller-eff {
  padding: 0.4rem 0.6rem;
  border-left: 3px solid #F59E0B;
  background: rgba(245,158,11,.08);
  border-radius: 0 6px 6px 0;
  margin: 0.3rem 0;
  font-size: 0.85rem;
  color: #94A3B8;
}
.mb-miller-eff b { color: var(--realm-color); }
.mb-multiplier { color: #F59E0B; font-size: 0.82rem; margin-bottom: 0.2rem; }
.mb-rz { margin: 0.3rem 0; }
.mb-pz-plot canvas { width: 100%; max-width: 200px; height: auto; background: #1A1520; border-radius: 8px; }
.mb-pm {
  margin-top: 0.4rem;
  font-size: 0.88rem;
  color: #94A3B8;
}
.mb-pm b { color: var(--realm-color); font-size: 1rem; }
.mb-bgref-info p, .mb-sw-info p {
  font-size: 0.85rem;
  color: #94A3B8;
  margin: 0.3rem 0;
}
.mb-bgref-info p b, .mb-sw-info p b { color: var(--realm-color); }
.mb-bgref-info canvas, .mb-sw-info canvas {
  width: 100%; max-width: 320px; height: auto;
  background: #1A1520; border-radius: 8px;
}
