/* ============================================================
   北辰青年 · 橙光互动剧情视觉框架（增量叠加，不改动原逻辑）
   作用范围：home(PROLOGUE) / diagnosis(CHAPTER 01) 的场景外壳
   ============================================================ */

:root {
  /* 标题使用人文/杂志感衬线栈；未引入外部字体，后续可换 Noto Serif SC */
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", "Source Han Serif SC", serif;
  --ink-warm: #FBF3E9;
  --ink-soft: #D8CDBF;
  --rabbit: #FF9A5F;
  --rabbit-deep: #F0642D;
}

/* 胶片颗粒噪点（内联 SVG，无外部图片） */
.scene-grain {
  position: absolute; inset: -60%;
  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' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  opacity: .06;
  mix-blend-mode: overlay;
  pointer-events: none;
  animation: grainShift 1.1s steps(3) infinite;
}
@keyframes grainShift {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-6px, 4px); }
  66% { transform: translate(5px, -5px); }
  100% { transform: translate(0, 0); }
}

/* ---------- 场景层（所有剧情视图通用） ---------- */
.scene-layer {
  position: absolute; inset: 0; z-index: 0;
  overflow: hidden; pointer-events: none;
}
.scene-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  transform: scale(1.04);
}
.scene-vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 42%, transparent 36%, rgba(8, 6, 4, .58) 100%);
}

/* ---------- 章节标签 ---------- */
.chapter-label {
  display: flex; align-items: center; justify-content: center; gap: 14px;
}
.ch-no {
  font-size: 13px; font-weight: 700; letter-spacing: .38em;
  color: var(--rabbit); text-transform: uppercase;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .5);
}
.ch-line {
  width: 48px; height: 1px;
  background: linear-gradient(90deg, rgba(255, 154, 95, .75), transparent);
}

/* ============================================================
   页面 1：home → PROLOGUE 开场
   ============================================================ */
.view-prologue { padding: 0 !important; }

.prologue-opening {
  position: relative;
  min-height: 100vh;
  display: flex;
  overflow: hidden;
}
.prologue-stage {
  position: relative; z-index: 6;
  margin: auto; text-align: center;
  padding: 0 24px;
  max-width: 760px;
}
.prologue-title {
  font-family: var(--serif);
  font-size: clamp(34px, 6vw, 60px); font-weight: 700;
  color: var(--ink-warm); letter-spacing: .02em; margin-top: 18px;
  text-shadow: 0 2px 22px rgba(0, 0, 0, .45);
}
.prologue-sub {
  margin-top: 16px; font-size: clamp(15px, 2.2vw, 18px);
  color: var(--ink-soft); text-shadow: 0 1px 10px rgba(0, 0, 0, .5);
}

/* 底部剧情对话框 */
.story-box {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  display: flex; align-items: flex-end; gap: 16px;
  padding: 22px 24px calc(24px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(8, 6, 4, .95) 28%, rgba(8, 6, 4, .55) 68%, transparent);
}
.npc-rabbit { flex: 0 0 104px; width: 104px; }
.npc-rabbit img {
  width: 100%; height: auto; display: block;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .5));
  animation: floatY 3.6s ease-in-out infinite;
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.story-dialog { flex: 1; min-width: 0; max-width: 640px; }
.dialog-name {
  font-size: 13px; font-weight: 700; letter-spacing: .14em;
  color: var(--rabbit); margin-bottom: 6px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .5);
}
.dialog-sub {
  font-size: 11px; letter-spacing: .12em;
  color: var(--ink-soft); margin-bottom: 10px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .5);
}
.dialog-text {
  font-family: var(--serif);
  font-size: clamp(18px, 3vw, 26px); line-height: 1.6;
  color: var(--ink-warm); margin-bottom: 16px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .55);
}
.btn-story {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 16px; font-weight: 700; color: #2A1407;
  background: linear-gradient(135deg, #FFB07A, var(--rabbit-deep));
  border-radius: 999px; padding: 14px 30px;
  box-shadow: 0 10px 26px rgba(240, 100, 45, .42);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.btn-story:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(240, 100, 45, .58); }
.btn-story:active { transform: scale(.97); }
.btn-story .arrow { font-size: 14px; }

/* 原有内容区：剧情模式隐藏，保留 DOM 结构以便未来切换官网/招募展示模式 */
.home-lower { display: none; }

/* ============================================================
   首页开场演出（黑屏 → PROLOGUE → CG 淡入 → 小辰 → 逐字 → 邀请框）
   仅在 body.prologue-play 下触发关键帧；仅首次播放（由 story.js 控制）
   ============================================================ */
.prologue-curtain {
  position: absolute; inset: 0; z-index: 5;
  background: #07060a; opacity: 0; pointer-events: none;
}
body.prologue-play .prologue-chapter,
body.prologue-play .prologue-title { opacity: 0; }
.prologue-intro { z-index: 7; }
.prologue-settle {
  z-index: 7; opacity: 0; visibility: hidden;
  transition: opacity .8s var(--ease), visibility .8s var(--ease);
}
.prologue-settle.show { opacity: 1; visibility: visible; }
.prologue-intro .dialog-text.typing::after {
  content: '▍'; color: var(--rabbit); margin-left: 2px;
  animation: caretBlink 1s steps(1) infinite;
}
@keyframes caretBlink { 50% { opacity: 0; } }

body.prologue-play .prologue-curtain { animation: curtainPlay 1.7s ease forwards; }
body.prologue-play .prologue-chapter { animation: fadeUp .9s ease .25s both; }
body.prologue-play .prologue-title { animation: fadeUp .9s ease .7s both; }
body.prologue-play .prologue-intro { animation: fadeUp .9s ease 1.35s both; }
@keyframes curtainPlay { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* 跳过态（已播放 / 减少动效）：隐藏黑幕与逐字框，直接显示常态邀请框 */
html.skip-prologue .prologue-curtain,
html.skip-prologue .prologue-intro { display: none; }

@media (prefers-reduced-motion: reduce) {
  body.prologue-play .prologue-curtain,
  body.prologue-play .prologue-chapter,
  body.prologue-play .prologue-title,
  body.prologue-play .prologue-intro { animation: none !important; opacity: 1 !important; }
  .prologue-intro .dialog-text.typing::after { animation: none; }
}

/* ============================================================
   页面 2：diagnosis → CHAPTER 01
   ============================================================ */
.view-chapter {
  position: relative; min-height: 100vh;
  padding: calc(var(--topbar-h) + 24px) 24px 60px !important;
}
.view-chapter .scene-layer { height: 100%; }

.chapter-head { position: relative; z-index: 1; max-width: 920px; margin: 0 auto 6px; }
.view-chapter .chapter-label { justify-content: flex-start; }
.chapter-title {
  font-family: var(--serif);
  font-size: clamp(24px, 4vw, 38px); font-weight: 700;
  color: var(--ink-warm); margin-top: 14px;
  text-shadow: 0 2px 16px rgba(0, 0, 0, .5);
}

.diag-stage {
  position: relative; z-index: 1;
  max-width: 920px; margin: 26px auto 0;
  display: flex; gap: 22px; align-items: flex-start;
}
.npc-diag {
  flex: 0 0 150px;
  position: sticky; top: calc(var(--topbar-h) + 24px);
}
.npc-diag img {
  width: 100%; height: auto; display: block;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .5));
  animation: floatY 3.8s ease-in-out infinite;
}
.view-chapter .diag-shell { flex: 1; min-width: 0; }

