:root {
  --bg: #1a0a28;
  --text: #f6f7ff;
  --gold-a: #ffe38b;
  --gold-b: #ffbf18;
  --gold-c: #e89400;
  --top-bar-h: 52px;
  --bottom-bar-h: 76px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Noto Sans Myanmar", "Myanmar Text", "Padauk", "Pyidaungsu", sans-serif;
  color: var(--text);
  background: radial-gradient(ellipse 120% 80% at 50% 0%, #3d1a5c 0%, var(--bg) 45%);
  -webkit-text-size-adjust: 100%;
}

body {
  line-height: 1.45;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: var(--bottom-bar-h);
}

/* —— 顶部浮窗 —— */
.top-banner {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: var(--top-bar-h);
  padding: 8px 14px 8px 16px;
  background: linear-gradient(92deg, #c41e0a 0%, #ff6a1a 38%, #ffb31a 100%);
  color: #fff8e8;
  font-weight: 800;
  letter-spacing: 0.02em;
  border-bottom: 2px solid rgba(255, 220, 140, 0.55);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.12), 0 8px 24px rgba(0, 0, 0, 0.35);
}

.banner-text {
  margin: 0;
  flex: 1;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  font-size: clamp(0.88rem, 2.6vw, 1.1rem);
}

.close-btn {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(0, 0, 0, 0.2));
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease;
}

.close-btn:hover {
  background: rgba(0, 0, 0, 0.25);
}

.close-btn:active {
  transform: scale(0.94);
}

/* —— 主内容区：大图自适应 —— */
.page {
  width: min(430px, 100%);
  margin: 0 auto;
  min-height: calc(100vh - var(--top-bar-h) - var(--bottom-bar-h));
  min-height: calc(100dvh - var(--top-bar-h) - var(--bottom-bar-h));
}

.hero-poster {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: calc(100vh - var(--top-bar-h) - var(--bottom-bar-h));
  min-height: calc(100dvh - var(--top-bar-h) - var(--bottom-bar-h));
  background: linear-gradient(180deg, #2a1240 0%, #1a0a28 55%, #12061c 100%);
  border-left: 1px solid rgba(180, 120, 255, 0.2);
  border-right: 1px solid rgba(180, 120, 255, 0.2);
}

.poster-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - var(--top-bar-h) - var(--bottom-bar-h));
  max-height: calc(100dvh - var(--top-bar-h) - var(--bottom-bar-h));
  min-height: 0;
  object-fit: contain;
  object-position: top center;
  border-radius: 0 0 16px 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

