/* =========================================================
   9.27 生日 H5  ·  style.css
   模块顺序：
   01 变量与基础
   02 背景层（星空 / 颗粒 / 光晕）
   03 固定 UI（进度点 / 音乐按钮）
   04 页面骨架与排版
   05 开场
   06 拍立得 / 胶片条 / 卡片
   07 聊天气泡 / 便签 / 圆角照片
   08 祝福 / 彩蛋 / 结束页
   09 图片放大
   10 入场动画
   11 适配（窄屏、矮屏、横屏）
   12 减弱动画
   ========================================================= */

/* ============ 01 变量与基础 ============ */
:root {
  /* 颜色 */
  --night:      #101827;
  --night-2:    #17243A;
  --night-3:    #1E2E47;
  --cream:      #F7F3EA;
  --grey:       #C8CDD5;
  --grey-dim:   #8E97A6;
  --gold:       #E8C98A;
  --gold-soft:  rgba(232, 201, 138, 0.18);
  --line:       rgba(247, 243, 234, 0.12);
  --surface:    rgba(247, 243, 234, 0.055);
  --surface-2:  rgba(247, 243, 234, 0.085);

  /* 排版 */
  --font-cn: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Heiti SC", sans-serif;
  --font-en: Georgia, "Times New Roman", "Songti SC", serif;

  /* 间距与圆角 */
  --gap: 22px;
  --radius: 16px;
  --radius-sm: 10px;

  /* 页面横向留白（含刘海屏安全区） */
  --pad-x: max(24px, env(safe-area-inset-left), env(safe-area-inset-right));

  /* 由 JS 写入，解决微信 / iOS 下 100vh 不准的问题 */
  --app-h: 1vh;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--night);
  scroll-behavior: smooth;
  /* 只做“靠近才吸附”，不影响正常滚动 */
  scroll-snap-type: y proximity;
}

