/* ==========================================================================
   千里江山·拾捌 — 视觉材质、排版与动效规范（精修版）
   目标：iPhone 16+ Safari 竖屏专属 · 故宫圆形金属框流沙 × 宋代矿物颜料 × 液态玻璃 / 哑光玄笺
   ========================================================================== */

:root {
  --ink-deep: #06100F;
  --ink-dai: #0D1F1C;
  --xuan-base: rgba(14, 22, 21, 0.92);
  --warm-white: #ECE5D8;
  --warm-white-bright: #F4EFE4;
  --warm-white-soft: rgba(236, 229, 216, 0.86);
  --muted-slate: #9AA3A2;
  --gold-dust: #C7A56B;
  --gold-bright: #E8D4A6;
  --cinnabar: #A63429;
  --malachite: #3E8A72;
  --azurite: #2A6E8F;

  --font-shoujin: 'ShouJinSubset', serif;
  --font-date: 'CormorantDate', Georgia, serif;
  --font-birthday: 'CormorantBirthday', Georgia, serif;
  --font-italic: 'CormorantItalic', Georgia, serif;
  --font-happy: 'GreatVibesHappy', cursive;
  --font-seal: 'XiaoZhuanSeal', serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", sans-serif;

  /* 苹果弹簧感贝塞尔曲线 */
  --spring-soft: cubic-bezier(0.22, 1, 0.36, 1);
  --spring-snappy: cubic-bezier(0.32, 0.72, 0, 1);
  --spring-press: cubic-bezier(0.25, 0.9, 0.3, 1.15);
  --spring-pop: cubic-bezier(0.22, 1.24, 0.36, 1);

  /* 故宫实机流沙画 2.5D 尺寸、惯性晃动、实体化进度与陀螺仪分层视差变量 */
  --product-w: min(88vw, 49dvh, 354px);
  --metal-rot: 24deg;
  --frame-shake-x: 0px;
  --frame-shake-y: 0px;
  --frame-shake-rot: 0deg;
  --px-x: 0;
  --px-y: 0;
  --glare-x: 30%;
  --glare-y: 18%;
  --materialize: 0;
  --sand-reveal: 0;

  /* 陀螺仪倾斜变量（由 JS 实时写入） */
  --tilt-x: 0;
  --tilt-y: 0;
  --sheen-x: 50%;
  --sheen-y: 28%;
  --sheen-angle: 132deg;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  background-color: var(--ink-deep);
  color: var(--warm-white);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

#app {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  /* 开场：深墨绿漆底（宋代玄绿髹漆质感） */
  background: radial-gradient(
    118% 88% at 50% 40%,
    #112A24 0%,
    #0B1C19 46%,
    #061110 100%
  );
  opacity: 0;
  transition: opacity 520ms var(--spring-soft);
}

/* 过渡至流沙画与终幕时自然加深沉淀的深墨绿暗影层 */
#app::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    115% 86% at 50% 42%,
    #0D1D1C 0%,
    #081313 50%,
    #040A0B 100%
  );
  opacity: 0;
  transition: opacity 1400ms var(--spring-soft);
}

#app[data-stage="spark"]::before,
#app[data-stage="materialize"]::before,
#app[data-stage="sand-intro"]::before,
#app[data-stage="sand"]::before,
#app[data-stage="letter"]::before {
  opacity: 1;
}

#app[data-ready="true"] {
  opacity: 1;
}

.atmosphere-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.stage-fx-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 12;
  pointer-events: none;
}

/* ==========================================================================
   通用图层与安全区
   ========================================================================== */

.stage-layer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ==========================================================================
   液态玻璃（Liquid Glass）克制材质体系 — 仅用于交互控件
   ========================================================================== */

.liquid-glass {
  position: relative;
  background: linear-gradient(
    158deg,
    rgba(236, 229, 216, 0.13) 0%,
    rgba(236, 229, 216, 0.055) 48%,
    rgba(199, 165, 107, 0.048) 100%
  );
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border: 0.5px solid rgba(236, 229, 216, 0.22);
  box-shadow:
    inset 0 0.5px 0 rgba(236, 229, 216, 0.36),
    inset 0 -0.5px 0 rgba(13, 17, 18, 0.45),
    0 10px 28px rgba(0, 0, 0, 0.36);
  color: var(--warm-white);
  overflow: hidden;
}

.liquid-glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    170deg,
    rgba(236, 229, 216, 0.16) 0%,
    rgba(236, 229, 216, 0.02) 38%,
    transparent 65%
  );
  pointer-events: none;
}

.glass-pill {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  min-width: 112px;
  padding: 0 28px;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 14.5px;
  font-weight: 300;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  line-height: 1;
  cursor: pointer;
  outline: none;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) scale(1);
  transition:
    transform 340ms var(--spring-press),
    border-color 320ms ease,
    box-shadow 320ms ease,
    background-color 320ms ease,
    opacity 420ms var(--spring-soft);
}

.glass-pill:active,
.glass-pill.is-pressed {
  transform: translate3d(0, 0, 0) scale(0.94);
  border-color: rgba(236, 229, 216, 0.36);
  box-shadow:
    inset 0 0.5px 0 rgba(236, 229, 216, 0.46),
    inset 0 -0.5px 0 rgba(13, 17, 18, 0.5),
    0 4px 16px rgba(0, 0, 0, 0.36);
}

