/* ========================================
   潮汕十二时辰 H5 — 叙事驱动样式表 v2
   ======================================== */

/* --- CSS 变量 --- */
:root {
  --c-primary: #C84B31;
  --c-gold: #D4A843;
  --c-gold-dark: #B48214;
  --c-bg: #FDF5E6;
  --c-bg-warm: #FAEBD7;
  --c-text: #5C3317;
  --c-text-light: #8B6914;
  --c-accent: #2A9D8F;
  --c-cream: #FFF8EE;
  --c-night: #1a1210;
  --font-title: "STKaiti", "KaiTi", "STHeiti", serif;
  --font-body: "STSong", "SimSun", "Songti SC", serif;
  --font-ui: "Microsoft YaHei", "PingFang SC", sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* --- 重置 --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 16px; -webkit-tap-highlight-color: transparent; }
body {
  font-family: var(--font-ui);
  background: var(--c-night);
  overflow: hidden;
  width: 100vw;
  height: 100vh;
}
img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ========================================
   封面页
   ======================================== */
.cover {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  transition: transform 0.8s var(--ease-in-out), opacity 0.6s ease;
}
.cover.hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.cover-bg {
  position: absolute;
  inset: 0;
}
.cover-bg img {
  object-fit: cover;
  animation: coverZoom 20s ease-in-out infinite alternate;
}
@keyframes coverZoom {
  from { transform: scale(1); }
  to { transform: scale(1.05); }
}

.cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(0,0,0,0.1) 0%,
    rgba(0,0,0,0.0) 30%,
    rgba(0,0,0,0.0) 50%,
    rgba(92,51,23,0.4) 80%,
    rgba(92,51,23,0.7) 100%
  );
}

/* 云朵 */
.cover-clouds {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.cloud {
  position: absolute;
  background: rgba(255,255,255,0.2);
  border-radius: 50px;
  animation: cloudFloat 12s ease-in-out infinite;
}
.cloud::before, .cloud::after {
  content: '';
  position: absolute;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
}
.cloud.c1 { width: 120px; height: 36px; top: 8%; left: -20px; }
.cloud.c1::before { width: 50px; height: 50px; top: -26px; left: 20px; }
.cloud.c1::after { width: 36px; height: 36px; top: -16px; left: 58px; }
.cloud.c2 { width: 90px; height: 28px; top: 15%; right: -15px; animation-delay: -4s; animation-duration: 16s; }
.cloud.c2::before { width: 38px; height: 38px; top: -20px; left: 16px; }
.cloud.c2::after { width: 26px; height: 26px; top: -10px; left: 42px; }
.cloud.c3 { width: 100px; height: 30px; top: 25%; left: 10%; animation-delay: -7s; animation-duration: 14s; }
.cloud.c3::before { width: 42px; height: 42px; top: -22px; left: 18px; }
.cloud.c3::after { width: 30px; height: 30px; top: -12px; left: 50px; }
@keyframes cloudFloat {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(30px); }
}

/* 封面内容 */
.cover-content {
  position: absolute;
  bottom: 18%;
  left: 0; right: 0;
  z-index: 10;
  text-align: center;
  padding: 0 32px;
}
.cover-title {
  font-family: var(--font-title);
  font-size: 42px;
  font-weight: 900;
  color: #FFF;
  text-shadow: 2px 2px 0 var(--c-gold-dark), 0 0 30px rgba(212,168,67,0.3);
  letter-spacing: 10px;
  margin-bottom: 12px;
  animation: titleIn 1s var(--ease-out) both;
}
.cover-subtitle {
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  letter-spacing: 3px;
  margin-bottom: 24px;
  animation: titleIn 1s var(--ease-out) 0.2s both;
}
.cover-divider {
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--c-gold), transparent);
  margin: 0 auto 28px;
  animation: titleIn 1s var(--ease-out) 0.4s both;
}
@keyframes titleIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.cover-bottom-fade {
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  height: 60px;
  background: linear-gradient(0deg, rgba(92,51,23,0.5), transparent);
  pointer-events: none;
}

/* 按钮 */
.btn-start, .btn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 2px solid var(--c-gold-dark);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255,248,238,0.95), rgba(250,235,215,0.95));
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.3s;
  font-family: var(--font-ui);
  backdrop-filter: blur(4px);
}
.btn-start {
  padding: 14px 36px;
  box-shadow: 0 4px 24px rgba(180,130,20,0.3);
  animation: titleIn 1s var(--ease-out) 0.6s both, btnPulse 3s ease-in-out infinite 1.6s;
}
.btn-start:active { transform: scale(0.95); }
.btn-back { padding: 10px 24px; margin: 0 auto; }
.btn-back:active { transform: scale(0.95); }

.btn-diamond {
  width: 10px; height: 10px;
  background: var(--c-gold);
  transform: rotate(45deg);
  position: relative;
  flex-shrink: 0;
}
.btn-diamond::after {
  content: '';
  position: absolute;
  inset: 2px;
  background: var(--c-cream);
}
.btn-text {
  font-size: 18px;
  font-weight: bold;
  color: var(--c-text);
  letter-spacing: 4px;
}
.btn-back .btn-text { font-size: 15px; letter-spacing: 3px; }

@keyframes btnPulse {
  0%, 100% { box-shadow: 0 4px 24px rgba(180,130,20,0.3); }
  50% { box-shadow: 0 4px 36px rgba(180,130,20,0.5), 0 0 50px rgba(212,168,67,0.15); }
}

/* ========================================
   主滚动页面
   ======================================== */
.main-page {
  position: fixed;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--c-bg);
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.main-page.visible { opacity: 1; }
.main-page::-webkit-scrollbar { display: none; }

/* 进度条 */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-gold));
  z-index: 150;
  transition: width 0.2s ease;
  border-radius: 0 2px 2px 0;
}

/* 右侧导航 */
.scene-nav {
  position: fixed;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 140;
  display: flex;
  flex-direction: column;
  gap: 14px;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.scene-nav.visible { opacity: 1; }

.nav-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(180,130,20,0.25);
  border: 1.5px solid var(--c-gold-dark);
  cursor: pointer;
  position: relative;
  transition: all 0.3s var(--ease-out);
}
.nav-dot.active {
  background: var(--c-gold);
  transform: scale(1.5);
}
.nav-label {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--c-text);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  background: rgba(253,245,230,0.95);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-title);
}
.nav-dot:hover .nav-label { opacity: 1; }

/* ========================================
   序章
   ======================================== */
.prologue {
  padding: 92px 28px 40px;
  display: flex;
  justify-content: center;
}
.prologue-text {
  max-width: 340px;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 2;
  color: var(--c-text);
}
.prologue-text p { margin-bottom: 12px; }
.prologue-quote {
  font-family: var(--font-title);
  color: var(--c-primary);
  font-size: 16px;
  padding-left: 16px;
  border-left: 3px solid var(--c-gold);
  margin: 16px 0 !important;
}

/* ========================================
   场景通用
   ======================================== */
.scene {
  position: relative;
  padding: 20px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

/* 时间标签 */
.scene-time-badge {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 0 4px;
}
.time-hour {
  font-family: var(--font-title);
  font-size: 26px;
  font-weight: bold;
  color: var(--c-primary);
}
.time-clock {
  font-size: 13px;
  color: var(--c-text-light);
  letter-spacing: 2px;
}

/* 插画区域 */
.scene-illustration {
  position: relative;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 4/3;
  box-shadow: 0 8px 32px rgba(92,51,23,0.12);
}
.scene-illustration img {
  border-radius: 16px;
  transition: transform 6s ease;
}
.scene-illustration.in-view img {
  transform: scale(1.05);
}

.ill-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* 故事叙述区 */
.scene-narrative {
  padding: 0 4px;
}
.scene-title {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: bold;
  color: var(--c-text);
  letter-spacing: 4px;
  margin-bottom: 16px;
  position: relative;
  display: inline-block;
}
.scene-title::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--c-gold);
}

.narrative-body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 2;
  color: var(--c-text);
}
.narrative-body p { margin-bottom: 10px; }

