/* 《八十天》样式：一本 19 世纪的旅行手账
 * 舞台固定为 1600×900 逻辑像素，整体按窗口等比缩放（见 game.js fitStage），所以这里的尺寸都按 1600×900 设计。
 */
:root {
  --paper: #f1e4c4;
  --paper-2: #e8d5a8;
  --paper-3: #d6bd8a;
  --paper-hi: #fbf6e8;
  --ink: #3a2a1a;
  --ink-2: #6b5236;
  --ink-3: #8a6d45;
  --red: #9e2b25;
  --red-d: #6e1d18;
  --gold: #b08d3c;
  --gold-hi: #e2c372;
  --navy: #2c4152;
  --leather: #2b2016;
  --serif: "Songti SC", "Noto Serif SC", "STSong", "SimSun", serif;
  --fell: "IM Fell English", "Times New Roman", serif;
  --hand: "Kaiti SC", "STKaiti", "KaiTi", "楷体", "Noto Serif SC", serif;
  --num: "IM Fell English", "Noto Serif SC", serif;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .32 0 0 0 0 .22 0 0 0 0 .1 0 0 0 .11 0'/%3E%3C/filter%3E%3Crect width='260' height='260' filter='url(%23n)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #17110c; }
body {
  font-family: var(--serif);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
}
button { font-family: inherit; color: inherit; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums lining-nums; }
.muted { color: #7a6548; }
.small { font-size: .85em; }

#viewport { position: fixed; inset: 0; overflow: hidden; background: radial-gradient(ellipse at center, #2c2118 0%, #120d09 100%); }
#stage {
  position: absolute; left: 0; top: 0; width: 1600px; height: 900px;
  transform-origin: 0 0; overflow: hidden;
  background: #d9cba3;
  opacity: 0; transition: opacity .6s;
}
body.ready #stage { opacity: 1; }
#stage::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  box-shadow: inset 0 0 180px rgba(60, 38, 18, .55);
}

