/* ===========================================================
   安妮贝可 · 电子生日贺卡  —— 样式表
   作者：为「安妮贝可蛋糕店」定制
   说明：纯静态、零依赖，移动端优先
   =========================================================== */

/* ---------- 1. 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", system-ui, -apple-system, sans-serif;
  background: #F2E7E4;
  color: #4A3339;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --font-hand: "Kaiti SC", "STKaiti", "KaiTi", "楷体", "Xingkai SC", "Songti SC", serif;
  --font-script: "Snell Roundhand", "Segoe Script", "Brush Script MT", "Gabriola", cursive;
  /* 正文衬线：和参考图一样的宋体，端正好读 */
  --font-serif: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif SC",
                "SimSun", "宋体", "Microsoft YaHei", serif;
  --font-mono: "SF Mono", "Cascadia Mono", "Consolas", monospace;

  /* 默认主题：樱桃粉（可被 data-theme 覆盖） */
  --bg1: #FBD9DE;
  --bg2: #F4BAC6;
  --bg3: #EFA3B4;
  --ink: #5A3540;
  --ink-soft: rgba(90, 53, 64, 0.62);
  --ink-faint: rgba(90, 53, 64, 0.34);
  --accent: #D4657C;
  --accent-2: #F2A0B2;
  --card: #FFF8F6;
  --line: rgba(122, 74, 88, 0.16);
  --shadow: 0 18px 44px rgba(120, 55, 75, 0.18);
}

/* ---------- 2. 主题色 ---------- */
[data-theme="pink"] {
  --bg1: #FBD9DE; --bg2: #F4BAC6; --bg3: #EFA3B4;
  --ink: #5A3540; --ink-soft: rgba(90, 53, 64, 0.62); --ink-faint: rgba(90, 53, 64, 0.34);
  --accent: #D4657C; --accent-2: #F2A0B2; --card: #FFF8F6;
  --line: rgba(122, 74, 88, 0.16);
  --shadow: 0 18px 44px rgba(120, 55, 75, 0.18);
}

[data-theme="matcha"] {
  --bg1: #D9E6BB; --bg2: #BBD492; --bg3: #9FBF76;
  --ink: #33421F; --ink-soft: rgba(51, 66, 31, 0.62); --ink-faint: rgba(51, 66, 31, 0.32);
  --accent: #6E8F49; --accent-2: #A7C57B; --card: #FBFDF3;
  --line: rgba(60, 80, 40, 0.16);
  --shadow: 0 18px 44px rgba(60, 80, 35, 0.2);
}

[data-theme="cream"] {
  --bg1: #FDEDCB; --bg2: #F8D89E; --bg3: #F2C377;
  --ink: #5C4123; --ink-soft: rgba(92, 65, 35, 0.64); --ink-faint: rgba(92, 65, 35, 0.32);
  --accent: #C08A3A; --accent-2: #E8BE76; --card: #FFFCF3;
  --line: rgba(120, 88, 45, 0.16);
  --shadow: 0 18px 44px rgba(140, 100, 40, 0.2);
}

[data-theme="mist"] {
  --bg1: #DDEAF3; --bg2: #C1D7E7; --bg3: #A5C2D7;
  --ink: #2F4553; --ink-soft: rgba(47, 69, 83, 0.64); --ink-faint: rgba(47, 69, 83, 0.3);
  --accent: #5B8098; --accent-2: #9FBBD0; --card: #F8FCFE;
  --line: rgba(50, 75, 90, 0.16);
  --shadow: 0 18px 44px rgba(40, 70, 90, 0.2);
}

/* ---------- 3. 外壳 ---------- */
.card {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  touch-action: pan-y;
  background: var(--bg2);
  background: radial-gradient(125% 88% at 50% -6%, var(--bg1) 0%, var(--bg2) 58%, var(--bg3) 100%);
  color: var(--ink);
  isolation: isolate;
}

/* ---------- 3.5 背景：多层极光 ---------- */
.backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.aurora {
  position: absolute;
  display: block;
  border-radius: 50%;
  will-change: transform;
}

.aurora.a1 {
  width: 86%;
  padding-bottom: 86%;
  left: -30%;
  top: -22%;
  background: radial-gradient(circle at 50% 50%, #fff 0%, rgba(255, 255, 255, 0) 66%);
  opacity: .5;
  filter: blur(34px);
  animation: auroraA 24s ease-in-out infinite alternate;
}

.aurora.a2 {
  width: 74%;
  padding-bottom: 74%;
  right: -26%;
  top: 14%;
  background: radial-gradient(circle at 50% 50%, var(--accent-2) 0%, rgba(255, 255, 255, 0) 64%);
  opacity: .46;
  filter: blur(42px);
  animation: auroraB 30s ease-in-out infinite alternate;
}

.aurora.a3 {
  width: 92%;
  padding-bottom: 92%;
  left: -20%;
  bottom: -34%;
  background: radial-gradient(circle at 50% 50%, #fff 0%, rgba(255, 255, 255, 0) 70%);
  opacity: .4;
  filter: blur(38px);
  animation: auroraC 34s ease-in-out infinite alternate;
}

/* 一点暖色，避免整体发灰 */
.aurora.a4 {
  width: 58%;
  padding-bottom: 58%;
  right: -12%;
  bottom: 6%;
  background: radial-gradient(circle at 50% 50%, rgba(255, 214, 160, .95) 0%, rgba(255, 214, 160, 0) 62%);
  opacity: .34;
  filter: blur(46px);
  animation: auroraA 27s ease-in-out -8s infinite alternate-reverse;
}

@keyframes auroraA {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(6%, 5%, 0) scale(1.12); }
  100% { transform: translate3d(-4%, 9%, 0) scale(1.04); }
}

@keyframes auroraB {
  0%   { transform: translate3d(0, 0, 0) scale(1.05); }
  50%  { transform: translate3d(-7%, 6%, 0) scale(.94); }
  100% { transform: translate3d(3%, -5%, 0) scale(1.1); }
}

@keyframes auroraC {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(5%, -6%, 0) scale(1.14); }
  100% { transform: translate3d(-6%, -2%, 0) scale(1.02); }
}

