/*
 * 甜蜜表白 · Love POP
 * 样式风格：温馨浪漫，主色调粉/红系
 */

:root {
  --pink: #ff69b4; /* 主色：浪漫粉 */
  --deep-pink: #ff1493; /* 次色：深粉 */
  --bg: #fff0f6; /* 柔和背景 */
  --text: #a6005c; /* 文本色偏红紫 */
  --white: #ffffff;
  --popup-bg: rgba(255, 255, 255, 0.85);
  --border: rgba(255, 105, 180, 0.6);
  --shadow: rgba(255, 105, 180, 0.35);
  --ios-blue: #0A84FF; /* iOS 风格确认按钮色 */
  --ios-grey: #6e6e73; /* iOS 风格次级按钮色 */
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe Script", "Comic Sans MS", cursive, system-ui;
}

/* 预加载遮罩 */
#preloader {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #fff5f9, #ffe3ef);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.loader-card {
  width: min(480px, 90vw);
  background: var(--popup-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 24px var(--shadow);
  padding: 24px 20px;
  text-align: center;
}
.loader-title {
  font-size: clamp(18px, 2.6vw, 24px);
  margin-bottom: 16px;
  color: var(--deep-pink);
}
.progress-wrap {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--pink), var(--deep-pink));
  transition: width 0.2s ease-out;
}
.progress-text { margin-top: 10px; font-size: 14px; }

/* 柔和背景光晕 */
.glow-bg {
  position: fixed;
  inset: -10%;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(1200px 800px at 20% 30%, rgba(255, 105, 180, 0.15), transparent 70%),
              radial-gradient(900px 600px at 80% 70%, rgba(255, 20, 147, 0.12), transparent 60%);
  animation: glowShift 12s ease-in-out infinite;
}
@keyframes glowShift {
  0%, 100% { filter: blur(16px) saturate(1.05); opacity: 0.9; }
  50%      { filter: blur(20px) saturate(1.2);  opacity: 1; }
}

/* 画布（背景动画） */
.bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* 主区块 */
#app {
  position: relative;
  z-index: 2; /* 在画布之上 */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 20px 16px 60px;
}
.hero {
  margin-top: min(10vh, 120px);
  text-align: center;
}
.hero-title {
  font-size: clamp(26px, 6vw, 48px);
  margin: 0 0 10px;
  color: var(--deep-pink);
  text-shadow: 0 2px 8px rgba(255, 20, 147, 0.25);
}
.hero-sub {
  font-size: clamp(16px, 3.6vw, 20px);
  margin: 0;
  opacity: 0.9;
}

.controls { margin-top: 22px; }
.btn {
  background: linear-gradient(90deg, var(--pink), var(--deep-pink));
  color: var(--white);
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  box-shadow: 0 6px 16px var(--shadow);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 20px var(--shadow); }
.btn:active { transform: translateY(0); }

/* 弹窗层与弹窗样式（Safari 风格） */
.popup-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none; /* 弹窗自身可点，层不可点 */
}
.popup {
  position: absolute;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  padding: 12px 14px;
  color: #222;
  font-size: clamp(14px, 3.6vw, 16px);
  user-select: none;
  will-change: transform, opacity;
  pointer-events: auto;
}

.popup-content {
  padding: 6px 4px 10px;
  text-align: center;
}
.popup-actions {
  display: flex;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.popup-btn {
  flex: 1;
  border: none;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.12s ease;
}
.popup-btn.confirm {
  color: #fff;
  background: var(--ios-blue);
}
.popup-btn.cancel {
  color: #111;
  background: rgba(0, 0, 0, 0.06);
}
.popup-btn:hover { transform: translateY(-0.5px); }
.popup-btn:active { transform: translateY(0); }

/* 响应式断点 */
@media (max-width: 767px) {
  .popup { padding: 10px 14px; }
  .hero-title { font-size: clamp(24px, 8vw, 40px); }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .hero-title { font-size: clamp(28px, 6vw, 44px); }
}
@media (min-width: 1024px) {
  .popup { padding: 12px 18px; }
}