/* ============================================================
   情侣纪念单页 · 暖调温柔治愈风格样式表
   ------------------------------------------------------------
   目录：
   1. 设计变量（颜色 / 字体 / 间距，可整体调色）
   2. 基础重置与滚动行为
   3. 板块通用布局（一屏一板块 + 背景视频 + 蒙版）
   4. 板块1 首屏（标题 / 爱心按钮 / 实时计时器）
   5. 板块2-4 场景与可点击热区
   6. 覆盖层：亲吻视频 / 孩子成长时间轴
   7. 弹窗：电视播放器 / 相册幻灯片 / 信件
   8. 通用组件（关闭按钮 / 圆点导航 / 显现动画）
   9. 响应式适配（平板 / 手机）
  10. 动效减弱（无障碍）
   ============================================================ */

/* ---------- 1. 设计变量 ---------- */
:root {
  /* 暖调配色：奶油底 + 蜜桃 + 陶土红 + 暖棕字 */
  --c-cream:   #fff6ec;   /* 奶油白（页面底色） */
  --c-cream-2: #ffeede;   /* 浅一档奶油 */
  --c-peach:   #ffd9c2;   /* 蜜桃色 */
  --c-rose:    #e98a76;   /* 玫瑰粉（主强调色） */
  --c-terra:   #c96f53;   /* 陶土红（深强调） */
  --c-gold:    #e0a458;   /* 暖金（点缀） */
  --c-brown:   #6b4a3a;   /* 暖棕（标题） */
  --c-text:    #7a5c4e;   /* 正文 */
  --c-text-lt: #a98a7a;   /* 浅文字 */
  --c-white:   #fffdfa;

  /* 阴影：柔和不刺眼 */
  --shadow-soft:  0 10px 30px rgba(160, 105, 75, .16);
  --shadow-card:  0 24px 60px rgba(120, 72, 45, .22);

  /* 圆角 */
  --r-sm: 12px;
  --r-md: 20px;
  --r-lg: 28px;

  /* 字体：系统字体栈，无需联网加载 */
  --font-display: 'STZhongsong', 'Songti SC', 'Noto Serif SC', 'SimSun', serif;
  --font-body: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;

  /* 过渡时长（统一柔和节奏） */
  --t-fast: .25s;
  --t-mid:  .45s;
  --t-slow: .8s;
  --ease:   cubic-bezier(.22, .61, .36, 1);
}

/* ---------- 2. 基础重置与滚动行为 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;            /* 平滑滚动 */
  scroll-snap-type: y proximity;      /* 柔和吸附：一屏一板块 */
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--c-text);
  background: var(--c-cream);
  line-height: 1.7;
  overflow-x: hidden;
}

img, video { display: block; max-width: 100%; }

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

/* 焦点可见（键盘无障碍） */
:focus-visible {
  outline: 3px solid var(--c-terra);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- 3. 板块通用布局 ---------- */
.section {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;      /* 移动端浏览器地址栏适配 */
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  content-visibility: auto;          /* 离屏板块跳过渲染，减少卡顿 */
  contain-intrinsic-size: auto 100vh;
}

/* 背景视频容器 */
.bg-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.bg-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 首屏四季视频叠放：交叉淡入淡出 */
#heroMedia video {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.4s var(--ease);
}
#heroMedia video.is-active { opacity: 1; }

/* 暖色蒙版：保证文字在任何画面上都清晰 */
.scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(255, 236, 214, .55) 0%, rgba(255, 222, 196, .18) 35%, rgba(120, 62, 38, .32) 100%);
  pointer-events: none;
}
.scrim--soft {
  background: linear-gradient(180deg, rgba(255, 236, 214, .28), rgba(120, 62, 38, .38));
}

.section-inner {
  position: relative;
  z-index: 2;
  width: min(1100px, 92vw);
  text-align: center;
  padding: 6vh 0;
}

