/* ============================================================
   婚礼邀请函 — 样式表（移动端优先）
   主色：香槟金 #C6A769 + 深墨 #2B2622 + 胭脂红 #B23A48
   ============================================================ */

:root {
  --champagne: #C6A769;
  --ink: #2B2622;
  --rouge: #B23A48;
  --cream: #FBF8F3;
  --card: #FFFFFF;
  --ink-soft: #6B6259;
  --line: rgba(198, 167, 105, 0.28);
  --shadow: 0 10px 30px rgba(43, 38, 34, 0.08);
  --radius: 18px;
  --radius-lg: 24px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --maxw: 480px;
}

* { box-sizing: border-box; }

/* hidden 属性必须能压过作者样式里的 display（.lightbox / .map-fallback /
   .music-toggle 等都设了 display:flex，会覆盖 UA 默认的 [hidden]{display:none}）。
   放在 reset 段，一次性覆盖全部带 hidden 的元素。 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "PingFang SC", "Helvetica Neue", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--cream);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, .serif {
  font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
  font-weight: 600;
  letter-spacing: 0.02em;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

#app {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  background: var(--cream);
  position: relative;
  overflow: hidden;
}

/* ---------- 通用 section ---------- */
.section {
  padding: 44px 22px;
}
.section__title {
  font-size: 28px;
  margin: 0 0 6px;
  text-align: center;
  color: var(--ink);
}
.section__title::after {
  content: "";
  display: block;
  width: 46px;
  height: 2px;
  margin: 12px auto 0;
  background: linear-gradient(90deg, transparent, var(--champagne), transparent);
}
.section__subtitle {
  text-align: center;
  margin: 10px 0 24px;
  font-size: 14px;
  color: var(--ink-soft);
}

/* ============================================================
   1. 首屏迎宾封面
   ============================================================ */
.cover {
  position: relative;
  height: 100vh;
  min-height: 620px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
}
/* 封面主图：用 contain 完整显示整张横图，露出完整建筑与人物。
   cover 会把 1920×1280 的横图裁到只剩约 27% 宽，两侧建筑与人物下半身全被裁掉。
   contain 留下的上下留白由 .cover::before 的同图模糊层填充，不会出现生硬空白。 */
.cover__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center 22%;   /* 取值由配置驱动 / 已实拍调优 */
  background: transparent;
  transform: none;               /* contain 下放大即裁切，违背「完整显示」，故不做 transform */
  animation: none;               /* kenburns 会让图片溢出被裁，封面关闭该动效 */
  z-index: 1;
}
/* 封面留白填充：用同一张图的模糊放大版铺满，让 letterbox 的上下区域
   与照片同色系，视觉上自然过渡（照片 URL 由 JS 写入 --cover-img）。
   放在 .cover 之后、且 z-index 低于主图，保证不遮挡照片。 */
.cover::before {
  content: "";
  position: absolute;
  inset: -10%;                   /* 外扩，避免模糊边缘露出透明圈 */
  z-index: 0;
  background-image: var(--cover-img, none);
  background-size: cover;
  background-position: center;
  /* brightness 保持接近 1，让模糊层与照片亮度接近，消除照片上下边缘的明暗硬切；
     更大 blur 半径把接缝弱化为「清晰 vs 虚化」的景深差异（大光圈虚化感）。 */
  filter: blur(44px) saturate(1.05) brightness(0.95);
  transform: scale(1.06);
  pointer-events: none;
}
/* 封底：保持原有的 cover + 缓慢缩放动效，完全不变 */
.backcover__bg {
  position: absolute;
  top: -4%;
  left: -4%;
  width: 108%;
  height: 108%;
  /* 用真实 <img> + object-fit 而非 background，微信才能抓到分享缩略图 */
  object-fit: cover;
  object-position: center 40%;
  background: #2B2622;
  transform: scale(1.06);
  animation: kenburns 26s ease-in-out infinite alternate;
}
.cover__mask {
  position: absolute;
  inset: 0;
  z-index: 2;
  /* 模糊层不再压暗后，顶部 / 中段相应减淡，避免留白过曝；
     底部 0.70 / 0.92 保持不变，保证白色文案可读。 */
  background: linear-gradient(180deg,
    rgba(24, 20, 17, 0.40) 0%,
    rgba(24, 20, 17, 0.10) 24%,
    rgba(24, 20, 17, 0.14) 44%,
    rgba(24, 20, 17, 0.70) 74%,
    rgba(24, 20, 17, 0.92) 100%);
}
.cover__content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12vh;
  z-index: 3;
  padding: 0 26px;
  animation: fadeUp 1.2s var(--ease) both;
}
.cover__eyebrow {
  font-size: 11px;
  letter-spacing: 0.42em;
  color: rgba(255, 255, 255, 0.82);
  margin: 0 0 18px;
  padding-left: 0.42em;
}
.cover__names {
  font-size: 40px;
  margin: 0;
  line-height: 1.35;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
}
.cover__heart {
  color: var(--champagne);
  font-size: 24px;
  animation: heartbeat 1.8s var(--ease) infinite;
}
.cover__date {
  font-size: 26px;
  letter-spacing: 0.16em;
  margin: 24px 0 6px;
  color: var(--champagne);
  font-family: "Noto Serif SC", serif;
}
.cover__slogan {
  font-size: 15px;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.9);
  margin: 10px 0 0;
}
.cover__scroll {
  position: absolute;
  bottom: 30px;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  letter-spacing: 0.2em;
}
.cover__scroll-arrow {
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--champagne);
  border-bottom: 2px solid var(--champagne);
  transform: rotate(45deg);
  animation: breathe 1.8s var(--ease) infinite;
}