.glass-pill--primary {
  height: 48px;
  min-width: 136px;
  padding: 0 38px;
  font-size: 15px;
  border-color: rgba(236, 229, 216, 0.26);
}

.glass-pill--radiant {
  border-color: rgba(199, 165, 107, 0.36);
  animation: radiantBreath 4.2s ease-in-out infinite;
}

@keyframes radiantBreath {
  0%, 100% {
    box-shadow:
      inset 0 0.5px 0 rgba(236, 229, 216, 0.36),
      inset 0 -0.5px 0 rgba(13, 17, 18, 0.45),
      0 10px 28px rgba(0, 0, 0, 0.34),
      0 0 18px rgba(199, 165, 107, 0.08);
  }
  50% {
    box-shadow:
      inset 0 0.5px 0 rgba(236, 229, 216, 0.44),
      inset 0 -0.5px 0 rgba(13, 17, 18, 0.45),
      0 10px 28px rgba(0, 0, 0, 0.34),
      0 0 24px rgba(199, 165, 107, 0.24);
  }
}

.pill-label {
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   状态 0：微信内置浏览器强制拦截层
   ========================================================================== */

.wechat-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding:
    calc(env(safe-area-inset-top, 0px) + 24px)
    28px
    calc(env(safe-area-inset-bottom, 0px) + 24px);
  background: radial-gradient(
    90% 70% at 50% 42%,
    #102521 0%,
    #061110 72%
  );
  pointer-events: auto;
}

.wechat-gate[hidden] {
  display: none;
}

.wechat-arrow {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  right: 22px;
  width: 56px;
  height: 56px;
  color: rgba(236, 229, 216, 0.72);
  animation: wechatArrowFloat 2.6s ease-in-out infinite;
}

@keyframes wechatArrowFloat {
  0%, 100% {
    transform: translate3d(0, 0, 0);
    opacity: 0.48;
  }
  50% {
    transform: translate3d(4px, -5px, 0);
    opacity: 0.92;
  }
}

.wechat-card {
  width: min(76vw, 272px);
  padding: 34px 28px 30px;
  border-radius: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.safari-emblem {
  width: 44px;
  height: 44px;
  color: var(--warm-white);
}

.wechat-label {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-indent: 0.14em;
  color: var(--warm-white);
}

/* ==========================================================================
   故宫《千里江山》流沙画 — 2.5D 实机四层光学夹层与陀螺仪视差舞台
   Layer 1 (Back)  : 圆形深玄青玻璃背板
   Layer 2 (Mid)   : WebGL2 15.5 万粒超细矿物流沙（严格约束在圆环内、无气泡）
   Layer 3 (Glass) : 内环金属投射暗影 + 陀螺仪滑移曲面玻璃反光 + 0.5px 内缘高光
   Layer 4 (Front) : 暗调精修实机金属圆框 + 青绿立体山峦底座（自然遮挡底部流沙）
   ========================================================================== */

.sand-layer {
  position: fixed;
  inset: 0;
  z-index: 5;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 620ms var(--spring-soft),
    filter 950ms var(--spring-soft),
    transform 950ms var(--spring-soft);
  will-change: opacity, filter, transform;
  touch-action: none;
}

#app[data-stage="materialize"] .sand-layer,
#app[data-stage="sand-intro"] .sand-layer {
  opacity: 1;
  pointer-events: none;
}

#app[data-stage="sand"] .sand-layer,
#app[data-stage="letter"] .sand-layer {
  opacity: 1;
  pointer-events: auto;
}

.sand-layer.is-frozen {
  filter: blur(3.6px) brightness(0.74) saturate(0.94);
  transform: scale(1.06);
}

.sand-ambient-glow {
  position: absolute;
  inset: -10%;
  pointer-events: none;
  background:
    radial-gradient(56% 36% at 50% 46%, rgba(36, 98, 86, 0.14) 0%, rgba(24, 68, 88, 0.055) 48%, transparent 76%),
    radial-gradient(40% 28% at 50% 56%, rgba(199, 165, 107, 0.06) 0%, transparent 72%);
  opacity: calc(0.92 * var(--materialize, 0));
}

.sand-frame-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    calc(env(safe-area-inset-top, 0px) + 96px)
    16px
    calc(env(safe-area-inset-bottom, 0px) + 92px);
  pointer-events: none;
}

.sand-frame-wrap {
  position: relative;
  width: var(--product-w);
  aspect-ratio: 748 / 852;
  pointer-events: auto;
  opacity: var(--materialize, 0);
  transform:
    translate3d(var(--frame-shake-x), var(--frame-shake-y), 0)
    rotate(var(--frame-shake-rot));
  transition: transform 950ms var(--spring-soft);
  will-change: transform, opacity;
}

#app[data-stage="materialize"] .sand-frame-wrap,
#app[data-stage="sand-intro"] .sand-frame-wrap {
  pointer-events: none;
}

.sand-layer.is-frozen .sand-frame-wrap {
  transform: translate3d(0, 0, 0) scale(1.10);
}

/* 实机后方极克制的深青微曜展柜氛围光晕 */
.sand-frame-halo {
  position: absolute;
  left: -6%;
  top: -4%;
  width: 112%;
  height: 92%;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(
    circle at 50% 48%,
    rgba(62, 126, 124, 0.12) 38%,
    rgba(182, 194, 200, 0.045) 58%,
    transparent 74%
  );
  filter: blur(16px);
  opacity: 0.88;
}

