/* ============================================================
   ch19「精微之极」章节样式
   结丹六层·精微之极（结丹期圆满章）
   境界色：雌黄 #FFC64B（结丹期）
   章末征兆：月白 #D6ECF0（元婴期 ch20 在望）
   极纹：摩尔曲线（金）+ 极限墙（银）+ 三维通道（紫金）
   ============================================================ */
:root {
  --realm-color: #FFC64B;
  --realm-glow: #FFC64B33;
  --moon-color: #D6ECF0;        /* 元婴期月白征兆 */
  --moon-glow: #D6ECF033;
  --euv-color: #B57BFF;          /* EUV 紫光 */
  --wall-color: #B8C0C4;         /* 物理极限之墙 银色 */
  --tri-color: #C49BFF;          /* 三维通道紫金 */
}

/* 开场标题 */
.op-title span,
.op-sub {
  color: var(--realm-color);
}
/* focus-breath 呼吸光晕（下一场景按钮引导） */
.focus-breath {
  box-shadow: 0 0 0 0 #FFC64B66;
  animation: ch19Breath 2s ease-in-out infinite;
}
@keyframes ch19Breath {
  0%, 100% { box-shadow: 0 0 0 0 #FFC64B66; }
  50% { box-shadow: 0 0 16px 4px #FFC64B44; }
}

/* S9 Boss 战触发按钮：雌黄描边 + 紫金光晕（结丹→元婴临界） */
#s9-start {
  border-color: var(--realm-color);
  color: var(--realm-color);
  position: relative;
}
#s9-start::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, #FFC64B22, transparent 70%);
  animation: ch19BossPulse 2.4s ease-in-out infinite;
}
@keyframes ch19BossPulse {
  0%, 100% { opacity: .4; }
  50% { opacity: 1; }
}
#s9-start:hover {
  background: var(--realm-color);
  color: #1a1a1a;
}

/* S4 能墙：殿内温度升高的红光警示（仅在该场景） */
.scene[data-scene="s5"] .scene-kicker {
  color: #D24735;
}
.scene[data-scene="s5"] .insight {
  border-left-color: #D24735;
}