.narrative-quote {
  font-family: var(--font-title);
  color: var(--c-primary) !important;
  font-size: 16px !important;
  padding: 12px 16px;
  border-left: 3px solid var(--c-gold);
  background: rgba(253,245,230,0.6);
  border-radius: 0 8px 8px 0;
  margin: 16px 0 !important;
}
.narrative-emotion {
  font-family: var(--font-title);
  color: var(--c-accent) !important;
  font-size: 15px !important;
  font-style: italic;
  text-align: center;
  padding: 12px 0;
  margin: 16px 0 !important;
}

.letter-text {
  font-family: var(--font-body) !important;
  font-style: italic;
  color: var(--c-text) !important;
  background: linear-gradient(135deg, rgba(253,245,230,0.8), rgba(245,222,179,0.6));
  border-left-color: var(--c-primary) !important;
}

/* 潮语卡片 */
.dialect-card {
  background: linear-gradient(135deg, var(--c-cream), var(--c-bg-warm));
  border: 1.5px solid var(--c-gold);
  border-radius: 14px;
  padding: 16px 20px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.3s;
  text-align: center;
  margin: 0 4px;
}
.dialect-card:active { transform: scale(0.97); }
.dialect-word {
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: bold;
  color: var(--c-primary);
  margin-bottom: 4px;
}
.dialect-mean {
  font-size: 13px;
  color: var(--c-text-light);
  margin-bottom: 8px;
}
.dialect-hint {
  font-size: 11px;
  color: var(--c-gold-dark);
  letter-spacing: 1px;
}

/* ========================================
   场景间过渡
   ======================================== */
.scene-transition {
  position: relative;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-height: 120px;
}
.transition-path {
  width: 40px;
  height: 80px;
  opacity: 0.4;
}
.transition-path svg {
  width: 100%;
  height: 100%;
}
.transition-text {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--c-text-light);
  text-align: center;
  max-width: 280px;
  line-height: 1.8;
  font-style: italic;
}

/* ========================================
   CSS 动画：蒸汽
   ======================================== */
.steam-group {
  position: absolute;
  bottom: 30%;
  left: 35%;
}
.steam {
  position: absolute;
  width: 6px;
  background: rgba(255,255,255,0.5);
  border-radius: 50%;
  animation: steamRise 2.5s ease-in-out infinite;
}
.steam.s1 { height: 14px; left: 0; animation-delay: 0s; }
.steam.s2 { height: 18px; left: 10px; animation-delay: 0.6s; }
.steam.s3 { height: 12px; left: 20px; animation-delay: 1.2s; }
@keyframes steamRise {
  0% { opacity: 0.6; transform: translateY(0) scaleX(1); }
  50% { opacity: 0.3; transform: translateY(-16px) scaleX(1.5); }
  100% { opacity: 0; transform: translateY(-32px) scaleX(2); }
}

/* CSS 动画：闪点（嵌瓷光泽） */
.sparkle {
  position: absolute;
  width: 4px; height: 4px;
  background: var(--c-gold);
  border-radius: 50%;
  animation: sparkle 2s ease-in-out infinite;
}
.sparkle.sp1 { top: 20%; left: 40%; animation-delay: 0s; }
.sparkle.sp2 { top: 30%; left: 55%; animation-delay: 0.7s; }
.sparkle.sp3 { top: 25%; left: 48%; animation-delay: 1.4s; }
@keyframes sparkle {
  0%, 100% { opacity: 0; transform: scale(0); }
  50% { opacity: 1; transform: scale(2); }
}

/* CSS 动画：香烟 */
.smoke-group {
  position: absolute;
  bottom: 40%;
  left: 45%;
}
.smoke {
  position: absolute;
  width: 4px;
  background: rgba(180,180,180,0.4);
  border-radius: 50%;
  animation: smokeRise 3.5s ease-in-out infinite;
}
.smoke.sm1 { height: 20px; left: 0; animation-delay: 0s; }
.smoke.sm2 { height: 26px; left: 8px; animation-delay: 1s; }
.smoke.sm3 { height: 16px; left: 16px; animation-delay: 2s; }
@keyframes smokeRise {
  0% { opacity: 0.4; transform: translateY(0) translateX(0) scaleX(1); }
  33% { opacity: 0.25; transform: translateY(-18px) translateX(4px) scaleX(1.3); }
  66% { opacity: 0.1; transform: translateY(-36px) translateX(-3px) scaleX(1.6); }
  100% { opacity: 0; transform: translateY(-54px) translateX(6px) scaleX(2); }
}

/* CSS 动画：鼓点脉冲 */
.drum-beat {
  position: absolute;
  bottom: 20%;
  left: 20%;
  width: 30px; height: 30px;
  border: 2px solid rgba(200,75,49,0.3);
  border-radius: 50%;
  animation: drumPulse 1.2s ease-out infinite;
}
@keyframes drumPulse {
  0% { transform: scale(0.5); opacity: 0.8; }
  100% { transform: scale(3); opacity: 0; }
}

/* CSS 动画：萤火虫 */
.firefly {
  position: absolute;
  width: 4px; height: 4px;
  background: #FFD700;
  border-radius: 50%;
  box-shadow: 0 0 6px #FFD700, 0 0 12px rgba(255,215,0,0.3);
  animation: fireflyFloat 6s ease-in-out infinite;
}
.firefly.ff1 { top: 15%; left: 20%; animation-delay: 0s; animation-duration: 5s; }
.firefly.ff2 { top: 30%; left: 70%; animation-delay: 1.5s; animation-duration: 7s; }
.firefly.ff3 { top: 50%; left: 30%; animation-delay: 3s; animation-duration: 6s; }
.firefly.ff4 { top: 20%; left: 55%; animation-delay: 4s; animation-duration: 8s; }
.firefly.ff5 { top: 60%; left: 80%; animation-delay: 2s; animation-duration: 5.5s; }
@keyframes fireflyFloat {
  0%, 100% { opacity: 0; transform: translate(0, 0); }
  25% { opacity: 1; transform: translate(8px, -12px); }
  50% { opacity: 0.6; transform: translate(-6px, -8px); }
  75% { opacity: 1; transform: translate(10px, 4px); }
}

/* 月光 */
.moon-glow {
  position: absolute;
  top: 10%;
  right: 15%;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,248,238,0.3), transparent 70%);
  animation: moonPulse 4s ease-in-out infinite;
}
@keyframes moonPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(255,248,238,0.2); transform: scale(1); }
  50% { box-shadow: 0 0 40px rgba(255,248,238,0.4); transform: scale(1.1); }
}

/* ========================================
   夜晚场景特殊
   ======================================== */
.scene-night {
  background: linear-gradient(180deg, var(--c-bg) 0%, #2C1810 30%, #1a1210 100%);
}
.scene-night .time-hour { color: var(--c-gold); }
.scene-night .time-clock { color: rgba(212,168,67,0.7); }
.scene-night .scene-title { color: var(--c-cream); }
.scene-night .scene-title::after { background: rgba(212,168,67,0.5); }
.scene-night .narrative-body { color: rgba(253,245,230,0.85); }
.scene-night .narrative-quote {
  color: var(--c-gold) !important;
  background: rgba(255,248,238,0.08);
  border-left-color: rgba(212,168,67,0.5);
}
.scene-night .narrative-emotion { color: rgba(212,168,67,0.8) !important; }
.scene-night .dialect-card {
  background: linear-gradient(135deg, rgba(44,24,16,0.9), rgba(60,35,23,0.9));
  border-color: rgba(212,168,67,0.4);
}
.scene-night .dialect-word { color: var(--c-gold); }
.scene-night .dialect-mean { color: rgba(212,168,67,0.6); }
.scene-night .dialect-hint { color: rgba(212,168,67,0.4); }

/* 英歌舞场景高亮 */
.scene-highlight {
  background: linear-gradient(180deg, var(--c-bg) 0%, #FDF5E6 20%, #FAEBD7 50%, #F4A261 80%, rgba(200,75,49,0.15) 100%);
}

/* ========================================
   滚动入场动画
   ======================================== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}
/* 交错延迟 */
.scene .reveal:nth-child(1) { transition-delay: 0s; }
.scene .reveal:nth-child(2) { transition-delay: 0.15s; }
.scene .reveal:nth-child(3) { transition-delay: 0.3s; }
.scene .reveal:nth-child(4) { transition-delay: 0.45s; }

/* ========================================
   结尾页
   ======================================== */
.scene-ending {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ending-bg {
  position: absolute;
  inset: 0;
}
.ending-bg img {
  object-fit: cover;
}
.ending-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(26,18,16,0.3) 0%,
    rgba(26,18,16,0.5) 40%,
    rgba(26,18,16,0.7) 100%
  );
}

.ending-content {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 40px 28px;
  max-width: 340px;
}
.ending-memo {
  font-family: var(--font-title);
  font-size: 17px;
  color: var(--c-cream);
  line-height: 2;
  margin-bottom: 28px;
  opacity: 0.9;
}
.ending-divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--c-gold), transparent);
  margin: 0 auto 24px;
}
.ending-title {
  font-family: var(--font-title);
  font-size: 25px;
  color: #FFF;
  letter-spacing: 4px;
  white-space: nowrap;
  margin-bottom: 8px;
  text-shadow: 0 0 20px rgba(212,168,67,0.3);
}
.ending-subtitle {
  font-size: 14px;
  color: rgba(253,245,230,0.7);
  letter-spacing: 3px;
  margin-bottom: 32px;
}
.ending-poem {
  font-family: var(--font-body);
  font-size: 14px;
  color: rgba(253,245,230,0.6);
  line-height: 2.2;
  margin-bottom: 40px;
}

