* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 45%, #160a1c 0%, #09040d 55%, #020105 100%);
  font-family: 'Noto Serif SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: #fff;
}

#webgl-container {
  position: fixed;
  inset: 0;
  z-index: 1;
  touch-action: none;
}

#blessing-canvas {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/* ==================== 开场页面 ==================== */
#intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, rgba(35, 14, 42, 0.55) 0%, rgba(5, 2, 10, 0.92) 75%);
  backdrop-filter: blur(4px);
  transition: opacity 1.1s ease, visibility 1.1s ease;
}

#intro-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intro-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.intro-title {
  font-family: 'Great Vibes', 'Snell Roundhand', 'Brush Script MT', cursive;
  font-size: clamp(3.2rem, 7vw, 5.5rem);
  font-weight: 400;
  letter-spacing: 2px;
  color: #ffe8f3;
  text-shadow:
    0 0 12px rgba(255, 130, 195, 0.85),
    0 0 32px rgba(255, 90, 175, 0.6),
    0 0 64px rgba(190, 80, 255, 0.35);
  animation: pulseGlow 3s ease-in-out infinite;
}

.intro-subtitle {
  font-size: 0.95rem;
  letter-spacing: 5px;
  color: rgba(255, 224, 240, 0.72);
  margin-bottom: 18px;
}

.glow-btn {
  position: relative;
  padding: 13px 40px;
  border-radius: 999px;
  border: 1px solid rgba(255, 185, 225, 0.45);
  background: rgba(255, 145, 205, 0.12);
  color: #fff2f8;
  font-size: 1rem;
  letter-spacing: 4px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(10px);
  box-shadow:
    0 0 20px rgba(255, 120, 190, 0.25),
    inset 0 0 14px rgba(255, 190, 225, 0.15);
  transition: all 0.35s ease;
}

.glow-btn:hover {
  transform: translateY(-2px) scale(1.03);
  background: rgba(255, 145, 205, 0.26);
  border-color: rgba(255, 210, 235, 0.85);
  box-shadow:
    0 0 32px rgba(255, 120, 190, 0.55),
    inset 0 0 18px rgba(255, 210, 235, 0.28);
}

.glow-btn:active {
  transform: scale(0.98);
}

.intro-footer {
  position: absolute;
  bottom: 28px;
  font-size: 0.78rem;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.42);
}

/* ==================== 主界面 HUD ==================== */
#hud-overlay {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 1;
  transition: opacity 1.4s ease;
}

#hud-overlay.hidden {
  opacity: 0;
}

.hud-top-right {
  position: absolute;
  top: 28px;
  right: 36px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.hud-header {
  text-align: right;
}

.hud-title {
  font-family: 'Great Vibes', 'Snell Roundhand', 'Brush Script MT', cursive;
  font-size: clamp(2rem, 3.8vw, 3.1rem);
  font-weight: 400;
  color: #ffe8f3;
  text-shadow:
    0 0 10px rgba(255, 130, 195, 0.8),
    0 0 26px rgba(255, 90, 175, 0.45);
  line-height: 1.1;
}

.hud-subtitle {
  font-size: 0.78rem;
  letter-spacing: 3px;
  color: rgba(255, 224, 240, 0.65);
  margin-top: 4px;
}

.hud-controls {
  display: flex;
  gap: 10px;
  pointer-events: auto;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 200, 230, 0.26);
  background: rgba(20, 10, 28, 0.45);
  color: rgba(255, 225, 242, 0.8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(8px);
  transition: all 0.25s ease;
}

.icon-btn:hover {
  background: rgba(255, 140, 205, 0.25);
  border-color: rgba(255, 210, 235, 0.7);
  color: #fff;
  transform: translateY(-1px);
}

.icon-btn.active {
  border-color: rgba(255, 170, 220, 0.7);
  box-shadow: 0 0 12px rgba(255, 130, 195, 0.35);
}

.icon-btn.heart-active {
  background: rgba(255, 80, 145, 0.32);
  border-color: rgba(255, 155, 200, 0.92);
  color: #ffd6e9;
  box-shadow: 0 0 18px rgba(255, 85, 155, 0.65);
}

.icon-btn.muted {
  opacity: 0.45;
}

/* ==================== 照片放大预览弹窗 ==================== */
#photo-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 2, 12, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.32s ease, visibility 0.32s ease;
  padding: 20px;
}

#photo-modal.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.photo-modal-card {
  position: relative;
  max-width: min(90vw, 480px);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 12px 18px;
  border-radius: 16px;
  background: linear-gradient(155deg, rgba(40, 18, 52, 0.92), rgba(16, 8, 24, 0.96));
  border: 1px solid rgba(255, 195, 230, 0.38);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.72),
    0 0 36px rgba(255, 115, 190, 0.25);
  transform: scale(1);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

#photo-modal.hidden .photo-modal-card {
  transform: scale(0.88);
}

#photo-modal-img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 10px;
  object-fit: contain;
  display: block;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.photo-modal-footer {
  width: 100%;
  margin-top: 12px;
  padding: 0 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(255, 232, 244, 0.86);
  font-size: 0.88rem;
  letter-spacing: 1.5px;
}

.photo-modal-counter {
  font-size: 0.76rem;
  color: rgba(255, 210, 235, 0.62);
  white-space: nowrap;
}

.photo-modal-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 200, 230, 0.45);
  background: rgba(26, 10, 34, 0.9);
  color: #ffe8f3;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.photo-modal-close:hover {
  background: rgba(255, 110, 180, 0.45);
  transform: scale(1.08);
}

.photo-nav-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 200, 230, 0.35);
  background: rgba(20, 10, 28, 0.65);
  color: #ffe8f3;
  font-size: 1.4rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: all 0.22s ease;
}

.photo-nav-btn:hover {
  background: rgba(255, 120, 190, 0.35);
  border-color: rgba(255, 215, 238, 0.8);
}

.photo-nav-prev {
  left: max(14px, calc(50% - 300px));
}

.photo-nav-next {
  right: max(14px, calc(50% - 300px));
}

@media (max-width: 640px) {
  .photo-nav-btn {
    width: 38px;
    height: 38px;
    font-size: 1.2rem;
  }
  .photo-nav-prev {
    left: 10px;
  }
  .photo-nav-next {
    right: 10px;
  }
}

.hud-bottom {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 18px;
  border-radius: 999px;
  background: rgba(15, 8, 22, 0.4);
  border: 1px solid rgba(255, 200, 230, 0.14);
  backdrop-filter: blur(6px);
  font-size: 0.76rem;
  letter-spacing: 1.5px;
  color: rgba(255, 230, 244, 0.58);
  white-space: nowrap;
}

.hud-bottom .dot {
  opacity: 0.45;
}

@keyframes pulseGlow {
  0%, 100% {
    text-shadow:
      0 0 12px rgba(255, 130, 195, 0.85),
      0 0 32px rgba(255, 90, 175, 0.55),
      0 0 64px rgba(190, 80, 255, 0.3);
  }
  50% {
    text-shadow:
      0 0 18px rgba(255, 155, 210, 1),
      0 0 44px rgba(255, 110, 185, 0.75),
      0 0 82px rgba(210, 100, 255, 0.5);
  }
}

@media (max-width: 768px) {
  .hud-top-right {
    top: 16px;
    right: 18px;
  }
  .hud-bottom {
    font-size: 0.68rem;
    padding: 6px 14px;
  }
}
