/* ================================================================
   一、CSS变量 & 全局重置
   ================================================================ */
:root {
  /* 配色 —— 高对比度复古旧书质感 */
  --bg-dark: #080604;
  --page-bg: rgba(255, 250, 240, 0.90);
  --page-bg-strong: rgba(255, 250, 240, 0.96);
  --text-main: #1a0f08;
  --text-title: #402618;
  --text-transition: #5c4a3b;
  --speaker-ursula: #a52020;
  --speaker-jose: #1a3a4a;
  --speaker-melquiades: #c4910a;
  --speaker-narrator: #4a2a18;
  --choice-bg: #faf3e8;
  --choice-border: #b8956a;
  --choice-hover-bg: #ecdcc8;
  --choice-active-bg: #c89860;
  --gold: #b8893e;
  --gold-light: #e8c870;
  --gold-dim: #d4b070;
  --spine-shadow: rgba(0,0,0,0.18);
  --sidebar-text: #e0d2bc;
  --sidebar-text-dim: #c0b090;

  /* 字体 */
  --font-body: 'Cormorant Garamond', 'Noto Serif SC', 'Georgia', 'STSong', serif;
  --font-title: 'Cinzel', 'Noto Serif SC', 'Times New Roman', serif;
  --font-ui: 'Noto Serif SC', 'Georgia', serif;

  /* 尺寸 */
  --topbar-h: 48px;
  --bottombar-h: 56px;
  --book-padding: 40px;
  --spine-width: 4px;

  /* 过渡 */
  --transition-speed: 0.35s;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg-dark);
  font-family: var(--font-body);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  color: var(--text-main);
}

/* ================================================================
   二、书页背景层
   ================================================================ */
#book-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-color: #241c12;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(200,155,80,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(200,155,80,0.04) 0%, transparent 50%),
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="400" height="400"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/></filter><rect width="400" height="400" filter="url(%23n)" opacity="0.02"/></svg>');
  opacity: 1;
}

/* 书页纹理叠加 */
#book-texture {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(139,105,20,0.02) 2px, rgba(139,105,20,0.02) 4px);
  opacity: 0.35;
}

/* 暗角 */
#vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  box-shadow: inset 0 0 180px 60px rgba(0,0,0,0.55);
}

/* ================================================================
   三、主布局 — CSS Grid 书页
   ================================================================ */
#app-container {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
}

/* 顶部栏 */
#top-bar {
  height: var(--topbar-h);
  z-index: 15;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  background: linear-gradient(to bottom, rgba(10,8,4,0.9) 0%, rgba(10,8,4,0.4) 100%);
  gap: 12px;
  flex-shrink: 0;
  backdrop-filter: blur(6px);
}

.top-item {
  display: flex;
  align-items: center;
  gap: 16px;
}

.top-btn {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  color: var(--gold-dim);
  background: rgba(10,8,4,0.55);
  border: 1px solid rgba(184,137,62,0.22);
  padding: 5px 14px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.top-btn:hover {
  background: rgba(184,137,62,0.12);
  border-color: rgba(184,137,62,0.45);
  color: #e8d0a0;
}

#progress-label {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--gold-dim);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

/* 书页区域 */
#book-area {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr var(--spine-width) 1fr;
  overflow: hidden;
  min-height: 0;
  position: relative; /* 为翻页导航按钮提供定位参考 */
}

/* ── 翻页导航按钮 ── */
.book-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 40px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20,14,8,0.55);
  border: 1px solid rgba(184,137,62,0.18);
  color: var(--gold-dim);
  font-family: var(--font-ui);
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.book-nav-btn:hover {
  background: rgba(184,137,62,0.12);
  border-color: rgba(184,137,62,0.45);
  color: #e8d0a0;
  box-shadow: 0 0 16px rgba(184,137,62,0.1);
}
.book-nav-btn:active {
  background: rgba(184,137,62,0.18);
  transform: translateY(-50%) scale(0.95);
}
#nav-prev { left: 4px; border-radius: 0 8px 8px 0; }
#nav-next { right: 4px; border-radius: 8px 0 0 8px; }

/* 左页 */
#left-page {
  position: relative;
  padding: 32px 28px 32px 36px;
  overflow-y: auto;
  overflow-x: hidden;
  background:
    linear-gradient(to right, rgba(0,0,0,0.04) 0%, transparent 6%),
    linear-gradient(to left, rgba(0,0,0,0.03) 0%, transparent 3%),
    rgba(255, 250, 240, 0.88);
  transition: opacity var(--transition-speed) ease;
}
#left-page.fading { opacity: 0; }

#left-page::-webkit-scrollbar { width: 4px; }
#left-page::-webkit-scrollbar-track { background: transparent; }
#left-page::-webkit-scrollbar-thumb { background: rgba(139,105,20,0.15); border-radius: 6px; }

/* 书脊 */
#spine {
  position: relative;
  background: linear-gradient(
    to right,
    rgba(0,0,0,0.12) 0%,
    rgba(0,0,0,0.18) 30%,
    rgba(0,0,0,0.22) 50%,
    rgba(0,0,0,0.18) 70%,
    rgba(0,0,0,0.12) 100%
  );
  box-shadow:
    -2px 0 8px rgba(0,0,0,0.1),
    2px 0 8px rgba(0,0,0,0.1);
  z-index: 2;
}

/* 右页 */
#right-page {
  position: relative;
  padding: 32px 36px 32px 28px;
  overflow-y: auto;
  overflow-x: hidden;
  background:
    linear-gradient(to left, rgba(0,0,0,0.04) 0%, transparent 6%),
    linear-gradient(to right, rgba(0,0,0,0.03) 0%, transparent 3%),
    rgba(255, 250, 240, 0.88);
  transition: opacity var(--transition-speed) ease;
}
#right-page.fading { opacity: 0; }

#right-page::-webkit-scrollbar { width: 4px; }
#right-page::-webkit-scrollbar-track { background: transparent; }
#right-page::-webkit-scrollbar-thumb { background: rgba(139,105,20,0.15); border-radius: 6px; }

/* 阅读进度条（可点击/拖动） */
#reading-progress {
  position: relative;
  z-index: 16;
  height: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 8px;
  cursor: pointer;
}
#reading-progress-track {
  position: relative;
  width: 100%;
  height: 4px;
  background: rgba(184,137,62,0.08);
  border-radius: 2px;
}
#reading-progress-fill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  background: linear-gradient(to right, rgba(184,137,62,0.3), var(--gold));
  border-radius: 2px;
  width: 0%;
  pointer-events: none;
}
#reading-progress-thumb {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid rgba(10,8,4,0.8);
  box-shadow: 0 0 6px rgba(184,137,62,0.5);
  transform: translate(-50%, -50%);
  left: 0%;
  pointer-events: none;
  will-change: left;
}
#reading-progress:hover #reading-progress-thumb {
  transform: translate(-50%, -50%) scale(1.3);
}
#reading-progress:active #reading-progress-thumb {
  transform: translate(-50%, -50%) scale(1.5);
  box-shadow: 0 0 12px rgba(184,137,62,0.7);
}

/* 页码指示器 */
#page-indicator {
  text-align: center;
  font-family: var(--font-title);
  font-size: 0.6rem;
  color: var(--gold-dim);
  letter-spacing: 0.08em;
  padding: 1px 0 4px;
  flex-shrink: 0;
  z-index: 16;
  user-select: none;
}

/* 底部栏 */
#bottom-bar {
  height: var(--bottombar-h);
  z-index: 15;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 8px 20px 14px;
  background: linear-gradient(to top, rgba(10,8,4,0.9) 0%, rgba(10,8,4,0.4) 100%);
  backdrop-filter: blur(6px);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.bottom-btn {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--gold-dim);
  background: rgba(10,8,4,0.55);
  border: 1px solid rgba(184,137,62,0.2);
  padding: 6px 16px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.06em;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
}
.bottom-btn:hover {
  background: rgba(184,137,62,0.12);
  border-color: rgba(184,137,62,0.45);
  color: #e8d0a0;
}

/* ================================================================
   四、左页叙事区样式
   ================================================================ */
.scene-title {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-title);
  letter-spacing: 0.1em;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(196,149,74,0.2);
  text-align: center;
}

.speaker-label {
  display: inline-block;
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}
.speaker-label.ursula { color: var(--speaker-ursula); }
.speaker-label.jose { color: var(--speaker-jose); }
.speaker-label.melquiades { color: var(--speaker-melquiades); }
.speaker-label.narrator { color: var(--speaker-narrator); }

.narrative-paragraph {
  font-size: var(--narrative-font-size, 1.05rem);
  line-height: 1.9;
  color: var(--text-main);
  text-indent: 2em;
  margin-bottom: 14px;
  text-align: justify;
  letter-spacing: 0.01em;
}

.narrative-quote {
  display: block;
  margin: 8px 0 14px 16px;
  padding: 8px 16px;
  border-left: 2px solid var(--gold);
  font-style: italic;
  color: #3a2518;
  font-size: var(--narrative-quote-font-size, 1rem);
  line-height: 1.8;
  background: rgba(196,149,74,0.08);
}

.transition-text {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px dashed rgba(139,105,20,0.15);
  font-style: italic;
  color: var(--text-transition);
  font-size: 0.95rem;
  line-height: 1.7;
  text-align: center;
}

.memory-hint {
  margin-top: 20px;
  padding: 10px 16px;
  background: rgba(196,149,74,0.1);
  border: 1px solid rgba(184,137,62,0.25);
  border-radius: 6px;
  font-size: 0.8rem;
  color: #5c4a3b;
  text-align: center;
  font-style: italic;
}
.memory-hint::before {
  content: '\2767  ';
}

