/* ============================================================
 * 婚礼请柬 - 自定义样式与动画
 * ============================================================ */

/* ---------- 基础重置 ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html, body {
  height: 100%;
  width: 100%;
  overflow-x: hidden;
  background: #fefafb;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft Yahei", "Helvetica Neue", Arial, sans-serif;
  color: #333;
  -webkit-font-smoothing: antialiased;
}
body {
  overscroll-behavior: none;          /* 禁止下拉回弹 */
  touch-action: manipulation;         /* 禁止双击缩放 + 300ms 延迟 */
  -webkit-user-select: none;
  user-select: none;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  position: relative;
}
input, textarea, button {
  -webkit-user-select: text;
  user-select: text;
  font-family: inherit;
}
button { border: none; outline: none; }
a { text-decoration: none; }

/* ---------- 每一屏 ---------- */
.screen {
  width: 100vw;
  min-height: 100vh;
  min-height: calc(var(--vh, 1vh) * 100);
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}

/* ---------- 渐入动画 ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.fade-in.show {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- 封面遮罩 ---------- */
.cover-mask {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(0,0,0,0.35), rgba(0,0,0,0.55)),
    url("https://picsum.photos/seed/wedding-cover/750/1334") center/cover no-repeat;
  z-index: 0;
  /* 由 main.js 动态替换为 config.coverImage */
}
/* 封面按钮呼吸感 */
.open-btn {
  animation: breath 2.4s ease-in-out infinite;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}
@keyframes breath {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 24px rgba(0,0,0,0.15); }
  50%      { transform: scale(1.04); box-shadow: 0 6px 32px rgba(255,182,193,0.35); }
}
#page1 h1 { letter-spacing: 4px; }

/* ---------- 音乐按钮 ---------- */
.music-btn {
  position: fixed;
  top: calc(20px + env(safe-area-inset-top));
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0,0,0,0.28);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.music-btn.rotate {
  animation: rotate 3.2s linear infinite;
}
@keyframes rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ---------- 输入框 & 主按钮 ---------- */
.input-box {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #f3d9db;
  border-radius: 999px;
  margin-bottom: 12px;
  outline: none;
  background: #fffaf7;
  font-size: 14px;
  color: #444;
  transition: all 0.2s;
}
.input-box:focus {
  border-color: #f3a8ad;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(243,168,173,0.18);
}
.btn-primary {
  width: 100%;
  padding: 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f3a6a9, #e88e93);
  color: #fff;
  border: none;
  font-size: 15px;
  letter-spacing: 2px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(232,142,147,0.35);
  transition: all 0.15s;
}
.btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(232,142,147,0.35);
}

/* ---------- 留言项 ---------- */
.msg-item {
  padding: 12px 14px;
  background: #fff6f6;
  border-radius: 12px;
  margin-bottom: 10px;
  border: 1px solid #fde4e6;
  animation: fadeInShow 0.45s ease;
}
.msg-item .msg-name {
  color: #e36b74;
  font-size: 13px;
  margin-bottom: 4px;
  font-weight: 600;
}
.msg-item .msg-text {
  color: #444;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-all;
}
@keyframes fadeInShow {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- 弹窗 ---------- */
.pop {
  position: fixed;
  left: 0; top: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.pop.show { display: flex; animation: fadeInShow 0.25s ease; }
.pop-content {
  width: 82%;
  max-width: 360px;
  background: #fff;
  border-radius: 20px;
  padding: 24px 22px 22px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}

/* ---------- 恋爱时间轴 ---------- */
.timeline { position: relative; margin-left: 10px; }
.timeline .tl-item { position: relative; }
.timeline .tl-item::before {
  content: "";
  position: absolute;
  left: -27px;
  top: 6px;
  width: 10px; height: 10px;
  background: #f3a6a9;
  border-radius: 50%;
  box-shadow: 0 0 0 4px #fff, 0 0 0 5px #fbd5d8;
}
.timeline .tl-date {
  color: #e36b74;
  font-size: 13px;
  margin-bottom: 3px;
  font-weight: 600;
}
.timeline .tl-text {
  color: #555;
  font-size: 14px;
}

/* ---------- 婚纱照轮播 ---------- */
.carousel-wrap {
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(232,142,147,0.2);
}
.carousel {
  overflow: hidden;
  width: 100%;
}
.carousel-inner {
  display: flex;
  transition: transform 0.5s ease;
  will-change: transform;
}
.carousel-inner .carousel-item {
  flex: 0 0 100%;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f5e6e8 center/cover no-repeat;
}
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}
.carousel-dots .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #f0c9cc;
  transition: all 0.25s;
}
.carousel-dots .dot.active {
  width: 18px;
  border-radius: 3px;
  background: #e36b74;
}

