/* ============================================
   重走《入蜀记》：陆小六的奇幻诗旅
   原型样式 - Z世代新中式梦幻国风
   ============================================ */

:root {
  --parchment: #F5F0E6;
  --parchment-dark: #E8DFD0;
  --ink: #2C2C2C;
  --ink-light: #5A5A5A;
  --ink-faint: #7A7570;
  --accent-blue: #5B8FA8;
  --accent-gold: #C4A35A;
  --accent-red: #B85450;
  --river-blue: #7EB8C9;
  --bamboo-green: #7A9E7E;
  --ink-wash-1: rgba(90, 80, 70, 0.06);
  --ink-wash-2: rgba(90, 80, 70, 0.04);
  --font-title: 'Ma Shan Zheng', 'STKaiti', 'KaiTi', serif;
  --font-body: 'Noto Serif SC', 'STSong', 'SimSun', serif;
  --font-ui: 'Noto Serif SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --shadow-soft: 0 2px 20px rgba(44,44,44,0.08);
  --shadow-card: 0 4px 24px rgba(44,44,44,0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* === Design Token: 动画系统 === */
  --ease-out: var(--ease-out);
  --ease-in-out: var(--ease-in-out);
  --ease-soft: var(--ease-soft);
  --dur-fast: 0.2s;
  --dur-normal: 0.3s;
  --dur-slow: 0.55s;
  --dur-slide: 0.8s;
  --dur-float: 6s;
  --dur-breathe: 4s;

  /* === Design Token: 视觉层级 (z-index) === */
  --z-bg: 0;
  --z-scene: 10;
  --z-float: 20;
  --z-overlay: 50;
  --z-ui: 100;
  --z-modal: 200;
  --z-toast: 300;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

body {
  font-family: var(--font-body);
  background: var(--parchment);
  color: var(--ink);
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* 防止 iOS 弹性滚动导致的背景露出 */
  position: fixed;
  width: 100%;
  height: 100%;
}

/* 所有屏幕：未激活时完全隐藏 */
.screen {
  display: none;
}

/* 激活的屏幕：固定全屏 */
.screen.active {
  display: flex;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.view {
  display: none;
  min-height: 100%;
  position: relative;
}

.view.active {
  display: block;
}

/* 卷轴展开 — 驿站详情页入场动画 */
#view-station.view-enter {
  animation: scrollUnfurl 0.55s var(--ease-in-out);
}
@keyframes scrollUnfurl {
  0% { 
    clip-path: inset(0 100% 0 0);
    opacity: 0.3;
  }
  40% {
    clip-path: inset(0 40% 0 0);
    opacity: 0.7;
  }
  100% { 
    clip-path: inset(0 0 0 0);
    opacity: 1;
  }
}
/* 返回地图时反向卷轴（收起） */
#view-station.view-exit {
  animation: scrollRoll 0.35s var(--ease-soft) forwards;
}
@keyframes scrollRoll {
  0% { clip-path: inset(0 0 0 0); opacity: 1; }
  100% { clip-path: inset(0 100% 0 0); opacity: 0; }
}

#main {
  flex-direction: column;
  height: 100%;
  background: var(--parchment);
}

#main.active {
  overflow: hidden;
}

#main > .top-bar {
  flex-shrink: 0;
}

#main > .view.active {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  /* 为底部气泡留出空间 */
  padding-bottom: 80px;
}

.section-title {
  font-family: var(--font-title);
  font-size: 1.8rem;
  color: var(--ink);
  text-align: center;
  margin: 24px 0 20px;
  position: relative;
}
.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 2px;
  background: var(--accent-gold);
  margin: 8px auto 0;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--ink-faint);
  color: var(--ink-light);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  padding: 10px 20px;
  border-radius: 20px;
  cursor: pointer;
  margin: 12px 16px;
  margin-top: calc(12px + var(--safe-top));
  transition: all var(--dur-normal);
  min-height: 44px;
  -webkit-user-select: none;
  user-select: none;
}
.back-btn:hover {
  background: var(--ink);
  color: var(--parchment);
  border-color: var(--ink);
}

/* 终页触发按钮（最后一站底部） */
.finale-trigger {
  text-align: center;
  padding: 32px 20px 40px;
  animation: finaleTriggerIn 0.8s ease both;
}
@keyframes finaleTriggerIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.finale-trigger-divider {
  width: 60px;
  height: 1px;
  margin: 0 auto 16px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
}
.finale-trigger-text {
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: var(--ink-light);
  letter-spacing: 4px;
  margin-bottom: 20px;
}
.finale-trigger-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--ink);
  color: var(--parchment);
  font-family: var(--font-title);
  font-size: 1.2rem;
  letter-spacing: 3px;
  padding: 16px 40px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.4s var(--ease-out);
  min-height: 44px;
  -webkit-user-select: none;
  user-select: none;
  position: relative;
  overflow: hidden;
}
.finale-trigger-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-red));
  opacity: 0;
  transition: opacity 0.4s;
}
.finale-trigger-btn:hover::before {
  opacity: 1;
}
.finale-trigger-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(44,44,44,0.2);
}
.finale-trigger-btn span {
  position: relative;
  z-index: 1;
}
.finale-trigger-arrow {
  font-size: 0.85rem;
  letter-spacing: 2px;
  opacity: 0.75;
}

/* 非最后一站时隐藏触发按钮 */
.view:not(#view-station) .finale-trigger,
#view-station:not(.active) .finale-trigger {
  display: none !important;
}

/* ==================== Shader Canvas ==================== */
.shader-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  display: block;
  pointer-events: none;
}

#opening .opening-bg {
  z-index: 1;
}

#opening .opening-content {
  z-index: var(--z-scene);
  position: relative;
}

/* shader 激活时：文字改为浅色 */
#opening.shader-active .seal {
  color: #D4A0A0;
  border-color: rgba(180,100,100,0.6);
}
#opening.shader-active .seal::before {
  border-color: rgba(180,100,100,0.25);
}
#opening.shader-active .title {
  color: rgba(245,240,230,0.95);
  text-shadow: 0 2px 30px rgba(0,0,0,0.4);
}
#opening.shader-active .title-line {
  background: rgba(196,163,90,0.6);
}
#opening.shader-active .subtitle {
  color: rgba(196,163,90,0.85);
}
#opening.shader-active .opening-tagline {
  color: rgba(220,215,205,0.7);
  text-shadow: 0 1px 6px rgba(0,0,0,0.2);
}
#opening.shader-active .start-btn {
  background: linear-gradient(135deg, rgba(196,163,90,0.9), rgba(180,140,60,0.9));
  box-shadow: 0 4px 24px rgba(196,163,90,0.3);
}
#opening.shader-active .start-btn:hover {
  box-shadow: 0 8px 36px rgba(196,163,90,0.45);
}

/* fallback: 没有 shader 时保持原样 */
#opening:not(.shader-active) .shader-canvas {
  display: none;
}

/* ==================== 开场页 ==================== */
#opening {
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #F5F0E6 0%, #EDE5D8 40%, #E8DFD0 100%);
}

/* 开场视频背景 */
.opening-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  background: #F5F0E6; /* 加载前占位 */
  transition: opacity 2s var(--ease-soft);
}
/* 转场: 视频淡出 + 遮罩层接住 */
#opening.content-ready .opening-video {
  opacity: 0;
}

/* ===== 视频缓冲加载指示器 ===== */
.video-loader {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3;
  pointer-events: none;
  background: rgba(245,240,230,0.15);
  backdrop-filter: blur(2px);
  transition: opacity 0.4s var(--ease-soft);
  opacity: 0;
}
.video-loader.active {
  display: flex;
  opacity: 1;
}
.video-loader-ring {
  width: 36px; height: 36px;
  border: 2px solid rgba(196,163,90,0.15);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: vloader-spin 0.8s linear infinite;
}
@keyframes vloader-spin {
  to { transform: rotate(360deg); }
}

/* 视频遮罩 — 视频播放期间透明，内容出现后渐变 */
.opening-overlay {
  position: absolute;
  inset: 0;
  background: rgba(245, 240, 230, 0.35);
  backdrop-filter: blur(1px);
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s var(--ease-soft);
}

.opening-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.mountain-silhouette {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 45%;
  opacity: 0.04;
  pointer-events: none;
}

.ink-wash {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: inkFloat 8s ease-in-out infinite;
}
.ink-wash-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(91,143,168,0.12), transparent 70%);
  top: -150px; right: -150px;
  animation-delay: 0s;
}
.ink-wash-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(196,163,90,0.1), transparent 70%);
  bottom: -80px; left: -80px;
  animation-delay: -3s;
}
.ink-wash-3 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(122,158,126,0.08), transparent 70%);
  top: 35%; left: 25%;
  animation-delay: -5s;
}
.ink-wash-4 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(184,84,80,0.06), transparent 70%);
  top: 15%; right: 20%;
  animation-delay: -2s;
  animation: inkFloat 10s ease-in-out infinite;
}

@keyframes inkFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -15px) scale(1.05); }
  66% { transform: translate(-15px, 10px) scale(0.95); }
}