/* 立体青绿山峦底座下方柔软写实的展台暗调接触投影 + 极克制展柜台面微反光 */
.sand-base-shadow {
  position: absolute;
  bottom: -2.4%;
  left: 50%;
  width: 92%;
  height: 8.2%;
  transform: translate3d(calc(-50% + var(--px-x) * 1.4px), 0, 0);
  border-radius: 50%;
  background:
    radial-gradient(
      ellipse at 50% 42%,
      rgba(0, 0, 0, 0.92) 0%,
      rgba(0, 0, 0, 0.62) 44%,
      rgba(34, 62, 58, 0.14) 68%,
      transparent 92%
    );
  filter: blur(7px);
  pointer-events: none;
  z-index: 0;
  transition: opacity 720ms var(--spring-soft);
}

.sand-base-shadow::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 24%;
  height: 36%;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at 50% 50%,
    rgba(0, 0, 0, 0.96) 0%,
    rgba(0, 0, 0, 0.72) 55%,
    transparent 100%
  );
  filter: blur(3px);
}

.sand-layer.is-frozen .sand-base-shadow {
  opacity: 0.25;
}

/* 2.5D 圆形玻璃夹层容器（尺寸精确扩延 18px 压入实机暗钛银环背后，确保视差位移绝不漏缝） */
.sand-chamber-clip {
  position: absolute;
  left: 5.95%;
  top: 4.86%;
  width: 87.70%;
  height: 79.30%;
  border-radius: 50%;
  overflow: hidden;
  z-index: 1;
  background: #0B1215;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  mask-image: radial-gradient(white, black);
}

/* Layer 1（最底层）：深玄墨青圆形玻璃背板（最深视差平面） */
.sand-glass-backing {
  position: absolute;
  inset: -4%;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(88% 72% at 54% 34%, rgba(36, 66, 72, 0.42) 0%, rgba(16, 30, 35, 0.22) 52%, transparent 82%),
    radial-gradient(100% 100% at 50% 50%, #101A1E 0%, #0B1215 62%, #070C0E 100%);
  transform: translate3d(calc(var(--px-x) * -2.6px), calc(var(--px-y) * -2.0px), 0);
  will-change: transform;
}

/* Layer 2（中层）：WebGL2 超细矿物颜料流沙画布（夹层中段视差平面） */
#sand-canvas {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  touch-action: none;
  opacity: var(--sand-reveal, 0);
  transform: translate3d(calc(var(--px-x) * -1.5px), calc(var(--px-y) * -1.2px), 0);
  transition: opacity 520ms var(--spring-soft);
  will-change: transform, opacity;
}

/* Layer 3A（前置光学玻璃层）：博物馆低反射曲面玻璃斜向反光（随陀螺仪优雅滑移，克制清晰） */
.sand-glass-reflection {
  position: absolute;
  inset: -6%;
  z-index: 2;
  border-radius: 50%;
  pointer-events: none;
  background:
    linear-gradient(
      128deg,
      transparent 17%,
      rgba(226, 236, 240, 0.035) 26%,
      rgba(238, 245, 248, 0.115) 32.5%,
      rgba(244, 249, 250, 0.055) 36.5%,
      transparent 44%,
      transparent 67%,
      rgba(214, 228, 226, 0.052) 74%,
      transparent 82%
    ),
    radial-gradient(
      68% 42% at var(--glare-x) var(--glare-y),
      rgba(242, 248, 250, 0.135) 0%,
      rgba(228, 238, 242, 0.042) 42%,
      transparent 72%
    );
  transform: translate3d(calc(var(--px-x) * 3.8px), calc(var(--px-y) * 2.8px), 0);
  mix-blend-mode: screen;
  will-change: transform;
}

/* Layer 3B（前置光学玻璃内壁）：金属框投射在流沙边缘的深邃内影 + 0.5px 极细玻璃内缘微光 */
.sand-glass-inner-shadow {
  position: absolute;
  left: 2.75%;
  top: 2.65%;
  width: 94.50%;
  height: 94.70%;
  z-index: 3;
  border-radius: 50%;
  pointer-events: none;
  box-shadow:
    inset calc(var(--px-x) * -2.8px) calc(5.5px + var(--px-y) * -2.2px) 16px rgba(0, 0, 0, 0.68),
    inset 0 0 22px rgba(0, 0, 0, 0.44),
    inset 0 0 0 0.5px rgba(232, 240, 244, 0.30),
    inset 0 1px 1.5px rgba(246, 250, 252, 0.20);
  transform: translate3d(calc(var(--px-x) * 2.1px), calc(var(--px-y) * 1.6px), 0);
  will-change: transform;
}

/* Layer 4（最顶层前景）：暗调实机金属圆框 + 立体青绿山峦底座（最浅前景视差平面，形成真实双层玻璃景深） */
.sand-product-shell-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  transform: translate3d(calc(var(--px-x) * 2.4px), calc(var(--px-y) * 1.9px), 0);
  will-change: transform;
  filter:
    drop-shadow(0 20px 36px rgba(0, 0, 0, 0.66))
    drop-shadow(0 4px 10px rgba(0, 0, 0, 0.42));
}

