/* 夜晚悬疑 + 青少年读物感。字体只用系统字体栈（离线）。 */
:root {
  --ink: #0b1020; --panel: rgba(13, 18, 38, .93); --panel-line: rgba(255, 255, 255, .14);
  --text: #f6f1e4; --muted: #b4bad2; --gold: #e8b84f; --gold-deep: #b98a22;
  --paper: #fbf6ea; --paper-ink: #2a2438; --good: #2f8f5b; --bad: #b8433a;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Songti SC", "Noto Serif SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  --dlg-h: 200px;
  /* 刘海/底部横条留边（没有刘海的设备都是 0，电脑端不变）；自测改这四个变量来模拟刘海 */
  --sat: env(safe-area-inset-top, 0px); --sar: env(safe-area-inset-right, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--text); font-family: var(--sans); }
#app { position: fixed; inset: 0; overflow: hidden; overflow: clip; }   /* clip：连 scrollIntoView/focus 这类程序滚动也不许把整页顶歪 */
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }

.screen { position: absolute; inset: 0; display: none; }
.screen.active { display: block; }
.bg-layer { position: absolute; inset: 0; background-size: cover; background-position: center; }

/* ---------- 按钮 ---------- */
.btn { min-height: 46px; padding: 0 26px; border-radius: 999px; border: 1px solid transparent; font-size: 16px; font-weight: 600; letter-spacing: .02em; transition: transform .15s, background .2s, box-shadow .2s; }
.btn-primary { background: var(--gold); color: #241a05; box-shadow: 0 6px 20px rgba(232, 184, 79, .3); }
.btn-primary:hover:not(:disabled) { background: #f3c866; transform: translateY(-1px); }
.btn-primary:disabled { background: #5b5a64; color: #b9b8c0; box-shadow: none; cursor: not-allowed; }
.btn-ghost { background: transparent; border-color: rgba(255, 255, 255, .3); }
.btn-ghost:hover { background: rgba(255, 255, 255, .08); }
.quiz-card .btn-ghost { border-color: #c9bfa6; color: var(--paper-ink); }
.quiz-card .btn-ghost:hover { background: #efe7d3; }
.chip { min-height: 36px; padding: 0 14px; border-radius: 999px; background: rgba(10, 14, 30, .62); border: 1px solid var(--panel-line); font-size: 14px; backdrop-filter: blur(6px); }
.chip:hover { background: rgba(10, 14, 30, .85); }
.chip-light { background: #efe7d3; color: var(--paper-ink); border-color: #cfc4a8; }
.chip-light:hover { background: #e6dcc2; }
.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; font-size: 13px; padding: 8px; }

/* ---------- 标题页 ---------- */
.title-bg { background: linear-gradient(180deg, #070b1c 0%, #1a2446 60%, #3a2f56 100%); }
.title-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 35%, rgba(232, 184, 79, .18), transparent 55%), linear-gradient(180deg, rgba(7, 11, 28, .35), rgba(7, 11, 28, .85)); }
.title-wrap { position: relative; z-index: 2; height: 100%; max-width: 760px; margin: 0 auto; padding: 6vh 24px 2vh; display: flex; flex-direction: column; align-items: center; text-align: center; overflow-y: auto; }
.eyebrow { margin: 0 0 8px; color: var(--gold); letter-spacing: .22em; font-size: 12px; text-transform: uppercase; }
.title-wrap h1 { margin: 4px 0 0; font-family: var(--serif); font-size: clamp(40px, 8vw, 76px); font-weight: 700; letter-spacing: .08em; text-shadow: 0 4px 30px rgba(0, 0, 0, .6); }
.subtitle { margin: 6px 0 18px; font-family: var(--serif); font-style: italic; font-size: clamp(18px, 3vw, 26px); color: #f1dfb0; }
.tagline { max-width: 520px; margin: 0 0 24px; color: var(--muted); line-height: 1.75; font-size: 15px; }
.title-actions { margin-bottom: 26px; }
.chapter-list { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 10px; }
.chapter-item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 18px; text-align: left; border-radius: 14px; background: rgba(15, 21, 44, .72); border: 1px solid var(--panel-line); min-height: 64px; transition: background .2s, border-color .2s; backdrop-filter: blur(6px); }
.chapter-item:not(:disabled):hover { background: rgba(32, 42, 82, .85); border-color: rgba(232, 184, 79, .55); }
.chapter-item:disabled { opacity: .55; cursor: not-allowed; }
.chapter-no { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(232, 184, 79, .16); color: var(--gold); font-weight: 700; font-family: var(--serif); }
.chapter-meta { flex: 1; min-width: 0; }
.chapter-meta b { display: block; font-family: var(--serif); font-size: 18px; font-weight: 600; }
.chapter-meta span { color: var(--muted); font-size: 13px; }
.chapter-state { flex: none; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.chapter-state.passed { color: #8fd8ae; }
.chapter-state svg { width: 16px; height: 16px; }
.title-foot { margin-top: auto; padding-top: 18px; }
.music-credit { margin: 0; padding: 0 0 6px; font-size: 11px; color: var(--muted); opacity: .6; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 380px) { .music-credit { font-size: 10px; } }

/* ---------- 游戏页 ---------- */
.scene-bg { transition: opacity .6s; animation: drift 50s ease-in-out infinite alternate; transform-origin: 50% 40%; }
@keyframes drift { from { transform: scale(1.02); } to { transform: scale(1.09) translateX(-1%); } }
.scene-shade { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 40%, transparent 45%, rgba(0, 0, 0, .45) 100%), linear-gradient(180deg, rgba(0, 0, 0, .25) 0%, transparent 22%, transparent 55%, rgba(5, 8, 20, .55) 100%); }
.topbar { position: absolute; top: 0; left: 0; right: 0; z-index: 12; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; }
.chapter-name { font-family: var(--serif); font-size: 15px; color: #f1e8cf; text-shadow: 0 1px 8px rgba(0, 0, 0, .8); text-align: center; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; gap: 8px; }
.hint { position: absolute; top: 58px; left: 50%; transform: translateX(-50%); z-index: 12; font-size: 13px; padding: 7px 16px; border-radius: 999px; background: rgba(10, 14, 30, .66); color: #e9e2cc; border: 1px solid var(--panel-line); transition: opacity .8s; white-space: nowrap; max-width: 94vw; overflow: hidden; text-overflow: ellipsis; }
.hint.off { opacity: 0; pointer-events: none; }

.sprites { position: absolute; left: 0; right: 0; top: 0; bottom: calc(var(--dlg-h) - 34px); z-index: 5; pointer-events: none; }
.sprite { position: absolute; bottom: 0; max-height: calc(100% - 70px); width: auto; max-width: 34vw; object-fit: contain; opacity: 0; transform: translateY(10px); transition: opacity .35s, transform .35s, filter .35s; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .55)); }
.sprite { -webkit-mask-image: linear-gradient(#000 82%, transparent 100%); mask-image: linear-gradient(#000 82%, transparent 100%); }
.sprite.left { left: 5vw; }
.sprite.right { right: 5vw; }
.sprite.show { opacity: 1; transform: none; }
.sprite.dim { opacity: .92; filter: brightness(.42) saturate(.6) drop-shadow(0 8px 18px rgba(0, 0, 0, .55)); transform: none; }

.dialog { max-height: calc(100vh - 28px); position: absolute; z-index: 10; left: 50%; bottom: 20px; transform: translateX(-50%); width: min(980px, calc(100% - 32px)); min-height: 150px; padding: 30px 28px 24px; border-radius: 20px; background: var(--panel); border: 1px solid var(--panel-line); box-shadow: 0 18px 50px rgba(0, 0, 0, .55); backdrop-filter: blur(10px); }
.speaker { position: absolute; top: -17px; left: 24px; min-width: 80px; padding: 6px 18px; border-radius: 10px; font-weight: 700; font-size: 15px; letter-spacing: .06em; background: var(--gold); color: #241a05; box-shadow: 0 4px 14px rgba(0, 0, 0, .4); }
.speaker.THEO { background: #f2b84b; }
.speaker.CRANE { background: #9bbbe0; color: #10223c; }
.speaker.SAM { background: #7ed6c4; color: #08302a; }
.speaker.NARRATION { display: none; }
.dlg-body { max-height: calc(100vh - 140px); overflow-y: auto; font-family: var(--serif); font-size: clamp(18px, 2.2vw, 23px); line-height: 1.7; min-height: 3.4em; padding-right: 88px; padding-bottom: 34px; cursor: pointer; }
.dlg-body.narration { font-style: italic; color: #dcd7e8; }
.dlg-text { white-space: pre-wrap; user-select: text; -webkit-user-select: text; cursor: text; }
.tr-btn { position: absolute; right: 16px; top: 14px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--panel-line); background: rgba(255, 255, 255, .06); font-family: var(--sans); font-size: 14px; }
.tr-btn:hover { background: rgba(232, 184, 79, .25); }
.next-btn { position: absolute; right: 16px; bottom: 10px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(232, 184, 79, .55); background: rgba(232, 184, 79, .14); color: var(--gold); font-size: 14px; font-weight: 600; }
.next-btn:hover { background: rgba(232, 184, 79, .3); }
.dialog.choosing > .dlg-body, .dialog.choosing > .tr-btn, .dialog.choosing > .spk, .dialog.choosing > .next-btn { display: none; }
.choices { display: none; gap: 10px; flex-direction: column; max-height: calc(100vh - 110px); overflow-y: auto; overflow-x: hidden; }
.dialog.choosing .choices { display: flex; }
.choice-hint { margin: 0 0 2px; font-size: 13px; color: var(--muted); }
.choice { position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 52px 10px 16px; text-align: left; border-radius: 14px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(232, 184, 79, .45); font-family: var(--serif); font-size: clamp(17px, 2vw, 21px); line-height: 1.45; cursor: pointer; transition: background .15s, border-color .15s; }
.choice:hover { background: rgba(232, 184, 79, .2); border-color: rgba(243, 200, 102, .95); }
.choice .num { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font: 700 15px var(--sans); background: var(--gold); color: #241a05; border: 0; }
.choice .num:hover { background: #f3c866; }
.choice .ctext { flex: 0 1 auto; user-select: text; -webkit-user-select: text; cursor: text; }
.choice .tr-btn { top: 8px; right: 8px; width: 34px; height: 34px; }
.end-card { position: absolute; z-index: 11; left: 50%; bottom: 50%; transform: translate(-50%, 50%); text-align: center; padding: 26px 34px; border-radius: 20px; background: var(--panel); border: 1px solid var(--panel-line); box-shadow: 0 18px 50px rgba(0, 0, 0, .55); }
.end-card p { margin: 0 0 14px; font-family: var(--serif); font-size: 22px; }

/* ---------- 回看 ---------- */
.history { position: absolute; z-index: 30; top: 0; right: 0; bottom: 0; width: min(440px, 100%); display: flex; flex-direction: column; background: rgba(11, 16, 34, .97); border-left: 1px solid var(--panel-line); box-shadow: -12px 0 40px rgba(0, 0, 0, .5); }
.history-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--panel-line); }
.history-list { flex: 1; overflow-y: auto; padding: 14px 18px 24px; }
.h-item { margin-bottom: 14px; font-family: var(--serif); font-size: 17px; line-height: 1.6; }
.h-item .h-who { display: block; font: 700 12px var(--sans); letter-spacing: .08em; color: var(--gold); margin-bottom: 2px; }
.h-item.NARRATION .h-text { font-style: italic; color: #cfcbe0; }
.h-text { user-select: text; -webkit-user-select: text; }

/* ---------- 浮层（查词 / 句子讲解） ---------- */
.pop { overflow-y: auto; overscroll-behavior: contain; position: fixed; z-index: 60; width: max-content; max-width: min(360px, calc(100vw - 16px)); padding: 12px 16px 13px; border-radius: 14px; background: var(--paper); color: var(--paper-ink); border: 1px solid #d8cdb0; box-shadow: 0 12px 34px rgba(0, 0, 0, .5); font-family: var(--sans); line-height: 1.55; animation: popin .14s ease-out; }
@keyframes popin { from { opacity: 0; transform: translateY(4px) scale(.97); } }
.pop::after { content: ""; position: absolute; left: var(--ax, 50%); width: 12px; height: 12px; margin-left: -6px; background: var(--paper); border: 1px solid #d8cdb0; transform: rotate(45deg); }
.pop.above::after { bottom: -7px; border-top: 0; border-left: 0; }
.pop.below::after { top: -7px; border-bottom: 0; border-right: 0; }
.pop .p-word { font-family: var(--serif); font-size: 20px; font-weight: 700; color: #3a2a70; }
.pop .p-ipa { margin-left: 8px; font-size: 14px; color: #6b6585; }
.pop .p-pos { display: inline-block; margin: 4px 8px 0 0; padding: 0 7px; border-radius: 6px; background: #eadfbd; font-size: 12px; font-weight: 700; color: #6a4f0b; }
.pop .p-zh { margin-top: 2px; font-size: 16px; font-weight: 600; }
.pop .p-form { margin-top: 4px; font-size: 13px; color: #6b6585; }
.pop .p-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: #8a6a14; margin-top: 8px; }
.pop .p-s-next { margin-top: 10px; padding-top: 8px; border-top: 1px dashed #d8cdb0; }
.pop .p-en { font-family: var(--serif); font-style: italic; font-size: 14px; color: #6b6585; }
.pop .p-sel { font-family: var(--serif); font-style: italic; font-size: 14px; color: #6b6585; padding-bottom: 6px; border-bottom: 1px dashed #d8cdb0; margin-bottom: 6px; }
.pop .p-zhs { font-size: 16px; font-weight: 600; }
.pop .p-note { font-size: 14.5px; margin-top: 2px; }
.pop-sent { max-width: min(420px, calc(100vw - 16px)); }

/* ---------- 测验页 ---------- */
.quiz-bg { background: linear-gradient(180deg, #0c1230, #1b2547 70%, #2a2a50); }
.quiz-scroll { position: absolute; inset: 0; overflow-y: auto; padding: 4vh 16px 6vh; }
.quiz-card { max-width: 820px; margin: 0 auto; padding: 28px 30px 32px; border-radius: 22px; background: var(--paper); color: var(--paper-ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.quiz-card .eyebrow { color: #8a6a14; }
.quiz-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 14px; }
.quiz-head .chip { white-space: nowrap; flex: none; }
.quiz-head h2 { margin: 0; font-family: var(--serif); font-size: 30px; }
.quiz-rule { margin: 4px 0 0; color: #5d5877; font-size: 14px; }
.q { padding: 18px 0; border-top: 1px solid #e2d8bd; }
.q-stem { font-family: var(--serif); font-size: 20px; font-weight: 600; line-height: 1.5; margin: 0 0 10px; }
.q-stem .qn { color: #8a6a14; margin-right: 6px; }
.q-opts { display: grid; gap: 8px; }
.q-opt { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 8px 14px; border-radius: 12px; border: 1.5px solid #d8cdb0; background: #fffdf6; font-family: var(--serif); font-size: 18px; text-align: left; cursor: pointer; transition: background .15s, border-color .15s; }
.q-opt:hover { background: #f6ecd0; }
.q-opt .ltr { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 700 14px var(--sans); background: #eadfbd; color: #6a4f0b; border: 0; cursor: pointer; }
.q-opt.selected { border-color: #3a2a70; background: #ece7fb; }
.q-opt.selected .ltr { background: #3a2a70; color: #fff; }
.q-opt .otext { user-select: text; -webkit-user-select: text; flex: 0 1 auto; cursor: text; }
.q-opt .mark { flex: none; margin-left: auto; font: 700 13px var(--sans); }
.q-tr { position: static; margin-left: 8px; width: 30px; height: 30px; flex: none; color: #3a2a70; border-color: #cfc4a8; vertical-align: middle; }
.q-opt.correct { border-color: var(--good); background: #e4f4ea; }
.q-opt.wrong { border-color: var(--bad); background: #fbe7e4; }
.q-opt.correct .mark { color: var(--good); }
.q-opt.wrong .mark { color: var(--bad); }
.locked .q-opt { cursor: default; }
.q-why { margin-top: 10px; padding: 10px 14px; border-radius: 12px; background: #f4ecd6; font-size: 15px; line-height: 1.65; }
.q-why .zh-stem { color: #5d5877; font-size: 14px; }
.quiz-result { margin: 8px 0 4px; padding: 18px 20px; border-radius: 16px; text-align: center; font-size: 17px; }
.quiz-result.pass { background: #e4f4ea; color: #1d5b3a; }
.quiz-result.fail { background: #fbe7e4; color: #7e2b25; }
.quiz-result b { display: block; font-family: var(--serif); font-size: 40px; line-height: 1.2; }
.quiz-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }

/* ---------- 转场 ---------- */
.fade { position: absolute; inset: 0; z-index: 90; background: #04060f; opacity: 0; pointer-events: none; transition: opacity .45s ease; }
.fade.on { opacity: 1; pointer-events: all; }

/* ---------- 窄屏 ---------- */
@media (max-width: 720px) {
  .dialog { bottom: 10px; padding: 26px 16px 18px; width: calc(100% - 16px); }
  .speaker { left: 14px; }
  .sprite { max-width: 46vw; }
  .sprite.left { left: 0; } .sprite.right { right: 0; }
  .hint { top: 54px; font-size: 12px; }
  .chapter-name { font-size: 13px; }
  .quiz-card { padding: 20px 16px 24px; }
  .quiz-head { flex-direction: column; }
  .q-stem { font-size: 18px; } .q-opt { font-size: 16px; }
  .title-wrap h1 { letter-spacing: .03em; }
}
@media (prefers-reduced-motion: reduce) {
  .scene-bg { animation: none; }
  * { transition-duration: .01s !important; }
}

/* 点了选项/测验选项的文字：让编号（字母）按钮脉冲一下，提醒「点这里选」 */
@keyframes pulse { 0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(232, 184, 79, .85); } 40% { transform: scale(1.3); box-shadow: 0 0 0 10px rgba(232, 184, 79, .25); } 100% { transform: scale(1); box-shadow: 0 0 0 16px rgba(232, 184, 79, 0); } }
.pulse { animation: pulse .7s ease-out 1; }

/* ---------- 音乐音量滑条 ---------- */
.vol-range { -webkit-appearance: none; appearance: none; width: 130px; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .28); outline-offset: 6px; cursor: pointer; vertical-align: middle; }
.vol-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--gold); border: 2px solid #241a05; box-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
.vol-range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--gold); border: 2px solid #241a05; }
.vol-range:disabled { opacity: .35; cursor: not-allowed; }
.vol-range:disabled::-webkit-slider-thumb { background: #8a8a94; }
.vol-val { display: inline-block; min-width: 3em; text-align: right; font-size: 13px; color: var(--muted); }
.vol-inline { display: inline-flex; align-items: center; gap: 8px; margin: 0 6px; font-size: 13px; color: var(--muted); }
.vol-inline.off, .vol-wrap.off .vol-panel { opacity: .6; }
.title-foot { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; }
.title-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.vol-wrap { position: relative; display: inline-block; }
.vol-panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--panel-line); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); white-space: nowrap; font-size: 13px; color: var(--text); }
.vol-panel .vol-range { width: 120px; }

/* ---------- 生词：浮层按钮 ---------- */
.pop .p-vocab { margin-top: 8px; }
.pop .p-add { min-height: 34px; padding: 0 14px; border-radius: 999px; border: 1.5px solid #3a2a70; background: transparent; color: #3a2a70; font: 700 14px var(--sans); }
.pop .p-add:hover { background: #ece7fb; }
.pop .p-add.on { background: #3a2a70; color: #fff; }

/* ---------- 生词表面板（沿用米白纸面卡片） ---------- */
.btn-sm { min-height: 38px; padding: 0 16px; font-size: 14px; }
.btn-danger { background: var(--bad); color: #fff; }
.vocab { position: absolute; inset: 0; z-index: 40; overflow-y: auto; padding: 4vh 16px 6vh; background: rgba(4, 6, 15, .82); }
.vocab-card { max-width: 760px; margin: 0 auto; padding: 24px 26px 28px; border-radius: 22px; background: var(--paper); color: var(--paper-ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.vocab-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.vocab-head h2 { margin: 0; font-family: var(--serif); font-size: 28px; }
.vocab-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0 6px; }
.vocab-card .btn-ghost { border-color: #c9bfa6; color: var(--paper-ink); }
.vocab-card .btn-ghost:hover:not(:disabled) { background: #efe7d3; }
.vocab-card .btn:disabled { opacity: .45; cursor: not-allowed; }
.vocab-ask { font-size: 14px; color: var(--bad); font-weight: 600; }
.v-empty { margin: 26px 4px; color: #5d5877; line-height: 1.8; font-size: 15px; }
.v-item { padding: 14px 0; border-top: 1px solid #e2d8bd; }
.v-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.v-word { font-family: var(--serif); font-size: 22px; font-weight: 700; color: #3a2a70; }
.v-ipa { font-size: 14px; color: #6b6585; }
.v-form { font-size: 12px; color: #8a6a14; }
.v-del { margin-left: auto; min-height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid #d8cdb0; background: #fffdf6; color: #7e2b25; font-size: 13px; }
.v-del:hover { background: #fbe7e4; }
.v-mean { margin-top: 2px; }
.v-pos { display: inline-block; margin-right: 8px; padding: 0 7px; border-radius: 6px; background: #eadfbd; font-size: 12px; font-weight: 700; color: #6a4f0b; }
.v-zh { font-size: 16px; font-weight: 600; }
.v-sent { margin-top: 6px; font-family: var(--serif); font-style: italic; font-size: 16px; line-height: 1.55; }
.v-sent mark { background: #f6df9a; color: inherit; border-radius: 3px; padding: 0 2px; font-style: normal; font-weight: 700; }
.v-sentzh { font-size: 14px; color: #5d5877; }
.v-src { margin-top: 2px; font-size: 12px; color: #8a8499; }

@media (max-width: 720px) {
  .topbar { padding: 10px 8px; gap: 6px; }
  .topbar .chip { padding: 0 9px; font-size: 13px; min-height: 34px; }
  .topbar-right { gap: 5px; }
}
@media (max-width: 520px) { .chapter-name { display: none; } .topbar { justify-content: space-between; } .vocab-card { padding: 18px 14px 22px; } .vol-range { width: 100px; } }

/* ---------- 语音朗读：小喇叭 + 声音面板里的语音开关 ---------- */
.spk { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--panel-line); background: rgba(255, 255, 255, .06); color: var(--gold); display: inline-grid; place-items: center; padding: 0; cursor: pointer; }
.spk svg { width: 20px; height: 20px; }
.spk:hover:not(:disabled) { background: rgba(232, 184, 79, .25); }
.spk:disabled { opacity: .35; cursor: not-allowed; }
.spk[hidden] { display: none; }
.dialog > .spk { position: absolute; right: 60px; top: 14px; }
.h-who .spk-hist { width: 28px; height: 28px; margin-left: 8px; vertical-align: middle; }
.h-who .spk-hist svg { width: 16px; height: 16px; }
.pop .p-spk { display: flex; align-items: center; gap: 8px; margin: 2px 0 4px; }
.pop .spk-pop { width: 32px; height: 32px; border: 1.5px solid #3a2a70; background: transparent; color: #3a2a70; }
.pop .spk-pop:hover:not(:disabled) { background: #ece7fb; }
.pop .p-spk-t { font-size: 12px; color: #6b6585; }
/* 单词发音喇叭（生词表词头一行、查词浮层词头一行）：样式和句子旁的小喇叭同源（圆形描边喇叭），负外边距让它不撑高现有行高 */
.spk-word, .spk-sent { width: 28px; height: 28px; margin: -3px 0 -3px 4px; vertical-align: middle; align-self: center; border: 1.5px solid #3a2a70; background: transparent; color: #3a2a70; }
.spk-word svg, .spk-sent svg { width: 16px; height: 16px; }
.spk-word:hover:not(:disabled), .spk-sent:hover:not(:disabled) { background: #ece7fb; }
.spk-word:active:not(:disabled), .spk-sent:active:not(:disabled) { transform: scale(.92); }
.spk-word.playing { background: #3a2a70; color: #fff; animation: spkpulse 1s ease-in-out infinite; }
.spk-word.nosound { border-style: dashed; border-color: #8a8499; color: #8a8499; background: transparent; }
.spk-word:focus-visible, .spk-sent:focus-visible { outline: 2px solid #8a6a14; outline-offset: 2px; }
.spk-sent { margin: 0; width: 24px; height: 24px; }
.v-sent.has-spk { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.v-sent.has-spk .spk-sent { flex: none; align-self: flex-start; }
.pop .spk-word { margin-left: 8px; }
.v-top .spk-word { align-self: baseline; margin: -2px 0 -6px 4px; }      /* 词头行：和词/音标同一条基线，不撑高行 */
@media (max-width: 400px) { .v-top { gap: 4px 6px; } .v-top .spk-word { margin-left: 0; } .v-form { font-size: 11.5px; } .v-del { padding: 0 10px; } }
@keyframes spkpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(58, 42, 112, .35); } 50% { box-shadow: 0 0 0 5px rgba(58, 42, 112, 0); } }
@media (prefers-reduced-motion: reduce) { .spk-word.playing { animation: none; box-shadow: 0 0 0 3px rgba(58, 42, 112, .3); } }
@media (pointer: coarse), (max-width: 720px) {      /* 手机：可见圆圈和桌面一样大（28/24px），点击区域用透明伪元素扩到 44×44（不占布局、不改行高） */
  .spk-word, .spk-sent { position: relative; }
  .spk-word::after, .spk-sent::after { content: ""; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); border-radius: 50%; }
}
.vol-panel { flex-direction: column; align-items: stretch; gap: 10px; }
.vol-panel .vol-row { display: flex; align-items: center; gap: 10px; }
.vol-panel .vol-row > span:first-child { flex: 1; }
.vol-panel .chip:disabled { opacity: .4; cursor: not-allowed; }


/* =====================================================================
   手机适配（触屏）。原则：电脑端（鼠标）的外观和行为不变；尺寸类调整只在 (pointer: coarse) / 窄屏 / 短屏下生效。
   ===================================================================== */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
/* 禁掉双击放大（轻点立刻响应），但不禁用户双指缩放 */
* { touch-action: manipulation; }
.vol-range { touch-action: pan-y; }
.safe-probe { position: fixed; left: 0; top: 0; width: 0; height: 0; visibility: hidden; pointer-events: none; padding: var(--sat) var(--sar) var(--sab) var(--sal); }

/* 手机地址栏伸缩：用 dvh，不支持的浏览器保持原来的 vh/inset */
@supports (height: 100dvh) {
  #app { height: 100dvh; bottom: auto; }
}

/* 刘海 / 底部横条 */
.topbar { padding-top: calc(12px + var(--sat)); padding-left: calc(16px + var(--sal)); padding-right: calc(16px + var(--sar)); }
.hint { top: calc(58px + var(--sat)); }
.sprites { bottom: calc(var(--dlg-h) - 34px + var(--sab)); }
.dialog { bottom: calc(20px + var(--sab)); left: calc(50% + (var(--sal) - var(--sar)) / 2); width: min(980px, calc(100% - 32px - var(--sal) - var(--sar))); max-height: calc(100vh - 28px - var(--sat) - var(--sab)); }
.dlg-body { max-height: calc(100vh - 140px - var(--sat) - var(--sab)); }
.choices { max-height: calc(100vh - 110px - var(--sat) - var(--sab)); }
@supports (height: 100dvh) {
  .dialog { max-height: calc(100dvh - 28px - var(--sat) - var(--sab)); }
  .dlg-body { max-height: calc(100dvh - 140px - var(--sat) - var(--sab)); }
  .choices { max-height: calc(100dvh - 110px - var(--sat) - var(--sab)); }
}
.title-wrap { padding-top: calc(6vh + var(--sat)); padding-bottom: calc(2vh + var(--sab)); padding-left: calc(24px + var(--sal)); padding-right: calc(24px + var(--sar)); }
.quiz-scroll, .vocab { padding-top: calc(4vh + var(--sat)); padding-bottom: calc(6vh + var(--sab)); padding-left: calc(16px + var(--sal)); padding-right: calc(16px + var(--sar)); }
.history { padding-top: var(--sat); padding-bottom: var(--sab); padding-right: var(--sar); }
.end-card { max-width: calc(100% - 24px); }

@media (max-width: 720px) {
  .topbar { padding: calc(10px + var(--sat)) calc(8px + var(--sar)) 10px calc(8px + var(--sal)); }
  .dialog { bottom: calc(10px + var(--sab)); width: calc(100% - 16px - var(--sal) - var(--sar)); }
  .hint { top: calc(54px + var(--sat)); }
}

/* 竖屏手机：横版背景图 cover 裁成竖条，--bg-pos 决定留哪一块（默认偏右上，避开被对话框盖住的下半截） */
@media (max-aspect-ratio: 4/5) {
  #app { --bg-pos: 62% 30%; }
  .sprite { max-width: 44vw; }
}

html[data-input="touch"] .h-m { display: none; }
html:not([data-input="touch"]) .h-t { display: none; }

/* 触屏：点击区域 ≥44×44，且彼此不重叠 */
@media (pointer: coarse) {
  .chip, .topbar .chip { min-height: 44px; min-width: 44px; }
  .btn-sm { min-height: 44px; }
  .link-btn { min-height: 44px; padding: 0 12px; }
  .hint { white-space: normal; text-align: center; border-radius: 16px; width: max-content; max-width: calc(100% - 24px); line-height: 1.5; }

  /* 对话框：按钮排在底部一行（喇叭、译、下一句），文字用满整行宽度 */
  .dlg-body { padding-right: 0; padding-bottom: 58px; }
  .dialog > .tr-btn, .tr-btn { width: 44px; height: 44px; }
  .dialog > .tr-btn { top: auto; bottom: 10px; right: 120px; }
  .dialog > .spk { top: auto; bottom: 10px; right: 172px; width: 44px; height: 44px; }
  .next-btn { min-height: 44px; min-width: 100px; right: 12px; bottom: 10px; }

  .choice { padding: 6px 60px 6px 8px; min-height: 56px; }
  .choice .num { width: 44px; height: 44px; font-size: 17px; }
  .choice .tr-btn { top: 6px; right: 6px; width: 44px; height: 44px; }
  .q-opt { padding: 6px 10px 6px 8px; min-height: 56px; }
  .q-opt .ltr { width: 44px; height: 44px; font-size: 16px; }
  .q-tr { width: 44px; height: 44px; margin-left: 4px; }
  .quiz-head .chip { align-self: flex-start; }

  .pop .p-add { min-height: 44px; padding: 0 18px; }
  .pop .spk-pop { width: 44px; height: 44px; }
  .h-who .spk-hist { width: 44px; height: 44px; margin-left: 4px; }
  .v-del { min-height: 44px; min-width: 56px; }

  /* 滑条：命中区 44px 高，细轨道画在里面 */
  .vol-range { height: 44px; background: transparent; width: 150px; }
  .vol-range::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .28); }
  .vol-range::-moz-range-track { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .28); }
  .vol-range::-webkit-slider-thumb { margin-top: -7px; width: 22px; height: 22px; }
  .vol-panel .vol-range { width: 130px; }
  .vol-panel .vol-row { min-height: 44px; }

  /* 悬停样式在触屏上会「粘住」：点完一直亮着，去掉 */
  .choice:hover { background: rgba(255, 255, 255, .07); border-color: rgba(232, 184, 79, .45); }
  .q-opt:hover { background: #fffdf6; }
  .q-opt.selected:hover { background: #ece7fb; }
  .btn-primary:hover:not(:disabled) { background: var(--gold); transform: none; }
  .chip:hover { background: rgba(10, 14, 30, .62); }
  .chip-light:hover { background: #efe7d3; }
}

/* 窄屏：音量面板脱离顶栏按钮，固定在顶栏下方、不会被挤出屏幕左边 */
@media (max-width: 520px) {
  .vol-wrap { position: static; }
  .vol-panel { position: fixed; top: calc(var(--sat) + 60px); right: calc(8px + var(--sar)); left: auto; max-width: calc(100vw - 16px - var(--sal) - var(--sar)); }
  .topbar .chip { padding: 0 7px; }
}
@media (max-width: 380px) { .topbar { gap: 4px; } .topbar-right { gap: 3px; } .topbar .chip { padding: 0 6px; font-size: 12.5px; } }

/* 横屏手机（矮屏）：压缩留白，让对话框、选项、立绘都装得下 */
@media (max-height: 480px) and (orientation: landscape) {
  .dialog { min-height: 0; padding: 24px 18px 12px; }
  .dlg-body { font-size: 17px; line-height: 1.55; min-height: 2.6em; }
  .choice { min-height: 48px; font-size: 16px; }
  .quiz-scroll, .vocab { padding-top: calc(10px + var(--sat)); padding-bottom: calc(14px + var(--sab)); }
  .title-wrap { padding-top: calc(10px + var(--sat)); }
  .title-wrap h1 { font-size: 34px; }
  .tagline { margin-bottom: 14px; }
  .hint { display: none; }
}


/* ---------- 留邮箱（最后一关结算页，仅 http/https） ---------- */
.notify { margin: 22px 0 6px; padding: 18px 20px 14px; border-radius: 16px; background: #f4ecd6; border: 1px solid #e2d8bd; }
.notify h3 { margin: 0 0 4px; font-family: var(--serif); font-size: 21px; }
.notify p { margin: 0 0 10px; font-size: 14.5px; line-height: 1.6; color: #5d5877; }
.notify-form { display: flex; flex-wrap: wrap; gap: 10px; }
.notify-form input { flex: 1 1 200px; min-width: 0; min-height: 46px; padding: 0 14px; border-radius: 12px; border: 1.5px solid #cfc4a8; background: #fffdf6; color: var(--paper-ink); font: 16px var(--sans); }   /* 16px：iOS 聚焦时小于 16px 会自动放大整页 */
.notify-form input:focus { outline: 3px solid var(--gold); outline-offset: 1px; border-color: #3a2a70; }
.notify-form .btn { flex: none; }
.notify-msg { margin: 8px 0 0; min-height: 1.5em; font-size: 14px; color: var(--bad); }
.notify-done { margin: 0; font-weight: 600; color: #1d5b3a; font-size: 16px; }
/* 软键盘弹出时底部多留一屏，输入框和按钮才有地方滚上来；首次聚焦后一直保留到离开测验页（中途收回会让按钮在手指下移位） */
.quiz-scroll.kb { padding-bottom: calc(60vh + var(--sab)); }

/* 游戏名：中文大字 + 英文小一号另起一行 */
.title-wrap h1 .t-en { display: block; margin-top: 2px; font-size: .42em; font-style: italic; font-weight: 400; letter-spacing: .12em; color: #f1dfb0; }
/* 标题页末尾「敬请期待」：不可点的占位格，比锁着的关更淡，没有锁图标 */
.chapter-soon { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 18px; min-height: 64px; border-radius: 14px; border: 1px dashed rgba(255, 255, 255, .16); background: rgba(15, 21, 44, .35); color: var(--muted); opacity: .42; list-style: none; cursor: default; text-align: left; user-select: none; }
.chapter-soon .chapter-no { opacity: .7; }
/* 结算页「故事未完」：和下面留邮箱块是一组（同色纸片，接在一起，只有上方留白） */
.tbc { margin: 22px 0 0; padding: 18px 20px 12px; border-radius: 16px 16px 0 0; background: #f4ecd6; border: 1px solid #e2d8bd; border-bottom: 0; text-align: center; }
.tbc h3 { margin: 0 0 4px; font-family: var(--serif); font-size: 22px; letter-spacing: .06em; }
.tbc p { margin: 0 0 6px; font-size: 14.5px; line-height: 1.6; color: #5d5877; }
.tbc + .notify { margin-top: 0; border-radius: 0 0 16px 16px; border-top: 1px dashed #cfc4a8; }
.tbc:not([hidden]):not(:has(+ .notify:not([hidden]))) { border-radius: 16px; border-bottom: 1px solid #e2d8bd; padding-bottom: 14px; margin-bottom: 6px; }


/* =====================================================================
   多本书：书架 / 书页 / 新说话人 / 回忆 / 证据卡 / 测验进度
   ===================================================================== */
.speaker:empty { display: none; }

/* ---------- 书架（首页） ---------- */
.shelf-wrap { position: relative; z-index: 2; height: 100%; max-width: 1180px; margin: 0 auto; overflow-y: auto; overflow-x: hidden; text-align: center; display: flex; flex-direction: column; align-items: center;
  padding: calc(5vh + var(--sat)) calc(20px + var(--sar)) calc(2vh + var(--sab)) calc(20px + var(--sal)); }
.shelf-head { flex: none; width: 100%; display: flex; flex-direction: column; align-items: center; }
.shelf-wrap h1 { margin: 4px 0 0; font-family: var(--serif); font-size: clamp(38px, 7vw, 68px); font-weight: 700; letter-spacing: .08em; text-shadow: 0 4px 30px rgba(0, 0, 0, .6); }
.shelf-wrap h1 .t-en { display: block; margin-top: 2px; font-size: .42em; font-style: italic; font-weight: 400; letter-spacing: .12em; color: #f1dfb0; }
.shelf-head .tagline { margin-bottom: 14px; }
.shelf-head .title-actions { margin-bottom: 22px; }
.shelf-list { list-style: none; margin: 0 auto; padding: 0 0 8px; width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 210px)); justify-content: center; gap: 26px 22px; align-items: start; }
.shelf-item { min-width: 0; }
.book-card { position: relative; display: flex; flex-direction: column; width: 100%; padding: 0; text-align: left; background: none; border: 0; border-radius: 12px; color: inherit; cursor: pointer; transition: transform .18s; }
.book-card:not(:disabled):hover { transform: translateY(-4px); }
.book-card:not(:disabled):active { transform: translateY(-1px) scale(.99); }
.book-card:disabled { cursor: not-allowed; }
.book-cover { position: relative; display: block; width: 100%; aspect-ratio: 3 / 4; border-radius: 4px 12px 12px 4px; overflow: hidden; background: linear-gradient(160deg, var(--c1, #0b1a3a), var(--c2, #3a2f56));
  box-shadow: 0 14px 28px rgba(0, 0, 0, .55), 0 2px 0 rgba(255, 255, 255, .06) inset, 6px 0 0 -2px rgba(0, 0, 0, .35) inset; }
.book-cover::before { content: ""; position: absolute; z-index: 3; left: 0; top: 0; bottom: 0; width: 9px; background: linear-gradient(90deg, rgba(0, 0, 0, .4), rgba(255, 255, 255, .1) 60%, transparent); pointer-events: none; }
.bc-art { position: absolute; inset: 0; opacity: .95; }
.motif-moon .bc-art { background:
  radial-gradient(circle at 72% 26%, var(--ac) 0 11%, transparent 11.5%),
  radial-gradient(circle at 72% 26%, color-mix(in srgb, var(--ac) 28%, transparent) 0 22%, transparent 23%),
  radial-gradient(circle at 20% 18%, #fff 0 1.2%, transparent 1.6%), radial-gradient(circle at 38% 34%, #fff 0 .9%, transparent 1.4%),
  radial-gradient(circle at 12% 46%, #fff 0 1%, transparent 1.5%), radial-gradient(circle at 54% 12%, #fff 0 1.1%, transparent 1.6%),
  linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, .38)); }
.motif-plane .bc-art { background:
  linear-gradient(115deg, transparent 0 42%, color-mix(in srgb, var(--ac) 70%, transparent) 42.4% 43.2%, transparent 43.6%),
  repeating-linear-gradient(105deg, transparent 0 14px, rgba(255, 255, 255, .09) 14px 15px),
  radial-gradient(ellipse 22% 14% at 68% 28%, transparent 0 62%, var(--ac) 64% 70%, transparent 72%),
  linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, .42)); }
.bc-title { position: absolute; z-index: 2; left: 16px; right: 12px; bottom: 16px; display: block; }
.bc-title b { display: block; font-family: var(--serif); font-size: clamp(20px, 2.4vw, 27px); line-height: 1.2; letter-spacing: .04em; color: #fbf3dc; text-shadow: 0 2px 10px rgba(0, 0, 0, .7); }
.bc-title i { display: block; margin-top: 4px; font-family: var(--serif); font-size: 12px; color: var(--ac); letter-spacing: .06em; text-shadow: 0 1px 6px rgba(0, 0, 0, .7); }
.bc-img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.book-cover.has-img .bc-title, .book-cover.has-img .bc-art { display: none; }
.bc-ribbon { position: absolute; z-index: 4; top: 12px; right: 0; padding: 5px 12px 5px 14px; border-radius: 999px 0 0 999px; background: rgba(10, 14, 30, .86); color: #f1dfb0; border: 1px solid rgba(241, 223, 176, .5); border-right: 0; font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.book-card.soon .book-cover { filter: brightness(.94); container-type: inline-size; }
.bc-q { position: absolute; z-index: 3; left: 0; right: 0; top: 17%; text-align: center; font-family: var(--serif); font-weight: 700; font-size: 52cqw; line-height: 1; color: var(--ac, #d9a441); opacity: .6; text-shadow: 0 0 34px color-mix(in srgb, var(--ac, #d9a441) 45%, transparent); pointer-events: none; user-select: none; }
.book-info { display: block; padding: 12px 4px 4px; }
.bk-zh { display: block; font-family: var(--serif); font-size: 18px; line-height: 1.3; }
.bk-en { display: block; margin-top: 1px; font-family: var(--serif); font-size: 12.5px; color: #f1dfb0; }
.bk-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bk-tags:empty { display: none; }
.bk-tag { font-style: normal; font-size: 12px; font-weight: 700; padding: 1px 9px; border-radius: 999px; border: 1px solid rgba(232, 184, 79, .6); color: var(--gold); }
.bk-blurb { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-top: 8px; font-size: 13.5px; line-height: 1.55; color: #dad6e6; }
.bk-diff { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 6px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.bk-prog { display: block; margin-top: 8px; font-size: 13px; font-weight: 700; color: #8fd8ae; }
.book-card.soon .bk-prog { color: var(--muted); }
.shelf-wrap .title-foot { margin-top: 22px; }

/* ---------- 书页 ---------- */
.book-back { position: absolute; z-index: 6; top: calc(12px + var(--sat)); left: calc(14px + var(--sal)); min-height: 44px; }
#screen-book .title-wrap { padding-top: calc(60px + var(--sat)); }
.book-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 10px 0 12px; }
.book-tags:empty { display: none; }
.book-diff { max-width: 520px; margin: -12px 0 20px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.book-diff:empty { display: none; }
.book-hint { margin: -10px 0 18px; font-size: 13px; color: var(--muted); }
#screen-book .title-wrap h1 { font-size: clamp(36px, 7vw, 66px); }
#screen-book .title-wrap h1 .t-en { display: block; margin-top: 2px; font-size: .42em; font-style: italic; font-weight: 400; letter-spacing: .12em; color: #f1dfb0; }
.chapter-cp { display: block; margin-top: 2px; color: var(--gold) !important; font-size: 12.5px !important; }
.chapter-load { justify-content: center; }
.chapter-load .btn { margin-left: 8px; }

/* ---------- 纸上的字 PAPER：纸张卡片，打字机/手写感（只用系统字体） ---------- */
.dlg-body.paper { font-style: normal; color: #2a2438; }
.dlg-body.paper .dlg-text { display: block; padding: 12px 16px 12px 18px; border-radius: 4px 10px 6px 8px; background: #f4ecd6; color: #2a2438; border-left: 5px solid #b98a22;
  font-family: "American Typewriter", "Courier Prime", "Courier New", Courier, "Songti SC", monospace; font-size: .92em; letter-spacing: .01em; line-height: 1.6;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .22), inset 0 0 0 1px rgba(120, 90, 40, .22); background-image: repeating-linear-gradient(180deg, transparent 0 1.55em, rgba(120, 90, 40, .11) 1.55em calc(1.55em + 1px)); }
.h-item.is-paper .h-text { display: inline-block; padding: 4px 10px; border-radius: 4px; background: #f4ecd6; color: #2a2438; border-left: 4px solid #b98a22; font-family: "American Typewriter", "Courier New", Courier, monospace; font-size: 15px; }

/* ---------- 无线电 RADIO：只有声音，没有立绘；名牌是荧光绿的小电台 ---------- */
.speaker.radio { background: #10241f; color: #8fe3b0; border: 1px solid #3f8f6a; font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .12em; }
.speaker.radio::before { content: "◉ "; color: #5fe39a; }
.dialog.is-radio { border-color: rgba(95, 227, 154, .35); }

/* ---------- 回忆 FLASHBACK：整个画面（背景+立绘）旧照片色调；背景图停掉缓动（滤镜+动画一起会在手机上费力） ---------- */
.flashback .scene-bg { animation: none; filter: sepia(.85) saturate(.85) contrast(.94) brightness(.96); }
.flashback .sprites { filter: sepia(.85) saturate(.8); }
.flashback .scene-shade { background: radial-gradient(ellipse at 50% 45%, transparent 32%, rgba(60, 35, 10, .62) 100%), linear-gradient(180deg, rgba(40, 24, 8, .3) 0%, transparent 25%, transparent 55%, rgba(30, 18, 6, .55) 100%); }
.flashback .scene-shade::after { content: ""; position: absolute; inset: 0; background: rgba(160, 118, 62, .14); }
.fb-badge { position: absolute; top: -14px; right: 22px; padding: 3px 12px; border-radius: 999px; background: #f4ecd6; color: #5b4217; border: 1px dashed #b98a22; font: 700 12px var(--sans); letter-spacing: .14em; }

/* ---------- 续玩提示 ---------- */
.ro-note { margin: 10px auto; max-width: 440px; padding: 8px 14px; border-radius: 10px; background: rgba(232, 184, 79, .16); border: 1px solid rgba(232, 184, 79, .6); color: var(--gold); font-size: 13px; line-height: 1.5; text-align: left; }
.ro-note[hidden] { display: none; }
.toast { position: absolute; z-index: 13; top: calc(60px + var(--sat)); left: 50%; transform: translateX(-50%); padding: 8px 18px; border-radius: 999px; background: rgba(232, 184, 79, .96); color: #241a05; font-weight: 700; font-size: 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, .4); max-width: calc(100% - 24px); text-align: center; }

/* ---------- 证据卡 [EVIDENCE]：卡片网格，选满才出确认 ---------- */
.evidence { position: absolute; inset: 0; z-index: 11; display: flex; flex-direction: column; padding-top: calc(60px + var(--sat)); background: linear-gradient(180deg, rgba(5, 8, 20, .84), rgba(5, 8, 20, .95)); }
.ev-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px calc(16px + var(--sar)) 14px calc(16px + var(--sal)); }
.ev-head { max-width: 1000px; margin: 0 auto 12px; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; }
.ev-head h2 { margin: 0; font-family: var(--serif); font-size: 24px; }
.ev-count { margin: 0; font-weight: 700; color: var(--gold); font-size: 15px; display: inline-block; }
.ev-grid { max-width: 1000px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px; }
.ev-card { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 12px 54px 12px 12px; border-radius: 14px; background: #f4ecd6; color: #2a2438; border: 2px solid #d8cdb0; font-family: var(--serif); font-size: 16.5px; line-height: 1.5; cursor: pointer; transition: border-color .15s, background .15s, opacity .15s; }
.ev-card:hover { background: #f8f1de; }
.ev-card.sel { border-color: #3a2a70; background: #ece7fb; box-shadow: 0 0 0 3px rgba(58, 42, 112, .28); }
.ev-card.full { opacity: .72; }
.ev-card .num { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font: 700 15px var(--sans); background: #eadfbd; color: #6a4f0b; border: 0; cursor: pointer; }
.ev-card.sel .num { background: #3a2a70; color: #fff; }
.ev-card .ctext { flex: 1; min-width: 0; user-select: text; -webkit-user-select: text; cursor: text; padding-top: 4px; }
.ev-card .tr-btn { top: 10px; right: 10px; width: 34px; height: 34px; color: #3a2a70; border-color: #cfc4a8; background: rgba(0, 0, 0, .03); }
.ev-bar { flex: none; display: flex; justify-content: center; gap: 12px; padding: 10px calc(16px + var(--sar)) calc(12px + var(--sab)) calc(16px + var(--sal)); background: rgba(5, 8, 20, .96); border-top: 1px solid var(--panel-line); min-height: 14px; }
.ev-bar:not(:has(:not([hidden]))) { display: none; }
.ev-bar .btn-ghost { border-color: rgba(255, 255, 255, .35); }

/* ---------- 测验：题多时顶部粘住一条进度（--qpad = 测验页滚动区的顶部留白，粘住的位置要抵消它，条才贴在最上面，不留一条空隙让内容从上面漏出来） ---------- */
.quiz-scroll { --qpad: calc(4vh + var(--sat)); }
@media (max-height: 480px) and (orientation: landscape) { .quiz-scroll { --qpad: calc(10px + var(--sat)); } }
.quiz-prog { position: sticky; top: calc(-1 * var(--qpad, 0px) - 1px); z-index: 4; display: flex; align-items: center; gap: 12px; margin: 6px -8px 0; padding: 8px 8px; background: rgba(251, 246, 234, .97); border-bottom: 1px solid #e2d8bd; }
.quiz-prog-text { font: 700 14px var(--sans); color: #5d5877; white-space: nowrap; }
.quiz-prog-bar { flex: 1; height: 6px; border-radius: 999px; background: #e2d8bd; overflow: hidden; }
.quiz-prog-bar i { display: block; height: 100%; width: 0; background: #3a2a70; transition: width .2s; }
.quiz-prog .btn { flex: none; }

/* ---------- 书架/书页：手机与横屏 ---------- */
@media (max-width: 520px) {
  .shelf-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; }
  .bc-title b { font-size: 19px; }
  .bk-zh { font-size: 16.5px; }
  .ev-head h2 { font-size: 20px; }
  .ev-grid { grid-template-columns: 1fr; }
}
@media (min-width: 900px) { .shelf-list { grid-template-columns: repeat(auto-fit, minmax(190px, 230px)); } }
@media (max-height: 480px) and (orientation: landscape) {
  .shelf-wrap { padding-top: calc(8px + var(--sat)); }
  .shelf-wrap h1 { font-size: 30px; }
  .shelf-head .tagline { display: none; }
  .shelf-head .title-actions { margin-bottom: 12px; }
  .shelf-list { grid-template-columns: repeat(auto-fit, minmax(300px, 380px)); gap: 14px 18px; }
  .book-card { flex-direction: row; gap: 14px; align-items: flex-start; }
  .book-cover { width: 112px; flex: none; }
  .bc-title b { font-size: 15px; } .bc-title i { display: none; }
  .book-info { padding-top: 2px; }
  #screen-book .title-wrap { padding-top: calc(52px + var(--sat)); }
  #screen-book .title-wrap h1 { font-size: 30px; }
  .book-tags { margin: 4px 0 6px; } .book-diff, .book-hint { display: none; }
  .evidence { padding-top: calc(54px + var(--sat)); }
  .ev-head h2 { font-size: 18px; }
  .toast { top: calc(54px + var(--sat)); }
}
@media (pointer: coarse) {
  .ev-card .num { width: 44px; height: 44px; font-size: 17px; }
  .ev-card .tr-btn { width: 44px; height: 44px; top: 6px; right: 6px; }
  .ev-card { padding: 8px 60px 8px 8px; }
  .ev-card:hover { background: #f4ecd6; }
  .ev-card.sel:hover { background: #ece7fb; }
}
@media (prefers-reduced-motion: reduce) { .book-card { transition: none; } }
/* 书架头部压紧：首屏要看到封面 */
.shelf-wrap { padding-top: calc(3.5vh + var(--sat)); }
.shelf-wrap h1 { font-size: clamp(34px, 5.2vw, 56px); }
.shelf-wrap .subtitle { margin: 4px 0 10px; font-size: clamp(16px, 2.2vw, 21px); }
.shelf-head .tagline { margin-bottom: 10px; font-size: 14px; }
.shelf-head .title-actions { margin-bottom: 16px; }
.shelf-head .title-actions .btn { min-height: 44px; font-size: 14px; }
@media (max-height: 480px) and (orientation: landscape) { .shelf-wrap .subtitle { font-size: 15px; margin: 0 0 8px; } .shelf-wrap h1 { font-size: 28px; } }

/* =====================================================================
   第 16 轮：老板第一次试玩看到的四个界面问题（以「她眼睛看到的」为准）
   1) 书架页/书页：滚动的是整块屏幕本身（铺满窗口宽度，滚动条在窗口最右边），不再是中间 760px/1180px 的内层容器（那样滚动条出现在页面中间、右边露出一截背景）；
      内层容器只负责排版（flex:none 的子元素不会被压扁，页脚两行不会叠在一起），底部留足空白，能完整滚到底。
   2) 全站滚动条：深色细样式，和深色界面协调。
   ===================================================================== */
#screen-shelf.active, #screen-book.active { overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
#screen-shelf .bg-layer, #screen-book .bg-layer { position: fixed; }
.shelf-wrap, .title-wrap { height: auto; min-height: 100%; overflow: visible; }
.shelf-wrap > *, .title-wrap > * { flex-shrink: 0; }
.shelf-wrap { padding-bottom: calc(56px + var(--sab)); }
.title-wrap, #screen-book .title-wrap { padding-bottom: calc(56px + var(--sab)); }
.music-credit { line-height: 1.5; padding-bottom: 4px; }
.book-back { position: fixed; }
* { scrollbar-width: thin; scrollbar-color: rgba(232, 184, 79, .38) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(232, 184, 79, .38); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(232, 184, 79, .6); background-clip: content-box; }
*::-webkit-scrollbar-corner { background: transparent; }
.pop, .vocab-card, .quiz-card { scrollbar-color: rgba(42, 36, 56, .35) transparent; }
.pop::-webkit-scrollbar-thumb, .vocab-card::-webkit-scrollbar-thumb { background: rgba(42, 36, 56, .35); background-clip: content-box; }
@media (max-width: 420px) { .eyebrow { letter-spacing: .08em; font-size: 11px; } }

/* 第 19 轮：音乐曲目署名（折叠，默认和「出品」同一行，不增加页脚高度；展开时占满一行） */
.credit-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; column-gap: 10px; max-width: 100%; }
.music-titles { margin: 0; padding: 0 0 4px; font-size: 11px; line-height: 1.5; color: var(--muted); opacity: .75; max-width: 100%; text-align: center; }
.music-titles[open] { flex-basis: 100%; }
.music-titles summary { cursor: pointer; list-style: none; opacity: .8; padding: 0 4px; }
.music-titles summary::-webkit-details-marker { display: none; }
.music-titles p { margin: 2px 0 0; line-height: 1.6; overflow-wrap: anywhere; }
@media (max-width: 380px) { .music-titles { font-size: 10px; } }