/* ---------- 婚礼流程项 ---------- */
.sch-item {
  display: flex;
  align-items: flex-start;
  background: linear-gradient(135deg, #fff9f9, #fff5ee);
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #fde4e6;
  text-align: left;
}
.sch-time {
  flex: 0 0 58px;
  color: #e36b74;
  font-weight: 700;
  font-size: 14px;
  padding-top: 2px;
}
.sch-body { flex: 1; }
.sch-title {
  color: #333;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}
.sch-desc {
  color: #888;
  font-size: 12px;
  line-height: 1.5;
}
.sch-icon {
  flex: 0 0 28px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #fde4e6;
  color: #e36b74;
  display: flex; align-items: center; justify-content: center;
  margin-right: 10px;
  font-size: 13px;
}

/* ---------- 倒计时 ---------- */
.cd-cell {
  background: linear-gradient(180deg, #f5a4a9, #e7898e);
  border-radius: 14px;
  width: 64px; height: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(231,137,142,0.3);
}
.cd-num {
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  display: block;
  margin-bottom: 6px;
  color: #fff;
  font-family: "DIN Alternate", "Helvetica Neue", Arial, sans-serif;
}
.cd-label {
  font-size: 11px;
  opacity: 0.9;
  color: #fff;
}

/* ============================================================
 * 粒子特效
 * ============================================================ */

/* ---------- 花瓣 ---------- */
.petal {
  position: fixed;
  top: -20px;
  border-radius: 50% 0 50% 50%;
  pointer-events: none;
  z-index: 900;
  opacity: 0.85;
  will-change: transform;
}
@keyframes petalFall {
  0%   { transform: translate3d(0, -10vh, 0) rotate(0deg); }
  100% { transform: translate3d(0, 110vh, 0) rotate(360deg); }
}

/* ---------- 爱心 ---------- */
.heart {
  position: fixed;
  pointer-events: none;
  z-index: 901;
  color: #f48fb1;
  font-size: 16px;
  opacity: 0.9;
  animation: heartUp 2.6s ease-out forwards;
  will-change: transform, opacity;
}
@keyframes heartUp {
  0%   { transform: translate3d(0,0,0) scale(0.7); opacity: 0; }
  15%  { opacity: 1; }
  100% { transform: translate3d(0,-140px,0) scale(1.25); opacity: 0; }
}

/* ---------- 星光层 ---------- */
.star-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.6s;
}
.star-layer.active { opacity: 1; }
.star {
  position: absolute;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px #fff, 0 0 12px #ffd6de;
  animation: twinkle 2.5s ease-in-out infinite;
}
.star.lg { width: 5px; height: 5px; }
@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.6); }
  50%      { opacity: 1;   transform: scale(1.3); }
}

/* ============================================================
 * 滚动条（PC 调试）
 * ============================================================ */
.screen::-webkit-scrollbar { width: 0; height: 0; }
.screen { scrollbar-width: none; }

/* ============================================================
 * 小型屏幕适配
 * ============================================================ */
@media (max-width: 320px) {
  .cd-cell { width: 56px; height: 64px; }
  .cd-num  { font-size: 20px; }
  .open-btn { padding: 10px 22px; font-size: 13px; }
  #page1 h1 { font-size: 32px; }
}