/* ---------- 4. 板块1 首屏 ---------- */
.hero-inner { display: flex; flex-direction: column; align-items: center; gap: clamp(14px, 2.6vh, 26px); }

.hero-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 3vw, 36px);
  font-family: var(--font-display);
  font-size: clamp(30px, 6vw, 62px);
  font-weight: 700;
  color: var(--c-white);
  text-shadow: 0 4px 24px rgba(110, 55, 30, .45);
  letter-spacing: .06em;
}

/* 爱心按钮：呼吸跳动 */
.heart-btn {
  width: clamp(52px, 8vw, 84px);
  height: clamp(52px, 8vw, 84px);
  border-radius: 50%;
  background: rgba(255, 250, 244, .82);
  box-shadow: 0 10px 30px rgba(200, 90, 70, .38);
  display: grid;
  place-items: center;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
  animation: heartBeat 2.2s ease-in-out infinite;
}
.heart-btn svg {
  width: 58%;
  height: 58%;
  fill: var(--c-rose);
  transition: fill var(--t-fast) var(--ease);
}
.heart-btn:hover  { transform: scale(1.12); box-shadow: 0 16px 40px rgba(200, 90, 70, .5); }
.heart-btn:active { transform: scale(.94); }
.heart-btn:hover svg { fill: var(--c-terra); }

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  12%      { transform: scale(1.1); }
  24%      { transform: scale(1); }
  36%      { transform: scale(1.07); }
  48%      { transform: scale(1); }
}

/* 计时文案 */
.hero-sub {
  font-family: var(--font-display);
  font-size: clamp(16px, 2.6vw, 26px);
  color: var(--c-white);
  letter-spacing: .3em;
  text-shadow: 0 2px 16px rgba(110, 55, 30, .5);
}

/* 实时计时器 */
.counter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(8px, 1.6vw, 18px);
}
.counter-item {
  min-width: clamp(64px, 10vw, 96px);
  padding: clamp(10px, 1.8vh, 18px) clamp(8px, 1.4vw, 16px);
  background: rgba(255, 250, 243, .78);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.counter-num {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(24px, 4.6vw, 46px);
  font-weight: 700;
  color: var(--c-terra);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;   /* 数字等宽，跳动不抖 */
}
.counter-unit {
  font-size: clamp(11px, 1.6vw, 15px);
  color: var(--c-text-lt);
  letter-spacing: .25em;
}

.hero-hint {
  font-size: clamp(12px, 1.8vw, 15px);
  color: var(--c-white);
  opacity: .92;
  letter-spacing: .18em;
  text-shadow: 0 2px 12px rgba(110, 55, 30, .55);
}

/* 下滑提示 */
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: clamp(18px, 4vh, 40px);
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--c-white);
}
.scroll-cue-text {
  font-size: 12px;
  letter-spacing: .3em;
  opacity: .85;
  text-shadow: 0 2px 12px rgba(110, 55, 30, .5);
}
/* 用户开始滚动后，下滑提示自动淡出（JS 加 .is-hidden） */
.scroll-cue {
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.scroll-cue.is-hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
  pointer-events: none;
}
.scroll-cue-arrow {
  width: 18px;
  height: 18px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  animation: cueFloat 1.8s ease-in-out infinite;
}
@keyframes cueFloat {
  0%, 100% { transform: rotate(45deg) translate(0, 0); opacity: .9; }
  50%      { transform: rotate(45deg) translate(5px, 5px); opacity: .4; }
}

/* ---------- 5. 板块2-4 场景与热区 ---------- */
.scene-inner { display: flex; flex-direction: column; gap: 12px; align-items: center; }

.scene-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 52px);
  color: var(--c-white);
  letter-spacing: .18em;
  text-shadow: 0 4px 22px rgba(110, 55, 30, .5);
}
.scene-sub {
  font-size: clamp(14px, 2.2vw, 20px);
  color: var(--c-white);
  opacity: .92;
  letter-spacing: .12em;
  text-shadow: 0 2px 14px rgba(110, 55, 30, .5);
}