/* 细颗粒，模拟纸张/印刷质感 */
.grain {
  position: absolute;
  inset: -50%;
  display: block;
  opacity: .14;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  animation: grainShift 8s steps(6) infinite;
}

@keyframes grainShift {
  0%   { transform: translate3d(0, 0, 0); }
  20%  { transform: translate3d(-2%, 1%, 0); }
  40%  { transform: translate3d(1%, -2%, 0); }
  60%  { transform: translate3d(-1%, 2%, 0); }
  80%  { transform: translate3d(2%, -1%, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

/* 暗角，让中间的卡片更聚焦 */
.vignette {
  position: absolute;
  inset: 0;
  display: block;
  background: radial-gradient(125% 82% at 50% 44%,
    rgba(0, 0, 0, 0) 46%,
    rgba(70, 28, 44, .16) 82%,
    rgba(60, 20, 36, .3) 100%);
}

/* 漂浮糖珠 */
.floaters { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }

.floaters s {
  position: absolute;
  top: 100%;
  display: block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #fff;
  opacity: .55;
  animation: drift linear infinite;
  text-decoration: none;
}

.floaters s.sq { border-radius: 2px; transform: rotate(20deg); }
.floaters s.hd { border-radius: 50% 50% 50% 0; }

@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0; }
  8%   { opacity: .6; }
  85%  { opacity: .4; }
  100% { transform: translate3d(0, -118vh, 0) rotate(220deg); opacity: 0; }
}

/* ---------- 4. 竖向滚动 ---------- */
.scroller {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y proximity;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.scroller::-webkit-scrollbar { display: none; }

/* 还没解锁时锁住，别让人提前翻过去 */
.scroller.locked { overflow: hidden; }

.screen {
  position: relative;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  scroll-snap-align: start;
  padding: 70px 22px 96px;
  padding: max(64px, calc(env(safe-area-inset-top) + 40px)) 22px
           max(92px, calc(env(safe-area-inset-bottom) + 86px));
}

/* 每一屏背后有一团自己的光，换屏时明暗会变 */
.screen::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 128%;
  height: 76%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%,
    var(--glow, rgba(255, 255, 255, .34)) 0%,
    rgba(255, 255, 255, 0) 66%);
  opacity: 0;
  transition: opacity 1.1s ease;
  pointer-events: none;
}

.screen.in::before { opacity: 1; }
.s-gallery::before { --glow: rgba(255, 232, 205, .5); }
.s-letter::before { --glow: rgba(255, 255, 255, .42); }
.s-cake::before { --glow: rgba(255, 214, 158, .5); }

.wrap {
  position: relative;
  margin: auto;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* 拆开的一瞬间，光从卡片里透出来 */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: radial-gradient(circle at 50% 44%, #fff 0%, rgba(255, 255, 255, .55) 32%, rgba(255, 255, 255, 0) 68%);
  opacity: 0;
}

.card.bloom::after {
  animation: bloom .85s cubic-bezier(.2, .7, .3, 1) forwards;
}

@keyframes bloom {
  0%   { opacity: 0; }
  22%  { opacity: .85; }
  100% { opacity: 0; }
}

/* ---------- 5. 通用文字 ---------- */
.eyebrow {
  font-size: 11px;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 14px;
  font-weight: 500;
  padding-left: .34em;
}

/* 点阵 LED 标题 */
.dot-title {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1.5;
  margin: 0;
  color: #fff;
  font-size: clamp(26px, 8.4vw, 40px);
  text-shadow: 0 2px 18px rgba(255, 255, 255, .38);
  word-break: break-word;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .dot-title {
    color: transparent;
    background-image: radial-gradient(circle at center, #fff 36%, rgba(255, 255, 255, 0) 40%);
    background-size: 5px 5px;
    background-position: center;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  .dot-title.small { background-size: 4px 4px; }
}

.script {
  font-family: var(--font-script);
  font-size: clamp(30px, 10vw, 44px);
  line-height: 1.25;
  color: #fff;
  margin: 10px 0 0;
  opacity: .92;
  text-shadow: 0 4px 22px rgba(0, 0, 0, .1);
}

.hand {
  font-family: var(--font-hand);
  font-size: clamp(17px, 4.8vw, 20px);
  line-height: 1.85;
  color: var(--ink);
  margin: 0;
}

.muted { color: var(--ink-soft); }

/* 玻璃面板 */
.glass {
  width: 100%;
  max-width: 320px;
  border-radius: 20px;
  padding: 16px;
  background: rgba(255, 255, 255, .3);
  border: 1px solid rgba(255, 255, 255, .55);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .08);
}

/* ---------- 6. 封面 ---------- */
.s-cover { justify-content: center; }

.cover-brand {
  font-size: 10.5px;
  letter-spacing: .3em;
  color: var(--ink-soft);
  margin: 0 0 22px;
  padding-left: .3em;
}

.cover-title { font-size: clamp(30px, 9.6vw, 46px); }

.cover-sub {
  font-family: var(--font-hand);
  font-size: clamp(15px, 4.4vw, 17px);
  color: var(--ink-soft);
  margin: 14px 0 30px;
  letter-spacing: .04em;
}

.gate { display: flex; flex-direction: column; gap: 10px; }

.gate-label {
  font-size: 11.5px;
  letter-spacing: .22em;
  color: var(--ink-soft);
  margin: 0 0 2px;
  padding-left: .22em;
}

.gate-input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .8);
  background: rgba(255, 255, 255, .62);
  border-radius: 14px;
  height: 50px;
  padding: 0 14px;
  font-size: 20px;
  letter-spacing: .55em;
  text-align: center;
  text-indent: .55em;
  font-family: var(--font-mono);
  color: var(--ink);
  outline: none;
  transition: box-shadow .25s, background .25s, border-color .25s;
}