/* ========================================
   弹窗
   ======================================== */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.popup-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.popup-card {
  width: 88%;
  max-width: 340px;
  max-height: 78vh;
  background: linear-gradient(180deg, #FFFDF8, #FDF5E6);
  border-radius: 20px;
  border: 2px solid var(--c-gold-dark);
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  padding: 24px 20px 20px;
  transform: translateY(40px) scale(0.95);
  transition: transform 0.4s var(--ease-out);
  overflow-y: auto;
  position: relative;
}
.popup-overlay.active .popup-card {
  transform: translateY(0) scale(1);
}

.popup-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 24px;
  color: var(--c-text-light);
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
  z-index: 10;
}
.popup-close:hover { opacity: 1; }

.popup-header {
  text-align: center;
  margin-bottom: 14px;
}
.popup-title {
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: bold;
  color: var(--c-text);
  letter-spacing: 3px;
  margin-bottom: 8px;
}
.popup-divider {
  width: 50%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--c-gold), transparent);
  margin: 0 auto;
}

.popup-body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 2;
  color: var(--c-text);
  margin-bottom: 20px;
}
.popup-body .hl {
  display: inline-block;
  background: var(--c-cream);
  border: 1px solid var(--c-gold);
  border-radius: 4px;
  padding: 0 6px;
  margin: 2px 0;
  font-size: 13px;
  color: var(--c-gold-dark);
  font-weight: 600;
}

.popup-footer { text-align: center; }

/* ========================================
   滚动提示
   ======================================== */
.scroll-hint {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 150;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  animation: hintBounce 2s ease-in-out infinite;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.scroll-hint.visible { opacity: 0.6; }
.scroll-hint span {
  font-size: 11px;
  color: var(--c-gold-dark);
  letter-spacing: 2px;
}
.scroll-arrow {
  width: 14px; height: 14px;
  border-right: 2px solid var(--c-gold-dark);
  border-bottom: 2px solid var(--c-gold-dark);
  transform: rotate(45deg);
}
@keyframes hintBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

/* ========================================
   v2.0 中互动升级层
   ======================================== */

/* ---------- L1 · 顶栏时辰印章收集 ---------- */
.stamp-collection {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: rgba(253, 245, 230, 0.97);
  border: 1px solid rgba(212, 168, 67, 0.4);
  border-radius: 22px;
  box-shadow: 0 2px 10px rgba(92, 51, 23, 0.15);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease, padding 0.3s var(--ease-out);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.main-page.visible .stamp-collection {
  opacity: 1;
  pointer-events: auto;
}
.stamp-label {
  font-family: var(--font-title);
  font-size: 11px;
  color: var(--c-text);
  letter-spacing: 1px;
  padding-right: 8px;
  border-right: 1px solid rgba(212, 168, 67, 0.4);
}
.stamp-list {
  display: flex;
  gap: 6px;
}
.stamp {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px dashed rgba(200, 75, 49, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-size: 11px;
  color: rgba(200, 75, 49, 0.5);
  background: transparent;
  position: relative;
  transition: all 0.4s var(--ease-out);
}
.stamp.lit {
  border-style: solid;
  border-color: var(--c-primary);
  background: var(--c-primary);
  color: #FFF8EE;
  box-shadow: 0 0 0 2px rgba(200, 75, 49, 0.2), 0 2px 8px rgba(200, 75, 49, 0.4);
  animation: stampInk 0.6s var(--ease-out);
}
@keyframes stampInk {
  0%   { transform: scale(2.2) rotate(-12deg); opacity: 0; }
  40%  { transform: scale(0.85) rotate(4deg); opacity: 1; }
  70%  { transform: scale(1.1) rotate(-2deg); }
  100% { transform: scale(1) rotate(0); }
}
.stamp-count {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--c-text-light);
  letter-spacing: 0.5px;
  padding-left: 8px;
  border-left: 1px solid rgba(212, 168, 67, 0.4);
}
.stamp-count span {
  color: var(--c-primary);
  font-weight: 700;
}

/* ---------- 顶栏音乐开关 ---------- */
.music-toggle {
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid rgba(200, 75, 49, 0.55);
  background: rgba(255, 248, 238, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  margin-left: 2px;
  color: var(--c-primary);
  transition: transform 0.2s var(--ease-out), background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}
.music-toggle:active {
  transform: scale(0.9);
}
.music-note {
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
  display: inline-block;
  transform-origin: center;
}
.music-wave {
  position: absolute;
  right: -3px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--c-gold);
  opacity: 0;
  box-shadow: 0 0 0 0 rgba(212, 168, 67, 0.6);
  transition: opacity 0.3s ease;
}
.music-slash {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24px;
  height: 1.6px;
  background: var(--c-primary);
  border-radius: 1px;
  transform: translate(-50%, -50%) rotate(-45deg);
  opacity: 1;
  transition: opacity 0.25s ease;
  box-shadow: 0 0 2px rgba(253, 245, 230, 0.9);
}
/* 播放中：隐藏斜杠 + 音符摆动 + 金色波纹 */
.music-toggle.playing {
  background: var(--c-primary);
  border-color: var(--c-gold);
  color: #FFF8EE;
  box-shadow: 0 0 0 2px rgba(212, 168, 67, 0.35), 0 2px 8px rgba(200, 75, 49, 0.4);
}
.music-toggle.playing .music-slash {
  opacity: 0;
}
.music-toggle.playing .music-note {
  animation: musicNoteWiggle 1.4s ease-in-out infinite;
}
.music-toggle.playing .music-wave {
  opacity: 1;
  animation: musicWavePulse 1.6s ease-out infinite;
}
@keyframes musicNoteWiggle {
  0%, 100% { transform: rotate(-8deg) translateY(0); }
  50%      { transform: rotate(8deg)  translateY(-1px); }
}
@keyframes musicWavePulse {
  0%   { box-shadow: 0 0 0 0 rgba(212, 168, 67, 0.7); }
  70%  { box-shadow: 0 0 0 6px rgba(212, 168, 67, 0); }
  100% { box-shadow: 0 0 0 0 rgba(212, 168, 67, 0); }
}

/* ---------- 顶栏收起 / 下拉展开按钮 ---------- */
.bar-fold {
  width: 20px;
  height: 26px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  margin-left: -2px;
  color: rgba(180, 130, 20, 0.9);
  -webkit-tap-highlight-color: transparent;
}
.fold-arrow {
  display: inline-block;
  font-size: 13px;
  line-height: 1;
  transform: rotate(180deg); /* 展开态：▴ 点击收起 */
  transition: transform 0.35s var(--ease-out);
}
.stamp-collection.mini {
  padding: 6px 10px;
  gap: 8px;
}
.stamp-collection.mini .fold-arrow {
  transform: rotate(0deg); /* 收起态：▾ 点击下拉展开 */
}
.stamp-collection.mini .stamp-label,
.stamp-collection.mini .stamp-list {
  display: none;
}

/* ---------- L2 · 场景插画热区 ---------- */
.hotspot-layer {
  position: absolute;
  inset: 0;
  pointer-events: none; /* 容器不拦截滚动 */
  z-index: 5;
}
.hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  pointer-events: auto; /* 单个热区可点 */
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.hotspot-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--c-gold);
  background: rgba(253, 245, 230, 0.92);
  box-shadow: 0 2px 8px rgba(92, 51, 23, 0.25);
  animation: hotspotPulse 2.2s ease-out infinite;
}
.hotspot.found .hotspot-ring {
  animation: none;
  border-color: var(--c-primary);
  background: var(--c-primary);
}
.hotspot.found .hotspot-icon {
  filter: brightness(0) invert(1);
}
@keyframes hotspotPulse {
  0%   { box-shadow: 0 2px 8px rgba(92,51,23,0.25), 0 0 0 0 rgba(212,168,67,0.55); }
  70%  { box-shadow: 0 2px 8px rgba(92,51,23,0.25), 0 0 0 14px rgba(212,168,67,0); }
  100% { box-shadow: 0 2px 8px rgba(92,51,23,0.25), 0 0 0 0 rgba(212,168,67,0); }
}
.hotspot-icon {
  position: relative;
  font-size: 18px;
  line-height: 1;
  z-index: 2;
  transition: transform 0.3s var(--ease-out);
}
.hotspot:active .hotspot-icon {
  transform: scale(0.85);
}
.hotspot-tip {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--font-ui);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(92, 51, 23, 0.85);
  color: #FFF8EE;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.hotspot:hover .hotspot-tip,
