/* ============================================================
   静默之城 · 视觉层 —— 雾、雨、琥珀灯光（深色电影感）
   ============================================================ */
:root {
  --ink: #0a1014;
  --ink-2: #0e1720;
  --panel: rgba(14, 24, 32, 0.88);
  --panel-2: rgba(18, 30, 40, 0.72);
  --line: rgba(232, 176, 75, 0.16);
  --line-2: rgba(159, 176, 181, 0.14);
  --amber: #e8b04b;
  --amber-soft: #f2d492;
  --text: #e9e6dd;
  --muted: #9fb0b5;
  --teal: #7fb3ae;
  --rose: #d98a7e;
  --serif: Georgia, "Times New Roman", "Songti SC", "Noto Serif SC", "SimSun", serif;
  --sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
main { display: block; }
.view { min-height: 100vh; }

/* ---------- 氛围层 ---------- */
#fog { position: fixed; inset: 0; pointer-events: none; z-index: 3; overflow: hidden; }
#fog i { position: absolute; width: 140vmax; height: 140vmax; border-radius: 50%; filter: blur(60px); opacity: .07; background: radial-gradient(circle at 50% 50%, #cfe3e0 0%, transparent 60%); animation: drift 46s linear infinite alternate; }
#fog .f2 { animation-duration: 68s; animation-direction: alternate-reverse; opacity: .05; }
@keyframes drift { from { transform: translate(-30%, -20%) scale(1); } to { transform: translate(15%, 25%) scale(1.25); } }
#grain { position: fixed; inset: 0; pointer-events: none; z-index: 4; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.7'/%3E%3C/svg%3E"); }

/* ---------- HUD ---------- */
#hud { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 18px; background: linear-gradient(180deg, rgba(8,13,17,.92), rgba(8,13,17,.72) 80%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line-2); }
.hud-left, .hud-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#hud-title { font-family: var(--serif); letter-spacing: .08em; color: var(--amber-soft); font-size: 15px; }
.hud-stat { font-size: 13px; color: var(--muted); letter-spacing: .05em; }
.hud-btn { background: transparent; border: 1px solid var(--line-2); color: var(--muted); font-family: var(--sans);
  padding: 6px 12px; border-radius: 999px; font-size: 13px; cursor: pointer; transition: .18s; letter-spacing: .04em; }
.hud-btn:hover { color: var(--text); border-color: var(--amber); }
.hud-btn.toggle { width: 34px; text-align: center; padding: 6px 0; }
.hud-btn.toggle.on { color: var(--amber); border-color: rgba(232,176,75,.55); background: rgba(232,176,75,.08); }

/* ---------- 按钮 ---------- */
.btn { font-family: var(--sans); background: transparent; border: 1px solid var(--line-2); color: var(--text);
  padding: 11px 26px; border-radius: 4px; font-size: 15px; letter-spacing: .12em; cursor: pointer; transition: .2s; }
.btn:hover { border-color: var(--amber); color: var(--amber-soft); background: rgba(232,176,75,.06); transform: translateY(-1px); }
.btn.primary { border-color: rgba(232,176,75,.6); color: #14100a; background: linear-gradient(180deg, #f0c267, var(--amber)); font-weight: 600; }
.btn.primary:hover { color: #14100a; filter: brightness(1.06); }
.btn.ghost { border-style: dashed; color: var(--muted); }
.btn.small { padding: 7px 16px; font-size: 13px; }
.btn.continue { border-color: rgba(232,176,75,.45); color: var(--amber-soft); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 0%,100% { opacity: .75; } 50% { opacity: 1; } }

/* ---------- 标题页 ---------- */
#view-title { display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, #12222b 0%, var(--ink) 60%); }
#title-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0;
  filter: saturate(.85) brightness(.55) blur(.4px); transform: scale(1.03); }
#title-video-veil { position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 35%, rgba(6,10,14,.35) 0%, rgba(6,10,14,.86) 70%, rgba(6,10,14,.97) 100%); }
.title-wrap { text-align: center; padding: 60px 24px; max-width: 720px; position: relative; z-index: 2; }
.title-eyebrow { font-size: 12px; letter-spacing: .5em; color: var(--muted); margin-bottom: 26px; }
.title-main { font-family: var(--serif); font-size: clamp(52px, 9vw, 92px); font-weight: 400; letter-spacing: .18em;
  color: var(--text); animation: glowPulse 5s ease-in-out infinite alternate, titleIn 1.6s ease-out; }
@keyframes glowPulse { from { text-shadow: 0 0 30px rgba(232,176,75,.12); } to { text-shadow: 0 0 80px rgba(232,176,75,.32); } }
@keyframes titleIn { from { opacity: 0; letter-spacing: .34em; filter: blur(6px); } to { opacity: 1; letter-spacing: .18em; filter: none; } }
.title-en { font-family: var(--serif); font-style: italic; color: var(--amber); letter-spacing: .14em; margin: 10px 0 26px; font-size: 20px; }
.title-tag { color: var(--muted); line-height: 2; font-size: 15px; margin-bottom: 40px; }
.title-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 34px; }
.title-foot { font-size: 12px; color: rgba(159,176,181,.55); letter-spacing: .18em; }
.btn.big { font-size: 17px; padding: 15px 46px; letter-spacing: .3em; }
.title-minor { margin-top: 22px; font-size: 12.5px; color: rgba(159,176,181,.6); display: flex; gap: 12px; justify-content: center; }
.title-minor a { color: rgba(159,176,181,.65); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.title-minor a:hover { color: var(--amber); }
.title-minor i { font-style: normal; opacity: .4; }
.chapter-end p { margin-top: 6px; }
.title-foot .sound-hint { display: inline-block; margin-top: 10px; letter-spacing: .08em; color: rgba(232,176,75,.65); }

/* 光尘粒子 */
.mote { position: absolute; bottom: -12px; width: 3px; height: 3px; border-radius: 50%;
  background: rgba(232, 176, 75, .55); filter: blur(.6px); pointer-events: none;
  animation: floaty 14s linear infinite; }
@keyframes floaty {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  12% { opacity: .8; }
  100% { transform: translateY(-92vh) translateX(4vw); opacity: 0; }
}
#view-title, #view-map { position: relative; overflow: hidden; }

/* ---------- 地图 ---------- */
#view-map { padding: 40px 20px 80px; background: linear-gradient(180deg, #0c141a, var(--ink)); }
.map-wrap { max-width: 1020px; margin: 0 auto; }
.map-head h2, .page-head h2 { font-family: var(--serif); font-weight: 400; letter-spacing: .2em; font-size: 28px; color: var(--amber-soft); }
.map-head p, .page-head p { color: var(--muted); margin-top: 8px; font-size: 14px; }
.map-stats { display: flex; gap: 14px; margin: 26px 0; flex-wrap: wrap; }
.stat { flex: 1; min-width: 140px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 6px; padding: 14px 18px; }
.stat b { font-family: var(--serif); font-size: 26px; color: var(--amber); display: block; }
.stat span { font-size: 12px; color: var(--muted); letter-spacing: .1em; }
.map-cards { display: flex; flex-direction: column; gap: 18px; }
.map-card { display: grid; grid-template-columns: 220px 1fr 160px; gap: 0; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden;
  background: var(--panel); transition: .25s; }
.map-card:not(.locked):hover { border-color: rgba(232,176,75,.5); transform: translateY(-2px); box-shadow: 0 18px 50px rgba(0,0,0,.45); }
.map-card.locked { opacity: .45; filter: saturate(.4); }
.map-thumb { background-size: cover; background-position: center; min-height: 160px; }
.map-body { padding: 20px 22px; }
.map-kicker { font-size: 11px; letter-spacing: .3em; color: var(--amber); margin-bottom: 8px; }
.map-body h3 { font-family: var(--serif); font-weight: 400; font-size: 21px; letter-spacing: .06em; }
.map-sub { font-size: 12px; color: var(--muted); margin: 6px 0 10px; letter-spacing: .05em; }
.map-intro { font-size: 13px; color: rgba(233,230,221,.72); line-height: 1.9; }
.trust-line { font-size: 12px; color: var(--muted); margin-top: 12px; display: flex; align-items: center; gap: 10px; }
.trustbar { width: 120px; height: 3px; background: rgba(159,176,181,.18); border-radius: 2px; overflow: hidden; }
.trustbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--amber)); transition: width .7s cubic-bezier(.3,1,.3,1); }
.map-actions { display: flex; align-items: center; justify-content: center; padding: 20px; border-left: 1px solid var(--line-2); }
.lock { font-size: 12px; color: var(--muted); text-align: center; letter-spacing: .05em; }
.map-foot { display: flex; gap: 12px; margin-top: 34px; flex-wrap: wrap; }