.gate-input::placeholder {
  font-size: 13px;
  letter-spacing: .1em;
  text-indent: .1em;
  color: var(--ink-faint);
  font-family: inherit;
}

.gate-input:focus {
  background: rgba(255, 255, 255, .9);
  border-color: #fff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .35);
}

.gate-input.shake { animation: shake .42s cubic-bezier(.36, .07, .19, .97); }

@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  height: 50px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  letter-spacing: .14em;
  font-weight: 500;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .16);
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s;
}

.btn:active { transform: scale(.975); }
.btn.ghost { background: rgba(255, 255, 255, .5); color: var(--ink); box-shadow: none; border: 1px solid rgba(255, 255, 255, .8); }

.gate-note {
  font-size: 11.5px;
  color: var(--ink-soft);
  margin: 12px 0 0;
  line-height: 1.7;
  min-height: 20px;
}

.gate-skip {
  margin-top: 16px;
  font-size: 12px;
  color: var(--ink-soft);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
  font-family: inherit;
  letter-spacing: .06em;
  padding: 6px;
}

/* 解锁动效 */
.gate-exit { animation: gateOut .5s ease forwards; }

@keyframes gateOut {
  to { opacity: 0; transform: scale(.94) translateY(-8px); }
}

/* ---------- 7. 蛋糕页 ---------- */
.s-cake { justify-content: center; gap: 6px; }

.cake-stage {
  width: min(84%, 330px);
  margin: 4px 0 2px;
  position: relative;
  cursor: pointer;
}

.cake-stage svg {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* 烛光把周围照亮一点，氛围更强 */
.cake-stage::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 30%;
  width: 130%;
  height: 130%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 216, 158, .55) 0%, rgba(255, 216, 158, 0) 62%);
  opacity: 0;
  transition: opacity 1.6s ease;
  pointer-events: none;
}

.screen.in .cake-stage::before {
  opacity: 1;
  animation: breathe 5.5s ease-in-out infinite;
}

.screen.in .cake-stage.out::before {
  opacity: 0;
  animation: none;
}

@keyframes breathe {
  0%, 100% { opacity: .72; }
  50%      { opacity: 1; }
}

.flame {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: flicker 1.7s ease-in-out infinite;
}

@keyframes flicker {
  0%, 100% { transform: scale(1) rotate(0deg); }
  22%      { transform: scale(1.07, .93) rotate(-3.5deg); }
  46%      { transform: scale(.95, 1.07) rotate(2.5deg); }
  70%      { transform: scale(1.05, .96) rotate(-2deg); }
}

.flame-glow {
  transform-box: fill-box;
  transform-origin: 50% 60%;
  animation: glow 2.4s ease-in-out infinite;
}

@keyframes glow {
  0%, 100% { opacity: .32; }
  50%      { opacity: .58; }
}

.smoke {
  opacity: 0;
  transition: opacity .5s ease .2s;
}

.cake-stage.out .flame,
.cake-stage.out .flame-glow {
  opacity: 0;
  animation: none;
  transition: opacity .3s ease;
}
.cake-stage.out .smoke { opacity: 1; animation: smokeUp 2.2s ease-out .1s forwards; }

@keyframes smokeUp {
  0%   { opacity: 0; transform: translateY(6px) scale(.7); }
  30%  { opacity: .75; }
  100% { opacity: 0; transform: translateY(-26px) scale(1.35); }
}