.floating-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.particle {
  position: absolute;
  font-family: var(--font-title);
  color: var(--ink-faint);
  opacity: 0;
  animation: floatUp 15s linear infinite;
}
.p1 { left: 8%; animation-delay: 0s; font-size: 1rem; }
.p2 { left: 22%; animation-delay: -2.5s; font-size: 1.4rem; }
.p3 { left: 48%; animation-delay: -5s; font-size: 1.1rem; }
.p4 { left: 68%; animation-delay: -7.5s; font-size: 0.9rem; }
.p5 { left: 82%; animation-delay: -10s; font-size: 1.2rem; }
.p6 { left: 38%; animation-delay: -12.5s; font-size: 1.3rem; }

@keyframes floatUp {
  0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  5% { opacity: 0.2; }
  90% { opacity: 0.15; }
  100% { transform: translateY(-100px) rotate(15deg); opacity: 0; }
}

.opening-content {
  position: relative;
  z-index: var(--z-scene);
  text-align: center;
  padding: 48px 20px 32px;
  padding-top: calc(48px + var(--safe-top));
  padding-bottom: calc(20px + var(--safe-bottom));
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  gap: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s var(--ease-soft);
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 安静开场 — tagline（视频结束后由 content-ready 触发动效） */
.opening-tagline {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink-faint);
  line-height: 2;
  max-width: 420px;
  margin: 0 auto;
  opacity: 0;
}
@keyframes taglineFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 呼吸柔光 — 标题背景光晕 */
.opening-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 320px;
  height: 200px;
  margin-left: -160px;
  margin-top: -140px;
  background: radial-gradient(ellipse, rgba(196,163,90,0.08), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  animation: glowBreathe 5s ease-in-out infinite;
}
@keyframes glowBreathe {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.15); }
}

/* 轻触启程提示 */
.opening-tap-hint {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  animation: tapHintPulse 2.2s ease-in-out infinite;
  transition: opacity 0.6s var(--ease-soft);
}
.opening-tap-hint.hidden {
  opacity: 0;
  pointer-events: none;
}
.tap-hint-text {
  font-family: var(--font-body);
  font-size: 14px;
  letter-spacing: 0.2em;
  color: var(--ink);
  opacity: 0.45;
}
.tap-hint-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-gold);
  opacity: 0.5;
  animation: tapDotBounce 1.6s ease-in-out infinite;
}
@keyframes tapHintPulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}
@keyframes tapDotBounce {
  0%, 100% { transform: translateY(0); opacity: 0.3; }
  50% { transform: translateY(4px); opacity: 0.7; }
}

/* content-ready 后启程提示保持可见（用户手动点击） */
#opening.content-ready .opening-tap-hint {
  /* 保持显示，引导用户点击 */
}

/* ---- 手机端开场页适配 ---- */
@media (max-width: 640px) {
  #opening {
    justify-content: flex-start;
  }
  .opening-content {
    padding-top: calc(8px + var(--safe-top));
    padding-bottom: calc(90px + var(--safe-bottom));
    min-height: auto;
    justify-content: flex-start;
    gap: 12px;
  }
  .title-group {
    margin-top: calc(6vh + var(--safe-top));
    margin-bottom: 12px;
  }
  .opening-tagline {
    font-size: 0.82rem;
    line-height: 1.7;
    max-width: 300px;
  }
  .route-stream {
    margin: 8px 0 10px;
  }
  .opening-tap-hint {
    bottom: 36px;
  }
  .opening-glow {
    top: 30%;
    width: 240px;
    height: 140px;
    margin-left: -120px;
    margin-top: -70px;
  }
}

/* ==================== 卷轴开场页 ==================== */
#scroll-intro {
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: #1C1814;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* 卷轴循环视频（双通道无缝循环） */
.scroll-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.scroll-video-a {
  z-index: 2;
  opacity: 1;
}
.scroll-video-b {
  z-index: 1;
  opacity: 0;
}
/* 交叉淡入淡出状态 */
.scroll-video-a.crossfade { opacity: 0; }
.scroll-video-b.crossfade { opacity: 1; }

/* 点击提示 */
.scroll-tap-hint {
  position: absolute;
  bottom: 10vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  animation: tapHintPulse 2.2s ease-in-out infinite;
}
.scroll-tap-text {
  font-family: var(--font-body);
  font-size: 15px;
  letter-spacing: 0.25em;
  white-space: nowrap;
  color: rgba(212,175,105,0.9);
  text-shadow: 0 0 12px rgba(0,0,0,0.5), 0 0 4px rgba(0,0,0,0.3);
}
.scroll-tap-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-gold);
  opacity: 0.5;
  animation: tapDotBounce 1.6s ease-in-out infinite;
}
/* 微信 autoplay 失败时 — 提示更醒目 */
.scroll-tap-hint.waiting {
  animation: tapHintUrgent 0.8s ease-in-out infinite;
  bottom: 14vh;
  width: max-content;
}
.scroll-tap-hint.waiting .scroll-tap-text {
  font-size: 17px;
  color: rgba(245,240,230,0.95);
  text-shadow: 0 0 16px rgba(196,163,90,0.7), 0 0 6px rgba(0,0,0,0.6);
  letter-spacing: 0.3em;
}
.scroll-tap-hint.waiting .scroll-tap-dot {
  width: 7px;
  height: 7px;
  background: rgba(245,240,230,0.8);
  animation: tapDotBounce 0.9s ease-in-out infinite;
}
@keyframes tapHintUrgent {
  0%, 100% { opacity: 0.5; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.03); }
}
@keyframes tapHintPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
@keyframes tapDotBounce {
  0%, 100% { transform: translateY(0); opacity: 0.3; }
  50% { transform: translateY(-4px); opacity: 0.7; }
}

/* 淡出（点击后） */
#scroll-intro.fade-out {
  pointer-events: none;
}
#scroll-intro.fade-out .scroll-video {
  opacity: 0;
  transition: opacity 0.8s ease;
}
#scroll-intro.fade-out .scroll-tap-hint {
  opacity: 0;
  transition: opacity 0.5s ease;
}

/* 手机端适配 */
@media (max-width: 640px) {
  .scroll-tap-hint {
    bottom: 8vh;
  }
  .scroll-tap-text {
    font-size: 13px;
  }
}

/* ---- 标题组 ---- */
.title-group {
  margin-bottom: 20px;
}

/* 印章基类 — 竖式方印共用属性 */
.seal-base {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1px;
  color: var(--accent-red);
  font-family: var(--font-title);
  transform: rotate(-3deg);
  line-height: 1.4;
  position: relative;
}
.seal-base span {
  display: block;
  text-align: center;
  line-height: 1.4;
}
/* 做旧斑驳纹理 — 四类印章共用 */
.seal-base::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 15% 20%, rgba(245,240,230,0.3) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 75%, rgba(245,240,230,0.25) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 45%, rgba(245,240,230,0.1) 0%, transparent 40%);
  pointer-events: none;
}

.seal {
  width: 44px;
  height: 58px;
  border: 2.5px solid var(--accent-red);
  font-size: 0.92rem;
  padding: 6px 4px;
  margin-bottom: 16px;
  letter-spacing: 2px;
  opacity: 0.78;
  box-shadow:
    inset 0 0 0 3px transparent,
    inset 0 0 0 4px rgba(184, 84, 80, 0.12);
}
/* 内框 — 双栏印章 */
.seal::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(184, 84, 80, 0.35);
  pointer-events: none;
}

.title {
  font-family: var(--font-title);
  font-size: 2.6rem;
  color: var(--ink);
  margin: 0 auto 12px;
  letter-spacing: 8px;
  text-shadow: 0 2px 20px rgba(44,44,44,0.06);
  line-height: 1.3;
}

.title-line {
  width: 40px;
  height: 1.5px;
  background: var(--accent-gold);
  margin: 0 auto 14px;
  opacity: 0.6;
}

.subtitle {
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--accent-blue);
  letter-spacing: 4px;
  opacity: 0.8;
  font-weight: 300;
}

.description {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--ink-light);
  line-height: 2.2;
  margin-bottom: 24px;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
  letter-spacing: 0.5px;
}

/* ==================== 视频结束 → 内容渐入 ==================== */
#opening.content-ready .opening-overlay { opacity: 1; }
#opening.content-ready .opening-content {
  opacity: 1; pointer-events: auto;
  animation: fadeInUp 0.6s ease-out;
}
#opening.content-ready .opening-tagline {
  animation: taglineFadeIn 0.7s 0.3s ease-out forwards;
}
#opening.content-ready .route-stream {
  opacity: 0;
  animation: taglineFadeIn 0.7s 0.6s ease-out forwards;
}
#opening.content-ready .start-btn {
  animation: btnReveal 0.7s 1.0s ease-out forwards;
}