.sand-product-shell {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

/* 暗调拉丝钛银圆框随陀螺仪微弱游走的冷银边缘流光（100% 精确贴合实机金属环外内径，绝不越界进玻璃或山座） */
.sand-ring-sheen {
  position: absolute;
  left: 2.06%;
  top: 1.64%;
  width: 95.61%;
  height: 84.55%;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.44;
  background: conic-gradient(
    from var(--metal-rot),
    transparent 0deg,
    rgba(232, 240, 244, 0.24) 24deg,
    transparent 54deg,
    transparent 178deg,
    rgba(210, 224, 228, 0.16) 204deg,
    transparent 234deg,
    transparent 360deg
  );
  -webkit-mask: radial-gradient(closest-side, transparent 86.2%, #000 87.2%, #000 99.0%, transparent 100%);
  mask: radial-gradient(closest-side, transparent 86.2%, #000 87.2%, #000 99.0%, transparent 100%);
  clip-path: inset(0 0 21% 0);
  mix-blend-mode: screen;
}

.sand-vignette {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: radial-gradient(
    96% 84% at 50% 50%,
    transparent 52%,
    rgba(8, 11, 12, 0.56) 100%
  );
  opacity: 0.78;
  transition: opacity 900ms var(--spring-soft);
}

.sand-layer.is-frozen .sand-vignette {
  opacity: 1;
}

/* ==========================================================================
   第一幕：开场 · 花式英文书写（深墨绿漆底 × 暖金散景 × Great Vibes 连笔书写）
   ========================================================================== */

.act-unseal {
  z-index: 10;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  justify-items: center;
  padding:
    calc(env(safe-area-inset-top, 0px) + 52px)
    24px
    calc(env(safe-area-inset-bottom, 0px) + 46px);
  background: transparent;
  opacity: 1;
  transition:
    opacity 320ms ease-out,
    visibility 0ms linear 0ms;
  pointer-events: auto;
}

.act-unseal.is-dissolving {
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms ease-out;
}

.act-unseal.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 280ms ease-out,
    visibility 0ms linear 280ms;
}

.unseal-aura {
  position: absolute;
  inset: -10%;
  pointer-events: none;
  background:
    radial-gradient(58% 38% at 50% 42%, rgba(44, 118, 96, 0.17) 0%, rgba(22, 68, 66, 0.08) 46%, transparent 76%),
    radial-gradient(42% 28% at 50% 44%, rgba(206, 170, 102, 0.09) 0%, transparent 70%);
  animation: inkLiquidBreath 9.5s ease-in-out infinite;
  transform-origin: center center;
}

@keyframes inkLiquidBreath {
  0%, 100% {
    opacity: 0.70;
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    opacity: 1;
    transform: translate3d(0, -6px, 0) scale(1.045);
  }
}

.unseal-top,
.unseal-center,
.unseal-bottom {
  position: relative;
  z-index: 2;
}

.unseal-top {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  opacity: 0;
  transform: translate3d(0, -6px, 0);
  transition: opacity 780ms var(--spring-soft), transform 780ms var(--spring-soft);
}

.unseal-top.is-shown {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.top-hairline {
  display: inline-block;
  width: 28px;
  height: 0.75px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(216, 186, 128, 0.45) 100%
  );
}

.top-hairline:last-child {
  background: linear-gradient(
    90deg,
    rgba(216, 186, 128, 0.45) 0%,
    transparent 100%
  );
}

.date-mark {
  display: inline-block;
  font-family: var(--font-date);
  font-size: 13.5px;
  font-weight: 400;
  letter-spacing: 0.30em;
  text-indent: 0.30em;
  color: rgba(236, 224, 198, 0.74);
  text-shadow: 0 0 18px rgba(206, 172, 106, 0.18);
}

.unseal-center {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: -14px;
}

.hero-lockup {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.happy-wrap {
  position: relative;
  z-index: 2;
  width: min(86vw, 336px);
  aspect-ratio: 320 / 150;
  margin-bottom: -29px;
  pointer-events: none;
}

.happy-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter:
    drop-shadow(0 0 6px rgba(255, 246, 224, 0.52))
    drop-shadow(0 0 15px rgba(232, 198, 134, 0.28));
}

.hero-birthday {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: var(--font-birthday);
  font-size: clamp(28px, 8.0vw, 34px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  background: linear-gradient(
    180deg,
    #F9EBBE 0%,
    #E2BE74 44%,
    #C49A4E 78%,
    #9F7938 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 14px rgba(199, 165, 107, 0.24));
  opacity: 0;
  transform: translate3d(0, 8px, 0) scale(0.985);
  transition: opacity 860ms var(--spring-soft), transform 900ms var(--spring-soft);
}

.hero-birthday.is-shown {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.hero-recipient {
  margin: 26px 0 0;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 11px;
  opacity: 0;
  transform: translate3d(0, 10px, 0);
  transition: opacity 780ms var(--spring-soft), transform 820ms var(--spring-soft);
}

.hero-recipient.is-shown {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.hero-to {
  font-family: var(--font-italic);
  font-style: italic;
  font-size: clamp(22px, 5.9vw, 25px);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: rgba(242, 224, 184, 0.86);
  text-shadow: 0 0 18px rgba(218, 184, 118, 0.22);
}

.hero-name {
  font-family: var(--font-shoujin);
  font-size: clamp(28px, 7.4vw, 32px);
  font-weight: 400;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  color: #FAF5EA;
  text-shadow:
    0 2px 18px rgba(0, 0, 0, 0.42),
    0 0 24px rgba(235, 206, 146, 0.34);
}

.hero-divider {
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 132px;
  opacity: 0;
  transform: scaleX(0.55);
  transition: opacity 680ms var(--spring-soft), transform 760ms var(--spring-soft);
}

.hero-divider.is-shown {
  opacity: 1;
  transform: scaleX(1);
}

.hero-divider-line {
  flex: 1;
  height: 0.75px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(220, 190, 128, 0.52) 100%
  );
}

.hero-divider-line:last-child {
  background: linear-gradient(
    90deg,
    rgba(220, 190, 128, 0.52) 0%,
    transparent 100%
  );
}

.hero-divider-dot {
  width: 4.5px;
  height: 4.5px;
  transform: rotate(45deg);
  background: #F2D89C;
  box-shadow: 0 0 10px rgba(242, 216, 156, 0.85);
}

.hero-subtitle {
  margin: 16px 0 0;
  font-family: var(--font-shoujin);
  font-size: clamp(14.5px, 3.85vw, 16px);
  font-weight: 400;
  letter-spacing: 0.30em;
  text-indent: 0.30em;
  color: rgba(242, 232, 208, 0.86);
  text-shadow:
    0 1px 14px rgba(0, 0, 0, 0.42),
    0 0 16px rgba(224, 194, 132, 0.16);
  opacity: 0;
  transform: translate3d(0, 8px, 0);
  transition: opacity 720ms var(--spring-soft), transform 760ms var(--spring-soft);
}

.hero-subtitle.is-shown {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.unseal-bottom {
  opacity: 0;
  transform: translate3d(0, 14px, 0) scale(0.96);
  pointer-events: none;
  transition: opacity 820ms var(--spring-soft), transform 860ms var(--spring-soft);
}

.unseal-bottom.is-shown {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  pointer-events: auto;
}

/* 第一幕底部唯一精致细描边微光胶囊按钮 */
.unseal-capsule {
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 48px;
  padding: 0 28px;
  border-radius: 999px;
  border: 0.85px solid rgba(224, 194, 132, 0.46);
  background: linear-gradient(
    162deg,
    rgba(24, 52, 46, 0.56) 0%,
    rgba(11, 26, 23, 0.68) 60%,
    rgba(206, 172, 106, 0.08) 100%
  );
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  color: #F6EFE1;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0.16em;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  outline: none;
  pointer-events: auto;
  box-shadow:
    inset 0 0.5px 0 rgba(248, 234, 198, 0.34),
    inset 0 -0.5px 0 rgba(5, 14, 13, 0.55),
    0 10px 28px rgba(0, 0, 0, 0.42),
    0 0 24px rgba(214, 180, 114, 0.14);
  animation: capsuleShimmerBreath 4.2s ease-in-out infinite;
  transition:
    transform 320ms var(--spring-press),
    border-color 280ms ease,
    box-shadow 280ms ease;
}

.unseal-capsule:active,
.unseal-capsule.is-pressed {
  transform: scale(0.95);
  border-color: rgba(244, 218, 160, 0.72);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 245, 218, 0.5),
    0 4px 16px rgba(0, 0, 0, 0.45),
    0 0 32px rgba(232, 198, 130, 0.28);
}

.capsule-star {
  font-size: 11px;
  line-height: 1;
  color: #F2D694;
  text-shadow: 0 0 10px rgba(242, 214, 148, 0.85);
}

@keyframes capsuleShimmerBreath {
  0%, 100% {
    border-color: rgba(224, 194, 132, 0.42);
    box-shadow:
      inset 0 0.5px 0 rgba(248, 234, 198, 0.32),
      inset 0 -0.5px 0 rgba(5, 14, 13, 0.55),
      0 10px 28px rgba(0, 0, 0, 0.42),
      0 0 20px rgba(214, 180, 114, 0.12);
  }
  50% {
    border-color: rgba(242, 216, 158, 0.68);
    box-shadow:
      inset 0 0.5px 0 rgba(255, 244, 214, 0.44),
      inset 0 -0.5px 0 rgba(5, 14, 13, 0.55),
      0 10px 30px rgba(0, 0, 0, 0.42),
      0 0 30px rgba(232, 198, 130, 0.28);
  }
}

/* ==========================================================================
   第二幕：上方雅致题签（方案一默认实装）与底部双液态玻璃胶囊
   ========================================================================== */

.act-sand-ui {
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding:
    calc(env(safe-area-inset-top, 0px) + 46px)
    24px
    calc(env(safe-area-inset-bottom, 0px) + 38px);
}

.sand-inscription {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, -10px, 0);
  transition:
    opacity 860ms var(--spring-soft),
    transform 920ms var(--spring-soft);
}

.sand-inscription[data-visible="true"] {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.sand-title {
  margin: 0;
  font-family: var(--font-shoujin);
  font-size: clamp(26px, 7.2vw, 31px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  color: var(--warm-white-bright);
  text-shadow:
    0 2px 18px rgba(0, 0, 0, 0.55),
    0 0 28px rgba(199, 165, 107, 0.14);
}

.sand-inscription-rule {
  width: 38px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(199, 165, 107, 0.56) 50%,
    transparent 100%
  );
}

.sand-subtitle {
  margin: 0;
  font-family: var(--font-shoujin);
  font-size: clamp(13.5px, 3.6vw, 15px);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  color: rgba(236, 229, 216, 0.62);
}

.sand-footer-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  pointer-events: none;
}

.sand-interact-hint {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 300;
  line-height: 1.4;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  color: rgba(236, 229, 216, 0.56);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, 6px, 0);
  transition:
    opacity 780ms var(--spring-soft),
    transform 820ms var(--spring-soft);
}

.sand-interact-hint[data-visible="true"] {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  animation: hintGentleBreath 3.8s ease-in-out 860ms infinite;
}

@keyframes hintGentleBreath {
  0%, 100% {
    opacity: 0.94;
  }
  50% {
    opacity: 0.56;
  }
}

.sand-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  opacity: 0;
  transform: translate3d(0, 14px, 0) scale(0.96);
  pointer-events: none;
  transition:
    opacity 720ms var(--spring-soft),
    transform 760ms var(--spring-soft);
}

.sand-controls[data-visible="true"] {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  pointer-events: auto;
}

/* ==========================================================================
   第三 / 四幕：哑光玄笺（Matte Xuan Paper）、层级字号与逐字显墨
   ========================================================================== */

.act-letter {
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding:
    calc(env(safe-area-inset-top, 0px) + 28px)
    0
    calc(env(safe-area-inset-bottom, 0px) + 28px);
  pointer-events: none;
}

.xuan-card {
  position: relative;
  width: 87vw;
  max-width: 356px;
  min-width: 312px;
  border-radius: 22px;
  background-color: var(--xuan-base);
  box-shadow:
    0 26px 68px rgba(0, 0, 0, 0.62),
    0 2px 10px rgba(0, 0, 0, 0.36);
  overflow: visible;
  opacity: 0;
  transform: translate3d(0, 18px, 0) scale(0.94);
  pointer-events: none;
  transition:
    opacity 760ms var(--spring-soft),
    transform 860ms var(--spring-soft);
  will-change: transform, opacity;
}

.xuan-card[data-state="visible"] {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  pointer-events: auto;
}

.xuan-card.is-thud {
  animation: cardStampThud 140ms cubic-bezier(0.22, 1.35, 0.36, 1);
}

@keyframes cardStampThud {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  38% { transform: translate3d(0, 1.2px, 0) scale(0.994); }
  100% { transform: translate3d(0, 0, 0) scale(1); }
}

.xuan-paper-grain {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0.045;
  background-repeat: repeat;
  background-size: 160px 160px;
  pointer-events: none;
  mix-blend-mode: screen;
}

.xuan-sheen {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    86% 68% at var(--sheen-x) var(--sheen-y),
    rgba(199, 165, 107, 0.088) 0%,
    rgba(236, 229, 216, 0.025) 38%,
    transparent 74%
  );
  transition: opacity 400ms ease;
}

.xuan-rim {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  padding: 0.75px;
  background: linear-gradient(
    var(--sheen-angle),
    rgba(199, 165, 107, 0.46) 0%,
    rgba(199, 165, 107, 0.16) 28%,
    rgba(236, 229, 216, 0.08) 54%,
    rgba(199, 165, 107, 0.24) 84%,
    rgba(199, 165, 107, 0.38) 100%
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0.86;
}

.xuan-inner {
  position: relative;
  z-index: 2;
  padding: 38px 23px 32px;
}

/* 清晰字号层级：抬头称谓名字最大 > 落款名字略大 > 尾句祝语 > 正文 > 落款日期 */
.letter-content {
  font-family: var(--font-shoujin);
  color: rgba(236, 229, 216, 0.92);
  font-size: clamp(17.5px, 4.5vw, 19px);
  letter-spacing: 0.10em;
  line-height: 2.08;
}

.letter-salutation {
  margin: 0 0 26px;
  display: flex;
  align-items: baseline;
  line-height: 1.35;
}

.salutation-prefix {
  font-size: clamp(18.5px, 4.75vw, 20px);
  letter-spacing: 0.14em;
  color: rgba(236, 229, 216, 0.78);
}

.salutation-gap {
  display: inline-block;
  width: 0.48em;
}

.salutation-name {
  font-size: clamp(25px, 6.45vw, 27.5px);
  letter-spacing: 0.17em;
  color: var(--warm-white-bright);
  text-shadow: 0 1px 14px rgba(199, 165, 107, 0.10);
}

.letter-stanza {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.letter-line {
  margin: 0;
  white-space: nowrap;
}

.letter-line--wish {
  margin-top: 8px;
  font-size: clamp(19.5px, 5.0vw, 21px);
  letter-spacing: 0.15em;
  color: var(--warm-white-bright);
}

.xuan-footer {
  margin-top: 38px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.signature-group {
  display: inline-flex;
  align-items: center;
  gap: 15px;
}

.signature-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}

.letter-signature {
  font-family: var(--font-shoujin);
  font-size: clamp(22.5px, 5.8vw, 24.5px);
  letter-spacing: 0.17em;
  margin-right: -0.17em;
  color: var(--warm-white-bright);
  line-height: 1.1;
}

.xuan-date {
  font-size: 15px;
  letter-spacing: 0.21em;
  text-indent: 0;
  margin-right: -0.21em;
  line-height: 1;
  color: rgba(236, 229, 216, 0.58);
  opacity: 0;
  transform: translate3d(0, -1px, 0);
  transition: opacity 540ms var(--spring-soft), transform 540ms var(--spring-soft);
}

.xuan-date.is-revealed {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* 逐字显墨字符单元（无光标、180ms 柔化淡入 + <1px 微沉落墨感） */
.ink-char {
  display: inline-block;
  opacity: 0;
  transform: translate3d(0, -0.85px, 0);
  filter: blur(0.6px);
  transition:
    opacity 180ms cubic-bezier(0.25, 0.85, 0.35, 1),
    transform 180ms cubic-bezier(0.25, 0.85, 0.35, 1),
    filter 180ms ease-out;
  will-change: opacity, transform;
}

.ink-char.is-space {
  width: 0.42em;
}

.ink-char.is-revealed {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  filter: blur(0px);
}

/* ==========================================================================
   印位、苹果设计语言长按提示气泡、朱砂着墨 Canvas 与悬空水晶方印
   ========================================================================== */

.seal-slot {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

/* 印章出现后 1 秒柔和弹出的 Apple TipKit / Liquid Glass 提示气泡（无缝圆弧尾角） */
.seal-tip {
  position: absolute;
  bottom: calc(100% + 14px);
  right: -6px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
  transform-origin: calc(100% - 32px) 100%;
  opacity: 0;
  transform: translate3d(0, 8px, 0) scale(0.84);
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.48)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.28));
  transition:
    opacity 420ms var(--spring-soft),
    transform 520ms var(--spring-pop);
}

.seal-tip[data-visible="true"] {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  animation: sealTipBreath 3.2s ease-in-out 560ms infinite;
}

@keyframes sealTipBreath {
  0%, 100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(0, -2.4px, 0) scale(1);
  }
}

.seal-tip-pill {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px 0 10px;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    rgba(44, 52, 55, 0.94) 0%,
    rgba(25, 32, 34, 0.99) 100%
  );
  -webkit-backdrop-filter: blur(22px) saturate(185%);
  backdrop-filter: blur(22px) saturate(185%);
  border: 0.5px solid rgba(236, 229, 216, 0.28);
  box-shadow: inset 0 0.5px 0 rgba(255, 255, 255, 0.30);
  color: rgba(244, 239, 230, 0.95);
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1;
  white-space: nowrap;
}