.cake-bob,
.smoke {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

.cake-bob { animation: bob 4.2s ease-in-out infinite; }

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

.cake-name { margin: 6px 0 0; }

.blow-hint {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin: 14px 0 0;
  letter-spacing: .1em;
  transition: opacity .3s;
}

.like-btn {
  margin-top: 22px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .42);
  border: 1px solid rgba(255, 255, 255, .72);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  letter-spacing: .1em;
  cursor: pointer;
  transition: transform .2s, background .25s;
}

.like-btn:active { transform: scale(.95); }
.like-btn.liked { background: var(--ink); color: #fff; border-color: transparent; }
.like-btn .heart { font-size: 14px; line-height: 1; }

/* ---------- 8. 许愿页 ---------- */
.s-wish { justify-content: center; }

.wish-lead {
  font-family: var(--font-hand);
  font-size: clamp(20px, 6vw, 26px);
  color: var(--ink);
  margin: 0 0 20px;
  letter-spacing: .06em;
  line-height: 1.6;
}

.wish-card {
  width: 100%;
  max-width: 330px;
  background: var(--card);
  border-radius: 18px;
  padding: 26px 22px;
  box-shadow: var(--shadow);
  position: relative;
}

.wish-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  pointer-events: none;
}

.wish-text {
  font-family: var(--font-hand);
  font-size: clamp(16px, 4.6vw, 18.5px);
  line-height: 2.05;
  color: var(--ink);
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.wish-deco {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 22px 0 0;
  font-size: 16px;
  opacity: .7;
  letter-spacing: .3em;
}

/* ---------- 9. 相册页 ---------- */
.s-gallery { justify-content: center; }

.gallery-lead {
  font-family: var(--font-hand);
  font-size: clamp(16px, 4.4vw, 18px);
  color: var(--ink-soft);
  margin: 0 0 18px;
  letter-spacing: .06em;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  width: 100%;
  max-width: 360px;
}

.pole {
  background: #fff;
  padding: 8px 8px 30px;
  border-radius: 4px;
  box-shadow: 0 10px 26px rgba(90, 50, 60, .16);
  transform: rotate(var(--rot, -2deg));
  transition: transform .3s ease;
  position: relative;
}

.pole:nth-child(4n+2) { --rot: 2.4deg; }
.pole:nth-child(4n+3) { --rot: -1.4deg; }
.pole:nth-child(4n+4) { --rot: 1.8deg; }

.pole:hover { transform: rotate(0deg) scale(1.02); }

.pole-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 2px;
  overflow: hidden;
  display: block;
  background: var(--bg1);
}

.pole-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  animation: kenburns 15s ease-in-out infinite alternate;
  will-change: transform;
}

.pole:nth-child(2n) .pole-img img { animation-duration: 18s; animation-delay: -4s; }
.pole:nth-child(3n) .pole-img img { animation-duration: 13s; animation-delay: -8s; }
.pole:nth-child(5n) .pole-img img { animation-duration: 21s; animation-delay: -2s; }

/* 照片缓慢呼吸，让静止的图也有生命 */
@keyframes kenburns {
  from { transform: scale(1) translate3d(0, 0, 0); }
  to   { transform: scale(1.075) translate3d(0, -1.6%, 0); }
}

.pole-img svg { width: 100%; height: 100%; display: block; }

.pole-cap {
  position: absolute;
  left: 0; right: 0; bottom: 7px;
  text-align: center;
  font-family: var(--font-hand);
  font-size: 13px;
  color: #6E5560;
  padding: 0 8px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* 胶带 */
.pole::after {
  content: "";
  position: absolute;
  top: -8px; left: 50%;
  width: 46px; height: 16px;
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(255, 255, 255, .3);
  transform: translateX(-50%) rotate(-3deg);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
}

/* ---------- 10. 长信页 ---------- */
.s-letter { justify-content: center; }

.paper {
  width: 100%;
  max-width: 350px;
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 30px 26px 24px;
  position: relative;
  text-align: left;
  overflow: hidden;
}

.paper::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 10px, var(--accent-2) 10px 20px);
  opacity: .55;
}

.letter-head {
  font-family: var(--font-hand);
  font-size: 19px;
  color: var(--accent);
  margin: 0 0 16px;
  letter-spacing: .05em;
}

.letter-body {
  font-family: var(--font-hand);
  font-size: clamp(15.5px, 4.4vw, 17.5px);
  line-height: 2;
  color: #4E3A42;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 3em;
}