body {
  margin: 0;
  min-height: 100%;
  width: 100%;
  overflow-x: hidden;
  font-family: var(--font-cn);
  font-size: 16px;
  line-height: 1.85;
  color: var(--cream);
  background:
    radial-gradient(120% 60% at 50% 0%, #1B2C48 0%, rgba(16, 24, 39, 0) 60%),
    linear-gradient(180deg, #101827 0%, #131E31 45%, #0D1420 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }

/* 长按不选中，避免微信里误选文字 */
.page { -webkit-touch-callout: none; }
.body, .wish, .card__text, .sticky, .bubble { -webkit-user-select: none; user-select: none; }

/* ============ 02 背景层 ============ */
.sky,
.grain,
.glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.sky { z-index: 0; overflow: hidden; }

.star {
  position: absolute;
  width: var(--s, 2px);
  height: var(--s, 2px);
  border-radius: 50%;
  background: #FFF8E8;
  opacity: 0.5;
  animation: twinkle var(--dur, 5s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
/* 少数几颗偏暖黄 */
.star--warm { background: var(--gold); }

@keyframes twinkle {
  0%, 100% { opacity: 0.14; transform: scale(0.85); }
  50%      { opacity: 0.75; transform: scale(1); }
}

.glow {
  z-index: 1;
  background:
    radial-gradient(320px 320px at 82% 10%, rgba(232, 201, 138, 0.16), rgba(232, 201, 138, 0) 70%),
    radial-gradient(420px 420px at 10% 88%, rgba(120, 160, 220, 0.10), rgba(120, 160, 220, 0) 70%);
}

.grain {
  z-index: 2;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============ 03 固定 UI ============ */
.dots {
  position: fixed;
  z-index: 20;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(16, 24, 39, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(247, 243, 234, 0.08);
}

.dot {
  width: 4px;
  height: 4px;
  padding: 0;              /* 按钮默认 padding 会把小圆点撑成长条 */
  border-radius: 50%;
  background: rgba(247, 243, 234, 0.32);
  transition: background 0.4s ease, transform 0.4s ease, opacity 0.4s ease;
}

.dot.is-on {
  background: var(--gold);
  transform: scale(1.7);
}

.music {
  position: fixed;
  z-index: 21;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  right: calc(env(safe-area-inset-right, 0px) + 10px);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(16, 24, 39, 0.5);
  border: 1px solid rgba(247, 243, 234, 0.1);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.3s ease, opacity 0.3s ease;
}

.music.is-off { opacity: 0.72; }
.music:active { background: rgba(232, 201, 138, 0.16); }

/* 第一次进来时轻轻提示一下（点过之后就不再闪），
   因为微信不让自动播放，她不点就听不到 */
.music.is-hint::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 1px solid rgba(232, 201, 138, 0.55);
  animation: music-hint 2.4s ease-out infinite;
  pointer-events: none;
}

@keyframes music-hint {
  0%   { transform: scale(0.92); opacity: 0.9; }
  70%  { transform: scale(1.25); opacity: 0; }
  100% { transform: scale(1.25); opacity: 0; }
}

.music__icon {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 15px;
}

.music__icon i {
  display: block;
  width: 2px;
  height: 5px;
  border-radius: 2px;
  background: var(--gold);
  transform-origin: bottom;
}

/* 播放中：四根小音柱轻轻起伏 */
.music.is-on .music__icon i { animation: bars 1.15s ease-in-out infinite; }
.music.is-on .music__icon i:nth-child(2) { animation-delay: 0.15s; }
.music.is-on .music__icon i:nth-child(3) { animation-delay: 0.32s; }
.music.is-on .music__icon i:nth-child(4) { animation-delay: 0.48s; }

/* 未播放时音柱更暗一点，一眼能看出状态 */
.music.is-off .music__icon i { opacity: 0.5; }

@keyframes bars {
  0%, 100% { height: 4px;  opacity: 0.65; }
  50%      { height: 15px; opacity: 1; }
}

/* 音乐文件缺失时：按钮变暗、不可点 */
.music.is-dead { opacity: 0.3; pointer-events: none; }

/* ============ 04 页面骨架与排版 ============ */
.pages { position: relative; z-index: 10; }

.page {
  position: relative;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  min-height: calc(var(--app-h) * 100);
  padding:
    calc(env(safe-area-inset-top, 0px) + 82px)
    var(--pad-x)
    calc(env(safe-area-inset-bottom, 0px) + 64px);
}

/* 内容较长的几页不做吸附，保证阅读时滚动顺手 */
#p3, #p4, #p5 { scroll-snap-align: none; }

.wrap { width: 100%; max-width: 520px; margin: 0 auto; }

.kicker {
  margin: 0 0 14px;
  font-family: var(--font-en);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.85;
}

.display {
  margin: 0 0 18px;
  font-size: clamp(34px, 10.5vw, 46px);
  line-height: 1.28;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.title {
  margin: 0 0 18px;
  font-size: clamp(24px, 7.4vw, 31px);
  line-height: 1.5;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.lead {
  margin: 0 0 10px;
  font-size: 16px;
  color: var(--grey);
}

.lead--sm { font-size: 14px; color: var(--grey-dim); }

.body {
  margin: 0 0 14px;
  font-size: 15.5px;
  color: var(--grey);
}

.body--dim { color: var(--grey-dim); font-size: 14px; }

/* 小插曲 / 备注用的窄条 */
.aside {
  position: relative;
  margin: 24px 0 6px;
  padding: 14px 16px 15px;
  font-size: 13.5px;
  line-height: 1.95;
  color: var(--grey);
  border-left: 2px solid rgba(232, 201, 138, 0.45);
  background: rgba(232, 201, 138, 0.055);
  border-radius: 3px;
}

.aside__tag {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 8px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--gold);
  border: 1px solid rgba(232, 201, 138, 0.34);
  border-radius: 999px;
  vertical-align: 1px;
}

.tiny {
  margin: 26px 0 0;
  font-size: 12.5px;
  color: var(--grey-dim);
}

.tail-note {
  margin: 30px 0 0;
  font-size: 13.5px;
  color: var(--grey-dim);
  text-align: center;
}

/* 占位符统一样式：一眼能看到需要替换 */
.placeholder-note {
  margin: 12px 0 0;
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--gold);
  text-align: center;
  border: 1px dashed rgba(232, 201, 138, 0.42);
  border-radius: var(--radius-sm);
  background: var(--gold-soft);
}

/* 通用按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  margin: 34px auto 0;
  padding: 0 26px;
  font-size: 14.5px;
  letter-spacing: 0.06em;
  border-radius: 999px;
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.btn:active { transform: scale(0.97); }

.btn--ghost {
  color: var(--cream);
  border: 1px solid var(--line);
  background: var(--surface);
}

.btn--ghost:active { background: var(--surface-2); }

.btn--line {
  color: var(--gold);
  border: 1px solid rgba(232, 201, 138, 0.4);
}

.btn__arrow { font-size: 12px; opacity: 0.75; }

/* 照片加载失败时的占位标签 */
.photo-fallback {
  display: none;
  position: absolute;
  inset: 0;
  place-items: center;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--grey-dim);
  background: linear-gradient(150deg, #22314C 0%, #17243A 100%);
}

img.is-missing { display: none; }
img.is-missing + .photo-fallback { display: grid; }

/* ============ 05 开场 ============ */
.page--intro {
  align-items: center;
  text-align: center;
  justify-content: space-between;
}

.intro {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.intro__line {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  color: var(--grey);
}

.intro__num {
  margin: 4px 0;
  font-family: var(--font-en);
  font-size: clamp(56px, 20vw, 84px);
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--cream);
  text-shadow: 0 0 40px rgba(232, 201, 138, 0.28);
}

.intro__line--b {
  font-size: 19px;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: var(--cream);
}

/* 开头那句里的昵称 */
.intro__nick {
  font-family: var(--font-en);
  font-size: 1.2em;
  letter-spacing: 0.04em;
  color: var(--gold);
}

/* 让括号里的语气词不要被拆到两行 */
.nowrap { white-space: nowrap; }

/* 三行依次出现：1s → 9.27 → 生日快乐 */
.intro__line--a,
.intro__num,
.intro__line--b {
  opacity: 0;
  transform: translateY(12px);
  animation: intro-in 1.6s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.intro__line--a { animation-delay: 0.2s; }
.intro__num    { animation-delay: 1.2s; }
.intro__line--b { animation-delay: 2.1s; }

@keyframes intro-in {
  to { opacity: 1; transform: translateY(0); }
}

.scroll-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--grey-dim);
  opacity: 0;
  animation: intro-in 1.6s 3.2s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.scroll-hint__arrow {
  width: 1px;
  height: 34px;
  background: linear-gradient(180deg, rgba(232, 201, 138, 0.7), rgba(232, 201, 138, 0));
  animation: hint-move 2.6s ease-in-out infinite;
}

@keyframes hint-move {
  0%, 100% { transform: translateY(-4px); opacity: 0.5; }
  50%      { transform: translateY(4px);  opacity: 1; }
}

/* ============ 06 拍立得 / 胶片条 / 卡片 ============ */

/* --- 拍立得 --- */
.polaroid {
  width: min(74%, 260px);
  margin: 38px auto 6px;
  padding: 10px 10px 0;
  background: #F4F1E8;
  border-radius: 4px;
  transform: rotate(-2.4deg);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.4);
}

.polaroid__frame {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #22314C;
  border-radius: 2px;
}

.polaroid__frame img { width: 100%; height: 100%; object-fit: cover; }

.polaroid figcaption {
  padding: 12px 4px 14px;
  font-size: 11.5px;
  line-height: 1.5;
  color: #5A5A5A;
  text-align: center;
}

/* --- 胶片条 --- */
.filmstrip {
  margin: 30px 0 8px;
  padding: 6px 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #1B2740 0%, #131D2E 100%);
  box-shadow: inset 0 0 0 1px rgba(247, 243, 234, 0.06), 0 14px 30px rgba(0, 0, 0, 0.35);
}

.filmstrip__holes {
  height: 12px;
  background-image: radial-gradient(circle, rgba(247, 243, 234, 0.16) 1.6px, transparent 1.8px);
  background-size: 18px 12px;
  background-position: center;
}

.filmstrip__roll { overflow: hidden; padding: 2px 0; }

.film {
  display: flex;
  gap: 8px;
  padding: 0 8px;
}

.film__shot {
  position: relative;
  flex: 1 1 0;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #22314C;
  border-radius: 2px;
}

.film__shot img { width: 100%; height: 100%; object-fit: cover; }

.film__shot .photo-fallback {
  font-family: var(--font-en);
  font-size: 18px;
  color: rgba(247, 243, 234, 0.45);
}

/* --- 经历卡片 --- */
.origin {
  position: relative;
  margin: 30px 0 0;
  padding: 22px 20px 24px;
  border-radius: 4px 18px 4px 18px;
  background:
    linear-gradient(150deg, rgba(232, 201, 138, 0.12) 0%, rgba(232, 201, 138, 0.03) 55%),
    rgba(11, 17, 28, 0.5);
  border: 1px solid rgba(232, 201, 138, 0.28);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.3);
}

/* 左上角的一小块“台球巧粉”配色，让这一块和其他卡片不一样 */
.origin::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 22px;
  width: 46px;
  height: 10px;
  border-radius: 2px;
  background: rgba(232, 201, 138, 0.28);
  transform: rotate(2.5deg);
}

.origin__date {
  margin: 0;
  font-family: var(--font-en);
  font-size: 40px;
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--gold);
}

.origin__kicker {
  margin: 8px 0 14px;
  font-size: 11.5px;
  letter-spacing: 0.24em;
  color: rgba(232, 201, 138, 0.75);
}

.origin__text {
  margin: 0;
  font-size: 15px;
  line-height: 2.05;
  color: var(--cream);
}

.origin__dim {
  font-size: 14px;
  color: var(--grey);
}

/* 下面这两组（经历卡片 / 聊天气泡 / 便签）当前页面没有用到，
   是上一版区块的样式，留着方便以后想加回来时直接用
   （原文见 tools\_备份-删掉的区块.html）。 */
.cards {
  list-style: none;
  margin: 30px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  position: relative;
  padding: 20px 20px 22px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22);
}

.card__tag {
  display: inline-block;
  margin-bottom: 10px;
  padding: 2px 9px;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--gold);
  border: 1px solid rgba(232, 201, 138, 0.34);
  border-radius: 999px;
}

