/* 郑伯克段于鄢 · 解谜档案 —— 样式（零依赖） */
:root {
  --bg: #0b0c0c;
  --panel: #1a1512;
  --panel-2: #241c16;
  --line: #8d7547;
  --dim: #4a3a2a;
  --gold: #d8b878;
  --cream: #f3ead3;
  --red: #a8322a;
  --muted: #a89c86;
  --ok: #8fc79a;
  --bad: #e08074;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #000; color: var(--cream); font-family: var(--sans); }
body { display: flex; justify-content: center; align-items: center; }
button { font-family: inherit; }
[hidden] { display: none !important; }

.app {
  position: relative; width: min(100%, 430px); height: 100vh; height: 100dvh;
  overflow: hidden; background: var(--bg); user-select: none; -webkit-user-select: none;
}
@media (min-width: 520px) and (min-height: 640px) {
  .app { height: min(100dvh, 920px); border-radius: 18px; box-shadow: 0 0 0 1px #2a211c, 0 24px 70px rgba(0, 0, 0, 0.7); }
}
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; }

/* ---------- 通用按钮 ---------- */
.btn {
  display: block; width: 100%; height: 58px; border-radius: 10px;
  border: 1px solid #c9705f; background: var(--red); color: var(--cream);
  font-size: 18px; letter-spacing: 0.2em; text-indent: 0.2em; cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.btn:active { transform: scale(0.98); filter: brightness(1.15); }
.btn:disabled { opacity: 0.4; cursor: default; transform: none; filter: none; }
.btn-gold { background: var(--panel-2); border-color: var(--gold); color: var(--gold); }
.btn-text {
  display: block; width: 100%; margin-top: 12px; background: none; border: 0; color: var(--muted);
  font-size: 14px; letter-spacing: 0.1em; cursor: pointer; padding: 8px;
}
.btn-text:active { color: var(--cream); }
.btn-sm { height: 44px; font-size: 15px; letter-spacing: 0.12em; }

/* ---------- 标题页 ---------- */
#screen-title { background: #0b1616; }
.title-art { position: absolute; inset: 0; }
.title-art svg { display: block; width: 100%; height: 100%; }
.title-block { position: absolute; left: 16px; right: 16px; text-align: center; animation: fadeUp 0.8s ease-out both; }
.title-chip {
  display: inline-block; font-size: 12px; letter-spacing: 0.18em; color: var(--gold);
  border: 1px solid rgba(141, 117, 71, 0.8); border-radius: 999px; padding: 4px 12px;
  background: rgba(11, 22, 22, 0.55); margin-bottom: 14px;
}
.title-main {
  margin: 0; font-family: var(--serif); font-weight: 700; color: #f8f0dc; letter-spacing: 0.06em;
  line-height: 1.15; text-shadow: 0 0 22px rgba(243, 234, 211, 0.6), 0 0 3px rgba(243, 234, 211, 0.9), 0 2px 10px rgba(0, 0, 0, 0.5);
}
.title-sub { margin-top: 8px; font-size: 12px; letter-spacing: 0.24em; text-indent: 0.24em; color: #9aa39c; }
.title-tag { margin: 14px 0 0; font-size: 15px; line-height: 1.6; color: #e6dcc6; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7); }
.title-actions { position: absolute; left: 0; right: 0; bottom: 5.5%; padding: 0 20px; text-align: center; }
.title-src { margin-top: 12px; font-size: 12px; color: #8a9490; letter-spacing: 0.12em; }
/* 背景动画：图形由 scenes.js 的 titleArt 生成，这里按 class 驱动 */
.title-svg .tw { animation: twinkle 3s ease-in-out infinite; }
.title-svg .halo { transform-box: fill-box; transform-origin: center; animation: halo 6s ease-in-out infinite; }
.title-svg .drift { animation: drift 44s ease-in-out infinite alternate; }
.title-svg .shimmer { animation: twinkle 3s ease-in-out infinite; }
.title-svg .ripple { animation: ripple 7s ease-in-out infinite alternate; }
.title-svg .glow { transform-box: fill-box; transform-origin: center; animation: glow 4.5s ease-in-out infinite; }
.title-svg .mote { animation: rise 6s linear infinite; }
.title-svg .sway { transform-box: fill-box; transform-origin: 50% 100%; animation: sway 5s ease-in-out infinite alternate; }
/* 封面卡片墙：七幕关键画面特写，上四下三；每张有自己的动效，另有光泽错时扫过 */
.title-tiles { position: absolute; left: 0; right: 0; display: flex; flex-direction: column; gap: var(--gap, 7px); pointer-events: none; }
.tile-row { display: flex; justify-content: center; gap: var(--gap, 7px); }
.tile {
  position: relative; overflow: hidden; width: var(--cw, 85px); height: var(--ch, 113px); margin: 0;
  border-radius: 9px; background: #0d1a18; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55);
  animation: tileIn 0.55s ease-out both; animation-delay: calc(var(--i, 0) * 0.07s);
}
.tile svg { display: block; width: 100%; height: 100%; }
.tile::before { content: ""; position: absolute; inset: 0; z-index: 3; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(216, 184, 120, 0.32); pointer-events: none; }
.tile::after {
  content: ""; position: absolute; inset: -30%; z-index: 2; pointer-events: none;
  background: linear-gradient(115deg, transparent 44%, rgba(255, 244, 214, 0.2) 50%, transparent 56%);
  transform: translateX(-80%); animation: sweep 9s ease-in-out infinite; animation-delay: var(--s, 0s);
}
.tile figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 16px 2px 6px; text-align: center; white-space: nowrap;
  font-size: 10.5px; line-height: 1.3; letter-spacing: 0.02em; color: var(--cream);
  background: linear-gradient(transparent, rgba(8, 14, 12, 0.86));
}
.tile figcaption b { color: var(--gold); font-weight: 700; margin-right: 3px; }
/* 每幕的专属动效：封面卡片（scenes.js 的 TILES）和场景页插画（SCENES）共用同一组 class。
 * 同一组关键帧在 240×320 的卡片和 390×520 的场景里复用；场景画幅大，位移相对更小、更克制。
 * 绕点旋转/缩放的元素已包进 translate 分组，以自身原点为中心变换，不依赖 transform-box */
:is(.tile, .stage) .a-glow { animation: tileGlow 3.2s ease-in-out infinite; }
:is(.tile, .stage) .a-flame { animation: tileFlame 1.7s linear infinite; }
:is(.tile, .stage) .a-cradle { animation: tileRock 3.4s ease-in-out infinite alternate; }
:is(.tile, .stage) .a-eyes { animation: tileEyes 4.6s ease-in-out infinite; }
:is(.tile, .stage) .a-drift { animation: drift 9s ease-in-out infinite alternate; }
:is(.tile, .stage) .a-rise { animation: tileRise 6s ease-in-out infinite alternate; }
:is(.tile, .stage) .a-flag, :is(.tile, .stage) .a-pennant { animation: tileWave 2.2s ease-in-out infinite alternate; }
:is(.tile, .stage) .a-swap { animation: tileSwap 8s ease-in-out infinite; }
:is(.tile, .stage) .a-quake { animation: tileQuake 5s linear infinite; }
:is(.tile, .stage) .a-lean { animation: tileLean 2.6s ease-in-out infinite alternate; }
:is(.tile, .stage) .a-bolt { opacity: 0; animation: tileBolt 5s linear infinite; }
:is(.tile, .stage) .a-flash { opacity: 0; animation: tileFlash 5s linear infinite; }
:is(.tile, .stage) .a-fall { animation: tileFall 2.2s linear infinite; }
:is(.tile, .stage) .a-dust { animation: tileDust 1.3s ease-out infinite; }
:is(.tile, .stage) .a-speed { animation: tileSpeed 0.9s linear infinite; }
:is(.tile, .stage) .a-spin { animation: spin 0.7s linear infinite; }
:is(.tile, .stage) .a-rally { animation: tileRally 0.62s ease-in-out infinite alternate; }
:is(.tile, .stage) .a-spring { animation: tileGlow 2.6s ease-in-out infinite; }
:is(.tile, .stage) .a-mist { opacity: 0; animation: tileMist 4s ease-out infinite; }
:is(.tile, .stage) .a-tw { animation: twinkle 3s ease-in-out infinite; }
:is(.tile, .stage) .a-walk-l { animation: tileWalkL 3.6s ease-in-out infinite alternate; }
:is(.tile, .stage) .a-walk-r { animation: tileWalkR 3.6s ease-in-out infinite alternate; }
:is(.tile, .stage) .a-bob { animation: tileBob 0.5s ease-in-out infinite alternate; }
:is(.tile, .stage) .a-ripple { animation: tileRipple 2.4s ease-out infinite; }
/* 场景页里隧中二人站得近，相向走近的步幅收小，免得叠到一起 */
.stage .a-walk-l { animation-name: scWalkL; }
.stage .a-walk-r { animation-name: scWalkR; }

/* ---------- 剧情页 ---------- */
#screen-story { background: #000; }
.story-kicker {
  position: absolute; top: calc(18px + env(safe-area-inset-top)); left: 0; right: 0; text-align: center;
  font-size: 12px; letter-spacing: 0.2em; color: var(--muted);
}
.story-text {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 24px 30px; text-align: center; font-size: 17px; line-height: 1.95; color: #e8dcc0;
  flex-direction: column; animation: fade 0.4s ease-out;
}
.story-text .kicker { display: block; font-size: 13px; letter-spacing: 0.3em; color: var(--gold); margin-bottom: 18px; }
.story-text .big { display: block; font-family: var(--serif); font-size: 32px; letter-spacing: 0.12em; color: var(--cream); margin-bottom: 14px; line-height: 1.3; }
.story-text .place { display: block; font-size: 14px; color: var(--muted); letter-spacing: 0.15em; }
/* 本幕小结弹窗里的统计行（game.js 的 actEndCheck） */
.end-stat { margin: 6px 0 0; font-size: 15px; line-height: 1.6; color: var(--muted); letter-spacing: 0.05em; }
.end-stat b { color: var(--cream); font-weight: 600; }
.story-seal { display: grid; place-items: center; width: 56px; height: 56px; margin: 14px auto 4px; border: 2px solid var(--red); border-radius: 8px; background: rgba(168, 50, 42, 0.08); }
.story-seal.off { border-color: #4a3a32; background: none; }
.stamp-text { writing-mode: vertical-rl; color: var(--red); font-family: var(--serif); font-size: 14px; letter-spacing: 2px; line-height: 1; }
.story-seal.off .stamp-text { color: #6a554a; }
/* 多行对白（歌词式）：整段译文排成一列、不分页，每点一次多亮一行，新行奶油色加粗，之前的变暗；引文偏暖棕。
 * 当前行停在画面约 40% 高处，前面的行向上滑出、在顶部渐隐；上移由 game.js 的 layoutStory 给 .lyrics 设 translateY */
.story-text.lines {
  display: block; position: relative; overflow: hidden; padding: 14vh 30px 24px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 13%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 13%);
}
.story-text .lyrics { transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1); }
.story-text .line { display: block; width: 100%; font-size: 17px; line-height: 1.75; letter-spacing: 0.02em; color: #6c6053; transition: color 0.3s; }
.story-text .line + .line { margin-top: 26px; }
.story-text .line.quote { color: #7b6a4c; }
.story-text .line.now { color: var(--cream); font-weight: 700; animation: fadeUp 0.45s ease-out; }
.story-text .line.hide { visibility: hidden; }
.story-next {
  position: absolute; bottom: 17%; left: 0; right: 0; background: none; border: 0;
  color: var(--line); font-size: 13px; letter-spacing: 0.1em; cursor: pointer; padding: 12px;
  animation: breathe 2.4s ease-in-out infinite;
}

/* ---------- 场景页 ---------- */
#screen-scene { background: #000; padding-top: calc(14px + env(safe-area-inset-top)); padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
.topbar { display: flex; gap: 8px; padding: 0 12px; align-items: center; }
.cap {
  height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line);
  background: var(--panel); color: var(--cream); font-size: 14px; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; transition: filter 0.12s;
}
.cap b { font-weight: 700; color: var(--gold); min-width: 1em; text-align: center; }
.cap:active { filter: brightness(1.35); }
.cap-place { margin-left: auto; max-width: 44%; overflow: hidden; text-overflow: ellipsis; cursor: default; }
.cap-active { background: var(--panel-2); border-color: var(--gold); color: #fff5dd; font-weight: 700; }
.stage-wrap { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; margin: 10px 0; padding: 0 12px; }
.stage { position: relative; border-radius: 4px; overflow: hidden; }
.stage svg { display: block; width: 100%; height: 100%; }
.inv-toggle {
  position: absolute; left: 6px; bottom: 6px; width: 44px; height: 44px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(26, 21, 18, 0.86); color: var(--cream); cursor: pointer;
  display: grid; place-items: center; z-index: 2;
}
.inv-toggle:active { filter: brightness(1.4); }
.inv-toggle.flash { animation: flash 0.5s ease-in-out 3; }
.guide {
  margin: 0 12px; min-height: 54px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #0e0c0a; font-size: 14px; line-height: 1.55; color: var(--cream);
}
.guide-sub { font-size: 12px; color: var(--muted); margin-top: 2px; letter-spacing: 0.05em; }
.guide-tag {
  display: inline-block; margin-right: 7px; padding: 0 6px; border-radius: 4px; vertical-align: 1px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--gold); font-size: 11px; line-height: 16px; letter-spacing: 0.12em;
}
/* 首次进场景：第一个光点旁的「点这里调查」 */
.tap-hint {
  position: absolute; left: 0; top: 0; z-index: 3; padding: 7px 12px; border-radius: 999px; white-space: nowrap; pointer-events: none;
  background: var(--cream); color: #1a1512; font-size: 13px; font-weight: 700; letter-spacing: 0.08em;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5); transform: translate(-50%, var(--ty)); animation: tapHint 1.3s ease-in-out infinite;
}
.tap-hint::after { content: ""; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top: 6px solid var(--cream); }
.tap-hint.below::after { bottom: auto; top: -6px; border-top: 0; border-bottom: 6px solid var(--cream); }
/* 物品栏：一排 = 格子（按实际件数画，见 game.js 的 renderInv）+ 一句说明，不再固定画 6 个空格 */
.inv { display: flex; align-items: center; gap: 12px; padding: 10px 12px 0; }
#screen-scene.inv-off .inv { display: none; }
.slot {
  flex: none; width: 54px; aspect-ratio: 1 / 1; border-radius: 10px; border: 1px solid var(--dim); background: #14100e;
  display: grid; place-items: center; padding: 6px; cursor: default; position: relative;
}
.inv-note { flex: 1; min-width: 0; font-size: 13px; line-height: 1.5; color: var(--muted); text-wrap: balance; }
.inv-note b { color: var(--cream); font-weight: 700; margin-right: 6px; }
.slot.has { cursor: pointer; }
.slot svg { width: 100%; height: 100%; display: block; }
.slot.sel { border-color: var(--gold); background: var(--panel-2); box-shadow: 0 0 0 1px var(--gold) inset, 0 0 14px rgba(216, 184, 120, 0.35); }

/* SVG 上的热点标记 */
.hs-dot { fill: #f3ead3; pointer-events: none; animation: breathe 1.8s ease-in-out infinite; }
.hs-ring { fill: none; stroke: #f3ead3; stroke-width: 1.2; pointer-events: none; transform-box: fill-box; transform-origin: center; animation: ring 1.8s ease-out infinite; }
.hs-ring.gold { stroke: #f3d27a; }
/* 工具：金色四角星，和线索光点区分开 */
.hs-star { fill: #f3d27a; pointer-events: none; transform-box: fill-box; transform-origin: center; animation: spin 7s linear infinite; }
.hs-badge { pointer-events: none; }
.hs-badge-ok { fill: #6fb07c; stroke: #0b0c0c; stroke-width: 1.5; }
.hs-badge-bad { fill: #c0564a; stroke: #0b0c0c; stroke-width: 1.5; }
.hs-badge-ev { fill: #d8b878; stroke: #3a2a1c; stroke-width: 1.5; }
.hs-mark { fill: #0b0c0c; pointer-events: none; font-size: 10px; font-weight: 700; font-family: var(--sans); }
.hs-mark.ev { fill: #3a2a1c; font-family: var(--serif); }
.hs-lock-bg { fill: rgba(26, 21, 18, 0.92); stroke: #d8b878; stroke-width: 1; pointer-events: none; }
.hs-lock { fill: none; stroke: #d8b878; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.hs-lock-body { fill: #d8b878; pointer-events: none; }
.exit-arrow { fill: none; stroke: #f3ead3; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.exit-arrow.dim { opacity: 0.35; }
/* 「下一幕」：本幕集齐后出现在画面右上角（game.js 的 renderSceneAll），金色胶囊 + 外圈光环 */
.next-act {
  position: absolute; top: 10px; right: 10px; z-index: 3; height: 42px; padding: 0 15px 0 13px; border-radius: 21px;
  border: 1px solid #f6e2a8; background: linear-gradient(180deg, #ecd08c, #c9a45a); color: #1a1512;
  font-size: 15px; font-weight: 700; letter-spacing: 0.1em; text-indent: 0.1em; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  animation: nextGlow 1.6s ease-out infinite;
}
.next-act:active { filter: brightness(1.12); }
.next-act svg { flex: none; width: 20px; height: 20px; animation: nextNudge 1.1s ease-in-out infinite; }
.next-act.flash { animation: flash 0.5s ease-in-out 4; }
@keyframes nextGlow {
  0% { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), 0 0 0 0 rgba(243, 210, 122, 0.75); }
  70%, 100% { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), 0 0 0 9px rgba(243, 210, 122, 0); }
}
@keyframes nextNudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(3px); } }
.hits rect { fill: transparent; cursor: pointer; }
.marks.flash .hs-dot, .marks.flash .hs-lock-bg, .marks.flash .hs-star { animation: flash 0.5s ease-in-out 4; }
.marks.flash .hs-ring { animation: ring 0.5s ease-out 4; }

/* ---------- 弹层 ---------- */
.overlay {
  position: absolute; inset: 0; z-index: 20; background: rgba(0, 0, 0, 0.74);
  display: flex; align-items: flex-end; justify-content: center; animation: fade 0.18s ease-out;
}
.overlay.center { align-items: center; padding: 24px 20px; }
.sheet {
  width: 100%; max-height: 92%; overflow: auto; -webkit-overflow-scrolling: touch;
  background: #120f0d; border-top: 1px solid var(--line); border-radius: 16px 16px 0 0;
  padding: 16px 16px calc(18px + env(safe-area-inset-bottom)); animation: slideUp 0.24s ease-out;
}
.overlay.center .sheet { border: 1px solid var(--line); border-radius: 16px; max-height: 86%; padding-bottom: 18px; text-align: center; }
.sheet-title { font-family: var(--serif); font-size: 20px; letter-spacing: 0.14em; color: var(--cream); margin: 0 0 4px; }
.sheet-sub { font-size: 12px; color: var(--muted); letter-spacing: 0.16em; margin-bottom: 14px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 16px; }
.sheet-actions .btn { flex: 1; }
.sheet-actions .btn + .btn { margin-top: 0; }

/* ---------- 谜题弹窗 ---------- */
.q-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.q-kind { font-size: 12px; color: var(--gold); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; letter-spacing: 0.14em; white-space: nowrap; }
.q-place { font-size: 12px; color: var(--muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-close { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: none; color: var(--cream); font-size: 15px; cursor: pointer; flex: none; display: grid; place-items: center; }
.q-close:active { filter: brightness(1.5); }
.excerpt { background: var(--panel); border: 1px solid #3a2e22; border-radius: 10px; padding: 12px 10px 10px; margin-bottom: 14px; }
.excerpt-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.excerpt-label { font-size: 11px; color: var(--muted); letter-spacing: 0.16em; }
.narr-btn {
  flex: none; height: 26px; padding: 0 11px; border-radius: 13px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--gold); font-size: 12px; letter-spacing: 0.04em; white-space: nowrap; cursor: pointer;
}
.narr-btn:active { filter: brightness(1.35); }
.ruby { font-family: var(--serif); text-align: center; line-height: 1; user-select: text; -webkit-user-select: text; }
.unit { display: inline-flex; align-items: flex-end; vertical-align: bottom; margin: 3px 0; }
.col { display: inline-flex; flex-direction: column; align-items: center; }
.py { font-size: 10px; line-height: 13px; height: 13px; color: var(--muted); font-family: var(--sans); white-space: nowrap; letter-spacing: 0; }
.ch { font-size: 20px; line-height: 24px; color: var(--cream); }
.unit.note { padding: 1px 3px; margin: 1px 1px; border-radius: 4px; background: rgba(216, 184, 120, 0.16); cursor: pointer; }
.unit.note .ch { color: var(--gold); font-weight: 700; }
.unit.note .ch.punct { color: var(--cream); font-weight: 400; }
.unit.note:active { background: rgba(216, 184, 120, 0.4); }
/* 诵读进度：正在读的句子垫一层奶油色，金色注释句则加深 */
.excerpt .unit { border-radius: 4px; transition: background 0.18s; }
.excerpt .unit.now { background: rgba(243, 234, 211, 0.16); }
.excerpt .unit.note.now { background: rgba(216, 184, 120, 0.5); }
.ellipsis { color: var(--muted); font-size: 16px; margin: 0 6px; vertical-align: middle; font-family: var(--serif); }
.note-card { margin-top: 10px; padding: 10px 12px; border-left: 2px solid var(--gold); background: rgba(216, 184, 120, 0.07); border-radius: 0 8px 8px 0; text-align: left; animation: fade 0.2s; }
.note-term { font-family: var(--serif); font-size: 17px; color: var(--gold); margin-bottom: 4px; }
.note-core { display: inline-block; font-family: var(--sans); font-size: 10px; letter-spacing: 0.1em; color: var(--red); border: 1px solid var(--red); border-radius: 4px; padding: 0 5px; margin-left: 8px; vertical-align: 2px; }
.note-meaning { font-size: 14px; line-height: 1.6; color: var(--cream); }
.note-src { font-size: 13px; line-height: 1.6; color: var(--muted); margin-top: 4px; font-family: var(--serif); }
.q-prompt { font-size: 16px; line-height: 1.6; color: var(--cream); margin: 0 0 12px; font-weight: 500; }
.q-body { display: flex; flex-direction: column; gap: 10px; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 10px 12px;
  border-radius: 8px; border: 1px solid var(--dim); background: var(--panel); color: var(--cream);
  font-size: 14px; line-height: 1.5; cursor: pointer; transition: background 0.12s, border-color 0.12s;
}
.opt .mark { flex: none; width: 18px; color: var(--muted); font-size: 13px; text-align: center; }
.opt.sel { border-color: var(--gold); background: var(--panel-2); box-shadow: 0 0 0 1px var(--gold) inset; }
.opt.ok { border-color: var(--ok); background: rgba(143, 199, 154, 0.14); }
.opt.bad { border-color: var(--bad); background: rgba(224, 128, 116, 0.14); }
.opt.ok .mark, .opt.bad .mark { color: inherit; }
.opt.ok .mark { color: var(--ok); }
.opt.bad .mark { color: var(--bad); }
.opt:disabled { cursor: default; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 12px; width: auto; display: inline-flex; }
.chip .mark { width: auto; }
.claim { padding: 10px 0 4px; border-top: 1px dashed #3a2e22; }
.claim:first-child { border-top: 0; padding-top: 0; }
.claim-st { font-size: 15px; line-height: 1.55; color: var(--cream); margin-bottom: 8px; }
.claim-lbls { display: flex; gap: 6px; }
.lbl { flex: 1; justify-content: center; text-align: center; padding: 8px 4px; font-size: 12px; }
.sm-row { display: grid; grid-template-columns: 72px 1fr; gap: 8px; align-items: center; }
.sm-term { font-family: var(--serif); color: var(--gold); font-size: 18px; text-align: center; letter-spacing: 0.1em; }
.sm-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.sm-opts .opt { flex: 1 1 100%; font-size: 13px; padding: 8px 10px; }
.seq-box { min-height: 44px; padding: 8px; border: 1px dashed var(--dim); border-radius: 8px; display: flex; flex-wrap: wrap; gap: 6px; background: rgba(26, 21, 18, 0.5); }
.seq-box.empty::after { content: attr(data-ph); color: #6a5a48; font-size: 13px; align-self: center; padding: 6px; }
.seq-hint { font-size: 12px; color: var(--muted); }
.seq-item { padding: 8px 10px 8px 8px; }
.seq-item .num { flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--gold); color: #1a1512; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.seq-item.sel .num { background: var(--panel-2); color: var(--gold); border: 1px solid var(--gold); }
.seq-item.ok .num { background: var(--ok); }
.seq-item.bad .num { background: var(--bad); }
.correct-order { font-size: 13px; line-height: 1.7; color: var(--muted); }
.correct-order b { color: var(--ok); font-weight: 600; }
.hint-box { margin-top: 10px; padding: 10px 12px; border-left: 2px solid var(--gold); background: var(--panel); font-size: 14px; color: #d9cdb4; line-height: 1.65; animation: fade 0.2s; }
.hint-box + .hint-box { margin-top: 6px; }
/* 提示面板：本幕未完成的题目，一题一卡（game.js 的 openHintSheet） */
.hint-q { margin-top: 10px; padding: 12px; border: 1px solid var(--dim); border-radius: 10px; background: rgba(26, 21, 18, 0.5); }
.hint-spot {
  display: inline-block; margin-bottom: 6px; padding: 0 8px; border: 1px solid var(--dim); border-radius: 999px;
  font-size: 11px; line-height: 17px; letter-spacing: 0.12em; color: var(--gold);
}
.hint-prompt { font-size: 15px; line-height: 1.6; color: var(--cream); }
.hint-q .hint-box:first-of-type { margin-top: 10px; }
.hint-btn { margin-top: 10px; }
.hint-used { margin-top: 8px; font-size: 12px; color: var(--muted); }
.q-foot { display: flex; gap: 10px; margin-top: 14px; }
.q-foot .btn { flex: 1; }
.q-foot .btn + .btn { margin-top: 0; }
.q-result { margin-top: 14px; padding: 12px; border-radius: 8px; border: 1px solid; animation: fadeUp 0.25s ease-out; }
.q-result.ok { border-color: var(--ok); background: rgba(143, 199, 154, 0.1); }
.q-result.bad { border-color: var(--bad); background: rgba(224, 128, 116, 0.1); }
.q-result-title { font-size: 16px; font-weight: 700; letter-spacing: 0.1em; }
.q-result.ok .q-result-title { color: var(--ok); }
.q-result.bad .q-result-title { color: var(--bad); }
.q-result-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.q-expl { margin-top: 8px; font-size: 14px; line-height: 1.7; color: #e2d7c0; }

/* ---------- 竹简（原文） ---------- */
.src-body { margin-top: 14px; }
.src-actions { display: flex; gap: 10px; margin-top: 4px; }
.src-actions .btn { flex: 1; }
.src-actions .btn + .btn { margin-top: 0; }
.src-playing { color: var(--gold); }

/* ---------- 菜单 ---------- */
.acts { display: flex; flex-direction: column; gap: 6px; }
.act-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--dim); background: var(--panel); font-size: 14px; }
.act-row.cur { border-color: var(--gold); }
.act-num { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); color: var(--gold); font-size: 12px; display: grid; place-items: center; flex: none; }
.act-name { flex: 1; color: var(--cream); }
.act-st { font-size: 12px; color: var(--muted); }
.act-st.done { color: var(--gold); }
.act-st.cur { color: var(--cream); }
.ev-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.ev-cell { aspect-ratio: 1 / 1; border-radius: 8px; border: 1px solid var(--dim); background: #14100e; display: grid; place-items: center; padding: 4px; }
.ev-cell.has { border-color: var(--line); background: var(--panel-2); }
.ev-cell svg { width: 100%; height: 100%; }
.sec-title { font-size: 12px; color: var(--gold); letter-spacing: 0.24em; margin: 18px 0 8px; display: flex; align-items: center; gap: 10px; }
.sec-title::after { content: ""; flex: 1; height: 1px; background: #3a2e22; }

/* ---------- 玩法说明 ---------- */
.tut { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.tut-step { display: flex; gap: 12px; align-items: flex-start; }
.tut-ic { flex: none; width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--dim); background: var(--panel-2); display: grid; place-items: center; }
.tut-ic svg { width: 28px; height: 28px; display: block; }
.tut-title { font-size: 15px; font-weight: 700; line-height: 1.5; color: var(--cream); }
.tut-text { font-size: 13px; line-height: 1.6; color: var(--muted); margin-top: 1px; }
.tut-tip {
  margin-top: 14px; padding: 10px 12px; border-left: 2px solid var(--gold); border-radius: 0 8px 8px 0;
  background: rgba(216, 184, 120, 0.07); font-size: 13px; line-height: 1.7; color: #d9cdb4;
}
.tut-tip b { color: var(--gold); font-weight: 600; }

/* ---------- 结案报告 ---------- */
#screen-report { background: var(--bg); }
.report { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; padding: 28px 20px calc(24px + env(safe-area-inset-bottom)); animation: fade 0.4s; }
.report-head { text-align: center; margin-bottom: 6px; }
.report-head .case { font-size: 12px; letter-spacing: 0.24em; color: var(--muted); }
.report-head h2 { font-family: var(--serif); font-size: 30px; letter-spacing: 0.16em; color: var(--cream); margin: 8px 0 6px; }
.report-head .sub { font-size: 13px; color: var(--gold); letter-spacing: 0.16em; }
.report-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0 6px; }
.stat { padding: 10px 6px; border: 1px solid var(--dim); border-radius: 10px; background: var(--panel); text-align: center; }
.stat b { display: block; font-size: 20px; color: var(--cream); font-family: var(--serif); }
.stat span { font-size: 12px; color: var(--muted); letter-spacing: 0.1em; }
.seals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 8px; }
.seal { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); text-align: center; }
.seal-stamp { display: grid; place-items: center; width: 48px; height: 48px; border: 2px solid var(--red); border-radius: 7px; background: rgba(168, 50, 42, 0.08); }
.seal-stamp .stamp-text { font-size: 12px; }
.seal.off .seal-stamp { border-color: #4a3a32; background: none; }
.chain { display: flex; flex-direction: column; gap: 0; }
.chain-step { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.55; color: var(--cream); }
.chain-step i { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); color: var(--gold); font-style: normal; font-size: 12px; display: grid; place-items: center; margin-top: 1px; background: var(--panel); }
.char { padding: 8px 0; border-top: 1px dashed #3a2e22; }
.char:first-child { border-top: 0; padding-top: 0; }
.char-name { font-family: var(--serif); color: var(--gold); font-size: 16px; margin-bottom: 4px; }
.char ul { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.7; color: #d9cdb4; }
.pattern { padding: 8px 0; border-top: 1px dashed #3a2e22; }
.pattern:first-child { border-top: 0; padding-top: 0; }
.pattern-text { font-family: var(--serif); font-size: 17px; color: var(--cream); }
.pattern-expl { font-size: 13px; color: var(--muted); line-height: 1.6; margin-top: 2px; }
.terms { display: flex; flex-wrap: wrap; gap: 8px; }
.term { font-family: var(--serif); font-size: 15px; color: var(--gold); border: 1px solid var(--dim); border-radius: 6px; padding: 4px 10px; background: var(--panel); }
.citation { font-size: 13px; color: var(--muted); line-height: 1.7; font-family: var(--serif); }
.ev-list { display: flex; flex-direction: column; gap: 8px; }
.ev { display: flex; gap: 12px; align-items: center; padding: 8px 10px; border: 1px solid var(--dim); border-radius: 10px; background: var(--panel); text-align: left; }
.ev-icon { width: 40px; height: 40px; flex: none; }
.ev-icon svg { width: 100%; height: 100%; }
.ev-name { font-family: var(--serif); color: var(--gold); font-size: 15px; }
.ev-quote { font-family: var(--serif); font-size: 13px; color: var(--cream); margin-top: 2px; line-height: 1.5; }
.ev-desc { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.confirm-text { font-size: 15px; line-height: 1.7; color: var(--cream); }

/* ---------- Toast ---------- */
.toast {
  position: absolute; left: 50%; top: calc(64px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 30;
  max-width: 86%; background: rgba(26, 21, 18, 0.96); border: 1px solid var(--line); color: var(--cream);
  padding: 8px 14px; border-radius: 999px; font-size: 13px; line-height: 1.4; animation: fade 0.2s; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- 动画 ---------- */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes slideUp { from { transform: translateY(30%); opacity: 0.6; } to { transform: none; opacity: 1; } }
@keyframes breathe { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
@keyframes ring { from { transform: scale(0.5); opacity: 0.9; } to { transform: scale(1.8); opacity: 0; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes flash { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
/* 标题页背景 */
@keyframes twinkle { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
@keyframes halo { 0%, 100% { opacity: 0.7; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes drift { from { transform: translateX(-22px); } to { transform: translateX(22px); } }
@keyframes ripple { from { transform: translateX(-12px); } to { transform: translateX(12px); } }
@keyframes glow { 0%, 100% { opacity: 0.8; transform: scale(1); } 50% { opacity: 1; transform: scale(1.05); } }
@keyframes rise { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 0.9; } 70% { opacity: 0.6; } 100% { transform: translateY(-70px); opacity: 0; } }
@keyframes sway { from { transform: rotate(-2.5deg); } to { transform: rotate(2.5deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes tapHint { 0%, 100% { transform: translate(-50%, var(--ty)); } 50% { transform: translate(-50%, calc(var(--ty) - 6px)); } }
/* 封面卡片 */
@keyframes tileIn { from { opacity: 0; transform: translateY(14px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes tileGlow { 0%, 100% { opacity: 0.7; } 50% { opacity: 1; } }
@keyframes tileFlame {
  0%, 100% { transform: scale(1, 1) rotate(-2deg); }
  25% { transform: scale(0.9, 1.12) rotate(3deg); }
  50% { transform: scale(1.06, 0.94) rotate(-1deg); }
  75% { transform: scale(0.92, 1.08) rotate(2deg); }
}
@keyframes tileRock { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }
@keyframes tileEyes { 0%, 16% { transform: scaleY(0.1); } 24%, 88% { transform: scaleY(1); } 94%, 100% { transform: scaleY(0.1); } }
@keyframes tileRise { from { transform: translateY(62px); } to { transform: translateY(0); } }
@keyframes tileWave { from { transform: skewY(-6deg) scaleX(0.92); } to { transform: skewY(6deg) scaleX(1.06); } }
@keyframes tileSwap {
  0% { transform: scaleX(1) skewY(6deg); }
  20% { transform: scaleX(0.9) skewY(-6deg); }
  40% { transform: scaleX(1) skewY(6deg); }
  46% { transform: scaleX(0.05) skewY(0deg); }
  52% { transform: scaleX(-1) skewY(-6deg); }
  60% { transform: scaleX(-0.94) skewY(5deg); }
  72% { transform: scaleX(-0.9) skewY(6deg); }
  92% { transform: scaleX(-1) skewY(-6deg); }
  98% { transform: scaleX(-0.05) skewY(0deg); }
  100% { transform: scaleX(1) skewY(6deg); }
}
@keyframes tileQuake {
  0%, 70%, 84%, 100% { transform: translate(0, 0); }
  72% { transform: translate(-2px, 1px); }
  74% { transform: translate(2px, -1px); }
  76% { transform: translate(-2px, 0); }
  78% { transform: translate(2px, 1px); }
  80% { transform: translate(-1px, -1px); }
  82% { transform: translate(1px, 0); }
}
@keyframes tileLean { from { transform: rotate(0deg); } to { transform: rotate(4.5deg); } }
@keyframes tileBolt { 0%, 70%, 84%, 100% { opacity: 0; } 71%, 75% { opacity: 1; } 73% { opacity: 0.2; } 80% { opacity: 0.6; } }
@keyframes tileFlash { 0%, 70%, 84%, 100% { opacity: 0; } 71%, 75% { opacity: 0.22; } 80% { opacity: 0.1; } }
@keyframes tileFall { from { transform: translateY(0); opacity: 1; } to { transform: translateY(64px); opacity: 0; } }
@keyframes tileDust { from { transform: translate(0, 0) scale(0.5); opacity: 0.85; } to { transform: translate(-30px, -10px) scale(1.6); opacity: 0; } }
@keyframes tileSpeed { from { transform: translateX(36px); opacity: 0; } 35% { opacity: 0.75; } to { transform: translateX(-30px); opacity: 0; } }
@keyframes tileRally { from { transform: translateY(0); } to { transform: translateY(-5px); } }
@keyframes tileMist { 0% { transform: translateY(8px) scale(0.7); opacity: 0; } 25% { opacity: 0.9; } 100% { transform: translateY(-46px) scale(1.25); opacity: 0; } }
@keyframes tileWalkL { from { transform: translateX(0); } to { transform: translateX(12px); } }
@keyframes tileWalkR { from { transform: translateX(0); } to { transform: translateX(-12px); } }
@keyframes scWalkL { from { transform: translateX(0); } to { transform: translateX(5px); } }
@keyframes scWalkR { from { transform: translateX(0); } to { transform: translateX(-5px); } }
@keyframes tileBob { from { transform: translateY(0); } to { transform: translateY(-2px); } }
@keyframes tileRipple { from { transform: scale(0.4); opacity: 0.9; } to { transform: scale(1.5); opacity: 0; } }
@keyframes sweep { 0%, 72% { transform: translateX(-80%); } 100% { transform: translateX(80%); } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  /* 只在动效中途才该出现的闪电、闪光、尘土、雾气：静止时直接藏起来 */
  .a-bolt, .a-flash, .a-dust, .a-mist { opacity: 0 !important; animation: none !important; }
}