/* 诊断气泡改为橙光对话框（半透明深色 + 暖橙名牌） */
.view-chapter .diag-label { color: var(--ink-soft); }
.view-chapter .diag-fill { background: var(--rabbit-deep); }
.view-chapter .msg-avatar {
  background: linear-gradient(135deg, var(--rabbit-deep), #FF9A5F);
  color: #fff;
}
.view-chapter .bubble {
  background: rgba(20, 16, 12, .72);
  border: 1px solid rgba(255, 154, 95, .25);
  color: #F3ECE2;
  border-radius: 4px 18px 18px 18px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
}
.view-chapter .bubble .b-name { color: var(--rabbit); }
.view-chapter .msg-user .bubble {
  background: rgba(240, 100, 45, .88);
  color: #fff; border-color: transparent;
}
.view-chapter .typing i { background: var(--ink-soft); }

.view-chapter .msg-options { margin-top: 12px; }
.view-chapter .opt-btn {
  background: rgba(20, 16, 12, .6);
  border-color: rgba(255, 255, 255, .18);
  color: #F3ECE2;
}
.view-chapter .opt-btn:hover {
  border-color: var(--rabbit); background: rgba(240, 100, 45, .18); color: #FFD9C2;
}
.view-chapter .opt-btn.chosen {
  background: var(--rabbit); color: #1C1917; border-color: var(--rabbit);
}
.view-chapter .opt-card-no {
  font-size: 11px; letter-spacing: .2em; color: var(--rabbit);
  margin-bottom: 8px; text-shadow: 0 1px 6px rgba(0, 0, 0, .4);
}
/* 选项点击后的 +1 属性浮字 */
.pick-float {
  position: fixed; z-index: 200; transform: translate(-50%, -50%);
  padding: 6px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 700; color: #2A1407;
  background: linear-gradient(135deg, #FFB07A, var(--rabbit-deep));
  box-shadow: 0 8px 20px rgba(240, 100, 45, .5);
  pointer-events: none; animation: pickFloat 1.05s ease-out forwards;
}
@keyframes pickFloat {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(.8); }
  20% { opacity: 1; transform: translate(-50%, -55%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -150%) scale(1); }
}
.view-chapter .name-input {
  background: rgba(20, 16, 12, .7);
  border-color: rgba(255, 255, 255, .18);
  color: #F3ECE2;
}
.view-chapter .name-input:focus { border-color: var(--rabbit); }
.view-chapter .name-submit { background: var(--rabbit-deep); }
.view-chapter .gen-block {
  background: rgba(20, 16, 12, .72); border: 1px solid rgba(255, 154, 95, .25);
}
.view-chapter .gen-text { color: var(--ink-soft); }
.view-chapter .gen-track { background: rgba(255, 255, 255, .12); }
.view-chapter .gen-fill { background: var(--rabbit-deep); }

/* ============================================================
   页面 3：profile → CHAPTER 02 角色档案
   ============================================================ */
.view-chapter .profile-stage {
  position: relative; z-index: 1;
  max-width: 720px; margin: 22px auto 0;
}
.view-chapter .profile-scan {
  text-align: center; color: var(--ink-soft);
  font-size: 13px; letter-spacing: .14em; margin-bottom: 14px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .5);
}
.view-chapter .profile-card {
  background: rgba(20, 16, 12, .74);
  border: 1px solid rgba(255, 154, 95, .22);
  border-radius: 16px; padding: 26px 24px 22px;
  color: #F3ECE2; backdrop-filter: blur(8px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
}
.view-chapter .profile-top { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.view-chapter .profile-avatar {
  width: 54px; height: 54px; border-radius: 50%;
  background: linear-gradient(135deg, var(--rabbit-deep), #FF9A5F);
  color: #fff; font-size: 22px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex: 0 0 54px;
}
.view-chapter .profile-name { font-size: 20px; font-weight: 700; color: var(--ink-warm); }
.view-chapter .profile-type { font-size: 15px; color: var(--rabbit); font-weight: 700; }
.view-chapter .profile-arch { font-size: 13px; color: var(--ink-soft); }
.view-chapter .profile-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.view-chapter .profile-block {
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px; padding: 14px 16px;
}
.view-chapter .block-label { font-size: 12px; letter-spacing: .12em; color: var(--rabbit); margin-bottom: 8px; }
.view-chapter .block-text { color: #F3ECE2; font-size: 15px; line-height: 1.6; }
.view-chapter .chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.view-chapter .chip {
  background: rgba(240, 100, 45, .16); border: 1px solid rgba(255, 154, 95, .3);
  color: #FFD9C2; border-radius: 999px; padding: 5px 12px; font-size: 13px;
}
.view-chapter .profile-attrs {
  margin-top: 16px; padding: 14px 16px;
  background: rgba(255, 154, 95, .06);
  border: 1px solid rgba(255, 154, 95, .18); border-radius: 12px;
}
.view-chapter .attr-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; }
.view-chapter .attr-name { font-size: 14px; color: var(--ink-warm); }
.view-chapter .attr-stars { color: var(--rabbit); letter-spacing: 2px; font-size: 14px; text-shadow: 0 1px 6px rgba(0, 0, 0, .4); }
.view-chapter .profile-note {
  margin-top: 16px; display: flex; gap: 12px; align-items: flex-start;
  background: rgba(255, 154, 95, .08); border-left: 3px solid var(--rabbit);
  border-radius: 8px; padding: 12px 14px;
}
.view-chapter .note-rabbit { width: 40px; flex: 0 0 40px; }
.view-chapter .note-rabbit img { width: 100%; border-radius: 8px; display: block; }
.view-chapter .note-name { color: var(--rabbit); font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.view-chapter .note-line { color: #F3ECE2; font-size: 14px; line-height: 1.7; margin: 2px 0; }
.view-chapter .profile-actions { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.view-chapter .profile-monologue {
  display: flex; gap: 14px; align-items: flex-start; margin-top: 18px;
  background: rgba(20, 16, 12, .72); border: 1px solid rgba(255, 154, 95, .22);
  border-radius: 14px; padding: 16px 18px; backdrop-filter: blur(8px);
}
.view-chapter .npc-mini { flex: 0 0 56px; width: 56px; }
.view-chapter .npc-mini img { width: 100%; height: auto; display: block; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .5)); }
.view-chapter .monologue-text { flex: 1; min-width: 0; }
.view-chapter .monologue-line { font-family: var(--serif); font-size: 16px; line-height: 1.7; color: var(--ink-warm); margin: 4px 0; text-shadow: 0 1px 8px rgba(0, 0, 0, .4); }
.view-chapter .profile-monologue .dialog-name { margin-bottom: 6px; }
.view-chapter .btn-primary { background: linear-gradient(135deg, #FFB07A, var(--rabbit-deep)); color: #2A1407; border: none; }
.view-chapter .btn-ghost { background: transparent; color: #FFD9C2; border: 1px solid rgba(255, 154, 95, .4); }

/* ============================================================
   顶栏沉浸式（场景视图时变暗）
   ============================================================ */
body.scene-mode .topbar {
  background: rgba(18, 14, 10, .66);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
body.scene-mode .brand-name, body.scene-mode .brand-star { color: var(--ink-warm); }
body.scene-mode .brand-star { color: var(--rabbit); }
body.scene-mode .level-pill {
  color: #FFD9C2; background: rgba(240, 100, 45, .18); border-color: rgba(240, 100, 45, .32);
}
body.scene-mode .level-pill.lv2 { color: #F4D58A; background: var(--gold-soft); border-color: #F0D18A; }
body.scene-mode .reset-btn { color: var(--ink-soft); }
body.scene-mode .reset-btn:hover { color: #fff; background: rgba(255, 255, 255, .08); }
/* 剧情视图解除 main 的 1120px 最大宽度，使 PROLOGUE / CHAPTER 真正全屏 */
body.scene-mode main { max-width: none; margin: 0; }
/* 剧情视图隐藏页脚，使 PROLOGUE / CHAPTER 成为整屏叙事 */
body.scene-mode .footer { display: none; }

/* ---------- 统一章节 HUD（剧情模式顶栏） ---------- */
.chapter-hud {
  display: none;
  align-items: center; gap: 12px; flex: 1; min-width: 0;
  color: var(--ink-warm);
}
body.scene-mode .brand,
body.scene-mode .topbar-progress,
body.scene-mode .topbar-right { display: none; }
body.scene-mode .chapter-hud { display: flex; }

.chapter-hud .hud-brand {
  font-size: 14px; font-weight: 700; letter-spacing: .06em;
  color: var(--rabbit); white-space: nowrap;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .5);
}
.chapter-hud .hud-divider {
  width: 1px; height: 16px; flex: 0 0 1px;
  background: rgba(255, 255, 255, .22);
}
.chapter-hud .ch-hud-no {
  font-size: 12px; font-weight: 700; letter-spacing: .22em;
  color: var(--ink-soft); white-space: nowrap;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .5);
}
.chapter-hud .hud-title {
  font-family: var(--serif);
  font-size: 15px; color: var(--ink-warm); flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .5);
}
.chapter-hud .hud-reset {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; color: var(--ink-soft); background: transparent;
  border: 1px solid rgba(255, 255, 255, .18); cursor: pointer;
  transition: all .18s var(--ease);
}
.chapter-hud .hud-reset:hover { color: #fff; background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .3); }
@media (max-width: 640px) {
  .chapter-hud { gap: 9px; }
  .chapter-hud .hud-brand { font-size: 13px; }
  .chapter-hud .hud-title { font-size: 14px; }
  .chapter-hud .ch-hud-no { letter-spacing: .14em; }
}

/* ============================================================
   响应式（手机竖屏优先）
   ============================================================ */
@media (max-width: 640px) {
  .npc-diag { flex-basis: 82px; }
  .diag-stage { gap: 12px; }
  .view-chapter .chapter-title { font-size: 22px; }
  .npc-rabbit { flex-basis: 72px; width: 72px; }
  .story-box { gap: 12px; padding: 16px 16px calc(18px + env(safe-area-inset-bottom)); }
  .dialog-text { font-size: 18px; }
  .btn-story { padding: 12px 24px; font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .scene-grain, .npc-rabbit img, .npc-diag img { animation: none !important; }
}

/* 背景兜底：图片未加载时仍保持暗色，保证文字可读 */
.prologue-opening, .view-chapter { background: #14100c; }

/* ============================================================
   游戏层扩展：橙光视觉小说化（全章节 HUD / 立绘 / 过场 / 菜单）
   ============================================================ */

/* 新场景视图定位与层级 */
#view-match, #view-challenge, #view-result, #view-beichen { position: relative; }
#view-match > :not(.scene-layer),
#view-challenge > :not(.scene-layer),
#view-result > :not(.scene-layer),
#view-beichen > :not(.scene-layer) { position: relative; z-index: 1; }
body.scene-mode #view-match { max-width: none; }

/* 背景缓慢移动（电影感，尊重 reduced-motion） */
body.scene-mode .scene-bg { animation: bgDrift 28s ease-in-out infinite alternate; }
@keyframes bgDrift { from { transform: scale(1.04) translateX(0); } to { transform: scale(1.08) translateX(-1.2%); } }
@media (prefers-reduced-motion: reduce) { body.scene-mode .scene-bg { animation: none; } }

/* ---------- HUD 游戏状态栏 ---------- */
.chapter-hud { gap: 10px; }
.hud-progress { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; overflow: hidden; }
.hp-seg { font-size: 10px; letter-spacing: .08em; white-space: nowrap; color: rgba(255, 255, 255, .38); padding: 3px 7px; border-radius: 999px; border: 1px solid transparent; }
.hp-seg.done { color: rgba(255, 210, 185, .75); border-color: rgba(240, 100, 45, .35); }
.hp-seg.current { color: #FFD9C2; background: rgba(240, 100, 45, .22); border-color: rgba(255, 154, 95, .5); }
.hp-arrow { color: rgba(255, 255, 255, .22); font-size: 9px; }
.hud-stats { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.hud-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--ink-soft); padding: 3px 8px; border-radius: 999px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); white-space: nowrap; }
.hud-chip b { color: var(--ink-warm); font-weight: 700; }
.hud-chip.pulse { animation: chipPulse .7s ease; }
@keyframes chipPulse { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
#hudLv { color: #FFD9C2; background: rgba(240, 100, 45, .16); border-color: rgba(240, 100, 45, .3); }
.hud-menu { width: 32px; height: 32px; border-radius: 10px; font-size: 17px; color: var(--ink-soft); background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .14); cursor: pointer; transition: all .18s var(--ease); }
.hud-menu:hover { color: #fff; background: rgba(240, 100, 45, .25); border-color: rgba(255, 154, 95, .5); }
@media (max-width: 720px) {
  .hud-progress { display: none; }
  .hud-chip { font-size: 10px; padding: 3px 6px; }
  .chapter-hud { gap: 8px; }
}

/* ---------- 角色立绘层 ---------- */
.cast-layer { position: fixed; inset: 0; z-index: 22; pointer-events: none; }
.cast-fig { position: absolute; bottom: clamp(180px, 25vh, 250px); width: min(28vw, 300px); opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.cast-fig.in { opacity: 1; transform: translateY(0); }
.cast-fig.left { left: 3vw; }
.cast-fig.right { right: 3vw; }
.cast-fig img { width: 100%; height: auto; display: block; filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .55)); animation: castFloat 4.2s ease-in-out infinite; }
.cast-fig .cast-name { position: absolute; top: -26px; left: 0; font-size: 12px; font-weight: 700; letter-spacing: .18em; color: var(--rabbit); text-shadow: 0 1px 8px rgba(0, 0, 0, .6); }
.cast-fig.talk img { animation-duration: 1.5s; filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .55)) brightness(1.1); }
@keyframes castFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@media (max-width: 640px) {
  .cast-fig { bottom: 200px; width: 44vw; }
  .cast-fig.left { left: -5vw; }
  .cast-fig.right { right: -5vw; }
}

/* ---------- 章节入场过场 ---------- */
.chapter-intro { position: fixed; inset: 0; z-index: 120; background: #07060a; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .4s ease; }
.chapter-intro.show { opacity: 1; pointer-events: auto; }
.ci-inner { text-align: center; padding: 0 24px; }
.ci-no { font-size: 14px; font-weight: 700; letter-spacing: .5em; color: var(--rabbit); opacity: 0; transform: translateY(8px); }
.chapter-intro.show .ci-no { animation: ciIn .8s ease .1s forwards; }
.ci-title { font-family: var(--serif); font-size: clamp(28px, 5vw, 46px); font-weight: 700; color: var(--ink-warm); margin-top: 14px; opacity: 0; transform: translateY(10px); }
.chapter-intro.show .ci-title { animation: ciIn .8s ease .45s forwards; }
.ci-line { width: 46px; height: 1px; margin: 18px auto 0; background: linear-gradient(90deg, transparent, rgba(255, 154, 95, .8), transparent); opacity: 0; }
.chapter-intro.show .ci-line { animation: ciIn .6s ease .85s forwards; }
@keyframes ciIn { to { opacity: 1; transform: translateY(0); } }

/* ---------- 作品结算过场 ---------- */
.ending-intro { position: fixed; inset: 0; z-index: 121; background: #07060a; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .5s ease; }
.ending-intro.show { opacity: 1; pointer-events: auto; }
.ei-inner { text-align: center; padding: 0 24px; max-width: 560px; }
.ei-no { font-size: clamp(20px, 4vw, 34px); font-weight: 800; letter-spacing: .3em; color: var(--rabbit); text-shadow: 0 0 30px rgba(240, 100, 45, .35); opacity: 0; }
.ending-intro.show .ei-no { animation: ciIn .9s ease .1s forwards; }
.ei-line { width: 60px; height: 1px; margin: 20px auto; background: linear-gradient(90deg, transparent, rgba(255, 154, 95, .9), transparent); opacity: 0; }
.ending-intro.show .ei-line { animation: ciIn .6s ease .8s forwards; }
.ei-cast { width: min(180px, 40vw); margin: 0 auto; opacity: 0; transform: scale(.9); }
.ending-intro.show .ei-cast { animation: ciIn .8s ease 1.1s forwards; }
.ei-cast img { width: 100%; filter: drop-shadow(0 14px 30px rgba(0, 0, 0, .55)); animation: castFloat 3.6s ease-in-out infinite; }
.ei-text { font-family: var(--serif); font-size: clamp(16px, 2.6vw, 20px); line-height: 1.7; color: var(--ink-warm); margin-top: 18px; opacity: 0; }
.ending-intro.show .ei-text { animation: ciIn .8s ease 1.6s forwards; }

/* ---------- 奖励弹层 ---------- */
.reward-pop { position: fixed; inset: 0; z-index: 122; display: flex; align-items: center; justify-content: center; background: rgba(7, 6, 10, .6); backdrop-filter: blur(4px); }
.reward-pop[hidden] { display: none !important; }
.reward-pop[hidden] { display: none; }
.rp-inner { width: min(460px, 90vw); max-height: 86vh; overflow: auto; text-align: center; background: rgba(20, 16, 12, .94); border: 1px solid rgba(255, 154, 95, .35); border-radius: 18px; padding: 30px 26px 24px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); animation: rpIn .45s var(--ease) both; }
@keyframes rpIn { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
.rp-title { font-size: 12px; letter-spacing: .34em; color: var(--rabbit); }
.rp-badge { width: 64px; height: 64px; margin: 16px auto 10px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 26px; color: #2A1407; background: linear-gradient(135deg, #FFB07A, var(--rabbit-deep)); box-shadow: 0 0 0 6px rgba(240, 100, 45, .18), 0 10px 26px rgba(240, 100, 45, .4); animation: badgePop 1.2s ease infinite; }
@keyframes badgePop { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.rp-name { font-family: var(--serif); font-size: 20px; font-weight: 700; color: var(--ink-warm); }
.rp-rows { margin: 16px 0 20px; text-align: left; }
.rp-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px dashed rgba(255, 255, 255, .1); font-size: 14px; }
.rp-row .k { color: var(--ink-soft); }
.rp-row .v { color: var(--rabbit); font-weight: 700; }
.rp-close { width: 100%; padding: 12px; border-radius: 999px; font-size: 15px; font-weight: 700; color: #2A1407; background: linear-gradient(135deg, #FFB07A, var(--rabbit-deep)); border: none; cursor: pointer; }

/* ---------- 游戏菜单 ---------- */
.game-menu { position: fixed; top: 0; right: 0; bottom: 0; width: min(320px, 86vw); z-index: 130; background: rgba(18, 14, 10, .94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-left: 1px solid rgba(255, 255, 255, .08); transform: translateX(102%); transition: transform .32s var(--ease); display: flex; flex-direction: column; padding: 20px 18px; }
.game-menu.open { transform: translateX(0); }
.gm-head { display: flex; justify-content: space-between; align-items: center; font-size: 15px; font-weight: 700; letter-spacing: .08em; color: var(--rabbit); padding: 6px 4px 16px; border-bottom: 1px solid rgba(255, 255, 255, .08); margin-bottom: 10px; }
.gm-close { background: none; border: none; color: var(--ink-soft); font-size: 20px; cursor: pointer; }
.gm-item { padding: 13px 12px; margin: 2px 0; border-radius: 10px; font-size: 15px; color: var(--ink-warm); cursor: pointer; transition: background .18s var(--ease), color .18s var(--ease); }
.gm-item:hover { background: rgba(240, 100, 45, .14); color: #FFD9C2; }
.gm-item.gm-danger { color: #E5A9A0; }
.gm-item.gm-danger:hover { background: rgba(220, 80, 60, .14); }
.gm-sub { margin-top: 8px; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); font-size: 14px; color: var(--ink-soft); line-height: 2; }
.gm-sub .gs-row { display: flex; justify-content: space-between; align-items: center; }
.gm-sub .gs-row b { color: var(--ink-warm); font-weight: 600; }
.gm-sub .gs-done { color: var(--rabbit); }
.gm-sub .gs-lock { opacity: .45; }
.gm-sub .gs-row[data-view] { cursor: pointer; transition: opacity .15s ease, transform .15s ease; }
.gm-sub .gs-row[data-view]:hover { opacity: 1; transform: translateX(2px); }
.gm-sub .gs-row[data-view] .gs-go { font-size: 12px; color: var(--ink-soft); letter-spacing: .08em; }
.gm-sub .gs-row[data-view]:hover .gs-go { color: var(--rabbit); }
.gm-sub .gs-cur { opacity: 1; }
.gm-sub .attr-bar { margin: 4px 0 10px; }
.gm-mask { position: fixed; inset: 0; z-index: 129; background: rgba(0, 0, 0, .45); }
.gm-mask[hidden] { display: none; }

/* ---------- 场景视图深色内容覆盖（非 match：保留原逻辑） ---------- */
body.scene-mode .page-head h1 { color: var(--ink-warm); }
body.scene-mode .page-head .eyebrow { color: var(--rabbit); }
body.scene-mode .page-sub { color: var(--ink-soft); }

/* ---------- QUEST / 任务模式：背景降存在感 + 高可读面板 ---------- */
/* 强遮罩：背景仅作氛围，不承载文字 */
#view-match .scene-veil {
  position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(180deg, rgba(10, 8, 6, .78) 0%, rgba(10, 8, 6, .7) 42%, rgba(8, 6, 5, .92) 100%),
    radial-gradient(120% 80% at 50% 30%, rgba(10, 8, 6, .55), rgba(8, 6, 5, .9));
}
/* 面板后的局部再压暗，确保正文对比度 */
#view-match .quest-panel::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: 16px;
  background: rgba(14, 11, 8, .94);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
}
#view-match .quest-panel {
  position: relative; z-index: 2;
  width: min(640px, 92vw);
  margin: clamp(48px, 9vh, 96px) auto 0;
  padding: 34px 36px 30px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 16px;
  color: #F4EDE3;
}
/* 层级 1：QUEST 01 + 标题 */
.quest-no { font-size: 13px; font-weight: 800; letter-spacing: .42em; color: var(--rabbit); }
.quest-title { font-family: var(--serif); font-size: clamp(26px, 4.4vw, 38px); font-weight: 700; color: #FBF6EE; line-height: 1.18; margin: 10px 0 6px; }
.quest-lead { font-size: 15px; color: #E7DECF; margin: 0; }
/* 分隔线 */
.quest-block { padding: 18px 0; border-top: 1px solid rgba(255, 255, 255, .1); }
.quest-block:first-of-type { border-top: none; }
.qb-label { font-size: 12px; letter-spacing: .2em; color: var(--rabbit); margin-bottom: 8px; }
.qb-body { font-size: 16px; line-height: 1.75; color: #F4EDE3; margin: 0; }
/* 层级 2：任务信息——弱化、克制 */
.quest-info { display: flex; gap: 30px; flex-wrap: wrap; }
.qi-row { display: flex; flex-direction: column; gap: 4px; }
.qi-k { font-size: 12px; letter-spacing: .12em; color: #B6AC9B; }
.qi-v { font-size: 17px; font-weight: 700; color: #F4EDE3; }
/* 层级 3：你的任务位置——重点突出 */
.role-main {
  display: inline-flex; align-items: baseline; gap: 12px;
  font-family: var(--serif); font-size: clamp(22px, 3.4vw, 28px); font-weight: 700; color: #FBF6EE;
}
.role-match { font-family: var(--sans); font-size: 13px; font-weight: 800; letter-spacing: .1em; color: #1C1917; background: var(--rabbit); padding: 3px 9px; border-radius: 6px; }
.role-desc { font-size: 14px; line-height: 1.7; color: #CFC6B6; margin: 10px 0 0; }
.role-desc b { color: #FFD9C2; font-weight: 600; }
/* 层级 4：接受任务按钮 */
.btn-accept {
  display: block; width: 100%; margin-top: 26px; padding: 15px 20px;
  font-size: 16px; font-weight: 700; letter-spacing: .04em; color: #1C1917;
  background: var(--rabbit); border: none; border-radius: 12px; cursor: pointer;
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease);
}
.btn-accept .arrow { transition: transform .16s var(--ease); }
.btn-accept:hover { background: var(--rabbit-deep); box-shadow: 0 10px 30px rgba(240, 100, 45, .4); transform: translateY(-2px); }
.btn-accept:hover .arrow { transform: translateX(4px); }
.btn-accept:active { transform: translateY(0) scale(.99); }
/* 弱化区块：更多项目——不在主面板内，不抢焦点 */
.quest-more { position: relative; z-index: 2; width: min(640px, 92vw); margin: 18px auto 40px; text-align: center; }
.qm-kicker { display: block; font-size: 12px; letter-spacing: .22em; color: #9C9384; margin-bottom: 12px; }
.qm-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 14px; margin: 6px 0; border: 1px solid rgba(255, 255, 255, .08); border-radius: 10px; background: rgba(14, 11, 8, .72); }
.qm-name { font-size: 15px; color: #E7DECF; }
.qm-tag { font-size: 12px; color: #B6AC9B; white-space: nowrap; }
@media (max-width: 640px) {
  #view-match .quest-panel { padding: 26px 22px 24px; }
  .quest-info { gap: 22px; }
  .qm-row { flex-direction: column; align-items: flex-start; gap: 3px; }
}

/* challenge：Quest 进度与深色步骤区 */
body.scene-mode .challenge-side h1, body.scene-mode .challenge-desc { color: var(--ink-warm); }
body.scene-mode .step-list li { color: var(--ink-soft); border-color: rgba(255, 255, 255, .12); }
body.scene-mode .step-list li.active { color: #FFD9C2; border-color: rgba(255, 154, 95, .5); }
body.scene-mode .step-list li.done { color: var(--rabbit); }
body.scene-mode .stage-kicker { color: var(--rabbit); }
body.scene-mode .stage-title { color: var(--ink-warm); }
body.scene-mode .stage-desc { color: #E8DFD3; }
body.scene-mode .persona-card, body.scene-mode .choice-chip, body.scene-mode .suggest-item { background: rgba(20, 16, 12, .68); border-color: rgba(255, 255, 255, .14); color: #F3ECE2; }
body.scene-mode .persona-card:hover, body.scene-mode .choice-chip:hover, body.scene-mode .suggest-item:hover { border-color: var(--rabbit); background: rgba(240, 100, 45, .14); }
body.scene-mode .persona-card.selected, body.scene-mode .choice-chip.selected, body.scene-mode .suggest-item.selected { background: rgba(240, 100, 45, .28); border-color: var(--rabbit); }
body.scene-mode .persona-name, body.scene-mode .s-title { color: var(--ink-warm); }
body.scene-mode .persona-tag, body.scene-mode .s-detail, body.scene-mode .persona-quote { color: var(--ink-soft); }
body.scene-mode .plan-draft, body.scene-mode .summary-card { background: rgba(255, 255, 255, .04); border-color: rgba(255, 154, 95, .22); color: #F3ECE2; }
body.scene-mode .plan-draft h4, body.scene-mode .pd-label { color: var(--ink-warm); }
body.scene-mode .pd-value, body.scene-mode .pd-oneline, body.scene-mode .sum-value, body.scene-mode .sum-label { color: #F3ECE2; }
body.scene-mode .choice-label { color: var(--ink-warm); }
body.scene-mode .q-no { color: var(--rabbit); }
body.scene-mode .stage-hint, body.scene-mode .gen-final p { color: var(--ink-soft); }
body.scene-mode .ai-block { background: rgba(255, 154, 95, .07); border: 1px solid rgba(255, 154, 95, .22); }
body.scene-mode .ai-block .ai-title { color: var(--rabbit); }
body.scene-mode .ai-block p { color: #F3ECE2; }
body.scene-mode #view-result .result-tip { color: var(--ink-soft); }

/* beichen：下一章 */
body.scene-mode .beichen-hero h1 { color: var(--ink-warm); }
body.scene-mode .beichen-sub { color: var(--ink-soft); }
body.scene-mode .beichen-card h3 { color: var(--ink-warm); }
body.scene-mode .beichen-card p, body.scene-mode .beichen-note { color: var(--ink-soft); }
body.scene-mode .beichen-cta h3 { color: var(--ink-warm); }
.next-chapter-label { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 44px 0 8px; }
.next-chapter-label .nc-no { font-size: 12px; font-weight: 700; letter-spacing: .34em; color: var(--rabbit); }
.next-chapter-label em { font-style: normal; font-family: var(--serif); font-size: 20px; font-weight: 700; color: var(--ink-warm); }
.next-chapter-label::before, .next-chapter-label::after { content: ''; height: 1px; width: 60px; background: linear-gradient(90deg, transparent, rgba(255, 154, 95, .6)); }
.next-chapter-label::after { background: linear-gradient(270deg, transparent, rgba(255, 154, 95, .6)); }

/* ---------- 剧情选项按钮升级（诊断，卡片式） ---------- */
.view-chapter .opt-btn {
  display: block; width: 100%; text-align: left;
  padding: 14px 18px; margin: 8px 0;
  border-radius: 14px;
  font-size: 15px; line-height: 1.5;
  background: rgba(20, 16, 12, .62);
  border: 1px solid rgba(255, 255, 255, .16);
  color: #F3ECE2; cursor: pointer;
  transition: transform .16s var(--ease), border-color .16s var(--ease), background .16s var(--ease), box-shadow .16s var(--ease);
  opacity: 0; animation: optIn .5s var(--ease) forwards;
}
.view-chapter .msg-options .opt-btn:nth-child(1) { animation-delay: .05s; }
.view-chapter .msg-options .opt-btn:nth-child(2) { animation-delay: .14s; }
.view-chapter .msg-options .opt-btn:nth-child(3) { animation-delay: .23s; }
.view-chapter .msg-options .opt-btn:nth-child(4) { animation-delay: .32s; }
@keyframes optIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.view-chapter .opt-btn:hover { transform: translateY(-1px); border-color: var(--rabbit); background: rgba(240, 100, 45, .16); color: #FFD9C2; box-shadow: 0 0 0 3px rgba(240, 100, 45, .14), 0 8px 22px rgba(0, 0, 0, .3); }
.view-chapter .opt-btn:active { transform: scale(.985); }
.view-chapter .opt-btn.chosen { background: rgba(240, 100, 45, .85); color: #1C1917; border-color: rgba(255, 154, 95, .9); box-shadow: 0 0 0 3px rgba(240, 100, 45, .22); }

/* ---------- 场景视图切换淡入 ---------- */
body.scene-mode .view.active { animation: sceneViewIn .6s var(--ease) both; }
@keyframes sceneViewIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 角色档案属性条 ---------- */
.view-chapter .attr-row { display: block; padding: 9px 0; }
.view-chapter .attr-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.view-chapter .attr-name { font-size: 13px; color: var(--ink-warm); }
.view-chapter .attr-val { font-size: 13px; color: var(--rabbit); font-weight: 700; }
.view-chapter .attr-bar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.view-chapter .attr-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--rabbit-deep), #FFB07A); transition: width .9s var(--ease); }

/* ---------- 开场对话框控制（继续 / 跳过 / 选择） ---------- */
.prologue-intro { cursor: pointer; }
.prologue-intro .dialog-text { margin-bottom: 10px; min-height: 2.6em; }
.opening-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.opening-actions .btn-story { padding: 11px 24px; font-size: 15px; }
.opening-actions .btn-ghost { background: transparent; color: #FFD9C2; border: 1px solid rgba(255, 154, 95, .4); border-radius: 999px; padding: 11px 24px; font-size: 15px; font-weight: 700; cursor: pointer; }
.opening-actions .btn-ghost:hover { background: rgba(240, 100, 45, .14); }
.opening-skip { position: absolute; top: 14px; right: 18px; z-index: 3; font-size: 12px; letter-spacing: .1em; color: var(--ink-soft); background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.opening-skip:hover { color: #fff; background: rgba(240, 100, 45, .18); }
.continue-hint { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; letter-spacing: .12em; color: var(--ink-soft); animation: hintFade 2s ease infinite; }
@keyframes hintFade { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  body.scene-mode .scene-bg, .cast-fig img, .ei-cast img, .rp-badge { animation: none !important; }
  .view-chapter .opt-btn { animation: none; opacity: 1; }
  .chapter-intro.show .ci-no, .chapter-intro.show .ci-title, .chapter-intro.show .ci-line,
  .ending-intro.show .ei-no, .ending-intro.show .ei-line, .ending-intro.show .ei-cast, .ending-intro.show .ei-text { animation: none !important; opacity: 1 !important; transform: none !important; }
}

/* ============================================================
   范式转换：视觉小说对话系统（CHAPTER 01 标杆）
   原则：游戏里保留信息，而不是网页里加游戏元素
   ============================================================ */

/* 剧情模式顶栏极简化：只保留 ☰ 菜单按钮，隐藏整套状态数值 */
body.scene-mode .chapter-hud .hud-brand,
body.scene-mode .chapter-hud .hud-progress,
body.scene-mode .chapter-hud .ch-hud-no,
body.scene-mode .chapter-hud .hud-title,
body.scene-mode .chapter-hud .hud-stats,
body.scene-mode .chapter-hud .hud-reset { display: none; }
body.scene-mode .chapter-hud { justify-content: flex-end; gap: 0; }
body.scene-mode .chapter-hud .hud-menu { font-size: 18px; }

/* 剧情模式隐藏右下角悬浮小辰（聊天入口收进 ☰ 菜单） */
body.scene-mode .chat-fab { display: none; }

/* ---------- 统一视觉小说舞台（重定位后：全局单舞台，scene-mode 显示） ---------- */
.vn-stage { display: none; position: fixed; inset: 0; z-index: 3; }
body.scene-mode .vn-stage { display: block; }

/* 角色立绘：居中偏左站位，z 低于对话框 → 对话框遮住立绘下半身（标准 VN 站位） */
.vn-cast { position: absolute; left: 24vw; bottom: 17vh; width: min(28vw, 320px); opacity: 0; z-index: 1; }
body.scene-mode .vn-cast { animation: vnCastIn 1s var(--ease) .3s forwards; }
@keyframes vnCastIn { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: translateY(0); } }
.vn-cast img { width: 100%; height: auto; display: block; filter: drop-shadow(0 20px 44px rgba(0, 0, 0, .55)); animation: castFloat 4.4s ease-in-out infinite; }
.vn-cast.talk img { animation: castFloat 4.4s ease-in-out infinite, vnSpeak 1.1s ease-out; filter: drop-shadow(0 20px 44px rgba(0, 0, 0, .55)); }
@keyframes vnSpeak { 0%, 100% { filter: drop-shadow(0 20px 44px rgba(0, 0, 0, .55)); } 30% { filter: drop-shadow(0 20px 44px rgba(0, 0, 0, .55)) brightness(1.18); } }

/* 底部剧情框：横向宽、半透明深色、模糊、细边框、轻圆角，不做卡片 */
/* z-index 高于立绘：立绘站在对话框后面，下半身被自然遮住 */
.vn-dialog {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  width: min(900px, calc(100vw - 28px));
  box-sizing: border-box;
  padding: 18px 22px 16px;
  border-radius: 16px;
  background: rgba(16, 13, 10, .78);
  border: 1px solid rgba(255, 255, 255, .1);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .4);
  color: var(--ink-warm);
  z-index: 2;
}
.vn-ch { font-size: 11px; letter-spacing: .3em; color: var(--rabbit); margin-bottom: 8px; }
.vn-meta { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.vn-char { font-size: 15px; font-weight: 700; letter-spacing: .12em; color: var(--rabbit); }
.vn-sub { font-size: 11px; letter-spacing: .1em; color: var(--ink-soft); }
.vn-text { font-family: var(--serif); font-size: clamp(17px, 2.4vw, 21px); line-height: 1.75; min-height: 3.5em; margin: 0; text-shadow: 0 1px 8px rgba(0, 0, 0, .5); }
.vn-text.typing::after { content: '▍'; color: var(--rabbit); margin-left: 2px; animation: caretBlink 1s steps(1) infinite; }
.vn-hint { display: inline-block; margin-top: 6px; font-size: 12px; letter-spacing: .14em; color: var(--ink-soft); animation: hintFade 2s ease infinite; }
.vn-opt-area { margin-top: 10px; }

/* 剧情选项：纵向、居中、半透明、克制、点击反馈 */
.vn-opt {
  display: flex; align-items: center; gap: 14px; width: 100%;
  margin: 8px 0; padding: 13px 18px; text-align: left; box-sizing: border-box;
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .14);
  color: #F3ECE2; font-size: 15px; line-height: 1.5; cursor: pointer;
  opacity: 0; animation: optIn .5s var(--ease) forwards;
  transition: transform .15s var(--ease), border-color .15s var(--ease), background .15s var(--ease);
}
.vn-opt:nth-child(2) { animation-delay: .08s; }
.vn-opt:nth-child(3) { animation-delay: .16s; }
.vn-opt:nth-child(4) { animation-delay: .24s; }
.vn-opt-no { flex: 0 0 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--rabbit); border: 1px solid rgba(255, 154, 95, .45); }
.vn-opt:hover { transform: translateY(-1px); border-color: rgba(255, 154, 95, .55); background: rgba(240, 100, 45, .14); }
.vn-opt:active { transform: scale(.985); }
.vn-opt.chosen { background: rgba(240, 100, 45, .85); border-color: rgba(255, 154, 95, .9); color: #1C1917; }
.vn-opt.chosen .vn-opt-no { color: #1C1917; border-color: rgba(255, 255, 255, .6); }

/* 名字输入：剧情中的中央一幕，提交后消失 */
.vn-name { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 6; text-align: center; width: min(420px, 88vw); }
.vn-name-prompt { font-family: var(--serif); font-size: clamp(18px, 2.6vw, 24px); color: var(--ink-warm); margin-bottom: 18px; text-shadow: 0 1px 10px rgba(0, 0, 0, .5); }
.vn-name-row2 { display: flex; gap: 10px; }
.vn-name-input {
  flex: 1; min-width: 0; padding: 13px 16px; border-radius: 12px; box-sizing: border-box;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .16);
  color: var(--ink-warm); font-size: 16px; outline: none; text-align: center;
}
.vn-name-input:focus { border-color: var(--rabbit); }
.vn-name-input::placeholder { color: rgba(216, 205, 191, .6); }
.vn-name-btn { padding: 13px 26px; border-radius: 12px; border: none; font-size: 15px; font-weight: 700; color: #2A1407; background: linear-gradient(135deg, #FFB07A, var(--rabbit-deep)); cursor: pointer; }
.vn-name-btn:hover { filter: brightness(1.06); }
.vn-name-btn:active { transform: scale(.97); }

@media (max-width: 640px) {
  .vn-cast { left: 10vw; bottom: 18vh; width: 52vw; }
  .vn-dialog { padding: 14px 16px 12px; bottom: 10px; width: calc(100vw - 16px); }
  .vn-opt { padding: 11px 14px; font-size: 14px; }
  .vn-opt-no { flex-basis: 22px; height: 22px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  body.scene-mode .vn-cast { animation: none; opacity: 1; }
  .vn-cast img { animation: none; }
  .vn-opt { animation: none; opacity: 1; }
}

/* ============================================================
   视觉小说重定位补充：全屏场景 / CG 层 / 章节头 / 档案卡浮层
   ============================================================ */

/* 场景视图：全屏舞台（覆盖 main 的 max-width 与 .view 内边距） */
body.scene-mode .view-chapter {
  position: fixed; inset: 0; z-index: 1; margin: 0;
  width: 100vw; height: 100vh; overflow: hidden;
  padding: 0 !important; background: #14100c;
}
body.scene-mode .view-chapter.active { animation: none; }
body.scene-mode .view-chapter .scene-layer { position: absolute; inset: 0; }
body.scene-mode .view-chapter .scene-bg,
body.scene-mode .view-chapter .scene-veil { background-size: cover; background-position: center; }

/* 章节头：顶置居中，弱化，游戏 HUD 感 */
.chapter-head {
  position: fixed; top: 78px; left: 50%; transform: translateX(-50%);
  text-align: center; z-index: 4; pointer-events: none; width: max-content; max-width: 92vw;
}
.chapter-label { display: flex; align-items: center; gap: 12px; justify-content: center; font-size: 11px; letter-spacing: .34em; color: var(--rabbit); }
.chapter-label .ch-line { width: 44px; height: 1px; background: rgba(255, 154, 95, .5); }
.chapter-title { font-family: var(--serif); font-size: clamp(20px, 3vw, 28px); color: var(--ink-warm); margin: 10px 0 0; letter-spacing: .08em; text-shadow: 0 2px 16px rgba(0, 0, 0, .55); }

/* CG 事件层：48h 序列 / 二维码，全屏背景 + Ken Burns */
.vn-cg {
  position: absolute; inset: 0; z-index: 1;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity .7s ease;
  pointer-events: none;
}
.vn-cg.show { opacity: 1; animation: cgKenburns 14s ease-in-out infinite alternate; }
.vn-cg.qr-mode { animation: none; }
@keyframes cgKenburns { from { transform: scale(1); } to { transform: scale(1.06); } }
.vn-cast.cg-mode { opacity: 0 !important; pointer-events: none; }
.vn-cast.hidden { display: none; }
.vn-dialog.cg-mode { z-index: 3; }

/* 探索档案卡浮层（CH02） */
.profile-card-pop {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  background: rgba(8, 6, 4, .86); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  pointer-events: auto; cursor: pointer;
}
/* 关键：HTML hidden 属性 + CSS display:flex 冲突，强制 [hidden] 隐藏（覆盖 display:flex） */
.profile-card-pop[hidden] { display: none !important; }
.pc-inner {
  width: min(560px, 92vw); max-height: 84vh; overflow: auto; box-sizing: border-box;
  background: linear-gradient(160deg, #241a12, #171009);
  border: 1px solid rgba(255, 154, 95, .25); border-radius: 20px; padding: 26px 28px 22px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .55); cursor: default;
}
.pc-kicker { font-size: 11px; letter-spacing: .3em; color: var(--rabbit); margin-bottom: 16px; }
.pc-top { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.pc-avatar {
  width: 52px; height: 52px; border-radius: 50%; flex: 0 0 52px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; color: #2A1407;
  background: linear-gradient(135deg, #FFB07A, var(--rabbit-deep));
}
.pc-name { font-size: 20px; font-weight: 700; color: var(--ink-warm); }
.pc-type { font-size: 13px; color: var(--rabbit); margin-top: 3px; letter-spacing: .04em; }
.pc-block { margin-top: 14px; }
.pc-block-label { font-size: 11px; letter-spacing: .22em; color: var(--ink-soft); margin-bottom: 8px; }
.pc-dir { color: #F3ECE2; font-size: 14px; line-height: 1.7; }
.pc-attrs { display: grid; gap: 8px; margin-top: 4px; }
.pc-attr { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-warm); }
.pc-attr-name { width: 86px; flex: 0 0 86px; }
.pc-attr .attr-bar { flex: 1; height: 6px; background: rgba(255, 255, 255, .1); border-radius: 4px; overflow: hidden; }
.pc-attr .attr-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--rabbit), #FFB07A); border-radius: 4px; }
.pc-attr b { width: 30px; text-align: right; color: var(--ink-soft); font-weight: 400; }
.pc-inner .chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.pc-inner .chip {
  padding: 5px 12px; border-radius: 999px; font-size: 13px;
  color: #F3ECE2; background: rgba(240, 100, 45, .14); border: 1px solid rgba(255, 154, 95, .32);
}
.pc-close {
  display: block; margin: 22px auto 0; padding: 12px 36px; border: none; border-radius: 12px;
  font-size: 15px; font-weight: 700; color: #2A1407; cursor: pointer;
  background: linear-gradient(135deg, #FFB07A, var(--rabbit-deep));
  position: relative; z-index: 201; pointer-events: auto;
}
.pc-close:hover { filter: brightness(1.06); }
.pc-close:active { transform: scale(.97); }
.pc-tip { text-align: center; margin-top: 12px; font-size: 11px; letter-spacing: .14em; color: var(--ink-soft); }

@media (max-width: 640px) {
  .chapter-head { top: 64px; }
  .pc-inner { padding: 20px 18px 18px; }
}

/* ENDING 二维码页操作按钮：保存二维码 / 重新开始 */
#vnOptArea.end-actions { display: flex; gap: 12px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
#vnOptArea.end-actions .end-btn {
  flex: 0 1 200px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: 12px; border: 1px solid rgba(255, 154, 95, .45);
  background: rgba(240, 100, 45, .16); color: #F3ECE2; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: transform .15s ease, background .2s ease; animation: none;
}
#vnOptArea.end-actions .end-btn:hover { background: rgba(240, 100, 45, .32); transform: translateY(-1px); }
#vnOptArea.end-actions .end-btn:active { transform: scale(.97); }
#vnOptArea.end-actions .end-ico { font-size: 16px; }

/* ---------- 报名二维码结束页（独立面板，二维码完整显示） ---------- */
.qr-page {
  position: fixed; inset: 0; z-index: 250;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #FBF4EA, #F1E4D0);
  padding: 20px;
}
.qr-page[hidden] { display: none !important; }
.qr-card {
  width: min(420px, 92vw); box-sizing: border-box; text-align: center;
  background: #FFFFFF; border-radius: 22px; padding: 30px 26px 26px;
  box-shadow: 0 24px 70px rgba(120, 80, 30, .22);
}
.qr-title { font-size: 20px; font-weight: 800; color: #1C1917; letter-spacing: .05em; }
.qr-sub { font-size: 11px; color: #A8A29E; margin-top: 6px; letter-spacing: .3em; }
.qr-img {
  width: min(240px, 70vw); height: min(240px, 70vw); object-fit: contain;
  margin: 20px auto 4px; display: block;
  border-radius: 12px; border: 1px solid #EFE7DA;
}
.qr-caption { font-size: 13px; color: #78716C; line-height: 1.75; margin-top: 10px; }
.qr-actions { display: flex; gap: 12px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
.qr-btn {
  padding: 13px 22px; border-radius: 12px; font-size: 15px; font-weight: 700;
  cursor: pointer; border: none; transition: transform .15s ease, filter .2s ease;
}
.qr-save { color: #2A1407; background: linear-gradient(135deg, #FFB07A, #F0642D); }
.qr-explore { color: #44403C; background: #F1EAE0; border: 1px solid #E7DFD2; }
.qr-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.qr-btn:active { transform: scale(.97); }
@media (max-width: 640px) {
  .qr-card { padding: 24px 18px 22px; }
  .qr-btn { flex: 1 1 140px; padding: 12px 14px; }
}