/* ---------- 场景 ---------- */
#view-scene { position: relative; overflow: hidden; height: 100vh; }
#scene-bg { position: absolute; inset: -6% -4% -8% -4%; z-index: 0; background-size: cover; background-position: center 30%;
  filter: saturate(.9) brightness(.8); transform: scale(1.02); animation: sceneIn 2.2s ease-out; }
@keyframes sceneIn { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: scale(1.02); } }
.scene-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: saturate(.9) brightness(.82); }

/* ---------- 场景热点探索 ---------- */
#hotspots { position: absolute; inset: 0; z-index: 3; pointer-events: none; transition: opacity .4s; }
#view-scene:not(.exploring) #hotspots { opacity: 0; }
#view-scene:not(.exploring) .hotspot { pointer-events: none; }

/* ---------- 探索阶段：先探索，后对话 ---------- */
#view-scene.exploring #dialogue-layer { opacity: 0; pointer-events: none; }
#dialogue-layer { transition: opacity .5s; }
#view-scene.exploring .hotspot i { width: 12px; height: 12px; margin: 9px; }
#view-scene.exploring .hotspot::before { content: ""; position: absolute; inset: -8px; border-radius: 50%;
  border: 1px solid rgba(232,176,75,.5); animation: spotRing 2.2s ease-out infinite; }