/* 可点击热区：一个柔和的呼吸光圈 + 文字标签
   ⚠ 换背景视频后若热区对不准画面主体，
     只需调整下面 --hot-* 变量（百分比定位） */
.hotspot {
  position: absolute;
  z-index: 3;
  /* 默认居中偏上，可按需微调 */
  --hot-top: 50%;
  --hot-left: 50%;
  --hot-w: clamp(120px, 18vw, 220px);
  --hot-h: clamp(120px, 18vw, 220px);
  top: var(--hot-top);
  left: var(--hot-left);
  width: var(--hot-w);
  height: var(--hot-h);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: transform var(--t-mid) var(--ease);
}
.hotspot:hover { transform: translate(-50%, -50%) scale(1.08); }
.hotspot:active { transform: translate(-50%, -50%) scale(.96); }

/* 呼吸光圈 */
.hotspot-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px dashed rgba(255, 250, 240, .85);
  background: radial-gradient(circle, rgba(255, 240, 220, .28), rgba(255, 240, 220, .06) 70%);
  animation: ringPulse 2.6s ease-in-out infinite;
}
@keyframes ringPulse {
  0%, 100% { transform: scale(1);   opacity: .85; }
  50%      { transform: scale(1.12); opacity: .45; }
}

.hotspot-label {
  position: relative;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255, 250, 243, .9);
  color: var(--c-terra);
  font-size: clamp(13px, 1.8vw, 16px);
  font-weight: 600;
  letter-spacing: .14em;
  box-shadow: var(--shadow-soft);
  white-space: nowrap;
}

/* 各板块热区位置（按视频画面微调这里） */
.hotspot--tv     { --hot-top: 60%; --hot-left: 80%; }
.hotspot--album  { --hot-top: 80%; --hot-left: 50%; }
.hotspot--letter { --hot-top: 80%; --hot-left: 50%; }