.hotspot:active .hotspot-tip {
  opacity: 1;
}

/* 夜景场景热区配色微调（更亮） */
.scene-night .hotspot-ring {
  border-color: var(--c-gold);
  background: rgba(26, 18, 16, 0.85);
  box-shadow: 0 0 12px rgba(212, 168, 67, 0.5);
}
.scene-night .hotspot-tip {
  background: rgba(212, 168, 67, 0.92);
  color: var(--c-night);
}

/* ---------- 热区物件弹窗 ---------- */
.hotspot-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(26, 18, 16, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.hotspot-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.hotspot-card {
  position: relative;
  width: 100%;
  max-width: 320px;
  max-height: 78vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #FFF8EE 0%, #FAEBD7 100%);
  border: 1.5px solid var(--c-gold);
  border-radius: 14px;
  padding: 22px 20px 18px;
  box-shadow: 0 12px 40px rgba(92, 51, 23, 0.35);
  transform: translateY(20px) scale(0.92);
  opacity: 0;
  transition: transform 0.4s var(--ease-out), opacity 0.35s ease;
}
.hotspot-overlay.active .hotspot-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.hotspot-close {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: var(--c-text-light);
  cursor: pointer;
}
.hotspot-badge {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--c-primary);
  background: rgba(200, 75, 49, 0.1);
  border: 1px solid rgba(200, 75, 49, 0.3);
  border-radius: 10px;
  padding: 2px 10px;
  margin-bottom: 10px;
}
.hotspot-title {
  font-family: var(--font-title);
  font-size: 20px;
  color: var(--c-text);
  letter-spacing: 2px;
  margin-bottom: 8px;
}
.hotspot-divider {
  width: 40px;
  height: 2px;
  background: var(--c-gold);
  margin: 0 auto 14px;
  border-radius: 2px;
}
.hotspot-body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.85;
  color: var(--c-text);
}
.hotspot-body p { margin-bottom: 10px; }
.hotspot-body .hl {
  color: var(--c-primary);
  font-weight: 700;
  padding: 0 2px;
}
.hotspot-body .quote {
  display: block;
  margin: 10px 0;
  padding: 8px 12px;
  border-left: 3px solid var(--c-gold);
  background: rgba(212, 168, 67, 0.08);
  font-style: italic;
  color: var(--c-text-light);
  font-size: 13px;
}
.hotspot-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed rgba(212, 168, 67, 0.4);
}
.hotspot-progress {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--c-text-light);
}
.hotspot-ok {
  border: none;
  background: var(--c-primary);
  color: #FFF8EE;
  font-family: var(--font-ui);
  font-size: 12px;
  padding: 7px 16px;
  border-radius: 16px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hotspot-ok:active {
  transform: scale(0.95);
}

/* ---------- 印章盖章 Toast ---------- */
.stamp-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  z-index: 95;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px 14px 14px;
  background: rgba(253, 245, 230, 0.98);
  border: 2px solid var(--c-primary);
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(200, 75, 49, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.45s var(--ease-out);
}
.stamp-toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.toast-stamp {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--c-primary);
  color: #FFF8EE;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-size: 26px;
  box-shadow: inset 0 0 0 2px rgba(255, 248, 238, 0.4);
}
.toast-title {
  font-family: var(--font-title);
  font-size: 16px;
  color: var(--c-text);
  letter-spacing: 2px;
}
.toast-sub {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--c-text-light);
  margin-top: 2px;
}

/* ---------- L3 · 侨批信封开合动画 ---------- */
.letter-stage {
  margin: 28px 0 8px;
  padding: 24px 16px 32px;
  background: linear-gradient(180deg,
    rgba(26, 18, 16, 0) 0%,
    rgba(26, 18, 16, 0.4) 30%,
    rgba(26, 18, 16, 0.6) 100%
  );
  border-radius: 16px;
  position: relative;
}
.letter-hint {
  text-align: center;
  margin-bottom: 18px;
  color: var(--c-gold);
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 1px;
  animation: hintFloat 2.4s ease-in-out infinite;
}
.letter-hint .hint-arrow {
  display: inline-block;
  margin-right: 6px;
  font-size: 14px;
}
@keyframes hintFloat {
  0%, 100% { opacity: 0.75; transform: translateY(0); }
  50%      { opacity: 1;    transform: translateY(4px); }
}

.envelope-wrap {
  display: flex;
  justify-content: center;
  perspective: 1400px;
  padding: 20px 0;
}
.envelope {
  position: relative;
  width: 290px;
  height: 370px;
  transform-style: preserve-3d;
  animation: envelopeBreathe 4s ease-in-out infinite;
  transition: transform 0.8s var(--ease-out);
}
@keyframes envelopeBreathe {
  0%, 100% { transform: rotateY(-4deg) rotateX(2deg) translateY(0); }
  50%      { transform: rotateY(4deg)  rotateX(-1deg) translateY(-6px); }
}
.envelope.opening,
.envelope.opened {
  animation: none;
  transform: rotateY(0) rotateX(0) translateY(0);
}

.envelope-back {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #C9A57A 0%, #A88052 50%, #8B6538 100%);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), inset 0 0 40px rgba(92, 51, 23, 0.25);
  z-index: 1;
}
.envelope-back::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(139, 101, 56, 0.3) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(92, 51, 23, 0.25) 0%, transparent 45%);
  border-radius: 6px;
  mix-blend-mode: multiply;
}