.card__title {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.card__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.9;
  color: var(--grey);
}

/* 四种卡片外观，避免整页一个模板感 */
.card--tape {
  border-radius: 10px;
  transform: rotate(-0.5deg);
}
.card--tape::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 26px;
  width: 58px;
  height: 18px;
  background: rgba(232, 201, 138, 0.22);
  border-left: 1px solid rgba(247, 243, 234, 0.12);
  border-right: 1px solid rgba(247, 243, 234, 0.12);
  transform: rotate(-3deg);
}

.card--note { border-radius: 4px 14px 4px 14px; }

.card--ticket {
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(247, 243, 234, 0.06), rgba(247, 243, 234, 0.03));
}
.card--ticket::after {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  right: 14px;
  width: 1px;
  background-image: linear-gradient(180deg, rgba(247, 243, 234, 0.22) 50%, transparent 50%);
  background-size: 1px 8px;
}

.card--polaroid {
  border-radius: 6px;
  transform: rotate(0.6deg);
  padding-bottom: 30px;
}

/* ============ 07 聊天气泡 / 便签 / 圆角照片 ============ */
.chats {
  margin: 28px 0 6px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.chat {
  position: relative;
  padding: 16px 16px 18px;
  border-radius: 14px;
  background: rgba(11, 17, 28, 0.55);
  border: 1px solid rgba(247, 243, 234, 0.07);
}

.chat__mark {
  position: absolute;
  top: -9px;
  left: 16px;
  padding: 1px 8px;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--grey-dim);
  background: #141F31;
  border: 1px solid rgba(247, 243, 234, 0.08);
  border-radius: 999px;
}