/* ---------- 6. 覆盖层：亲吻视频 / 成长时间轴 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-slow) var(--ease), visibility var(--t-slow) var(--ease);
}
.overlay.is-open { opacity: 1; visibility: visible; }

/* 亲吻视频全屏 */
.overlay--kiss { background: #2f1b12; }
.kiss-media { position: absolute; inset: 0; }
.kiss-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.kiss-text {
  position: absolute;
  left: 50%;
  bottom: 12vh;
  transform: translateX(-50%);
  z-index: 2;
  font-family: var(--font-display);
  font-size: clamp(20px, 3.6vw, 38px);
  color: var(--c-white);
  letter-spacing: .22em;
  text-shadow: 0 4px 24px rgba(80, 35, 15, .6);
  opacity: 0;
  animation: kissTextIn 1.4s var(--ease) .6s forwards;
  white-space: nowrap;
}
@keyframes kissTextIn {
  from { opacity: 0; transform: translate(-50%, 16px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.skip-btn {
  position: absolute;
  right: clamp(16px, 4vw, 40px);
  bottom: clamp(16px, 4vh, 36px);
  z-index: 3;
  padding: 10px 22px;
  border-radius: 999px;
  background: rgba(255, 250, 243, .85);
  color: var(--c-terra);
  font-size: 14px;
  letter-spacing: .12em;
  transition: background var(--t-fast) var(--ease);
}
.skip-btn:hover { background: var(--c-white); }

/* 成长时间轴 */
.overlay--timeline {
  background: linear-gradient(160deg, var(--c-cream) 0%, var(--c-cream-2) 55%, var(--c-peach) 100%);
  display: flex;
  flex-direction: column;
  padding: clamp(18px, 4vh, 44px) 0;
  /* 转场层级高于亲吻视频，支持两者交叉淡入淡出 */
  z-index: 62;
}

/* 弹层入场：内容柔和上浮（配合整体淡入） */
.overlay--timeline .timeline-head,
.overlay--timeline .timeline-wrap,
.overlay--timeline .timeline-foot {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.overlay--timeline.is-open .timeline-head  { opacity: 1; transform: none; transition-delay: .12s; }
.overlay--timeline.is-open .timeline-wrap  { opacity: 1; transform: none; transition-delay: .22s; }
.overlay--timeline.is-open .timeline-foot  { opacity: 1; transform: none; transition-delay: .32s; }
.timeline-head {
  position: relative;
  text-align: center;
  /* 顶部留出一行，避免「回到首页」按钮与标题重叠 */
  padding: 54px clamp(48px, 8vw, 80px) 0;
}
/* 「回到首页」快捷入口 */
.home-btn {
  position: absolute;
  left: clamp(12px, 3vw, 32px);
  top: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--c-white);
  color: var(--c-terra);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .12em;
  box-shadow: var(--shadow-soft);
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.home-btn svg { width: 17px; height: 17px; fill: currentColor; }
.home-btn:hover {
  transform: translateY(-2px);
  background: var(--c-peach);
}
.home-btn:active { transform: translateY(0) scale(.96); }
.timeline-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 4vw, 44px);
  color: var(--c-brown);
  letter-spacing: .14em;
}
.timeline-sub {
  margin-top: 8px;
  font-size: clamp(12px, 1.8vw, 16px);
  color: var(--c-text-lt);
  letter-spacing: .12em;
}
.timeline-foot {
  text-align: center;
  margin-top: clamp(10px, 2vh, 22px);
  color: var(--c-text-lt);
  letter-spacing: .28em;
  font-size: 13px;
}

.timeline-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  margin-top: clamp(12px, 3vh, 30px);
}

/* ---------- 照片点击放大预览层 ---------- */
.overlay--lightbox { z-index: 70; }
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 16, 10, .78);
  backdrop-filter: blur(6px);
}
.overlay--lightbox .overlay-close {
  z-index: 3;
  background: rgba(255, 250, 243, .92);
}
.lightbox-inner {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: clamp(48px, 8vh, 72px) clamp(18px, 5vw, 64px) clamp(24px, 5vh, 48px);
  pointer-events: none;               /* 仅图片/文字接收事件，空白处点击穿透到遮罩关闭 */
}
.lightbox-inner img {
  max-width: min(92vw, 900px);
  max-height: 78vh;
  border-radius: var(--r-lg);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .45);
  object-fit: contain;
  pointer-events: auto;
  /* 入场：轻微缩放 + 淡入，像照片被拿起端到眼前 */
  opacity: 0;
  transform: scale(.92);
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.overlay--lightbox.is-open .lightbox-inner img { opacity: 1; transform: none; }
.lightbox-caption {
  color: var(--c-cream);
  font-size: clamp(14px, 2vw, 17px);
  letter-spacing: .1em;
  text-align: center;
  opacity: 0;
  transition: opacity .35s var(--ease) .12s;
}
.overlay--lightbox.is-open .lightbox-caption { opacity: .92; }

/* 横向滚动容器 */
.timeline-scroll {
  display: flex;
  gap: clamp(18px, 3vw, 36px);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 18px clamp(24px, 8vw, 120px);
  width: 100%;
  scrollbar-width: none;
}
.timeline-scroll::-webkit-scrollbar { display: none; }

/* 时间轴节点卡片 */
.timeline-card {
  flex: 0 0 auto;
  width: clamp(230px, 62vw, 340px);
  scroll-snap-align: center;
  background: var(--c-white);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform var(--t-mid) var(--ease), box-shadow var(--t-mid) var(--ease);
  user-select: none;
}
.timeline-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-card);
}
.timeline-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}
.timeline-info { padding: 16px 20px 22px; }
.timeline-date {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--c-cream-2);
  color: var(--c-terra);
  font-size: 13px;
  letter-spacing: .1em;
  font-variant-numeric: tabular-nums;
}
.timeline-card h3 {
  margin: 10px 0 6px;
  font-family: var(--font-display);
  font-size: clamp(17px, 2.4vw, 21px);
  color: var(--c-brown);
}
.timeline-card p {
  font-size: 14px;
  color: var(--c-text);
  line-height: 1.75;
}