/* 信纸 */
.letter-paper {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 12px;
  height: 346px;
  background:
    repeating-linear-gradient(90deg,
      transparent 0,
      transparent 34px,
      rgba(200, 75, 49, 0.18) 34px,
      rgba(200, 75, 49, 0.18) 35px
    ),
    linear-gradient(180deg, #F7EAD0 0%, #ECDDB6 100%);
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(92, 51, 23, 0.3);
  z-index: 2;
  transform: translateY(100%) translateZ(1px);
  transition: transform 1.5s cubic-bezier(0.34, 1.3, 0.64, 1);
  overflow: hidden;
  padding: 14px 10px;
}
.envelope.opened .letter-paper {
  transform: translateY(-32%) translateZ(3px);
}
/* 竖排书写：块级 p 自然从右往左堆叠 —— 第一列（称谓）在最右 */
.letter-inner {
  writing-mode: vertical-rl;
  height: 100%;
  width: 100%;
  padding: 2px 4px;
  font-family: var(--font-body);
  color: #3E2A14;
  opacity: 0;
  transition: opacity 0.6s ease 1.2s;
}
.envelope.opened .letter-inner {
  opacity: 1;
}
.letter-inner p {
  margin: 0;
  font-size: 14px;
  line-height: 1.95;   /* 竖排时 line-height = 列间距 */
  letter-spacing: 3px; /* 字与字的纵向间距 */
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.envelope.opened .letter-inner p {
  opacity: 1;
  transform: translateX(0);
}
/* 逐列浮现（从右往左依次显现） */
.envelope.opened .letter-inner p:nth-child(1) { transition-delay: 1.5s; }
.envelope.opened .letter-inner p:nth-child(2) { transition-delay: 1.8s; }
.envelope.opened .letter-inner p:nth-child(3) { transition-delay: 2.1s; }
.envelope.opened .letter-inner p:nth-child(4) { transition-delay: 2.4s; }
.envelope.opened .letter-inner p:nth-child(5) { transition-delay: 2.7s; }
.envelope.opened .letter-inner p:nth-child(6) { transition-delay: 3.0s; }
.envelope.opened .letter-inner p:nth-child(7) { transition-delay: 3.3s; }
.envelope.opened .letter-inner p:nth-child(8) { transition-delay: 3.6s; }
/* 称谓：右上角，红字 */
.letter-inner .letter-header {
  font-family: var(--font-title);
  font-size: 17px;
  line-height: 2.2;
  letter-spacing: 6px;
  font-weight: 700;
  color: var(--c-primary);
}
/* 主题句：微微加重的墨红 */
.letter-inner .letter-key {
  color: #8C3A22;
  font-weight: 700;
  letter-spacing: 3.5px;
}
/* 署名：加大 + 红色，信末左侧最重的一笔 */
.letter-inner .letter-sign {
  font-family: var(--font-title);
  font-size: 20px;
  line-height: 2.1;
  letter-spacing: 5px;
  font-weight: 700;
  color: var(--c-primary);
  text-shadow: 0 0 1px rgba(200, 75, 49, 0.35);
}
/* 落款日期：小字收边 */
.letter-inner .letter-date {
  font-size: 12px;
  line-height: 2;
  letter-spacing: 2px;
  color: var(--c-text-light);
}

/* 信封前板 */
.envelope-front {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #D4B088 0%, #B58E5E 50%, #96713E 100%);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), inset 0 0 40px rgba(92, 51, 23, 0.2);
  z-index: 3;
  transform: translateZ(2px);
  transition: opacity 0.8s ease 0.9s;
  overflow: hidden;
}
.envelope-front::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 30% 40%, rgba(139, 101, 56, 0.3) 0%, transparent 40%),
    radial-gradient(circle at 70% 60%, rgba(92, 51, 23, 0.25) 0%, transparent 45%);
  mix-blend-mode: multiply;
}
.envelope.opened .envelope-front {
  opacity: 0;
  pointer-events: none;
}

/* 封盖（顶部三角形） */
.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 55%;
  background: linear-gradient(180deg, #C9A57A 0%, #A88052 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transform: rotateX(0deg) translateZ(3px);
  transition: transform 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  z-index: 4;
}
.envelope.opening .envelope-flap,
.envelope.opened .envelope-flap {
  transform: rotateX(-180deg) translateZ(3px);
}

/* 收件人地址 */
.envelope-address {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  writing-mode: vertical-rl;
  font-family: var(--font-title);
  color: #3E2A14;
  z-index: 5;
  padding: 8px 14px;
  border: 1px double rgba(62, 42, 20, 0.5);
  background: rgba(245, 230, 200, 0.35);
}
.addr-to {
  font-size: 16px;
  letter-spacing: 4px;
  font-weight: 700;
}
.addr-from {
  font-size: 10px;
  letter-spacing: 2px;
  color: #5C3317;
  margin-top: 4px;
}

/* 邮票 */
.envelope-stamp {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 48px;
  background: linear-gradient(135deg, #C84B31 0%, #8B2F1E 100%);
  border: 2px dashed rgba(253, 245, 230, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}
.stamp-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #FFF8EE;
  font-family: var(--font-title);
  line-height: 1.1;
}
.stamp-circle > span:first-child {
  font-size: 18px;
}
.stamp-sub {
  font-size: 8px;
  letter-spacing: 1px;
  margin-top: 2px;
}

/* 邮戳 */
.envelope-postmark {
  position: absolute;
  top: 16px;
  right: 58px;
  width: 60px;
  height: 60px;
  border: 2px solid rgba(92, 51, 23, 0.55);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-size: 8px;
  color: rgba(92, 51, 23, 0.7);
  transform: rotate(-12deg);
  z-index: 5;
  background: rgba(212, 168, 67, 0.08);
}
.envelope-postmark span:first-child {
  font-weight: 700;
  letter-spacing: 0.5px;
}
.envelope-postmark span:last-child {
  margin-top: 2px;
  font-size: 7px;
}

/* 火漆印章 */
.wax-seal {
  position: absolute;
  top: 46%;
  left: 50%;
  transform: translate(-50%, -50%) translateZ(6px);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 35% 30%, #D94A3A 0%, #A02818 60%, #6B1A0E 100%);
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.4),
    inset 0 -3px 6px rgba(0, 0, 0, 0.3),
    inset 0 3px 6px rgba(255, 255, 255, 0.15);
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  color: #FFF8EE;
  transition: transform 0.25s var(--ease-out);
  animation: sealGlow 2.4s ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
}
.wax-seal:active {
  transform: translate(-50%, -50%) translateZ(6px) scale(0.92);
}
.seal-text {
  font-size: 26px;
  letter-spacing: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
@keyframes sealGlow {
  0%, 100% { box-shadow: 0 3px 8px rgba(0,0,0,0.4), inset 0 -3px 6px rgba(0,0,0,0.3), inset 0 3px 6px rgba(255,255,255,0.15), 0 0 0 0 rgba(212,168,67,0.6); }
  50%      { box-shadow: 0 3px 8px rgba(0,0,0,0.4), inset 0 -3px 6px rgba(0,0,0,0.3), inset 0 3px 6px rgba(255,255,255,0.15), 0 0 0 12px rgba(212,168,67,0); }
}
.wax-seal.cracked {
  animation: waxCrack 0.7s var(--ease-out) forwards;
  pointer-events: none;
}
@keyframes waxCrack {
  0%   { transform: translate(-50%, -50%) translateZ(6px) scale(1) rotate(0); opacity: 1; }
  40%  { transform: translate(-50%, -50%) translateZ(6px) scale(1.35) rotate(12deg); opacity: 0.85; }
  100% { transform: translate(-50%, -50%) translateZ(6px) scale(0.2) rotate(45deg); opacity: 0; }
}

/* 合信按钮 */
.letter-close-btn {
  display: block;
  margin: 20px auto 0;
  padding: 10px 24px;
  border: 1px solid var(--c-gold);
  background: rgba(212, 168, 67, 0.15);
  color: var(--c-gold);
  font-family: var(--font-title);
  font-size: 14px;
  letter-spacing: 3px;
  border-radius: 22px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s var(--ease-out), background 0.2s ease;
}
.letter-close-btn.show {
  opacity: 1;
  transform: translateY(0);
}
.letter-close-btn:active {
  background: rgba(212, 168, 67, 0.35);
}

/* 合信状态 */
.envelope.closing .letter-paper {
  transform: translateY(100%) translateZ(1px);
  transition: transform 1.2s cubic-bezier(0.4, 0, 1, 1);
}
.envelope.closing .letter-inner {
  opacity: 0;
  transition: opacity 0.3s ease;
}
.envelope.closing .envelope-front {
  opacity: 1;
  transition: opacity 0.6s ease 0.8s;
}
.envelope.closing .envelope-flap {
  transform: rotateX(0deg) translateZ(3px);
  transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1) 1s;
}
.envelope.closing .wax-seal {
  animation: sealRestore 0.8s ease 1.8s forwards;
}
@keyframes sealRestore {
  from { transform: translate(-50%, -50%) translateZ(6px) scale(0); opacity: 0; }
  to   { transform: translate(-50%, -50%) translateZ(6px) scale(1); opacity: 1; }
}