/* S6 三维殿·彩色马赛克拼贴感（多色 die 拼合） */
.scene[data-scene="s6"] .scene-kicker {
  background: linear-gradient(90deg, #4FC3F7 0%, var(--realm-color) 35%, var(--euv-color) 70%, #66BB6A 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* S8 问道场·雌黄与月白交战（境界临界） */
.scene[data-scene="s8"] .scene-title {
  background: linear-gradient(90deg, var(--realm-color) 0%, var(--moon-color) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ============================================================
   极纹（S10 本命石第十九痕）
   半拱摩尔曲线（金）+ 极限墙（银）+ 三维通道（紫金）
   痕中央三字"极而通"
   ============================================================ */
.s10-scar-jiwen {
  display: inline-block;
  position: relative;
  width: 96px;
  height: 56px;
  vertical-align: middle;
  margin: 0 0.4rem;
}
.s10-scar-jiwen svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.s10-scar-jiwen .jiwen-curve {
  stroke: var(--realm-color);
  stroke-width: 2.2;
  fill: none;
  filter: drop-shadow(0 0 4px #FFC64B66);
}
.s10-scar-jiwen .jiwen-wall {
  stroke: var(--wall-color);
  stroke-width: 1.6;
  stroke-dasharray: 3 2;
  fill: rgba(184,192,196,0.08);
}
.s10-scar-jiwen .jiwen-3d {
  stroke: var(--tri-color);
  stroke-width: 2.2;
  fill: none;
  filter: drop-shadow(0 0 4px #C49BFF66);
}
.s10-scar-jiwen .jiwen-glyph {
  font-family: var(--font-serif, serif);
  font-size: 8px;
  fill: var(--realm-color);
  text-anchor: middle;
}

/* S10 月白门（境界转换征兆） */
.s10-moon-gate {
  display: block;
  margin: 1.4rem auto;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 4 / 5;
  position: relative;
  border-radius: 12px 12px 0 0;
  background:
    linear-gradient(180deg, rgba(214,236,240,0.0) 0%, rgba(214,236,240,0.18) 60%, rgba(214,236,240,0.42) 100%),
    radial-gradient(ellipse at 50% 100%, rgba(214,236,240,0.55) 0%, transparent 70%);
  border: 1px solid rgba(214,236,240,0.5);
  box-shadow: 0 0 32px rgba(214,236,240,0.22), inset 0 -20px 40px rgba(214,236,240,0.18);
  overflow: hidden;
}
.s10-moon-gate::before {
  content: '系 统';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-serif, serif);
  font-size: 1.6rem;
  letter-spacing: 0.5em;
  color: rgba(214,236,240,0.85);
  text-shadow: 0 0 12px rgba(214,236,240,0.6);
}
.s10-moon-gate::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 2px;
  height: 100%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, rgba(214,236,240,0.4));
}

/* S10 碎片归位·摩尔曲线容器（K-184~K-193） */
.s10-curve-host {
  margin: 1.2rem 0;
  padding: 1rem;
  border: 1px solid var(--glass-border, rgba(255,255,255,0.08));
  border-radius: 12px;
  background: rgba(0,0,0,0.2);
}
.frag-node:hover {
  border-color: var(--realm-color);
  color: var(--realm-color);
}
.frag-node.lit {
  border-color: var(--realm-color);
  background: rgba(255,198,75,0.12);
  color: var(--realm-color);
  box-shadow: 0 0 12px rgba(255,198,75,0.3);
}

/* 境界突破铭刻 */
.inscription {
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--realm-color);
  border-radius: 8px;
  background: rgba(255,198,75,0.1);
  color: var(--realm-color);
  font-family: var(--font-serif, serif);
  text-align: center;
  animation: ch19Inscription 1.2s var(--ease-out, ease);
}
@keyframes ch19Inscription {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* 章末 ch20 解锁链接：从雌黄渐变到月白 */
.s10-next-link {
  display: inline-block;
  padding: 0.5rem 1.4rem;
  border-radius: 8px;
  border: 1px solid;
  border-image: linear-gradient(90deg, var(--realm-color), var(--moon-color)) 1;
  background: linear-gradient(90deg, rgba(255,198,75,0.08), rgba(214,236,240,0.12));
  color: var(--moon-color);
  text-decoration: none;
  transition: all 0.3s var(--ease-out, ease);
}
.s10-next-link:hover {
  background: linear-gradient(90deg, rgba(255,198,75,0.18), rgba(214,236,240,0.22));
  box-shadow: 0 0 18px rgba(214,236,240,0.35);
}
/* ============================================================
   交互组件通用样式
   ============================================================ */

/* 顿悟框显示覆盖 [hidden] 属性 */
.insight.show {
  display: block !important;
}

/* 组件标题与副标题 */
.cmp-title {
  font-size: 1.05rem;
  font-weight: bold;
  color: var(--realm-color);
  margin: 0.5rem 0 0.3rem;
}
.cmp-sub {
  font-size: 0.85rem;
  color: #94A3B8;
  margin: 0 0 0.8rem;
  line-height: 1.5;
}
.cmp-subtitle {
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--realm-color);
  margin: 1rem 0 0.5rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255,198,75,0.15);
}

/* 滑块行 */
.cmp-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.4rem 0;
  font-size: 0.85rem;
  color: #94A3B8;
}
.cmp-row label {
  min-width: 5rem;
  font-size: 0.82rem;
}
.cmp-row input[type="range"] {
  flex: 1;
  accent-color: var(--realm-color);
  cursor: pointer;
}
.cmp-row span {
  min-width: 3.5rem;
  text-align: right;
  font-weight: bold;
  color: var(--realm-color);
  font-size: 0.85rem;
  font-family: var(--font-mono, monospace);
}

/* 数据行 */
.cmp-data-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0.6rem;
  margin: 0.2rem 0;
  border-bottom: 1px solid rgba(117,135,138,0.12);
  font-size: 0.85rem;
  color: #94A3B8;
}
.cmp-data-row b {
  color: var(--realm-color);
  font-family: var(--font-mono, monospace);
  font-size: 0.88rem;
}

/* 导师提示 */
.mentor-cue {
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  border-left: 3px solid var(--realm-color);
  background: rgba(255,198,75,0.08);
  color: #F1F5F9;
  font-size: 0.9rem;
  line-height: 1.7;
  border-radius: 0 8px 8px 0;
}