.caret {
  display: inline-block;
  width: 1px;
  height: 1.05em;
  background: var(--accent);
  vertical-align: -0.16em;
  margin-left: 2px;
  animation: blink .9s step-end infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.letter-foot {
  margin-top: 22px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.letter-sign {
  font-family: var(--font-hand);
  font-size: 16.5px;
  color: var(--ink);
  line-height: 1.7;
  text-align: right;
  margin-left: auto;
}

.letter-sign small {
  display: block;
  font-size: 11.5px;
  color: var(--ink-faint);
  letter-spacing: .1em;
  font-family: var(--font-body, inherit);
  margin-top: 4px;
}

/* ---------- 11. 落款 / 店铺页 ---------- */
.s-shop { justify-content: center; gap: 0; }

.shop-name {
  font-family: var(--font-hand);
  font-size: clamp(24px, 7vw, 30px);
  letter-spacing: .14em;
  color: var(--ink);
  margin: 0;
  font-weight: 400;
}

.shop-from {
  font-family: var(--font-hand);
  font-size: clamp(13px, 3.8vw, 15px);
  color: var(--ink-soft);
  letter-spacing: .12em;
  margin: 0 0 14px;
}

.shop-slogan {
  font-size: 11.5px;
  letter-spacing: .28em;
  color: var(--ink-soft);
  margin: 10px 0 22px;
  padding-left: .28em;
}

.coupon {
  position: relative;
  width: 100%;
  max-width: 340px;
  background: linear-gradient(135deg, #fff, var(--card));
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: var(--shadow);
  text-align: left;
  overflow: hidden;
}

/* 票券感：右侧虚线分割由 .coupon-code 提供 */
.coupon::before {
  content: "";
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  opacity: .55;
}

.coupon-main { display: flex; flex-direction: column; gap: 5px; }

.coupon-tag {
  font-size: 10px;
  letter-spacing: .24em;
  color: var(--accent);
  padding-left: .24em;
}

.coupon-title {
  font-family: var(--font-hand);
  font-size: 18px;
  color: var(--ink);
  margin: 0;
  letter-spacing: .06em;
}

.coupon-desc {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0;
}

.coupon-code {
  border-left: 1px dashed var(--line);
  padding-left: 14px;
  text-align: center;
  flex: 0 0 auto;
}

.coupon-off {
  font-family: var(--font-script);
  font-size: 30px;
  color: var(--accent);
  line-height: 1;
  display: block;
}

.coupon-code small {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  color: var(--ink-faint);
  margin-top: 6px;
  max-width: 74px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shop-lines {
  margin: 22px 0 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: 100%;
  max-width: 340px;
}

.shop-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
  letter-spacing: .04em;
  line-height: 1.5;
}

.shop-line b { font-weight: 500; color: var(--ink); }
.shop-line .ico { font-size: 13px; opacity: .7; }

.qr-box {
  margin-top: 20px;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.qr-box.show { display: flex; }

.qr-box canvas, .qr-box img {
  width: 96px; height: 96px;
  border-radius: 8px;
  background: #fff;
  padding: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .1);
  image-rendering: pixelated;
}

.qr-box span {
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--ink-faint);
}

.share-row {
  margin-top: 22px;
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 340px;
}

.share-row .btn { flex: 1; height: 46px; font-size: 13.5px; letter-spacing: .1em; }

.foot-note {
  font-size: 10.5px;
  color: var(--ink-faint);
  letter-spacing: .14em;
  margin: 24px 0 0;
}

/* ---------- 12. HUD ---------- */

/* 顶部阅读进度 */
.progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 4;
  background: rgba(255, 255, 255, .28);
  pointer-events: none;
}

.progress i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--ink);
  opacity: .55;
  transition: width .16s linear;
}

.dots {
  position: absolute;
  left: 50%;
  bottom: 20px;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
  pointer-events: auto;
  z-index: 4;
}

.dots button {
  position: relative;
  width: 6px; height: 6px;
  border-radius: 999px;
  border: 0;
  padding: 0;
  background: var(--ink-faint);
  cursor: pointer;
  transition: width .3s ease, background .3s ease;
}

/* 扩大点击热区，视觉仍是小圆点 */
.dots button::after {
  content: "";
  position: absolute;
  inset: -11px -7px;
}

.dots button.on { width: 18px; background: var(--ink); opacity: .8; }

/* 首屏的「上滑」提示 */
.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: max(52px, calc(env(safe-area-inset-bottom) + 46px));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 3;
  pointer-events: none;
  transition: opacity .5s ease;
}

.scroll-hint em {
  font-style: normal;
  font-size: 10.5px;
  letter-spacing: .28em;
  color: var(--ink-soft);
  padding-left: .28em;
}

.scroll-hint .arrow {
  width: 12px; height: 12px;
  border-right: 1.5px solid var(--ink-soft);
  border-bottom: 1.5px solid var(--ink-soft);
  transform: rotate(45deg);
  animation: arrowDown 1.9s ease-in-out infinite;
  opacity: .8;
}

@keyframes arrowDown {
  0%, 100% { transform: rotate(45deg) translate(0, 0); opacity: .35; }
  50%      { transform: rotate(45deg) translate(3px, 3px); opacity: .9; }
}

.scroll-hint.hide { opacity: 0; }


.sound-btn {
  position: absolute;
  top: 14px;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  z-index: 4;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .5);
  background: rgba(255, 255, 255, .32);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--ink);
  transition: background .25s, opacity .25s;
}

.sound-btn svg { width: 16px; height: 16px; display: block; }
.sound-btn .off { display: none; }
.sound-btn[data-on="0"] .on { display: none; }
.sound-btn[data-on="0"] .off { display: block; }

/* 播放中：外面一圈呼吸的涟漪 */
.sound-btn[data-on="1"]::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .7);
  animation: ripple 2.6s ease-out infinite;
  pointer-events: none;
}

@keyframes ripple {
  0%   { transform: scale(.86); opacity: .9; }
  100% { transform: scale(1.45); opacity: 0; }
}

/* ---------- 13. 粒子层 ---------- */
.fx { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }

