/*
 * 第 19 章综合实验页面共用样式（19-1～19-6）。与平台外壳（首页、全链路认知页）同一套设计变量：
 * 浅色纸面、白色圆角卡片、轻阴影、靛—紫—品红渐变点缀；仿真视窗为深靛夜色。
 * 页面不经过实验页主题转换（见 app.py _inject_lab），这里的颜色、圆角、阴影原样生效。
 * 语义色：达标/完成 = 靛蓝（并配 ✓），未达标/异常 = 玫红（并配 ✕），不只靠颜色区分。
 */
:root {
  --ink: #0F172A; --ink-2: #334155; --ink-3: #475569; --mute: #64748B;
  --line: #E2E8F0; --line-2: #EEF1F7; --rule: #C7D2FE;
  --paper: #F7F9FC; --card: #FFFFFF; --soft: #F8FAFF;
  --indigo: #6366F1; --accent: #4F46E5; --accent-d: #4338CA; --violet: #8B5CF6; --fuchsia: #D946EF;
  --ok: #4F46E5; --ok-t: #EEF2FF; --bad: #DB2777; --bad-ink: #BE185D; --bad-t: #FDF2F8;
  --gold: #D19A1A;
  --night: #0B1026; --night-2: #121836; --night-3: #1B2350; --night-line: #2A3466; --night-text: #C7D2FE; --night-mute: #A5B4FC;
  --grad: linear-gradient(135deg, #6366F1 0%, #8B5CF6 48%, #D946EF 100%);
  --grad-text: linear-gradient(100deg, #6366F1, #8B5CF6 55%, #D946EF);
  --r-s: 8px; --r-m: 12px; --r-l: 16px;
  --shadow: 0 4px 16px -10px rgba(15, 23, 42, .14);
  --shadow-h: 0 10px 28px -14px rgba(79, 70, 229, .35);
  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-num: "Space Grotesk", "Archivo", var(--font);
  --font-mono: "JetBrains Mono", "Space Grotesk", monospace;
}
* { box-sizing: border-box; }
html body.s19 { margin: 0; padding: 0; background: var(--paper); color: var(--ink-2); font-family: var(--font); font-size: 15px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
body.s19 ::selection { background: rgba(139, 92, 246, .22); }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 16px 28px; }
body.s19 :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- 页头 ---------- */
.hd { padding-top: 14px; }
.hd .wrap { position: relative; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 18px 22px 16px;
  background: radial-gradient(760px 220px at 92% 130%, rgba(217, 70, 239, .10), transparent 62%), radial-gradient(620px 220px at -4% -40%, rgba(99, 102, 241, .12), transparent 62%), var(--card);
  border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow); overflow: hidden; }
.hd .wrap::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--grad); }
.hd .code { font-family: var(--font-mono); font-weight: 600; font-size: 12.5px; letter-spacing: .12em; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hd h1 { margin: 2px 0 0; font-size: 24px; font-weight: 900; letter-spacing: .01em; color: var(--ink); }
.hd .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.hd .tags span { font-size: 12.5px; padding: 2px 10px; border-radius: 999px; background: var(--ok-t); color: var(--accent-d); font-weight: 600; }
.hd .tags span.p { background: #FAE8FF; color: #A21CAF; }
.mode { font-size: 13.5px; padding: 8px 14px; border-radius: var(--r-m); background: var(--soft); border: 1px solid var(--line); color: var(--ink-3); max-width: 540px; line-height: 1.55; }
.mode b { color: #A21CAF; }
.mode.rec { background: var(--ok-t); border-color: var(--rule); }
.mode.rec b { color: var(--accent); }
.mode i.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--fuchsia); margin-right: 6px; vertical-align: 1px; }
.mode.rec i.dot { background: var(--accent); box-shadow: 0 0 0 0 rgba(79, 70, 229, .5); animation: c19pulse 1.6s infinite; }
@keyframes c19pulse { 0% { box-shadow: 0 0 0 0 rgba(79, 70, 229, .5); } 70% { box-shadow: 0 0 0 7px rgba(79, 70, 229, 0); } 100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); } }
.pc-only { display: none; }