/* ---- 诗旅路线 · 竖向时间轴 ---- */
/* ---- 诗旅路线 · 水墨流线 ---- */
.route-stream {
  position: relative;
  width: 100%;
  margin: 20px 0 24px;
  padding: 4px 0;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

.stream-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

/* 鎏金帆船由 JS 驱动，CSS 仅控制点亮态与过渡 */
.sp {
  opacity: 0.15;
  transition: opacity 0.6s ease;
  cursor: pointer;
  pointer-events: all;
}
.sp.lit { opacity: 0.9; }

.sl {
  font-family: var(--font-title);
  font-size: 11px;
  fill: var(--ink-faint);
  text-anchor: middle;
  opacity: 0.2;
  pointer-events: none;
  transition: opacity 0.6s ease, fill 0.6s ease;
}
.sl.lit { opacity: 1; fill: var(--accent-gold); }

/* 帆船 JS 元素过渡 */
#goldBoat { transition: opacity 0.4s ease; }
#goldWake { transition: opacity 0.4s ease; }
#goldHalo { transition: opacity 0.4s ease; }

/* Shader 激活时的适配 */
#opening.shader-active .sl {
  fill: rgba(200,195,185,0.4);
}
#opening.shader-active .sl.lit {
  fill: rgba(200,180,120,0.9);
}

/* ---- 角色预览卡片 ---- */
.characters-preview {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 32px;
}

.character-card {
  position: relative;
  width: 130px;
  transition: transform 0.4s var(--ease-out);
  cursor: default;
}

.character-card:hover {
  transform: translateY(-6px);
}

.character-img {
  width: 110px;
  height: 110px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(44,44,44,0.1));
  transition: transform 0.4s;
}

.character-card:hover .character-img {
  transform: scale(1.05);
}

.character-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 6px;
}

.character-name {
  font-family: var(--font-title);
  font-size: 1rem;
  color: var(--ink);
  letter-spacing: 2px;
}

.character-role {
  font-size: 0.68rem;
  color: var(--ink-faint);
  margin-top: 1px;
  letter-spacing: 1px;
}

.liuxiaoliu-card .character-role {
  color: var(--accent-gold);
}

.linu-card .character-role {
  color: var(--accent-blue);
}

/* ---- 开始按钮 ---- */
.start-btn {
  position: relative;
  display: inline-block;
  font-family: var(--font-title);
  font-size: 1.15rem;
  color: var(--parchment);
  background: linear-gradient(135deg, #2C2C2C 0%, #4A4A4A 100%);
  border: none;
  padding: 13px 48px;
  border-radius: 40px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.4s var(--ease-out);
  letter-spacing: 6px;
  box-shadow: 0 4px 20px rgba(44,44,44,0.15);
  opacity: 0;
  transform: translateY(16px);
}
@keyframes btnReveal {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.start-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(44,44,44,0.25);
  letter-spacing: 8px;
}

.start-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(44,44,44,0.15);
}

/* 自动倒计时状态 —— 按钮脉冲 + 倒计时文字 */
.start-btn.counting {
  animation: btnPulse 1.5s ease-in-out infinite;
}
@keyframes btnPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(44,44,44,0.15); }
  50% { box-shadow: 0 4px 32px rgba(196,163,90,0.35); }
}

.btn-ink {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 30%, rgba(255,255,255,0.12) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: inkFlow 3s ease-in-out infinite;
}

@keyframes inkFlow {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}

/* ==================== 顶部导航 ==================== */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 16px;
  padding-top: var(--safe-top);
  padding-bottom: 4px;
  background: rgba(245,240,230,0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(44,44,44,0.08);
  position: sticky;
  top: 0;
  z-index: var(--z-ui);
}

.logo-text {
  font-family: var(--font-title);
  font-size: 1.3rem;
  color: var(--ink);
  letter-spacing: 2px;
}

.progress-ring {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.progress-label {
  font-size: 0.7rem;
  color: var(--ink-faint);
}

.progress-count {
  font-family: var(--font-title);
  font-size: 1rem;
  color: var(--accent-gold);
}

.nav-btn {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: all var(--dur-fast);
  position: relative;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-user-select: none;
  user-select: none;
  /* 消除 300ms 延迟 */
  touch-action: manipulation;
}

.nav-btn:hover {
  background: rgba(44,44,44,0.05);
  transform: translateY(-2px);
}
.nav-btn:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}
.back-btn:focus-visible,
.start-btn:focus-visible,
.quiz-option:focus-visible,
.finale-btn:focus-visible,
.quiz-restart-btn:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}

.nav-btn .badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--accent-red);
  color: #fff;
  font-size: 0.6rem;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.top-bar-right {
  display: flex;
  gap: 4px;
}

/* ==================== 地图视图 ==================== */
.map-container {
  position: relative;
  min-height: calc(100vh - 116px);
  display: flex;
  padding: 16px;
}

/* 视差图层 */
.parallax-mountains {
  position: absolute;
  left: 0;
  top: -40px;
  width: 100%;
  height: calc(100% + 80px);
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}
.mountains-svg {
  width: 100%;
  height: 100%;
  opacity: 0.7;
}

.river-bg {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 80px;
  width: 80px;
  transform: translateX(-50%);
  opacity: 0.6;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

.river-svg {
  width: 100%;
  height: 100%;
}

.stations-list {
  position: relative;
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1;
}

/* 驿站卡片 */
.station-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(44,44,44,0.06);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.4s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.station-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent-blue);
  border-radius: 0 2px 2px 0;
  transition: width 0.3s;
}

.station-card:hover {
  transform: translateX(8px);
  box-shadow: var(--shadow-card);
  background: rgba(255,255,255,0.9);
}

.station-card:hover::before {
  width: 6px;
}

.station-card.visited::before {
  background: var(--accent-gold);
}

.station-dot {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  border: 2px solid var(--accent-blue);
  background: var(--parchment);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-size: 0.8rem;
  color: var(--accent-blue);
  transition: all var(--dur-normal);
}

.station-card.visited .station-dot {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  color: #fff;
}

.station-info {
  flex: 1;
  min-width: 0;
}

.station-name {
  font-family: var(--font-title);
  font-size: 1.3rem;
  color: var(--ink);
  margin-bottom: 2px;
}

.station-meta {
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.station-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: rgba(91,143,168,0.1);
  border-radius: 10px;
  font-size: 0.7rem;
  color: var(--accent-blue);
}

.station-arrow {
  font-size: 1.2rem;
  color: var(--ink-faint);
  transition: all var(--dur-normal);
}

.station-card:hover .station-arrow {
  color: var(--accent-blue);
  transform: translateX(4px);
}

/* 驿站解锁动画 */
.station-card.unlocking {
  animation: cardUnlock 0.6s ease-out;
}
@keyframes cardUnlock {
  0% { transform: scale(0.95); opacity: 0.5; }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); opacity: 1; }
}

/* 雾锁未解锁驿站 — 轻盈山间晨雾，低饱和度冷色 + 缓慢呼吸动效 */
.station-fog {
  position: absolute;
  inset: -10px;
  z-index: 2;
  pointer-events: none;
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse 55% 40% at 18% 32%, rgba(200, 212, 225, 0.28) 0%, transparent 60%),
    radial-gradient(ellipse 50% 38% at 72% 50%, rgba(190, 205, 218, 0.22) 0%, transparent 58%),
    radial-gradient(ellipse 65% 32% at 48% 78%, rgba(195, 208, 222, 0.18) 0%, transparent 62%),
    radial-gradient(ellipse 35% 25% at 85% 25%, rgba(210, 218, 228, 0.14) 0%, transparent 55%);
  opacity: 1;
  transition: opacity 1.2s var(--ease-soft);
  animation: fogBreathe 7s ease-in-out infinite;
}
.station-card:not(.visited) .station-name,
.station-card:not(.visited) .station-meta {
  filter: blur(0.5px);
  transition: filter 0.8s ease;
}
.station-card.visited .station-fog {
  opacity: 0;
  animation: none;
}
.station-card.visited .station-name,
.station-card.visited .station-meta {
  filter: blur(0px);
}
.station-card.unlocking .station-fog {
  animation: fogLift 1.5s ease-out forwards;
}
.station-card.unlocking .station-name,
.station-card.unlocking .station-meta {
  animation: fogUnblur 1.5s ease-out forwards;
}
@keyframes fogBreathe {
  0%, 100% { opacity: 0.78; }
  40% { opacity: 1; }
  70% { opacity: 0.88; }
}
@keyframes fogLift {
  0% { opacity: 1; }
  30% { opacity: 0.6; }
  100% { opacity: 0; }
}
@keyframes fogUnblur {
  0% { filter: blur(0.5px); }
  100% { filter: blur(0px); }
}

/* 角色对话气泡 */
.character-bubble {
  position: fixed;
  bottom: calc(16px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(44,44,44,0.08);
  border-radius: 24px;
  padding: 10px 20px 10px 12px;
  max-width: 500px;
  width: calc(100% - 32px);
  box-shadow: var(--shadow-soft);
  z-index: var(--z-overlay);
  animation: bubbleUp 0.5s ease-out;
  -webkit-user-select: none;
  user-select: none;
}

@keyframes bubbleUp {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.bubble-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-gold), #D4B36A);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.bubble-name {
  font-size: 0.7rem;
  color: var(--accent-gold);
  font-weight: 500;
}

.bubble-text {
  font-size: 0.85rem;
  color: var(--ink-light);
  line-height: 1.5;
}

/* ==================== 驿站详情视图 ==================== */
.station-detail {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 20px 100px;
}

.detail-hero {
  text-align: center;
  padding: 30px 0 20px;
  position: relative;
  z-index: 1;
}