/* 时间轴左右箭头 */
.timeline-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: clamp(38px, 5vw, 52px);
  height: clamp(38px, 5vw, 52px);
  border-radius: 50%;
  background: var(--c-white);
  color: var(--c-terra);
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1;
  box-shadow: var(--shadow-soft);
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.timeline-arrow:hover { background: var(--c-peach); transform: translateY(-50%) scale(1.08); }
.timeline-arrow--prev { left: clamp(6px, 2vw, 28px); }
.timeline-arrow--next { right: clamp(6px, 2vw, 28px); }

/* ---------- 7. 弹窗：电视 / 相册 / 信件 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 40px);
}
/* 未打开的弹层必须彻底隐藏，否则会拦截页面点击 */
.modal[hidden],
.overlay[hidden] { display: none !important; }
/* 作者样式写了 display:flex 的元素，同样必须尊重 hidden 属性（否则错误提示会常驻显示） */
.tv-error[hidden] { display: none !important; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(96, 52, 32, .5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity var(--t-slow) var(--ease);
}
.modal.is-open .modal-backdrop { opacity: 1; }

.modal-card {
  position: relative;
  width: min(1080px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: var(--c-white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  opacity: 0;
  transform: translateY(22px) scale(.97);
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
}
.modal.is-open .modal-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* 关闭按钮（覆盖层 / 弹窗通用） */
.overlay-close {
  position: absolute;
  top: clamp(12px, 2vw, 22px);
  right: clamp(12px, 2vw, 22px);
  z-index: 5;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 250, 243, .9);
  color: var(--c-terra);
  font-size: 17px;
  line-height: 1;
  box-shadow: var(--shadow-soft);
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.overlay-close:hover { transform: rotate(90deg); background: var(--c-white); }

/* --- 电视播放器弹窗 --- */
.tv-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  min-height: 420px;
}
.tv-player {
  position: relative;
  background: #241408;
  border-radius: var(--r-lg) 0 0 var(--r-lg);
  display: flex;
  flex-direction: column;
}
.tv-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #241408;
  border-radius: var(--r-lg) 0 0 0;
}
.tv-error {
  position: absolute;
  inset: 0 0 auto 0;
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(36, 20, 8, .92);
  color: var(--c-cream);
  font-size: 16px;
}
.tv-error-tip { font-size: 13px; opacity: .75; }
.tv-error code {
  background: rgba(255, 246, 236, .16);
  padding: 2px 8px;
  border-radius: 6px;
}
.tv-now {
  padding: 16px 22px 20px;
  color: var(--c-cream);
}
.tv-now h3 {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: .08em;
}
.tv-now p { margin-top: 4px; font-size: 13px; opacity: .8; }

/* 侧边播放列表 */
.tv-list-wrap {
  padding: 22px 18px;
  background: var(--c-cream);
  border-radius: 0 var(--r-lg) var(--r-lg) 0;
  overflow-y: auto;
}
.tv-list-title {
  font-family: var(--font-display);
  color: var(--c-brown);
  font-size: 17px;
  letter-spacing: .16em;
  margin-bottom: 12px;
}
.tv-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.tv-item {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--c-white);
  box-shadow: 0 4px 14px rgba(160, 105, 75, .1);
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.tv-item:hover { transform: translateX(4px); background: var(--c-cream-2); }
.tv-item.is-active {
  background: var(--c-rose);
  color: var(--c-white);
}
.tv-item.is-active .tv-item-desc { color: rgba(255, 253, 250, .85); }
.tv-item-title { font-size: 15px; font-weight: 600; }
.tv-item-desc { font-size: 12px; color: var(--c-text-lt); margin-top: 2px; }

/* --- 相册幻灯片弹窗 --- */
.modal-card--album {
  background: linear-gradient(170deg, var(--c-cream), var(--c-cream-2));
  padding: clamp(18px, 3vw, 34px);
}
.slide-stage {
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 18px);
}
.slide-img-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  background: var(--c-peach);
  aspect-ratio: 4 / 3;
}
/* 图片叠放，靠透明度淡入淡出切换 */
.slide-img-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .55s var(--ease);
}
.slide-img-wrap img.is-shown { opacity: 1; }