.fx i {
  position: absolute;
  display: block;
  font-style: normal;
  font-size: 16px;
  animation: floatUp 2.1s cubic-bezier(.2, .7, .3, 1) forwards;
  will-change: transform, opacity;
}

@keyframes floatUp {
  0%   { opacity: 0; transform: translate3d(0, 0, 0) scale(.5); }
  18%  { opacity: 1; }
  100% { opacity: 0; transform: translate3d(var(--dx, 0px), -160px, 0) scale(1.15); }
}

/* 星光爆开 */
.spark {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #fff;
  animation: sparkOut .95s ease-out forwards;
  box-shadow: 0 0 8px rgba(255, 255, 255, .9);
}

@keyframes sparkOut {
  0%   { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--sx), var(--sy)) scale(.15); }
}

/* 屏幕内元素入场 */
.screen .reveal { opacity: 0; transform: translateY(16px); }

.screen.in .reveal {
  animation: revealIn .72s cubic-bezier(.22, .72, .18, 1) forwards;
}

.screen.in .reveal.d1 { animation-delay: .1s; }
.screen.in .reveal.d2 { animation-delay: .2s; }
.screen.in .reveal.d3 { animation-delay: .32s; }
.screen.in .reveal.d4 { animation-delay: .44s; }
.screen.in .reveal.d5 { animation-delay: .56s; }
.screen.in .reveal.d6 { animation-delay: .68s; }

@keyframes revealIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 13.5 开场倒计时 ---------- */
.opening {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(120% 90% at 50% 40%, var(--bg1) 0%, var(--bg2) 55%, var(--bg3) 100%);
  opacity: 0;
  transition: opacity .6s ease;
}

.opening.show { display: flex; opacity: 1; }
.opening.out { opacity: 0; }

.opening-halo {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 62vw;
  max-width: 300px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .85) 0%, rgba(255, 228, 190, .5) 40%, rgba(255, 255, 255, 0) 70%);
  filter: blur(18px);
  animation: haloPulse 2.8s ease-in-out infinite;
}

@keyframes haloPulse {
  0%, 100% { transform: scale(.9); opacity: .55; }
  50%      { transform: scale(1.12); opacity: .9; }
}

.opening-ring {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 58vw;
  max-width: 280px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .55);
  animation: ringSweep 2.8s linear infinite;
}

.opening-ring::after {
  content: "";
  position: absolute;
  top: -3px;
  left: 50%;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 12px rgba(255, 255, 255, .95);
}

@keyframes ringSweep {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.opening-num {
  position: relative;
  font-family: var(--font-script);
  font-size: clamp(96px, 34vw, 150px);
  line-height: 1;
  color: #fff;
  text-shadow: 0 8px 40px rgba(160, 80, 100, .35);
  font-weight: 400;
}

.opening-num.pop {
  animation: countPop .9s cubic-bezier(.2, .8, .3, 1) forwards;
}

@keyframes countPop {
  0%   { transform: scale(.55); opacity: 0; filter: blur(6px); }
  28%  { transform: scale(1.04); opacity: 1; filter: blur(0); }
  72%  { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.22); opacity: 0; filter: blur(4px); }
}

.opening-tip {
  position: absolute;
  bottom: 18%;
  margin: 0;
  font-family: var(--font-hand);
  font-size: 14px;
  letter-spacing: .26em;
  color: rgba(255, 255, 255, .9);
  padding-left: .26em;
  text-shadow: 0 2px 12px rgba(160, 80, 100, .3);
}

/* toast */
.toast {
  position: absolute;
  left: 50%;
  bottom: 86px;
  transform: translate(-50%, 12px);
  background: rgba(45, 30, 36, .86);
  color: #fff;
  font-size: 12.5px;
  letter-spacing: .08em;
  padding: 10px 18px;
  border-radius: 999px;
  opacity: 0;
  transition: opacity .3s, transform .3s;
  pointer-events: none;
  z-index: 5;
  white-space: nowrap;
}

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

/* ---------- 14. 桌面端：手机框 ---------- */
@media (min-width: 620px) {
  body {
    background: #2A2226;
    background: radial-gradient(120% 100% at 50% 0%, #3A2F33 0%, #221B1E 100%);
  }

  .card {
    inset: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 414px;
    height: min(880px, 92vh);
    border-radius: 34px;
    box-shadow: 0 50px 110px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .07);
    overflow: hidden;
  }

  .screen { padding-left: 30px; padding-right: 30px; }
}

/* ---------- 15. 小屏适配 ---------- */
@media (max-height: 680px) {
  .screen { padding-top: 52px; padding-bottom: 84px; }
  .cover-sub { margin: 10px 0 20px; }
  .gate-input, .btn { height: 46px; }
  .cake-stage { width: min(72%, 270px); }
  .paper { padding: 24px 20px 20px; }
  .coupon { padding: 14px 16px; }
  .shop-lines { margin-top: 16px; gap: 7px; }
  .share-row { margin-top: 16px; }
  .foot-note { margin-top: 16px; }
  .scroll-hint { bottom: 44px; }
}

@media (max-height: 600px) {
  .cake-stage { width: min(60%, 220px); }
  .cover-brand { margin-bottom: 12px; }
  .cover-sub { margin-bottom: 14px; }
  .gallery-grid { gap: 10px; }
}

