/* 《明文 Plaintext》riso 双色孔版风格 */
:root {
  --pink: #FF48B0;
  --cyan: #0078BF;
  --yellow: #FFE800;
  --paper: #F4EFE6;
  --ink: #1d2a5c;
  --ink-soft: #3b4677;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --dialog-h: 30vh;
  --fs: 19px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--paper); color: var(--ink); overflow: hidden; }
body { font-family: var(--serif); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
.noscript { padding: 2em; }

.app { position: fixed; inset: 0; overflow: hidden; background: var(--paper); user-select: none; -webkit-user-select: none; }
.stage { position: absolute; inset: 0; }
.layer { position: absolute; inset: 0; }
.bg svg, .bg-svg { width: 100%; height: 100%; display: block; }
.bg { transition: opacity .5s ease; }
.bg.fade { opacity: 0; }
.rain-layer { animation: rain 0.7s linear infinite; }
@keyframes rain { from { transform: translate(0, -120px); } to { transform: translate(0, 0); } }

/* 纸张颗粒 + 半调网点（全屏叠印） */
.grain {
  position: fixed; inset: -50%; pointer-events: none; z-index: 50; opacity: .32; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .45  0 0 0 0 .4  0 0 0 0 .35  0 0 0 .9 0'/></filter><rect width='220' height='220' filter='url(%23n)'/></svg>");
}
.stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 3; opacity: .12;
  background-image: radial-gradient(var(--cyan) 18%, transparent 20%);
  background-size: 5px 5px; mix-blend-mode: multiply;
}

/* ---------- 立绘 ---------- */
.chars { display: flex; justify-content: center; align-items: flex-end; gap: 2vw; padding: 0 4vw calc(var(--dialog-h) - 4vh); pointer-events: none; z-index: 2; }
.slot { height: 80vh; max-height: 760px; width: min(40vw, 520px); display: none; transition: opacity .35s ease, transform .35s ease, filter .35s ease; }
.slot.on { display: block; }
.slot.dim { filter: saturate(.55) brightness(1.06); opacity: .78; transform: translateY(8px) scale(.98); }
.slot.enter { animation: pin .45s ease-out; }
@keyframes pin { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
.portrait-svg { width: 100%; height: 100%; display: block; }

/* ---------- 对话框 ---------- */
.dialog {
  position: absolute; left: 50%; bottom: calc(14px + var(--safe-b)); transform: translateX(-50%);
  width: min(980px, calc(100% - 24px)); min-height: var(--dialog-h); max-height: 46vh; z-index: 10;
  background: var(--paper); border: 3px solid var(--cyan); padding: 34px 28px 22px;
  box-shadow: 7px 6px 0 var(--pink); cursor: pointer;
}
.dialog::before { /* 套色偏移的第二道框 */
  content: ""; position: absolute; inset: -3px; border: 3px solid var(--pink); transform: translate(3px, 2px); mix-blend-mode: multiply; pointer-events: none; opacity: .7;
}
.namebox {
  position: absolute; top: -20px; left: 22px; padding: 4px 16px 5px; font-weight: 900; font-size: 18px; letter-spacing: .12em;
  background: var(--cyan); color: var(--paper); box-shadow: 4px 3px 0 var(--pink);
}
.namebox:empty { display: none; }
.text { font-size: var(--fs); line-height: 1.85; letter-spacing: .04em; white-space: pre-wrap; overflow-y: auto; max-height: calc(46vh - 60px); }
.dialog.narr .text { color: var(--ink-soft); }
.dialog.think .text { color: var(--pink); font-style: italic; }
.dialog.think { border-style: dashed; }
.next-ind { position: absolute; right: 18px; bottom: 10px; color: var(--pink); font-size: 14px; opacity: 0; }
.dialog.done .next-ind { opacity: 1; animation: bob 1s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(4px); } }

/* ---------- 快捷栏 ---------- */
.quickbar { position: absolute; right: max(16px, calc(50% - 490px + 8px)); bottom: calc(14px + var(--dialog-h) + 10px + var(--safe-b)); z-index: 11; display: flex; gap: 6px; }
.quickbar button { background: var(--paper); border: 2px solid var(--ink); padding: 3px 10px; font-size: 13px; font-family: var(--sans); letter-spacing: .1em; }
.quickbar button.on { background: var(--yellow); }
.quickbar button:hover { background: var(--pink); color: var(--paper); }