/* ============================================================ 地图 */
#map { position: absolute; inset: 0; z-index: 0; display: block; }
.wm-sea { fill: #c6cdb6; }
.wm-grat { stroke: #8a7350; stroke-width: .6px; opacity: .32; vector-effect: non-scaling-stroke; }
.wm-grat-major { opacity: .55; stroke-width: 1px; }
.wm-tropic { stroke: #9e2b25; stroke-width: .7px; opacity: .28; stroke-dasharray: 6 5; vector-effect: non-scaling-stroke; }
.wm-rhumb { stroke: #7b6a4c; stroke-width: .5px; opacity: .2; vector-effect: non-scaling-stroke; }
.wm-rhumb-main { opacity: .34; }
.wm-wl { fill: none; stroke: #5f7f86; stroke-linejoin: round; }
.wm-wl1 { stroke-width: 2.4px; opacity: .32; }
.wm-wl2 { stroke-width: 6px; opacity: .16; }
.wm-wl3 { stroke-width: 11px; opacity: .08; }
.wm-land { fill: #f3e7c6; stroke: #4e3b26; stroke-width: 1.2px; stroke-linejoin: round; }
.wm-lake { fill: #c6cdb6; stroke: #4e3b26; stroke-width: .8px; }
.wm-rose-ring { fill: none; stroke: #6b5236; stroke-width: .8px; }
.wm-rose-a { fill: #3a2a1a; }
.wm-rose-b { fill: #e8d8b0; stroke: #3a2a1a; stroke-width: .08; }
.wm-rose-n { font-family: var(--fell); fill: #3a2a1a; text-anchor: middle; }
.wm-ocean text { font-family: var(--serif); fill: #6b5a3e; text-anchor: middle; font-style: italic; opacity: .75; letter-spacing: .15em; }
.wm-ocean .wm-ocean-en { font-family: var(--fell); letter-spacing: .3em; opacity: .7; }

.plan-line { fill: none; stroke: #6b5236; stroke-width: 1.3px; stroke-dasharray: 2 6; stroke-linecap: round; opacity: .5; vector-effect: non-scaling-stroke; }
#jPlan.glow .plan-line { stroke: var(--red); opacity: .85; stroke-width: 2.4px; animation: dashMove 1.2s linear infinite; }
@keyframes dashMove { to { stroke-dashoffset: -16; } }
.rt path { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.rt-sea .rt-a { stroke: var(--red); stroke-width: 2.8px; stroke-dasharray: 10 7; }
.rt-sea .rt-b { stroke: none; }
.rt-rail .rt-a { stroke: #2a1d10; stroke-width: 2.4px; }
.rt-rail .rt-b { stroke: #2a1d10; stroke-width: 8px; stroke-dasharray: 1.6 7; stroke-linecap: butt; }
.rt-land .rt-a { stroke: #7a3b18; stroke-width: 3.2px; stroke-dasharray: .5 7; }
.rt-land .rt-b { stroke: none; }
.leg.high .rt-a { stroke: var(--gold); stroke-width: 5px; stroke-dasharray: none; filter: drop-shadow(0 0 4px rgba(176, 141, 60, .8)); }
.leg.high .rt-b { stroke: #6e5420; }
.mk circle { fill: var(--red); stroke: #fbf6e8; stroke-width: 2.5px; }
.mk text { font-family: var(--serif); font-size: 21px; font-weight: 700; fill: var(--ink); paint-order: stroke; stroke: #f3e8cb; stroke-width: 5px; stroke-linejoin: round; }
.mk.minor circle { fill: var(--ink-2); }
.mk.minor text { font-size: 17px; font-weight: 400; }
.mk.faint { opacity: .5; }
.mk.faint circle { fill: none; stroke: var(--ink-2); stroke-width: 2px; }
.stamp-in { opacity: .86; }
.stamp-in.anim { animation: stampIn .55s cubic-bezier(.2, 1.6, .4, 1) both; transform-box: fill-box; transform-origin: center; }
@keyframes stampIn { 0% { transform: scale(2.2); opacity: 0; } 60% { opacity: .95; } 100% { transform: scale(1); opacity: .86; } }
.stamp .st-o { fill: rgba(241, 228, 196, .55); stroke: var(--red); stroke-width: 3.2px; }
.stamp .st-i { fill: none; stroke: var(--red); stroke-width: 1.4px; }
.stamp text { fill: var(--red); text-anchor: middle; font-weight: 700; }
.stamp .st-name { font-family: var(--serif); font-weight: 900; }
.stamp .st-date { font-family: var(--fell); font-size: 15px; letter-spacing: .08em; }
.stamp .st-y { font-family: var(--fell); font-size: 11px; letter-spacing: .2em; }
.stamp .st-w { fill: none; stroke: var(--red); stroke-width: 2.2px; opacity: .8; }
.dt-line { fill: none; stroke: var(--gold); stroke-width: 2px; stroke-dasharray: 2 5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.dt-star path { fill: var(--gold-hi); stroke: var(--ink); stroke-width: 1.4px; }
.dt-star text { font-family: var(--serif); font-size: 16px; fill: var(--ink); paint-order: stroke; stroke: #f3e8cb; stroke-width: 4px; }
#mVeh { filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35)); }

/* ============================================================ 层级 */
#screen { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
#screen > * { pointer-events: auto; }
#screen.scr-travel > * { pointer-events: none; }
#hud { position: absolute; left: 0; right: 0; top: 0; height: 122px; z-index: 20; pointer-events: none; }
#hud > * { pointer-events: auto; }
#journalBtn { z-index: 30; }
#modal { z-index: 40; }
#overlay { z-index: 50; }
#fx { position: absolute; inset: 0; z-index: 60; pointer-events: none; }
#toast { z-index: 70; }
#debug { z-index: 100; }

/* ============================================================ HUD */
#hud {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 10px 22px 0;
  background: linear-gradient(to bottom, rgba(33, 23, 15, .94) 0%, rgba(33, 23, 15, .8) 62%, rgba(33, 23, 15, 0) 100%);
  color: #f4ecd6;
}
.hud-left { display: flex; align-items: flex-start; gap: 16px; }
.purse { min-width: 210px; }
.purse-label { font-size: 15px; color: #d4bd86; letter-spacing: .12em; }
.purse-amt { font-family: var(--num); font-size: 38px; line-height: 1.1; color: #fbf3e0; }
.purse-sub { font-size: 12px; color: #a8957a; }
.purse.broke .purse-amt { color: #ff9f8f; }
.party { display: flex; gap: 10px; padding-top: 2px; }
.pp { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 13px; color: #e9dcbc; }
.pp .portrait { width: 50px; height: 50px; border: 2px solid var(--gold); }
.pp.away { opacity: .45; filter: grayscale(1); }
.portrait { position: relative; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 50% 35%, #efe1bb, #c9b385); flex: none; }
.portrait svg { position: absolute; width: 175%; height: auto; left: -37.5%; top: 4%; }

.hud-center { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); display: flex; align-items: center; gap: 18px; }
.calendar { position: relative; width: 88px; height: 94px; perspective: 500px; }
.cal-face {
  position: absolute; inset: 0; border-radius: 6px; overflow: hidden; text-align: center;
  background: var(--paper-hi) var(--noise); color: var(--ink);
  box-shadow: 0 3px 0 #c9b385, 0 4px 0 #a8915e, 0 8px 14px rgba(0, 0, 0, .45);
  transform-origin: 50% 0;
}
.cal-top { display: flex; justify-content: space-between; padding: 3px 6px; background: var(--red); color: #fbf3e0; font-size: 12px; white-space: nowrap; }
.cal-d { font-family: var(--num); font-size: 46px; line-height: 1.02; margin-top: 2px; font-weight: 700; }
.cal-wd { font-size: 13px; color: var(--ink-2); }
.cal-leaf { z-index: 2; }
.cal-leaf.fwd { animation: leafUp .3s ease-in forwards; }
.cal-leaf.back { animation: leafDown .55s ease-out both; }
@keyframes leafUp { to { transform: rotateX(105deg) translateY(-6px); opacity: 0; } }
@keyframes leafDown { from { transform: rotateX(110deg); opacity: 0; } to { transform: rotateX(0); opacity: 1; } }
.countdown { min-width: 250px; text-align: center; }
.cd-label { font-size: 14px; color: #d4bd86; letter-spacing: .08em; }
.cd-val { font-family: var(--num); font-size: 34px; line-height: 1.15; color: #fbf3e0; }
.cd-val.low { color: #ffcf7a; }
.cd-val.over { color: #ff8f80; }
.cd-plan { font-size: 15px; margin-top: 1px; }
.cd-plan.ahead { color: #b4e09a; }
.cd-plan.behind { color: #ffab9c; }
.cd-plan.even { color: #d4bd86; }
.watch { width: 82px; height: 100px; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .5)); }
.hud-right { display: flex; align-items: flex-start; gap: 10px; }
.fixbox {
  position: relative; width: 156px; height: 96px; border-radius: 8px; overflow: hidden; cursor: pointer;
  background: radial-gradient(circle at 20% 22%, rgba(255, 228, 150, .85), rgba(255, 228, 150, 0) 42%), linear-gradient(180deg, #a48f6b 0%, #6a573f 100%);
  border: 1.5px solid rgba(176, 141, 60, .7);
  box-shadow: inset 0 -20px 30px rgba(0, 0, 0, .25);
  transition: box-shadow .5s, border-color .5s;
}
.fix-lamp { position: absolute; left: 26px; top: 16px; width: 4px; height: 84px; background: #2a1d10; }
.fix-lamp::before { content: ""; position: absolute; left: -7px; top: -9px; width: 18px; height: 14px; border-radius: 3px 3px 6px 6px; background: #ffe7a0; box-shadow: 0 0 14px 4px rgba(255, 220, 140, .8); }
.fix-sil { position: absolute; right: 12px; bottom: -4px; width: 54px; height: 88px; transform-origin: 50% 100%; transition: transform 1s cubic-bezier(.3, 1.3, .5, 1), opacity 1s; }
.fix-sil svg { width: 100%; height: 100%; }
.fix-val { position: absolute; left: 8px; bottom: 4px; font-size: 18px; color: #fbf3e0; text-shadow: 0 1px 3px #000; }
.fixbox.unseen .fix-val { opacity: .7; }
.fixbox.hot { border-color: #ff6b5a; animation: hotPulse 1.6s ease-in-out infinite; }
@keyframes hotPulse { 50% { box-shadow: 0 0 18px rgba(255, 90, 70, .75), inset 0 -20px 30px rgba(0, 0, 0, .25); } }
.icon-btn {
  width: 48px; height: 48px; border-radius: 50%; cursor: pointer; font-size: 22px; line-height: 1;
  border: 1.5px solid var(--gold); background: rgba(43, 32, 22, .85); color: #f4ecd6;
}
.icon-btn:hover { background: #4a3626; }

/* 日记本按钮 */
#journalBtn { position: absolute; right: 22px; bottom: 16px; width: 96px; height: 108px; border: none; background: none; cursor: pointer; padding: 0; }
.jb-book {
  position: absolute; inset: 8px 12px 0 6px; border-radius: 4px 9px 9px 4px;
  background: linear-gradient(135deg, #7a4626, #3e2213); border: 1px solid var(--gold);
  box-shadow: inset 7px 0 0 #2a160b, inset -3px 0 0 #f1e4c4, 0 8px 16px rgba(0, 0, 0, .55);
  transition: transform .2s;
}
#journalBtn:hover .jb-book { transform: rotate(-4deg) translateY(-3px); }
.jb-strap { position: absolute; right: 12px; top: -2px; bottom: -2px; width: 10px; background: #2a160b; border-left: 1px solid #5c3a20; }
.jb-title { position: absolute; left: 14px; right: 26px; top: 36px; text-align: center; color: var(--gold-hi); font-size: 17px; letter-spacing: .25em; border-top: 1px solid var(--gold); border-bottom: 1px solid var(--gold); padding: 3px 0 3px .25em; }
.jb-count { position: absolute; right: 0; top: 0; min-width: 32px; height: 32px; padding: 0 6px; border-radius: 16px; background: var(--red); color: #fff; font-size: 17px; line-height: 28px; font-weight: 700; border: 2px solid #f4ecd6; font-family: var(--num); }
#journalBtn.bump .jb-book { animation: bump .55s; }
@keyframes bump { 30% { transform: scale(1.15) rotate(-6deg); } 60% { transform: scale(.96); } }

/* ============================================================ 通用按钮与标签 */
.btn {
  font-size: 21px; padding: 10px 24px; border-radius: 7px; cursor: pointer;
  border: 1.5px solid var(--ink); background: var(--paper-hi); color: var(--ink);
  box-shadow: 0 3px 0 var(--ink); transition: transform .08s, box-shadow .08s, background .15s;
  white-space: nowrap;
}
.btn:hover { background: #fffaf0; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn.primary { background: var(--red); color: #fbf3e0; border-color: var(--red-d); box-shadow: 0 3px 0 var(--red-d); }
.btn.primary:hover { background: #b0352e; }
.btn.small { font-size: 16px; padding: 6px 14px; }
.btn.big { font-size: 28px; padding: 14px 52px; letter-spacing: .3em; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.chip {
  display: inline-block; font-size: 16px; padding: 2px 10px; border-radius: 13px; white-space: nowrap;
  background: #efe3c4; border: 1px solid #c9b385; color: var(--ink); font-variant-numeric: tabular-nums;
}
.chip.t { color: var(--navy); background: #e3e6dc; border-color: #aeb8a6; }
.chip.m { color: #6b3d1f; background: #f2e2c6; }
.chip.s { color: #2a1d10; background: #e2d6c3; border-color: #a8957a; }
.chip.j { color: #3f5e24; background: #e5ecd0; border-color: #a9bb8a; }
.chip.r { color: var(--red); background: #f5ddd3; border-color: #dba99b; }
.chip.warn { background: var(--red); color: #fff; border-color: var(--red-d); }
.chip.none { opacity: .7; }
.chip.risk { color: #6b5236; background: transparent; border-style: dashed; }
.ch-cost { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }

/* ============================================================ 站点画面 */
.station { position: absolute; inset: 0; }
.desk-shade { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 45% 55%, rgba(28, 19, 11, .45), rgba(28, 19, 11, .82)); opacity: 0; transition: opacity .6s; }
.station.in .desk-shade { opacity: 1; }
.st-left { position: absolute; left: 34px; top: 124px; width: 980px; opacity: 0; transform: translateY(24px); transition: opacity .6s .1s, transform .6s .1s; }
.page { opacity: 0; transform: translateX(30px) rotate(.4deg); transition: opacity .6s .2s, transform .6s .2s; }
.station.in .st-left { opacity: 1; transform: none; }
.station.in .page { opacity: 1; transform: rotate(.35deg); }

.plate-wrap { position: relative; }
.plate {
  position: relative; width: 960px; height: 540px; margin-left: 10px; overflow: hidden; cursor: ew-resize;
  background: var(--paper-2);
  outline: 12px solid #f4ecd6;
  box-shadow: 0 0 0 13px rgba(80, 60, 30, .25), 0 22px 46px rgba(0, 0, 0, .55);
  transform: rotate(-.35deg);
  touch-action: none;
}
.era { position: absolute; inset: 0; }
.era svg, .era img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.split-line { position: absolute; top: 0; bottom: 0; left: 0; width: 3px; margin-left: -1.5px; background: #fbf3e0; box-shadow: 0 0 8px rgba(0, 0, 0, .55); pointer-events: none; transition: opacity .2s; }
.split-knob { position: absolute; top: 50%; left: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; background: #fbf3e0; color: var(--ink); font-size: 24px; line-height: 46px; text-align: center; box-shadow: 0 2px 8px rgba(0, 0, 0, .5); border: 2px solid var(--gold); }
.era-tag { position: absolute; bottom: 14px; padding: 3px 12px; font-family: var(--fell); font-size: 22px; background: rgba(251, 243, 224, .9); color: var(--ink); border: 1px solid var(--ink-2); transition: opacity .3s; pointer-events: none; }
.era-tag.ttoday { left: 16px; font-family: var(--serif); font-size: 18px; color: var(--navy); }
.era-tag.t1872 { right: 16px; }
.plate-credit {
  position: absolute; right: 10px; top: 8px; max-width: 72%; padding: 3px 9px; border-radius: 4px;
  font-size: 13px; line-height: 1.4; color: #f4ecd6; background: rgba(20, 14, 9, .62); text-align: right; pointer-events: none;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.plate-credit:empty { display: none; }
.plate-hint {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); pointer-events: none;
  padding: 6px 16px; border-radius: 18px; background: rgba(43, 32, 22, .82); color: #fbf3e0; font-size: 18px;
  animation: hintPulse 2.2s ease-in-out infinite; transition: opacity .4s;
}
.plate.touched .plate-hint { opacity: 0; animation: none; }
@keyframes hintPulse { 50% { transform: translateX(-50%) translateY(-4px); } }
.anim-host { position: absolute; inset: 0; pointer-events: none; }
.anim-svg { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity .6s; }
.anim-svg.fade { opacity: 0; }

.slider { display: flex; align-items: center; gap: 16px; width: 960px; margin: 30px 0 0 10px; height: 40px; cursor: pointer; touch-action: none; outline: none; }
.sl-end { font-family: var(--fell); font-size: 23px; color: #f4ecd6; }
.sl-end:last-child { font-family: var(--serif); font-size: 20px; }
.sl-track { position: relative; flex: 1; height: 8px; border-radius: 4px; background: rgba(241, 228, 196, .28); }
.sl-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: linear-gradient(90deg, #8a6d45, var(--gold-hi)); }
.sl-knob { position: absolute; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #f6e2a4, var(--gold) 60%, #6e5420); border: 2px solid #fbf3e0; box-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
.slider:focus-visible .sl-knob { outline: 3px solid #fbf3e0; outline-offset: 3px; }
.cmp-line { position: relative; height: 70px; margin: 10px 0 0 10px; width: 960px; color: #f4ecd6; font-size: 20px; line-height: 1.5; }
.cmp-line > span { position: absolute; left: 0; top: 0; right: 0; transition: opacity .25s; }
.cmp-line b, .cmp-static b { display: inline-block; margin-right: 10px; padding: 0 8px; border: 1px solid var(--gold); color: var(--gold-hi); font-family: var(--fell); font-size: 17px; font-weight: 400; }
.cmp-now b { font-family: var(--serif); font-size: 15px; }

.plate-wrap.minor .plate { cursor: default; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--paper) var(--noise); }
.sketch-art { width: 520px; }
.sketch-art svg { width: 100%; height: auto; display: block; }
.sketch-name { font-size: 64px; font-weight: 900; letter-spacing: .3em; margin-top: 10px; }
.sketch-en { font-family: var(--fell); font-size: 24px; letter-spacing: .5em; color: var(--red); }
.cmp-static { margin: 30px 0 0 10px; width: 960px; color: #f4ecd6; font-size: 20px; line-height: 1.6; }
.cmp-static p { margin: 0 0 6px; }

.art-card {
  position: absolute; left: 676px; top: 140px; width: 316px; padding: 12px 12px 10px; z-index: 3;
  background: var(--paper-hi) var(--noise); box-shadow: 0 10px 24px rgba(0, 0, 0, .45);
  transform: rotate(2.6deg); transition: opacity .35s, transform .35s; pointer-events: none;
}
.art-card::before { content: ""; position: absolute; left: 50%; top: -12px; width: 90px; height: 24px; margin-left: -45px; background: rgba(230, 216, 170, .8); transform: rotate(-3deg); box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.art-card.hidden { display: block !important; opacity: 0; transform: translateY(-16px) rotate(7deg); }
.ac-in svg { width: 100%; height: auto; display: block; }

.lines { position: absolute; left: 44px; top: 818px; width: 960px; display: flex; gap: 14px; align-items: flex-end; }
.bubble { display: flex; align-items: center; gap: 12px; padding: 7px 16px 7px 7px; max-width: 480px; border-radius: 34px 16px 16px 34px; background: rgba(251, 246, 232, .95); box-shadow: 0 6px 14px rgba(0, 0, 0, .35); font-size: 19px; line-height: 1.4; animation: popIn .4s both; }
.bubble .portrait { width: 54px; height: 54px; border: 2px solid var(--gold); }
.bb-text b { display: block; font-size: 14px; color: var(--red); letter-spacing: .1em; }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.96); } }

.page {
  position: absolute; left: 1034px; top: 118px; width: 534px; height: 654px;
  padding: 24px 28px 16px 40px; display: flex; flex-direction: column;
  background:
    linear-gradient(90deg, transparent 26px, rgba(158, 43, 37, .35) 26px, rgba(158, 43, 37, .35) 28px, transparent 28px),
    repeating-linear-gradient(180deg, transparent 0 37px, rgba(44, 65, 82, .09) 37px 38px),
    var(--noise), var(--paper-hi);
  border-radius: 3px 8px 8px 3px;
  box-shadow: 0 22px 46px rgba(0, 0, 0, .55), inset 8px 0 14px -10px rgba(0, 0, 0, .35);
}
.page-head { border-bottom: 3px double #c9b385; padding-bottom: 8px; }
.ph-en { font-family: var(--fell); font-size: 19px; letter-spacing: .28em; color: var(--red); }
.ph-name { font-size: 56px; line-height: 1.08; margin: 2px 0 2px; font-weight: 900; letter-spacing: .06em; }
.ph-sub { font-size: 16px; color: var(--ink-2); }
.steps { display: flex; gap: 6px; margin: 10px 0 6px; }
.steps span { font-size: 15px; padding: 2px 11px; border-radius: 14px; border: 1px solid #c9b385; color: var(--ink-3); }
.steps span.cur { background: var(--ink); color: var(--paper-hi); border-color: var(--ink); }
.steps span.na { opacity: .35; }
.page-body { flex: 1; min-height: 0; overflow-y: auto; font-size: 22px; line-height: 1.62; padding: 4px 10px 6px 0; user-select: text; -webkit-user-select: text; }
.page-body p { margin: 0 0 .55em; }
.page-body::-webkit-scrollbar, .md-body::-webkit-scrollbar, .cr-scroll::-webkit-scrollbar { width: 8px; }
.page-body::-webkit-scrollbar-thumb, .md-body::-webkit-scrollbar-thumb, .cr-scroll::-webkit-scrollbar-thumb { background: #c9b385; border-radius: 4px; }
.page-foot { display: flex; justify-content: flex-end; gap: 10px; padding-top: 10px; min-height: 58px; }
.quote { margin: 4px 0 12px; padding: 4px 0 4px 14px; border-left: 3px solid var(--gold); font-style: italic; color: var(--ink-2); font-size: 20px; }
.ev-title { font-size: 29px; margin: 2px 0 10px; font-weight: 900; }
.ev-chosen { font-weight: 700; color: var(--red); margin-bottom: 8px; }
.ev-chosen::before { content: "▸ "; }
.ev-result { animation: fadeIn .5s both; }
.ev-random { margin-top: 12px; padding: 10px 14px; border-left: 4px solid var(--ink-3); background: rgba(138, 109, 69, .08); border-radius: 0 6px 6px 0; animation: fadeIn .4s both; }
.ev-random p:last-of-type { margin-bottom: 0; }
.ev-random.hit { border-color: var(--red); background: rgba(158, 43, 37, .08); }
.ev-random.miss { border-color: #4e8a4f; background: rgba(78, 138, 79, .08); }
.ev-random.rolling { font-size: 28px; letter-spacing: .3em; animation: pulse .6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } }
.choices { display: flex; flex-direction: column; gap: 11px; margin-top: 14px; }
.choice {
  display: block; width: 100%; text-align: left; cursor: pointer; padding: 12px 16px 12px;
  background: #fffaf0; border: 1.5px solid var(--ink-3); border-radius: 9px; box-shadow: 0 3px 0 var(--ink-3);
  transition: transform .1s, border-color .15s, box-shadow .1s;
  font-size: 22px; line-height: 1.4;
}
.choice:hover:not(:disabled) { border-color: var(--red); transform: translateY(-1px); box-shadow: 0 4px 0 var(--red); }
.choice:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--red); }
.choice:disabled { opacity: .55; cursor: not-allowed; }
.ch-label { font-weight: 600; }
.ch-hint { font-size: 16px; color: #7a6548; font-style: italic; margin-top: 2px; }
.search-hint { font-size: 17px; color: var(--ink-2); margin: 6px 0; }
.places { display: flex; gap: 14px; margin: 14px 0; }
.place { flex: 1; font-size: 26px; padding: 18px 0; cursor: pointer; border-radius: 10px; border: 2px solid var(--ink); background: #fffaf0; box-shadow: 0 4px 0 var(--ink); font-weight: 700; letter-spacing: .2em; }
.place:hover:not(:disabled) { background: #fff3d8; }
.place:disabled { opacity: .4; cursor: not-allowed; text-decoration: line-through; }
.detours { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.detour { display: grid; grid-template-columns: 112px 1fr; gap: 6px 14px; align-items: start; padding: 10px; border: 1.5px dashed var(--ink-3); border-radius: 9px; background: rgba(255, 250, 240, .8); }
.detour .dt-art { grid-row: span 2; }
.detour .dt-art svg { width: 112px; height: auto; display: block; }
.detour .btn { grid-column: 2; justify-self: end; }
.detour.done { opacity: .6; }
.dt-name { font-size: 22px; font-weight: 700; }
.dt-desc { font-size: 17px; line-height: 1.5; color: var(--ink-2); }
.dt-result { margin-top: 10px; font-size: 19px; }
.tickets { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.ticket {
  display: flex; width: 100%; padding: 0; text-align: left; cursor: pointer; overflow: hidden;
  background: #fbf2dc; border: 1.5px solid var(--ink-2); border-radius: 9px; box-shadow: 0 3px 0 var(--ink-2);
  transition: transform .1s, box-shadow .1s, border-color .15s;
}
.ticket:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--red); box-shadow: 0 4px 0 var(--red); }
.ticket:disabled { opacity: .5; cursor: not-allowed; }
.tk-stub { flex: none; width: 88px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: var(--red); color: #fbf3e0; border-right: 2px dashed #f1e4c4; }
.tk-icon { font-size: 34px; line-height: 1; }
.tk-to { font-size: 14px; }
.tk-main { padding: 10px 14px 12px; flex: 1; }
.tk-label { font-size: 21px; font-weight: 700; line-height: 1.35; }
.tk-desc { font-size: 16px; color: var(--ink-2); line-height: 1.45; margin-top: 2px; }

/* ============================================================ 旅途 */
.leg-banner {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  min-width: 560px; padding: 12px 40px 10px; text-align: center;
  background: var(--paper-hi) var(--noise); border: 2px solid var(--ink); border-radius: 6px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .4); animation: fadeUp .5s both;
}
.leg-banner::before, .leg-banner::after { content: ""; position: absolute; top: 50%; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%; background: #3a2c1e; }
.leg-banner::before { left: -12px; }
.leg-banner::after { right: -12px; }
.lb-route { font-size: 32px; font-weight: 900; letter-spacing: .08em; }
.lb-route span { color: var(--red); margin: 0 6px; }
.lb-sub { font-size: 18px; color: var(--ink-2); }
.lb-hint { font-size: 13px; color: #9a8466; margin-top: 2px; }
@keyframes fadeUp { from { opacity: 0; transform: translate(-50%, 20px); } }

/* ============================================================ 弹窗 */
#modal, #overlay { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; }
#modal.open, #overlay.open { display: flex; }
#modal.dim, #overlay.dim { background: rgba(20, 14, 9, .58); animation: fadeIn .3s both; }
.modal {
  width: 680px; max-height: 840px; display: flex; flex-direction: column;
  padding: 24px 32px 20px; border-radius: 8px;
  background: var(--noise), var(--paper-hi); box-shadow: 0 30px 70px rgba(0, 0, 0, .6);
  animation: popIn .35s both;
}
.modal h2 { margin: 0 0 12px; font-size: 32px; font-weight: 900; }
.md-art { position: relative; height: 290px; margin: -24px -32px 14px; overflow: hidden; background: #ead9b2; display: flex; align-items: center; justify-content: center; border-bottom: 2px solid var(--ink-3); }
.md-art > svg { height: 92%; width: auto; }
.md-art .anim-host { z-index: 2; }
.md-body { flex: 1; min-height: 0; overflow-y: auto; font-size: 22px; line-height: 1.6; }
.md-body p { margin: 0 0 .5em; }
.md-foot { display: flex; justify-content: flex-end; gap: 10px; padding-top: 12px; }
.set-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px dashed #c9b385; font-size: 21px; }
.credits { width: 1360px; }
.cr-scroll { max-height: 620px; overflow: auto; font-size: 16px; user-select: text; -webkit-user-select: text; }
.credits table { width: 100%; border-collapse: collapse; }
.credits th, .credits td { padding: 6px 8px; border-bottom: 1px solid #e0d1a8; text-align: left; vertical-align: top; }
.credits th { background: #efe3c4; position: sticky; top: 0; }
.credits tr.miss td { color: #8a7a62; }
.credits td:nth-child(-n+3), .credits th:nth-child(-n+3), .credits td:last-child, .credits th:last-child { white-space: nowrap; }
.credits tr.ok td:nth-child(3) { color: #3f5e24; font-weight: 700; }
.credits a { color: var(--red); }
.credits h3 { margin: 18px 0 6px; }
.credits li { margin-bottom: 4px; }
.about p { font-size: 21px; line-height: 1.7; margin: 0 0 .7em; }

/* ============================================================ 日记本 */
.book-wrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.book {
  position: relative; width: 1380px; height: 800px; border-radius: 14px;
  background: linear-gradient(135deg, #6a3d22, #3b2113); border: 2px solid #8a5a32;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .7), inset 0 0 0 10px #4a2a16;
  animation: popIn .4s both;
}
.book-pages {
  position: absolute; left: 34px; right: 34px; top: 30px; bottom: 66px; display: grid; grid-template-columns: 1fr 1fr;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0) 46%, rgba(80, 50, 20, .28) 49.6%, rgba(40, 25, 10, .45) 50%, rgba(80, 50, 20, .28) 50.4%, rgba(0, 0, 0, 0) 54%), var(--noise), var(--paper);
  border-radius: 4px; box-shadow: inset 0 0 40px rgba(120, 80, 30, .25);
}
.book-pages.turn-l { animation: turnL .4s ease-out; }
.book-pages.turn-r { animation: turnR .4s ease-out; }
@keyframes turnL { from { opacity: .3; transform: perspective(1800px) rotateY(-6deg); } }
@keyframes turnR { from { opacity: .3; transform: perspective(1800px) rotateY(6deg); } }
.bpage { padding: 34px 56px 26px; min-height: 0; display: flex; flex-direction: column; }
.book-tabs { position: absolute; top: -34px; left: 70px; display: flex; gap: 8px; }
.book-tabs button { font-size: 18px; padding: 6px 22px 12px; border: none; border-radius: 8px 8px 0 0; cursor: pointer; background: #8a5a32; color: #f1e4c4; }
.book-tabs button.cur { background: var(--red); }
.book-tabs button:disabled { opacity: .4; cursor: not-allowed; }
.book-nav { position: absolute; top: 50%; width: 56px; height: 90px; margin-top: -45px; border: none; border-radius: 8px; cursor: pointer; font-size: 60px; line-height: 80px; background: rgba(43, 25, 12, .75); color: var(--gold-hi); }
.book-nav.prev { left: -70px; }
.book-nav.next { right: -70px; }
.book-nav:disabled { opacity: .25; cursor: default; }
.book-close { position: absolute; right: -18px; top: -18px; width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--gold); background: var(--ink); color: #fbf3e0; font-size: 22px; cursor: pointer; }
.book-foot { position: absolute; left: 0; right: 0; bottom: 20px; text-align: center; color: var(--gold-hi); font-size: 18px; letter-spacing: .08em; }
.jcard { height: 100%; display: flex; flex-direction: column; position: relative; animation: fadeIn .4s both; }
.jc-top { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid #c9b385; padding-bottom: 6px; }
.jc-place { color: var(--red); font-size: 20px; letter-spacing: .14em; font-weight: 700; }
.jc-date { font-family: var(--fell); font-size: 20px; color: var(--ink-2); }
.jc-art { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 12px 0; }
.jc-art svg { max-width: 100%; max-height: 100%; width: 100%; height: 100%; }
.jc-art.f-night svg { filter: sepia(.65) hue-rotate(178deg) saturate(1.25) brightness(.82); }
.jc-art.f-dusk svg { filter: sepia(.45) hue-rotate(-18deg) saturate(1.6) brightness(.95); }
.jc-art.f-mist svg { filter: brightness(1.08) contrast(.75) blur(.4px); }
.jc-art.q { font-size: 150px; color: #d2bf92; font-family: var(--fell); }
.jc-title { font-size: 34px; font-weight: 900; margin-top: 4px; }
.jc-text { font-family: var(--hand); font-size: 25px; line-height: 1.65; margin-top: 6px; color: #2f2418; min-height: 3.3em; }
.jc-mark { position: absolute; right: 4px; top: 54px; width: 92px; height: 92px; border-radius: 50%; border: 3px solid rgba(158, 43, 37, .7); color: rgba(158, 43, 37, .8); display: flex; align-items: center; justify-content: center; text-align: center; font-size: 15px; font-weight: 900; transform: rotate(-14deg); padding: 10px; line-height: 1.2; box-shadow: inset 0 0 0 4px rgba(241, 228, 196, .6), inset 0 0 0 5px rgba(158, 43, 37, .5); }
.jcard.locked .jc-title { color: #a8957a; }
.jc-empty, .jc-blank { margin: auto; text-align: center; font-size: 26px; color: var(--ink-2); }
.jc-empty p { margin: 0 0 .5em; }
.jc-blank { font-size: 20px; color: #b7a37c; font-style: italic; }

/* ============================================================ 过场（电影） */
.cinema { position: absolute; inset: 0; background: #120d09; }
.cine-art { position: absolute; inset: 0; opacity: 0; transition: opacity 1s, filter 1.2s; }
.cinema.in .cine-art { opacity: 1; }
.cine-art svg { width: 100%; height: 100%; display: block; }
.cinema.dark .cine-art { filter: brightness(.62) saturate(.75); }
.cinema.dark.lit .cine-art { filter: brightness(.95) saturate(1); }
.cinema.warm .cine-art { filter: saturate(1.15) sepia(.12); }
.cinema.burst .cine-art { animation: flash .6s; }
@keyframes flash { 0% { filter: brightness(1.8); } 100% { filter: brightness(.62) saturate(.75); } }
.cine-sub {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 70px 200px 34px; text-align: center;
  background: linear-gradient(to bottom, rgba(14, 10, 6, 0), rgba(14, 10, 6, .88) 38%);
  color: #f4ecd6; font-size: 27px; line-height: 1.6;
}
.cine-text p { margin: 0 0 .3em; animation: fadeIn .7s both; }
.cine-text.big p { font-size: 44px; font-weight: 900; letter-spacing: .12em; }
.cine-text.burst p:first-child { font-size: 64px; font-weight: 900; color: #f6d27a; animation: shake .5s both; }
.cine-text.burst p { font-size: 25px; }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-10px) rotate(-1deg); } 40% { transform: translateX(10px) rotate(1deg); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
.cine-text.dlg { display: flex; justify-content: center; }
.bubble.big { max-width: 960px; font-size: 26px; text-align: left; color: var(--ink); padding: 10px 26px 10px 10px; }
.bubble.big .portrait { width: 84px; height: 84px; }
.bubble.big .bb-text b { font-size: 17px; }
.cine-foot { margin-top: 16px; min-height: 52px; }

.explain { position: absolute; inset: 0; background: #efe2c2; }
.ex-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ex-text { position: absolute; left: 70px; top: 300px; width: 470px; font-size: 25px; line-height: 1.6; }
.ex-text p { margin: 0 0 .7em; opacity: .55; }
.ex-text p.new, .ex-text p:last-child { opacity: 1; }
.ex-text p.new { animation: fadeIn .6s both; font-weight: 700; }
.ex-foot { position: absolute; right: 90px; bottom: 70px; }

.sprint-host { position: absolute; inset: 0; background: #0b0907; }

/* ============================================================ 结局 */
.ending { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(18, 12, 8, .6); }
.ending .paper {
  width: 1500px; height: 860px; padding: 22px 46px 20px; display: flex; flex-direction: column;
  background: var(--noise), #f3ead2; box-shadow: 0 30px 80px rgba(0, 0, 0, .65);
  transform: translateY(40px) rotate(-1deg); opacity: 0; transition: transform .9s cubic-bezier(.2, 1.2, .4, 1), opacity .7s;
}
.ending.in .paper { transform: rotate(-.4deg); opacity: 1; }
.mast { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 5px double var(--ink); padding-bottom: 6px; }
.mast span { font-family: var(--fell); font-size: 17px; color: var(--ink-2); letter-spacing: .1em; }
.mast b { font-size: 50px; font-weight: 900; letter-spacing: .35em; }
.en-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 640px; gap: 38px; margin-top: 16px; }
.en-main { min-height: 0; overflow-y: auto; padding-right: 8px; }
.en-title { font-size: 46px; line-height: 1.2; margin: 0 0 12px; font-weight: 900; }
.ending.lost .en-title { color: #4a3a2a; }
.en-text { font-size: 23px; line-height: 1.7; }
.en-text p { margin: 0 0 .5em; }
.en-extra { margin-top: 12px; padding: 10px 0; border-top: 1px solid var(--ink-3); border-bottom: 1px solid var(--ink-3); color: var(--red); font-size: 24px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.en-extra p { margin: 0; }
.en-aouda { display: flex; gap: 16px; align-items: flex-start; margin-top: 14px; font-size: 21px; line-height: 1.65; font-style: italic; }
.en-aouda .portrait { width: 76px; height: 76px; border: 2px solid var(--gold); }
.en-aouda p { margin: 0 0 .4em; }
.en-map { position: relative; height: 270px; border: 2px solid var(--ink); background: #c6cdb6; overflow: hidden; }
.em-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.em-svg .rt-sea .rt-a { stroke-width: 2.2px; stroke-dasharray: 6 4; }
.em-svg .rt-rail .rt-b { stroke-width: 6px; stroke-dasharray: 1.2 5; }
.em-dot { fill: var(--red); stroke: #fbf6e8; stroke-width: .5; }
.em-star { fill: var(--gold-hi); stroke: var(--ink); stroke-width: 1; }
.em-cap { position: absolute; left: 8px; bottom: 4px; font-size: 14px; color: var(--ink-2); background: rgba(243, 234, 210, .85); padding: 1px 8px; }
.en-stats { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 26px; }
.en-stats div { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px dotted var(--ink-3); padding: 5px 0; font-size: 18px; color: var(--ink-2); }
.en-stats b { font-family: var(--num); font-size: 23px; color: var(--ink); font-weight: 400; }
.en-final { text-align: center; font-size: 24px; font-style: italic; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--ink-3); }
.en-btns { display: flex; justify-content: center; gap: 18px; margin-top: 12px; }

/* ============================================================ 标题 */
.title { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, rgba(20, 14, 9, .08), rgba(20, 14, 9, .55)); }
.cartouche {
  position: relative; width: 780px; padding: 34px 64px 30px; text-align: center;
  background: var(--noise), rgba(251, 246, 232, .96);
  border: 3px double var(--ink); outline: 1.5px solid var(--ink); outline-offset: 8px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .5);
  animation: popIn .8s both;
}
.cartouche::before, .cartouche::after { content: "❦"; position: absolute; top: 50%; font-size: 40px; color: var(--red); margin-top: -26px; }
.cartouche::before { left: 18px; transform: scaleX(-1); }
.cartouche::after { right: 18px; }
.ct-orn { font-family: var(--fell); font-size: 24px; color: var(--red); letter-spacing: .4em; }
.cartouche h1 { margin: 2px 0 0; font-size: 156px; line-height: 1.04; font-weight: 900; letter-spacing: .14em; padding-left: .14em; text-shadow: 3px 3px 0 rgba(176, 141, 60, .35); }
.ct-en { font-family: var(--fell); font-size: 22px; letter-spacing: .2em; color: var(--ink-2); white-space: nowrap; }
.ct-line { height: 2px; margin: 16px 60px; background: linear-gradient(90deg, transparent, var(--ink), transparent); position: relative; }
.ct-line::after { content: "◆"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -54%); font-size: 16px; background: #fbf6e8; padding: 0 8px; color: var(--red); }
.ct-pitch { font-size: 25px; line-height: 1.6; margin: 0 0 22px; }
.ct-btns { display: flex; justify-content: center; align-items: center; gap: 14px; }
.ct-rec { margin-top: 20px; font-size: 16px; color: var(--ink-2); }
.title-foot { position: absolute; left: 0; right: 0; bottom: 16px; text-align: center; color: #fbf3e0; font-size: 16px; text-shadow: 0 1px 4px #000; }

.intro-bar {
  position: absolute; left: 50%; bottom: 48px; width: 1120px; transform: translateX(-50%);
  padding: 24px 40px 18px; background: var(--noise), rgba(251, 246, 232, .97);
  border: 2px solid var(--ink); box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
}
.intro-bar.show .ib-text { animation: fadeIn .7s both; }
.ib-year { position: absolute; top: -38px; left: 34px; padding: 0 14px; font-family: var(--fell); font-size: 46px; color: var(--red); background: rgba(251, 246, 232, .97); border: 2px solid var(--ink); border-bottom: none; line-height: 1.2; }
.ib-year:empty { display: none; }
.ib-text { font-size: 32px; line-height: 1.55; min-height: 100px; }
.ib-foot { display: flex; justify-content: flex-end; gap: 12px; margin-top: 8px; }

/* ============================================================ 特效 */
.fx-float { position: absolute; transform: translateX(-50%); font-size: 28px; font-weight: 900; font-family: var(--num); text-shadow: 0 2px 6px rgba(0, 0, 0, .8); animation: floatUp 1.8s ease-out forwards; white-space: nowrap; }
.fx-float.money { color: #ffd98a; }
.fx-float.time { color: #cfe6ff; }
.fx-float.fix { color: #ff9f8f; }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, 10px); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, 70px); } }
.fx-page {
  position: absolute; left: 650px; top: 270px; width: 300px; padding: 12px 12px 10px; text-align: center;
  background: var(--noise), var(--paper-hi); box-shadow: 0 16px 40px rgba(0, 0, 0, .55);
  opacity: 0; transform: scale(.6) rotate(-6deg); transition: opacity .4s, transform .45s cubic-bezier(.2, 1.4, .4, 1);
}
.fx-page.show { opacity: 1; transform: scale(1) rotate(-2deg); }
.fx-page.fly { transition: transform .75s cubic-bezier(.6, 0, .9, .6), opacity .75s; transform: translate(876px, 540px) scale(.12) rotate(24deg); opacity: .3; }
.fxp-art svg { width: 100%; height: auto; display: block; }
.fxp-art.f-night svg { filter: sepia(.65) hue-rotate(178deg) saturate(1.25) brightness(.82); }
.fxp-art.f-dusk svg { filter: sepia(.45) hue-rotate(-18deg) saturate(1.6); }
.fxp-art.f-mist svg { filter: brightness(1.08) contrast(.75); }
.fxp-t { font-size: 22px; font-weight: 900; margin-top: 6px; }
.fxp-new { position: absolute; right: -14px; top: -14px; background: var(--red); color: #fff; font-size: 15px; padding: 4px 10px; border-radius: 14px; transform: rotate(10deg); }

#toast { position: absolute; left: 50%; top: 128px; transform: translateX(-50%); max-width: 900px; padding: 12px 24px; border-radius: 8px; background: rgba(33, 23, 15, .94); color: #f4ecd6; font-size: 19px; line-height: 1.5; opacity: 0; pointer-events: none; transition: opacity .3s; border: 1px solid var(--gold); }
#toast.show { opacity: 1; }

/* ============================================================ 调试面板 */
#debug { position: absolute; right: 10px; top: 120px; width: 600px; padding: 10px 12px; border-radius: 8px; background: rgba(8, 6, 4, .93); color: #d8f0e0; font: 13px/1.45 Consolas, "Courier New", monospace; user-select: text; -webkit-user-select: text; }
#debug pre { margin: 6px 0 8px; white-space: pre-wrap; color: #bfe8cf; }
.dbg-head { font-weight: 700; color: #ffd98a; }
.dbg-head span { font-weight: 400; color: #8aa; }
.dbg-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 5px 0; }
#debug button, #debug select { font: 12px Consolas, monospace; padding: 3px 8px; background: #2a3a30; color: #e0f4e8; border: 1px solid #4a6a58; border-radius: 4px; cursor: pointer; }
#debug label { display: flex; align-items: center; gap: 3px; }

/* ============================================================ 竖屏提示与错误 */
#rotateHint { position: fixed; inset: 0; z-index: 200; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: #17110c; color: #f4ecd6; text-align: center; font-size: 18px; padding: 30px; }
.rh-phone { font-size: 64px; animation: rot 2s ease-in-out infinite; }
@keyframes rot { 50% { transform: rotate(-90deg); } }
#rotateHint button { font-size: 16px; padding: 8px 20px; border-radius: 6px; border: 1px solid var(--gold); background: transparent; color: #f4ecd6; }
/* ============================================================ 竖屏布局（舞台 900×1600，手机竖着拿时自动启用） */
body.portrait #hud { height: 290px; padding: 12px 16px 0; background: linear-gradient(to bottom, rgba(33, 23, 15, .95) 0%, rgba(33, 23, 15, .85) 70%, rgba(33, 23, 15, 0) 100%); }
body.portrait .purse { min-width: 0; }
body.portrait .hud-center { top: 112px; }
body.portrait .fixbox { width: 130px; }
body.portrait .st-left { left: 16px; top: 262px; width: 868px; }
body.portrait .plate { width: 852px; height: 479px; margin-left: 8px; }
body.portrait .slider { width: 852px; margin: 26px 0 0 8px; }
body.portrait .cmp-line { width: 852px; height: 96px; margin-left: 8px; font-size: 22px; }
body.portrait .cmp-static { width: 852px; }
body.portrait .plate-wrap.minor .sketch-art { width: 420px; }
body.portrait .art-card { left: 566px; top: 274px; width: 290px; }
body.portrait .page { left: 16px; top: 926px; width: 868px; height: 600px; padding: 20px 26px 14px 40px; }
body.portrait .ph-name { font-size: 48px; }
body.portrait .lines { left: 16px; top: 1536px; width: 740px; }
body.portrait .bubble { max-width: 360px; font-size: 16px; padding-block: 4px; }
body.portrait .bubble .portrait { width: 46px; height: 46px; }
body.portrait .cartouche { width: 840px; padding: 30px 40px 26px; }
body.portrait .cartouche h1 { font-size: 130px; }
body.portrait .intro-bar { width: 860px; bottom: 80px; }
body.portrait .leg-banner { min-width: 0; width: 820px; bottom: 60px; }
body.portrait .modal { max-width: 860px; max-height: 1400px; }
body.portrait .credits { width: 870px; }
body.portrait .credits .cr-scroll { max-height: 1200px; font-size: 14px; }
body.portrait .book { width: 860px; height: 1400px; }
body.portrait .book-pages { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; left: 24px; right: 24px; bottom: 100px; background: var(--noise), var(--paper); }
body.portrait .bpage.left { border-bottom: 2px dashed #c9b385; }
body.portrait .book-nav { top: auto; bottom: 18px; margin-top: 0; height: 64px; line-height: 56px; font-size: 48px; }
body.portrait .book-nav.prev { left: 40px; }
body.portrait .book-nav.next { right: 40px; }
body.portrait .book-foot { bottom: 40px; }
body.portrait .book-close { right: 6px; top: -22px; }
body.portrait .jc-text { font-size: 24px; }
body.portrait .ending .paper { width: 872px; height: 1560px; padding: 18px 24px; overflow-y: auto; }
body.portrait .mast { flex-wrap: wrap; justify-content: center; gap: 4px 16px; }
body.portrait .mast b { font-size: 40px; order: -1; width: 100%; text-align: center; }
body.portrait .en-cols { grid-template-columns: 1fr; flex: none; align-content: start; }
body.portrait .en-map { height: 300px; }
body.portrait .en-main { overflow: visible; }
body.portrait .en-title { font-size: 40px; }
body.portrait .cine-sub { padding: 60px 40px 50px; font-size: 30px; }
body.portrait .cine-text.big p { font-size: 40px; }
body.portrait .bubble.big { max-width: 820px; }
body.portrait .ex-text { left: 60px; top: 1100px; width: 780px; }
body.portrait .ex-foot { right: 60px; bottom: 60px; }
body.portrait .sprint-host { inset: auto 0; top: 547px; height: 506px; }
body.portrait .fx-page { left: 300px; top: 620px; }
body.portrait .fx-page.fly { transform: translate(380px, 820px) scale(.12) rotate(24deg); }
body.portrait #toast { top: 300px; max-width: 840px; }
body.portrait #debug { left: 20px; right: auto; width: 860px; top: 300px; }
.fatal { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--paper); font-size: 24px; padding: 80px; text-align: center; }
.fatal h1 { font-size: 80px; margin: 0 0 20px; }

/* 小屏（舞台缩得很小时）放大文字，保证手机上可读 */
body.compact .page-body, body.compact .md-body { font-size: 26px; line-height: 1.55; }
body.compact .choice { font-size: 25px; }
body.compact .ch-hint { font-size: 19px; }
body.compact .chip { font-size: 19px; }
body.compact .tk-label { font-size: 24px; }
body.compact .tk-desc, body.compact .dt-desc { font-size: 19px; }
body.compact .btn { font-size: 25px; padding: 12px 28px; }
body.compact .cmp-line { font-size: 23px; }
body.compact .bubble { font-size: 22px; }
body.compact .jc-text { font-size: 28px; }
body.compact .cine-sub { font-size: 31px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