/* ---------- 16. 无障碍 / 减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  .floaters, .cake-bob, .flame, .flame-glow,
  .aurora, .grain, .opening-ring, .opening-halo { animation: none !important; }
  .scroller { scroll-behavior: auto; }
  .screen .reveal { opacity: 1; transform: none; }
  .screen.in .reveal { animation: none; }
  .fx i, .spark { animation-duration: .01ms; }
  .opening-num.pop { animation-duration: .01ms; }
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* 打印/截图导出时保持整屏 */
@media print {
  body { background: #fff; }
  .card { position: static; width: auto; height: auto; box-shadow: none; }
  .progress, .dots, .sound-btn, .floaters, .opening { display: none; }
  .scroller { position: static; overflow: visible; }
  .screen { min-height: 100vh; page-break-after: always; }
}

/* ===========================================================
   17. 对齐参考站（happyeveryday.site）的视觉语言
   -----------------------------------------------------------
   参考站的关键不是背景花哨，而是「每一帧构图都不同」：
   点阵大字 / 手绘插画卡片 / 马克笔标题 / 宽字距白字 / 米色信纸
   =========================================================== */

/* ---------- 背景：柔和的粉，从上面浅到下面深 ---------- */
.card {
  background: linear-gradient(178deg,
    var(--bg1) 0%,
    var(--bg2) 42%,
    var(--bg3) 100%);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(90% 55% at 50% 6%,
    rgba(255, 255, 255, .55) 0%,
    rgba(255, 255, 255, 0) 62%);
}

.backdrop { z-index: 0; }
.aurora { opacity: .18 !important; }
.aurora.a4 { display: none; }
.vignette { display: none; }
.grain { opacity: .1; }

/* ---------- 点阵字（参考站的招牌） ---------- */
.dot-word {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Source Han Sans SC", system-ui, sans-serif;
  font-weight: 900;
  letter-spacing: .04em;
  line-height: 1.34;
  color: #fff;
  font-size: clamp(34px, 11.5vw, 54px);
  text-indent: .04em;
  word-break: break-word;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .dot-word {
    color: transparent;
    background-image: radial-gradient(circle closest-side,
      #ffffff 0%, #ffffff 72%, rgba(255, 255, 255, 0) 80%);
    background-size: 0.078em 0.078em;
    background-size: max(3.2px, 0.078em) max(3.2px, 0.078em);
    background-position: 50% 50%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
  }
}

.dot-word.big {
  font-size: clamp(46px, 19vw, 76px);
  letter-spacing: .02em;
  text-indent: .02em;
  line-height: 1.3;
}

.dot-word.mid { font-size: clamp(32px, 10.5vw, 48px); }

.cover-title { font-size: clamp(36px, 12vw, 56px); }

/* 点阵大字下面的一行小字，白得柔和一点 */
.dot-word + .line { margin-top: 26px; }

/* ---------- 手写体标题（Happy Birthday） ---------- */
.marker {
  font-family: var(--font-script);
  font-size: clamp(30px, 9.4vw, 44px);
  line-height: 1.25;
  color: #fff;
  margin: 0 0 6px;
  font-weight: 400;
  letter-spacing: .01em;
  rotate: -1.2deg;
  text-shadow:
    0 2px 0 rgba(214, 122, 146, .35),
    0 10px 26px rgba(150, 70, 90, .28);
}

/* ---------- 正文：实心白字 + 衬线 ---------- */
.line {
  font-family: var(--font-serif);
  font-size: clamp(17.5px, 5.1vw, 21.5px);
  line-height: 2.05;
  font-weight: 600;
  letter-spacing: .12em;
  text-indent: .12em;
  color: #ffffff;
  margin: 0;
  text-align: center;
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 340px;
  text-shadow:
    0 1px 2px rgba(140, 62, 88, .38),
    0 3px 12px rgba(140, 62, 88, .46),
    0 12px 26px rgba(140, 62, 88, .24);
}

.s-letter .wrap { gap: 26px; }
.s-cake .wrap { gap: 18px; }

.line.big {
  font-size: clamp(19px, 5.6vw, 23px);
  letter-spacing: .16em;
  text-indent: .16em;
}

/* ---------- 故事帧：文字 + 插画卡片，交替出现 ---------- */
/* 让生成的帧直接参与 .scroller 的布局，
   否则百分比高度会失效，帧就撑不满一屏 */
#storyFrames { display: contents; }

.s-story {
  justify-content: center;
}

.s-story .wrap { gap: 30px; }

.s-story .line {
  align-self: stretch;
  max-width: none;
  width: auto;
  padding: 0 4%;
  font-family: var(--font-serif);
  font-size: clamp(17.5px, 5.1vw, 21.5px);
  line-height: 2;
  letter-spacing: .12em;
  text-indent: .12em;
  text-align: center;
  white-space: pre-wrap;
  rotate: 0deg;
}

.story-card {
  position: relative;
  width: min(88%, 400px);
  min-height: 180px;
  border-radius: 22px;
  overflow: hidden;
  background: #fff;
  box-shadow:
    0 18px 40px rgba(150, 70, 95, .2),
    0 2px 6px rgba(150, 70, 95, .08);
  transform: rotate(-1deg);
}

/* 隔一帧换个角度，像随手摆上去的 */
.s-story:nth-of-type(even) .story-card { transform: rotate(1deg); }
.s-story.wide .story-card { transform: rotate(0deg); }

/* 高度跟着图片走：竖图不会被裁成方的 */
.story-card img,
.story-card svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: cover;
}

/* 用的是抠好的透明图时：去掉白卡片，让图直接浮在粉色上 */
.s-story .story-card.is-cut {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  transform: none;
}

.s-story .story-card.is-cut img {
  filter: drop-shadow(0 10px 22px rgba(150, 70, 95, .22));
}

/* 文字在下方时，卡片在上面 */
.s-story.flip .wrap { flex-direction: column-reverse; }

/* 大图帧：卡片几乎铺满 */
.s-story.wide .story-card {
  width: 100%;
  max-width: 420px;
}

/* ---------- 长信：米色信纸 ---------- */
.paper {
  width: 100%;
  max-width: 360px;
  background: #FBF2E7;
  border-radius: 16px;
  padding: 44px 28px 34px;
  box-shadow: 0 18px 44px rgba(150, 70, 95, .24);
  text-align: center;
  position: relative;
  overflow: visible;
}

.paper::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: -1px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: rgba(180, 150, 130, .18);
}