.seal-tip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: var(--gold-bright);
  flex-shrink: 0;
}

.seal-tip-icon svg {
  width: 16px;
  height: 16px;
}

.tip-ring-pulse {
  transform-origin: 9px 9px;
  animation: tipPulseRing 2.1s ease-out infinite;
}

@keyframes tipPulseRing {
  0% {
    transform: scale(0.72);
    opacity: 0.78;
  }
  75% {
    transform: scale(1.18);
    opacity: 0.14;
  }
  100% {
    transform: scale(1.24);
    opacity: 0;
  }
}

.seal-tip-text {
  display: inline-block;
  line-height: 1;
}

/* 精准对准下方 52px 印章正中心的平滑圆弧 Apple TipKit SVG 尾角（无缝熔合胶囊底缘，彻底消除贯穿水平接缝） */
.seal-tip-arrow {
  position: relative;
  z-index: 2;
  display: block;
  width: 18px;
  height: 10px;
  margin-top: -2px;
  margin-right: 23px;
  flex-shrink: 0;
  overflow: visible;
}

.seal-canvas {
  position: absolute;
  inset: 0;
  width: 52px;
  height: 52px;
  pointer-events: none;
  opacity: 0;
  transform: scale(1);
  transition: opacity 90ms ease-out;
}

.seal-canvas.is-stamped {
  opacity: 1;
}

