/* ============================================================
   Liquid Glass 婚礼邀请函
   ============================================================ */
:root {
  --ink: #2b2430;
  --ink-soft: rgba(43, 36, 48, 0.62);
  --blush: #d9a0a8;
  --champagne: #e9d5b8;
  --bg: #f6f1ec;
  --glass-bg: rgba(255, 255, 255, 0.38);
  --glass-bg-strong: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.65);
  --glass-shadow: 0 18px 50px rgba(120, 90, 80, 0.18);
  --serif: "Cormorant Garamond", "Noto Serif SC", "Songti SC", serif;
  --sans: "Noto Serif SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --ease-apple: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- 氛围背景 ---------- */
.ambient {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  overflow: hidden;
}
.blob {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: 0.55;
  animation: drift 26s ease-in-out infinite alternate;
}
.blob-1 { width: 55vw; height: 55vw; left: -15vw; top: -10vh;
  background: radial-gradient(circle, #f3d3cd, transparent 65%); }
.blob-2 { width: 45vw; height: 45vw; right: -12vw; top: 35vh;
  background: radial-gradient(circle, #e9d5b8, transparent 65%);
  animation-delay: -8s; }
.blob-3 { width: 40vw; height: 40vw; left: 20vw; bottom: -20vh;
  background: radial-gradient(circle, #d8e4ee, transparent 65%);
  animation-delay: -16s; }
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(6vw, -5vh) scale(1.15); }
}

/* ---------- Liquid Glass 通用材质 ---------- */
.liquid-glass {
  position: relative;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
  backdrop-filter: blur(22px) saturate(1.6);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  box-shadow: var(--glass-shadow),
              inset 0 1px 0 rgba(255, 255, 255, 0.7),
              inset 0 -8px 24px rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.liquid-glass::before {
  /* 镜面高光 */
  content: "";
  position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(115deg,
    rgba(255,255,255,0.55) 0%,
    rgba(255,255,255,0.08) 22%,
    transparent 40%,
    transparent 70%,
    rgba(255,255,255,0.15) 100%);
  pointer-events: none;
}
.liquid-glass::after {
  /* 液态流光 */
  content: "";
  position: absolute; inset: -40%;
  background: conic-gradient(from 0deg,
    transparent 0deg, rgba(255,255,255,0.18) 40deg,
    transparent 90deg, transparent 200deg,
    rgba(255,255,255,0.12) 260deg, transparent 320deg);
  animation: liquidSheen 14s linear infinite;
  pointer-events: none;
}
@keyframes liquidSheen { to { transform: rotate(360deg); } }

/* ---------- 入场揭示动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(46px) scale(0.985);
  transition: opacity 1s var(--ease-apple), transform 1s var(--ease-apple);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: translateY(0) scale(1); }

/* ---------- 导航 ---------- */
.glass-nav {
  position: fixed; top: 16px; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: center;
  padding: 0 16px;
  opacity: 0; transform: translateY(-20px);
  transition: opacity .6s var(--ease-apple), transform .6s var(--ease-apple);
}
.glass-nav.show { opacity: 1; transform: translateY(0); }
.nav-inner {
  display: flex; align-items: center; gap: 28px;
  padding: 10px 26px; border-radius: 999px;
}
.nav-logo {
  font-family: var(--serif); font-weight: 600; font-size: 18px;
  letter-spacing: 2px; font-style: italic;
}
.nav-links { display: flex; gap: 6px; position: relative; }
.nav-links a {
  position: relative; z-index: 2;
  color: var(--ink); text-decoration: none; font-size: 14px;
  letter-spacing: 1px; opacity: .65;
  padding: 6px 14px; border-radius: 999px;
  transition: opacity .35s, color .35s;
}
.nav-links a:hover { opacity: 1; }
.nav-links a.active { opacity: 1; color: #fff; }
.nav-indicator {
  position: absolute; z-index: 1; top: 0; left: 0; height: 100%;
  border-radius: 999px; background: rgba(43,36,48,.85);
  box-shadow: 0 6px 18px rgba(43,36,48,.28);
  opacity: 0; transform: scale(.6);
  transition: left .45s var(--ease-apple), width .45s var(--ease-apple),
              opacity .3s, transform .45s var(--ease-apple);
  pointer-events: none;
}
.nav-indicator.on { opacity: 1; transform: scale(1); }
.nav-cta {
  border: 1px solid rgba(43,36,48,.25);
}
.nav-cta.active { border-color: transparent; }

/* ---------- HERO ---------- */
.hero {
  position: relative; height: 100vh; height: 100svh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; z-index: 1;
}
.hero-photo {
  position: absolute; inset: -8%;
  background-size: cover; background-position: center;
  transform: scale(1.12);
  will-change: transform, filter;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(30,20,25,.25) 0%, rgba(30,20,25,.15) 45%,
    rgba(246,241,236,.95) 100%);
}
.hero-content {
  position: relative; z-index: 2; text-align: center;
  padding: 0 24px; color: #fff;
  margin-top: 150px;
}
.hero-eyebrow {
  font-family: var(--serif); letter-spacing: 6px; font-size: clamp(11px, 1.6vw, 15px);
  opacity: .85; margin-bottom: 18px; font-style: italic;
}
.hero-names {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(42px, 9vw, 96px);
  line-height: 1.15; letter-spacing: 4px;
  text-shadow: 0 4px 40px rgba(0,0,0,.35);
}
.hero-names .amp {
  display: inline-block; font-style: italic; font-weight: 400;
  margin: 0 .25em; font-size: .6em; vertical-align: middle;
  color: var(--champagne);
}
.hero-date {
  margin-top: 16px; font-size: clamp(14px, 2vw, 19px);
  letter-spacing: 3px; opacity: .92;
}
.hero-card {
  margin: 34px auto 0; max-width: 520px;
  padding: 22px 34px; color: #fff;
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.35);
  box-shadow: 0 18px 50px rgba(0,0,0,.25),
              inset 0 1px 0 rgba(255,255,255,.4);
}
.hero-card-title { font-family: var(--serif); font-size: 22px; letter-spacing: 4px; margin-bottom: 8px; }
.hero-card-msg { font-size: 14px; line-height: 1.9; opacity: .92; white-space: pre-line; }
.scroll-hint {
  position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%);
  z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: rgba(43,36,48,.6); font-size: 12px; letter-spacing: 3px;
}
.scroll-line {
  width: 1px; height: 46px; overflow: hidden; position: relative;
  background: rgba(43,36,48,.18);
}
.scroll-line::after {
  content: ""; position: absolute; left: 0; top: -100%;
  width: 100%; height: 100%;
  background: var(--ink-soft);
  animation: scrollPulse 1.8s var(--ease-apple) infinite;
}
@keyframes scrollPulse {
  0% { top: -100%; } 60%, 100% { top: 100%; }
}

/* ---------- 通用 section ---------- */
section { position: relative; z-index: 1; padding: 90px 20px; }
.section-title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(26px, 4.5vw, 40px);
  text-align: center; letter-spacing: 6px; margin-bottom: 44px;
}