/* ========================================
   P1 · 隐藏分支互动组件
   ======================================== */
.mini-interaction {
  margin: 24px 20px 8px;
  padding: 18px 16px 20px;
  background: linear-gradient(180deg, rgba(255, 248, 238, 0.9) 0%, rgba(247, 234, 208, 0.75) 100%);
  border: 1px solid rgba(212, 168, 67, 0.4);
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(92, 51, 23, 0.08), inset 0 0 0 3px rgba(255, 255, 255, 0.35);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  position: relative;
}
.mini-interaction.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}
.mini-interaction::before {
  content: "";
  position: absolute;
  top: -6px; left: 20px;
  width: 12px; height: 12px;
  background: var(--c-gold);
  transform: rotate(45deg);
  box-shadow: 0 0 0 2px rgba(253, 245, 230, 0.9);
}
.mi-header { text-align: center; margin-bottom: 12px; }
.mi-tag {
  display: inline-block;
  font-family: var(--font-title);
  font-size: 12px;
  letter-spacing: 2px;
  color: #FFF8EE;
  background: var(--c-primary);
  padding: 3px 10px;
  border-radius: 3px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(200, 75, 49, 0.35);
}
.mi-hint {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--c-text-light);
  letter-spacing: 0.5px;
}
.mi-btn {
  display: block;
  margin: 14px auto 0;
  padding: 8px 22px;
  font-family: var(--font-title);
  font-size: 15px;
  letter-spacing: 3px;
  color: #FFF8EE;
  background: var(--c-primary);
  border: 1.5px solid var(--c-gold);
  border-radius: 22px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(200, 75, 49, 0.35);
  transition: transform 0.15s var(--ease-out), box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.mi-btn:active {
  transform: scale(0.95);
  box-shadow: 0 1px 3px rgba(200, 75, 49, 0.35);
}

/* ---------- P1-A · 掷筊杯 ---------- */
.jiaobei-stage {
  position: relative;
  height: 180px;
  margin: 0 auto;
  width: 100%;
  max-width: 320px;
}
.jiaobei-tray {
  position: absolute;
  left: 50%; bottom: 12px;
  transform: translateX(-50%);
  width: 240px;
  height: 40px;
  background: radial-gradient(ellipse at center top, #7A4A22 0%, #3E2410 60%, #241306 100%);
  border-radius: 50% 50% 12px 12px / 60% 60% 12px 12px;
  box-shadow: inset 0 6px 12px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(92, 51, 23, 0.35);
}
.jiaobei-tray::after {
  content: "";
  position: absolute;
  left: 20%; top: 22%;
  width: 60%; height: 8%;
  background: linear-gradient(90deg, transparent, rgba(255, 220, 160, 0.18), transparent);
  border-radius: 50%;
}
.jiaobei-cup {
  position: absolute;
  bottom: 40px;
  width: 62px;
  height: 34px;
  transition: transform 0.15s ease;
}
.jiaobei-cup.cup-left  { left: calc(50% - 66px); }
.jiaobei-cup.cup-right { left: calc(50% + 4px); }
.cup-shape {
  width: 100%;
  height: 100%;
  border-radius: 50% 50% 46% 46% / 90% 90% 20% 20%;
  background: linear-gradient(180deg, #8B4A22 0%, #5C2E12 60%, #3E1D08 100%);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 220, 160, 0.25);
  position: relative;
  transform-origin: center;
}
.jiaobei-cup.flat-up .cup-shape {
  background: linear-gradient(180deg, #E7C58A 0%, #C79A5A 55%, #8A6136 100%);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35), inset 0 -3px 4px rgba(0, 0, 0, 0.18);
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
}
.jiaobei-cup.flat-up .cup-shape::before {
  content: "";
  position: absolute;
  inset: 6px 10px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 240, 200, 0.4), transparent 70%);
}
.jiaobei-cup.round-up .cup-shape::after {
  content: "";
  position: absolute;
  top: 4px; left: 15%;
  width: 55%; height: 22%;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 240, 200, 0.45), transparent);
}
.jiaobei-cup.toss {
  animation: cupToss 0.9s cubic-bezier(0.35, 0.9, 0.5, 1);
}
.jiaobei-cup.cup-left.toss { animation-name: cupTossLeft; }
.jiaobei-cup.cup-right.toss { animation-name: cupTossRight; }
@keyframes cupTossLeft {
  0%   { transform: translateY(0) rotate(0deg); }
  30%  { transform: translateY(-90px) rotate(-380deg); }
  60%  { transform: translateY(-20px) rotate(-720deg); }
  85%  { transform: translateY(4px) rotate(-1060deg); }
  100% { transform: translateY(0) rotate(-1080deg); }
}
@keyframes cupTossRight {
  0%   { transform: translateY(0) rotate(0deg); }
  30%  { transform: translateY(-80px) rotate(340deg); }
  60%  { transform: translateY(-14px) rotate(680deg); }
  85%  { transform: translateY(4px) rotate(1020deg); }
  100% { transform: translateY(0) rotate(1080deg); }
}
.jiaobei-result {
  text-align: center;
  margin-top: 8px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.jiaobei-result.show { opacity: 1; transform: translateY(0); }
.jr-name {
  font-family: var(--font-title);
  font-size: 24px;
  letter-spacing: 6px;
  color: var(--c-primary);
  text-shadow: 0 1px 0 rgba(255, 248, 238, 0.9);
}
.jr-name.smile { color: var(--c-gold); }
.jr-name.sad { color: var(--c-text-light); }
.jr-desc {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--c-text);
  margin-top: 4px;
  line-height: 1.7;
  letter-spacing: 0.5px;
}

/* ---------- P1-B · 拖拽嵌瓷 ---------- */
.qiaoci-stage {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.qiaoci-phoenix {
  position: relative;
  width: 260px;
  height: 200px;
  background: linear-gradient(180deg, rgba(255, 248, 238, 0.6) 0%, rgba(247, 234, 208, 0.35) 100%);
  border: 1px dashed rgba(212, 168, 67, 0.5);
  border-radius: 12px;
  overflow: hidden;
}
.phoenix-svg {
  position: absolute;
  inset: 10px;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  opacity: 0.65;
}
.qiaoci-slot {
  position: absolute;
  width: 34px;
  height: 34px;
  transform: translate(-50%, -50%);
  border-radius: 40% 60% 55% 45% / 50% 45% 55% 50%;
  border: 1.5px dashed rgba(200, 75, 49, 0.5);
  background: rgba(255, 248, 238, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(200, 75, 49, 0.55);
  font-family: var(--font-title);
  font-size: 11px;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s var(--ease-out);
}
.qiaoci-slot.hover {
  transform: translate(-50%, -50%) scale(1.15);
  border-color: var(--c-gold);
  background: rgba(212, 168, 67, 0.25);
}
.qiaoci-slot.filled {
  border-style: solid;
  border-color: var(--c-primary);
  background: transparent;
}
.qiaoci-slot.filled .slot-ghost { display: none; }
.qiaoci-tray {
  display: flex;
  gap: 14px;
  padding: 8px 12px;
  background: rgba(92, 51, 23, 0.06);
  border-radius: 10px;
  border: 1px dashed rgba(92, 51, 23, 0.25);
}
.qiaoci-piece {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.qiaoci-piece .piece-shard {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--pc) 0%, rgba(0, 0, 0, 0.15) 100%), var(--pc);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.15);
  filter: saturate(1.05);
}
.qiaoci-piece.dragging {
  cursor: grabbing;
  opacity: 0.85;
  transform: scale(1.1);
  z-index: 5;
}
.qiaoci-piece.placed {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.6);
}
.qiaoci-progress {
  text-align: center;
  margin-top: 8px;
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--c-text-light);
}
.qiaoci-progress span {
  color: var(--c-primary);
  font-weight: 700;
  font-size: 14px;
}
.qiaoci-done {
  margin-top: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(212, 168, 67, 0.15) 0%, rgba(200, 75, 49, 0.12) 100%);
  border-left: 3px solid var(--c-primary);
  border-radius: 8px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.qiaoci-done.show { opacity: 1; transform: translateY(0); }