.crystal-seal-wrap {
  position: absolute;
  inset: -16px;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translate3d(0, -14px, 0) scale(0.92);
  pointer-events: none;
  transition:
    opacity 720ms var(--spring-soft),
    transform 820ms var(--spring-soft);
}

.crystal-seal-wrap[data-state="ready"] {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  pointer-events: auto;
}

.crystal-seal-wrap[data-state="lifting"] {
  opacity: 0;
  transform: translate3d(0, -18px, 0) scale(1.08);
  pointer-events: none;
  transition:
    opacity 460ms var(--spring-soft),
    transform 520ms var(--spring-soft);
}

.crystal-seal-wrap[data-state="gone"] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.seal-progress-ring {
  position: absolute;
  width: 72px;
  height: 72px;
  pointer-events: none;
  overflow: visible;
  transform: rotate(-90deg);
}

.seal-ring-track {
  fill: none;
  stroke: rgba(236, 229, 216, 0.12);
  stroke-width: 1;
  opacity: 0;
  transition: opacity 220ms ease;
}

.crystal-seal-wrap.is-pressing .seal-ring-track {
  opacity: 1;
}

.seal-ring-bar {
  fill: none;
  stroke: rgba(236, 229, 216, 0.84);
  stroke-width: 1.25;
  stroke-linecap: round;
  opacity: 0;
  transition: opacity 160ms ease;
  filter: drop-shadow(0 0 4px rgba(199, 165, 107, 0.38));
}