.detail-name {
  font-family: var(--font-title);
  font-size: 2.2rem;
  color: var(--ink);
  margin-bottom: 4px;
}

.detail-modern {
  font-size: 0.9rem;
  color: var(--accent-blue);
  margin-bottom: 8px;
}

.detail-date {
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.detail-mood {
  display: inline-block;
  font-family: var(--font-title);
  font-size: 0.85rem;
  color: var(--accent-red);
  background: rgba(184,84,80,0.06);
  border: 1px solid rgba(184,84,80,0.15);
  border-radius: 4px;
  padding: 3px 14px;
  margin-top: 8px;
  letter-spacing: 2px;
}

.detail-divider {
  width: 60px;
  height: 2px;
  background: var(--accent-gold);
  margin: 16px auto;
}

.detail-desc {
  font-size: 0.95rem;
  color: var(--ink-light);
  line-height: 1.8;
  max-width: 560px;
  margin: 0 auto 30px;
}

/* 感知型文本 — 文学短句，首屏主视觉 */
.detail-moodtext {
  font-family: var(--font-title);
  font-size: 1.15rem;
  color: var(--ink);
  line-height: 2;
  max-width: 560px;
  margin: 0 auto 24px;
  text-align: center;
  opacity: 0.82;
  letter-spacing: 1px;
}

/* 背景考据 — 折叠 */
.detail-kaoju {
  max-width: 560px;
  margin: 0 auto 20px;
  text-align: center;
}
.kaoju-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid rgba(44,44,44,0.1);
  border-radius: 20px;
  padding: 6px 16px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--ink-faint);
  cursor: pointer;
  transition: all var(--dur-fast) ease;
}
.kaoju-toggle:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}
.kaoju-arrow {
  font-size: 0.7rem;
  transition: transform 0.25s ease;
}
.kaoju-text {
  font-size: 0.85rem;
  color: var(--ink-light);
  line-height: 1.7;
  margin-top: 10px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, margin 0.4s ease, opacity var(--dur-normal) ease;
  opacity: 0;
}
.kaoju-text.open {
  max-height: 200px;
  opacity: 1;
  margin-top: 12px;
}

/* 日记引导语 */
.diary-intro {
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin-bottom: 10px;
  font-style: italic;
  opacity: 0.7;
}

/* Hero 底部按钮行 */
.detail-hero-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}

/* 沉浸阅读按钮 */
.immersive-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1px solid rgba(44,44,44,0.1);
  border-radius: 20px;
  padding: 7px 18px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--ink-faint);
  cursor: pointer;
  transition: all var(--dur-fast) ease;
  min-height: 36px;
}
.immersive-btn:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

/* ========= 沉浸阅读模式 ========= */
/* 隐藏 hero 中的文本内容，但保留按钮行 */
#view-station.immersive-mode .detail-name,
#view-station.immersive-mode .detail-modern,
#view-station.immersive-mode .detail-date,
#view-station.immersive-mode .detail-mood,
#view-station.immersive-mode .detail-divider,
#view-station.immersive-mode .detail-moodtext,
#view-station.immersive-mode .detail-desc,
#view-station.immersive-mode .detail-kaoju,
#view-station.immersive-mode .station-atmosphere,
#view-station.immersive-mode #fengwu-section,
#view-station.immersive-mode #scenery-section,
#view-station.immersive-mode #ancient-modern-section,
#view-station.immersive-mode #fragments-section,
#view-station.immersive-mode #character-section {
  display: none;
}

/* 沉浸模式下按钮行紧凑排列，只保留沉浸切换按钮 */
#view-station.immersive-mode .detail-hero-actions {
  padding: 4px 0 8px;
}
#view-station.immersive-mode .daily-card-btn {
  display: none;
}

/* 沉浸模式下，hero-actions 中的按钮小间距 */
.detail-hero-actions .daily-card-btn {
  margin-top: 0;
}

/* 沉浸模式纯色背景 */
#view-station.immersive-mode {
  background: var(--parchment) !important;
  transition: background var(--dur-slide) ease;
}

/* 沉浸模式 — 文本放大 */
#view-station.immersive-mode .station-detail {
  padding-top: 12px;
}
#view-station.immersive-mode .diary-text {
  font-size: 1.05rem;
  line-height: 2.3;
  border-left-width: 3px;
  color: var(--ink);
}
#view-station.immersive-mode .poem-line {
  font-size: 1.1rem;
  line-height: 2.2;
  letter-spacing: 2px;
}
#view-station.immersive-mode .diary-intro {
  font-size: 0.8rem;
}

/* 详情卡片 */
.detail-section {
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(44,44,44,0.06);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
  transition: all var(--dur-normal);
}

.detail-section:hover {
  box-shadow: var(--shadow-soft);
  background: rgba(255,255,255,0.8);
}

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-title);
  font-size: 1rem;
  color: var(--accent-blue);
  margin-bottom: 12px;
}

/* 朗读按钮 */
.tts-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(91,143,168,0.2);
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all var(--dur-fast) ease;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}
.tts-btn:hover {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  transform: scale(1.1);
}
.tts-btn:active {
  transform: scale(0.95);
}

.diary-text {
  font-size: 0.9rem;
  color: var(--ink-light);
  line-height: 2;
  text-indent: 2em;
  border-left: 2px solid var(--accent-gold);
  padding-left: 16px;
  font-style: italic;
}

.scenery-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.scenery-tag {
  padding: 4px 14px;
  background: rgba(122,158,126,0.1);
  border: 1px solid rgba(122,158,126,0.2);
  border-radius: 16px;
  font-size: 0.85rem;
  color: var(--bamboo-green);
}

/* 入蜀风物志 */
.fengwu-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fengwu-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: rgba(196,163,90,0.04);
  border: 1px solid rgba(196,163,90,0.12);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: background 0.25s, border-color 0.25s;
}

.fengwu-card:hover {
  background: rgba(196,163,90,0.08);
  border-color: rgba(196,163,90,0.25);
}

.fengwu-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 2px;
}

.fengwu-body {
  flex: 1;
  min-width: 0;
}