@keyframes spotRing { from { transform: scale(.6); opacity: .9; } to { transform: scale(1.5); opacity: 0; } }
#explore-bar { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 9;
  display: flex; align-items: center; gap: 18px; padding: 12px 16px 12px 20px; border-radius: 10px;
  background: rgba(9,17,22,.88); border: 1px solid rgba(232,176,75,.25); backdrop-filter: blur(12px);
  opacity: 0; pointer-events: none; transition: .4s; max-width: calc(100% - 32px); }
#view-scene.exploring #explore-bar { opacity: 1; pointer-events: auto; }
.ex-hint { font-size: 13px; color: var(--muted); line-height: 1.7; }
.hotspot { position: absolute; transform: translate(-50%, -50%); width: 30px; height: 30px; padding: 0;
  border: none; background: none; cursor: pointer; pointer-events: auto; }
.hotspot i { display: block; width: 9px; height: 9px; margin: 10px; border-radius: 50%;
  background: rgba(232,176,75,.9); box-shadow: 0 0 10px rgba(232,176,75,.75);
  animation: spotPulse 2.6s ease-in-out infinite; }
.hotspot::after { content: ""; position: absolute; inset: 4px; border-radius: 50%;
  border: 1px solid rgba(232,176,75,.45); opacity: 0; transition: .25s; }
.hotspot:hover::after { opacity: 1; transform: scale(1.15); }
.hotspot:hover i { background: var(--amber); box-shadow: 0 0 16px rgba(232,176,75,.95); }
.hotspot.found i { width: 7px; height: 7px; margin: 11px; background: rgba(159,176,181,.5);
  box-shadow: none; animation: none; }
.hotspot.found::after { border-color: rgba(159,176,181,.25); }
@keyframes spotPulse {
  0%, 100% { transform: scale(1); opacity: .75; }
  50% { transform: scale(1.45); opacity: 1; }
}

#spot-card { position: absolute; left: 50%; top: 15%; transform: translate(-50%, 10px); z-index: 8;
  width: min(560px, calc(100% - 44px)); padding: 20px 22px 16px; border-radius: 10px;
  background: rgba(9,17,22,.9); border: 1px solid rgba(232,176,75,.28); backdrop-filter: blur(14px);
  box-shadow: 0 18px 50px rgba(0,0,0,.55); opacity: 0; transition: opacity .3s, transform .35s; }
#spot-card.show { opacity: 1; transform: translate(-50%, 0); }
#spot-card.hidden { display: none; }
.spot-eyebrow { font-size: 11px; letter-spacing: .28em; color: var(--amber-soft); margin-bottom: 12px; }
.spot-en { font-family: var(--serif); font-size: 18px; line-height: 1.8; color: var(--text); }
.spot-cn { margin-top: 9px; font-size: 13px; line-height: 1.9; color: var(--muted); }
.spot-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.spot-actions .btn { padding: 7px 14px; font-size: 12.5px; }

