/* ══════════════════════════════════════════════
   OneShot · 世界机器纪念站
   设计语言取自游戏本体：
   - 深色底 + 四色荧光（蓝/绿/红/黄）
   - RMXP 式对话框（深蓝底白双边框）
   - Ed_Message 式黑底居中弹字
   - 全站像素化 image-rendering
   ══════════════════════════════════════════════ */

@font-face {
  font-family: 'Terminus';
  src: url('../assets/fonts/TerminusTTF-Bold.ttf') format('truetype');
  font-display: swap;
}

:root {
  --bg: #06070d;
  --bg2: #0b0e1a;
  --ink: #e8e6f0;
  --dim: #8b8aa0;
  --blue: #4fc3ff;
  --green: #7dff8a;
  --red: #ff5d5d;
  --yellow: #ffd77a;
  --purple: #c9a0ff;
  --cyan: #9fffef;
  --box: #10142a;
  --line: #ffffff;
  --mono: 'Terminus', 'Cascadia Mono', Consolas, monospace;
  --cjk: 'WenQuanYi Micro Hei', 'Microsoft YaHei', 'PingFang SC', sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--cjk);
  font-size: 16px;
  line-height: 1.85;
  overflow-x: hidden;
}
img { image-rendering: pixelated; }
kbd {
  font-family: var(--mono); font-size: .8em;
  border: 1px solid #4a4a66; border-bottom-width: 3px;
  border-radius: 4px; padding: 0 6px; background: #14172b;
}

/* ── 全局层 ─────────────────────────── */
#phosphor-canvas {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: .8;
}
.crt {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.14) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}
.crt::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 58%, rgba(0,0,0,.5) 100%);
}