.fengwu-title {
  font-family: var(--font-title);
  font-size: 0.9rem;
  color: var(--ink);
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.fengwu-text {
  font-size: 0.82rem;
  color: var(--ink-light);
  line-height: 1.75;
}

.poem-card {
  background: linear-gradient(135deg, rgba(196,163,90,0.05), rgba(245,240,230,0.8));
  border: 1px solid rgba(196,163,90,0.15);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

.poem-title-author {
  font-family: var(--font-title);
  font-size: 1.2rem;
  color: var(--ink);
  margin-bottom: 16px;
}

.poem-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.poem-line {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  line-height: 1.8;
  letter-spacing: 1px;
}

.poem-source {
  font-size: 0.8rem;
  color: var(--ink-faint);
  font-style: italic;
}

/* 古今对照 */
.am-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.am-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.am-label {
  min-width: 60px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  text-align: center;
  flex-shrink: 0;
}

.am-ancient .am-label {
  background: rgba(91,143,168,0.1);
  color: var(--accent-blue);
}

.am-modern .am-label {
  background: rgba(196,163,90,0.1);
  color: var(--accent-gold);
}

.am-liuxiaoliu .am-label {
  background: rgba(184,84,80,0.1);
  color: var(--accent-red);
}

.am-text {
  font-size: 0.88rem;
  color: var(--ink-light);
  line-height: 1.7;
}

.am-liuxiaoliu .am-text {
  font-style: italic;
  color: var(--accent-red);
  opacity: 0.9;
}

/* ==================== 站点氛围背景 ==================== */
#view-station {
  min-height: calc(100vh - 56px);
  transition: background 0.8s ease;
  position: relative;
  z-index: 0;
}

#view-station.theme-shanyin {
  background: linear-gradient(180deg, #F2F0E8 0%, #E8E5D8 30%, #F5F0E6 100%);
}
#view-station.theme-linan {
  background: linear-gradient(180deg, #F0EDE4 0%, #E8E2D5 15%, #F5F0E6 40%, #F5F0E6 100%);
}
#view-station.theme-fengqiao {
  background: linear-gradient(180deg, #2A2D3A 0%, #3A3F52 15%, #E8E5D8 40%, #F5F0E6 100%);
}
#view-station.theme-jinshan {
  background: linear-gradient(180deg, #F5E6C8 0%, #F0DFC0 15%, #F5F0E6 40%, #F5F0E6 100%);
}
#view-station.theme-huangzhou {
  background: linear-gradient(180deg, #F5E0D5 0%, #EDD5C8 15%, #F5F0E6 40%, #F5F0E6 100%);
}
#view-station.theme-jiankang {
  background: linear-gradient(180deg, #F0E8DA 0%, #E8DCCB 15%, #F5F0E6 40%, #F5F0E6 100%);
}
#view-station.theme-wushan {
  background: linear-gradient(180deg, #DDE5EE 0%, #D0DAE8 15%, #EAE6E0 40%, #F5F0E6 100%);
}
#view-station.theme-kuizhou {
  background: linear-gradient(180deg, #F0D5C5 0%, #E8C8B5 15%, #F0E0D5 40%, #F5F0E6 100%);
}
#view-station.theme-shuzhou {
  background: linear-gradient(180deg, #E8E0D0 0%, #DDD3C0 10%, #E8E2D5 30%, #F5F0E6 100%);
}

.detail-hero .detail-name {
  position: relative;
  z-index: 1;
}

/* 站点氛围装饰 */
.station-atmosphere {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 200px;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.station-atmosphere::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 0 0 50% 50%;
  opacity: 0.08;
}

.theme-shanyin .station-atmosphere::before {
  background: radial-gradient(ellipse at 50% 40%, #7A9E7E, transparent 70%);
}
.theme-linan .station-atmosphere::before {
  background: radial-gradient(ellipse at 45% 45%, #C4A35A, transparent 70%);
}
.theme-fengqiao .station-atmosphere::before {
  background: radial-gradient(ellipse at 30% 50%, #5B8FA8, transparent 70%);
}
.theme-jinshan .station-atmosphere::before {
  background: radial-gradient(ellipse at 50% 40%, #C4A35A, transparent 70%);
}
.theme-huangzhou .station-atmosphere::before {
  background: radial-gradient(ellipse at 60% 50%, #B85450, transparent 70%);
}
.theme-jiankang .station-atmosphere::before {
  background: radial-gradient(ellipse at 55% 45%, #8B7355, transparent 70%);
}
.theme-wushan .station-atmosphere::before {
  background: radial-gradient(ellipse at 40% 40%, #7EB8C9, transparent 70%);
}
.theme-kuizhou .station-atmosphere::before {
  background: radial-gradient(ellipse at 50% 50%, #C4A35A, transparent 70%);
}
.theme-shuzhou .station-atmosphere::before {
  background: radial-gradient(ellipse at 50% 45%, #7A9E7E, transparent 70%);
}

/* ==================== 角色动画 ==================== */
/* 呼吸浮动 */
@keyframes characterFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes characterFloatSlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* 开场页角色 */
.character-card .character-img {
  animation: characterFloat 3s ease-in-out infinite;
}

.linu-card .character-img {
  animation-delay: -1.5s;
}

.character-card:hover .character-img {
  animation-play-state: paused;
  transform: scale(1.05);
}

/* 站点详情页角色 */
.interaction-img-main {
  animation: characterFloat 4s ease-in-out infinite;
}

.interaction-img-cat {
  animation: characterFloatSlow 3.5s ease-in-out infinite;
  animation-delay: -1s;
}

/* 气泡头像呼吸 */
.bubble-avatar img {
  animation: characterFloatSlow 4s ease-in-out infinite;
}

/* 角色切换过渡 */
.interaction-img,
.bubble-avatar img {
  transition: transform 0.3s ease, opacity var(--dur-normal) ease;
}

.interaction-img.switching,
.bubble-avatar img.switching {
  opacity: 0;
  transform: scale(0.9) translateY(4px);
}

/* 驿站解锁 — 角色跳跃 */
.interaction-img.unlock-jump {
  animation: unlockJump 0.7s ease-out !important;
}
@keyframes unlockJump {
  0% { transform: translateY(0) scale(1); }
  20% { transform: translateY(-18px) scale(1.05); }
  40% { transform: translateY(-5px) scale(0.95); }
  60% { transform: translateY(-14px) scale(1.03); }
  80% { transform: translateY(0) scale(0.97); }
  100% { transform: translateY(0) scale(1); }
}

/* 答对诗题 — 角色点头 */
.interaction-img.quiz-nod {
  animation: nodHead 0.6s ease-in-out !important;
}
.bubble-avatar.quiz-nod img {
  animation: nodHead 0.6s ease-in-out !important;
  animation-delay: 0.1s;
}
@keyframes nodHead {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(4deg); }
  60% { transform: rotate(-3deg); }
  80% { transform: rotate(2deg); }
}

/* 狸奴跳跃（独立微动效） */
.interaction-img-cat.cat-hop {
  animation: catHop 0.5s ease-out !important;
}
@keyframes catHop {
  0% { transform: translateY(0) rotate(0deg); }
  30% { transform: translateY(-24px) rotate(-8deg); }
  60% { transform: translateY(-8px) rotate(5deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

/* ==================== 角色互动区 ==================== */
.character-interaction {
  background: linear-gradient(180deg, rgba(255,255,255,0.4), rgba(245,240,230,0.6)) !important;
  border: 1px solid rgba(196,163,90,0.1) !important;
}

.interaction-characters {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 16px;
}

.interaction-img {
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(44,44,44,0.08));
  transition: transform 0.3s;
}

.interaction-img:hover {
  transform: scale(1.08) translateY(-4px);
}

.interaction-img-main {
  height: 120px;
}

.interaction-img-cat {
  height: 90px;
}

.interaction-quote {
  font-size: 0.85rem;
  color: var(--ink-faint);
  font-style: italic;
  line-height: 1.7;
  max-width: 400px;
  margin: 0 auto;
  position: relative;
  padding: 0 8px;
}

/* 碎片收集 */
.fragments-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fragment-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(196,163,90,0.08);
  border: 1px solid rgba(196,163,90,0.15);
  border-radius: 16px;
  font-size: 0.82rem;
  color: var(--ink-light);
  cursor: pointer;
  transition: all var(--dur-normal);
}

.fragment-item.collected {
  background: rgba(196,163,90,0.15);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.fragment-item:hover {
  transform: translateY(-2px);
}

.fragment-icon {
  font-size: 0.9rem;
}

/* 碎片弹出动画 */
.fragment-collect-anim {
  position: fixed;
  pointer-events: none;
  z-index: var(--z-modal);
  font-size: 1.5rem;
  animation: fragmentFly 1s ease-out forwards;
}

@keyframes fragmentFly {
  0% { transform: scale(0) rotate(0deg); opacity: 0; }
  30% { transform: scale(1.2) rotate(15deg); opacity: 1; }
  70% { transform: scale(1) rotate(-5deg); opacity: 1; }
  100% { transform: scale(0.8) translateY(-40px); opacity: 0; }
}

/* ==================== 诗词挑战 ==================== */
.quiz-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 20px 100px;
}

.quiz-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.quiz-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--parchment-dark);
  border-radius: 3px;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-gold));
  border-radius: 3px;
  transition: width 0.5s ease-out;
}

.quiz-progress-text {
  font-size: 0.8rem;
  color: var(--ink-faint);
  min-width: 50px;
  text-align: right;
}

.quiz-card {
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(44,44,44,0.06);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.quiz-poem-info {
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin-bottom: 16px;
}

.quiz-question {
  font-family: var(--font-body);
  font-size: 1.2rem;
  color: var(--ink);
  line-height: 2;
  margin-bottom: 20px;
  letter-spacing: 1px;
}

.quiz-question .blank {
  display: inline-block;
  min-width: 120px;
  border-bottom: 2px dashed var(--accent-gold);
  color: var(--accent-gold);
  font-weight: 500;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.quiz-option {
  padding: 12px 18px;
  background: rgba(245,240,230,0.6);
  border: 1px solid rgba(44,44,44,0.08);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  cursor: pointer;
  transition: all var(--dur-normal);
  text-align: left;
}

.quiz-option:hover {
  background: rgba(91,143,168,0.08);
  border-color: var(--accent-blue);
}

.quiz-option.correct {
  background: rgba(122,158,126,0.15);
  border-color: var(--bamboo-green);
  color: var(--bamboo-green);
}
.quiz-option.correct::after { content: ' ✓'; }

.quiz-option.wrong {
  background: rgba(184,84,80,0.08);
  border-color: var(--accent-red);
  color: var(--accent-red);
}
.quiz-option.wrong::after { content: ' ✗'; }

.quiz-option.disabled {
  pointer-events: none;
  opacity: 0.6;
}

.quiz-hint {
  font-size: 0.85rem;
  color: var(--ink-faint);
  padding: 10px 14px;
  background: rgba(196,163,90,0.06);
  border-left: 3px solid var(--accent-gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  display: none;
}

.quiz-hint.show { display: block; }

.quiz-result {
  text-align: center;
  padding: 40px 20px;
}

.quiz-result-score {
  font-family: var(--font-title);
  font-size: 3rem;
  color: var(--accent-gold);
  margin-bottom: 8px;
}

.quiz-result-text {
  font-size: 1.1rem;
  color: var(--ink-light);
  margin-bottom: 20px;
}

.quiz-restart-btn {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--parchment);
  background: var(--accent-blue);
  border: none;
  padding: 12px 28px;
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--dur-normal);
  min-height: 46px;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.quiz-restart-btn:hover {
  background: #4A7A8F;
  transform: translateY(-2px);
}

/* ==================== 诗集视图 ==================== */
.poetry-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 20px 100px;
}

.poetry-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.poetry-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(44,44,44,0.06);
  border-radius: var(--radius);
  padding: 20px;
  transition: all var(--dur-normal);
}
.pli-main {
  flex: 1;
  cursor: pointer;
  min-width: 0;
}

.poetry-list-item:hover {
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.poetry-list-item .poem-title-author {
  text-align: left;
  font-size: 1rem;
}

/* 诗集列表中的小号朗读按钮 */
.tts-btn-sm {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.poetry-preview {
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin-top: 8px;
  line-height: 1.6;
}

/* ==================== 诗签画廊 ==================== */
.gallery-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 16px 60px;
}

.gallery-subtitle {
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.85rem;
  margin: -8px 0 24px;
  letter-spacing: 1px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.gallery-card {
  cursor: pointer;
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: transform 0.3s var(--ease-out),
              box-shadow var(--dur-normal) ease;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(44,44,44,0.06);
  animation: galleryFadeIn 0.5s ease both;
}
.gallery-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 28px rgba(44,44,44,0.14);
}

@keyframes galleryFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.gc-visual {
  position: relative;
  aspect-ratio: 2 / 3;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.gc-accent {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 38px;
  border-radius: 2px;
  opacity: 0.25;
}

.gc-seal-mini {
  position: absolute;
  top: 18px;
  right: 18px;
  font-family: var(--font-title);
  font-size: 8px;
  line-height: 1.3;
  color: var(--accent-red);
  opacity: 0.55;
  text-align: center;
  letter-spacing: 1px;
  writing-mode: vertical-rl;
}

.gc-station-name {
  font-family: var(--font-title);
  font-size: 1.3rem;
  color: var(--ink);
  letter-spacing: 3px;
  text-shadow: 0 1px 2px rgba(255,255,255,0.6);
}

.gc-place {
  font-size: 0.68rem;
  color: var(--ink-faint);
  margin-top: 2px;
  letter-spacing: 1px;
}

.gc-poem-line {
  font-size: 0.72rem;
  color: var(--ink-light);
  margin-top: 8px;
  line-height: 1.5;
  font-family: var(--font-title);
  letter-spacing: 1px;
  opacity: 0.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gc-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  background: rgba(245,240,230,0.9);
}

.gc-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-gold);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
}

.gc-action {
  font-size: 0.72rem;
  color: var(--ink-faint);
  letter-spacing: 1px;
}

.gallery-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-faint);
  font-size: 0.95rem;
  line-height: 1.8;
}
.gallery-empty-hint {
  font-size: 0.8rem;
  color: var(--accent-gold);
  margin-top: 4px;
}

/* 移动端 2 列 */
@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .gc-station-name { font-size: 1.1rem; letter-spacing: 2px; }
  .gc-poem-line { font-size: 0.68rem; }
}

/* ==================== 成就视图 ==================== */
.achievements-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 20px 100px;
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.achievement-card {
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(44,44,44,0.06);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  transition: all var(--dur-normal);
}

.achievement-card.locked {
  opacity: 0.4;
  filter: grayscale(1);
}

.achievement-card.unlocked {
  background: rgba(196,163,90,0.08);
  border-color: rgba(196,163,90,0.2);
}

.achievement-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.achievement-name {
  font-family: var(--font-title);
  font-size: 1rem;
  color: var(--ink);
  margin-bottom: 4px;
}

.achievement-desc {
  font-size: 0.75rem;
  color: var(--ink-faint);
  line-height: 1.4;
}

/* ==================== 背景音乐按钮 ==================== */
.bgm-toggle {
  position: fixed;
  top: calc(60px + var(--safe-top));
  right: 10px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(44,44,44,0.08);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 6px rgba(44,44,44,0.06);
  transition: all var(--dur-normal);
  padding: 0;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
.bgm-toggle:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}

.bgm-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 10px rgba(44,44,44,0.12);
}

.bgm-icon {
  font-size: 0.8rem;
  line-height: 1;
}

/* 环境音开关 — 在 BGM 按钮下方 */
.ambient-toggle {
  position: fixed;
  top: calc(108px + var(--safe-top));
  right: 10px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(44,44,44,0.08);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 6px rgba(44,44,44,0.06);
  transition: all var(--dur-normal);
  padding: 0;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
.ambient-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 10px rgba(44,44,44,0.12);
}
.ambient-icon {
  font-size: 0.85rem;
  line-height: 1;
}

/* ==================== 通知 Toast ==================== */
.toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(44,44,44,0.9);
  color: var(--parchment);
  padding: 10px 24px;
  border-radius: 20px;
  font-size: 0.85rem;
  z-index: var(--z-toast);
  opacity: 0;
  transition: all var(--dur-slow);
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==================== 响应式 ==================== */
@media (max-width: 640px) {
  .title { font-size: 2rem; letter-spacing: 5px; }
  .subtitle { font-size: 0.95rem; letter-spacing: 2px; }
  .description { font-size: 0.82rem; line-height: 2; }
  .description br { display: none; }
  .character-img { width: 90px; height: 90px; }
  .character-card { width: 110px; }
  .characters-preview { gap: 24px; }
  .route-timeline { margin-bottom: 24px; }
  .timeline-track { padding-left: 24px; }
  .timeline-track::before { left: 7px; }
  .tl-dot { left: -24px; top: 12px; width: 11px; height: 11px; min-width: 11px; }
  .tl-card { padding: 10px 12px; }
  .tl-name { font-size: 0.95rem; }
  .tl-meta { font-size: 0.68rem; }
  .tl-desc { font-size: 0.73rem; }
  .tl-item { margin-bottom: 6px; gap: 12px; min-height: 48px; }
  .tl-badge { font-size: 0.55rem; padding: 1px 6px; }
  .route-info { font-size: 0.65rem; }

  .station-card {
    padding: 14px 16px;
    gap: 12px;
    min-height: 60px;
    /* 更大的触摸区域 */
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
  }
  .station-name { font-size: 1.1rem; }
  .station-meta { font-size: 0.75rem; gap: 8px; }

  .detail-hero { padding: 20px 0 16px; }
  .detail-name { font-size: 1.8rem; }
  .detail-modern { font-size: 0.85rem; }
  .detail-mood { font-size: 0.78rem; padding: 2px 12px; }
  .detail-desc { font-size: 0.9rem; line-height: 1.8; }
  .detail-moodtext { font-size: 1.05rem; line-height: 1.9; }
  .detail-section { padding: 16px; margin-bottom: 12px; }

  .section-title { font-size: 1.5rem; margin: 16px 0 16px; }

  .diary-text { font-size: 0.85rem; line-height: 1.9; }

  .poem-card { padding: 18px 16px; }
  .poem-lines { gap: 2px; }
  .poem-line { font-size: 0.95rem; }

  .quiz-question { font-size: 1.05rem; }
  .quiz-option {
    padding: 14px 16px;
    font-size: 0.95rem;
    min-height: 48px;
    display: flex;
    align-items: center;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
  }

  .character-bubble {
    width: calc(100% - 24px);
    padding: 8px 16px 8px 10px;
    bottom: calc(12px + var(--safe-bottom));
  }

  .am-row { flex-direction: column; gap: 4px; }
  .am-label { min-width: auto; display: inline-block; }
  .am-text { font-size: 0.85rem; }

  .achievements-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .achievement-card { padding: 14px 12px; }
  .achievement-icon { font-size: 1.6rem; }

  .scenery-tag { padding: 4px 12px; font-size: 0.8rem; }
  .fengwu-card { padding: 14px 14px; gap: 10px; }
  .fengwu-icon { font-size: 1.3rem; }
  .fengwu-title { font-size: 0.82rem; }
  .fengwu-text { font-size: 0.76rem; line-height: 1.7; }

  .fragment-item {
    padding: 6px 12px;
    font-size: 0.78rem;
    -webkit-user-select: none;
    user-select: none;
  }

  .interaction-img-main { height: 100px; }
  .interaction-img-cat { height: 75px; }

  /* Toast 适配刘海屏 */
  .toast {
    top: calc(70px + var(--safe-top));
    left: 16px;
    right: 16px;
    transform: none;
    text-align: center;
  }
  .toast.show {
    transform: none;
  }

  .start-btn {
    padding: 14px 40px;
    font-size: 1.1rem;
    letter-spacing: 5px;
    min-height: 50px;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
  }

  .back-btn { margin-top: 8px; }
  .station-fog { background: radial-gradient(ellipse 55% 35% at 20% 30%, rgba(200,212,225,0.22) 0%, transparent 60%), radial-gradient(ellipse 50% 35% at 70% 55%, rgba(190,205,218,0.18) 0%, transparent 58%); }
  .interaction-img-main.unlock-jump { animation: unlockJump 0.6s ease-out !important; }
  .interaction-img-cat.cat-hop { animation: catHop 0.45s ease-out !important; }
}

/* 超小屏（iPhone SE 等） */
@media (max-width: 375px) {
  .title { font-size: 1.7rem; letter-spacing: 3px; }
  .character-img { width: 80px; height: 80px; }
  .character-card { width: 95px; }
  .route-timeline { margin-bottom: 20px; }
  .tl-card { padding: 8px 10px; }
  .tl-name { font-size: 0.9rem; }
  .tl-desc { font-size: 0.7rem; }
  .detail-name { font-size: 1.6rem; }
  .poem-line { font-size: 0.9rem; }
}

/* ==================== 终页 ==================== */
#view-finale {
  min-height: calc(100vh - 56px);
  background: linear-gradient(180deg, #F5F0E6 0%, #EDE5D8 30%, #E8DFD0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.finale-container {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 24px;
  text-align: center;
}

.finale-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.finale-particle {
  position: absolute;
  font-size: 1.2rem;
  opacity: 0;
  animation: finaleSparkle 4s ease-in-out infinite;
}

.fp1 { left: 10%; top: 15%; animation-delay: 0s; }
.fp2 { left: 80%; top: 10%; animation-delay: -0.7s; }
.fp3 { left: 65%; top: 35%; animation-delay: -1.4s; }
.fp4 { left: 15%; top: 55%; animation-delay: -2.1s; }
.fp5 { left: 85%; top: 65%; animation-delay: -2.8s; }
.fp6 { left: 40%; top: 80%; animation-delay: -3.5s; }

@keyframes finaleSparkle {
  0%, 100% { opacity: 0; transform: scale(0.5) translateY(0); }
  50% { opacity: 0.8; transform: scale(1.2) translateY(-10px); }
}

.finale-content {
  position: relative;
  z-index: 1;
  animation: fadeInUp 1s ease-out;
}

.finale-seal {
  width: 44px;
  height: 72px;
  border: 2.5px solid var(--accent-red);
  font-size: 0.92rem;
  padding: 6px 5px;
  margin-bottom: 20px;
  letter-spacing: 2px;
  opacity: 0.78;
  box-shadow:
    inset 0 0 0 3px transparent,
    inset 0 0 0 4px rgba(184, 84, 80, 0.12);
}
.finale-seal::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(184, 84, 80, 0.35);
  pointer-events: none;
}

.finale-title {
  font-family: var(--font-title);
  font-size: 2.4rem;
  color: var(--ink);
  letter-spacing: 6px;
  margin-bottom: 8px;
}

.finale-subtitle {
  font-size: 0.9rem;
  color: var(--ink-faint);
  margin-bottom: 28px;
}

.finale-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
}