.bubble {
  position: relative;
  max-width: 82%;
  margin-top: 10px;
  padding: 8px 13px;
  font-size: 14px;
  line-height: 1.65;
  border-radius: 12px;
}

.bubble--you {
  margin-right: auto;
  background: rgba(247, 243, 234, 0.9);
  color: #1A2231;
  border-top-left-radius: 4px;
}

.bubble--me {
  margin-left: auto;
  background: rgba(232, 201, 138, 0.2);
  color: var(--cream);
  border: 1px solid rgba(232, 201, 138, 0.26);
  border-top-right-radius: 4px;
}

.stickies {
  margin: 30px 0 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sticky {
  width: 88%;
  margin: 0;
  padding: 18px 20px;
  font-size: 13.5px;
  line-height: 1.95;
  color: #23293A;
  background: #F3EBD9;
  border-radius: 3px;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.32);
}

.sticky--a { transform: rotate(-1.6deg); }
.sticky--b {
  margin-left: auto;
  transform: rotate(1.4deg);
  background: #E9EEF1;
}
.sticky--c {
  width: 100%;
  margin-top: 6px;
  transform: rotate(-0.7deg);
  background: linear-gradient(180deg, #F6EFDE, #EFE6D2);
}

.duo {
  margin: 34px 0 0;
  display: flex;
  align-items: flex-end;
  gap: 14px;
}

.rounded {
  position: relative;
  flex: 1 1 0;
  margin: 0;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--radius);
  background: #22314C;
  border: 1px solid rgba(247, 243, 234, 0.08);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.34);
}