/* ── 顶栏 ─────────────────────────── */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; gap: 14px;
  padding: 8px 18px;
  background: rgba(8,10,20,.82);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid #232848;
}
.brand {
  display: flex; align-items: center; gap: 8px;
  color: var(--ink); text-decoration: none;
  font-family: var(--mono); font-weight: bold; font-size: 18px; letter-spacing: 1px;
}
.brand small { color: var(--dim); font-size: 11px; margin-left: 2px; }
.bulb-mini {
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff7d6, #ffd977 55%, #e88f2a);
  box-shadow: 0 0 10px 2px rgba(255, 215, 122, .7);
}
.nav-links { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
.nav-links a {
  color: var(--dim); text-decoration: none; font-size: 13px;
  padding: 3px 8px; border-radius: 3px; transition: .15s;
}
.nav-links a:hover { color: #fff; background: #1a1f3a; }
.nav-right { display: flex; align-items: center; gap: 8px; }
.pill {
  font-size: 12px; color: var(--dim);
  border: 1px solid #2c3154; padding: 2px 10px; border-radius: 999px;
  white-space: nowrap; max-width: 38vw; overflow: hidden; text-overflow: ellipsis;
}
.pill.on { color: var(--green); border-color: var(--green); }
.icon-btn {
  background: #14172b; color: var(--ink); border: 1px solid #2c3154;
  width: 32px; height: 28px; cursor: pointer; border-radius: 4px; font-size: 14px;
}
.icon-btn:hover { border-color: var(--yellow); color: var(--yellow); }
.icon-btn.off { color: #555; }

/* ── 成就抽屉 ─────────────────────── */
#achv-panel {
  position: fixed; top: 54px; right: 12px; z-index: 55;
  width: min(430px, calc(100vw - 24px));
  background: var(--box); border: 2px solid #fff;
  box-shadow: 0 0 0 2px #000, 0 18px 50px rgba(0,0,0,.7);
  padding: 16px 18px; max-height: 72vh; overflow: auto;
}
#achv-panel h3 { margin: 0 0 6px; font-size: 17px; }
#achv-panel h3 small { color: var(--yellow); font-family: var(--mono); }
.achv-hint { color: var(--dim); font-size: 13px; margin: 0 0 12px; }
.achv-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 6px; border-top: 1px dashed #2c3154; font-size: 13.5px;
}
.achv-item .ic { font-size: 20px; filter: grayscale(1) brightness(.55); }
.achv-item.got .ic { filter: none; }
.achv-item b { display: block; font-size: 14px; }
.achv-item.got b { color: var(--yellow); }
.achv-item span { color: var(--dim); font-size: 12.5px; }
.achv-item.locked b { color: #6c6f8a; }
.ghost-btn {
  margin-top: 12px; background: none; color: var(--dim);
  border: 1px solid #2c3154; padding: 6px 18px; cursor: pointer; font-family: var(--cjk);
}
.ghost-btn:hover { color: #fff; border-color: #fff; }

/* ── 开机 ─────────────────────────── */
#boot {
  position: fixed; inset: 0; z-index: 100;
  background: #020208;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .8s;
}
#boot.done { opacity: 0; pointer-events: none; }
.boot-inner { width: min(680px, 92vw); }
.term {
  font-family: var(--mono); font-size: 15px; line-height: 1.7;
  color: #b9f5c8; white-space: pre-wrap; min-height: 200px; margin: 0;
  text-shadow: 0 0 6px rgba(120, 255, 170, .35);
}
#boot-confirm { margin-top: 22px; animation: fadein .6s; }
.boot-ask { font-size: 19px; margin: 0 0 6px; }
.boot-ask-sub { color: var(--yellow); font-size: 16px; margin: 0 0 18px; }
.boot-note { color: var(--dim); font-size: 13px; }
.boot-actions { margin: 10px 0 20px; }
#godname {
  display: block; width: 100%; max-width: 340px; margin: 14px 0;
  background: #0d1122; border: 2px solid #fff; color: #fff;
  font-family: var(--mono); font-size: 18px; padding: 8px 12px; outline: none;
}
#godname:focus { border-color: var(--yellow); }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }

/* ── 按钮 ─────────────────────────── */
.main-btn, .pixel-btn {
  display: inline-block; cursor: pointer; text-decoration: none;
  font-family: var(--cjk); font-size: 15px;
  background: #171b33; color: var(--ink);
  border: 2px solid #fff; padding: 9px 22px;
  box-shadow: 0 0 0 2px #000, 4px 4px 0 rgba(0,0,0,.55);
  transition: transform .08s, background .15s;
}
.main-btn:hover, .pixel-btn:hover { background: #232a4d; }
.main-btn:active, .pixel-btn:active { transform: translate(2px,2px); box-shadow: 0 0 0 2px #000; }
.pixel-btn.danger { border-color: var(--red); color: var(--red); }
.pixel-btn.danger:hover { background: #2a1420; }

/* ── 标题画面 ─────────────────────── */
#title {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 90px 20px 40px;
}
.title-wrap { max-width: 860px; }
.logo {
  display: inline-flex; align-items: flex-end; gap: 2px;
  font-family: var(--mono); font-weight: bold;
  font-size: clamp(56px, 11vw, 108px); line-height: .9;
  color: #fff; letter-spacing: 2px;
  text-shadow: 0 0 24px rgba(255, 215, 122, .35), 0 0 2px #fff;
}
.logo-bulb { display: inline-flex; align-items: flex-end; transform: translateY(4px); }
.logo-bulb svg { filter: drop-shadow(0 0 18px rgba(255, 217, 119, .8)); animation: bulbPulse 3s ease-in-out infinite; }
@keyframes bulbPulse { 0%,100% { filter: drop-shadow(0 0 14px rgba(255,217,119,.65)); } 50% { filter: drop-shadow(0 0 30px rgba(255,217,119,.95)); } }
.tagline { font-size: clamp(15px, 2.2vw, 19px); color: var(--ink); margin: 26px 0 8px; }
.title-sub { color: var(--dim); font-size: 13.5px; line-height: 2; margin: 0 0 30px; }
.dim { color: var(--dim); }
.title-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 18px; }
.keys-hint { color: var(--dim); font-size: 12.5px; }
.title-art { margin-top: 42px; opacity: .92; }
.title-art img { width: min(320px, 80vw); border: 2px solid #2c3154; box-shadow: 0 0 60px rgba(201,160,255,.15); }
.scroll-cue { position: absolute; bottom: 14px; color: var(--dim); animation: bob 1.6s infinite; font-size: 18px; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* ── 章节 ─────────────────────────── */
.chapter { position: relative; z-index: 1; padding: 90px 0 70px; border-top: 1px solid #161a30; }
.chapter-body { max-width: 1060px; margin: 0 auto; padding: 0 22px; }
.chapter-head {
  max-width: 1060px; margin: 0 auto 34px; padding: 0 22px;
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
}
.chapter-head h1 { font-size: clamp(26px, 4.5vw, 40px); margin: 0; letter-spacing: 1px; }
.chapter-en { font-family: var(--mono); color: var(--dim); font-size: 14px; margin: 0; }
.phosphor-dot {
  width: 14px; height: 14px; border-radius: 50%; align-self: center;
  background: var(--c); box-shadow: 0 0 14px 3px var(--c);
}
.prose { max-width: 760px; }
.prose p { margin: 14px 0; }
.prose b { color: #fff; }
.prose code, .exhibit code, .steps code, .lore-card code {
  font-family: var(--mono); font-size: .88em; color: var(--cyan);
  background: #0e1224; border: 1px solid #232848; padding: 0 5px; border-radius: 3px;
}

/* 引文（普通窗口风） */
blockquote.quote {
  margin: 22px 0; padding: 16px 20px;
  background: var(--box);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #000;
  font-size: 16.5px; line-height: 2;
}
blockquote.quote cite { display: block; margin-top: 8px; color: var(--dim); font-size: 12.5px; font-style: normal; }
blockquote.quote.ed {
  background: #05060c; border-color: #3a3f5e; text-align: center;
  font-family: var(--mono); color: #dfe6ff; letter-spacing: 1px;
}
blockquote.quote.inline, p.quote.inline { padding: 10px 16px; font-size: 15px; }
p.quote.inline { margin: 10px 0; background: var(--box); border: 2px solid #fff; box-shadow: 0 0 0 2px #000; }

/* 主题色微调 */
.theme-barrens  .chapter-head h1 { color: var(--blue); }
.theme-glen     .chapter-head h1 { color: var(--green); }
.theme-refuge   .chapter-head h1 { color: var(--red); }
.theme-tower    .chapter-head h1 { color: var(--yellow); }
.theme-solstice .chapter-head h1 { color: var(--cyan); }
.theme-meta     .chapter-head h1 { color: var(--purple); }

/* ── 媒体小件 ─────────────────────── */
.sprite-stage { margin: 30px 0; text-align: center; }
.sprite-cap { color: var(--dim); font-size: 12px; margin-top: 10px; }
.sheep-row .sprite { cursor: pointer; }
.sprite-cap { text-align: center; }

/* 像素小人：RMXP 角色表 192x256, 帧 48x64 */
.sprite {
  --s: 2;
  width: calc(48px * var(--s)); height: calc(64px * var(--s));
  background-size: calc(192px * var(--s)) calc(256px * var(--s));
  background-repeat: no-repeat;
  image-rendering: pixelated;
  display: inline-block;
  background-position: calc(-48px * var(--s) * var(--f, 1)) calc(-64px * var(--s) * var(--r, 0));
}
.sprite.big { --s: 5; }
.sprite.niko-down { --r: 0; --f: 1; animation: walkdown 0.7s steps(1, end) infinite; }
@keyframes walkdown {
  0%   { background-position: 0 0; }
  25%  { background-position: calc(-48px*2) 0; }
  50%  { background-position: calc(-96px*2) 0; }
  75%  { background-position: calc(-48px*2) 0; }
  100% { background-position: 0 0; }
}

/* ── 序章谜题 ─────────────────────── */
.widget {
  margin: 34px 0; padding: 22px;
  background: rgba(20, 24, 46, .6);
  border: 1px solid #232848; border-left: 4px solid var(--yellow);
}
.widget-title { margin: 0 0 6px; font-size: 17px; color: var(--yellow); }
.widget-desc { color: var(--dim); font-size: 13.5px; margin: 0 0 16px; }
.tv-scene, .pc-scene { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin: 12px 0; }
.tv-window, .pc-screen {
  background: #04050a; border: 3px solid #2c3154; min-width: 220px;
  min-height: 110px; display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); color: var(--dim); font-size: 14px;
  box-shadow: inset 0 0 30px rgba(0,0,0,.8);
}
.tv-digits { display: flex; gap: 18px; }
.tv-digits b {
  font-family: var(--mono); font-size: 34px; padding: 4px 10px;
}
.tv-digits b:nth-child(1) { color: var(--red); } .tv-digits b:nth-child(2) { color: var(--green); }
.tv-digits b:nth-child(3) { color: var(--blue); } .tv-digits b:nth-child(4) { color: var(--yellow); }
.pc-screen { flex: 1; justify-content: flex-start; padding: 10px 14px; color: #b9f5c8; white-space: pre-wrap; }
.pc-input { display: flex; gap: 8px; }
.pc-input input {
  background: #0d1122; border: 2px solid #fff; color: #fff;
  font-family: var(--mono); font-size: 15px; padding: 7px 10px; width: 150px; outline: none;
}
.pc-hint { color: var(--dim); font-size: 13px; margin: 6px 0 0; min-height: 20px; }
.pc-hint.ok { color: var(--green); }
.pc-hint.bad { color: var(--red); }

/* ── 区域节拍卡 ────────────────────── */
.beat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 16px; margin: 30px 0; }
.beat {
  background: rgba(16,20,42,.65); border: 1px solid #232848; padding: 16px 18px;
}
.beat h4 { margin: 0 0 8px; font-size: 15.5px; color: #fff; }
.beat p { margin: 0; font-size: 13.5px; color: #c7c5da; }

/* ── 世界观卡片 ────────────────────── */
.lore-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin: 10px 0 24px; }
.lore-card {
  background: rgba(16,20,42,.65); border: 1px solid #232848; padding: 18px 20px;
}
.lore-card h4 { margin: 0 0 10px; color: var(--cyan); font-size: 16px; }
.lore-card p { margin: 0; font-size: 13.8px; color: #c7c5da; }

/* ── 展品 ─────────────────────────── */
.exhibits { display: flex; flex-direction: column; gap: 22px; margin-top: 26px; }
.exhibit {
  background: rgba(14,17,34,.72);
  border: 1px solid #232848; border-left: 4px solid var(--purple);
  padding: 22px 24px;
}
.exhibit h3 { margin: 0 0 12px; font-size: 17.5px; color: var(--purple); }
.exhibit p { font-size: 14.2px; color: #c9c7dc; margin: 10px 0; }
.exhibit-demo { margin-top: 14px; }

/* 假窗口（关窗展品） */
.fake-os { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.fake-win {
  width: 280px; background: #10142a; border: 2px solid #fff;
  box-shadow: 0 0 0 2px #000, 8px 8px 0 rgba(0,0,0,.5);
}
.fake-titlebar {
  display: flex; justify-content: space-between; align-items: center;
  background: #2a2f55; padding: 4px 8px; font-family: var(--mono); font-size: 13px;
}
.fake-x {
  background: #d0d0d0; color: #000; border: 1px solid #000;
  width: 22px; height: 20px; cursor: pointer; font-size: 12px; line-height: 1;
}
.fake-x:hover { background: var(--red); color: #fff; }
.fake-body { padding: 16px; text-align: center; font-size: 13px; color: var(--dim); }
.fake-body .sprite { margin-bottom: 8px; }
.fake-save-log { font-family: var(--mono); font-size: 13px; color: var(--green); white-space: pre-wrap; min-width: 220px; }

/* 文件卡 */
.filecard {
  display: inline-flex; align-items: center; gap: 12px;
  background: #0d1122; border: 1px dashed #3a3f5e; padding: 10px 16px; margin-right: 14px;
}
.filecard small { display: block; color: var(--dim); font-size: 11.5px; }
.fileicon { font-size: 22px; }

/* 假桌面（胶片展品） */
.fake-desktop {
  position: relative; height: 300px; overflow: hidden;
  background:
    linear-gradient(160deg, #0a3341 0%, #06202b 100%);
  border: 10px solid #1a1d2e; border-radius: 8px;
  box-shadow: inset 0 0 60px rgba(0,0,0,.6), 0 0 0 2px #000;
  touch-action: none;
}
.film-win {
  position: absolute; left: 24px; top: 30px; width: 250px;
  background: #10142a; border: 2px solid #fff; box-shadow: 0 0 0 2px #000, 6px 6px 0 rgba(0,0,0,.5);
  cursor: grab; user-select: none;
}
.film-win:active { cursor: grabbing; }
.film-body { padding: 18px; display: flex; justify-content: center; }
.film-card {
  width: 120px; height: 120px; background: #04050a;
  border: 6px solid #1c1c22; border-radius: 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  outline: 4px dotted #3a3f5e; outline-offset: -14px;
  position: relative;
}
.film-card small { color: var(--dim); font-size: 11px; margin-top: 6px; }
.film-hidden {
  font-family: var(--mono); font-size: 42px; color: var(--yellow);
  filter: blur(7px); transition: filter .5s; user-select: none;
}
.film-revealed .film-hidden { filter: blur(0); text-shadow: 0 0 14px rgba(255,215,122,.8); }
.film-tip { position: absolute; right: 14px; bottom: 10px; color: #9fd7e8; font-size: 12.5px; opacity: .85; margin: 0; }

/* 日志页 / 壁纸 */
.journal-demo { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.journal-page {
  width: min(240px, 44vw); border: 1px solid #3a3f5e;
  box-shadow: 0 8px 26px rgba(0,0,0,.5);
}
.wall-demo { display: flex; gap: 12px; flex-wrap: wrap; }
.wall-demo img {
  width: min(190px, 30vw); border: 2px solid #2c3154; cursor: zoom-in; transition: border-color .15s;
}
.wall-demo img:hover { border-color: var(--yellow); }
.x-img { width: min(320px, 70vw); border: 2px solid #2c3154; }

/* ── 塔顶 ─────────────────────────── */
.summit {
  position: relative; height: 380px; overflow: hidden;
  background: linear-gradient(#0a0b14 0%, #14101f 100%);
  border: 2px solid #2c3154; margin: 26px 0;
}
.summit-sky {
  position: absolute; inset: 0;
  background:
    radial-gradient(1px 1px at 20% 30%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 70% 20%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 45% 45%, #ffe9b0 50%, transparent 51%),
    radial-gradient(1px 1px at 85% 60%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 30% 70%, #fff 50%, transparent 51%);
  opacity: .5;
}
.summit-floor {
  position: absolute; left: 0; right: 0; bottom: 0; height: 90px;
  background: repeating-linear-gradient(90deg, #1c1730 0 48px, #171226 48px 96px);
  border-top: 2px solid #3a2f55;
}
.niko-summit { position: absolute; bottom: 40px; left: calc(50% - 140px); }
.socket {
  position: absolute; bottom: 44px; left: calc(50% + 96px);
  width: 34px; height: 10px; background: #3a2f55; border: 2px solid #57431f;
}
.socket.lit { box-shadow: 0 -6px 40px 10px rgba(255, 215, 122, .8); background: var(--yellow); }
.bulb {
  position: absolute; bottom: 122px; left: calc(50% + 20px);
  cursor: grab; z-index: 2; user-select: none; touch-action: none;
  filter: drop-shadow(0 0 16px rgba(255, 217, 119, .85));
  animation: bob 2.4s ease-in-out infinite;
}
.bulb:active { cursor: grabbing; }
.bulb.held { position: fixed; animation: none; z-index: 200; pointer-events: none; }
.summit-tip { position: absolute; top: 12px; width: 100%; text-align: center; color: var(--dim); font-size: 13px; margin: 0; }
.ending-choices { text-align: center; padding: 12px 0 26px; }
.choice-ask { font-size: 17px; color: var(--yellow); }
.choice-btn {
  display: block; width: min(420px, 90vw); margin: 12px auto;
  font-family: var(--cjk); font-size: 16px; cursor: pointer;
  background: var(--box); color: var(--ink);
  border: 2px solid #fff; box-shadow: 0 0 0 2px #000; padding: 12px;
}
.choice-btn:hover { background: #232a4d; }
.choice-btn.danger { border-color: var(--red); color: var(--red); }
.choice-btn.danger:hover { background: #2a1420; }
.choice-note { color: var(--dim); font-size: 12.5px; }
.ending-result { padding: 26px 4px; text-align: center; }
.ending-result img { width: min(480px, 92vw); border: 2px solid #fff; box-shadow: 0 0 80px rgba(255,255,255,.12); margin: 18px 0; }
.ending-result h3 { font-size: 22px; letter-spacing: 2px; }
.ending-result .end-note { max-width: 640px; margin: 0 auto; color: #c9c7dc; font-size: 14.5px; text-align: left; }

.ending-table-wrap { margin-top: 40px; overflow-x: auto; }
.ending-table { border-collapse: collapse; width: 100%; font-size: 13.5px; min-width: 640px; }
.ending-table th, .ending-table td { border: 1px solid #2c3154; padding: 10px 12px; text-align: left; vertical-align: top; }
.ending-table th { background: #141833; color: #fff; }
.ending-table td small { color: var(--dim); font-family: var(--mono); }
.ending-table-wrap .sprite-cap { text-align: left; }

/* 抖动（打碎灯泡） */
body.shake { animation: shake .5s linear; }
@keyframes shake {
  0%,100% { transform: translate(0); } 10% { transform: translate(-8px, 4px); }
  20% { transform: translate(7px, -3px); } 30% { transform: translate(-6px, -5px); }
  40% { transform: translate(6px, 5px); } 50% { transform: translate(-7px, 2px); }
  60% { transform: translate(5px, -4px); } 70% { transform: translate(-4px, 4px); }
  80% { transform: translate(4px, -2px); } 90% { transform: translate(-2px, 2px); }
}

/* ── 二周目锁定 ────────────────────── */
.lockable { position: relative; }
#solstice[data-locked="true"] .solstice-content { filter: blur(9px); pointer-events: none; user-select: none; }
#solstice[data-locked="false"] .lock-overlay { display: none; }
#solstice[data-locked="false"] .solstice-content { filter: none; }
.lock-overlay {
  position: absolute; inset: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center;
}
.lock-card {
  text-align: center; background: rgba(10,12,24,.9);
  border: 2px solid var(--cyan); box-shadow: 0 0 60px rgba(159,255,239,.15);
  padding: 30px 34px; max-width: 480px;
}
.lock-title { font-size: 20px; color: var(--cyan); margin: 0 0 14px; }
#countdown-input {
  background: #0d1122; border: 2px solid #fff; color: #fff;
  font-family: var(--mono); font-size: 16px; padding: 8px 12px; width: 220px; outline: none;
  display: block; margin: 0 auto 12px; text-align: center;
}
.steps { padding-left: 22px; }
.steps li { margin: 10px 0; font-size: 14.5px; }

/* ── 角色图鉴 ─────────────────────── */
.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.char-card {
  background: rgba(16,20,42,.7); border: 1px solid #232848; padding: 16px;
  display: flex; gap: 14px; transition: border-color .15s;
}
.char-card:hover { border-color: var(--yellow); }
.char-face {
  width: 84px; height: 84px; flex: none;
  image-rendering: pixelated;
  border: 2px solid #2c3154;
}
.char-card b { display: block; font-size: 15.5px; color: #fff; }
.char-card .en-name { font-family: var(--mono); color: var(--dim); font-size: 11.5px; }
.char-card p { margin: 6px 0 0; font-size: 12.8px; color: #c7c5da; line-height: 1.75; }
.char-card .cq { margin-top: 8px; font-size: 12.5px; color: var(--yellow); border-left: 2px solid #3a3f5e; padding-left: 8px; }

/* ── 考古 ─────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 26px 0; }
.stat {
  background: rgba(16,20,42,.7); border: 1px solid #232848;
  text-align: center; padding: 16px 8px;
}
.stat b { display: block; font-family: var(--mono); font-size: 26px; color: var(--purple); }
.stat span { font-size: 12px; color: var(--dim); }

/* ── 年表 ─────────────────────────── */
.timeline { list-style: none; margin: 10px 0 30px; padding: 0 0 0 22px; border-left: 2px solid #2c3154; }
.timeline li { margin: 18px 0; position: relative; font-size: 14.5px; }
.timeline li::before {
  content: ''; position: absolute; left: -29px; top: 9px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--yellow); box-shadow: 0 0 10px var(--yellow);
}
.timeline b { font-family: var(--mono); color: var(--yellow); }
.credits-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.credits-col { background: rgba(16,20,42,.7); border: 1px solid #232848; padding: 18px 20px; font-size: 13.8px; }
.credits-col h4 { margin: 0 0 10px; color: #fff; }

/* ══════════ 旅程舞台（浓缩体验模式） ══════════ */
#stage {
  position: fixed; inset: 0; z-index: 95;
  background: #030409;
  display: flex; flex-direction: column;
}
#stage .stage-top {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid #161a30;
  background: rgba(6,8,16,.85);
}
.stage-chip {
  font-family: var(--mono); font-size: 12px; letter-spacing: 2px;
  padding: 3px 12px; border: 1px solid var(--rg, #ffd77a); color: var(--rg, #ffd77a);
  border-radius: 3px;
}
.stage-title { flex: 1; color: var(--dim); font-size: 13.5px; letter-spacing: 1px; }
.stage-exit {
  background: none; border: 1px solid #2c3154; color: var(--dim);
  padding: 4px 12px; cursor: pointer; font-family: var(--cjk); font-size: 12.5px; border-radius: 3px;
}
.stage-exit:hover { color: #fff; border-color: #fff; }
.stage-view {
  position: relative; flex: 1; overflow: hidden;
  display: flex; align-items: flex-end; justify-content: center;
}
.stage-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  image-rendering: pixelated;
  opacity: .5;
}
#stage::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(ellipse at 50% 40%, transparent 45%, rgba(0,0,0,.55) 100%);
}
.stage-cg {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  max-width: min(720px, 88vw); max-height: 72%;
  border: 2px solid #fff; box-shadow: 0 0 90px rgba(0,0,0,.8), 0 0 50px var(--rg, rgba(255,215,122,.3));
  image-rendering: pixelated; z-index: 2;
}
.stage-cg-cap {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  color: #b9b8d0; font-size: 12.5px; background: rgba(4,5,12,.8);
  border: 1px solid #2c3154; padding: 4px 14px; border-radius: 3px; z-index: 3;
  white-space: nowrap; max-width: 92vw; overflow: hidden; text-overflow: ellipsis;
}
.stage-sprites {
  position: absolute; bottom: 0; left: 0; right: 0; height: 150px; z-index: 2;
  pointer-events: none;
  border-bottom: 2px solid rgba(255,255,255,.06);
  background: linear-gradient(transparent, rgba(0,0,0,.5));
}
.stage-sprites .sprite { position: absolute; bottom: 0; }
.stage-flash {
  position: absolute; inset: 0; background: #fff; opacity: 0; z-index: 5;
  pointer-events: none; transition: opacity 2.2s;
}
.stage-narr {
  position: relative; z-index: 4;
  margin: 0 auto; width: min(760px, 94vw);
  padding: 18px 8px 26px; text-align: center; cursor: pointer;
}
.stage-narr p {
  margin: 0; font-size: 16.5px; line-height: 2.1; color: #dfe2f5;
  text-shadow: 0 2px 8px #000;
}
.stage-narr p em { color: var(--yellow); font-style: normal; }
.narr-next { display: block; color: var(--yellow); font-size: 11px; animation: bob 1.2s infinite; }
.stage-choice {
  position: relative; z-index: 4;
  margin: 0 auto 40px; width: min(640px, 94vw);
  background: rgba(10,12,26,.94);
  border: 2px solid #fff; box-shadow: 0 0 0 2px #000, 0 20px 60px rgba(0,0,0,.7);
  padding: 22px 26px; text-align: center;
}
.stage-choice .choice-ask { font-size: 15.5px; line-height: 2; color: var(--yellow); margin: 0 0 14px; white-space: pre-wrap; }
.stage-choice .opt {
  display: block; width: 100%; margin: 9px 0; cursor: pointer;
  background: #171b33; color: var(--ink); border: 2px solid #4a5078;
  padding: 11px 14px; font-size: 14.5px; font-family: var(--cjk); text-align: left;
  transition: border-color .12s, background .12s;
}
.stage-choice .opt:hover { border-color: #fff; background: #232a4d; }
.stage-choice .opt.final { border-color: var(--red); color: #ffb0b0; }
.stage-choice .opt.final:hover { background: #2a1420; }
.stage-endpanel {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); z-index: 6;
  width: min(620px, 92vw);
  background: rgba(8,10,20,.96); border: 2px solid #fff; box-shadow: 0 0 0 2px #000, 0 30px 90px rgba(0,0,0,.85);
  padding: 30px 34px; text-align: center;
}
.stage-endpanel h3 { font-size: 21px; letter-spacing: 2px; margin: 0 0 14px; }
.stage-endpanel p { font-size: 14px; line-height: 2.1; color: #c9c7dc; text-align: left; margin: 10px 0; }
.stage-endpanel .reflect { color: var(--yellow); border-left: 3px solid var(--yellow); padding-left: 12px; }
.stage-endpanel button { margin: 8px 4px 0; }
/* 区域色 */
#stage.rg-home     { --rg: #ffd77a; } #stage.rg-home .stage-bg { filter: sepia(.3) brightness(.8); }
#stage.rg-barrens  { --rg: #4fc3ff; }
#stage.rg-glen     { --rg: #7dff8a; }
#stage.rg-refuge   { --rg: #ff5d5d; }
#stage.rg-tower    { --rg: #ffd77a; }
#stage.rg-final    { --rg: #c9a0ff; }
#stage.rg-solstice { --rg: #9fffef; }

/* ── 对话模拟触发区 ─────────────────── */
.dialogue-sim { margin: 22px 0; }

/* ── 隐藏要素 ──────────────────────── */
.hidden-goodies {
  margin: 26px 0 0; padding: 10px 6px; display: flex; align-items: center; gap: 18px;
}
.goodies-hint { color: #4a4a66; font-size: 12px; }
#hidden-pancake { filter: drop-shadow(0 0 8px rgba(255,215,122,.6)); }

/* ── 对话引擎 ─────────────────────── */
#dialog-layer { position: fixed; inset: 0; z-index: 105; pointer-events: none; }
.dlg {
  position: absolute; pointer-events: auto; cursor: pointer;
  width: min(620px, 94vw);
  animation: fadein .18s;
}
/* 普通窗口风 */
.dlg.norm {
  left: 50%; bottom: 42px; transform: translateX(-50%);
  background: rgba(13, 16, 38, .96);
  border: 2px solid #fff; box-shadow: 0 0 0 2px #000, 0 14px 40px rgba(0,0,0,.6);
  padding: 14px 16px; display: flex; gap: 14px; align-items: flex-start;
}
.dlg.norm .dlg-face {
  width: 96px; height: 96px; flex: none; image-rendering: pixelated;
  border: 1px solid #3a3f5e; background: #04050a;
}
.dlg .dlg-name {
  position: absolute; top: -14px; left: 10px;
  background: #171b33; border: 2px solid #fff; box-shadow: 0 0 0 2px #000;
  font-size: 12.5px; padding: 1px 10px; color: var(--yellow); font-family: var(--mono);
}
.dlg .dlg-text { font-size: 15.5px; line-height: 2; min-height: 66px; white-space: pre-wrap; }
.dlg .dlg-next {
  position: absolute; right: 12px; bottom: 6px; color: var(--yellow);
  animation: bob 1s infinite; font-size: 12px;
}
/* Ed 风黑屏弹字 */
.dlg.ed {
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: rgba(2, 3, 8, .96);
  border: 1px solid #3a3f5e;
  padding: 34px 30px; text-align: center;
  font-family: var(--mono); color: #dfe6ff;
  font-size: clamp(16px, 2.6vw, 21px); letter-spacing: 2px; line-height: 2.1;
  white-space: pre-wrap; text-shadow: 0 0 8px rgba(120,140,255,.4);
  min-width: min(560px, 92vw); min-height: 150px;
  display: flex; align-items: center; justify-content: center;
}

/* ── Toast / Fatal / Unreality ─────── */
#toast-layer { position: fixed; top: 62px; right: 14px; z-index: 90; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  background: rgba(10,12,24,.95); border: 2px solid var(--yellow);
  box-shadow: 0 0 0 2px #000; padding: 10px 16px; font-size: 13.5px;
  animation: fadein .25s; max-width: 320px;
}
.toast b { color: var(--yellow); display: block; font-size: 14px; }
.toast.achv { border-color: var(--yellow); }

#fatal {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(0,0,0,.88);
  display: flex; align-items: center; justify-content: center;
}
.fatal-box { width: min(460px, 92vw); background: #c0c0c0; color: #000; font-family: var(--cjk); box-shadow: 8px 8px 0 rgba(0,0,0,.6); }
.fatal-title { background: linear-gradient(90deg, #000080, #1084d0); color: #fff; padding: 6px 10px; font-weight: bold; font-size: 14px; }
.fatal-body { padding: 22px 20px; font-size: 15px; line-height: 1.9; }
.fatal-body p { margin: 0 0 10px; font-family: var(--mono); }
.fatal-body .dim { color: #444; font-family: var(--cjk); font-size: 13px; }

#unreality {
  position: fixed; inset: 0; z-index: 130; cursor: pointer;
  background:
    repeating-conic-gradient(#1a1030 0% 25%, #0d0820 0% 50%) 0 0 / 120px 120px;
  display: flex; align-items: center; justify-content: center;
  animation: unrealShift 6s linear infinite;
}
@keyframes unrealShift { to { background-position: 240px 240px; } }
.unreal-inner { text-align: center; }
.unreal-text { font-family: var(--mono); font-size: 44px; color: #fff; letter-spacing: 8px; margin: 20px 0 0; }
.unreal-sub { color: #9a8fc0; font-size: 13px; }

/* ── 页脚 ─────────────────────────── */
footer {
  position: relative; z-index: 1;
  border-top: 1px solid #161a30; padding: 46px 22px 60px;
  text-align: center; font-size: 13px; color: var(--dim);
  background: #04050a;
}
footer p { margin: 8px auto; max-width: 760px; }
footer b { color: var(--ink); }
.final-line { color: var(--yellow); }

/* 响应式 */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .dlg.norm { flex-direction: row; }
  .dlg.norm .dlg-face { width: 72px; height: 72px; }
  .dlg .dlg-text { font-size: 14px; min-height: 54px; }
  .chapter { padding: 60px 0 50px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01s !important; transition-duration: .01s !important; }
}