/* ================================================================
   五、右页交互区样式
   ================================================================ */
.right-section-title {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-title);
  text-align: center;
  margin-bottom: 20px;
  letter-spacing: 0.08em;
}

.choices-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.choice-btn {
  display: block;
  width: 100%;
  padding: 18px 22px;
  background: rgba(250, 243, 232, 0.94);
  border: 1px solid var(--choice-border);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 1.05rem;
  text-align: left;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  letter-spacing: 0.02em;
}
.choice-btn:hover {
  background: var(--choice-hover-bg);
  /* transform removed for literary feel */
  box-shadow: 0 1px 4px rgba(0,0,0,0.10);
  border-color: #a07848;
}
.choice-btn:active {
  background: var(--choice-active-bg);
  transform: translateY(0);
  /* removed */
}
/* 已锁定的选择（回退查看时）：高亮已选 */
.choice-btn.choice-chosen {
  border-color: var(--gold);
  border-width: 2px;
  background: rgba(232, 200, 112, 0.12);
  cursor: default;
}
.choice-btn.choice-chosen:hover {
  background: rgba(232, 200, 112, 0.12);
  transform: none;
  box-shadow: none;
}
/* 已锁定选择页：已选选项可点击前进 */
.choice-btn.choice-chosen-clickable {
  cursor: pointer;
}
.choice-btn.choice-chosen-clickable:hover {
  background: rgba(232, 200, 112, 0.2);
  box-shadow: 0 0 14px rgba(184, 137, 62, 0.2);
  border-color: var(--gold-light);
}
.choice-btn.choice-chosen .choice-label {
  color: var(--gold-light);
}
/* 未选选项（锁定模式下灰显） */
.choice-btn.choice-dimmed {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
  filter: grayscale(0.3);
}
.choice-btn.choice-dimmed:hover {
  background: rgba(250, 243, 232, 0.94);
  transform: none;
  box-shadow: none;
}
/* 两步确认：选中但未确认 */
.choice-btn.choice-selected {
  border-color: var(--gold-light);
  border-width: 2px;
  background: rgba(232, 200, 112, 0.18);
  box-shadow: inset 0 0 0 2px rgba(184,137,62,0.35);
  /* transform removed */
}
.choice-btn.choice-selected:hover {
  background: rgba(232, 200, 112, 0.25);
  /* transform removed for literary feel */
}
.choice-btn.choice-selected .choice-label {
  color: var(--gold-light);
}
.choice-btn .choice-label {
  display: block;
  font-weight: 600;
  font-family: var(--font-title);
  font-size: 1rem;
  color: var(--text-title);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}
.choice-btn .choice-desc {
  display: block;
  font-size: 0.88rem;
  color: #4a3a2a;
  line-height: 1.5;
  font-style: italic;
}

/* 结算面板 */
.settlement-panel {
  background: rgba(250, 243, 232, 0.94);
  border: 1px solid var(--choice-border);
  border-radius: 8px;
  padding: 24px;
}

.settlement-summary {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-main);
  text-align: center;
  margin-bottom: 16px;
  font-style: italic;
}

.settlement-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.88rem;
}
.settlement-table th {
  font-family: var(--font-title);
  font-size: 0.75rem;
  color: var(--text-title);
  padding: 8px 10px;
  border-bottom: 1px solid var(--choice-border);
  letter-spacing: 0.05em;
}
.settlement-table td {
  padding: 8px 10px;
  text-align: center;
  border-bottom: 1px solid rgba(196,149,74,0.12);
  color: var(--text-main);
}

.tag-badge {
  display: inline-block;
  padding: 3px 12px;
  background: rgba(184,137,62,0.15);
  border: 1px solid rgba(184,137,62,0.3);
  border-radius: 2px;
  font-size: 0.75rem;
  color: #3a2018;
  margin: 2px 4px;
}

.profile-tags .tag-badge {
  color: #e0d8d2;
  font-weight: 600;
}

.next-btn {
  display: block;
  width: 80%;
  margin: 20px auto 0;
  padding: 14px 24px;
  background: rgba(184,137,62,0.10);
  border: 1px solid var(--gold);
  border-radius: 3px;
  font-family: var(--font-title);
  font-size: 0.95rem;
  color: #9a7030;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.1em;
  text-align: center;
}
.next-btn:hover {
  background: rgba(184,137,62,0.22);
  /* transform removed for literary feel */
  box-shadow: 0 1px 4px rgba(184,137,62,0.15);
  color: #b8893e;
}

/* 记忆碎片卡片 修复蓝白色冰低对比度问题 */
.memory-card {
  position: relative;
  margin-top: 16px;
  padding: 16px 20px;
  /* 原淡蓝冷渐变加深、弱化透光白雾 */
  background: linear-gradient(135deg, rgba(184,137,0.18), rgba(8,6,4,0.65));
  border: 1px solid var(--gold);
  border-radius: 8px;
  animation: memorySlideIn 0.5s ease;
  box-shadow: 0 0 16px rgba(184,137,62,0.12);
}
@keyframes memorySlideIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.memory-card-title {
  font-family: var(--font-title);
  font-size: 0.85rem;
  color: var(--gold-light);
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  font-weight: 600; /* 加粗提升醒目度 */
}
.memory-card-desc {
  font-size: 0.82rem;
  color: #c8b290; /* 原#d4c0a0加深，解决淡字看不清 */
  line-height: 1.6;
  font-style: italic;
}


/* ================================================================
   六、侧边栏（通用）
   ================================================================ */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0,0,0,0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.sidebar-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.sidebar-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 90vw);
  z-index: 55;
  background: linear-gradient(135deg, #14100c, #0e0b08);
  border-left: 1px solid rgba(184,137,62,0.2);
  box-shadow: -8px 0 30px rgba(0,0,0,0.6);
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
}
.sidebar-panel.open {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(184,137,62,0.2);
}
.sidebar-title {
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: var(--gold-light);
  letter-spacing: 0.08em;
}
.sidebar-close {
  background: none;
  border: 1px solid rgba(184,137,62,0.3);
  color: var(--gold-dim);
  font-size: 1.2rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}
.sidebar-close:hover {
  background: rgba(184,137,62,0.15);
  border-color: var(--gold);
  color: var(--gold-light);
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
}

/* 家族树 */
.family-member {
  padding: 10px 14px;
  margin: 6px 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(184,137,62,0.15);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}
.family-member:hover {
  background: rgba(184,137,62,0.1);
  border-color: rgba(184,137,62,0.35);
}
.family-member.current {
  border-color: var(--gold);
  background: rgba(184,137,62,0.15);
}
.family-member .fm-name {
  font-family: var(--font-title);
  font-size: 0.9rem;
  color: #e8d0a0;
  letter-spacing: 0.04em;
}
.family-member .fm-relation {
  font-size: 0.7rem;
  color: var(--gold-dim);
  margin-top: 2px;
}
.family-tree-connector {
  width: 2px;
  height: 16px;
  background: rgba(184,137,62,0.18);
  margin: 0 auto;
}

/* 历史档案 */
.archive-item {
  padding: 12px 16px;
  margin: 8px 0;
  border-radius: 6px;
  border: 1px solid rgba(184,137,62,0.15);
  background: rgba(255,255,255,0.03);
  transition: all 0.3s ease;
}
.archive-item.unlocked { border-color: rgba(184,137,62,0.35); }
.archive-item.locked {
  opacity: 0.45;
  filter: grayscale(0.4);
}
.archive-item .archive-chapter {
  font-size: 0.65rem;
  color: var(--gold-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.archive-item .archive-title {
  font-family: var(--font-title);
  font-size: 0.9rem;
  color: #e8d0a0;
  margin-top: 2px;
  letter-spacing: 0.04em;
}
.archive-item .archive-desc {
  font-size: 0.8rem;
  color: #c0b090;
  margin-top: 4px;
  line-height: 1.4;
}
.locked .archive-title::after {
  content: '  —';
}

/* 个人简介 */
.profile-section {
  margin-bottom: 20px;
}
.profile-section h4 {
  font-family: var(--font-title);
  font-size: 0.8rem;
  color: var(--gold-light);
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(184,137,62,0.18);
}
.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.profile-choice-log {
  font-size: 0.82rem;
  color: #d0c0a0;
  line-height: 1.8;
}
/* ================================================================
   七、设置面板（模态框）
   ================================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 101;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-panel {
  background: linear-gradient(135deg, #181410, #12100c);
  border: 1px solid rgba(184,137,62,0.25);
  border-radius: 2px;
  padding: 28px 32px;
  width: min(380px, 90vw);
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
}

.modal-title {
  font-family: var(--font-title);
  font-size: 1rem;
  color: #e8d0a0;
  text-align: center;
  margin-bottom: 20px;
  letter-spacing: 0.1em;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(184,137,62,0.1);
}
.setting-label {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: #d4c0a0;
}

.setting-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.font-size-btn {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--gold-dim);
  background: rgba(10,8,4,0.5);
  border: 1px solid rgba(184,137,62,0.25);
  padding: 4px 12px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.font-size-btn.active {
  background: rgba(184,137,62,0.22);
  border-color: var(--gold);
  color: #e8d0a0;
}

input[type="range"] {
  width: 80px;
  accent-color: var(--gold);
}

.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  background: rgba(255,255,255,0.08);
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.3s ease;
}
.toggle-switch.on {
  background: rgba(184,137,62,0.55);
}
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #d4c0a0;
  transition: left 0.3s ease;
}
.toggle-switch.on::after { left: 21px; }

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  justify-content: center;
}
.modal-btn {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  padding: 8px 20px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.05em;
}
.modal-btn-primary {
  background: rgba(184,137,62,0.22);
  border: 1px solid var(--gold);
  color: #e8d0a0;
}
.modal-btn-primary:hover {
  background: rgba(184,137,62,0.38);
}
.modal-btn-danger {
  background: rgba(165,26,26,0.15);
  border: 1px solid rgba(165,26,26,0.45);
  color: #d08080;
}
.modal-btn-danger:hover {
  background: rgba(165,26,26,0.3);
}

/* ================================================================
   八、Toast 提示
   ================================================================ */
#toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 70;
  padding: 10px 24px;
  background: rgba(16,12,8,0.92);
  border: 1px solid rgba(184,137,62,0.35);
  border-radius: 3px;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: #e8d0a0;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s ease;
  backdrop-filter: blur(8px);
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ================================================================
   九、记忆碎片弹窗（右下角滑入/滑出）
   ================================================================ */
#memory-popup {
  position: fixed;
  bottom: 100px;
  right: 0;
  z-index: 75;
  width: min(320px, 80vw);
  padding: 18px 22px;
  background: linear-gradient(135deg, rgba(24,18,10,0.96), rgba(14,10,6,0.96));
  border: 1px solid rgba(184,137,62,0.35);
  border-right: none;
  border-radius: 2px 0 0 10px;
  box-shadow: -6px 4px 30px rgba(0,0,0,0.6);
  transform: translateX(105%);
  transition: transform 0.45s cubic-bezier(0.25, 0.8, 0.25, 1);
  pointer-events: none;
  backdrop-filter: blur(12px);
}
#memory-popup.show {
  transform: translateX(0);
}
#memory-popup-icon {
  font-size: 1.4rem;
  margin-bottom: 6px;
  color: #d4b070;
}
#memory-popup-title {
  font-family: var(--font-title);
  font-size: 0.9rem;
  color: var(--gold-light);
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  font-weight: 600;
}
#memory-popup-desc {
  font-size: 0.78rem;
  color: #c0b090;
  line-height: 1.6;
  font-style: italic;
}