/* ---------- 16 步时间线 ---------- */
.tl { display: grid; grid-template-columns: minmax(64px, 1.1fr) minmax(64px, 1fr) 5fr minmax(80px, 1.1fr) 3fr 3fr 2fr minmax(64px, 1fr) minmax(72px, 1.2fr); gap: 8px; margin: 16px 0 6px; padding: 12px 14px 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow); }
.tl .ph { min-width: 0; }
.tl .ph > small { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--mute); letter-spacing: .03em; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.tl .ph > small::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.tl .ph.on > small { color: var(--accent); }
.tl .ph.on > small::before { background: var(--grad); }
.tl .ph.ok > small { color: var(--ink-3); }
.tl .ph.ok > small::before { background: var(--accent); }
.tl .bs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
html body.s19 #stepper button { position: relative; font: inherit; border: 1px solid var(--line); background: var(--soft); color: var(--ink-3); padding: 5px 0 4px; cursor: pointer; font-family: var(--font-num); font-weight: 700; font-size: 15px; line-height: 1.15; min-width: 0; border-radius: 10px; transition: background .18s, border-color .18s, box-shadow .18s, transform .18s; }
html body.s19 #stepper button:hover { border-color: var(--rule); box-shadow: var(--shadow-h); transform: translateY(-1px); }
html body.s19 #stepper button small { display: block; font-family: var(--font); font-size: 11.5px; font-weight: 600; margin-top: 1px; color: var(--mute); }
html body.s19 #stepper button.done { background: var(--ok-t); border-color: var(--rule); color: var(--accent); }
html body.s19 #stepper button.done small { color: var(--accent); }
html body.s19 #stepper button.cur { background: var(--grad); border-color: transparent; color: #FFFFFF; box-shadow: 0 8px 18px -10px rgba(139, 92, 246, .8); }
html body.s19 #stepper button.cur small { color: #FFFFFF; }
/* 第 11 步“受控失败”是特殊节点：与其他步骤对齐，只用琥珀色区分（客户 11-04） */
.tl .ph.df > small { color: #B45309; }
.tl .ph.df > small::before { background: #F59E0B; }
html body.s19 #stepper .ph.df button { background: #FFFBEB; border-color: #FCD34D; color: #B45309; }
html body.s19 #stepper .ph.df button small { color: #B45309; }
html body.s19 #stepper .ph.df button.done { background: #FEF3C7; border-color: #F59E0B; color: #92400E; }
html body.s19 #stepper .ph.df button.cur { background: linear-gradient(135deg, #F59E0B, #EA580C); border-color: transparent; color: #FFFFFF; box-shadow: 0 8px 18px -10px rgba(234, 88, 12, .8); }
html body.s19 #stepper .ph.df button.cur small { color: #FFFFFF; }
html body.s19 #stepper button.view { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink); }
.stepname { font-size: 14.5px; color: var(--mute); margin: 8px 2px 14px; min-height: 22px; }
.stepname b { color: var(--ink); }
.stepname .ok { display: inline-block; padding: 0 10px; border-radius: 999px; background: var(--ok-t); font-size: 13px; }

/* ---------- 主区：仿真视窗 + 操作面板 ---------- */
.main { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
.vp-card { background: var(--night); color: #FFFFFF; border-radius: var(--r-l); overflow: hidden; box-shadow: 0 16px 36px -22px rgba(15, 23, 42, .6); border: 1px solid var(--night-3); }
.vp { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--night); }
.vp canvas { display: block; width: 100%; height: 100%; }
.hud { position: absolute; inset: 0; pointer-events: none; }
.hud .tl0 { position: absolute; left: 14px; top: 12px; font-size: 12.5px; color: var(--night-mute); letter-spacing: .06em; font-family: var(--font-mono); }
.hud .tl0 b { color: #FFFFFF; font-weight: 700; letter-spacing: 0; font-family: var(--font); }
.hud .tr0 { position: absolute; right: 14px; top: 10px; font-size: 12px; color: var(--night-mute); text-align: right; }
.hud .badge { display: inline-block; padding: 1px 10px; border-radius: 999px; background: rgba(139, 92, 246, .22); border: 1px solid rgba(196, 181, 253, .45); color: #EDE9FE; margin-left: 6px; }
.hud .side { position: absolute; top: 42px; font-size: 13px; font-weight: 700; padding: 3px 12px; border-radius: 999px; background: rgba(11, 16, 38, .78); display: none; }
.hud .side.l { left: 14px; color: #F9A8D4; border: 1px solid rgba(244, 114, 182, .6); }
.hud .side.r { right: 14px; color: var(--night-text); border: 1px solid rgba(165, 180, 252, .6); }
.hud.cmp .side { display: block; }
.bars { position: absolute; left: 0; right: 0; height: 0; background: var(--night); transition: height .4s; }
.bars.t { top: 0; } .bars.b { bottom: 0; }
.vp.cine .bars { height: 9%; }
.cap { position: absolute; left: 0; right: 0; bottom: 11%; text-align: center; opacity: 0; transition: opacity .4s; }
.vp.cine .cap { opacity: 1; }
.cap span { display: inline-block; background: rgba(11, 16, 38, .8); padding: 4px 16px; border-radius: 999px; font-size: 15px; color: #FFFFFF; }
.cap span b { color: #F0ABFC; margin-right: 8px; font-family: var(--font-num); }
.vp .fail { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; text-align: center; padding: 20px; color: var(--night-text); }
.kpi { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 10px; background: var(--night-2); border-top: 1px solid var(--night-3); }
.kpi > div { padding: 8px 12px 9px; min-width: 0; border-radius: var(--r-m); background: rgba(99, 102, 241, .10); border: 1px solid rgba(99, 102, 241, .28); }
.kpi > div.bad { background: rgba(219, 39, 119, .12); border-color: rgba(244, 114, 182, .42); }
.kpi .k { font-size: 13px; color: var(--night-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .v { font-family: var(--font-num); font-size: 26px; font-weight: 700; line-height: 1.15; color: #FFFFFF; }
.kpi .t { font-size: 12.5px; color: var(--night-mute); }
.kpi .bad .v { color: #F9A8D4; }
.kpi .bad .k::before { content: "✕ "; color: #F472B6; font-weight: 700; }
.kpi .good .k::before { content: "✓ "; color: #A5B4FC; font-weight: 700; }
.vtools { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 12px 12px; background: var(--night-2); border-top: 1px solid var(--night-3); align-items: center; }
.vtools button { font: inherit; font-size: 13.5px; font-weight: 600; background: rgba(255, 255, 255, .04); color: #E0E7FF; border: 1px solid var(--night-line); padding: 5px 14px; cursor: pointer; border-radius: 999px; transition: background .18s, border-color .18s; }
.vtools button:hover { border-color: var(--night-mute); background: rgba(255, 255, 255, .08); }
.vtools button.on { background: var(--grad); border-color: transparent; color: #FFFFFF; }
.vtools button:disabled { opacity: .38; cursor: not-allowed; }
.vtools .sp { flex: 1; }
.vtools .note { font-size: 12.5px; color: var(--night-mute); }
.live { font-size: 13px; color: var(--ink-3); min-height: 20px; margin: 8px 4px 0; overflow-wrap: anywhere; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow); padding: 14px 16px 16px; }
.card + .card { margin-top: 14px; }
.card.pk { border-color: var(--rule); box-shadow: 0 12px 30px -20px rgba(79, 70, 229, .55); position: relative; overflow: hidden; }
.card.pk::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--grad); }
.card h3 { font-size: 16.5px; margin: 0 0 10px; color: var(--ink); display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-weight: 800; }
.card h3 small { font-weight: 600; font-size: 12.5px; color: var(--mute); }
.card.pk h3 small { padding: 1px 10px; border-radius: 999px; background: var(--ok-t); color: var(--accent); }
.lead { font-size: 14px; color: var(--ink-3); margin: 0 0 10px; }

/* 参数 */
.pg { padding: 8px 0 4px; border-top: 1px dashed var(--line); }
.pg:first-of-type { border-top: 0; }
.pg.on { background: var(--soft); margin: 2px -10px; padding: 8px 10px 4px; border: 1px solid var(--rule); border-radius: var(--r-m); }
.pg > b { font-size: 12.5px; color: var(--mute); letter-spacing: .05em; }
.pg.on > b { color: var(--accent); }
.ctl { margin: 2px 0 8px; }
.ctl label { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--ink-2); }
.ctl label .v { font-family: var(--font-num); font-weight: 700; color: var(--accent); }
.ctl label .v.ch { color: #A21CAF; }
.ctl label .v small { color: var(--mute); font-weight: 400; margin-left: 4px; font-family: var(--font); }
body.s19 input[type=range] { width: 100%; accent-color: var(--accent); margin: 4px 0 0; }
select, textarea { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid #CBD5E1; background: #FFFFFF; color: var(--ink); border-radius: 10px; }
select:focus, textarea:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(99, 102, 241, .18); }
textarea { min-height: 96px; resize: vertical; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: var(--grad); color: #FFFFFF; font: inherit; font-weight: 700; padding: 9px 18px; cursor: pointer; border-radius: 12px; box-shadow: 0 10px 22px -14px rgba(139, 92, 246, .9); transition: transform .18s, box-shadow .18s, filter .18s; }
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 14px 26px -14px rgba(139, 92, 246, .95); }
.btn.pink { background: linear-gradient(135deg, #8B5CF6 0%, #D946EF 60%, #EC4899 100%); }
.btn.sec { background: #FFFFFF; color: var(--accent); border: 1px solid var(--rule); box-shadow: none; }
.btn.sec:hover:not(:disabled) { background: var(--ok-t); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opts.one { grid-template-columns: 1fr; }
.opts label { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--line); padding: 7px 10px; cursor: pointer; font-size: 14px; background: #FFFFFF; border-radius: 10px; transition: border-color .15s, background .15s; }
.opts label:hover { border-color: var(--rule); background: var(--soft); }
.opts label:has(input:checked) { border-color: var(--indigo); background: var(--ok-t); }
.opts label small { display: block; color: var(--mute); font-size: 12.5px; }
.opts input { margin-top: 5px; accent-color: var(--accent); }
.msg { margin-top: 12px; font-size: 14px; padding: 9px 12px; background: var(--ok-t); border: 1px solid var(--rule); border-radius: var(--r-m); color: var(--ink-2); }
.msg.warn { border-color: #FBCFE8; background: var(--bad-t); }
.msg.warn::before { content: "! "; color: var(--bad-ink); font-weight: 800; }
.msg.busy { background: var(--soft); border-color: var(--line); color: var(--ink-3); }
.msg.busy::before { content: ""; display: inline-block; width: 13px; height: 13px; margin-right: 8px; vertical-align: -2px; border-radius: 50%; border: 2px solid var(--rule); border-top-color: var(--accent); animation: c19spin .8s linear infinite; }
@keyframes c19spin { to { transform: rotate(360deg); } }
.ai { margin-top: 12px; border: 1px solid var(--rule); background: linear-gradient(180deg, #F5F3FF, #FFFFFF 70%); padding: 10px 12px; font-size: 14px; border-radius: var(--r-m); }
.ai .tag { float: right; font-size: 11.5px; color: #FFFFFF; background: var(--grad); padding: 1px 9px; border-radius: 999px; margin-left: 8px; }
.ai b { color: var(--ink); }
.ok { color: var(--accent); font-weight: 700; } .bad { color: var(--bad-ink); font-weight: 700; }

/* ---------- 分析区 ---------- */
.card.ana { margin-top: 14px; }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--soft); border: 1px solid var(--line-2); border-radius: 12px; flex-wrap: wrap; }
.tabs button { font: inherit; font-size: 14px; font-weight: 600; border: 0; background: transparent; color: var(--ink-3); padding: 6px 14px; cursor: pointer; border-radius: 9px; transition: background .15s, color .15s; }
.tabs button:hover { background: #FFFFFF; color: var(--accent); }
.tabs button.on { background: #FFFFFF; color: var(--accent); box-shadow: 0 2px 8px -4px rgba(79, 70, 229, .45); }
.pane { display: none; padding-top: 12px; }
.pane.on { display: block; animation: c19fade .25s ease; }
@keyframes c19fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.chart { width: 100%; height: 330px; }
.cond { font-size: 13.5px; color: var(--ink-3); margin-top: 6px; }
.grov { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: center; }
.grov canvas { width: 100%; height: auto; display: block; background: var(--night); border-radius: var(--r-m); }
.mcbox { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.mcbox canvas { width: 100%; height: auto; display: block; background: var(--night); image-rendering: pixelated; border-radius: var(--r-m); }
#heat { width: 100%; height: auto; display: block; cursor: crosshair; background: var(--night); border-radius: var(--r-m); }
.heat-tip { position: fixed; z-index: 50; pointer-events: none; padding: 3px 10px; border-radius: 8px; background: var(--ink); color: #FFFFFF; font-size: 12.5px; display: none; }
.hlg { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-3); margin-top: 8px; gap: 8px; flex-wrap: wrap; }
.hlg i { display: inline-block; width: 12px; height: 12px; vertical-align: -1px; margin-right: 4px; border-radius: 3px; }
.hlg i.k-bad { background: var(--bad); } .hlg i.k-ok { background: var(--indigo); }
.runs { max-height: 320px; overflow: auto; font-size: 13.5px; }
.runs label { display: grid; grid-template-columns: auto auto 1fr; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--line-2); align-items: start; border-radius: 8px; }
.runs label:hover { background: var(--soft); }
.runs label .sid { font-family: var(--font-num); font-weight: 700; color: var(--ink); }
.runs label.pass .sid { color: var(--accent); }
.runs label.pass .sid::after { content: " ✓"; }
.runs label.fail .sid { color: var(--bad-ink); }
.runs label.fail .sid::after { content: " ✕"; }
.runs label.inv { opacity: .55; }
.note { font-size: 13.5px; color: var(--mute); }
.msg .dl { margin-top: 6px; font-size: 13.5px; color: var(--ink-3); }
.msg .dl a { color: var(--accent); font-weight: 700; margin-right: 8px; word-break: break-all; }
.foot { margin-top: 18px; font-size: 13px; color: var(--mute); border-top: 1px solid var(--line); padding-top: 10px; }

@media (prefers-reduced-motion: reduce) {
  body.s19 *, body.s19 *::before, body.s19 *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 1100px) { .kpi .v { font-size: 22px; } .vtools .note { display: none; } .opts { grid-template-columns: 1fr; } }
@media (max-width: 880px) {
  .main { display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
  .main > div { display: contents; }
  .main .card + .card { margin-top: 0; }
  .vp-card { order: 1; } .live { order: 2; margin-top: -8px; } #panel { order: 3; } #params { order: 4; } .card.ana { order: 5; margin-top: 0; } .c-heat { order: 6; } .c-runs { order: 7; }
  #heat { max-width: 460px; margin: 0 auto; }
}
@media (max-width: 760px) {
  .tl { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; padding: 10px; }
  .tl .ph.pre { grid-column: span 2; }
  .tl .ph, .tl .bs { display: contents; }
  .tl .ph > small { display: none; }
  .kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vp { aspect-ratio: 4 / 3; }
  .grov, .mcbox { grid-template-columns: 1fr; }
  .opts { grid-template-columns: 1fr; }
  .hd h1 { font-size: 20px; }
}
@media (max-width: 640px) {
  .pc-only { display: block; margin: 10px 0 0; padding: 9px 12px; border-radius: var(--r-m); background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; font-size: 13.5px; }
}
.wrap.pcw { padding-bottom: 0; }
@media (max-width: 520px) { .hud .tl0 { display: none; } .chart { height: 300px; } }

/* =====================================================================
 * 第 19 章情境化界面（2026-11-04 重做）：页头三行信息、课前占位、制作账本、本步界面、角色、选择片、赛跑
 * ===================================================================== */
.hd h1 small { display: block; font-size: 14px; font-weight: 600; color: var(--mute); margin-top: 2px; letter-spacing: 0; }
.meta3 { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 0; }
.meta3 div { display: flex; gap: 6px; align-items: baseline; font-size: 13.5px; }
.meta3 dt { color: var(--mute); font-weight: 600; } .meta3 dd { margin: 0; color: var(--ink); font-weight: 700; }
.hd-r { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; max-width: 540px; }
.qnote { font-size: 12.5px; color: #92400E; background: #FFFBEB; border: 1px solid #FDE68A; border-radius: 999px; padding: 3px 12px; font-weight: 600; }

/* 课前 1–4 步：虚线占位与提示 */
.tl .ph.pre { position: relative; }
html body.s19 #stepper button.pre { border-style: dashed; border-color: #A5B4FC; background: #FFFFFF; color: var(--accent); }
html body.s19 #stepper button.pre small { color: var(--mute); }
.pre-tip { position: absolute; z-index: 30; top: calc(100% + 8px); left: 0; width: 280px; padding: 10px 12px; border-radius: 12px; background: var(--ink); color: #E0E7FF; font-size: 13px; line-height: 1.6;
  box-shadow: 0 14px 30px -14px rgba(15, 23, 42, .6); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .18s, transform .18s, visibility .18s; }
.pre-tip b { display: block; color: #FFFFFF; margin-bottom: 2px; }
.pre-tip::before { content: ""; position: absolute; top: -6px; left: 22px; border: 6px solid transparent; border-top: 0; border-bottom-color: var(--ink); }
.tl .ph.pre:hover .pre-tip, .tl .ph.pre:focus-within .pre-tip { opacity: 1; visibility: visible; transform: none; }
.tl .ph.post .pre-tip { left: auto; right: 0; }
.tl .ph.post .pre-tip::before { left: auto; right: 22px; }

/* 制作账本 */
.ledger { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 14px 0 0; }
.ledger .lg { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 9px 13px 10px; box-shadow: var(--shadow); min-width: 0; position: relative; overflow: hidden; }
.ledger .lg::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--grad); opacity: .7; }
.ledger .lg small { display: block; font-size: 12.5px; color: var(--mute); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ledger .lg b { display: block; font-size: 22px; color: var(--ink); line-height: 1.25; white-space: nowrap; }
.ledger .lg span { font-size: 12.5px; color: var(--mute); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ledger .lg.bad { border-color: #FBCFE8; background: var(--bad-t); }
.ledger .lg.bad::before { background: var(--bad); opacity: 1; }
.ledger .lg.bad b { color: var(--bad-ink); }

/* 本步界面 */
.scr-card { padding: 18px 20px 18px; }
.scr-hd { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.scr-no { font-family: var(--font-num); font-weight: 700; font-size: 13px; color: #FFFFFF; background: var(--grad); padding: 2px 10px; border-radius: 999px; }
.scr-role { font-size: 13px; color: var(--mute); font-weight: 600; flex: 1; }
.sb { font-size: 12.5px; padding: 2px 10px; border-radius: 999px; font-weight: 700; }
.sb.ok { background: var(--ok-t); color: var(--accent); } .sb.cur { background: #FAE8FF; color: #A21CAF; } .sb.wait { background: #F1F5F9; color: var(--mute); } .sb.demo { background: #FFFBEB; color: #92400E; }
.scr h2 { font-size: 22px; margin: 6px 0 4px; color: var(--ink); font-weight: 900; letter-spacing: .01em; }
.scr-goal { margin: 0 0 12px; color: var(--ink-3); font-size: 14.5px; }
.scr-body { animation: c19fade .3s ease; }
.scr-act { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.scr-act .btn { padding: 10px 20px; }
.btn.pri { background: var(--grad); }
.btn.ghost { background: transparent; color: var(--mute); border: 1px dashed var(--line); box-shadow: none; }
.scr-step { margin-top: 10px; font-size: 12px; color: #94A3B8; }
.principle { margin-top: 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--soft); }
.principle summary { cursor: pointer; padding: 8px 12px; font-weight: 700; color: var(--accent); font-size: 13.5px; list-style: none; }
.principle summary::before { content: "◇ "; }
.principle[open] summary::before { content: "◆ "; }
.principle > div { padding: 0 14px 12px; font-size: 13.5px; color: var(--ink-3); }
.lab2, .lab { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink-2); margin: 14px 0 6px; }
.hint { margin-top: 10px; font-size: 13px; color: var(--mute); } .hint b { color: var(--accent); }
.note { font-size: 13.5px; color: var(--mute); }
.okk { color: var(--accent); font-weight: 800; } .dn { color: var(--bad-ink); font-weight: 800; } .up { color: var(--accent); }

/* 选择片 */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { font: inherit; font-size: 14px; font-weight: 600; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: #FFFFFF; color: var(--ink-2); cursor: pointer; transition: all .15s; display: inline-flex; flex-direction: column; align-items: center; line-height: 1.3; }
.chips button small { font-size: 11.5px; color: var(--mute); font-weight: 500; }
.chips button:hover { border-color: var(--rule); background: var(--soft); }
.chips button.on { background: var(--grad); color: #FFFFFF; border-color: transparent; box-shadow: 0 8px 18px -10px rgba(139, 92, 246, .9); }
.chips button.on small { color: #EDE9FE; }
.chips.bet button.on { background: linear-gradient(135deg, #F59E0B, #EC4899); }

/* 三位角色 */
.crew { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.cm { display: flex; gap: 10px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; box-shadow: var(--shadow); min-width: 0; }
.cm > i { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 900; color: #FFFFFF; font-size: 15px; }
.cm.c-dir > i { background: linear-gradient(135deg, #6366F1, #8B5CF6); } .cm.c-prod > i { background: linear-gradient(135deg, #F59E0B, #EF4444); } .cm.c-cul > i { background: linear-gradient(135deg, #CA8A04, #B45309); }
.cm b { display: block; font-size: 13.5px; color: var(--ink); } .cm b small { font-weight: 500; color: var(--mute); margin-left: 6px; }
.cm p { margin: 2px 0 0; font-size: 13.5px; color: var(--ink-3); line-height: 1.55; }
.cm p.typing::after { content: "▍"; color: var(--indigo); animation: c19blink .7s steps(2) infinite; }
@keyframes c19blink { 50% { opacity: 0; } }

/* 技术视图（折叠） */
.tech { margin-top: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow); }
.tech > summary { cursor: pointer; padding: 14px 18px; list-style: none; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.tech > summary b { font-size: 16px; color: var(--ink); } .tech > summary b::before { content: "▸ "; color: var(--indigo); }
.tech[open] > summary b::before { content: "▾ "; }
.tech > summary span { font-size: 13px; color: var(--mute); }
.tech-in { padding: 0 16px 16px; }
.tech-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 14px; margin-top: 12px; align-items: start; }
.tech-grid .card + .card { margin-top: 14px; }
.kpi.light { background: var(--soft); border: 1px solid var(--line-2); border-radius: 14px; }
.kpi.light > div { background: #FFFFFF; border-color: var(--line); }
.kpi.light .k { color: var(--ink-3); } .kpi.light .v { color: var(--ink); } .kpi.light .t { color: var(--mute); }
.kpi.light .bad .v { color: var(--bad-ink); } .kpi.light > div.bad { background: var(--bad-t); border-color: #FBCFE8; }
@media (max-width: 1100px) { .ledger { grid-template-columns: repeat(3, minmax(0, 1fr)); } .tech-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .crew { grid-template-columns: 1fr; } .ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hd-r { align-items: flex-start; } }