/* 弯路区 */
.wrong-path-zone {
  margin-top: 0.8rem;
}
.wrong-banner {
  padding: 0.6rem 0.8rem;
  border-left: 3px solid #EF4444;
  background: rgba(239,68,68,0.1);
  color: #FCA5A5;
  font-size: 0.85rem;
  border-radius: 0 8px 8px 0;
  margin-bottom: 0.5rem;
  line-height: 1.6;
}
.wrong-banner.danger {
  border-left-color: #D24735;
  background: rgba(210,71,53,0.12);
}

/* ============================================================
   S2 EUV光路损耗推演器
   ============================================================ */
.euv-canvas-wrap {
  margin: 0.5rem 0;
}
.euv-loss-panel {
  padding: 0.5rem 0.6rem;
  border: 1px solid rgba(157,78,221,0.2);
  border-radius: 8px;
  background: rgba(20,15,30,0.5);
  margin-bottom: 0.5rem;
}

/* SAQP面板 */
.saqp-panel {
  padding: 0.5rem 0.6rem;
  border: 1px solid rgba(255,198,75,0.15);
  border-radius: 8px;
  background: rgba(30,25,35,0.5);
  margin-bottom: 0.5rem;
}
.mult-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.mult-btn {
  padding: 0.4rem 0.7rem;
  border: 1px solid rgba(117,135,138,0.3);
  border-radius: 6px;
  background: transparent;
  color: #94A3B8;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-mono, monospace);
}
.mult-btn:hover {
  border-color: var(--realm-color);
  color: var(--realm-color);
}
.mult-btn.active {
  border-color: var(--realm-color);
  background: rgba(255,198,75,0.15);
  color: var(--realm-color);
}
.saqp-data {
  margin-top: 0.3rem;
}

/* ============================================================
   S3 FinFET三栅静电控制三旋钮实验台
   ============================================================ */
.finfet-canvas-wrap {
  margin: 0.5rem 0;
}

/* 三旋钮面板 */
.knob-panel {
  padding: 0.5rem 0.6rem;
  border: 1px solid rgba(255,198,75,0.15);
  border-radius: 8px;
  background: rgba(30,25,35,0.5);
  margin-bottom: 0.5rem;
}

/* 五指标面板 */
.metrics-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.metric {
  padding: 0.4rem 0.5rem;
  border: 1px solid rgba(117,135,138,0.2);
  border-radius: 6px;
  background: rgba(30,25,35,0.4);
  text-align: center;
  font-size: 0.82rem;
  transition: all 0.3s ease;
}
.metric .m-label {
  display: block;
  color: #94A3B8;
  font-size: 0.75rem;
  margin-bottom: 0.2rem;
}
.metric .m-val {
  display: block;
  font-weight: bold;
  font-family: var(--font-mono, monospace);
  color: #F1F5F9;
}
.metric.ok {
  border-color: rgba(34,197,94,0.4);
  background: rgba(34,197,94,0.08);
}
.metric.ok .m-val { color: #22C55E; }
.metric.warn {
  border-color: rgba(245,158,11,0.4);
  background: rgba(245,158,11,0.08);
}
.metric.warn .m-val { color: #F59E0B; }
.metric.fail {
  border-color: rgba(239,68,68,0.4);
  background: rgba(239,68,68,0.08);
}
.metric.fail .m-val { color: #EF4444; }

/* 对比按钮 */
.cmp-toggle {
  display: block;
  width: 100%;
  margin: 0.5rem 0;
  padding: 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
}

/* ============================================================
   S5 Dennard缩放时间轴游标
   ============================================================ */
.dennard-canvas-wrap {
  margin: 0.5rem 0;
}
.dennard-info-panel {
  padding: 0.5rem 0.6rem;
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 8px;
  background: rgba(20,15,30,0.5);
  margin-bottom: 0.5rem;
}

/* Rock定律面板 */
.rock-panel {
  padding: 0.5rem 0.6rem;
  border: 1px solid rgba(249,115,22,0.2);
  border-radius: 8px;
  background: rgba(30,15,10,0.4);
  margin-bottom: 0.5rem;
}
.rock-panel .cmp-subtitle {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
  color: #F97316;
}

/* V_DD弯路按钮 */
.wrong-vdd-btn {
  display: block;
  width: 100%;
  margin: 0.5rem 0;
  padding: 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 640px) {
  .metrics-panel {
    grid-template-columns: repeat(2, 1fr);
  }
  .cmp-row label {
    min-width: 3.5rem;
    font-size: 0.78rem;
  }
  .cmp-row span {
    min-width: 2.8rem;
    font-size: 0.78rem;
  }
  .mult-btn {
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
  }
}