.slide-arrow {
  flex: 0 0 auto;
  width: clamp(38px, 5vw, 50px);
  height: clamp(38px, 5vw, 50px);
  border-radius: 50%;
  background: var(--c-white);
  color: var(--c-terra);
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1;
  box-shadow: var(--shadow-soft);
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.slide-arrow:hover { background: var(--c-peach); transform: scale(1.1); }

/* 照片时间戳（日期） */
.slide-date {
  margin: 18px 0 4px;
  text-align: center;
  font-size: clamp(12px, 1.6vw, 14px);
  color: var(--c-terra);
  letter-spacing: .14em;
  font-variant-numeric: tabular-nums;
}
.slide-date[hidden] { display: none; }

.slide-caption {
  margin: 4px 0 10px;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(15px, 2.2vw, 20px);
  color: var(--c-brown);
  letter-spacing: .06em;
  min-height: 1.6em;
}

/* 底部可拖拽进度条 */
.slide-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 4px 2px;
}
.slide-track {
  position: relative;
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: rgba(201, 111, 83, .18);
  cursor: pointer;
  /* 扩大触摸热区 */
  background-clip: content-box;
  padding: 10px 0;
}
.slide-fill {
  position: absolute;
  top: 10px;
  left: 0;
  height: 10px;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--c-gold), var(--c-rose));
  pointer-events: none;
}
.slide-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--c-white);
  border: 3px solid var(--c-rose);
  box-shadow: 0 4px 12px rgba(200, 90, 70, .4);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.slide-count {
  font-size: 13px;
  color: var(--c-text-lt);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* --- 信件弹窗 --- */
.modal-card--letter {
  width: min(760px, 100%);
  background: linear-gradient(175deg, var(--c-white), var(--c-cream-2));
}
.letter-paper {
  padding: clamp(28px, 5vw, 56px) clamp(22px, 5vw, 60px);
}
.letter-title {
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(21px, 3vw, 30px);
  color: var(--c-brown);
  letter-spacing: .18em;
  margin-bottom: clamp(16px, 3vw, 28px);
}
.letter-title::after {
  content: '';
  display: block;
  width: 56px;
  height: 3px;
  margin: 12px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--c-gold), var(--c-rose));
}