/* ---------- 倒计时 ---------- */
.countdown-grid {
  display: grid; grid-template-columns: repeat(4, minmax(70px, 130px));
  gap: 16px; justify-content: center;
}
.count-card {
  padding: 26px 10px; text-align: center; border-radius: 24px;
}
.count-num {
  display: block; font-family: var(--serif);
  font-size: clamp(34px, 6vw, 56px); font-weight: 600;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.count-label { font-size: 13px; letter-spacing: 4px; opacity: .6; }

/* ---------- 邀请文案 ---------- */
.invite-card {
  max-width: 640px; margin: 0 auto; padding: 54px 40px;
  text-align: center;
}
.couple-avatars { display: flex; justify-content: center; margin-bottom: 26px; }
.couple-avatars img {
  width: 92px; height: 92px; border-radius: 50%; object-fit: cover;
  border: 3px solid rgba(255,255,255,.85);
  box-shadow: 0 10px 30px rgba(120,90,80,.25);
}
.couple-avatars img + img { margin-left: -22px; }
.invite-text { white-space: pre-line; line-height: 2.2; color: var(--ink-soft); font-size: 16px; }
.invite-footer {
  margin-top: 26px; font-family: var(--serif); font-style: italic;
  letter-spacing: 3px; font-size: 17px;
}

/* ---------- 故事章节：粘性滚动（Apple 风格） ---------- */
.story { padding-bottom: 40px; }
.chapter { height: 230vh; position: relative; }
.chapter-stage {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.chapter-photo {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  will-change: transform, clip-path, border-radius, filter;
  transform: scale(1.25);
  clip-path: inset(28% 30% 28% 30% round 44px);
}
.chapter-text {
  position: relative; z-index: 2; text-align: center;
  color: #fff; padding: 0 24px;
  will-change: opacity, transform;
}
.chapter-subtitle {
  font-family: var(--serif); font-style: italic;
  letter-spacing: 8px; font-size: clamp(11px, 1.5vw, 14px);
  opacity: .85; margin-bottom: 14px;
}
.chapter-title {
  font-family: var(--serif); font-size: clamp(38px, 8vw, 84px);
  font-weight: 600; letter-spacing: 10px;
  text-shadow: 0 6px 50px rgba(0,0,0,.4);
}
.chapter-body {
  margin: 22px auto 0; max-width: 560px;
  font-size: clamp(14px, 1.8vw, 17px); line-height: 2.1;
  text-shadow: 0 2px 20px rgba(0,0,0,.45);
}
.chapter-index {
  position: absolute; z-index: 2; bottom: 5vh; left: 50%; transform: translateX(-50%);
  font-family: var(--serif); font-style: italic; color: rgba(255,255,255,.75);
  letter-spacing: 3px; font-size: 14px;
}

/* ---------- 相册：视差网格 ---------- */
.gallery-grid {
  max-width: 1100px; margin: 0 auto;
  columns: 2; column-gap: 18px;
}
.g-item {
  margin-bottom: 18px; border-radius: 26px; overflow: hidden;
  break-inside: avoid; position: relative;
  box-shadow: 0 16px 44px rgba(120,90,80,.16);
  opacity: 0; transform: translateY(60px) scale(.96);
  transition: opacity 1s var(--ease-apple), transform 1s var(--ease-apple);
}
.g-item.in { opacity: 1; transform: translateY(0) scale(1); }
.g-item img {
  width: 100%; transition: transform 1.4s var(--ease-apple);
  will-change: transform;
}
.g-item:hover img { transform: scale(1.06); }
.g-item::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(43,36,48,.28));
  opacity: 0; transition: opacity .6s;
}
.g-item:hover::after { opacity: 1; }