/* ---------- 选项 ---------- */
.choices { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--dialog-h) + 66px + var(--safe-b)); top: 74px; z-index: 12; width: min(760px, calc(100% - 28px)); display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; overflow-y: auto; padding: 6px 10px 6px 4px; }
.choice {
  position: relative; display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  background: var(--paper); border: 2.5px solid var(--ink); padding: 12px 16px; font-size: 17px; line-height: 1.5;
  box-shadow: 5px 4px 0 var(--cyan); transition: transform .12s ease, box-shadow .12s ease, background .12s;
  animation: rise .3s ease-out backwards;
}
.choice:nth-child(2) { animation-delay: .05s; } .choice:nth-child(3) { animation-delay: .1s; } .choice:nth-child(4) { animation-delay: .15s; } .choice:nth-child(5) { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.choice:hover, .choice:focus-visible { transform: translate(-2px, -2px); box-shadow: 8px 7px 0 var(--pink); outline: none; background: #fff9ef; }
.choice .num { flex: none; width: 26px; height: 26px; display: grid; place-items: center; background: var(--ink); color: var(--paper); font-family: var(--sans); font-size: 13px; }
.choice .ctext { flex: 1; }
.choice .ctag { flex: none; display: flex; align-items: center; gap: 4px; font-family: var(--sans); font-size: 11px; color: var(--ink-soft); letter-spacing: .08em; }
.icon { width: 22px; height: 22px; display: inline-block; vertical-align: middle; flex: none; }
.choice .hint { display: block; font-family: var(--sans); font-size: 12px; color: var(--pink); margin-top: 3px; letter-spacing: .05em; }
.choice.meta { border-style: dashed; box-shadow: 5px 4px 0 var(--pink); }
.choice.meta .ctext::before { content: "🔒 "; }
.choice.tempt { background: #fffbd0; border-color: var(--pink); animation: rise .3s ease-out backwards, tempt 2.4s ease-in-out infinite; }
@keyframes tempt { 0%, 100% { box-shadow: 5px 4px 0 var(--yellow), 0 0 0 0 rgba(255, 72, 176, .0); } 50% { box-shadow: 5px 4px 0 var(--yellow), 0 0 22px 6px rgba(255, 72, 176, .45); } }

/* ---------- 手机 ---------- */
.phone-screen {
  position: absolute; z-index: 5; left: 50%; transform: translateX(-50%); top: 3vh; bottom: calc(var(--dialog-h) + 30px);
  width: min(440px, calc(100% - 24px)); background: var(--paper); border: 3px solid var(--ink); border-radius: 26px;
  box-shadow: 9px 8px 0 var(--cyan), 9px 8px 0 3px var(--pink); display: flex; flex-direction: column; overflow: hidden;
}
.phone-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 2px solid var(--ink); font-family: var(--sans); font-weight: 700; letter-spacing: .1em; background: repeating-linear-gradient(-45deg, transparent 0 6px, rgba(0, 120, 191, .12) 6px 8px); }
.phone-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--pink); }
.phone-body { flex: 1; overflow-y: auto; padding: 14px 14px 18px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.bubble { max-width: 82%; padding: 9px 13px; font-size: 16px; line-height: 1.6; border: 2px solid var(--ink); background: #fff; position: relative; animation: pop .25s ease-out; font-family: var(--sans); }
.bubble .who { display: block; font-size: 11px; color: var(--ink-soft); margin-bottom: 2px; letter-spacing: .1em; }
.bubble.them { align-self: flex-start; border-radius: 4px 16px 16px 16px; box-shadow: 3px 3px 0 var(--pink); }
.bubble.mine { align-self: flex-end; background: var(--cyan); color: var(--paper); border-color: var(--cyan); border-radius: 16px 4px 16px 16px; box-shadow: 3px 3px 0 var(--yellow); }
.bubble.mine .who { color: #cfe6f5; }
@keyframes pop { from { opacity: 0; transform: scale(.92) translateY(6px); } }
.msgpop { position: absolute; z-index: 9; right: max(16px, 6vw); top: 118px; width: min(360px, calc(100% - 32px)); background: var(--paper); border: 3px solid var(--ink); border-radius: 18px; padding: 12px; box-shadow: 7px 6px 0 var(--cyan); display: flex; flex-direction: column; gap: 8px; animation: pop .3s ease-out; }
.msgpop::before { content: "新消息"; font-family: var(--sans); font-size: 11px; letter-spacing: .2em; color: var(--pink); }
.app.phone-bg .dialog { z-index: 10; }

.sysline { position: absolute; z-index: 9; left: 50%; top: 38%; transform: translateX(-50%); max-width: calc(100% - 40px); background: var(--ink); color: var(--paper); padding: 10px 22px; font-family: var(--sans); font-size: 15px; letter-spacing: .12em; box-shadow: 5px 4px 0 var(--pink); animation: pop .3s ease-out; cursor: pointer; text-align: center; }

/* ---------- HUD ---------- */
.hud { position: absolute; z-index: 8; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; pointer-events: none; font-family: var(--sans); }
.hud .grp { display: flex; flex-direction: column; gap: 5px; background: rgba(244, 239, 230, .9); border: 2px solid var(--ink); padding: 7px 10px; box-shadow: 4px 3px 0 var(--cyan); pointer-events: auto; }
.hud .row { display: flex; align-items: center; gap: 6px; font-size: 12px; letter-spacing: .08em; white-space: nowrap; }
.hud .row .lbl { min-width: 3.5em; }
.pips { display: flex; gap: 2px; }
.pip { width: 9px; height: 12px; border: 1.5px solid var(--ink); background: transparent; }
.pip.on { background: var(--yellow); }
.pip.own.on { background: var(--cyan); }
.pip.heart.on { background: var(--pink); }
.pip.low.on { background: var(--pink); animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: .35; } }
.hud .right { align-items: flex-end; }
.hud .cap { font-size: 10px; color: var(--ink-soft); letter-spacing: .15em; }
.hud .ledger-btn { margin-top: 2px; align-self: stretch; border: 2px solid var(--ink); background: var(--paper); padding: 2px 8px; font-size: 12px; display: flex; align-items: center; gap: 4px; justify-content: center; }
.hud .ledger-btn .icon { width: 16px; height: 16px; }

/* ---------- 他人视角回放 ---------- */
.app.replay .bg, .app.replay .chars { filter: invert(1) hue-rotate(180deg) contrast(1.05) saturate(1.2); }
.app.replay .stage::after { opacity: .25; background-image: radial-gradient(var(--pink) 18%, transparent 20%); }
.app.replay .grain { opacity: .55; mix-blend-mode: screen; animation: jitter .4s steps(3) infinite; }
@keyframes jitter { 0% { transform: translate(0, 0); } 33% { transform: translate(-3%, 2%); } 66% { transform: translate(2%, -3%); } }
.app.replay .stage::before { content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none; box-shadow: inset 0 0 18vmin rgba(0, 0, 0, .75); background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 3px); }
.app.replay .dialog { background: #12142a; color: var(--paper); border-color: var(--pink); box-shadow: 7px 6px 0 var(--cyan); }
.app.replay .dialog.narr .text { color: #d8d3e8; }
.app.replay .dialog.think .text { color: var(--yellow); }
.app.replay .namebox { background: var(--pink); box-shadow: 4px 3px 0 var(--cyan); }
.replayhud { position: absolute; z-index: 9; top: 12px; right: 12px; left: 12px; display: flex; justify-content: space-between; align-items: flex-start; font-family: var(--sans); color: var(--paper); pointer-events: none; }
.replayhud .tag { background: var(--pink); color: var(--paper); padding: 6px 12px; letter-spacing: .25em; font-size: 13px; box-shadow: 4px 3px 0 var(--cyan); }
.replayhud .stats { background: rgba(18, 20, 42, .85); border: 2px solid var(--yellow); padding: 8px 12px; font-size: 13px; letter-spacing: .08em; line-height: 1.8; text-align: right; }
.replayhud .bars { font-family: monospace; letter-spacing: 0; color: var(--pink); }
.replayhud .bars .off { color: #555a7a; }
.replayhud .bars .hot { color: var(--yellow); }

/* ---------- 全屏卡片（章节标题、解锁、结局） ---------- */
.overlay { position: absolute; inset: 0; z-index: 30; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; background: var(--paper); cursor: pointer; overflow-y: auto; padding: 24px 16px; }
.overlay.dim { background: rgba(244, 239, 230, .86); }
.overlay.dark { background: #12142a; color: var(--paper); }
.card { position: relative; width: min(620px, 100%); padding: 40px 34px; background: var(--paper); border: 3px solid var(--ink); box-shadow: 10px 9px 0 var(--pink), 10px 9px 0 3px var(--cyan); animation: rise .45s ease-out; cursor: default; color: var(--ink); }
.card h2 { margin: 0 0 10px; font-size: 30px; letter-spacing: .15em; }
.card p { line-height: 1.9; font-size: 16px; margin: .6em 0; }
.card .k { font-family: var(--sans); font-size: 12px; letter-spacing: .3em; color: var(--pink); }
.card .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.btn { border: 2.5px solid var(--ink); background: var(--paper); padding: 9px 18px; font-size: 15px; letter-spacing: .12em; box-shadow: 4px 3px 0 var(--cyan); }
.btn:hover, .btn:focus-visible { background: var(--yellow); outline: none; }
.btn.primary { background: var(--pink); color: var(--paper); box-shadow: 4px 3px 0 var(--ink); }
.btn[disabled] { opacity: .4; cursor: not-allowed; background: var(--paper); }
.chapter-card { text-align: center; position: relative; width: 100%; height: 100%; display: grid; place-items: center; }
.chapter-card .deco { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.chapter-card .deco i { position: absolute; border-radius: 50%; mix-blend-mode: multiply; opacity: .85; }
.chapter-card .no { font-family: var(--sans); letter-spacing: .6em; font-size: 15px; color: var(--cyan); }
.chapter-card .ttl { position: relative; font-size: clamp(64px, 16vw, 150px); font-weight: 900; letter-spacing: .1em; line-height: 1.1; margin: 10px 0; }
.riso-text { position: relative; display: inline-block; white-space: nowrap; color: var(--pink); mix-blend-mode: multiply; }
.riso-text::after { content: attr(data-t); white-space: nowrap; position: absolute; left: 4px; top: 3px; color: var(--cyan); mix-blend-mode: multiply; }
.chapter-card .sub { font-size: 18px; letter-spacing: .3em; color: var(--ink-soft); }
.chapter-card .tap { margin-top: 36px; font-family: var(--sans); font-size: 12px; letter-spacing: .3em; color: var(--ink-soft); animation: blink 1.6s steps(2) infinite; }
.ending-card .kind { display: inline-block; padding: 3px 10px; background: var(--ink); color: var(--paper); font-family: var(--sans); font-size: 12px; letter-spacing: .2em; }
.helpbox { margin-top: 18px; padding: 14px 16px; border: 2.5px solid var(--cyan); background: #eaf4fb; font-family: var(--sans); font-size: 14px; line-height: 1.8; color: var(--ink); }
.helpbox b { color: var(--cyan); }
.ledger-list { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-direction: column; gap: 6px; font-family: var(--sans); font-size: 14px; }
.ledger-list li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1.5px solid var(--ink); background: #fff; }
.ledger-list .st { margin-left: auto; font-weight: 700; letter-spacing: .1em; }
.ledger-list .st.q { color: var(--ink-soft); }
.ledger-list .st.in { color: var(--cyan); }
.ledger-list .st.back { color: var(--pink); }
.ledger-list .st.hang { color: #b38f00; }
.overlay.dark .card { background: #12142a; color: var(--paper); border-color: var(--pink); }
.overlay.dark .ledger-list li { background: #1d2040; border-color: #555a7a; }
.overlay.dark .btn { background: #12142a; border-color: var(--paper); }
.overlay.dark .btn.primary { background: var(--pink); }

/* ---------- 标题画面 ---------- */
.title-screen { position: absolute; inset: 0; z-index: 20; background: var(--paper); overflow-y: auto; display: flex; align-items: flex-start; justify-content: center; padding: 24px 16px calc(24px + var(--safe-b)); }
.title-art { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.title-art svg { width: 100%; height: 100%; }
.title-inner { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 5vw; align-items: center; width: min(1000px, 100%); margin: auto 0; }
.logo { font-size: clamp(88px, 17vw, 190px); font-weight: 900; line-height: 1; letter-spacing: .06em; margin: 0; }
.logo-en { font-family: var(--sans); font-size: clamp(16px, 2.6vw, 24px); letter-spacing: .7em; color: var(--cyan); margin: 6px 0 20px; text-transform: uppercase; }
.tagline { font-size: 17px; line-height: 1.9; max-width: 30em; margin: 0 0 16px; }
.cw { font-family: var(--sans); font-size: 13px; line-height: 1.7; padding: 10px 12px; border-left: 5px solid var(--pink); background: rgba(255, 255, 255, .7); max-width: 36em; }
.menu { display: flex; flex-direction: column; gap: 10px; }
.menu .btn { text-align: left; font-size: 17px; padding: 11px 18px; display: flex; justify-content: space-between; gap: 10px; }
.menu .btn small { font-family: var(--sans); font-size: 11px; color: var(--ink-soft); letter-spacing: .1em; align-self: center; }
.menu .btn.secret { border-style: dashed; background: #fffbd0; }
.loadinfo { font-family: var(--sans); font-size: 12px; color: var(--ink-soft); margin-top: 10px; line-height: 1.6; }

/* ---------- 弹窗 ---------- */
.modal { position: absolute; inset: 0; z-index: 40; background: rgba(29, 42, 92, .45); display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 16px; }
.panel { width: min(720px, 100%); min-width: 0; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); display: flex; flex-direction: column; background: var(--paper); border: 3px solid var(--ink); box-shadow: 9px 8px 0 var(--pink); animation: rise .25s ease-out; }
.panel.wide { width: min(980px, 100%); }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 2.5px solid var(--ink); background: repeating-linear-gradient(-45deg, transparent 0 7px, rgba(255, 72, 176, .14) 7px 9px); }
.panel-head h3 { margin: 0; font-size: 20px; letter-spacing: .2em; flex: 1; }
.panel-head .x { border: 2px solid var(--ink); background: var(--paper); width: 34px; height: 34px; font-size: 18px; line-height: 1; }
.panel-body { padding: 16px 18px 20px; overflow-y: auto; font-size: 15px; line-height: 1.8; }
.panel-body p { margin: .5em 0; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs button { border: 2px solid var(--ink); background: var(--paper); padding: 4px 14px; font-size: 14px; }
.tabs button.on { background: var(--ink); color: var(--paper); }
.slots { display: flex; flex-direction: column; gap: 10px; }
.slot-btn { display: flex; gap: 12px; align-items: center; text-align: left; border: 2.5px solid var(--ink); background: #fff; padding: 10px 12px; box-shadow: 4px 3px 0 var(--cyan); width: 100%; }
.slot-btn:hover:not([disabled]) { background: var(--yellow); }
.slot-btn[disabled] { opacity: .45; cursor: not-allowed; }
.slot-btn .no { flex: none; width: 54px; font-family: var(--sans); font-size: 12px; letter-spacing: .1em; color: var(--pink); font-weight: 700; }
.slot-btn .info { flex: 1; min-width: 0; }
.slot-btn .info b { display: block; }
.slot-btn .info span { display: block; font-family: var(--sans); font-size: 12px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.acard { border: 2.5px solid var(--ink); background: #fff; padding: 12px; box-shadow: 4px 3px 0 var(--pink); font-size: 14px; line-height: 1.7; }
.acard h4 { margin: 0 0 6px; font-size: 16px; letter-spacing: .1em; }
.acard .meta { font-family: var(--sans); font-size: 11px; color: var(--cyan); letter-spacing: .15em; }
.acard.locked { background: transparent; border-style: dashed; color: var(--ink-soft); box-shadow: none; }
.acard.locked svg { width: 100%; height: 80px; display: block; margin-bottom: 6px; }
.compare { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 13px; }
.compare td, .compare th { border-bottom: 1px solid rgba(29, 42, 92, .25); padding: 6px 4px; text-align: left; }
.bar { display: inline-block; height: 10px; vertical-align: middle; }
.bar.p { background: var(--pink); } .bar.c { background: var(--cyan); }
.backlog-list { display: flex; flex-direction: column; gap: 10px; }
.bl { line-height: 1.7; }
.bl .who { font-family: var(--sans); font-size: 12px; font-weight: 700; color: var(--cyan); letter-spacing: .1em; display: block; }
.bl.choice { color: var(--pink); font-family: var(--sans); font-size: 14px; }
.bl.narr { color: var(--ink-soft); }
.set-row { display: grid; grid-template-columns: 7em 1fr 3em; align-items: center; gap: 10px; margin: 10px 0; font-family: var(--sans); font-size: 14px; }
.set-row input[type=range] { width: 100%; accent-color: var(--pink); }
.chap-list { display: flex; flex-direction: column; gap: 8px; }

/* ---------- 提示、调试 ---------- */
.toast { position: absolute; z-index: 60; left: 50%; top: 14px; transform: translateX(-50%); max-width: calc(100% - 24px); background: var(--ink); color: var(--paper); padding: 9px 16px; font-family: var(--sans); font-size: 13px; letter-spacing: .06em; box-shadow: 4px 3px 0 var(--pink); animation: pop .25s ease-out; }
.debug { position: absolute; z-index: 55; left: 8px; bottom: 8px; width: 290px; max-height: 70vh; overflow: auto; background: rgba(255, 255, 255, .95); border: 2px dashed var(--pink); font: 11px/1.45 ui-monospace, Menlo, monospace; padding: 8px; color: #222; }
.debug.min { width: auto; max-height: none; }
.debug.min .dbody { display: none; }
.debug select, .debug button { font: 11px ui-monospace, Menlo, monospace; margin: 2px 2px 2px 0; }
.debug .flags { word-break: break-all; color: #555; }

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
  :root { --fs: 16px; --dialog-h: 26vh; }
  .dialog { padding: 26px 16px 16px; bottom: calc(10px + var(--safe-b)); width: calc(100% - 20px); box-shadow: 5px 4px 0 var(--pink); }
  .namebox { font-size: 15px; top: -17px; left: 12px; padding: 3px 12px; }
  .chars { padding-bottom: calc(var(--dialog-h) + 50px); gap: 0; }
  .slot { height: 52vh; width: 70vw; }
  .slot.on + .slot.on { margin-left: -22vw; }
  .slot.on:has(+ .slot.on) { margin-right: 0; }
  .quickbar { right: 10px; left: 10px; justify-content: flex-end; bottom: calc(10px + var(--dialog-h) + 8px + var(--safe-b)); }
  .quickbar button { padding: 3px 7px; font-size: 12px; letter-spacing: .02em; }
  .choices { bottom: calc(var(--dialog-h) + 52px + var(--safe-b)); top: 64px; }
  .choice { font-size: 15px; padding: 10px 12px; gap: 8px; }
  .choice .ctag .lbl { display: none; }
  .hud { top: 8px; left: 8px; right: 8px; }
  .hud .grp { padding: 5px 7px; }
  .hud .row { font-size: 11px; gap: 4px; }
  .hud .row .lbl { min-width: 2.6em; }
  .pip { width: 6px; height: 10px; }
  .phone-screen { top: 96px; bottom: calc(var(--dialog-h) + 50px); border-radius: 18px; }
  .msgpop { top: 104px; right: 12px; }
  .title-inner { grid-template-columns: 1fr; gap: 20px; }
  .tagline { font-size: 15px; }
  .card { padding: 28px 20px; }
  .card h2 { font-size: 24px; }
  .replayhud .stats { font-size: 11px; padding: 6px 8px; }
  .replayhud .tag { font-size: 11px; letter-spacing: .15em; }
  .debug { width: 230px; }
}
/* 横屏手机：高度很小 */
@media (max-height: 520px) and (orientation: landscape) {
  :root { --fs: 15px; --dialog-h: 30vh; }
  .dialog { padding: 20px 18px 10px; max-height: 40vh; }
  .text { line-height: 1.6; max-height: calc(40vh - 34px); }
  .slot { height: 86vh; width: 30vw; }
  .chars { padding-bottom: 0; justify-content: center; gap: 16vw; }
  .choices { top: 8px; bottom: calc(var(--dialog-h) + 44px); width: min(640px, calc(100% - 28px)); gap: 6px; }
  .choice { padding: 6px 12px; font-size: 14px; }
  .quickbar { bottom: calc(var(--dialog-h) + 18px); }
  .phone-screen { top: 6px; bottom: calc(var(--dialog-h) + 20px); width: min(520px, 70%); }
  .phone-body { padding: 8px; gap: 6px; }
  .bubble { font-size: 14px; padding: 5px 10px; }
  .hud .grp { padding: 4px 6px; }
  .title-inner { grid-template-columns: 1fr 260px; }
  .logo { font-size: 72px; }
  .tagline { font-size: 14px; margin-bottom: 8px; }
  .menu { gap: 6px; }
  .menu .btn { padding: 6px 14px; font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.app.reduce *, .app.reduce *::before, .app.reduce *::after { animation: none !important; transition: none !important; }
.overlay.dark .loadinfo { color: #b9b6d3; }