.finale-rank-icon {
  font-size: 2.2rem;
}

.finale-rank-name {
  font-family: var(--font-title);
  font-size: 1.3rem;
  letter-spacing: 4px;
}

.finale-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(44,44,44,0.06);
  border-radius: var(--radius);
  margin-bottom: 28px;
}

.finale-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.finale-stat-num {
  font-family: var(--font-title);
  font-size: 1.6rem;
  color: var(--accent-gold);
}

.finale-stat-label {
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin-top: 2px;
}

.finale-stat-divider {
  width: 1px;
  height: 36px;
  background: rgba(44,44,44,0.1);
}

.finale-achievements {
  margin-bottom: 28px;
}

.finale-section-label {
  font-family: var(--font-title);
  font-size: 0.95rem;
  color: var(--ink-light);
  margin-bottom: 12px;
}

.finale-achievement-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.finale-achievement-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(196,163,90,0.1);
  border: 1px solid rgba(196,163,90,0.2);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--ink-light);
}

.finale-achievement-icon {
  font-size: 1rem;
}

.finale-quote {
  padding: 20px;
  margin-bottom: 24px;
  position: relative;
}

.finale-quote-text {
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--ink);
  line-height: 2;
  letter-spacing: 1px;
  font-style: italic;
}

.finale-quote-author {
  font-size: 0.8rem;
  color: var(--ink-faint);
  margin-top: 8px;
}