/* ============================================================
   2. 核心信息卡
   ============================================================ */
.info-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 8px 20px;
  margin-top: 22px;
}
.info-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.info-row:last-child { border-bottom: none; }
.info-icon {
  font-size: 20px;
  line-height: 1.4;
  filter: drop-shadow(0 2px 4px rgba(198, 167, 105, 0.35));
}
.info-body { display: flex; flex-direction: column; }
.info-label {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--champagne);
}
.info-value {
  font-size: 16px;
  color: var(--ink);
  margin-top: 2px;
}

/* ============================================================
   3. 倒计时
   ============================================================ */
.section--countdown {
  background: linear-gradient(180deg, #fff 0%, var(--cream) 100%);
}
.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 26px;
}
.countdown__cell {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 4px 12px;
  text-align: center;
  box-shadow: var(--shadow);
}
.countdown__num {
  display: block;
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-variant-numeric: tabular-nums;
  font-size: 28px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.1;
}
.countdown__label {
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 0.1em;
}
.countdown--today .countdown__num { color: var(--rouge); }
.countdown__hint {
  text-align: center;
  margin: 18px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}
.countdown__celebrate {
  text-align: center;
  font-size: 22px;
  color: var(--rouge);
  margin: 12px 0 0;
  font-family: "Noto Serif SC", serif;
}

/* ============================================================
   4. 婚纱照画廊
   ============================================================ */
.gallery-group { margin-bottom: 34px; }
.gallery-group__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 0 4px 12px;
}
.gallery-group__title { font-size: 20px; margin: 0; }
.gallery-group__subtitle {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--champagne);
  text-transform: uppercase;
}
.gallery-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 4px 22px 14px;
  margin: 0 -22px;
  scrollbar-width: none;
}
.gallery-scroll::-webkit-scrollbar { display: none; }
.gallery-item {
  scroll-snap-align: center;
  flex: 0 0 auto;
  /* <button> 的 UA 默认边框是 `2px outset`，与米色背景和照片都不融合，显式归零 */
  border: 0;
  border-radius: var(--radius);
  overflow: hidden;
  /* 极柔外投影：扩散更大、透明度更低，让卡片与米色页面自然融合、无可见边框线 */
  box-shadow: 0 10px 28px rgba(43, 38, 34, 0.055);
  cursor: pointer;
  position: relative;
  /* 与页面同色系，照片未加载时也不会露出灰块 */
  background: var(--cream);
}
.gallery-item--portrait { width: 64vw; max-width: 300px; aspect-ratio: 3 / 4; }
.gallery-item--landscape { width: 78vw; max-width: 360px; aspect-ratio: 4 / 3; }
.gallery-item picture, .gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.96);
  transition: transform 0.6s var(--ease);
}
.gallery-item:active img { transform: scale(1.03); }
.gallery-item__zoom {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(24, 20, 17, 0.5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  backdrop-filter: blur(4px);
}

/* ============================================================
   5. 时间线
   ============================================================ */
.timeline {
  list-style: none;
  margin: 26px 0 0;
  padding: 0 0 0 6px;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 27px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--champagne), rgba(198, 167, 105, 0.15));
}
.timeline__item {
  position: relative;
  display: flex;
  gap: 18px;
  padding: 0 0 30px 0;
  opacity: 0.35;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.timeline__item.is-active { opacity: 1; transform: translateY(0); }
.timeline__dot {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--card);
  box-shadow: 0 0 0 2px var(--champagne);
  background: #eee;
}
.timeline__dot img { width: 100%; height: 100%; object-fit: cover; }
.timeline__body { flex: 1 1 auto; }
.timeline__title {
  font-size: 17px;
  margin: 6px 0 2px;
  color: var(--ink);
}
.timeline__date {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--champagne);
  margin: 0 0 6px;
}
.timeline__text {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0;
}