/* Markdown 渲染排版 */
.markdown-body { font-size: clamp(15px, 2vw, 17px); color: var(--c-text); }
.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  font-family: var(--font-display);
  color: var(--c-brown);
  margin: 1.2em 0 .6em;
  letter-spacing: .06em;
}
.markdown-body h1 { font-size: 1.5em; }
.markdown-body h2 { font-size: 1.28em; }
.markdown-body h3 { font-size: 1.12em; }
.markdown-body p { margin: .85em 0; }
.markdown-body strong { color: var(--c-terra); }
.markdown-body em { color: var(--c-terra); font-style: italic; }
.markdown-body blockquote {
  margin: 1.1em 0;
  padding: 12px 20px;
  border-left: 4px solid var(--c-rose);
  background: rgba(255, 217, 194, .3);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  color: var(--c-brown);
}
.markdown-body ul, .markdown-body ol { padding-left: 1.5em; margin: .8em 0; }
.markdown-body li { margin: .35em 0; }
.markdown-body li::marker { color: var(--c-rose); }
.markdown-body hr {
  border: none;
  height: 1px;
  margin: 1.6em 0;
  background: linear-gradient(90deg, transparent, var(--c-peach), transparent);
}
.markdown-body a { color: var(--c-terra); text-decoration: underline; text-underline-offset: 3px; }
.markdown-body code {
  background: rgba(201, 111, 83, .12);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: .9em;
}
/* 文章章节时间戳 */
.markdown-body .chapter-date {
  text-align: center;
  font-size: clamp(12px, 1.6vw, 14px);
  color: var(--c-terra);
  letter-spacing: .14em;
  font-variant-numeric: tabular-nums;
  margin: -.5em 0 1.2em;
}
/* 文章内嵌图片：圆角、限制宽度、居中 */
.markdown-body img {
  display: block;
  width: min(100%, 560px);
  margin: 1.2em auto;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  border: 6px solid var(--c-white);
  background: var(--c-cream-2);
}
/* 文章内嵌视频 */
.markdown-body video {
  display: block;
  width: min(100%, 560px);
  margin: 1.2em auto;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  background: #000;
}
/* 文章内居中诗行 / 致辞 */
.markdown-body center {
  display: block;
  text-align: center;
  line-height: 2;
  color: var(--c-brown);
}

/* --- 情书 · 左右仿真翻页 --- */
.letter-paper { position: relative; }

/* 文章滚动条：淡雅细条，悬停才浮现 */
.letter-body,
.slide-stage {
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 111, 83, .25) transparent;
}
.letter-body::-webkit-scrollbar,
.slide-stage::-webkit-scrollbar { width: 6px; height: 6px; }
.letter-body::-webkit-scrollbar-track,
.slide-stage::-webkit-scrollbar-track { background: transparent; }
.letter-body::-webkit-scrollbar-thumb,
.slide-stage::-webkit-scrollbar-thumb {
  background: rgba(201, 111, 83, .22);
  border-radius: 99px;
}
.letter-body:hover::-webkit-scrollbar-thumb,
.slide-stage:hover::-webkit-scrollbar-thumb { background: rgba(201, 111, 83, .45); }
.letter-body {
  /* 正文区可滚动，翻页时整区一起动 */
  max-height: min(58vh, 560px);
  overflow-y: auto;
  overscroll-behavior: contain;
  transform-origin: center center;
  backface-visibility: hidden;
  transition: opacity .26s var(--ease), transform .26s var(--ease);
}
/* 旧页沿方向翻出 */
.letter-paper.is-flip-next .letter-body { opacity: 0; transform: perspective(1400px) rotateY(-32deg) translateX(-6%); transform-origin: left center; }
.letter-paper.is-flip-prev .letter-body { opacity: 0; transform: perspective(1400px) rotateY( 32deg) translateX( 6%); transform-origin: right center; }
/* 新页从反方向翻入（换完内容后类已切换，天然形成 260ms 出 + 480ms 入的两段动画） */
.letter-paper.is-flip-next .letter-body,
.letter-paper.is-flip-prev .letter-body { transition-duration: .48s; }

/* 左右翻页按钮 */
.letter-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 250, 243, .92);
  color: var(--c-terra);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), opacity var(--t-fast);
}
.letter-nav:hover { background: var(--c-peach); transform: translateY(-50%) scale(1.08); }
.letter-nav:disabled { opacity: .3; cursor: default; pointer-events: none; }
.letter-nav--prev { left: 10px; }
.letter-nav--next { right: 10px; }

/* 页码指示器 */
.letter-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}
.letter-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--c-peach);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.letter-dot:hover { transform: scale(1.25); }
.letter-dot.is-active { background: var(--c-terra); transform: scale(1.3); }

/* 减少动效偏好：取消翻页动画（JS 端同样直接换页） */
.no-flip .letter-body { transition: none !important; transform: none !important; opacity: 1 !important; }