/* ================================================================
   十、存档槽位面板
   ================================================================ */
#saveload-overlay .modal-panel {
  width: min(560px, 94vw);
}

#saveload-current {
  text-align: center;
  font-size: 0.78rem;
  color: var(--gold-dim);
  padding: 8px 16px;
  margin-bottom: 14px;
  background: rgba(184,137,62,0.08);
  border: 1px solid rgba(184,137,62,0.15);
  border-radius: 6px;
}

.save-slots-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 50vh;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 12px;
}
.save-slots-grid::-webkit-scrollbar { width: 4px; }
.save-slots-grid::-webkit-scrollbar-track { background: transparent; }
.save-slots-grid::-webkit-scrollbar-thumb { background: rgba(139,105,20,0.15); border-radius: 6px; }

.save-slot {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(184,137,62,0.18);
  border-radius: 8px;
  transition: all 0.25s ease;
}
.save-slot:hover {
  background: rgba(184,137,62,0.07);
  border-color: rgba(184,137,62,0.38);
}
.save-slot.empty {
  opacity: 0.5;
}
.save-slot.empty:hover {
  opacity: 0.75;
}

.save-slot-number {
  font-family: var(--font-title);
  font-size: 1rem;
  color: var(--gold-light);
  min-width: 72px;
  letter-spacing: 0.08em;
  text-align: center;
  flex-shrink: 0;
}

.save-slot-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.save-slot-chapter {
  font-size: 0.84rem;
  color: #e0d0b0;
  line-height: 1.4;
}
.save-slot-round {
  font-size: 0.72rem;
  color: var(--gold-dim);
}
.save-slot-time {
  font-size: 0.67rem;
  color: var(--gold-dim);
  opacity: 0.65;
}
.save-slot-empty-text {
  font-size: 0.8rem;
  color: var(--gold-dim);
  opacity: 0.5;
  font-style: italic;
}

.save-slot-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.slot-btn {
  font-family: var(--font-ui);
  font-size: 0.66rem;
  padding: 5px 12px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 1px solid rgba(184,137,62,0.22);
  background: rgba(10,8,4,0.45);
  color: var(--gold-dim);
  white-space: nowrap;
  letter-spacing: 0.04em;
}
.slot-btn:hover {
  background: rgba(184,137,62,0.15);
  border-color: rgba(184,137,62,0.45);
  color: #e8d0a0;
}
.slot-btn.load-btn {
  border-color: rgba(184,137,62,0.4);
  color: #d4b070;
}
.slot-btn.load-btn:hover {
  background: rgba(184,137,62,0.2);
  border-color: var(--gold);
  color: var(--gold-light);
}
.slot-btn.save-btn {
  border-color: rgba(140,180,140,0.35);
  color: #b0c8b0;
}
.slot-btn.save-btn:hover {
  background: rgba(140,180,140,0.12);
  border-color: rgba(140,180,140,0.55);
  color: #c8e0c8;
}
.slot-btn.delete-btn {
  border-color: rgba(180,90,90,0.22);
  color: #c8a0a0;
}
.slot-btn.delete-btn:hover {
  background: rgba(180,90,90,0.15);
  border-color: rgba(180,90,90,0.5);
  color: #e0a0a0;
}

/* ================================================================
   十、响应式 — 移动端
   ================================================================ */