/* ============================================================
   6. 场地 & 地图
   ============================================================ */
.venue-name {
  text-align: center;
  font-size: 18px;
  margin: 22px 0 2px;
  font-family: "Noto Serif SC", serif;
}
.venue-address {
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 20px;
}
.map-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #EDE7DC;
  min-height: 240px;
}
.map-container { width: 100%; height: 260px; }
.map-fallback {
  height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background:
    radial-gradient(circle at 50% 45%, rgba(198, 167, 105, 0.22), transparent 60%),
    repeating-linear-gradient(45deg, #F3EEE4, #F3EEE4 12px, #EFE8DB 12px, #EFE8DB 24px);
}
.map-fallback__pin { font-size: 40px; animation: breathe 2s var(--ease) infinite; }
.map-fallback__name { font-size: 16px; margin: 4px 0 0; font-family: "Noto Serif SC", serif; }
.map-fallback__hint { font-size: 12px; color: var(--ink-soft); margin: 0; }

.map-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin: 18px 0 6px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 8px;
  border-radius: 12px;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease);
  font-family: inherit;
}
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--champagne); color: #fff; }
.btn--ghost { background: #fff; border-color: var(--line); color: var(--ink); }


/* ============================================================
   7. 结尾封底
   ============================================================ */
.backcover {
  position: relative;
  height: 100vh;
  min-height: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
  overflow: hidden;
}
.backcover__mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(24, 20, 17, 0.5), rgba(24, 20, 17, 0.68));
}
.backcover__content { position: relative; z-index: 2; padding: 0 30px; }
.backcover__thanks {
  font-size: 16px;
  letter-spacing: 0.1em;
  margin: 0 0 20px;
  color: rgba(255, 255, 255, 0.92);
}
.backcover__sign {
  font-size: 30px;
  font-family: "Noto Serif SC", serif;
  margin: 0;
}
.backcover__heart { color: var(--champagne); }
.backcover__date {
  font-size: 20px;
  letter-spacing: 0.18em;
  color: var(--champagne);
  margin: 14px 0 0;
}
.backcover__foot {
  position: absolute;
  bottom: 22px;
  left: 0;
  right: 0;
  z-index: 2;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

/* ============================================================
   音乐开关 / 返回顶部
   ============================================================ */
.music-toggle {
  position: fixed;
  right: max(16px, calc(50% - var(--maxw) / 2 + 16px));
  top: 18px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(43, 38, 34, 0.72);
  color: #fff;
  z-index: 45;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(43, 38, 34, 0.25);
  backdrop-filter: blur(6px);
}
.music-toggle__disc {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--champagne) 0 30%, #6B5A33 30% 100%);
  animation: spin 6s linear infinite;
  animation-play-state: paused;
}
.music-toggle.is-playing .music-toggle__disc { animation-play-state: running; }

.back-to-top {
  position: fixed;
  right: max(16px, calc(50% - var(--maxw) / 2 + 16px));
  bottom: 80px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 20px;
  z-index: 45;
  cursor: pointer;
  box-shadow: var(--shadow);
}

/* ============================================================
   Lightbox
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(12, 10, 9, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y pinch-zoom;
}
.lightbox__stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.lightbox__img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.4s var(--ease), transform 0.3s var(--ease);
  will-change: transform;
}
.lightbox__img.is-loaded { opacity: 1; }
.lightbox__close,
.lightbox__nav {
  position: absolute;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: none;
  cursor: pointer;
  backdrop-filter: blur(6px);
  border-radius: 50%;
}
.lightbox__close { top: 18px; right: 18px; width: 42px; height: 42px; font-size: 24px; }
.lightbox__nav { top: 50%; transform: translateY(-50%); width: 46px; height: 46px; font-size: 30px; }
.lightbox__nav--prev { left: 12px; }
.lightbox__nav--next { right: 12px; }
.lightbox__counter {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  letter-spacing: 0.1em;
}

/* ============================================================
   滚动淡入
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ============================================================
   动画
   ============================================================ */
@keyframes kenburns {
  from { transform: scale(1.06) translate(0, 0); }
  to { transform: scale(1.18) translate(-1.6%, -2%); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.22); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.5; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(4px); }
}
@keyframes spin {
  from { transform: rotate(0); }
  to { transform: rotate(360deg); }
}

/* ============================================================
   reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  /* 只对封底生效：封面为 object-fit: contain，任何 scale 都会放大导致边缘被裁 */
  .backcover__bg { transform: scale(1.04); }
  .reveal { opacity: 1; transform: none; }
  .timeline__item { opacity: 1; transform: none; }
}