.rounded img { width: 100%; height: 100%; object-fit: cover; }

.rounded--sm {
  flex: 0 0 38%;
  aspect-ratio: 1 / 1;
  transform: translateY(-14px) rotate(1.8deg);
}

.rounded--corner {
  width: 66%;
  margin: 46px 0 0 auto;
  aspect-ratio: 4 / 3;      /* 最后一张是横版合照，别用方框裁掉人 */
  transform: rotate(2.2deg);
}

/* 可点击放大的照片 */
[data-zoom] { cursor: zoom-in; }

/* ============ 08 祝福 / 彩蛋 / 结束页 ============ */
.page--wish .wish {
  margin: 26px 0 0;
  padding: 24px 22px;
  font-size: 15.5px;
  line-height: 2.1;
  color: var(--cream);
  border-left: 1px solid rgba(232, 201, 138, 0.4);
  background: linear-gradient(90deg, rgba(232, 201, 138, 0.07), rgba(232, 201, 138, 0));
}

.wish p { margin: 0 0 18px; }
.wish p:last-child { margin-bottom: 0; }

.wish__dim { color: var(--grey); }

.wish__small {
  font-size: 13.5px;
  color: var(--grey-dim);
  letter-spacing: 0.04em;
}

.wish__end {
  margin: 34px 0 0;
  font-size: clamp(22px, 6.6vw, 27px);
  letter-spacing: 0.16em;
  color: var(--gold);
}

/* --- 几句实话 --- */
.praise {
  margin: 28px 0 0;
  padding: 22px 20px;
  border-left: 1px solid rgba(232, 201, 138, 0.35);
  background: linear-gradient(90deg, rgba(232, 201, 138, 0.065), rgba(232, 201, 138, 0));
}

.praise__line {
  margin: 0 0 16px;
  font-size: 15.5px;
  line-height: 2.05;
  color: var(--cream);
}

.praise__line:last-child { margin-bottom: 0; }

.praise__line--dim {
  font-size: 14px;
  color: var(--grey);
}

/* --- 彩蛋 --- */
.page--egg { align-items: center; }

.egg {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  text-align: center;
}

/* 彩蛋没触发前，这一页不是完全空白 */
.egg__intro {
  margin: 0 auto 6px;
  font-size: 14.5px;
  letter-spacing: 0.06em;
  color: rgba(200, 205, 213, 0.55);
  transition: opacity 1s ease;
}

.egg__intro.is-hide { opacity: 0; }

.egg__line {
  margin: 0 auto 18px;
  font-size: 16px;
  color: var(--grey);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1s ease, transform 1s ease;
}

.egg__line--big {
  font-size: clamp(22px, 6.8vw, 28px);
  letter-spacing: 0.06em;
  color: var(--cream);
}

.egg__face {
  margin: 26px 0 0;
  font-size: 15px;
  letter-spacing: 0.3em;
  color: var(--gold);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1.2s ease, transform 1.2s ease;
}

.egg__line.is-show,
.egg__face.is-show { opacity: 1; transform: translateY(0); }

.egg__hint {
  position: absolute;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 46px);
  transform: translateX(-50%);
  width: calc(100% - var(--pad-x) * 4);
  margin: 0;
  font-size: 12px;
  color: rgba(200, 205, 213, 0.45);
  text-align: center;
  transition: opacity 0.8s ease;
}

.egg__hint.is-hide { opacity: 0; }

/* 角落里的小星星（可点 5 次） */
.egg-star {
  position: absolute;
  top: 22%;
  right: calc(env(safe-area-inset-right, 0px) + 22px);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}

.egg-star span {
  width: 9px;
  height: 9px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(232, 201, 138, 0.8), 0 0 22px rgba(232, 201, 138, 0.4);
  animation: twinkle 4.5s ease-in-out infinite;
  transition: transform 0.25s ease;
}