/* ---------- 地点 ---------- */
.venue-card {
  max-width: 620px; margin: 0 auto; padding: 54px 40px; text-align: center;
}
.venue-name { font-family: var(--serif); font-size: 28px; letter-spacing: 3px; margin-bottom: 12px; }
.venue-addr { color: var(--ink-soft); line-height: 1.9; margin-bottom: 8px; }
.venue-date { font-family: var(--serif); font-style: italic; letter-spacing: 2px; margin-bottom: 30px; }
.venue-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 30px; border-radius: 999px;
  color: var(--ink); text-decoration: none; font-size: 15px; letter-spacing: 2px;
  background: var(--glass-bg-strong);
  transition: transform .4s var(--ease-apple), box-shadow .4s;
}
.venue-btn:hover { transform: translateY(-3px); box-shadow: 0 22px 54px rgba(120,90,80,.28); }

/* ---------- RSVP ---------- */
.rsvp-card {
  max-width: 620px; margin: 0 auto; padding: 54px 40px;
}
.rsvp-sub { text-align: center; color: var(--ink-soft); margin: -26px 0 34px; letter-spacing: 1px; }
.form-row { margin-bottom: 24px; position: relative; z-index: 1; }
.form-row label {
  display: block; font-size: 14px; letter-spacing: 2px;
  margin-bottom: 10px; opacity: .75;
}
.form-row input[type="text"],
.form-row input[type="tel"],
.form-row textarea {
  width: 100%; padding: 14px 18px;
  border: 1px solid rgba(43,36,48,.14); border-radius: 16px;
  background: rgba(255,255,255,.6);
  font-family: inherit; font-size: 15px; color: var(--ink);
  outline: none; transition: border-color .3s, box-shadow .3s;
  resize: vertical;
}
.form-row input:focus, .form-row textarea:focus {
  border-color: var(--blush);
  box-shadow: 0 0 0 4px rgba(217,160,168,.18);
}
.pill-group { display: flex; flex-wrap: wrap; gap: 10px; }
.pill {
  padding: 10px 22px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(43,36,48,.16); background: rgba(255,255,255,.5);
  font-size: 14px; letter-spacing: 1px; user-select: none;
  transition: all .35s var(--ease-apple);
}
.pill.active {
  background: rgba(43,36,48,.88); color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 26px rgba(43,36,48,.25);
}
.stepper {
  display: inline-flex; align-items: center; gap: 20px;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(255,255,255,.55); border: 1px solid rgba(43,36,48,.12);
}
.stepper-btn {
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: rgba(43,36,48,.85); color: #fff; font-size: 18px;
  cursor: pointer; transition: transform .3s var(--ease-apple);
}
.stepper-btn:hover { transform: scale(1.12); }
.stepper span {
  font-family: var(--serif); font-size: 22px; font-weight: 600;
  min-width: 28px; text-align: center;
}
.submit-btn {
  width: 100%; padding: 17px; border: none; cursor: pointer;
  font-size: 16px; letter-spacing: 6px; font-family: inherit;
  color: var(--ink); background: rgba(255,255,255,.65);
  transition: transform .4s var(--ease-apple), box-shadow .4s;
  z-index: 1;
}
.submit-btn:hover { transform: translateY(-2px); box-shadow: 0 24px 60px rgba(120,90,80,.3); }
.submit-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.form-tip { text-align: center; margin-top: 14px; font-size: 13px; min-height: 18px; }
.form-tip.error { color: #c0534f; }
.form-tip.ok { color: #4f8a5b; }

/* ---------- 页脚 ---------- */
.footer { text-align: center; padding: 60px 20px 70px; position: relative; z-index: 1; }
.footer-names { font-family: var(--serif); font-size: 24px; letter-spacing: 4px; }
.footer-date { margin-top: 8px; color: var(--ink-soft); letter-spacing: 2px; font-size: 13px; }
.footer-visit {
  display: inline-block; margin-top: 22px; padding: 8px 22px;
  border-radius: 999px; font-size: 13px; color: var(--ink-soft);
}
.footer-visit b { font-family: var(--serif); font-size: 16px; }

/* ---------- 音乐悬浮按钮 ---------- */
.music-btn {
  position: fixed; right: 18px; bottom: 22px; z-index: 60;
  width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid var(--glass-border);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--ink); padding: 0;
  transition: transform .4s var(--ease-apple), box-shadow .4s;
}
.music-btn:hover { transform: scale(1.1); }
.music-disc {
  display: flex; align-items: center; justify-content: center;
  animation: spinDisc 5s linear infinite;
  animation-play-state: paused;
  opacity: .8;
}
.music-btn.playing .music-disc { animation-play-state: running; opacity: 1; }
/* 图标切换：播放时显示旋转音符，暂停时显示暂停图标 */
.music-btn .icon-pause { display: none; }
.music-btn:not(.playing) .music-disc { display: none; }
.music-btn:not(.playing) .icon-pause { display: block; }
.music-btn::after { animation: none; }
@keyframes spinDisc { to { transform: rotate(360deg); } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 40px; z-index: 99;
  transform: translate(-50%, 120px);
  padding: 15px 34px; border-radius: 999px;
  background: rgba(43,36,48,.92); color: #fff;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  font-size: 15px; letter-spacing: 2px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  transition: transform .6s var(--ease-apple);
}
.toast.show { transform: translate(-50%, 0); }

/* ---------- 响应式（移动端优先增强） ---------- */
@media (max-width: 640px) {
  .glass-nav { top: 10px; padding: 0 10px; }
  .nav-inner { gap: 14px; padding: 8px 16px; max-width: 100%; }
  .nav-logo { font-size: 15px; }
  .nav-links { gap: 2px; }
  .nav-links a { font-size: 12px; padding: 5px 10px; letter-spacing: 0; }
  section { padding: 64px 14px; }
  .section-title { letter-spacing: 3px; margin-bottom: 32px; }
  .gallery-grid { columns: 1; }
  .invite-card, .venue-card, .rsvp-card { padding: 40px 22px; border-radius: 24px; }
  .countdown-grid { gap: 8px; grid-template-columns: repeat(4, minmax(64px, 1fr)); padding: 0 4px; }
  .count-card { padding: 18px 6px; border-radius: 18px; }
  .hero-names { letter-spacing: 2px; }
  .hero-card { padding: 18px 22px; }
  .chapter { height: 200vh; }
  .chapter-title { letter-spacing: 6px; }
  .chapter-body { line-height: 1.9; }
  .couple-avatars img { width: 76px; height: 76px; }
  .music-btn { right: 14px; bottom: 16px; width: 46px; height: 46px; }
  .toast { bottom: 84px; max-width: 86vw; text-align: center; }
  .pill { padding: 9px 18px; font-size: 13px; }
  .submit-btn { letter-spacing: 4px; }
}
@media (min-width: 641px) and (max-width: 1024px) {
  .gallery-grid { columns: 2; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal, .g-item { transition: none; opacity: 1; transform: none; }
  .chapter-photo { clip-path: none !important; transform: none !important; }
}