/* --- 平板及以下 (≤768px) --- */
@media (max-width: 768px) {
  :root {
    --topbar-h: 42px;
    --bottombar-h: 48px;
    --narrative-font-size: 0.9rem;
    --narrative-quote-font-size: 0.85rem;
  }

  /* 允许 body 使用动态视口，避免 iOS Safari 地址栏挤压 */
  body {
    height: 100dvh;
    height: -webkit-fill-available;
    overflow: hidden;
  }

  /* 书页区域 —— 单栏连续滚屏 */
  #book-area {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
  #spine { display: none; }
  #left-page {
    padding: 18px 15px;
    max-height: none;
    overflow: visible;
    border-bottom: 2px solid rgba(196,149,74,0.12);
  }
  #right-page {
    padding: 18px 15px;
    max-height: none;
    overflow: visible;
  }

  /* 翻页按钮 — 移动端缩小，避免遮挡内容 */
  .book-nav-btn {
    width: 32px;
    height: 52px;
    font-size: 1.1rem;
  }
  #nav-prev { left: 1px; }
  #nav-next { right: 1px; }

  /* 顶部栏 —— 允许换行 */
  #top-bar {
    padding: 4px 8px;
    gap: 5px;
    height: auto;
    min-height: var(--topbar-h);
    flex-wrap: wrap;
    justify-content: center;
  }
  #top-bar .top-item { gap: 5px; }
  .top-btn { font-size: 0.6rem; padding: 4px 10px; letter-spacing: 0.02em; }
  #progress-label { font-size: 0.58rem; white-space: normal; text-align: center; }

  /* 进度条 — 移动端加大触摸区域 */
  #reading-progress { height: 28px; padding: 0 12px; }
  #reading-progress-track { height: 6px; }
  #reading-progress-thumb { width: 18px; height: 18px; }
  #page-indicator { font-size: 0.55rem; }

  /* 底部栏 */
  #bottom-bar {
    gap: 6px;
    padding: 6px 10px 10px;
    height: auto;
    min-height: var(--bottombar-h);
  }
  .bottom-btn { font-size: 0.6rem; padding: 5px 9px; gap: 3px; letter-spacing: 0.03em; }

  /* ---- 左页叙事区 ---- */
  .scene-title { font-size: 0.98rem; margin-bottom: 12px; padding-bottom: 8px; }
  .speaker-label { font-size: 0.88rem; margin-bottom: 4px; }
  .narrative-paragraph { line-height: 1.72; text-indent: 1.5em; margin-bottom: 10px; }
  .narrative-quote { margin-left: 6px; padding: 6px 12px; line-height: 1.65; }
  .transition-text { font-size: 0.82rem; margin-top: 14px; padding-top: 10px; line-height: 1.6; }
  .memory-hint { font-size: 0.7rem; padding: 8px 12px; margin-top: 14px; }

  /* ---- 右页交互区 ---- */
  .right-section-title { font-size: 0.88rem; margin-bottom: 12px; }
  .choices-list { gap: 10px; }
  .choice-btn { padding: 14px 14px; font-size: 0.9rem; }
  .choice-btn .choice-label { font-size: 0.88rem; margin-bottom: 4px; }
  .choice-btn .choice-desc { font-size: 0.78rem; line-height: 1.4; }

  /* 结算面板 */
  .settlement-panel { padding: 15px 14px; }
  .settlement-summary { font-size: 0.82rem; line-height: 1.65; margin-bottom: 10px; }
  .settlement-table { font-size: 0.76rem; }
  .settlement-table th { font-size: 0.65rem; padding: 6px 7px; }
  .settlement-table td { font-size: 0.72rem; padding: 6px 7px; }
  .next-btn { width: 100%; font-size: 0.82rem; padding: 12px 18px; margin-top: 14px; }

  /* ---- 侧边栏 ---- */
  .sidebar-panel { width: 100vw; padding: 16px; }
  .sidebar-title { font-size: 0.95rem; }
  .sidebar-header { margin-bottom: 12px; padding-bottom: 8px; }
  .sidebar-close { width: 28px; height: 28px; font-size: 1rem; }

  /* 家族树 */
  .family-member { padding: 8px 10px; margin: 4px 0; }
  .family-member .fm-name { font-size: 0.8rem; }
  .family-member .fm-relation { font-size: 0.64rem; }
  .family-tree-connector { height: 10px; }

  /* 历史档案 */
  .archive-item { padding: 10px 12px; margin: 6px 0; }
  .archive-item .archive-title { font-size: 0.8rem; }
  .archive-item .archive-desc { font-size: 0.72rem; }
  .archive-item .archive-chapter { font-size: 0.6rem; }

  /* 个人简介 */
  .profile-section { margin-bottom: 14px; }
  .profile-section h4 { font-size: 0.72rem; }
  .profile-choice-log { font-size: 0.74rem; line-height: 1.7; }

  /* ---- 设置面板（模态框） ---- */
  .modal-panel { padding: 18px 16px; width: min(340px, 94vw); border-radius: 2px; }
  .modal-title { font-size: 0.88rem; margin-bottom: 12px; }
  .setting-label { font-size: 0.76rem; }
  .setting-row { padding: 7px 0; }
  .font-size-btn { font-size: 0.62rem; padding: 3px 8px; }
  input[type="range"] { width: 60px; }
  .modal-btn { font-size: 0.72rem; padding: 7px 16px; }

  /* ---- Toast 提示 ---- */
  #toast {
    bottom: 70px;
    font-size: 0.7rem;
    padding: 8px 16px;
    left: 10%;
    right: 10%;
    transform: translateX(0) translateY(20px);
    border-radius: 3px;
    text-align: center;
  }
  #toast.show { transform: translateX(0) translateY(0); }

  /* 记忆碎片弹窗 —— 平板 */
  #memory-popup {
    width: min(280px, 75vw);
    bottom: 90px;
    padding: 14px 16px;
  }
  #memory-popup-title { font-size: 0.8rem; }
  #memory-popup-desc { font-size: 0.7rem; }

  /* ---- 存档/读档面板 ---- */
  #saveload-overlay .modal-panel { width: min(480px, 96vw); }
  #saveload-current { font-size: 0.7rem; padding: 6px 10px; margin-bottom: 10px; }
  .save-slots-grid { max-height: 42vh; gap: 7px; }
  .save-slot { flex-wrap: wrap; gap: 6px; padding: 10px 12px; }
  .save-slot-number { min-width: auto; font-size: 0.8rem; }
  .save-slot-details { width: 100%; }
  .save-slot-actions { width: 100%; justify-content: flex-end; }
  .save-slot-chapter { font-size: 0.76rem; }
  .save-slot-round { font-size: 0.66rem; }
  .save-slot-time { font-size: 0.62rem; }
  .save-slot-empty-text { font-size: 0.72rem; }
  .slot-btn { font-size: 0.58rem; padding: 4px 9px; }

  /* ---- 动态封面 ---- */
  #cover-main-title { font-size: clamp(1.5rem, 7vw, 2.4rem); letter-spacing: 0.1em; }
  #cover-subtitle { font-size: clamp(0.75rem, 3.5vw, 1.1rem); letter-spacing: 0.15em; margin-bottom: 24px; }
  #cover-quote { font-size: 0.76rem; max-width: 88vw; padding: 12px 16px; line-height: 1.6; }
  #cover-hint { font-size: 0.68rem; bottom: 36px; }

  /* ---- 结尾致谢 ---- */
  .credits-title-lg { font-size: 1.15rem; }
  .credits-name { font-size: 0.85rem; }
  .credits-role { font-size: 0.66rem; }
  .credits-quote { font-size: 0.72rem; max-width: 88vw; }
  .credits-divider { margin: 18px auto; }
  #credits-restart { bottom: 28px; padding: 10px 22px; font-size: 0.74rem; }

  /* ---- 主菜单 ---- */
  #mainmenu-overlay { padding: 20px 12px 36px; }
  #mainmenu-content { max-width: 100%; }
  .mm-title { font-size: clamp(1.3rem, 6vw, 1.8rem); letter-spacing: 0.12em; }
  .mm-subtitle { font-size: clamp(0.65rem, 3vw, 0.9rem); letter-spacing: 0.2em; }
  .mm-title-wrap { margin-bottom: 18px; }
  .mm-btn { padding: 12px 14px; gap: 8px; border-radius: 6px; }
  .mm-btn-icon { font-size: 1.15rem; width: 26px; }
  .mm-btn-label { font-size: 0.8rem; }
  .mm-btn-hint { font-size: 0.62rem; }
  .mm-btn:hover { transform: none; }
  .mm-savecard { padding: 12px 14px; margin-bottom: 18px; }
  .mm-savecard-title { font-size: 0.7rem; }
  .mm-options { gap: 6px; margin-bottom: 14px; }
  .mm-footer { font-size: 0.64rem; }

  /* ---- 成就 & 书签 ---- */
  .achievement-card { padding: 10px 12px; gap: 8px; }
  .ach-icon { font-size: 1.3rem; width: 34px; }
  .ach-name { font-size: 0.76rem; }
  .ach-desc { font-size: 0.68rem; }
  .ach-status { font-size: 0.62rem; }
  .bookmark-card { padding: 10px 12px; gap: 8px; }
  .bookmark-title { font-size: 0.76rem; }
  .bookmark-desc { font-size: 0.66rem; }
  .bookmark-chapter { font-size: 0.6rem; }

  /* ---- 记忆碎片卡片 ---- */
  .memory-card { padding: 12px 14px; margin-top: 10px; }
  .memory-card-title { font-size: 0.76rem; }
  .memory-card-desc { font-size: 0.72rem; }

  /* ---- 标签 ---- */
  .tag-badge { font-size: 0.68rem; padding: 2px 9px; }
}

/* --- 小屏手机 (≤480px) --- */
@media (max-width: 480px) {
  :root {
    --topbar-h: 36px;
    --bottombar-h: 44px;
    --narrative-font-size: 0.82rem;
    --narrative-quote-font-size: 0.78rem;
  }

  #left-page { padding: 14px 10px; }
  #right-page { padding: 14px 10px; }

  #top-bar { padding: 3px 4px; gap: 3px; }
  #top-bar .top-item { gap: 3px; }
  .top-btn { font-size: 0.52rem; padding: 3px 7px; }
  #progress-label { font-size: 0.5rem; }

  #reading-progress { height: 32px; padding: 0 14px; }
  #reading-progress-track { height: 8px; }
  #reading-progress-thumb { width: 22px; height: 22px; }

  #bottom-bar { gap: 4px; padding: 5px 6px 8px; }
  .bottom-btn { font-size: 0.54rem; padding: 4px 7px; }

  /* 确保触摸目标足够大 (WCAG 2.5.5 推荐 ≥44px) */
  .choice-btn, .bottom-btn, .top-btn, .next-btn,
  .modal-btn, .mm-btn, .slot-btn, .sidebar-close {
    min-height: 40px;
  }

  /* 叙事区 */
  .scene-title { font-size: 0.88rem; margin-bottom: 10px; padding-bottom: 6px; }
  .speaker-label { font-size: 0.8rem; }
  .narrative-paragraph { line-height: 1.6; text-indent: 1.2em; margin-bottom: 8px; }
  .narrative-quote { padding: 5px 10px; line-height: 1.55; }
  .transition-text { font-size: 0.76rem; }
  .memory-hint { font-size: 0.65rem; }

  /* 交互区 */
  .right-section-title { font-size: 0.8rem; }
  .choice-btn { padding: 12px 10px; }
  .choice-btn .choice-label { font-size: 0.8rem; }
  .choice-btn .choice-desc { font-size: 0.72rem; }

  /* 结算 */
  .settlement-panel { padding: 12px 10px; }
  .settlement-summary { font-size: 0.76rem; }
  .settlement-table { font-size: 0.68rem; }
  .settlement-table th { font-size: 0.58rem; padding: 4px 5px; }
  .settlement-table td { font-size: 0.64rem; padding: 4px 5px; }
  .next-btn { font-size: 0.76rem; padding: 10px 16px; }

  /* 侧边栏 */
  .sidebar-panel { padding: 12px; }
  .sidebar-title { font-size: 0.85rem; }
  .family-member { padding: 6px 8px; }
  .family-member .fm-name { font-size: 0.74rem; }
  .archive-item { padding: 8px 10px; }
  .archive-item .archive-title { font-size: 0.74rem; }
  .profile-section h4 { font-size: 0.66rem; }
  .profile-choice-log { font-size: 0.68rem; }

  /* 模态框 */
  .modal-panel { padding: 14px 10px; width: 96vw; border-radius: 8px; }
  .modal-title { font-size: 0.8rem; }
  .setting-label { font-size: 0.7rem; }
  .font-size-btn { font-size: 0.56rem; padding: 2px 7px; }
  input[type="range"] { width: 50px; }
  .modal-btn { font-size: 0.66rem; padding: 6px 14px; }

  /* Toast */
  #toast {
    bottom: 60px;
    font-size: 0.64rem;
    padding: 7px 14px;
    left: 4%;
    right: 4%;
  }

  /* 记忆碎片弹窗 —— 小屏 */
  #memory-popup {
    width: min(250px, 70vw);
    bottom: 80px;
    padding: 12px 14px;
  }
  #memory-popup-title { font-size: 0.74rem; }
  #memory-popup-desc { font-size: 0.64rem; }

  /* 存档面板 */
  #saveload-overlay .modal-panel { width: 98vw; }
  .save-slots-grid { max-height: 36vh; gap: 5px; }
  .save-slot { padding: 8px 10px; gap: 4px; }
  .save-slot-number { font-size: 0.7rem; }
  .save-slot-chapter { font-size: 0.7rem; }
  .save-slot-round { font-size: 0.6rem; }
  .save-slot-time { font-size: 0.56rem; }
  .slot-btn { font-size: 0.52rem; padding: 3px 7px; }

  /* 封面 */
  #cover-main-title { font-size: clamp(1.2rem, 8vw, 1.8rem); letter-spacing: 0.06em; }
  #cover-subtitle { font-size: clamp(0.65rem, 4vw, 0.9rem); letter-spacing: 0.1em; margin-bottom: 18px; }
  #cover-quote { font-size: 0.68rem; padding: 10px 12px; line-height: 1.5; }
  #cover-hint { font-size: 0.6rem; bottom: 26px; }

  /* 致谢 */
  .credits-title-lg { font-size: 1rem; }
  .credits-name { font-size: 0.76rem; }
  .credits-role { font-size: 0.6rem; }
  .credits-quote { font-size: 0.66rem; }
  #credits-restart { bottom: 20px; padding: 8px 18px; font-size: 0.66rem; }

  /* 主菜单 */
  #mainmenu-overlay { padding: 14px 8px 24px; }
  .mm-title { font-size: clamp(1.1rem, 7vw, 1.4rem); letter-spacing: 0.08em; }
  .mm-subtitle { font-size: clamp(0.58rem, 3.5vw, 0.78rem); }
  .mm-btn { padding: 10px 12px; gap: 6px; }
  .mm-btn-icon { font-size: 1rem; width: 22px; }
  .mm-btn-label { font-size: 0.72rem; }
  .mm-btn-hint { font-size: 0.56rem; }
  .mm-savecard { padding: 10px 12px; }
  .mm-savecard-title { font-size: 0.64rem; }

  /* 记忆碎片 */
  .memory-card { padding: 10px 10px; }
  .memory-card-title { font-size: 0.7rem; }
  .memory-card-desc { font-size: 0.66rem; }

  /* 成就 & 书签 */
  .achievement-card { padding: 8px 10px; gap: 6px; }
  .ach-icon { font-size: 1.1rem; width: 28px; }
  .ach-name { font-size: 0.7rem; }
  .ach-desc { font-size: 0.62rem; }
  .bookmark-card { padding: 8px 10px; gap: 6px; }
  .bookmark-title { font-size: 0.7rem; }
  .bookmark-desc { font-size: 0.6rem; }

  /* 标签 */
  .tag-badge { font-size: 0.62rem; padding: 2px 7px; }
}