/* ---------- 对话内嵌媒体 ---------- */
.b-media { margin: 4px 0 14px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line-2);
  box-shadow: 0 14px 40px rgba(0,0,0,.45); animation: rise .5s ease-out; max-width: 560px; }
.b-media img, .b-media video { display: block; width: 100%; max-height: 300px; object-fit: cover;
  filter: saturate(.92) brightness(.9); }
.b-media figcaption { padding: 9px 14px; font-size: 12.5px; color: var(--muted);
  background: rgba(9,17,22,.85); border-top: 1px solid var(--line); line-height: 1.7; }

/* ---------- 背包 ---------- */
.bag-item { display: flex; gap: 14px; padding: 14px 16px; border-radius: 8px; background: var(--panel-2);
  border: 1px solid var(--line-2); margin-bottom: 10px; align-items: center; }
.bag-item.unknown { opacity: .45; }
.bag-item.unknown .bag-icon img { filter: grayscale(1) brightness(.5); }
.bag-icon { width: 76px; height: 76px; border-radius: 10px; overflow: hidden; flex: none;
  border: 1px solid rgba(232,176,75,.35); box-shadow: 0 4px 18px rgba(0,0,0,.45); }
.bag-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bag-info b { font-size: 14.5px; color: var(--text); }
.bag-info em { font-size: 12px; color: var(--amber-soft); margin-left: 8px; font-style: italic; }
.bag-info p { margin-top: 5px; font-size: 12.5px; color: var(--muted); line-height: 1.8; }
.option.item-opt { display: flex; gap: 14px; align-items: center; }
.item-thumb { width: 62px; height: 62px; border-radius: 8px; overflow: hidden; flex: none;
  border: 1px solid rgba(232,176,75,.35); box-shadow: 0 3px 14px rgba(0,0,0,.4); }
.item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item-text b { display: block; }
.item-text span { display: block; margin-top: 3px; }
.option.item-opt.hot .item-thumb { border-color: var(--amber); box-shadow: 0 0 16px rgba(232,176,75,.35); }
.ce-reward { margin-top: 14px; display: flex; gap: 14px; align-items: center; text-align: left;
  padding: 12px 14px; border-radius: 10px; background: rgba(232,176,75,.08); border: 1px solid rgba(232,176,75,.3);
  animation: rise .5s ease-out; max-width: 460px; margin-left: auto; margin-right: auto; }
.ce-reward img { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; flex: none;
  border: 1px solid rgba(232,176,75,.4); }
.ce-reward span { display: block; font-size: 11.5px; letter-spacing: .12em; color: var(--muted); }
.ce-reward b { color: var(--amber); font-size: 15px; }
.ce-reward em { font-style: italic; color: var(--amber-soft); font-size: 12.5px; }

/* ---------- 车站 3D 视差 ---------- */
#plx { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
#plx img { position: absolute; left: -5%; top: -6%; width: 110%; height: 112%; object-fit: cover; will-change: transform; }
.plx-far { mix-blend-mode: screen; opacity: .8; }
.plx-near { opacity: .95;
  -webkit-mask-image: radial-gradient(ellipse 60% 56% at 50% 46%, transparent 40%, #000 86%);
  mask-image: radial-gradient(ellipse 60% 56% at 50% 46%, transparent 40%, #000 86%); }

/* ---------- 拼句小游戏 ---------- */
.build-ans { min-height: 52px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 10px; border-radius: 8px; border: 1px dashed rgba(232,176,75,.4); margin-bottom: 10px;
  background: rgba(232,176,75,.04); }
.build-ans:empty::after { content: "把词块点到这里，组成她说的话…"; font-size: 12.5px; color: rgba(159,176,181,.5); }
.build-tiles { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tile { font-family: var(--serif); font-size: 15.5px; padding: 8px 14px; border-radius: 6px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text); transition: .18s; }
.tile:not(:disabled):hover { border-color: var(--amber); color: var(--amber); transform: translateY(-2px); }
.tile.ans { background: rgba(232,176,75,.12); border-color: rgba(232,176,75,.45); }
#btn-say { margin-top: 2px; }
#btn-say:disabled { opacity: .35; cursor: default; }
.feedback span { display: block; color: var(--muted); margin-top: 4px; }

/* 场景特效层：雨 / 灯塔光束 */
#fx { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
#fx .rain { position: absolute; inset: -12% -6%; opacity: .45;
  background-image: repeating-linear-gradient(101deg, transparent 0 11px, rgba(190, 215, 222, .16) 11px 12px, transparent 12px 27px);
  background-size: 130px 240px; animation: rainfall .55s linear infinite; }
#fx .rain.r2 { opacity: .22; background-size: 84px 150px; animation-duration: .36s; }
@keyframes rainfall { from { background-position: 0 0; } to { background-position: -42px 240px; } }
#fx .beam { position: absolute; top: -14%; right: 14%; width: 24vmax; height: 78vmax; transform-origin: 50% 0;
  background: linear-gradient(180deg, rgba(240, 222, 164, .15), rgba(240, 222, 164, .04) 62%, transparent 85%);
  filter: blur(16px); animation: sweep 9s ease-in-out infinite alternate; }
#fx .beam2 { right: auto; left: 8%; top: -20%; width: 16vmax; height: 60vmax; animation-duration: 12s; animation-delay: -5s; opacity: .5; }
@keyframes sweep { from { transform: rotate(13deg); opacity: .45; } to { transform: rotate(34deg); opacity: .9; } }

#scene-vignette { position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 30%, transparent 40%, rgba(5,9,12,.55) 100%),
              linear-gradient(180deg, rgba(6,10,14,.5), transparent 30%, rgba(6,10,14,.82) 78%, rgba(6,10,14,.95)); }