.crystal-seal-wrap.is-pressing .seal-ring-bar,
.crystal-seal-wrap.is-releasing .seal-ring-bar {
  opacity: 1;
}

.crystal-shadow {
  position: absolute;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(0, 0, 0, 0.72) 0%,
    rgba(0, 0, 0, 0.38) 56%,
    transparent 82%
  );
  transform: translate3d(0, 10px, 0) scale(1.06);
  filter: blur(10px);
  opacity: 0.62;
  pointer-events: none;
  will-change: transform, filter, opacity;
}

.crystal-seal {
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 10px;
  border: 0.75px solid rgba(236, 229, 216, 0.36);
  background: linear-gradient(
    145deg,
    rgba(236, 229, 216, 0.22) 0%,
    rgba(236, 229, 216, 0.08) 44%,
    rgba(199, 165, 107, 0.09) 76%,
    rgba(166, 52, 41, 0.15) 100%
  );
  -webkit-backdrop-filter: blur(14px) saturate(165%);
  backdrop-filter: blur(14px) saturate(165%);
  box-shadow:
    inset 1px 1px 0 rgba(236, 229, 216, 0.45),
    inset -1px -1.5px 2px rgba(13, 17, 18, 0.45),
    inset 0 0 12px rgba(199, 165, 107, 0.10),
    0 1px 0 rgba(236, 229, 216, 0.16);
  cursor: pointer;
  outline: none;
  touch-action: none;
  transform: translate3d(0, -8px, 0) scale(1.07);
  will-change: transform, box-shadow;
  animation: crystalFloat 3.4s ease-in-out infinite;
}