/* ================================================================
   十一、开头动态封面
   ================================================================ */
#cover-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: radial-gradient(ellipse at center, #1a1410 0%, #080604 70%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
  cursor: pointer;
  overflow: hidden;
}
#cover-overlay.hidden {
  opacity: 0; visibility: hidden; pointer-events: none;
}

/* 漂浮尘埃粒子 */
.cover-particle {
  position: absolute;
  width: 2px; height: 2px;
  background: var(--gold-dim);
  border-radius: 50%;
  animation: particleFloat linear infinite;
  opacity: 0;
}
@keyframes particleFloat {
  0%   { transform: translateY(100vh) scale(0); opacity: 0; }
  10%  { opacity: 0.8; }
  90%  { opacity: 0.3; }
  100% { transform: translateY(-10vh) scale(1.5); opacity: 0; }
}

/* 主标题容器 */
#cover-title-wrap {
  position: relative; z-index: 2;
  text-align: center;
  opacity: 0;
  animation: coverFadeIn 1.2s ease forwards;
  animation-delay: 0.5s;
}
@keyframes coverFadeIn {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

#cover-main-title {
  font-family: var(--font-title);
  font-size: clamp(2.2rem, 5vw, 4rem);
  color: var(--gold-light);
  letter-spacing: 0.15em;
  text-shadow: 0 0 40px rgba(232,200,112,0.3);
  margin-bottom: 8px;
}
#cover-main-title .char {
  display: inline-block;
  opacity: 0;
  animation: charAppear 0.6s ease forwards;
}
@keyframes charAppear {
  from { opacity: 0; transform: translateY(-20px); filter: blur(4px); }
  to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}

#cover-subtitle {
  font-family: var(--font-title);
  font-size: clamp(1rem, 2.5vw, 1.6rem);
  color: var(--gold-dim);
  letter-spacing: 0.25em;
  margin-bottom: 40px;
  opacity: 0;
  animation: coverFadeIn 1s ease forwards;
  animation-delay: 2s;
}

#cover-quote {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: #8a7a60;
  font-style: italic;
  line-height: 1.8;
  max-width: 500px;
  padding: 20px 30px;
  border-left: 1px solid rgba(184,137,62,0.2);
  border-right: 1px solid rgba(184,137,62,0.2);
  opacity: 0;
  animation: coverFadeIn 1s ease forwards;
  animation-delay: 2.8s;
}

#cover-hint {
  position: absolute; bottom: 60px; z-index: 2;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--gold-dim);
  letter-spacing: 0.1em;
  opacity: 0;
  animation: hintPulse 2s ease-in-out infinite;
  animation-delay: 3.5s;
}
@keyframes hintPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* ================================================================
   十二、结尾致谢名单
   ================================================================ */
#credits-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: #080604;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 1s ease;
  overflow: hidden;
}
#credits-overlay.show {
  opacity: 1; visibility: visible; pointer-events: all;
}

#credits-scroll {
  text-align: center;
  animation: creditsRoll 25s linear forwards;
}
@keyframes creditsRoll {
  0%   { transform: translateY(75vh); }
  100% { transform: translateY(-120%); }
}

.credits-section {
  margin: 36px 0;
}
.credits-role {
  font-family: var(--font-title);
  font-size: 0.75rem;
  color: var(--gold-dim);
  letter-spacing: 0.15em;
  margin-bottom: 6px;
}
.credits-name {
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: var(--gold-light);
  letter-spacing: 0.1em;
}
.credits-divider {
  width: 60px; height: 1px;
  background: rgba(184,137,62,0.25);
  margin: 28px auto;
}
.credits-quote {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: #8a7a60;
  font-style: italic;
  line-height: 1.8;
  max-width: 480px;
  margin: 20px auto;
}
.credits-title-lg {
  font-family: var(--font-title);
  font-size: 1.6rem;
  color: var(--gold-light);
  letter-spacing: 0.2em;
  margin-bottom: 6px;
}
.credits-subtitle-sm {
  font-family: var(--font-title);
  font-size: 0.8rem;
  color: var(--gold-dim);
  letter-spacing: 0.15em;
}

#credits-restart {
  position: absolute; bottom: 50px; z-index: 5;
  opacity: 0;
  animation: coverFadeIn 1s ease forwards;
  animation-delay: 26s;
  font-family: var(--font-title);
  font-size: 0.9rem;
  color: var(--gold-light);
  background: rgba(184,137,62,0.12);
  border: 1px solid rgba(184,137,62,0.35);
  padding: 12px 32px;
  border-radius: 3px;
  cursor: pointer;
  letter-spacing: 0.1em;
  transition: all 0.3s ease;
}
#credits-restart:hover {
  background: rgba(184,137,62,0.28);
  border-color: var(--gold);
}

/* ================================================================
   十三、主菜单（全屏宿命感）
   ================================================================ */
#mainmenu-overlay {
  position: fixed; inset: 0; z-index: 99;
  background: radial-gradient(ellipse at 50% 30%, #1e1810 0%, #080604 70%);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.6s ease, visibility 0.6s ease;
  overflow-y: auto; overflow-x: hidden;
  padding: 40px 20px 60px;
}
#mainmenu-overlay.open {
  opacity: 1; visibility: visible; pointer-events: all;
}

#mainmenu-particles {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}

#mainmenu-content {
  position: relative; z-index: 2;
  max-width: 460px; width: 100%;
  display: flex; flex-direction: column; align-items: center;
  animation: mmFadeUp 0.8s ease forwards;
}
@keyframes mmFadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.mm-title-wrap { text-align: center; margin-bottom: 32px; }
.mm-title {
  font-family: var(--font-title);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--gold-light);
  letter-spacing: 0.18em;
  text-shadow: 0 0 36px rgba(232,200,112,0.25);
}
.mm-subtitle {
  font-family: var(--font-title);
  font-size: clamp(0.85rem, 2vw, 1.2rem);
  color: var(--gold-dim);
  letter-spacing: 0.3em;
  margin-top: 6px;
}

/* 大存档卡片 */
.mm-savecard {
  width: 100%; margin-bottom: 28px;
  padding: 18px 22px;
  background: rgba(255,250,240,0.04);
  border: 1px solid rgba(184,137,62,0.18);
  border-radius: 2px;
  text-align: center;
}
.mm-savecard-title {
  font-family: var(--font-title);
  font-size: 0.8rem; color: var(--gold-light);
  letter-spacing: 0.1em; margin-bottom: 8px;
}