.egg-star:active span { transform: scale(1.5); }
.egg-star.is-done { pointer-events: none; opacity: 0.35; }

/* --- 结束页 --- */
.page--end { align-items: center; text-align: center; }

.end__en {
  margin: 0;
  font-family: var(--font-en);
  font-size: clamp(30px, 10vw, 42px);
  letter-spacing: 0.06em;
  color: var(--cream);
}

.end__date {
  margin: 10px 0 0;
  font-family: var(--font-en);
  font-size: clamp(48px, 17vw, 70px);
  line-height: 1.1;
  color: rgba(232, 201, 138, 0.9);
  text-shadow: 0 0 46px rgba(232, 201, 138, 0.22);
}

.end__cn {
  margin: 26px 0 0;
  font-size: 14px;
  letter-spacing: 0.1em;
  color: var(--grey-dim);
}

.signature {
  margin: 44px 0 0;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: rgba(200, 205, 213, 0.42);
}

/* ============ 09 图片放大 ============ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 28px;
  background: rgba(8, 12, 20, 0.94);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.lightbox.is-open { opacity: 1; }
.lightbox[hidden] { display: none; }

.lightbox img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 6px;
}

.lightbox__tip {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: rgba(200, 205, 213, 0.5);
}

/* ============ 10 入场动画 ============ */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 1.1s cubic-bezier(0.22, 0.61, 0.36, 1),
              transform 1.1s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: opacity, transform;
}

[data-reveal].is-in { opacity: 1; transform: translateY(0); }

/* 标题与正文也做一次很轻的浮起 */
.reveal .kicker,
.reveal .display,
.reveal .title,
.reveal .lead,
.reveal .body,
.reveal .wish,
.reveal .wish__end,
.reveal .end__en,
.reveal .end__date {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1s cubic-bezier(0.22, 0.61, 0.36, 1),
              transform 1s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.reveal.is-in .kicker,
.reveal.is-in .display,
.reveal.is-in .title,
.reveal.is-in .lead,
.reveal.is-in .body,
.reveal.is-in .wish,
.reveal.is-in .wish__end,
.reveal.is-in .end__en,
.reveal.is-in .end__date {
  opacity: 1;
  transform: translateY(0);
}

/* 同一层里元素依次出现 */
.reveal.is-in .kicker      { transition-delay: 0.05s; }
.reveal.is-in .display,
.reveal.is-in .title       { transition-delay: 0.16s; }
.reveal.is-in .lead        { transition-delay: 0.28s; }
.reveal.is-in .body        { transition-delay: 0.38s; }
.reveal.is-in .wish        { transition-delay: 0.34s; }
.reveal.is-in .wish__end   { transition-delay: 0.5s; }

/* ============ 11 适配 ============ */

/* 小屏（iPhone SE 等 320–360px） */
@media (max-width: 360px) {
  :root { --pad-x: max(18px, env(safe-area-inset-left), env(safe-area-inset-right)); }
  body { font-size: 15px; }
  .card__text, .bubble { font-size: 13.5px; }
  .sticky { width: 94%; padding: 16px 16px; }
  .rounded--sm { flex-basis: 42%; }
}

/* 矮屏（横屏或小机型） */
@media (max-height: 620px) {
  .page { padding-top: calc(env(safe-area-inset-top, 0px) + 66px); }
  .display { font-size: clamp(28px, 8.6vw, 36px); }
  .intro__num { font-size: clamp(46px, 16vw, 64px); }
}

/* 更宽的手机 / 平板 */
@media (min-width: 560px) {
  .page { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 80px); }
  .wrap { max-width: 560px; }
}

/* 横屏时给一点额外留白，避免贴边 */
@media (orientation: landscape) and (max-height: 520px) {
  .page { padding-top: 60px; padding-bottom: 60px; }
}

/* ============ 12 减弱动画 ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; scroll-snap-type: none; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .intro__line--a,
  .intro__num,
  .intro__line--b,
  .scroll-hint {
    opacity: 1;
    transform: none;
  }

  [data-reveal],
  .reveal .kicker,
  .reveal .display,
  .reveal .title,
  .reveal .lead,
  .reveal .body,
  .reveal .wish,
  .reveal .wish__end,
  .reveal .end__en,
  .reveal .end__date {
    opacity: 1;
    transform: none;
  }
}