.letter-body {
  font-family: var(--font-hand);
  font-size: clamp(16px, 4.6vw, 18px);
  line-height: 2.7;
  letter-spacing: .16em;
  color: #6B5A50;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  text-align: center;
  min-height: 2em;
}

.letter-sign {
  margin: 30px 0 0;
  font-family: var(--font-hand);
  font-size: 15px;
  letter-spacing: .12em;
  color: #9A8778;
  text-align: right;
}

.letter-sign small {
  display: block;
  margin-top: 6px;
  font-family: inherit;
  font-size: 11.5px;
  letter-spacing: .1em;
  color: #B3A192;
}

.caret { background: #B3A192; }

/* ---------- 店铺页 ---------- */
.shop-slogan {
  font-size: 11.5px;
  letter-spacing: .3em;
  color: rgba(255, 255, 255, .88);
  margin: 18px 0 26px;
  padding-left: .3em;
  text-shadow: 0 2px 10px rgba(150, 75, 95, .3);
}

.shop-lines .shop-line,
.shop-lines .shop-line b { color: rgba(255, 255, 255, .92); text-shadow: 0 2px 10px rgba(150, 75, 95, .3); }
.shop-lines .shop-line .ico { color: rgba(255, 255, 255, .8); }

.foot-note { color: rgba(255, 255, 255, .6); }

/* ---------- 倒计时：点阵数字 ---------- */
.opening {
  background: linear-gradient(178deg, var(--bg1) 0%, var(--bg2) 46%, var(--bg3) 100%);
}

.opening-num {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-weight: 900;
  font-size: clamp(150px, 54vw, 250px);
  line-height: 1;
  letter-spacing: 0;
  color: #fff;
  text-shadow: none;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .opening-num {
    color: transparent;
    background-image: radial-gradient(circle closest-side,
      #ffffff 0%, #ffffff 72%, rgba(255, 255, 255, 0) 80%);
    background-size: 0.072em 0.072em;
    background-position: 50% 50%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

/* 数字周围散落的小光点 */
.opening-sparks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.opening-sparks i {
  position: absolute;
  display: block;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  animation: sparkleIn 2.6s ease-in-out infinite;
}

@keyframes sparkleIn {
  0%, 100% { opacity: 0; transform: scale(.4); }
  40%      { opacity: .85; transform: scale(1); }
  70%      { opacity: .35; transform: scale(.8); }
}

.opening-tip {
  bottom: 20%;
  font-family: inherit;
  font-size: 13.5px;
  letter-spacing: .3em;
  color: rgba(255, 255, 255, .95);
  text-shadow: 0 2px 14px rgba(150, 75, 95, .35);
}

/* ---------- 贴纸：白边抠图感 ---------- */
/* index.html 里那个 0×0 的 svg 只用来装滤镜定义 */
.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.sticker {
  position: absolute;
  display: block;
  pointer-events: none;
  z-index: 0;
  opacity: .95;
  filter: drop-shadow(0 7px 14px rgba(150, 70, 95, .2));
  transform: rotate(var(--rot, 0deg));
  animation: stickerFloat 7.5s ease-in-out infinite;
}

.sticker svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.sticker img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

@keyframes stickerFloat {
  0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); }
  50%      { transform: translateY(-9px) rotate(calc(var(--rot, 0deg) + 4deg)); }
}

/* 贴纸永远在内容下面 */
.screen > .wrap { z-index: 1; }

@media (prefers-reduced-motion: reduce) {
  .sticker { animation: none; }
}

/* ---------- 小屏收紧 ---------- */
@media (max-height: 700px) {
  .s-story .wrap { gap: 22px; }
  .story-card { width: min(76%, 330px); }
  .marker { font-size: clamp(26px, 8vw, 36px); }
  .dot-word.big { font-size: clamp(34px, 12.5vw, 56px); }
}