/* 菜单按钮 */
.mm-options { width: 100%; display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.mm-btn {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 14px 20px;
  font-family: var(--font-title);
  color: #c8b898; letter-spacing: 0.06em;
  background: rgba(184,137,62,0.05);
  border: 1px solid rgba(184,137,62,0.14);
  border-radius: 8px; cursor: pointer;
  transition: all 0.35s ease; text-align: left;
}
.mm-btn:hover {
  background: rgba(184,137,62,0.15);
  border-color: rgba(184,137,62,0.4);
  color: #e8d0a0;
  /* transform removed */
}
.mm-btn-primary {
  border-color: rgba(184,137,62,0.3);
  background: rgba(184,137,62,0.1);
}
.mm-btn-icon { font-size: 1.4rem; flex-shrink: 0; width: 32px; text-align: center; }
.mm-btn-label { font-size: 0.9rem; flex: 1; }
.mm-btn-hint {
  font-family: var(--font-body);
  font-size: 0.7rem; color: var(--gold-dim); font-style: italic;
  opacity: 0.7; letter-spacing: 0.03em;
}
.mm-btn-exit { border-color: rgba(160,120,100,0.15); color: #b09888; }
.mm-btn-exit:hover { background: rgba(160,100,80,0.12); border-color: rgba(160,100,80,0.4); color: #c8a898; }
.mm-btn:disabled { opacity: 0.35; pointer-events: none; filter: grayscale(0.4); }

.mm-footer {
  font-family: var(--font-body);
  font-size: 0.72rem; color: #6a5a48; font-style: italic;
  text-align: center; letter-spacing: 0.04em; margin-top: 8px;
}

/* 成就书签卡片 */
.achievement-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(184,137,62,0.15);
  border-radius: 8px;
  transition: all 0.3s ease;
}
.achievement-card.unlocked {
  border-color: rgba(184,137,62,0.4);
  background: rgba(184,137,62,0.06);
}
.achievement-card.unlocked .ach-icon { color: #d4b070; }
.achievement-card.locked {
  opacity: 0.45; filter: grayscale(0.5);
}
.achievement-card.locked .ach-icon { color: #605040; }
.ach-icon {
  font-size: 1.8rem; flex-shrink: 0; width: 44px; text-align: center;
}
.ach-info { flex:1; min-width:0; }
.ach-name {
  font-family: var(--font-title); font-size: 0.85rem;
  color: #e8d0a0; letter-spacing: 0.04em; margin-bottom: 2px;
}
.ach-desc {
  font-size: 0.75rem; color: #c0b090; line-height: 1.5; font-style: italic;
}
.ach-status {
  font-size: 0.68rem; margin-top: 2px;
}
.ach-status.unlocked { color: var(--gold-light); }
.ach-status.locked { color: var(--gold-dim); }

/* 书签记忆卡 */
.bookmark-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(184,137,62,0.12);
  border-radius: 6px;
}
.bookmark-card.unlocked { border-color: rgba(184,137,62,0.35); }
.bookmark-card.unlocked .bookmark-icon { color: #d4b070; }
.bookmark-card.locked { opacity: 0.4; filter: grayscale(0.4); }
.bookmark-card.locked .bookmark-icon { color: #605040; }
.bookmark-icon { font-size: 1.3rem; flex-shrink: 0; }
.bookmark-info { flex:1; }
.bookmark-chapter { font-size: 0.65rem; color: var(--gold-dim); letter-spacing:0.08em; }
.bookmark-title { font-family: var(--font-title); font-size:0.82rem; color:#e8d0a0; }
.bookmark-desc { font-size:0.72rem; color:#c0b090; line-height:1.4; margin-top:2px; }

/* ================================================================
   十四、角色情绪状态 (mood-label)
   ================================================================ */
.mood-label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.62rem;
  color: var(--gold-dim);
  font-style: italic;
  letter-spacing: 0.04em;
  opacity: 0.75;
  max-width: 200px;
  text-align: center;
  line-height: 1.3;
  transition: opacity 0.4s ease;
}
.mood-label:empty { display: none; }

/* ================================================================
   十五、边缘文字 (Marginalia)
   ================================================================ */
.marginalia {
  position: absolute;
  font-family: var(--font-body);
  font-size: 0.68rem;
  line-height: 1.5;
  max-width: 160px;
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
  transition: opacity 0.5s ease;
}
.marginalia-whisper {
  color: #8a8a7a;
  font-style: italic;
  right: -175px;
  bottom: 40px;
  border-left: 1px solid rgba(138,138,122,0.25);
  padding-left: 10px;
}
.marginalia-warning {
  color: #a04030;
  right: -175px;
  top: 60px;
  border-left: 1px solid rgba(160,64,48,0.25);
  padding-left: 10px;
}
.marginalia-echo {
  color: #b88a3e;
  right: -175px;
  bottom: 100px;
  border-left: 1px solid rgba(184,138,62,0.25);
  padding-left: 10px;
  font-family: var(--font-title);
  font-size: 0.62rem;
}

/* ================================================================
   十六、羊皮卷的另一页 (alternative-narrative)
   ================================================================ */
.alt-narrative-panel {
  margin-top: 20px;
  padding: 16px 18px;
  background: rgba(184,137,62,0.06);
  border: 1px solid rgba(184,137,62,0.2);
  border-radius: 8px;
}
.alt-narrative-title {
  font-family: var(--font-title);
  font-size: 0.78rem;
  color: var(--gold-light);
  letter-spacing: 0.06em;
  margin-bottom: 10px;
  text-align: center;
}
.alt-narrative-item {
  font-size: 0.8rem;
  color: #6a5a48;
  line-height: 1.7;
  font-style: italic;
  padding: 6px 0;
  border-bottom: 1px dotted rgba(184,137,62,0.12);
}
.alt-narrative-item:last-child {
  border-bottom: none;
}

/* ================================================================
   十七、情感结算 (emotional-cost)
   ================================================================ */
.emotional-cost-panel {
  margin-top: 20px;
  padding: 20px 24px;
  background: rgba(8,6,4,0.85);
  border: 1px solid rgba(184,137,62,0.25);
  border-radius: 8px;
  text-align: center;
  animation: emotionalFadeIn 0.8s ease;
}
@keyframes emotionalFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.emotional-cost-text {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: #c8b898;
  line-height: 2;
  font-style: italic;
  letter-spacing: 0.03em;
}

/* v2.3: 结局回廊卡片 */
.ending-gallery-card {
  padding: 18px 22px;
  border-radius: 6px;
  transition: all 0.3s ease;
}
.ending-gallery-card.ending-card-unlocked {
  background: rgba(30,22,12,0.8);
  border: 1px solid rgba(184,137,62,0.4);
}
.ending-gallery-card.ending-card-locked {
  background: rgba(15,12,8,0.6);
  border: 1px solid rgba(100,80,50,0.15);
  opacity: 0.65;
}
.ending-gallery-status {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.ending-card-unlocked .ending-gallery-status { color: var(--gold-light); }
.ending-card-locked .ending-gallery-status { color: #706050; }
.ending-gallery-title {
  font-family: var(--font-title);
  font-size: 1rem;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.ending-card-unlocked .ending-gallery-title { color: #e8d0a0; }
.ending-card-locked .ending-gallery-title { color: #807060; }
.ending-gallery-desc {
  font-size: 0.78rem;
  line-height: 1.6;
  font-style: italic;
}
.ending-card-unlocked .ending-gallery-desc { color: #b0a080; }
.ending-card-locked .ending-gallery-desc { color: #706050; }
.ending-gallery-hint {
  margin-top: 8px;
  font-size: 0.68rem;
  color: #605040;
  font-style: italic;
  letter-spacing: 0.04em;
}

/* v2.3: 象限叙事 — 结算页按当前象限展示个性化文本 */
.quadrant-narrative {
  margin-top: 18px;
  padding: 18px 22px;
  background: rgba(20,16,10,0.75);
  border-left: 3px solid var(--gold);
  border-radius: 0 6px 6px 0;
  animation: emotionalFadeIn 0.8s ease;
}
.quadrant-narrative-label {
  font-family: var(--font-title);
  font-size: 0.72rem;
  color: var(--gold);
  letter-spacing: 0.12em;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.quadrant-narrative-text {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: #c0b090;
  line-height: 1.8;
  font-style: italic;
  letter-spacing: 0.03em;
}

/* ================================================================
   十八、关系值变化 (relationship-effects)
   ================================================================ */
.rel-changes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}
.rel-change-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 2px;
  letter-spacing: 0.03em;
}
.rel-change-positive {
  color: #6a9a5a;
  background: rgba(106,154,90,0.1);
  border: 1px solid rgba(106,154,90,0.25);
}
.rel-change-negative {
  color: #a05040;
  background: rgba(160,80,64,0.1);
  border: 1px solid rgba(160,80,64,0.25);
}

/* 关系值进度条 (侧边栏个人简介) */
.relationship-item {
  margin: 8px 0;
}
.relationship-item .rel-name {
  font-size: 0.78rem;
  color: #d0c0a0;
  margin-bottom: 2px;
}
.relationship-item .rel-bar-wrap {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 2px;
}
.relationship-item .rel-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease, background 0.5s ease;
}
.relationship-item .rel-label {
  font-size: 0.65rem;
  color: var(--gold-dim);
  text-align: right;
}

/* ================================================================
   十九、条件解锁选项 (secret-option)
   ================================================================ */
.choice-btn.secret-option {
  border-color: rgba(184,137,62,0.45);
  border-style: dashed;
  background: linear-gradient(135deg, rgba(250,243,232,0.94), rgba(184,137,62,0.08));
}
/* 隐藏选项灰位提示 */
.choice-btn.choice-locked-hint {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
  border-style: dashed;
  border-color: rgba(160,120,70,0.35);
  background: rgba(240,230,215,0.5);
  filter: grayscale(0.15);
}
.choice-btn.choice-locked-hint:hover {
  background: rgba(240,230,215,0.5);
  transform: none;
  box-shadow: none;
}
.choice-btn.choice-locked-hint .choice-label {
  color: #8a7a60;
  font-style: italic;
  letter-spacing: 0.12em;
}
.choice-btn.choice-locked-hint .choice-desc {
  color: #9a8a70;
  font-style: italic;
}

/* ── v2.4: 门控选项条件展示 ── */

/* 已解锁的门控选项 — 细金边 + 小图标 */
.choice-btn.choice-gated-unlocked {
  border-color: rgba(184,137,62,0.5);
  border-style: solid;
  background: linear-gradient(135deg, rgba(252,248,238,0.96), rgba(184,137,62,0.06));
}
.choice-btn.choice-gated-unlocked::before {
  content: '🔓';
  position: absolute;
  top: -6px;
  right: 10px;
  font-size: 0.6rem;
  opacity: 0.7;
}
/* 已锁定但可见的门控选项 — 虚线灰框 + 条件说明 */
.choice-btn.choice-gated-locked {
  border-style: dashed;
  border-color: rgba(140,110,60,0.35);
  background: rgba(235,225,210,0.45);
  opacity: 0.7;
  cursor: default;
  pointer-events: none;
  filter: grayscale(0.12);
}
.choice-btn.choice-gated-locked:hover {
  background: rgba(235,225,210,0.45);
  transform: none;
  box-shadow: none;
}
.choice-btn.choice-gated-locked .choice-label {
  color: #7a6a55;
}
.choice-btn.choice-gated-locked .choice-desc {
  color: #8a7a65;
}

/* 门控条件标签 */
.choice-gate-conditions {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dotted rgba(160,130,90,0.25);
}
.choice-gate-condition {
  display: block;
  font-size: 0.68rem;
  line-height: 1.6;
}
.choice-gate-condition.met {
  color: #6a8a5a;
}
.choice-gate-condition.unmet {
  color: #a06040;
  font-weight: 500;
}

.choice-btn.secret-option::before {
  content: '◆ 线索解锁';
  position: absolute;
  top: -10px;
  right: 14px;
  font-family: var(--font-ui);
  font-size: 0.6rem;
  color: var(--gold);
  background: var(--page-bg-strong);
  padding: 2px 10px;
  border-radius: 2px;
  border: 1px solid rgba(184,137,62,0.3);
  letter-spacing: 0.04em;
}
.choice-btn .choice-cost {
  display: block;
  font-size: 0.75rem;
  color: #8a5040;
  margin-top: 4px;
  font-style: normal;
  opacity: 0.8;
}
.choice-btn .choice-gain {
  display: block;
  font-size: 0.75rem;
  color: #5a7a4a;
  margin-top: 2px;
  font-style: normal;
  opacity: 0.8;
}

/* ================================================================
   二十、探索场景 (exploration)
   ================================================================ */
.exploration-area {
  position: relative;
  width: 100%;
  min-height: 320px;
  background: rgba(20,16,10,0.75);
  border: 1px solid rgba(184,137,62,0.2);
  border-radius: 8px;
  overflow: hidden;
  cursor: default;
}
.exploration-bg-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: rgba(184,137,62,0.25);
  font-style: italic;
  pointer-events: none;
  letter-spacing: 0.06em;
}
.hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 2;
}
.hotspot-marker {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid rgba(184,137,62,0.4);
  background: rgba(184,137,62,0.08);
  transition: all 0.4s ease;
  position: relative;
}
.hotspot-marker::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(184,137,62,0.5);
  transition: all 0.4s ease;
}
.hotspot:hover .hotspot-marker {
  border-color: var(--gold);
  background: rgba(184,137,62,0.2);
  box-shadow: 0 0 16px rgba(184,137,62,0.25);
  transform: scale(1.15);
}
.hotspot:hover .hotspot-marker::after {
  background: var(--gold-light);
  box-shadow: 0 0 8px rgba(232,200,112,0.5);
}
.hotspot.discovered .hotspot-marker {
  border-color: rgba(184,137,62,0.2);
  background: rgba(184,137,62,0.04);
  opacity: 0.5;
}
.hotspot-label {
  position: absolute;
  top: 38px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-ui);
  font-size: 0.6rem;
  color: var(--gold-dim);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  letter-spacing: 0.04em;
}
.hotspot:hover .hotspot-label { opacity: 1; }
.hotspot-narrative-popup {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 60;
  max-width: 420px;
  width: 90vw;
  padding: 24px 28px;
  background: linear-gradient(135deg, #1a1610, #14100c);
  border: 1px solid rgba(184,137,62,0.35);
  border-radius: 2px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.7);
  animation: popupFadeIn 0.35s ease;
}
@keyframes popupFadeIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.92); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.hotspot-narrative-text {
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: #d4c0a0;
  line-height: 1.9;
  font-style: italic;
  margin-bottom: 16px;
  text-align: center;
}
.hotspot-narrative-close {
  display: block;
  margin: 0 auto;
  padding: 8px 24px;
  background: rgba(184,137,62,0.15);
  border: 1px solid rgba(184,137,62,0.3);
  border-radius: 3px;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--gold-light);
  cursor: pointer;
  letter-spacing: 0.06em;
  transition: all 0.3s ease;
}
.hotspot-narrative-close:hover {
  background: rgba(184,137,62,0.28);
  border-color: var(--gold);
}
.exploration-progress {
  text-align: center;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--gold-dim);
  margin-top: 14px;
  letter-spacing: 0.06em;
}
.exploration-continue-btn {
  display: block;
  width: 70%;
  margin: 16px auto 0;
  padding: 12px 20px;
  background: rgba(184,137,62,0.10);
  border: 1px solid var(--gold);
  border-radius: 3px;
  font-family: var(--font-title);
  font-size: 0.88rem;
  color: #9a7030;
  cursor: pointer;
  letter-spacing: 0.08em;
  transition: all 0.3s ease;
}
.exploration-continue-btn:hover {
  background: rgba(184,137,62,0.22);
  color: #b8893e;
}
.exploration-continue-btn:disabled {
  opacity: 0.3;
  pointer-events: none;
}

/* ---- 移动端：边缘文字隐藏 ---- */
@media (max-width: 768px) {
  .marginalia { display: none; }
  .hotspot-marker { width: 26px; height: 26px; }
  .hotspot-marker::after { width: 6px; height: 6px; }
  .hotspot-label { font-size: 0.52rem; top: 32px; }
  .emotional-cost-panel { padding: 14px 16px; }
  .emotional-cost-text { font-size: 0.78rem; line-height: 1.8; }
  .alt-narrative-panel { padding: 12px 14px; }
  .alt-narrative-title { font-size: 0.7rem; }
  .alt-narrative-item { font-size: 0.72rem; }
  .exploration-area { min-height: 240px; }
  .exploration-continue-btn { width: 90%; font-size: 0.78rem; }
}

@media (max-width: 480px) {
  .hotspot-marker { width: 22px; height: 22px; }
  .hotspot-marker::after { width: 5px; height: 5px; }
  .hotspot-narrative-popup { padding: 16px 18px; }
  .hotspot-narrative-text { font-size: 0.8rem; line-height: 1.7; }
  .exploration-area { min-height: 200px; }
  .rel-changes { gap: 4px; }
  .rel-change-item { font-size: 0.68rem; padding: 2px 7px; }
}

/* ================================================================
   v2.0 双轴 × 三层宿命 样式
   ================================================================ */

/* ---- 顶栏双轴显示 ---- */
.axis-display {
  font-family: var(--font-title);
  font-size: 0.7rem;
  color: var(--gold-dim);
  letter-spacing: 0.06em;
  padding: 3px 10px;
  background: rgba(10,8,4,0.55);
  border: 1px solid rgba(184,137,62,0.2);
  border-radius: 2px;
  white-space: nowrap;
  transition: all 0.3s ease;
}

/* ---- 隐藏线索文字 ---- */
.clue-text {
  color: #8a6040;
  cursor: pointer;
  border-bottom: 1px dashed rgba(138,96,64,0.4);
  transition: all 0.25s ease;
  padding: 0 1px;
}
.clue-text:hover {
  color: #b8893e;
  border-bottom-color: #b8893e;
  background: rgba(184,137,62,0.08);
}
.clue-text.discovered {
  color: #8a7060;
  cursor: default;
  border-bottom: none;
  opacity: 0.6;
  pointer-events: none;
}

/* ---- 线索弹窗 ---- */
.clue-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
  background: linear-gradient(135deg, rgba(20,15,8,0.97), rgba(30,22,12,0.97));
  border: 1px solid var(--gold);
  border-radius: 2px;
  padding: 24px 28px;
  min-width: 300px;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 0 40px rgba(184,137,62,0.25), 0 8px 32px rgba(0,0,0,0.5);
  animation: cluePopupIn 0.4s ease;
}
.clue-popup.closing {
  animation: cluePopupOut 0.35s ease forwards;
}
@keyframes cluePopupIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.85); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes cluePopupOut {
  from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  to   { opacity: 0; transform: translate(-50%, -50%) scale(0.85); }
}
.clue-popup-icon {
  font-size: 1.8rem;
  margin-bottom: 8px;
}
.clue-popup-title {
  font-family: var(--font-title);
  font-size: 1rem;
  color: var(--gold-light);
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.clue-popup-desc {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: #c0b090;
  line-height: 1.7;
  font-style: italic;
  margin-bottom: 12px;
}
.clue-popup-hint {
  font-size: 0.65rem;
  color: var(--gold-dim);
  margin-bottom: 16px;
  letter-spacing: 0.04em;
}
.clue-popup-close {
  padding: 8px 22px;
  background: rgba(184,137,62,0.15);
  border: 1px solid rgba(184,137,62,0.3);
  border-radius: 3px;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--gold-light);
  cursor: pointer;
  letter-spacing: 0.06em;
  transition: all 0.3s ease;
}
.clue-popup-close:hover {
  background: rgba(184,137,62,0.28);
  border-color: var(--gold);
}

/* ---- 回声文本 ---- */
.echo-text {
  margin-top: 20px;
  padding: 12px 18px;
  border-left: 3px solid rgba(184,137,62,0.35);
  font-style: italic;
  color: #5c4a3b;
  font-size: 0.9rem;
  line-height: 1.8;
  background: rgba(184,137,62,0.05);
  font-family: var(--font-body);
}
.echo-text::before {
  content: '\2020  ';
  font-style: normal;
  font-size: 0.75rem;
}

/* ---- 象限展示 ---- */
.quadrant-display {
  text-align: center;
  padding: 12px 16px;
  margin-bottom: 12px;
  background: rgba(184,137,62,0.06);
  border: 1px solid rgba(184,137,62,0.15);
  border-radius: 8px;
}
.quadrant-header {
  font-size: 0.65rem;
  color: var(--gold-dim);
  letter-spacing: 0.08em;
  margin-bottom: 4px;
  font-family: var(--font-title);
}
.quadrant-label {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}
.quadrant-desc {
  font-size: 0.78rem;
  color: #8a7a6a;
  font-style: italic;
  line-height: 1.6;
}

/* ---- 烙印标签 ---- */
.imprint-tags {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.imprint-tag {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 2px;
  font-size: 0.7rem;
  font-family: var(--font-ui);
  letter-spacing: 0.04em;
}
.fate-tag {
  color: #e8d0a0;
  background: rgba(184,137,62,0.15);
  border: 1px solid rgba(184,137,62,0.3);
}
.fate-tag.fate-witness { border-color: var(--gold-light); color: var(--gold-light); }
.fate-tag.fate-follower { border-color: var(--gold); color: #d4b070; }
.fate-tag.fate-rebel { border-color: #a05040; color: #c06050; }
.bond-tag {
  color: #c0b8c8;
  background: rgba(120,110,140,0.12);
  border: 1px solid rgba(120,110,140,0.25);
}
.bond-tag.bond-soul_of_family { border-color: #c0a0d0; color: #d0b8e0; }
.bond-tag.bond-bonded { border-color: #9080a0; color: #b0a0c0; }
.bond-tag.bond-estranged { border-color: #706070; color: #908090; }

/* ---- 烙印色块行（侧边栏用） ---- */
.imprint-track {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
  margin: 4px 0;
}
.imprint-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  transition: all 0.2s ease;
}
.imprint-dot.witness { background: var(--gold-light); box-shadow: 0 0 4px rgba(232,200,112,0.4); }
.imprint-dot.follower { background: var(--gold); }
.imprint-dot.rebel { background: #a05040; }
.imprint-dot.estranged { background: #706070; }
.imprint-dot.bonded { background: #9080a0; }
.imprint-dot.soul_of_family { background: #c0a0d0; box-shadow: 0 0 4px rgba(192,160,208,0.4); }

/* ---- 线索藏品列表（侧边栏用） ---- */
.clue-collection-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  margin: 4px 0;
  border-radius: 6px;
  background: rgba(184,137,62,0.05);
  font-size: 0.75rem;
}
.clue-collection-item.found {
  color: #d4c0a0;
}
.clue-collection-item.missing {
  color: #6a6050;
  font-style: italic;
}

/* ---- v2.0: 玩法介绍面板 ---- */
.gp-section {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(184,137,62,0.1);
}
.gp-section:last-child { border-bottom: none; }
.gp-section-title {
  font-family: var(--font-title);
  font-size: 0.8rem;
  color: var(--gold-light);
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.gp-section p {
  margin: 4px 0;
  font-size: 0.75rem;
  line-height: 1.7;
  color: #b0a090;
}

/* ---- v2.0: 标签按章节分类 ---- */
.tag-chapter-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 420px;
  overflow-y: auto;
}
.tag-chapter-group {
  border: 1px solid rgba(184,137,62,0.1);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.25s ease;
}
.tag-chapter-group.current {
  border-color: rgba(184,137,62,0.35);
}
.tag-chapter-group.complete {
  border-color: rgba(120,160,120,0.25);
}
.tag-chapter-header {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: rgba(184,137,62,0.05);
  cursor: pointer;
  font-size: 0.7rem;
  color: var(--gold-dim);
  user-select: none;
  transition: background 0.2s;
}
.tag-chapter-header:hover {
  background: rgba(184,137,62,0.12);
}
.tag-chapter-arrow {
  font-size: 0.5rem;
  transition: transform 0.25s;
  display: inline-block;
}
.tag-chapter-group.collapsed .tag-chapter-arrow {
  transform: rotate(0deg);
}
.tag-chapter-group:not(.collapsed) .tag-chapter-arrow {
  transform: rotate(90deg);
}
.tag-chapter-count {
  margin-left: auto;
  font-size: 0.6rem;
  color: var(--gold-dim);
  background: rgba(184,137,62,0.08);
  padding: 1px 8px;
  border-radius: 2px;
}
.tag-chapter-body {
  padding: 6px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.tag-chapter-group.collapsed .tag-chapter-body {
  display: none;
}
.tag-subtitle {
  width: 100%;
  font-size: 0.58rem;
  color: var(--gold-dim);
  margin: 2px 0;
  letter-spacing: 0.04em;
}
.tag-badge.tag-obtained {
  background: rgba(184,137,62,0.15);
  border: 1px solid rgba(184,137,62,0.3);
  color: #e0d8d2;
}
.tag-badge.tag-missing {
  background: rgba(100,100,100,0.08);
  border: 1px solid rgba(100,100,100,0.15);
  color: #706860;
  font-style: italic;
}

/* ---- v2.0: 关系值显示微调 ---- */
.relationship-item .rel-name {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ---- v2.0: 玩法介绍覆盖层 ---- */
#gameplay-overlay .modal-panel {
  font-size: 0.8rem;
}
#gameplay-overlay .modal-panel::-webkit-scrollbar {
  width: 4px;
}
#gameplay-overlay .modal-panel::-webkit-scrollbar-thumb {
  background: rgba(184,137,62,0.15);
  border-radius: 4px;
}

/* ---- v2.0: 结算中宿命/羁绊变化展示 ---- */
.fatebond-change-panel {
  text-align: center;
  padding: 10px 16px;
  margin-bottom: 12px;
  background: rgba(184,137,62,0.05);
  border: 1px solid rgba(184,137,62,0.12);
  border-radius: 8px;
}
.fatebond-change-title {
  font-size: 0.68rem;
  color: var(--gold-dim);
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  font-family: var(--font-title);
}
.fatebond-change-items {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.fb-change-item {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 2px;
  font-size: 0.75rem;
  font-family: var(--font-ui);
  letter-spacing: 0.04em;
}
.fb-change-positive {
  color: #8ab880;
  background: rgba(120,160,100,0.1);
  border: 1px solid rgba(120,160,100,0.25);
}
.fb-change-negative {
  color: #c07060;
  background: rgba(180,100,80,0.1);
  border: 1px solid rgba(180,100,80,0.25);
}
.fb-change-neutral {
  color: var(--gold-dim);
  background: rgba(184,137,62,0.06);
  border: 1px solid rgba(184,137,62,0.15);
}

/* ---- v2.0: 侧边栏帮助图标 ---- */
.help-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--gold-dim);
  background: rgba(184,137,62,0.12);
  border: 1px solid rgba(184,137,62,0.25);
  border-radius: 50%;
  cursor: pointer;
  margin-left: 4px;
  vertical-align: middle;
  transition: all 0.25s ease;
  font-family: var(--font-ui);
}
.help-icon:hover {
  color: var(--gold-light);
  background: rgba(184,137,62,0.25);
  border-color: var(--gold);
}

/* ---- v2.0: 定义说明弹窗 ---- */
.definitions-popup {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(4,2,1,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: defPopupIn 0.3s ease;
  backdrop-filter: blur(4px);
}
.definitions-popup.closing {
  animation: defPopupOut 0.25s ease forwards;
}
@keyframes defPopupIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes defPopupOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}
.definitions-popup-inner {
  background: linear-gradient(160deg, rgba(24,18,10,0.98), rgba(16,12,6,0.98));
  border: 1px solid var(--gold);
  border-radius: 2px;
  padding: 20px 24px;
  max-width: 480px;
  width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 0 48px rgba(184,137,62,0.2), 0 12px 40px rgba(0,0,0,0.5);
}
.definitions-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(184,137,62,0.18);
  font-family: var(--font-title);
  font-size: 0.95rem;
  color: var(--gold-light);
  letter-spacing: 0.06em;
}
.definitions-popup-close {
  width: 26px;
  height: 26px;
  line-height: 26px;
  text-align: center;
  background: rgba(184,137,62,0.1);
  border: 1px solid rgba(184,137,62,0.2);
  border-radius: 50%;
  color: var(--gold-dim);
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.25s ease;
}
.definitions-popup-close:hover {
  background: rgba(184,137,62,0.25);
  color: var(--gold-light);
}
.definitions-popup-body {
  font-size: 0.78rem;
  color: #c0b090;
  line-height: 1.7;
}
.definitions-popup-footer {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(184,137,62,0.1);
  text-align: center;
}
.def-section {
  margin-bottom: 18px;
}
.def-section-title {
  font-family: var(--font-title);
  font-size: 0.8rem;
  color: var(--gold-light);
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.def-text {
  font-size: 0.75rem;
  color: #a09080;
  margin-bottom: 10px;
  font-style: italic;
  line-height: 1.6;
}
.def-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.def-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.73rem;
  color: #b0a090;
  line-height: 1.5;
  padding: 6px 10px;
  background: rgba(184,137,62,0.04);
  border-radius: 6px;
}
.def-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
}
.def-dot.fate-rebel { background: #a05040; }
.def-dot.fate-follower { background: var(--gold); }
.def-dot.fate-witness { background: var(--gold-light); }
.def-dot.bond-estranged { background: #706070; }
.def-dot.bond-bonded { background: #9080a0; }
.def-dot.bond-soul_of_family { background: #c0a0d0; }
.def-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.def-card {
  padding: 10px;
  background: rgba(184,137,62,0.05);
  border: 1px solid rgba(184,137,62,0.12);
  border-radius: 8px;
  text-align: center;
}
.def-card-name {
  font-family: var(--font-title);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.def-card-desc {
  font-size: 0.68rem;
  color: #908070;
  line-height: 1.5;
  font-style: italic;
}