.qd-title {
  font-family: var(--font-title);
  font-size: 16px;
  color: var(--c-primary);
  letter-spacing: 3px;
  margin-bottom: 4px;
}
.qd-body {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--c-text);
  line-height: 1.75;
}

/* ---------- P1-C · 英歌脸谱转盘 ---------- */
.mask-carousel {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.mask-arrow {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255, 248, 238, 0.9);
  border: 1px solid rgba(200, 75, 49, 0.35);
  color: var(--c-primary);
  font-size: 22px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.2s ease, transform 0.15s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.mask-arrow:active { transform: scale(0.9); background: rgba(212, 168, 67, 0.3); }
.mask-track-wrap {
  flex: 1;
  overflow: hidden;
  padding: 6px 0;
  position: relative;
}
.mask-track {
  display: flex;
  gap: 14px;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
  padding: 4px 4px;
  touch-action: pan-y;
}
.mask-card {
  flex: 0 0 auto;
  width: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 6px 10px;
  background: linear-gradient(180deg, #FFF8EE 0%, #F1E4C6 100%);
  border: 1px solid rgba(212, 168, 67, 0.55);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(92, 51, 23, 0.1);
  transition: transform 0.4s var(--ease-out), box-shadow 0.3s ease;
}
.mask-card.active {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 6px 16px rgba(200, 75, 49, 0.28), 0 0 0 2px var(--c-gold) inset;
}
.mask-face-svg { width: 100px; height: 116px; display: block; }
.mask-name {
  font-family: var(--font-title);
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--c-text);
  margin-top: 4px;
}
.mask-mean {
  font-family: var(--font-title);
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--mc);
  margin-top: 1px;
}
.mask-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}
.mask-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(200, 75, 49, 0.28);
  transition: background 0.25s ease, transform 0.25s ease;
  cursor: pointer;
}
.mask-dot.active {
  background: var(--c-primary);
  transform: scale(1.4);
}
.mask-desc {
  margin-top: 10px;
  padding: 8px 10px;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.75;
  color: var(--c-text);
  text-align: center;
  background: rgba(255, 248, 238, 0.55);
  border-radius: 8px;
  border-left: 2px solid var(--c-gold);
  min-height: 42px;
}

/* ---------- 桌面端 375 框内适配 ---------- */
@media (min-width: 768px) {
  .stamp-collection {
    top: calc(50% - 395px);
    left: 50%;
  }
}

/* ========================================
   响应式
   ======================================== */
@media (max-width: 380px) {
  .cover-title { font-size: 34px; letter-spacing: 6px; }
  .scene-title { font-size: 20px; }
  .narrative-body { font-size: 14px; }
  .time-hour { font-size: 22px; }
}

@media (min-width: 768px) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .cover, .main-page {
    width: 375px;
    height: 812px;
    border-radius: 36px;
    box-shadow: 0 0 0 3px #333, 0 20px 60px rgba(0,0,0,0.5);
  }
  .main-page { position: relative; }
  .progress-bar { border-radius: 36px 36px 0 0; }
  .scene-nav { right: calc(50% - 195px); }
  .scroll-hint { bottom: calc(50% - 430px); }
}

/* ========================================
   P3 · 终章升级层（地图 / 水果分支 / 回信海报）
   ======================================== */

