/* ============================================================
   治愈烘焙 H5 — 全局样式
   配色：奶白 #FFF9F0 | 浅粉 #FFD6E0 | 鹅黄 #FFF3C4 | 巧克力 #8B5A3C
   ============================================================ */

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "ZCOOL KuaiLe", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #fff9f0;
  color: #8b5a3c;
  touch-action: pan-x;
}

body {
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.slider {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

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

.slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  background: linear-gradient(180deg, #fff9f0 0%, #fff3c4 55%, #ffd6e0 100%);
}

/* 非当前页暂停图层动画，减少卡顿与耗电 */
.slide:not(.is-active) [class*="anim-"] {
  animation-play-state: paused !important;
}

.scene {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.scene__stage {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
}

.scene__canvas {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  transform-origin: center center;
}

.scene[data-ratio="752-1334"] .scene__canvas {
  width: min(100vw, calc(100vh * 752 / 1334));
  height: min(100vh, calc(100vw * 1334 / 752));
}

.scene[data-ratio="1535-2732"] .scene__canvas {
  width: min(100vw, calc(100vh * 1535 / 2732));
  height: min(100vh, calc(100vw * 2732 / 1535));
}

.psd-layer {
  position: absolute;
  pointer-events: none;
  will-change: transform, opacity;
  backface-visibility: hidden;
}

.psd-layer img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.psd-layer--full {
  inset: 0;
  width: 100%;
  height: 100%;
}

.psd-layer--window-light {
  background: linear-gradient(105deg, rgba(255, 255, 220, 0.45) 0%, rgba(255, 230, 180, 0.15) 45%, transparent 70%);
  border-radius: 0 40% 40% 0;
  mix-blend-mode: soft-light;
}

.psd-layer--heart {
  display: flex;
  align-items: center;
  justify-content: center;
}

.psd-layer--heart::before {
  content: "♥";
  font-size: clamp(18px, 5vw, 36px);
  color: #ff8fab;
  text-shadow: 0 2px 8px rgba(255, 143, 171, 0.5);
}

.pager {
  position: fixed;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 100;
  pointer-events: none;
}

.pager__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(139, 90, 60, 0.25);
  transition: transform 0.3s ease, background 0.3s ease;
}

.pager__dot.is-active {
  background: #ff8fab;
  transform: scale(1.35);
}

.slide-hint {
  position: absolute;
  right: 16px;
  bottom: calc(48px + env(safe-area-inset-bottom));
  font-size: 13px;
  color: rgba(139, 90, 60, 0.55);
  animation: hint-pulse 2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes hint-pulse {
  0%,
  100% {
    opacity: 0.45;
    transform: translateX(0);
  }
  50% {
    opacity: 1;
    transform: translateX(4px);
  }
}

.action-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(56px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  gap: 16px;
  z-index: 50;
  padding: 0 20px;
}

.btn {
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  letter-spacing: 0.05em;
  border-radius: 999px;
  padding: 12px 22px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
  box-shadow: 0 4px 14px rgba(255, 143, 171, 0.35);
}

.btn:active,
.btn:hover {
  transform: scale(1.08);
}

.btn--share {
  background: linear-gradient(135deg, #ffd6e0, #ffb7c5);
  color: #8b5a3c;
}

.btn--poster {
  background: linear-gradient(135deg, #fff3c4, #ffe08a);
  color: #8b5a3c;
}

.btn--primary {
  background: linear-gradient(135deg, #ffd6e0, #ff8fab);
  color: #fff;
  box-shadow: 0 6px 20px rgba(255, 143, 171, 0.45);
}

.audio-unlock {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 249, 240, 0.92);
  backdrop-filter: blur(6px);
}

.audio-unlock[hidden] {
  display: none;
}

.audio-unlock__card {
  text-align: center;
  padding: 32px 28px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(255, 182, 193, 0.35);
  max-width: 86vw;
}

.audio-unlock__title {
  font-size: 20px;
  margin-bottom: 8px;
}

.audio-unlock__desc {
  font-size: 14px;
  color: rgba(139, 90, 60, 0.7);
  margin-bottom: 20px;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal__mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.modal__body {
  position: relative;
  background: #fff9f0;
  border-radius: 20px;
  padding: 28px 24px;
  text-align: center;
  max-width: 80vw;
  line-height: 1.8;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.modal__close {
  margin-top: 16px;
}
