/* 文本与剧情（Yuki 09-27 台词本；Shiori 09-30 分成剧情线 / 短文本） */
:root {
  --bg: #f5f3ee;
  --paper: #fffefa;
  --line: #e0dbd0;
  --line-strong: #cbc4b6;
  --ink: #2f2d29;
  --muted: #7d786e;
  --accent: #8d6444;
  --fuko: #3f76a3;
  --fuko-soft: #e7f0f7;
  --storm: #b8527a;
  --storm-soft: #f8e9ef;
  --other: #6f6a60;
  --other-soft: #efece6;
  --edit: #f3e2b8;
  --edit-line: #d9a93c;
  --error: #c0392b;
  --error-soft: #fbe9e6;
  --warn: #a8720d;
  --warn-soft: #fbf1dc;
  /* 委托泳道的颜色 */
  --c0: #6f8a4e; --c0-soft: #eef3e6;
  --c1: #b9772f; --c1-soft: #f8eedf;
  --c2: #4f79a3; --c2-soft: #e6eef6;
  --c3: #8664a8; --c3-soft: #f0eaf6;
  --c4: #3f8a80; --c4-soft: #e3f1ef;
  --c5: #a8574f; --c5-soft: #f6e6e3;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-size: 15px; background: var(--bg); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--paper); border-radius: 8px; padding: 8px 14px; }
button:hover { background: #efebe2; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.primary:hover { background: #7a5538; }
.primary:disabled { background: #bfae9f; border-color: #bfae9f; cursor: not-allowed; }
.ghost { background: transparent; }
.muted { color: var(--muted); }

/* 左侧分类 */
.side { position: fixed; inset: 0 auto 0 0; width: 200px; background: #ebe8e0; border-right: 1px solid var(--line); padding: 32px 18px; display: flex; flex-direction: column; }
.brand { text-decoration: none; color: var(--ink); font-size: 28px; font-weight: 600; letter-spacing: 5px; }
.brand span { display: block; font-size: 9px; letter-spacing: 1.5px; margin-top: 8px; color: #777166; }
.side nav { display: grid; gap: 2px; margin-top: 30px; }
.side nav a { text-decoration: none; color: var(--ink); padding: 10px 12px; border-radius: 7px; font-size: 14px; }
.side nav a:hover { background: #f4f1ea; }
.side nav a.active { background: var(--paper); color: var(--accent); font-weight: 600; }
.side-note { margin-top: auto; font-size: 12px; color: var(--muted); line-height: 1.7; }

main { margin-left: 200px; padding: 28px 36px 140px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.top-left { display: flex; align-items: center; gap: 22px; }
h1 { font-size: 28px; margin: 0; letter-spacing: 2px; }
.top-right { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
#sync { font-size: 12px; color: var(--muted); }

/* 剧情线 / 短文本 切换 */
.seg { display: inline-flex; background: #e6e2d9; border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 7px 20px; border-radius: 8px; font-size: 14px; color: var(--muted); }
.seg button:hover { background: #efebe3; }
.seg button.on { background: var(--paper); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px #0000001a; }

.search { display: flex; align-items: center; gap: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; flex: 1 1 260px; max-width: 420px; }
.search input { border: 0; background: none; outline: none; padding: 9px 0; width: 100%; }
.search span { color: var(--muted); font-size: 20px; }
.search.small { flex: 0 1 280px; margin-left: auto; }
.search.small input { padding: 7px 0; font-size: 13px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pills button, .subs button { border-radius: 999px; padding: 6px 13px; font-size: 13px; }
.pills button.on, .subs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pills button small, .subs button small { opacity: .6; margin-left: 5px; }
.check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.banner { background: var(--warn-soft); color: var(--warn); padding: 10px 14px; border-radius: 8px; margin-top: 14px; font-size: 13px; }
.empty { padding: 60px 0; text-align: center; color: var(--muted); }

/* ================================================================ 短文本 */
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 20px 0 10px; }
.rules { font-size: 12px; color: var(--muted); margin: 0 0 18px; }
.rules-note { margin-left: 14px; color: #a39d92; }

.layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 26px; align-items: start; }
.index { position: sticky; top: 16px; max-height: calc(100vh - 170px); overflow: auto; font-size: 13px; padding-right: 4px; }
.index h4 { font-size: 12px; color: var(--muted); margin: 16px 0 6px; font-weight: 600; letter-spacing: 1px; }
.index h4:first-child { margin-top: 0; }
.index a { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 6px; text-decoration: none; color: var(--ink); }
.index a:hover { background: #ebe7de; }
.index h5 { font-size: 11px; color: #a39d92; margin: 8px 0 1px 8px; font-weight: 400; }
.index a.sub { padding-left: 18px; }
.index a .n { margin-left: auto; color: var(--muted); font-size: 11px; white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot.edit { background: var(--edit-line); }
.dot.error { background: var(--error); }
.dot.none { background: transparent; }

.group { margin-bottom: 34px; }
.group > h2 { font-size: 20px; margin: 0 0 4px; }
.group > .hint { margin: 0 0 14px; color: var(--muted); font-size: 13px; }

.entry { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px 12px; margin-bottom: 12px; scroll-margin-top: 16px; }
.entry.readonly { background: #f8f6f1; }
.entry-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.entry-head h3 { font-size: 16px; margin: 0; }
.chip { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--other-soft); color: var(--other); }
.chip.lock { background: #eee; color: #888; }
.when { margin: 4px 0 10px; font-size: 12.5px; color: var(--muted); line-height: 1.6; }

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.col-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.col-head .who { padding: 2px 10px; border-radius: 999px; }
.col-head small { color: var(--muted); font-weight: 400; }
.who.fuko { background: var(--fuko-soft); color: var(--fuko); }
.who.storm { background: var(--storm-soft); color: var(--storm); }
.who.other { background: var(--other-soft); color: var(--other); }

.line { position: relative; margin-bottom: 6px; }
.line textarea {
  display: block; width: 100%; resize: none; overflow: hidden;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  padding: 8px 64px 8px 11px; line-height: 1.6; font-size: 15px; min-height: 40px;
}
.line textarea:hover { border-color: var(--line-strong); }
.line.changed textarea { background: #fffaf0; border-color: var(--edit-line); box-shadow: inset 3px 0 0 var(--edit-line); }
.line.added textarea { background: #f4fbf3; border-color: #7fb37a; box-shadow: inset 3px 0 0 #7fb37a; }
.line.has-error textarea { border-color: var(--error); box-shadow: inset 3px 0 0 var(--error); }
.line.deleted { opacity: .55; }
.line.deleted textarea { text-decoration: line-through; background: #f3f1ec; }
.line .meta { position: absolute; right: 8px; top: 20px; transform: translateY(-50%); display: flex; gap: 2px; align-items: center; font-size: 11px; color: var(--muted); }
.line .meta .len { margin-right: 2px; }
.line .meta .len.over { color: var(--warn); font-weight: 600; }
.line .meta button { border: 0; background: none; padding: 0 4px; font-size: 16px; line-height: 1; color: #a39d92; }
.line .meta button:hover { color: var(--error); background: none; }
.line .meta .restore:hover, .line .meta .ins:hover { color: var(--accent); }
.line.readonly-line p { margin: 0; padding: 8px 11px; border: 1px dashed var(--line); border-radius: 8px; line-height: 1.6; }
.msgs { margin: 3px 0 0; padding: 0; list-style: none; font-size: 12px; }
.msgs li { padding: 3px 8px; border-radius: 5px; margin-top: 2px; }
.msgs .error { background: var(--error-soft); color: var(--error); }
.msgs .warn { background: var(--warn-soft); color: var(--warn); }
.add { border: 1px dashed var(--line-strong); background: transparent; color: var(--muted); font-size: 13px; padding: 5px 12px; margin-top: 2px; }
.add:hover { color: var(--accent); border-color: var(--accent); background: transparent; }
.add.danger:hover { color: var(--error); border-color: var(--error); }

.script-row { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; align-items: start; margin-bottom: 6px; }
.script-row .who { font-size: 13px; font-weight: 600; padding: 9px 0 0; text-align: right; background: none; }
.script-row .who.fuko { color: var(--fuko); }
.script-row .who.storm { color: var(--storm); }
.script-row .who.other { color: var(--other); }
.script-row .who small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.var-note { font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.var-note code { background: var(--other-soft); padding: 1px 5px; border-radius: 4px; }
.issue-note { font-size: 12px; color: var(--warn); margin: 0 0 8px; }

/* ================================================================ 剧情线 */
.story-bar { display: flex; align-items: center; gap: 14px; margin: 20px 0 20px; flex-wrap: wrap; }
.subs { display: flex; gap: 6px; flex-wrap: wrap; }
.chap-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 24px; margin-bottom: 16px; flex-wrap: wrap; }
.chap-head h2 { margin: 0 0 3px; font-size: 20px; letter-spacing: 1px; }
.chap-head p { margin: 0; font-size: 13px; line-height: 1.7; max-width: 780px; }
/* 图例 */
.legend { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin: -4px 0 10px; }
.legend span { display: inline-flex; align-items: center; }
.legend i { display: inline-block; margin-right: 6px; flex: none; }
.lg-line { width: 22px; height: 4px; border-radius: 2px; background: #3a3631; }
.lg-line.k0 { background: #3f8a80; } .lg-line.k1 { background: #c0782f; } .lg-line.k2 { background: #8664a8; }
.lg-line.k3 { background: #4f79a3; } .lg-line.k4 { background: #a8574f; } .lg-line.k5 { background: #6f8a4e; }
.lg-dot { width: 11px; height: 11px; }
.lg-dot.sc { border-radius: 50%; border: 3px solid #3a3631; background: #fff; }
.lg-dot.ev { background: #26302b; transform: rotate(45deg) scale(.85); }
.lg-dot.ct { border-radius: 3px; border: 2px solid #3f8a80; background: #fff; }
.lg-fork { width: 18px; height: 12px; border: 2px solid #3a3631; border-bottom: 0; border-radius: 8px 8px 0 0; }
.lg-dash { width: 22px; height: 0; border-top: 2px dashed #c0782f; }
.lg-ch { color: var(--accent); margin-right: 6px; }

/* 第一章：地铁线路图 */
.metro-wrap { overflow-x: auto; padding-bottom: 10px; }
.metro { position: relative; }
.metro-svg { position: absolute; left: 0; top: 0; }
.metro-svg .band { fill: transparent; }
.metro-svg .band.odd { fill: #efebe3; fill-opacity: .55; }
.metro-svg .band-line { stroke: #d8d2c6; stroke-width: 1; }
.metro-svg .day { font-size: 15px; font-weight: 700; fill: var(--ink); letter-spacing: 1px; }
.metro-svg .phase { font-size: 12px; fill: var(--muted); text-anchor: end; }
.metro-svg .ln { fill: none; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.metro-svg .ln.dash { stroke-width: 2; stroke-dasharray: 5 4; }
.metro-svg .ln.cap { stroke-width: 3; }
.metro-svg .halo { fill: none; stroke: var(--bg); stroke-width: 12; }
.metro-svg .note { font-size: 11px; fill: var(--muted); }
.metro-svg .note.end { text-anchor: end; }

/* 站：点 + 站名；站名点了打开剧本 */
.st { position: absolute; width: 16px; height: 24px; padding: 0; border: 0; background: none; border-radius: 0; --lc: #3a3631; color: var(--ink); text-align: left; }
.st:hover { background: none; }
.st .dot { position: absolute; left: 1px; top: 5px; width: 14px; height: 14px; box-sizing: border-box; }
.st.sc .dot, .st.var .dot { border-radius: 50%; background: #fff; border: 3px solid var(--lc); }
.st.var .lb b { color: var(--lc); }
.st.ev .dot { left: 2px; top: 6px; width: 12px; height: 12px; background: #26302b; transform: rotate(45deg); }
.st.ct .dot { left: 2px; top: 6px; width: 12px; height: 12px; border-radius: 3px; background: #fff; border: 2px solid var(--lc); }
.st.end .dot { left: 0; top: 4px; width: 16px; height: 16px; border-radius: 4px; background: #121212; }
.st .lb { position: absolute; top: 0; white-space: nowrap; line-height: 24px; font-size: 13.5px; display: flex; align-items: center; gap: 6px; padding: 0 6px; margin-left: -6px; border-radius: 6px; }
.st .lb.two, .st.two .lb { flex-direction: column; align-items: flex-start; gap: 0; line-height: 1.3; top: -6px; padding: 2px 6px; }
.st .lb b { font-weight: 600; }
.st .lb small { font-size: 11px; color: var(--muted); font-weight: 400; }
.st.two .lb small, .st.ct .lb small { color: var(--lc); opacity: .85; }
.st.ct .lb b { color: var(--lc); font-weight: 600; }
button.st:hover .lb { background: #fff; box-shadow: 0 2px 10px #3a2f201a; }
button.st:hover .lb b { text-decoration: underline; text-underline-offset: 3px; }
.st.sel .lb { background: #fff; box-shadow: 0 0 0 2px var(--accent); }
.st .tag { font-size: 10px; letter-spacing: 1px; background: #26302b; color: #b9dcbf; padding: 1px 6px; border-radius: 4px; line-height: 1.6; }
.st.weather .tag { background: #3b4a5c; color: #c6d8ec; }
.st.shutdown .tag { background: #5a4a33; color: #f0d9b0; }
.st .ch { font-style: normal; font-size: 12px; color: var(--accent); font-weight: 600; }
.st .cond { font-size: 11px; font-weight: 600; color: var(--lc); background: #fff; border: 1px solid var(--lc); padding: 0 7px; border-radius: 999px; line-height: 1.6; }
.st.end .lb { background: #121212; color: #eee; line-height: 1.5; padding: 3px 10px; top: -2px; gap: 8px; }
.st.end .lb b { letter-spacing: 3px; }
.st.end .lb small { color: #bbb; }
.st .mk { width: 7px; height: 7px; border-radius: 50%; flex: none; background: transparent; }
.st.edited .mk { background: var(--edit-line); }
.st.error .mk { background: var(--error); }
.k0 { --lc: #3f8a80; } .k1 { --lc: #c0782f; } .k2 { --lc: #8664a8; } .k3 { --lc: #4f79a3; } .k4 { --lc: #a8574f; } .k5 { --lc: #6f8a4e; }
.st.dim { opacity: .28; }

/* 小卡片的记号（表格里用） */
.c-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: transparent; }
.edited .c-dot { background: var(--edit-line); }
.error .c-dot { background: var(--error); }
.dim { opacity: .32; }
.m-l i { font-style: normal; font-weight: 600; margin-right: 6px; }
i.fuko { color: var(--fuko); }
i.storm { color: var(--storm); }
i.other { color: var(--other); }

.others { margin-top: 28px; }
.others h3 { font-size: 14px; margin: 0 0 10px; }
.others-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }

/* 边走边聊 / 睡前夜谈：情况 × 谁的事 */
.mx-sec { margin-bottom: 26px; }
.mx-sec h3 { font-size: 15px; margin: 0 0 10px; }
.mx-sec h3 small { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 10px; }
.mx { display: grid; grid-template-columns: 200px repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--paper); }
.mx-h { font-size: 12px; font-weight: 600; padding: 10px 12px; background: #efece5; border-bottom: 1px solid var(--line); }
.mx-h + .mx-h { border-left: 1px solid var(--line); }
.mx-h.fuko { color: var(--fuko); }
.mx-h.storm { color: var(--storm); }
.mx-r { padding: 12px; border-bottom: 1px solid var(--line); font-size: 13px; background: #faf8f3; }
.mx-r small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.mx-c { padding: 8px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); display: grid; gap: 6px; align-content: start; min-width: 0; }
.gap { font-size: 12px; color: #c1bbb0; padding: 7px 4px; }
.mini { display: block; width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 8px; padding: 7px 22px 7px 9px; background: #fff; position: relative; min-width: 0; }
.mini.sel { outline: 2px solid var(--accent); outline-offset: 1px; }
.mini.edited { box-shadow: inset 3px 0 0 var(--edit-line); }
.mini:hover { border-color: var(--line-strong); background: #fff; box-shadow: 0 3px 10px #3a2f2012; }
.mini .c-dot { position: absolute; right: 8px; top: 9px; }
.m-l { display: block; font-size: 12.5px; line-height: 1.6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-more { display: block; font-size: 11px; color: var(--muted); }

/* ================================================================ 右边的剧本 */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: var(--dw, min(720px, 52vw)); background: var(--paper); border-left: 1px solid var(--line-strong); box-shadow: -18px 0 50px #3a2f2026; z-index: 16; display: flex; flex-direction: column; }
.dw-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 22px 12px; border-bottom: 1px solid var(--line); }
.dw-title small { font-size: 11px; color: var(--muted); letter-spacing: 1px; }
.dw-title h2 { margin: 2px 0 0; font-size: 20px; }
.dw-body { overflow: auto; padding: 14px 22px 150px; flex: 1; }
.dw-when { font-size: 13px; background: #f3f0e8; border-radius: 8px; padding: 9px 12px; line-height: 1.65; margin: 0 0 14px; }
.dw-when b { margin-right: 10px; }
.extras { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 12px; margin-bottom: 16px; }
.ex > span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.ex .line textarea { padding-right: 11px; font-size: 14px; min-height: 36px; }

/* 一句一行；左边一条线，一句一个点（点的颜色 = 谁在说），和线路图同一套画法 */
.script { display: grid; --rail: #b3ab9c; }
.sr { display: grid; grid-template-columns: 26px 52px minmax(0, 1fr); column-gap: 6px; align-items: start; }
.rl { position: relative; align-self: stretch; }
.rl::before { content: ""; position: absolute; left: 12px; top: 0; bottom: 0; width: 2px; background: var(--rail); }
.rl::after { content: ""; position: absolute; left: 8px; top: 15px; width: 10px; height: 10px; box-sizing: border-box; border-radius: 50%; background: #fff; border: 2px solid var(--other); }
.rl.fuko::after { background: var(--fuko); border-color: var(--fuko); }
.rl.storm::after { background: var(--storm); border-color: var(--storm); }
.rl.bare::after { display: none; }
.rl.opt::after { border: 0; border-radius: 2px; background: var(--rail); transform: rotate(45deg); left: 8px; top: 13px; }
.rl.cap::before { bottom: auto; height: 14px; }
.rl.cap::after { border: 0; border-radius: 2px; background: var(--rail); width: 14px; height: 4px; left: 6px; top: 13px; }
.script > .sr:first-child .rl::before { top: 15px; }
.sr.deleted .rl::after { opacity: .35; }
.sr.new .rl::after { box-shadow: 0 0 0 3px #7fb37a55; }
.spk { font-size: 13px; font-weight: 600; text-align: left; padding: 10px 0 0; border: 0; background: none; border-radius: 0; line-height: 1.3; white-space: nowrap; }
button.spk { cursor: pointer; text-decoration: underline dotted #0004; text-underline-offset: 4px; }
button.spk:hover { background: none; opacity: .75; }
.spk small { display: block; font-size: 10px; color: var(--muted); font-weight: 400; text-decoration: none; }
.spk.fuko { color: var(--fuko); }
.spk.storm { color: var(--storm); }
.spk.other { color: var(--other); }
.sr .line { margin-bottom: 3px; }
.sr .line textarea { padding-right: 76px; }
.sr .line:not(.changed):not(.added):not(.has-error):not(.deleted) textarea { border-color: transparent; background: transparent; }
.sr .line:not(.changed):not(.added):not(.has-error):not(.deleted) textarea:hover { border-color: var(--line); background: #fff; }
.sr .line:not(.changed):not(.added):not(.has-error):not(.deleted) textarea:focus { border-color: var(--line-strong); background: #fff; }
.sr .meta button { opacity: 0; }
.sr:hover .meta button, .sr .line:focus-within .meta button, .sr .meta .restore { opacity: 1; }
.sr.deleted .spk { opacity: .45; }
.sr.tool > div { padding: 4px 0 8px; }
.sr.fin .flow-end { padding-top: 8px; font-size: 11px; letter-spacing: 2px; color: var(--muted); grid-column: 2 / 4; }
.sr.fill { flex: 1; min-height: 6px; }
.sr.fill.none .rl::before { display: none; }

/* 玩家选择：线在这里分开，每个选项一条，汇合的地方再合上 */
.fork { position: relative; }
.fork-split, .fork-merge { position: relative; height: 22px; }
.fork-split::before, .fork-merge::before { content: ""; position: absolute; left: 12px; height: 22px; box-sizing: border-box; border: 2px solid var(--rail); }
.fork-split::before { top: 0; border-left-width: 2px; border-bottom: 0; border-radius: 0 12px 0 0; }
.fork-merge::before { bottom: 0; border-top: 0; border-radius: 0 0 12px 0; }
.fork.n2 > .fork-split::before, .fork.n2 > .fork-merge::before { width: calc(50% + 8px); }
.fork.n3 > .fork-split::before, .fork.n3 > .fork-merge::before { width: calc(66.667% + 10px); }
.fork.n4 > .fork-split::before, .fork.n4 > .fork-merge::before { width: calc(75% + 11px); }
.fork.n3 > .fork-split::after, .fork.n3 > .fork-merge::after { content: ""; position: absolute; top: 0; height: 22px; width: 2px; background: var(--rail); left: calc(33.333% + 16px); }
.fork-note { position: absolute; left: 30px; top: 3px; font-size: 11px; font-weight: 600; color: var(--accent); }
.fork-merge span { position: absolute; left: 30px; bottom: 5px; font-size: 11px; color: var(--muted); }
.fork-cols { display: grid; gap: 12px; }
.fork-cols.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fork-cols.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fork-cols.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.branch { display: flex; flex-direction: column; min-width: 0; --rail: var(--bc); }
.branch.k0 { --bc: #c79a5b; }
.branch.k1 { --bc: #6f96b8; }
.branch.k2 { --bc: #8a73b0; }
.branch.k3 { --bc: #5e9c8d; }
.branch .sr { grid-template-columns: 26px 40px minmax(0, 1fr); column-gap: 4px; }
.branch .spk { font-size: 12px; }
.opt-k { font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--bc); padding-top: 11px; white-space: nowrap; }
.sr.opt .line textarea { padding-right: 11px; font-weight: 600; }
.sr.opt .line:not(.changed):not(.added):not(.has-error):not(.deleted) textarea { background: #fff8ec; border-color: #ead9ba; }
.direct { font-size: 12px; color: var(--muted); margin: 4px 0; }
.add-in { font-size: 12px; border: 1px dashed var(--line-strong); background: transparent; color: var(--muted); padding: 3px 10px; }
.add-in:hover { color: var(--accent); border-color: var(--accent); background: transparent; }
.jump { font-size: 12px; color: var(--accent); }
.tail { display: flex; gap: 6px; flex-wrap: wrap; }
.orphans { margin-top: 18px; padding: 10px 12px; border: 1px dashed var(--warn); border-radius: 8px; }
.orphans h4 { font-size: 12px; color: var(--warn); margin: 0 0 6px; }
.whole { display: flex; gap: 8px; margin: 20px 0 0 32px; }
.tips { font-size: 11px; color: var(--muted); margin: 18px 0 0 32px; }

.who-menu { position: fixed; z-index: 25; background: var(--paper); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 10px 30px #3a2f2030; padding: 5px; display: grid; gap: 2px; min-width: 110px; }
.who-menu button { border: 0; text-align: left; padding: 6px 10px; font-size: 13px; font-weight: 600; background: none; }
.who-menu button:hover { background: #f1ede5; }
.who-menu button.on::after { content: " ✓"; }
.who-menu .fuko { color: var(--fuko); }
.who-menu .storm { color: var(--storm); }
.who-menu .other { color: var(--other); }

/* ================================================================ 保存条 / 预览 / 确认 */
.savebar { position: fixed; right: 28px; bottom: 24px; display: flex; align-items: center; gap: 12px; background: var(--paper); border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 14px 12px 18px; box-shadow: 0 10px 30px #3a2f2030; z-index: 20; }
.savebar #save-summary { font-size: 14px; }
.savebar .bad { color: var(--error); font-weight: 600; }

.preview { position: fixed; left: 236px; bottom: 20px; width: 230px; z-index: 15; pointer-events: none; }
body.drawer-open .preview { left: calc(100vw - var(--dw, min(720px, 52vw)) + 22px); z-index: 17; }
.preview-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.preview-stage { height: 130px; border-radius: 10px; overflow: hidden; position: relative; background: linear-gradient(180deg, #2b3440 0%, #1c232c 60%, #151a20 100%); box-shadow: 0 8px 24px #0003; }
.pv-bark { position: absolute; left: 50%; top: 34px; transform: translateX(-50%); text-align: center; color: #f4f2ec; font-size: 14px; white-space: nowrap; text-shadow: 0 1px 3px #000; }
.pv-bark::after { content: ""; display: block; width: 1px; height: 22px; background: #f4f2ec88; margin: 6px auto 0; }
.pv-bark.urgent { color: #ffd9a8; }
.pv-figure { position: absolute; left: 50%; top: 92px; width: 16px; height: 40px; margin-left: -8px; border-radius: 8px 8px 3px 3px; background: #5d6b7a; }
.pv-sub { position: absolute; left: 14px; right: 14px; bottom: 16px; color: #f4f2ec; font-size: 13px; line-height: 1.6; text-shadow: 0 1px 3px #000; }
.pv-sub b { font-weight: 600; margin-right: 6px; }
.pv-sub b.fuko { color: #9cc7ea; }
.pv-sub b.storm { color: #f2a3c2; }
.pv-story { position: absolute; left: 0; right: 0; bottom: 0; height: 58px; background: #0b0d10; color: #f4f2ec; font-size: 13px; padding: 9px 14px; line-height: 1.6; }
.pv-story small { display: block; font-size: 11px; color: #aaa; }
.pv-radio { position: absolute; left: 14px; bottom: 16px; right: 60px; color: #cfe7d2; font-size: 12px; line-height: 1.6; }
.pv-radio::before { content: "RADIO"; display: block; font-size: 9px; letter-spacing: 2px; color: #7fa487; }
.pv-black { position: absolute; inset: 0; background: #000; color: #eee; display: flex; align-items: center; justify-content: center; padding: 20px; font-size: 13px; text-align: center; }

dialog { border: 1px solid var(--line-strong); border-radius: 14px; padding: 0; width: min(760px, 92vw); max-height: 84vh; background: var(--paper); color: var(--ink); }
dialog::backdrop { background: #2a241b55; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--paper); }
.dlg-head h2 { margin: 0; font-size: 18px; }
.x { border: 0; background: none; font-size: 22px; padding: 0 6px; line-height: 1; }
#confirm-body { padding: 8px 20px 12px; overflow: auto; max-height: 60vh; }
.dlg-foot { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--paper); }
.dlg-foot .muted { margin-right: auto; font-size: 12px; }
.diff-group h4 { font-size: 13px; margin: 14px 0 6px; }
.diff-row { display: grid; grid-template-columns: 34px 90px minmax(0, 1fr); gap: 8px; font-size: 14px; padding: 6px 0; border-top: 1px dashed var(--line); }
.diff-row .k { font-size: 11px; border-radius: 4px; text-align: center; padding: 2px 0; height: fit-content; }
.k.改 { background: var(--edit); }
.k.加 { background: #dff0dc; }
.k.删 { background: #f6d9d4; }
.diff-row .before { color: #9a948a; text-decoration: line-through; display: block; }
.diff-row .after { display: block; }
.err-box { background: var(--error-soft); color: var(--error); padding: 10px 12px; border-radius: 8px; margin: 12px 0; font-size: 13px; }

#toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: #2f2d29; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px; z-index: 30; max-width: 80vw; }

@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .index { display: none; }
  .preview { display: none; }
  .drawer { width: min(780px, 92vw); }
  .top { flex-wrap: wrap; }
}

/* ================================================================ 演出预览（09-30 Shiori）：剧本抽屉顶上「游戏里的样子」 */
.stage { position: sticky; top: -14px; z-index: 3; margin: -14px -22px 14px; padding: 14px 22px 10px; background: var(--paper); border-bottom: 1px solid var(--line); }
/* 预览的大小跟着抽屉宽度走；太宽时按屏幕高度封顶（不超过窗口高度的 46%），居中 */
.stg-frame { container-type: inline-size; max-width: calc(46vh / 0.3136); margin: 0 auto; }
.stg-screen { position: relative; height: clamp(169.6px, 31.36cqw, 466.4px); border-radius: 10px; overflow: hidden; background: #0c0e12; box-shadow: 0 12px 30px #1a140c38, inset 0 0 0 1px #ffffff12; color: #f2f0ea; }
.stage.folded .stg-frame { display: none; }
.stg-world { position: absolute; inset: 0; background: radial-gradient(120% 95% at 72% 0%, #405063 0%, #222b37 42%, #10141a 100%); }
.stg-world::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 75%; background: linear-gradient(180deg, transparent 0%, #2d3744c0 70%, #1c222b 100%); }
/* 远处的街和电波塔（红灯一闪一闪） */
.stg-city { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: clamp(96px, 17.75cqw, 264px); }
.stage.story .stg-city { bottom: clamp(102.4px, 18.93cqw, 281.6px); height: clamp(48px, 8.88cqw, 132px); }
.stg-city .bld { fill: #0a0d12; }
.stg-city .win { fill: #ffd9a3; opacity: .55; }
.stg-city .tower { fill: none; stroke: #0a0d12; stroke-width: 2; }
.stg-city .lamp { fill: #ff4a3d; animation: stgLamp 2.4s ease-in-out infinite; }
.stg-city .halo2 { fill: #ff4a3d; opacity: .22; animation: stgHalo 2.4s ease-in-out infinite; }
@keyframes stgHalo { 0%, 55%, 100% { opacity: .22; } 70%, 85% { opacity: .03; } }
@keyframes stgLamp { 0%, 55%, 100% { opacity: .95; } 70%, 85% { opacity: .15; } }
.stg-glow { position: absolute; width: clamp(176px, 32.54cqw, 484px); height: clamp(176px, 32.54cqw, 484px); right: 10%; top: -80px; background: radial-gradient(circle, #ffdcae55 0%, #ffdcae10 45%, transparent 70%); }
.stg-label { position: absolute; right: clamp(9.6px, 1.78cqw, 26.4px); top: clamp(25.6px, 4.73cqw, 70.4px); z-index: 3; font-size: clamp(8px, 1.48cqw, 22px); letter-spacing: 3px; color: #ffffff4d; }
.stage.sub .stg-label, .stage.radio .stg-label { top: clamp(9.6px, 1.78cqw, 26.4px); left: clamp(12.8px, 2.37cqw, 35.2px); right: auto; }

/* 剧情对话：上下黑边、左边宽银幕近景小窗、右边名字和台词 */
.stage.story .stg-top { position: absolute; left: 0; right: 0; top: 0; height: clamp(19.2px, 3.55cqw, 52.8px); z-index: 2; background: #07080a; display: flex; align-items: center; padding: 0 clamp(13px, 2.37cqw, 35px); }
.stg-title { font-size: clamp(8.8px, 1.63cqw, 24.2px); letter-spacing: 3px; color: #cfc9bd; }
.stage.story .stg-bar { position: absolute; left: 0; right: 0; bottom: 0; height: clamp(102.4px, 18.93cqw, 281.6px); z-index: 2; background: linear-gradient(180deg, #08090b, #050607); display: flex; align-items: center; gap: clamp(16px, 2.96cqw, 44px); padding: 0 clamp(14px, 2.66cqw, 40px) 0 clamp(21px, 3.85cqw, 57px); }
.stg-ins { position: relative; flex: none; width: clamp(160px, 29.59cqw, 440px); height: clamp(72.8px, 13.46cqw, 200.2px); clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%); background: #ffffff3a; }
.stg-ins.fuko { background: linear-gradient(135deg, #a8d6ffb0, #ffffff30); }
.stg-ins.storm { background: linear-gradient(135deg, #ffb3ccb0, #ffffff30); }
.stg-face { position: absolute; inset: 1.5px; clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%); background-color: #141820; background-repeat: no-repeat; }
.stg-ins.empty .stg-face { background: #0e1117; }
.stg-wave { display: none; }
.stg-ins.empty .stg-wave { display: flex; position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); gap: 5px; align-items: center; height: 24px; }
.stg-wave b { width: 2px; height: 6px; background: #8e97a5; border-radius: 1px; animation: stgWave .9s ease-in-out infinite; }
.stg-wave b:nth-child(2) { animation-delay: .12s; } .stg-wave b:nth-child(3) { animation-delay: .24s; } .stg-wave b:nth-child(4) { animation-delay: .36s; }
.stg-wave b:nth-child(5) { animation-delay: .48s; } .stg-wave b:nth-child(6) { animation-delay: .6s; } .stg-wave b:nth-child(7) { animation-delay: .72s; }
@keyframes stgWave { 0%, 100% { height: 5px; } 50% { height: 20px; } }
.stg-who { position: absolute; left: 0; right: 0; bottom: clamp(9.6px, 1.78cqw, 26.4px); text-align: center; font-size: clamp(8px, 1.48cqw, 22px); letter-spacing: 1px; color: #9aa3b1; }
.stg-say { flex: 1; min-width: 0; }
.stg-name { display: flex; align-items: baseline; gap: clamp(6.4px, 1.18cqw, 17.6px); }
.stg-name b { font-size: clamp(12px, 2.22cqw, 33px); font-weight: 600; letter-spacing: 2px; color: #d5cfc4; }
.stg-name.fuko b { color: #a8d6ff; }
.stg-name.storm b { color: #ffb3cc; }
.stg-name small { font-size: clamp(8.8px, 1.63cqw, 24.2px); color: #8d8a84; letter-spacing: 1px; }
.stg-text { margin: 6px 0 0; font-size: clamp(12.8px, 2.37cqw, 35.2px); line-height: 1.75; color: #f4f2ec; min-height: clamp(44.8px, 8.28cqw, 123.2px); letter-spacing: .5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stg-text.typing::after { content: "▍"; color: #ffffff80; margin-left: 1px; animation: stgBlink .8s steps(2) infinite; }
@keyframes stgBlink { 50% { opacity: 0; } }
.stg-screen.struck .stg-text, .stg-screen.struck .stg-cur { text-decoration: line-through; opacity: .45; }
.stg-opts { display: grid; gap: clamp(4.8px, 0.89cqw, 13.2px); flex: none; }
.stg-opts:empty { display: none; }
.stg-opts button { display: flex; align-items: center; gap: clamp(6.4px, 1.18cqw, 17.6px); min-width: clamp(104px, 19.23cqw, 286px); text-align: left; font-size: clamp(10.4px, 1.92cqw, 28.6px); color: #f2f0ea; background: #ffffff10; border: 1px solid #ffffff2e; border-radius: 3px; padding: 5px 12px 5px 8px; }
.stg-opts button:hover { background: #ffffff24; border-color: #ffffff66; }
.stg-opts button i { font-style: normal; font-size: clamp(8px, 1.48cqw, 22px); font-weight: 700; color: #0c0e12; background: #d9d3c7; border-radius: 2px; padding: 0 4px; }
.stg-screen.in .stg-say, .stg-screen.in .stg-ins, .stg-screen.in .stg-cur, .stg-screen.in .stg-radio p { animation: stgIn .24s ease-out; }
@keyframes stgIn { from { opacity: 0; transform: translateY(5px); } }

/* 边走边聊 / 睡前夜谈：底部居中的字幕 */
.stage.sub .stg-subs { position: absolute; left: clamp(19.2px, 3.55cqw, 52.8px); right: clamp(19.2px, 3.55cqw, 52.8px); bottom: clamp(17.6px, 3.25cqw, 48.4px); z-index: 2; text-align: center; }
.stage.sub .stg-world::after, .stage.radio .stg-world::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 40%; background: linear-gradient(180deg, transparent, #050608a0); }
.stg-subs p { margin: 0; font-size: clamp(12px, 2.22cqw, 33px); line-height: 1.85; text-shadow: 0 1px 3px #000, 0 0 14px #000c; }
.stg-subs .stg-prev { font-size: clamp(10.8px, 2.00cqw, 29.7px); opacity: .42; }
.stg-subs .stg-prev:empty { display: none; }
.stg-subs b { margin-right: 10px; font-weight: 600; color: #d5cfc4; }
.stg-subs b.fuko { color: #a8d6ff; }
.stg-subs b.storm { color: #ffb3cc; }
.stage.sub .stg-text { display: inline; min-height: 0; font-size: inherit; margin: 0; }

/* 广播：左下角的电台文字 */
.stage.radio .stg-radio { position: absolute; left: clamp(19.2px, 3.55cqw, 52.8px); right: 28%; bottom: clamp(17.6px, 3.25cqw, 48.4px); z-index: 2; color: #cfe7d2; }
.stg-radio small { font-size: clamp(7.2px, 1.33cqw, 19.8px); letter-spacing: 3px; color: #7fa487; }
.stage.radio .stg-text { font-size: clamp(11.2px, 2.07cqw, 30.8px); color: #cfe7d2; min-height: 0; margin-top: 4px; text-shadow: 0 1px 3px #000; }

/* 播放控制 */
.stg-ctl { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; }
.stg-ctl button { padding: 3px 10px; font-size: 12px; border-radius: 6px; line-height: 1.6; }
.stg-ctl .stg-play { background: var(--ink); color: #fff; border-color: var(--ink); padding: 3px 14px; }
.stage.playing .stg-play { background: var(--accent); border-color: var(--accent); }
.stg-pos { color: var(--muted); margin-left: 4px; }
.stg-fold { margin-left: auto; background: transparent; color: var(--muted); }
.sr.on-stage { background: linear-gradient(90deg, #f3e7d3 0%, #f7efe300 85%); border-radius: 8px; }

/* 剧本里的小头像（线上的点换成头像，能换表情的点一下换） */
.rl.has-av::after { display: none; }
.rl .av { position: absolute; left: 1px; top: 8px; z-index: 1; }
.av { display: inline-block; width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 2px solid var(--other); background-color: #e9edf2; background-repeat: no-repeat; box-shadow: 0 0 0 2px var(--paper); }
.av.fuko { border-color: var(--fuko); }
.av.storm { border-color: var(--storm); }
button.av { cursor: pointer; transition: transform .12s; }
button.av:hover { transform: scale(1.15); background-color: #e9edf2; }
.sr.face-changed .av { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--edit-line); }
.sr.deleted .av { opacity: .4; }
.who-menu .av { width: 22px; height: 22px; margin-right: 8px; vertical-align: middle; box-shadow: none; }
.who-menu .av.none { border-color: transparent; background: none; }
.who-menu.faces { width: 300px; }
.menu-h { font-size: 11px; color: var(--muted); margin: 4px 6px 6px; }
.face-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; }
.who-menu .face-grid button { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11px; font-weight: 400; padding: 7px 2px; text-align: center; }
.who-menu .face-grid button.on { background: #f1e6d4; }
.who-menu .face-grid button.on::after { content: ""; }
.who-menu .av.big { width: 46px; height: 46px; margin: 0; }

/* 抽屉标题旁：这一段里有谁 */
.dw-cast { display: flex; gap: 10px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.dw-cast span { display: inline-flex; align-items: center; gap: 5px; }
.dw-cast .av { width: 20px; height: 20px; box-shadow: none; }

/* 剧本抽屉左边的拖柄：拖宽了预览跟着变大；双击恢复 */
.dw-grip { position: absolute; left: -7px; top: 0; bottom: 0; width: 14px; cursor: col-resize; z-index: 6; touch-action: none; }
.dw-grip::before { content: ""; position: absolute; left: 6px; top: 0; bottom: 0; width: 2px; background: transparent; transition: background .15s; }
.dw-grip i { position: absolute; left: 3px; top: 50%; width: 8px; height: 64px; transform: translateY(-50%); border-radius: 4px; background: #bdb4a4; box-shadow: 0 0 0 2px var(--paper), 0 2px 8px #3a2f2022; transition: background .15s, height .15s; }
.dw-grip i::before, .dw-grip i::after { content: ""; position: absolute; left: 2px; right: 2px; height: 1px; background: #fff9; top: 44%; }
.dw-grip i::after { top: 56%; }
.dw-grip:hover::before, body.resizing .dw-grip::before { background: #8d644466; }
.dw-grip:hover i, body.resizing .dw-grip i { background: var(--accent); height: 88px; }
body.resizing { cursor: col-resize; user-select: none; }
body.resizing .drawer { transition: none; }

/* ---------------------------------------------------------------- 10-01 Shiori：第一章两条线（主线等玩家 / 世界线按天） */
.metro-svg .col { font-size: 12px; font-weight: 700; letter-spacing: 2px; fill: var(--ink); }
.metro-svg .why { font-size: 12px; fill: var(--muted); text-anchor: end; }
.gl { position: absolute; font-size: 11.5px; line-height: 20px; padding: 0 9px; border-radius: 999px; color: #8a5a1c; background: #fff7ea; border: 1px dashed #d7b27c; white-space: nowrap; }
.st .chip, .legend .chip { font-style: normal; font-size: 10.5px; line-height: 1.5; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; background: #fff; margin-right: 0; }
.legend .chip { margin-right: 6px; }
.st .lb .row { display: inline-flex; align-items: center; gap: 6px; }
.lg-dot.end { width: 12px; height: 12px; border-radius: 3px; background: #121212; }
.lg-goal { width: 22px; height: 12px; border-radius: 999px; border: 1px dashed #d7b27c; background: #fff7ea; }
.st.ev.two .lb { top: -7px; }

/* 剧本里的演出那几步：和台词在同一条线上，点是小方块 */
.sp-h { font-size: 11px; letter-spacing: 2px; color: var(--muted); font-weight: 600; margin: 14px 0 6px 32px; }
.sp-h:first-of-type { margin-top: 4px; }
.sp-list { margin-bottom: 4px; }
.rl.sp::after { border-radius: 2px; border: 2px solid #8f8a80; background: #f3f0e8; }
.sr.k-radio .rl.sp::after { border-color: #3f8a80; background: #cfe7d2; }
.sr.k-event .rl.sp::after { border-color: #5a4a33; background: #f0d9b0; transform: rotate(45deg); }
.sr.k-card .rl.sp::after { border-color: #121212; background: #121212; }
.sr.k-goal .rl.sp::after { border: 1px dashed #d7b27c; background: #fff7ea; border-radius: 50%; }
.sr.sp .spk { font-size: 12px; padding-top: 9px; }
.sp-body { padding: 2px 0 6px; }
.sp-body .line textarea { padding-right: 11px; }
.sp-note { margin: 2px 0 0 2px; font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.sp-note .link { font-size: 11.5px; padding: 0 8px; line-height: 1.7; border-radius: 6px; }

/* 演出预览：演出那几格各画在自己那一层，只显示当前这一层 */
.stg-radio, .stg-bark, .stg-note, .stg-card, .stg-goal { display: none; }
.stg-screen[data-on="radio"] .stg-radio { display: block; position: absolute; left: clamp(19.2px, 3.55cqw, 52.8px); right: 26%; bottom: clamp(17.6px, 3.25cqw, 48.4px); z-index: 2; color: #cfe7d2; }
.stg-radio .stg-text { font-size: clamp(10.4px, 1.92cqw, 28.6px); color: #cfe7d2; min-height: 0; margin-top: 4px; text-shadow: 0 1px 3px #000; white-space: pre-line; -webkit-line-clamp: 4; line-height: 1.6; }
.stage.story .stg-screen:not([data-on="story"]) .stg-say, .stage.story .stg-screen:not([data-on="story"]) .stg-ins, .stage.story .stg-screen:not([data-on="story"]) .stg-opts, .stage.story .stg-screen:not([data-on="story"]) .stg-title { visibility: hidden; }
/* 演出时对话框还没出来：上下只有细黑边（游戏里 HudCine.BAR），对话框出来才加厚 */
.stage.story .stg-bar { transition: height .3s ease; }
.stage.story .stg-screen:not([data-on="story"]) .stg-bar { height: clamp(14px, 2.67cqw, 40px); }
.stage.story .stg-city.tall { display: none; bottom: clamp(14px, 2.67cqw, 40px); height: clamp(96px, 17.75cqw, 264px); }
.stage.story .stg-screen:not([data-on="story"]) .stg-city.tall { display: block; }
.stage.story .stg-screen:not([data-on="story"]) .stg-city:not(.tall) { display: none; }
.stage.story .stg-screen:not([data-on="story"]) .stg-radio, .stage.story .stg-screen:not([data-on="story"]) .stg-note { bottom: clamp(26px, 4.8cqw, 70px); }
.stage.sub .stg-screen:not([data-on="sub"]) .stg-subs { visibility: hidden; }
.stage.radio .stg-screen:not([data-on="radio"]) .stg-radio { display: none; }
.stg-screen[data-on="bark"] .stg-bark { display: block; position: absolute; left: 50%; top: 30%; transform: translateX(-50%); z-index: 2; max-width: 60%; background: #f4f2ec; color: #16181c; border-radius: 8px; padding: clamp(4px, .9cqw, 12px) clamp(9px, 1.8cqw, 24px); box-shadow: 0 4px 14px #0008; }
.stg-bark::after { content: ""; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: #f4f2ec; }
.stg-bark b { display: block; font-size: clamp(8px, 1.4cqw, 20px); letter-spacing: 1px; color: #6b6a66; }
.stg-bark b.fuko { color: #3b79b4; } .stg-bark b.storm { color: #c0567a; }
.stg-bark .stg-text { display: inline; min-height: 0; margin: 0; font-size: clamp(11.2px, 2.07cqw, 30.8px); color: inherit; line-height: 1.5; }
.stg-screen[data-on="note"] .stg-note { display: block; position: absolute; left: 12%; right: 12%; bottom: clamp(17.6px, 3.25cqw, 48.4px); z-index: 2; text-align: center; }
.stg-note small { display: block; font-size: clamp(7.2px, 1.33cqw, 19.8px); letter-spacing: 3px; color: #f0d9b0; }
.stg-note small:empty { display: none; }
.stg-note .stg-text { display: inline; min-height: 0; margin: 0; font-size: clamp(11.2px, 2.07cqw, 30.8px); font-style: italic; color: #e6e2d8; text-shadow: 0 1px 3px #000, 0 0 14px #000c; }
.stg-screen[data-on="card"] .stg-card { display: flex; position: absolute; inset: 0; z-index: 2; flex-direction: column; align-items: center; justify-content: center; gap: clamp(2px, .5cqw, 8px); text-align: center; }
.stg-card.chapter { background: radial-gradient(60% 45% at 50% 50%, #000c, #0000); }
.stg-card .stg-text { display: block; min-height: 0; margin: 0; font-size: clamp(20px, 4.2cqw, 60px); letter-spacing: .4em; padding-left: .4em; font-weight: 600; color: #f4f2ec; text-shadow: 0 2px 12px #000; }
.stg-card .stg-reading { font-size: clamp(7.2px, 1.33cqw, 19.8px); letter-spacing: 4px; color: #b9b3a8; }
.stg-card .stg-sub { font-size: clamp(10px, 1.85cqw, 27px); color: #ddd6c9; letter-spacing: 2px; }
.stg-screen[data-on="goal"] .stg-goal { display: block; position: absolute; left: clamp(13px, 2.4cqw, 35px); top: clamp(26px, 4.9cqw, 72px); z-index: 2; background: #000a; border-left: 3px solid #ffd9a3; padding: clamp(3px, .6cqw, 9px) clamp(8px, 1.5cqw, 22px); }
.stg-goal small { display: block; font-size: clamp(7.2px, 1.33cqw, 19.8px); letter-spacing: 3px; color: #ffd9a3; }
.stg-goal .stg-text { display: block; min-height: 0; margin: 0; font-size: clamp(11px, 2cqw, 30px); color: #f4f2ec; }
/* 停电以后：远处的窗和塔顶的红灯都灭了 */
.stg-screen.dark .stg-world { filter: brightness(.38) saturate(.6); }
.stg-screen.dark .stg-city .win, .stg-screen.dark .stg-city .lamp, .stg-screen.dark .stg-city .halo2 { opacity: 0; animation: none; }
.stg-screen.dark .stg-glow { opacity: 0; }