/* ---------- 8. 通用组件 ---------- */

/* 侧边圆点导航 */
.dot-nav {
  position: fixed;
  right: clamp(10px, 2vw, 26px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dot-btn {
  position: relative;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 250, 243, .55);
  border: 1.5px solid rgba(255, 250, 243, .9);
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.dot-btn.is-active {
  background: var(--c-terra);
  border-color: var(--c-white);
  transform: scale(1.35);
}
.dot-btn::after {
  content: attr(data-label);
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(107, 74, 58, .88);
  color: var(--c-cream);
  font-size: 12px;
  letter-spacing: .1em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-fast) var(--ease);
}
.dot-btn:hover::after { opacity: 1; }

/* 板块内容显现动画（JS 加 .is-visible） */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
/* 多个元素依次浮现 */
.reveal:nth-child(2) { transition-delay: .12s; }
.reveal:nth-child(3) { transition-delay: .24s; }
.reveal:nth-child(4) { transition-delay: .36s; }

/* 打开弹窗时锁定页面滚动 */
body.is-locked { overflow: hidden; }

/* ---------- 9. 响应式适配 ---------- */

/* 平板 */
@media (max-width: 900px) {
  .tv-layout { grid-template-columns: 1fr; }
  .tv-player { border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .tv-video  { border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .tv-list-wrap {
    border-radius: 0 0 var(--r-lg) var(--r-lg);
    max-height: 220px;
  }
  .tv-list { flex-direction: row; overflow-x: auto; }
  .tv-item { flex: 0 0 220px; }
}

/* 手机 */
@media (max-width: 640px) {
  html { scroll-snap-type: y proximity; }

  .hero-title { gap: 12px; letter-spacing: .02em; }
  .counter { gap: 8px; }
  .counter-item {
    /* 手机端 4 项按 2×2 排列（天/时 一行，分/秒 一行） */
    min-width: calc((100vw - 64px) / 2 - 8px);
    padding: 10px 6px;
    border-radius: 16px;
  }

  .dot-nav { right: 8px; gap: 11px; }
  .dot-btn { width: 9px; height: 9px; }
  .dot-btn::after { display: none; }

  /* 弹窗在手机上占满宽度，高度随内容自适应（避免底部大片留白） */
  .modal { padding: 0; }
  .modal-card {
    width: 100%;
    height: auto;
    max-height: 100%;
    border-radius: 0;
  }
  .tv-player { border-radius: 0; }
  .tv-video { border-radius: 0; }

  .slide-stage { gap: 4px; }
  .slide-arrow {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }
  .slide-thumb { width: 20px; height: 20px; }

  /* 手机端保留左右箭头：缩小尺寸、贴边，避免遮挡卡片内容 */
  .timeline-arrow {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }
  .timeline-arrow--prev { left: 4px; }
  .timeline-arrow--next { right: 4px; }
  .kiss-text { white-space: normal; width: 86vw; text-align: center; }

  /* 情书翻页按钮移到底部与页码并排，避免盖住窄屏正文 */
  .letter-nav {
    top: auto;
    bottom: 2px;
    transform: none;
    width: 36px;
    height: 36px;
    font-size: 20px;
  }
  .letter-nav:hover { transform: scale(1.06); }
  .letter-nav--prev { left: 8px; }
  .letter-nav--next { right: 8px; }
  .letter-dots { margin-top: 10px; }
  .letter-body { max-height: min(50vh, 420px); }

  /* 时间轴头部：缩小按钮，保证标题不被挤压 */
  .timeline-head { padding: 50px 16px 0; }
  .home-btn { padding: 8px 13px; font-size: 12px; gap: 5px; letter-spacing: .06em; }
  .home-btn svg { width: 14px; height: 14px; }
}

/* ---------- 10. 动效减弱（无障碍） ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .12s !important;
  }
  .reveal { opacity: 1; transform: none; }
}