/* ---------- 封面 · 地图入口 ---------- */
.btn-map-entry {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding: 7px 18px;
  font-family: var(--font-title);
  font-size: 13px;
  letter-spacing: 2px;
  color: rgba(253, 245, 230, 0.92);
  background: rgba(92, 51, 23, 0.35);
  border: 1px solid rgba(212, 168, 67, 0.55);
  border-radius: 20px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: transform 0.15s var(--ease-out), background 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-map-entry:active { transform: scale(0.94); background: rgba(92, 51, 23, 0.55); }
.map-compass {
  font-size: 14px;
  color: var(--c-gold);
  display: inline-block;
}

/* ---------- 顶栏 · 地图按钮 ---------- */
.map-toggle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid rgba(212, 168, 67, 0.6);
  background: rgba(255, 248, 238, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  margin-left: 6px;
  transition: transform 0.2s var(--ease-out), background 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}
.map-toggle:active { transform: scale(0.9); }
.map-toggle .map-icon { font-size: 13px; line-height: 1; }

/* ---------- P3-A · 全屏村庄漫游地图 ---------- */
.map-overlay {
  position: fixed;
  inset: 0;
  z-index: 210;
  background: rgba(26, 18, 16, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.map-overlay.active { opacity: 1; pointer-events: all; }
.map-panel {
  width: 92%;
  max-width: 360px;
  max-height: 88vh;
  background: linear-gradient(180deg, #FDF5E6 0%, #F3E3C3 100%);
  border: 2px solid var(--c-gold-dark);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  padding: 16px 14px 12px;
  transform: translateY(30px) scale(0.96);
  transition: transform 0.4s var(--ease-out);
  display: flex;
  flex-direction: column;
}
.map-overlay.active .map-panel { transform: translateY(0) scale(1); }
.map-head { position: relative; text-align: center; margin-bottom: 6px; }
.map-title {
  font-family: var(--font-title);
  font-size: 20px;
  letter-spacing: 5px;
  color: var(--c-text);
}
.map-sub { font-size: 11px; color: var(--c-text-light); margin-top: 3px; letter-spacing: 1px; }
.map-close {
  position: absolute;
  right: 0; top: -4px;
  width: 28px; height: 28px;
  border: none;
  background: transparent;
  font-size: 22px;
  color: var(--c-text-light);
  cursor: pointer;
  line-height: 1;
}
.map-body {
  position: relative;
  flex: 1;
  min-height: 380px;
  margin: 6px 2px;
  background:
    radial-gradient(circle at 20% 90%, rgba(94, 168, 111, 0.12) 0%, transparent 30%),
    radial-gradient(circle at 85% 12%, rgba(246, 210, 122, 0.18) 0%, transparent 26%),
    repeating-linear-gradient(0deg, transparent 0, transparent 26px, rgba(180, 130, 20, 0.05) 26px, rgba(180, 130, 20, 0.05) 27px);
  border-radius: 12px;
  border: 1px dashed rgba(180, 130, 20, 0.35);
}
.map-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-spot {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.ms-dot {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2px dashed rgba(200, 75, 49, 0.5);
  background: rgba(255, 248, 238, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.35s var(--ease-out);
  box-shadow: 0 2px 6px rgba(92, 51, 23, 0.18);
}
.ms-char {
  font-family: var(--font-title);
  font-size: 15px;
  color: rgba(200, 75, 49, 0.65);
  line-height: 1;
}
.ms-name {
  font-family: var(--font-title);
  font-size: 11px;
  color: var(--c-text);
  letter-spacing: 1px;
  background: rgba(253, 245, 230, 0.85);
  padding: 0 5px;
  border-radius: 6px;
  white-space: nowrap;
}
.ms-time { font-size: 9px; color: var(--c-text-light); letter-spacing: 0.5px; }
.map-spot:active .ms-dot { transform: scale(0.88); }
/* 已集齐时辰印 → 朱实 + 光晕 */
.map-spot.lit .ms-dot {
  border-style: solid;
  border-color: var(--c-primary);
  background: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(200, 75, 49, 0.18), 0 3px 10px rgba(200, 75, 49, 0.4);
}
.map-spot.lit .ms-char { color: #FFF8EE; }
.map-spot.lit::after {
  content: "✓";
  position: absolute;
  top: -4px; right: 2px;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--c-gold);
  color: #5C3317;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* 起点脉冲提示 */
.map-spot[data-goto="0"]:not(.lit) .ms-dot { animation: spotPulse 2.2s ease-out infinite; }
@keyframes spotPulse {
  0%   { box-shadow: 0 0 0 0 rgba(212, 168, 67, 0.5); }
  70%  { box-shadow: 0 0 0 12px rgba(212, 168, 67, 0); }
  100% { box-shadow: 0 0 0 0 rgba(212, 168, 67, 0); }
}
.map-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(180, 130, 20, 0.3);
  font-size: 10px;
  color: var(--c-text-light);
}
.map-legend { display: inline-flex; align-items: center; gap: 4px; }
.lg { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.lg-open { border: 1.5px dashed rgba(200, 75, 49, 0.55); background: #FFF8EE; }
.lg-lit { background: var(--c-primary); box-shadow: 0 0 0 2px rgba(200, 75, 49, 0.2); }
.map-progress { font-family: var(--font-title); letter-spacing: 1px; color: var(--c-primary); }

/* ---------- P3-B · 水果摊分支选择 ---------- */
.fruit-choices {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 4px;
}
.fruit-choice {
  flex: 1;
  max-width: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 6px 10px;
  background: rgba(255, 252, 244, 0.9);
  border: 1.5px solid rgba(212, 168, 67, 0.45);
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s var(--ease-out), border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}
.fruit-choice:active { transform: scale(0.94); }
.fruit-choice.picked {
  border-color: var(--c-primary);
  background: rgba(200, 75, 49, 0.08);
  box-shadow: 0 0 0 2px rgba(200, 75, 49, 0.18);
}
.fc-emoji { font-size: 24px; line-height: 1.2; }
.fc-name {
  font-family: var(--font-title);
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--c-text);
}
.fc-sub { font-size: 10px; color: var(--c-text-light); }
.fruit-reply {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}
.fruit-reply.show { opacity: 1; transform: translateY(0); }
.fr-avatar {
  flex: 0 0 34px;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--c-primary);
  color: #FFF8EE;
  font-family: var(--font-title);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(200, 75, 49, 0.35);
}
.fr-bubble {
  position: relative;
  flex: 1;
  background: #FFFDF6;
  border: 1px solid rgba(212, 168, 67, 0.5);
  border-radius: 4px 12px 12px 12px;
  padding: 10px 12px;
  box-shadow: 0 2px 8px rgba(92, 51, 23, 0.1);
}
.fr-bubble::before {
  content: "";
  position: absolute;
  left: -6px; top: 12px;
  width: 10px; height: 10px;
  background: #FFFDF6;
  border-left: 1px solid rgba(212, 168, 67, 0.5);
  border-bottom: 1px solid rgba(212, 168, 67, 0.5);
  transform: rotate(45deg);
}
.fr-dialect {
  font-family: var(--font-title);
  font-size: 15px;
  color: var(--c-primary);
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.7;
  margin-bottom: 4px;
}
.fr-text { font-size: 12px; color: var(--c-text); line-height: 1.8; }
.fr-proverb {
  margin-top: 6px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--c-gold-dark);
  letter-spacing: 0.5px;
}
#fruitReset { margin-top: 12px; }

/* ---------- P3-C · 终章收集回顾 ---------- */
.ending-review {
  margin: 8px auto 26px;
  padding: 14px 12px;
  background: rgba(253, 245, 230, 0.08);
  border: 1px solid rgba(212, 168, 67, 0.35);
  border-radius: 14px;
}
.er-title {
  font-family: var(--font-title);
  font-size: 14px;
  letter-spacing: 2px;
  color: rgba(253, 245, 230, 0.9);
  margin-bottom: 10px;
}
.er-title span { color: var(--c-gold); font-weight: 700; }
.er-stamps {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}
.er-stamp {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1.5px dashed rgba(200, 75, 49, 0.55);
  color: rgba(246, 210, 122, 0.55);
  font-family: var(--font-title);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s var(--ease-out);
}
.er-stamp.lit {
  border-style: solid;
  border-color: var(--c-gold);
  background: var(--c-primary);
  color: #FFF8EE;
  transform: rotate(-6deg);
  box-shadow: 0 0 0 2px rgba(200, 75, 49, 0.3), 0 3px 10px rgba(0, 0, 0, 0.35);
}
.er-note { font-size: 10px; color: rgba(253, 245, 230, 0.55); letter-spacing: 1px; }
.er-note.full { color: var(--c-gold); }

/* ---------- P3-C · 祝福回信 ---------- */
.ending-reply {
  margin: 0 auto 24px;
  padding: 16px 14px;
  background: rgba(253, 245, 230, 0.06);
  border: 1px solid rgba(212, 168, 67, 0.3);
  border-radius: 14px;
}
.ep-title {
  font-family: var(--font-title);
  font-size: 16px;
  letter-spacing: 3px;
  color: var(--c-gold);
  margin-bottom: 4px;
}
.ep-sub { font-size: 10px; color: rgba(253, 245, 230, 0.6); margin-bottom: 12px; letter-spacing: 1px; }
.ep-words {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}
.ep-word {
  padding: 6px 13px;
  font-family: var(--font-title);
  font-size: 13px;
  letter-spacing: 2px;
  color: rgba(253, 245, 230, 0.85);
  background: rgba(253, 245, 230, 0.08);
  border: 1px solid rgba(212, 168, 67, 0.45);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.ep-word:active { transform: scale(0.93); }
.ep-word.picked {
  background: var(--c-primary);
  border-color: var(--c-gold);
  color: #FFF8EE;
  box-shadow: 0 2px 8px rgba(200, 75, 49, 0.45);
}
.ep-word.dim { opacity: 0.35; }
.ep-generate {
  display: block;
  margin: 0 auto;
  padding: 9px 26px;
  font-family: var(--font-title);
  font-size: 15px;
  letter-spacing: 3px;
  color: #FFF8EE;
  background: linear-gradient(135deg, var(--c-primary), #A03322);
  border: 1.5px solid var(--c-gold);
  border-radius: 24px;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(200, 75, 49, 0.4);
  transition: transform 0.15s var(--ease-out), opacity 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}
.ep-generate:active { transform: scale(0.95); }
.ep-generate:disabled {
  opacity: 0.4;
  cursor: default;
  box-shadow: none;
}

/* ---------- 重看按钮 ---------- */
.btn-replay {
  margin-top: 4px;
  padding: 8px 20px;
  font-family: var(--font-title);
  font-size: 13px;
  letter-spacing: 2px;
  color: rgba(253, 245, 230, 0.75);
  background: transparent;
  border: 1px solid rgba(253, 245, 230, 0.35);
  border-radius: 20px;
  cursor: pointer;
  transition: transform 0.15s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.btn-replay:active { transform: scale(0.94); }

/* ---------- P3-C · 祝福卡海报 ---------- */
.poster-overlay {
  position: fixed;
  inset: 0;
  z-index: 220;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.poster-overlay.active { opacity: 1; pointer-events: all; }
.poster-panel {
  position: relative;
  width: 78%;
  max-width: 300px;
  text-align: center;
  transform: translateY(30px) scale(0.95);
  transition: transform 0.4s var(--ease-out);
}
.poster-overlay.active .poster-panel { transform: translateY(0) scale(1); }
.poster-close {
  position: absolute;
  right: -6px; top: -34px;
  width: 30px; height: 30px;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: #FFF8EE;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.poster-preview img,
.poster-preview canvas {
  width: 100%;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  display: block;
}
.poster-tip {
  margin-top: 12px;
  font-size: 11px;
  color: rgba(253, 245, 230, 0.65);
  letter-spacing: 1px;
}
.poster-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}
.poster-save, .poster-again {
  padding: 8px 20px;
  font-family: var(--font-title);
  font-size: 14px;
  letter-spacing: 2px;
  border-radius: 20px;
  cursor: pointer;
  transition: transform 0.15s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.poster-save {
  color: #FFF8EE;
  background: var(--c-primary);
  border: 1.5px solid var(--c-gold);
}
.poster-again {
  color: rgba(253, 245, 230, 0.85);
  background: transparent;
  border: 1px solid rgba(253, 245, 230, 0.4);
}
.poster-save:active, .poster-again:active { transform: scale(0.94); }

/* ---------- 刘海屏安全区 ---------- */
@supports (top: env(safe-area-inset-top)) {
  .stamp-collection { top: calc(14px + env(safe-area-inset-top)); }
  .progress-bar { margin-top: env(safe-area-inset-top); }
}

/* ---------- 减弱动效（无障碍） ---------- */
@media (prefers-reduced-motion: reduce) {
  .cover-bg img, .cloud, .steam, .smoke, .firefly,
  .sparkle, .drum-beat, .moon-glow,
  .music-note, .music-wave, .map-spot .ms-dot {
    animation: none !important;
  }
}