.finale-characters {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 8px;
}

.finale-char-img {
  height: 100px;
  object-fit: contain;
  animation: characterFloat 3s ease-in-out infinite;
}

.finale-char-img-cat {
  height: 75px;
  animation: characterFloatSlow 3.5s ease-in-out infinite;
  animation-delay: -1s;
}

.finale-characters-text {
  font-size: 0.82rem;
  color: var(--ink-faint);
  margin-bottom: 28px;
}

.finale-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.finale-btn {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--parchment);
  background: var(--ink);
  border: none;
  padding: 11px 28px;
  border-radius: 24px;
  cursor: pointer;
  transition: all var(--dur-normal);
  letter-spacing: 1px;
}

.finale-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(44,44,44,0.2);
}

.finale-btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}

.finale-btn-outline:hover {
  background: var(--ink);
  color: var(--parchment);
}

@media (max-width: 640px) {
  .finale-title { font-size: 1.9rem; }
  .finale-stats { gap: 14px; padding: 16px; }
  .finale-stat-num { font-size: 1.3rem; }
  .finale-char-img { height: 80px; }
  .finale-char-img-cat { height: 60px; }
  .finale-actions { flex-direction: column; align-items: center; }
  .finale-btn {
    width: 220px;
    text-align: center;
    min-height: 46px;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
  }
}

/* ==================== 页面切换动画 ==================== */
.screen-enter {
  animation: screenEnter 0.5s ease-out;
}

@keyframes screenEnter {
  from { opacity: 0; }
  to { opacity: 1; }
}

.view-enter {
  animation: viewSlideIn 0.4s ease-out;
}

@keyframes viewSlideIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ==================== 移动端触摸优化 ==================== */
.station-card,
.start-btn,
.finale-btn,
.quiz-option,
.fragment-item,
.poetry-list-item {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

/* 触摸时的即时反馈（替代 hover） */
@media (hover: none) and (pointer: coarse) {
  .station-card:active {
    transform: translateX(4px) scale(0.98);
    background: rgba(255,255,255,0.9);
    transition: none;
  }
  .start-btn:active {
    transform: scale(0.96);
    transition: none;
  }
  .quiz-option:active {
    transform: scale(0.98);
    transition: none;
  }
  .nav-btn:active {
    background: rgba(44,44,44,0.08);
    transform: scale(0.92);
    transition: none;
  }
  .finale-btn:active {
    transform: scale(0.96);
    transition: none;
  }
  .fragment-item:active {
    transform: scale(0.96);
    transition: none;
  }
  .poetry-list-item:active {
    transform: scale(0.98);
    transition: none;
  }
  .back-btn:active {
    background: var(--ink);
    color: var(--parchment);
    border-color: var(--ink);
    transition: none;
  }
  .bgm-toggle:active {
    transform: scale(0.9);
    transition: none;
  }
}

/* 横屏提示 */
@media (max-height: 500px) and (orientation: landscape) {
  .opening-content {
    padding: 16px 24px;
  }
  .title { font-size: 1.5rem; }
  .characters-preview { margin-bottom: 16px; }
  .start-btn { padding: 10px 32px; font-size: 1rem; }
}


/* ==================== 重置进度按钮 ==================== */
.reset-btn {
  display: block;
  margin: 32px auto 100px;
  padding: 10px 24px;
  background: none;
  border: 1px solid var(--ink-faint);
  color: var(--ink-faint);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--dur-normal);
}
.reset-btn:hover {
  border-color: var(--accent-red);
  color: var(--accent-red);
}
.reset-btn-confirm {
  border-color: var(--accent-red) !important;
  color: #fff !important;
  background: var(--accent-red) !important;
  animation: pulse 0.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}


/* ==================== 分享卡片 ==================== */
.finale-btn-share {
  background: linear-gradient(135deg, var(--accent-gold), #D4B36A);
  color: #fff;
}
.finale-btn-share:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(196,163,90,0.35);
}

#share-card {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.6);
  pointer-events: none;
}
.share-card-inner {
  width: 360px;
  margin: 60px auto;
  padding: 32px 28px;
  background: var(--parchment);
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,0.15);
  border: 2px solid var(--accent-gold);
  position: relative;
  overflow: hidden;
}
/* 成就卡片风景插画底层 */
.share-card-scenery {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
  opacity: 0.28;
  z-index: 0;
  pointer-events: none;
}
/* 成就卡片插画遮罩层 */
.share-card-scenery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    180deg,
    rgba(245, 240, 230, 0.55) 0%,
    rgba(245, 240, 230, 0.35) 25%,
    rgba(245, 240, 230, 0.50) 55%,
    rgba(245, 240, 230, 0.88) 100%
  );
  z-index: 1;
  pointer-events: none;
}
.share-card-header {
  margin-bottom: 20px;
  position: relative;
  z-index: 2;
}
.share-card-seal {
  width: 42px;
  height: 56px;
  border: 2.5px solid var(--accent-red);
  font-size: 0.85rem;
  padding: 6px 4px;
  letter-spacing: 2px;
  margin-bottom: 12px;
  opacity: 0.78;
  box-shadow:
    inset 0 0 0 3px transparent,
    inset 0 0 0 4px rgba(184, 84, 80, 0.12);
}
.share-card-seal::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(184, 84, 80, 0.35);
  pointer-events: none;
}
.share-card-title {
  font-family: var(--font-title);
  font-size: 1.8rem;
  color: var(--ink);
  margin-bottom: 4px;
  letter-spacing: 3px;
}
.share-card-subtitle {
  font-size: 0.8rem;
  color: var(--ink-faint);
}
.share-card-rank {
  font-family: var(--font-title);
  font-size: 1.6rem;
  margin-bottom: 20px;
  letter-spacing: 2px;
  position: relative;
  z-index: 2;
}
.share-card-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 20px;
  position: relative;
  z-index: 2;
}
.share-card-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.share-stat-num {
  font-family: var(--font-title);
  font-size: 1.5rem;
  color: var(--accent-gold);
}
.share-stat-label {
  font-size: 0.7rem;
  color: var(--ink-faint);
  margin-top: 2px;
}
.share-card-achievements {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
  position: relative;
  z-index: 2;
}
.share-achievement-badge {
  font-size: 1.4rem;
}
.share-card-quote {
  font-size: 0.82rem;
  color: var(--ink-light);
  font-style: italic;
  border-top: 1px solid var(--parchment-dark);
  padding-top: 16px;
  position: relative;
  z-index: 2;
  line-height: 1.6;
}