/* —— 底部浮窗 —— */
.bottom-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0));
  background: linear-gradient(180deg, #1e1a24 0%, #121018 100%);
  border-top: 2px solid var(--gold-b);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.bottom-inner {
  width: min(430px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bottom-left {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.bottom-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: contain;
  background: radial-gradient(circle at 30% 20%, rgba(255, 220, 150, 0.15), rgba(0, 0, 0, 0.35));
  border: 1px solid rgba(255, 200, 100, 0.45);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.bottom-text {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.bottom-text strong {
  color: var(--gold-a);
  font-size: clamp(0.95rem, 3.2vw, 1.2rem);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.bottom-text span {
  color: #e8eaf5;
  font-size: clamp(0.78rem, 2.4vw, 0.92rem);
  opacity: 0.95;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bottom-btn-wrap {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

.bottom-btn-gift {
  position: absolute;
  top: -10px;
  right: -6px;
  z-index: 2;
  font-size: 1.45rem;
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
  animation: gift-pop 1.15s ease-in-out infinite;
}

@keyframes gift-pop {
  0%,
  100% {
    transform: translateY(0) rotate(-6deg) scale(1);
  }
  25% {
    transform: translateY(-3px) rotate(4deg) scale(1.08);
  }
  50% {
    transform: translateY(-6px) rotate(-2deg) scale(1.05);
  }
  75% {
    transform: translateY(-2px) rotate(6deg) scale(1.08);
  }
}

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

.bottom-btn {
  flex-shrink: 0;
  min-width: 132px;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  font-size: clamp(0.85rem, 2.6vw, 1rem);
  color: #f3fff8;
  background: linear-gradient(180deg, #2ee07a 0%, #16a34a 55%, #15803d 100%);
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.bottom-btn-wrap:hover .bottom-btn {
  filter: brightness(1.06);
  box-shadow: 0 6px 18px rgba(22, 163, 74, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.bottom-btn:active {
  transform: translateY(1px) scale(0.98);
}

/* —— 弹窗（红包样式） —— */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(8, 4, 18, 0.72);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.show {
  display: flex;
}

.modal-card--hongbao {
  position: relative;
  width: min(400px, 100%);
  overflow: visible;
  border-radius: 4px 4px 16px 16px;
  padding: 52px 20px 22px;
  text-align: center;
  color: #fff8f0;
  border: 3px solid #e8c547;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(255, 240, 200, 0.15) 0%, transparent 55%),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 8px,
      rgba(0, 0, 0, 0.03) 8px,
      rgba(0, 0, 0, 0.03) 9px
    ),
    linear-gradient(165deg, #e85d4e 0%, #b91d2b 38%, #7a0f18 100%);
  box-shadow:
    0 0 0 1px rgba(139, 40, 30, 0.6),
    0 12px 0 rgba(0, 0, 0, 0.12),
    0 24px 48px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

/* 顶部封口 */
.modal-card--hongbao::before {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  height: 46px;
  background: linear-gradient(180deg, #ff7a6e 0%, #d42835 55%, #9e1520 100%);
  border-radius: 4px 4px 40% 40% / 4px 4px 18px 18px;
  border: 3px solid #e8c547;
  border-bottom: 2px solid rgba(232, 197, 71, 0.85);
  box-shadow: inset 0 2px 8px rgba(255, 255, 255, 0.15);
  z-index: 0;
}

.modal-card--hongbao::after {
  content: "";
  position: absolute;
  top: 38px;
  left: 50%;
  transform: translateX(-50%);
  width: 88%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(232, 197, 71, 0.9), transparent);
  z-index: 1;
  pointer-events: none;
}

.modal-hongbao-seal {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 900;
  color: #5c0a0a;
  background: radial-gradient(circle at 35% 30%, #fff5d6 0%, #e8c547 45%, #b8860b 100%);
  border: 2px solid #fff8e0;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  pointer-events: none;
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  width: 32px;
  height: 32px;
  border: 2px solid rgba(232, 197, 71, 0.7);
  border-radius: 999px;
  background: rgba(60, 8, 12, 0.55);
  color: #ffeec8;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
}

.modal-close:hover {
  background: rgba(90, 15, 20, 0.75);
}

.modal-close:active {
  transform: scale(0.94);
}

.modal-card--hongbao h3 {
  margin: 0;
  padding: 0 36px;
  color: #fffef0;
  font-size: clamp(1.05rem, 3.5vw, 1.35rem);
  line-height: 1.35;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 0 20px rgba(255, 220, 120, 0.25);
}

.modal-card--hongbao p {
  margin: 12px 0 0;
  color: rgba(255, 248, 235, 0.95);
  font-size: clamp(0.9rem, 3vw, 1.05rem);
  line-height: 1.55;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.modal-cta-wrap {
  position: relative;
  display: inline-block;
  margin-top: 18px;
}

.modal-cta-hongbao {
  position: absolute;
  top: -8px;
  right: -6px;
  z-index: 2;
  font-size: 1.35rem;
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
  animation: hongbao-shake 0.9s ease-in-out infinite;
}

@keyframes hongbao-shake {
  0%,
  100% {
    transform: translate(0, 0) rotate(-8deg) scale(1);
  }
  20% {
    transform: translate(2px, -2px) rotate(6deg) scale(1.06);
  }
  40% {
    transform: translate(-2px, 2px) rotate(-4deg) scale(1.04);
  }
  60% {
    transform: translate(1px, -4px) rotate(8deg) scale(1.08);
  }
  80% {
    transform: translate(-1px, 1px) rotate(-6deg) scale(1.05);
  }
}

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

.modal-cta-btn {
  min-width: 200px;
  min-height: 48px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0;
  color: #3a1500;
  background: linear-gradient(180deg, #ffe566 0%, var(--gold-b) 45%, var(--gold-c) 100%);
  box-shadow: 0 6px 20px rgba(255, 160, 40, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.modal-cta-wrap:hover .modal-cta-btn {
  filter: brightness(1.05);
}

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

@media (max-width: 380px) {
  :root {
    --top-bar-h: 48px;
    --bottom-bar-h: 72px;
  }

  .bottom-inner {
    gap: 8px;
  }

  .bottom-logo {
    width: 42px;
    height: 42px;
  }

  .bottom-btn {
    min-width: 118px;
    min-height: 44px;
    padding: 0 14px;
  }

  .bottom-btn-gift {
    font-size: 1.25rem;
    top: -8px;
    right: -4px;
  }

  .modal-cta-btn {
    min-width: 168px;
    min-height: 44px;
    font-size: 0.98rem;
  }

  .modal-cta-hongbao {
    font-size: 1.2rem;
    top: -6px;
    right: -4px;
  }
}