.crystal-seal-wrap.is-pressing .crystal-seal,
.crystal-seal-wrap.is-releasing .crystal-seal {
  animation: none;
}

@keyframes crystalFloat {
  0%, 100% {
    transform: translate3d(0, -8px, 0) scale(1.07);
    box-shadow:
      inset 1px 1px 0 rgba(236, 229, 216, 0.45),
      inset -1px -1.5px 2px rgba(13, 17, 18, 0.45),
      inset 0 0 12px rgba(199, 165, 107, 0.10),
      0 0 14px rgba(199, 165, 107, 0.10);
  }
  50% {
    transform: translate3d(0, -10.5px, 0) scale(1.085);
    box-shadow:
      inset 1px 1px 0 rgba(236, 229, 216, 0.56),
      inset -1px -1.5px 2px rgba(13, 17, 18, 0.45),
      inset 0 0 14px rgba(199, 165, 107, 0.18),
      0 0 20px rgba(199, 165, 107, 0.22);
  }
}

.crystal-facet-top {
  position: absolute;
  inset: 3px;
  border-radius: 6.5px;
  border: 0.5px solid rgba(236, 229, 216, 0.24);
  background: linear-gradient(
    135deg,
    rgba(236, 229, 216, 0.22) 0%,
    rgba(236, 229, 216, 0.03) 48%,
    transparent 100%
  );
  pointer-events: none;
}

.crystal-facet-edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    315deg,
    rgba(199, 165, 107, 0.18) 0%,
    transparent 35%,
    transparent 72%,
    rgba(236, 229, 216, 0.24) 100%
  );
  pointer-events: none;
}

.crystal-ghost-glyph {
  position: absolute;
  inset: 5px;
  border-radius: 4px;
  background-image: url('../assets/seal-shiba.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.36;
  filter: saturate(0.85) blur(0.25px);
  transform: scale(0.94);
  pointer-events: none;
}

.crystal-glint {
  position: absolute;
  top: 4px;
  left: 5px;
  width: 15px;
  height: 5px;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(236, 229, 216, 0.58), transparent);
  transform: rotate(-18deg);
  pointer-events: none;
}

/* ==========================================================================
   终幕下方极克制半透明返回图标按钮
   ========================================================================== */

.return-icon-btn {
  margin-top: 28px;
  appearance: none;
  -webkit-appearance: none;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: rgba(236, 229, 216, 0.72);
  cursor: pointer;
  outline: none;
  opacity: 0;
  transform: translate3d(0, 10px, 0) scale(0.92);
  pointer-events: none;
  transition:
    opacity 680ms var(--spring-soft),
    transform 680ms var(--spring-soft),
    border-color 280ms ease;
}

.return-icon-btn[data-visible="true"] {
  opacity: 0.86;
  transform: translate3d(0, 0, 0) scale(1);
  pointer-events: auto;
}

.return-icon-btn:active {
  transform: translate3d(0, 0, 0) scale(0.92);
  opacity: 1;
}

.return-icon-btn svg {
  width: 19px;
  height: 19px;
}

/* ==========================================================================
   全屏高级感彩带与鎏金箔庆典特效层
   ========================================================================== */

.celebration-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 40;
  pointer-events: none;
}

/* 针对较小高度屏幕（如 Safari 工具栏展开时）自适应缩放实机与卡片间距 */
@media (max-height: 700px) {
  :root {
    --product-w: min(76vw, 46dvh, 296px);
  }
  .act-unseal {
    padding-top: calc(env(safe-area-inset-top, 0px) + 32px);
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 28px);
  }
  .happy-wrap {
    width: min(80vw, 290px);
    margin-bottom: -30px;
  }
  .hero-recipient {
    margin-top: 18px;
  }
  .act-sand-ui {
    padding-top: calc(env(safe-area-inset-top, 0px) + 24px);
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 22px);
  }
  .sand-frame-stage {
    padding-top: calc(env(safe-area-inset-top, 0px) + 74px);
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 78px);
  }
  .sand-footer-group {
    gap: 12px;
  }
  .sand-interact-hint {
    font-size: 12px;
  }
  .xuan-inner {
    padding: 28px 21px 24px;
  }
  .letter-salutation {
    margin-bottom: 18px;
  }
  .xuan-footer {
    margin-top: 26px;
  }
  .return-icon-btn {
    margin-top: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .unseal-aura,
  .unseal-capsule,
  .glass-pill--radiant,
  .wechat-arrow,
  .crystal-seal,
  .sand-interact-hint[data-visible="true"],
  .seal-tip[data-visible="true"],
  .tip-ring-pulse {
    animation: none !important;
  }
}