@media (max-width: 640px) {
  .share-card-inner {
    width: calc(100vw - 48px);
    padding: 24px 20px;
  }
  .share-card-title { font-size: 1.4rem; }
  .share-card-rank { font-size: 1.3rem; }
  .share-stat-num { font-size: 1.2rem; }
}

/* ==================== 日签诗歌卡片 ==================== */

/* 模态遮罩 */
.dc-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(20, 18, 15, 0.82);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: dcFadeIn 0.35s ease-out;
  -webkit-user-select: none;
  user-select: none;
}
@keyframes dcFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 卡片容器 */
.dc-card {
  width: 360px;
  height: 540px;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(196, 163, 90, 0.18);
  animation: dcCardIn 0.4s var(--ease-out);
}
@keyframes dcCardIn {
  from { opacity: 0; transform: scale(0.92) translateY(16px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 卡片内层 */
.dc-inner {
  width: 100%;
  height: 100%;
  padding: 36px 30px 26px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* 绢本质感 — 丝纹纹理叠加 */
.dc-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='s' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.55 0.7' numOctaves='4' stitchTiles='stitch' result='noise'/%3E%3CfeColorMatrix type='saturate' values='0' in='noise' result='gray'/%3E%3CfeComponentTransfer in='gray' result='soft'%3E%3CfeFuncA type='linear' slope='0.06'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23s)'/%3E%3C/svg%3E");
  background-size: 300px 300px;
  background-repeat: repeat;
  mix-blend-mode: multiply;
  opacity: 0.7;
}

/* 风景插画背景 */
.dc-scenery {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
  opacity: 0.32;
  z-index: 0;
  pointer-events: none;
}

/* 插画遮罩层：上方透明→下方渐变，保持文字可读 */
.dc-scenery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    180deg,
    rgba(245, 240, 230, 0.5) 0%,
    rgba(245, 240, 230, 0.3) 30%,
    rgba(245, 240, 230, 0.55) 60%,
    rgba(245, 240, 230, 0.85) 100%
  );
  z-index: 1;
  pointer-events: none;
}

/* 印章 */
.dc-seal {
  position: absolute;
  top: 26px;
  left: 26px;
  width: 38px;
  height: 50px;
  border: 2px solid #B85450;
  color: #B85450;
  font-size: 0.78rem;
  padding: 5px 3px;
  letter-spacing: 1px;
  opacity: 0.68;
  z-index: 2;
  box-shadow:
    inset 0 0 0 2px transparent,
    inset 0 0 0 3px rgba(184, 84, 80, 0.1);
}
.dc-seal::before {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(184, 84, 80, 0.3);
  pointer-events: none;
}

/* 驿站名 */
.dc-station-name {
  font-family: 'Ma Shan Zheng', 'STKaiti', 'KaiTi', serif;
  font-size: 2.6rem;
  color: #2C2C2C;
  letter-spacing: 10px;
  text-align: center;
  margin-top: 16px;
  line-height: 1.2;
  position: relative;
  z-index: 2;
}
.dc-modern-name {
  font-size: 0.72rem;
  color: #9A9590;
  text-align: center;
  letter-spacing: 1px;
  margin-top: 6px;
}
.dc-ancient-date {
  font-size: 0.68rem;
  color: #9A9590;
  text-align: center;
  margin-top: 2px;
  font-style: italic;
}

/* 分割线 */
.dc-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
}
.dc-divider-line {
  flex: 1;
  height: 1px;
  opacity: 0.35;
}
.dc-divider-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  opacity: 0.5;
}

/* 诗词区 */
.dc-poem-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 2;
}
.dc-poem-title {
  font-family: 'Ma Shan Zheng', 'STKaiti', 'KaiTi', serif;
  font-size: 0.92rem;
  color: #5A5A5A;
  text-align: center;
  margin-bottom: 4px;
  letter-spacing: 1px;
}
.dc-poem-author {
  font-size: 0.72rem;
  color: #9A9590;
  text-align: center;
  margin-bottom: 14px;
  letter-spacing: 3px;
}
.dc-poem-lines {
  text-align: center;
}
.dc-poem-line {
  font-family: 'Noto Serif SC', 'STSong', 'SimSun', serif;
  font-size: 1.12rem;
  color: #2C2C2C;
  line-height: 2.1;
  letter-spacing: 2px;
}

/* 底部 */
.dc-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}
.dc-characters {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}
.dc-char-img {
  height: 68px;
  width: auto;
  object-fit: contain;
}
.dc-char-cat {
  height: 50px;
}
.dc-branding {
  text-align: right;
}
.dc-today {
  font-family: 'Noto Serif SC', serif;
  font-size: 0.68rem;
  color: #9A9590;
  letter-spacing: 1px;
}
.dc-brand-name {
  font-family: 'Ma Shan Zheng', 'STKaiti', serif;
  font-size: 0.72rem;
  letter-spacing: 2px;
  margin-top: 2px;
  opacity: 0.65;
}

/* 操作按钮 */
.dc-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  animation: dcCardIn 0.5s var(--ease-out);
}
.dc-save-btn {
  flex: 1;
  padding: 12px 20px;
  background: linear-gradient(135deg, #C4A35A, #D4B36A);
  color: #fff;
  border: none;
  border-radius: 24px;
  font-family: 'Noto Serif SC', serif;
  font-size: 0.92rem;
  cursor: pointer;
  letter-spacing: 2px;
  min-height: 46px;
  touch-action: manipulation;
  transition: all var(--dur-normal);
  -webkit-user-select: none;
  user-select: none;
}
.dc-save-btn:active {
  transform: scale(0.96);
  transition: none;
}
.dc-close-btn {
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 24px;
  font-family: 'Noto Serif SC', serif;
  font-size: 0.88rem;
  cursor: pointer;
  letter-spacing: 1px;
  min-height: 46px;
  touch-action: manipulation;
  transition: all var(--dur-normal);
  -webkit-user-select: none;
  user-select: none;
}
.dc-close-btn:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.2);
  transition: none;
}

/* 驿站详情中的日签入口按钮 */
.daily-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: linear-gradient(135deg, rgba(196, 163, 90, 0.12), rgba(196, 163, 90, 0.06));
  border: 1px solid rgba(196, 163, 90, 0.25);
  border-radius: 20px;
  font-family: 'Noto Serif SC', serif;
  font-size: 0.82rem;
  color: #C4A35A;
  cursor: pointer;
  margin-top: 16px;
  transition: all var(--dur-normal);
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
.daily-card-btn:hover {
  background: linear-gradient(135deg, rgba(196, 163, 90, 0.2), rgba(196, 163, 90, 0.1));
  transform: translateY(-2px);
}
.daily-card-btn:active {
  transform: scale(0.96);
  transition: none;
}

/* 日签响应式 */
@media (max-width: 400px) {
  .dc-card {
    width: 310px;
    height: 465px;
  }
  .dc-inner {
    padding: 28px 22px 20px;
  }
  .dc-station-name {
    font-size: 2.1rem;
    letter-spacing: 6px;
  }
  .dc-poem-line {
    font-size: 0.98rem;
    line-height: 2;
  }
  .dc-char-img {
    height: 56px;
  }
  .dc-char-cat {
    height: 42px;
  }
  .dc-divider {
    margin: 14px 0;
  }
  .dc-seal {
    width: 32px;
    height: 42px;
    font-size: 0.68rem;
    top: 20px;
    left: 20px;
    padding: 4px 2px;
  }
  .dc-seal::before {
    inset: 2px;
  }
}

/* ==================== 诗签保存预览（移动端长按保存降级） ==================== */
.save-img-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.save-img-container {
  position: relative;
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.save-img-preview {
  max-width: 92vw;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  -webkit-user-select: none;
  user-select: none;
  /* 允许长按触发系统菜单 */
  -webkit-touch-callout: default;
}
.save-img-hint {
  color: rgba(255, 255, 255, 0.85);
  font-family: "Noto Serif SC", serif;
  font-size: 15px;
  letter-spacing: 0.05em;
  text-align: center;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 20px;
}
.save-img-close {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.save-img-close:active {
  background: rgba(255, 255, 255, 0.3);
}

/* ==================== ICP 备案号 ==================== */
.site-icp {
  position: fixed;
  bottom: 12px;
  left: 0;
  right: 0;
  z-index: 100;
  text-align: center;
  pointer-events: none;
}
.site-icp a {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 11px;
  color: rgba(245,240,230,0.35);
  text-decoration: none;
  pointer-events: auto;
  letter-spacing: 0.05em;
  transition: color 0.3s;
}
.site-icp a:hover {
  color: rgba(245,240,230,0.6);
}

@media (max-width: 640px) {
  .site-icp {
    bottom: 8px;
  }
  .site-icp a {
    font-size: 10px;
  }
}