#dialogue-layer { position: relative; z-index: 5; height: 100%; max-width: 880px; margin: 0 auto; padding: 12vh 22px 34px;
  display: flex; flex-direction: column; overflow-y: auto; scrollbar-width: thin; }
#bubbles { display: flex; flex-direction: column; gap: 16px; margin-top: auto; padding-bottom: 8px; }
.bubble { position: relative; max-width: 92%; animation: rise .5s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.bubble.speech { align-self: flex-start; background: var(--panel); border: 1px solid var(--line-2);
  border-left: 3px solid rgba(232,176,75,.55); border-radius: 4px 14px 14px 14px; padding: 16px 20px 16px 18px; backdrop-filter: blur(10px); }
.bubble.narr { align-self: stretch; text-align: left; background: transparent; padding: 4px 6px; }
.bubble.narr .b-en { font-family: var(--serif); font-style: italic; font-size: 16.5px; color: rgba(233,230,221,.78); line-height: 2; }
.bubble.narr .b-cn { font-size: 13px; color: rgba(159,176,181,.8); }
.bubble.chapter-intro { margin-bottom: 10px; }
.b-name { font-size: 12px; letter-spacing: .22em; color: var(--amber); margin-bottom: 8px; }
.b-name span { color: rgba(159,176,181,.7); letter-spacing: .08em; margin-left: 10px; font-size: 11px; }
.b-en { font-family: var(--serif); font-size: 19px; line-height: 1.75; color: var(--text); }
.bubble.typing .b-en::after { content: "▌"; color: var(--amber); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.b-cn { margin-top: 8px; font-size: 13.5px; color: var(--muted); line-height: 1.9; opacity: 0; transform: translateY(4px); transition: opacity .5s .1s, transform .5s .1s; }
.b-cn.show { opacity: 1; transform: none; }
body.cn-off .b-cn { display: none; }
.tts { position: absolute; top: 10px; right: 12px; background: none; border: none; font-size: 15px; cursor: pointer; opacity: .5; transition: .2s; }
.tts:hover { opacity: 1; transform: scale(1.15); }
.blank { font-family: var(--serif); letter-spacing: .12em; padding: 1px 8px; border-bottom: 2px dashed rgba(232,176,75,.7);
  color: var(--amber-soft); transition: .3s; }
.blank.best, .blank.okay, .blank.off { animation: blankPop .35s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes blankPop { 0% { transform: scale(.85); filter: brightness(1.8); } 100% { transform: scale(1); filter: none; } }
.blank.best { color: var(--amber); border-bottom-style: solid; text-shadow: 0 0 22px rgba(232,176,75,.5); }
.blank.okay { color: var(--teal); border-bottom-style: solid; }
.blank.off { color: var(--rose); border-bottom-style: solid; }

#choices { display: flex; flex-direction: column; gap: 12px; padding: 18px 2px 6px; }
.choice-hint { font-size: 12.5px; color: var(--muted); letter-spacing: .06em; }
.choice-hint span { border-left: 2px solid rgba(232,176,75,.4); padding-left: 10px; }
.option-list { display: flex; flex-direction: column; gap: 10px; }
.option { text-align: left; font-family: var(--sans); background: var(--panel-2); border: 1px solid var(--line-2);
  border-radius: 6px; color: var(--text); padding: 13px 18px; cursor: pointer; transition: .2s; backdrop-filter: blur(8px);
  animation: rise .4s ease-out backwards; }
.option b { font-family: var(--serif); font-size: 17px; font-weight: 400; display: block; letter-spacing: .02em; }
.option span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.option:not(:disabled):hover { border-color: var(--amber); background: rgba(232,176,75,.09); transform: translateX(4px); }
.option.word-opt b { color: var(--amber-soft); letter-spacing: .1em; font-size: 18px; }
.option.best { border-color: rgba(232,176,75,.8); box-shadow: 0 0 30px rgba(232,176,75,.12); }
.option.okay { border-color: rgba(127,179,174,.7); }
.option.off { border-color: rgba(217,138,126,.6); }
.option.dim { opacity: .4; }
.option:disabled { cursor: default; }

.feedback { font-size: 13.5px; line-height: 1.9; padding: 10px 14px; border-radius: 6px; animation: pop .32s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes pop { from { opacity: 0; transform: scale(.92) translateY(6px); } to { opacity: 1; transform: none; } }
.feedback.best { background: rgba(232,176,75,.09); border: 1px solid rgba(232,176,75,.35); color: var(--amber-soft); }
.feedback.okay { background: rgba(127,179,174,.08); border: 1px solid rgba(127,179,174,.3); color: #b9d6d2; }
.feedback.off { background: rgba(217,138,126,.07); border: 1px solid rgba(217,138,126,.3); color: #e3b3aa; }
.feedback span { display: block; color: var(--muted); font-size: 12.5px; }
.tone { font-style: normal; font-size: 11.5px; padding: 2px 9px; border-radius: 999px; margin: 0 6px; letter-spacing: .1em; }
.t-warm { background: rgba(232,176,75,.16); color: var(--amber); }
.t-cold { background: rgba(127,179,174,.14); color: var(--teal); }
.t-neutral { background: rgba(159,176,181,.14); color: var(--muted); }

.chapter-end { margin: auto; text-align: center; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 44px 36px; max-width: 560px; backdrop-filter: blur(12px); }
.ce-kicker { font-size: 11px; letter-spacing: .5em; color: var(--amber); margin-bottom: 16px; }
.chapter-end h2 { font-family: var(--serif); font-weight: 400; letter-spacing: .1em; margin-bottom: 14px; }
.chapter-end p { color: var(--muted); font-size: 14px; margin-bottom: 26px; }

/* ---------- 页面通用头 ---------- */
.page-head { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head .btn { margin-left: auto; }

/* ---------- 词灵阁 ---------- */
#view-codex, #view-review, #view-end { padding: 46px 22px 90px; background: linear-gradient(180deg, #0c141a, var(--ink)); }
.codex-wrap, .review-wrap, .end-wrap { max-width: 1020px; margin: 0 auto; }
.codex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.wcard { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px; cursor: pointer; transition: .22s; }
.wcard:hover { transform: translateY(-3px); border-color: rgba(232,176,75,.55); box-shadow: 0 14px 40px rgba(0,0,0,.4); }
.wcard.unknown { opacity: .35; cursor: default; border-style: dashed; }
.wcard.unknown:hover { transform: none; box-shadow: none; }
.wcard.static { cursor: default; margin: 14px 0; }
.w-top { display: flex; align-items: baseline; gap: 10px; }
.w-top b { font-family: var(--serif); font-size: 22px; color: var(--amber-soft); letter-spacing: .04em; font-weight: 400; }
.w-top em { color: var(--muted); font-size: 13px; }
.w-mid { margin: 8px 0 10px; font-size: 14px; color: var(--text); }
.w-ex { font-family: var(--serif); font-style: italic; font-size: 13.5px; line-height: 1.8; color: rgba(233,230,221,.8); }
.w-excn { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.8; }
.w-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.chip { font-style: normal; font-size: 11px; padding: 2px 9px; border-radius: 999px; letter-spacing: .12em; }
.chip.ok { background: rgba(232,176,75,.15); color: var(--amber); }
.chip.mid { background: rgba(127,179,174,.14); color: var(--teal); }
.chip.bad { background: rgba(217,138,126,.14); color: var(--rose); }
.stars { color: rgba(232,176,75,.7); font-size: 12px; letter-spacing: .2em; }

/* ---------- 回声室 ---------- */
.empty { color: var(--muted); text-align: center; padding: 60px 0; letter-spacing: .1em; }
.quiz { background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; padding: 30px; max-width: 640px; }
.q-mode { font-size: 11px; letter-spacing: .4em; color: var(--amber); margin-bottom: 18px; }
.q-sent { font-family: var(--serif); font-size: 20px; line-height: 1.9; }
.q-cn { font-size: 13px; color: var(--muted); margin-top: 10px; line-height: 1.9; }
.q-word b { font-family: var(--serif); font-size: 34px; font-weight: 400; color: var(--amber-soft); }
.q-word em { color: var(--muted); margin-left: 10px; }
#q-replay { margin: 16px 0 0; }
.q-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }
.summary { text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 50px 30px; max-width: 480px; margin: 0 auto; }
.summary h3 { font-family: var(--serif); font-size: 44px; font-weight: 400; color: var(--amber); }
.summary p { color: var(--muted); margin: 14px 0 26px; }

/* ---------- 结局 ---------- */
.end-wrap { max-width: 760px; }
.end-wrap h2 { font-family: var(--serif); font-weight: 400; font-size: 30px; letter-spacing: .08em; margin-bottom: 26px; }
.end-wrap h2 span { font-size: 16px; font-style: italic; color: var(--amber); margin-left: 12px; }
.end-text { font-family: var(--serif); font-size: 16.5px; line-height: 2.1; color: rgba(233,230,221,.9); margin-bottom: 18px; }
.end-text.cn { font-family: var(--sans); font-size: 14px; color: var(--muted); line-height: 2.2; }

/* ---------- 弹层 / 提示 ---------- */
#modal { position: fixed; inset: 0; z-index: 50; background: rgba(4,7,10,.8); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal-card { position: relative; background: var(--ink-2); border: 1px solid var(--line); border-radius: 12px;
  max-width: 640px; width: 100%; max-height: 84vh; overflow-y: auto; padding: 36px; }
.modal-card h2 { font-family: var(--serif); font-weight: 400; letter-spacing: .08em; font-size: 21px; color: var(--amber-soft); margin-bottom: 20px; }
.modal-body p, .modal-body li { font-size: 14px; line-height: 2; color: rgba(233,230,221,.85); margin-bottom: 12px; }
.modal-body b { color: var(--amber-soft); }
.modal-body ul { padding-left: 20px; }
.modal-body .dim { color: var(--muted); font-size: 12.5px; }
#modal-close, #tts-modal-close { position: absolute; top: 14px; right: 16px; background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer; }
#modal-close:hover, #tts-modal-close:hover { color: var(--amber); }

/* ---------- 语音设置 ---------- */
.cfg-row { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.cfg-row > label { font-size: 12px; letter-spacing: .18em; color: var(--amber); }
.cfg-row input, .cfg-row select {
  background: rgba(10, 16, 20, .8); border: 1px solid var(--line-2); border-radius: 6px;
  color: var(--text); padding: 10px 12px; font-size: 14px; font-family: var(--sans); outline: none;
}
.cfg-row input:focus, .cfg-row select:focus { border-color: var(--amber); }
.cfg-row select option { background: #0e181f; }
.voice-row { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 10px; }
.voice-row > label { width: 92px; flex: none; letter-spacing: .1em; }
.voice-row select { flex: 1; min-width: 200px; }
.cfg-kicker { font-size: 12px; letter-spacing: .3em; color: var(--teal); margin: 22px 0 12px; border-top: 1px solid var(--line-2); padding-top: 18px; }
.cfg-note { font-size: 12.5px; color: var(--muted); line-height: 1.9; }
.cfg-note.warn { color: var(--rose); }
#toast { position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 20px); z-index: 60;
  background: rgba(14,24,32,.95); border: 1px solid rgba(232,176,75,.45); color: var(--text);
  padding: 12px 22px; border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none; transition: .35s; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast b { color: var(--amber-soft); }

/* ---------- 响应式 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 760px) {
  .map-card { grid-template-columns: 1fr; }
  .map-thumb { height: 130px; }
  .map-actions { border-left: none; border-top: 1px solid var(--line-2); }
  .b-en { font-size: 17px; }
  .q-opts { grid-template-columns: 1fr; }
  #dialogue-layer { padding-top: 9vh; }
}
