/* ============================================================
   婚礼答谢宴邀请函 · 梦幻光影（真实照片版）
   色彩：深夜蓝底 + 香槟金点缀，照片章节全屏铺底
   ============================================================ */

:root {
  --bg: #f7f1e8;
  --bg-2: #efe5d4;
  --ink: rgba(66, 45, 22, 0.92);
  --ink-dim: rgba(66, 45, 22, 0.55);
  --gold: #b8873b;
  --gold-soft: #c9a05c;
  --hairline: rgba(184, 135, 59, 0.4);
  /* 霞鹜文楷（按页面用字子集内嵌，见 @font-face）；老设备回退苹方/雅黑 */
  --serif: "LXGW WenKai", "霞鹜文楷", "PingFang SC", "Microsoft YaHei", "Noto Serif SC", serif;
  --sans: "LXGW WenKai", "霞鹜文楷", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.9 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior-y: none;
}

img { display: block; -webkit-user-drag: none; }

/* 微信抓取区（视觉隐藏） */
.wx-share {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

/* 页面主体：移动端全宽，桌面居中成窄栏 */
.page {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 50%, var(--bg) 100%);
  overflow: hidden;
}

/* ---------- 01 开场 ---------- */
.hero {
  position: relative;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 72%;
  opacity: 0;
  animation: bgIn 1.8s ease .2s forwards;
}

@keyframes bgIn { to { opacity: 1; } }

/* 顶部深色渐变压字，底部轻渐变放引导 */
.hero-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(11, 14, 31, 0.74) 0%, rgba(11, 14, 31, 0.38) 26%, rgba(11, 14, 31, 0) 48%),
    linear-gradient(0deg, rgba(11, 14, 31, 0.5) 0%, rgba(11, 14, 31, 0) 20%);
}

/* 光斑漂移 */
.bokeh {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 205, 154, 0.42) 0%, rgba(232, 205, 154, 0) 70%);
  filter: blur(2px);
  pointer-events: none;
  opacity: 0;
}
.b1 { width: 110px; height: 110px; left: 10%; top: 16%; animation: drift 14s ease-in-out 1.2s infinite alternate; }
.b2 { width: 64px;  height: 64px;  right: 12%; top: 24%; animation: drift 11s ease-in-out 1.8s infinite alternate-reverse; }

@keyframes drift {
  0%   { opacity: .5; transform: translate(0, 0) scale(1); }
  100% { opacity: .85; transform: translate(12px, -20px) scale(1.15); }
}

.hero-inner {
  position: absolute;
  z-index: 2;
  top: calc(env(safe-area-inset-top) + 8vh);
  left: 0;
  right: 0;
  text-align: center;
  padding: 0 28px;
}

/* 主标题块：姓名 + 答谢宴 紧凑成组，整体居中 */
.hero-names {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 0;
  font: 500 clamp(34px, 10.6vw, 49px)/1.2 var(--serif);
  letter-spacing: 0.06em;
  color: #fdfbf6;
  text-shadow: 0 2px 26px rgba(11, 14, 31, 0.75);
}

.hero-names .amp {
  flex: none;
  font: 300 0.48em/1 var(--serif);
  font-style: italic;
  color: #fdfbf6;
  margin: 0;
}

.hero-feast {
  margin-top: 6px;
  font: 500 clamp(30px, 9vw, 42px)/1.25 var(--serif);
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  /* 鎏金渐变字：暗金 → 亮金 → 高光 → 亮金 → 暗金，缓慢流光扫过 */
  background: linear-gradient(100deg,
    #8a6a2f 0%, #c9a24e 18%, #eed9a0 34%, #fffbe8 46%,
    #fff3cf 52%, #e3c37a 66%, #c9a24e 82%, #8a6a2f 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 16px rgba(11, 14, 31, 0.6));
  animation: goldShimmer 7s linear infinite;
}

@keyframes goldShimmer {
  0%   { background-position: 220% 50%; }
  100% { background-position: -120% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-feast { animation: none; }
}

/* 答谢宴下方的一行小字（与标题块拉开固定距离，单行不折行） */
.hero-tag {
  margin-top: 30px;
  font-size: clamp(11.5px, 3.7vw, 15px);
  letter-spacing: 0.01em;
  text-indent: 0.01em;
  color: #fdfbf6;
  white-space: nowrap;
}

.hero-date {
  margin-top: 22px;
  display: inline-block;
  font: 400 13px/1 var(--serif);
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: #fdfbf6;
  padding: 10px 22px;
  border-top: 1px solid rgba(253, 251, 246, 0.85);
  border-bottom: 1px solid rgba(253, 251, 246, 0.85);
}

/* 开场逐层淡入 */
.fade-item { opacity: 0; transform: translateY(18px); animation: fadeUp 1.1s cubic-bezier(.22,.61,.36,1) forwards; }
.d1 { animation-delay: .5s; }
.d2 { animation-delay: .75s; }
.d3 { animation-delay: .95s; }
.d4 { animation-delay: 1.15s; }
.d5 { animation-delay: 1.7s; }

@keyframes fadeUp { to { opacity: 1; transform: none; } }

/* 下滑引导 */
.scroll-hint {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 22px);
  transform: translateX(-50%);
  width: 26px;
  height: 44px;
  background: rgba(11, 14, 31, 0.25);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  cursor: pointer;
}

.scroll-hint span {
  position: absolute;
  left: 50%;
  top: 9px;
  width: 3px;
  height: 8px;
  margin-left: -1.5px;
  border-radius: 999px;
  background: var(--gold-soft);
  animation: hintDrop 1.8s ease-in-out infinite;
}

@keyframes hintDrop {
  0%   { transform: translateY(0); opacity: 1; }
  70%  { transform: translateY(14px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ---------- 通用节 ---------- */
.section {
  position: relative;
  padding: 56px 32px;
  text-align: center;
}

.eyebrow {
  font-size: 10px;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  color: rgba(184, 135, 59, 0.75);
  margin-bottom: 14px;
}

.sec-title {
  font: 500 24px/1.4 var(--serif);
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  background: linear-gradient(120deg, #a87c33 0%, #e2c186 30%, #8a6420 55%, #d4af6a 80%, #a87c33 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 34px;
}

.sec-title::after {
  content: "";
  display: block;
  width: 28px;
  height: 1px;
  background: var(--gold);
  margin: 20px auto 0;
  opacity: .7;
}

/* ---------- 07 请柬（奶油平底 + 圆角金边信息卡，同倒计时区风格） ---------- */
.invite-card {
  background: transparent;
  border: none;
  padding: 0;
}

.invite-line {
  font: 400 15px/2 var(--serif);
  letter-spacing: 0.12em;
  color: rgba(66, 45, 22, 0.85);
  margin-bottom: 38px;
}

.info-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 auto;
  max-width: 340px;
}

.info-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 15px 18px;
  background: rgba(253, 249, 241, 0.85);
  border: 1px solid rgba(184, 135, 59, 0.4);
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(66, 45, 22, 0.05);
}

.info-label {
  flex: none;
  font: 500 11px/1 var(--serif);
  letter-spacing: 0.3em;
  color: #8a6420;
  width: 3.2em;
}

.info-value {
  font: 500 14px/1.5 var(--serif);
  letter-spacing: 0.05em;
  color: #3a2508;
}

.invite-note {
  margin-top: 18px;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: rgba(69, 44, 10, 0.68);
}

/* ---------- 照片章节 ---------- */
.chapter {
  position: relative;
  min-height: 86svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.ch-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* 金色线框：篇章照片内衬细金边，强化请柬质感 */
.chapter::after,
.ending::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(216, 181, 108, 0.55);
  box-shadow: inset 0 0 0 3px rgba(216, 181, 108, 0.08);
  pointer-events: none;
  z-index: 3;
}

/* 底部重渐变保证文字可读 */
/* 仅底部轻纱保护文字，照片主体保持原样 */
.ch-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(43, 28, 12, 0.45) 0%, rgba(43, 28, 12, 0) 30%);
}

/* 篇章之间的奶油纸带：相册式留白，照片完全不碰 */
.paper-gap {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.paper-gap::before,
.paper-gap::after {
  content: "";
  width: 56px;
  height: 1px;
  background: var(--hairline);
}

.paper-gap i {
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
  border: 1px solid var(--gold-soft);
}

.ch-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 0 30px calc(env(safe-area-inset-bottom) + 52px);
  text-align: center;
}

.ch-no {
  font-size: 10px;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: var(--gold-soft);
  margin-bottom: 10px;
}

.ch-title {
  font: 500 26px/1.5 var(--serif);
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: #fdfbf6;
  text-shadow: 0 2px 20px rgba(11, 14, 31, 0.7);
  margin-bottom: 18px;
}

.ch-title::after {
  content: "";
  display: block;
  width: 26px;
  height: 1px;
  background: var(--gold-soft);
  margin: 16px auto 0;
  opacity: .8;
}

.ch-line {
  font: 400 15px/2.1 var(--serif);
  letter-spacing: 0.1em;
  color: rgba(253, 251, 246, 0.94);
  text-shadow: 0 1px 14px rgba(11, 14, 31, 0.8);
}

.ch-line.dim {
  margin-top: 8px;
  font-size: 13px;
  color: rgba(245, 242, 235, 0.62);
}

/* ---------- 05 倒计时 ---------- */
.countdown { padding-top: 48px; padding-bottom: 48px; }

.cd-grid {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.cd-cell {
  width: 74px;
  padding: 18px 0 14px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: rgba(232, 205, 154, 0.04);
}

.cd-cell b {
  display: block;
  font: 500 26px/1.2 var(--serif);
  font-variant-numeric: tabular-nums;
  color: var(--gold-soft);
}

.cd-cell span {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: var(--ink-dim);
}

.cd-note {
  margin-top: 26px;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--ink-dim);
}

/* ---------- 07 图集 ---------- */
.gallery { padding-bottom: 64px; }

.gal-tip {
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--ink-dim);
  margin: -18px 0 26px;
}

/* 左右滑动相册：scroll-snap 原生手感 */
.g-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 22px 14px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.g-track::-webkit-scrollbar { display: none; }

.g-item {
  position: relative;
  flex: 0 0 100%;
  scroll-snap-align: center;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(216, 181, 108, 0.18);
  cursor: pointer;
  background: var(--bg-2);
}

.g-item img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity .5s ease;
  pointer-events: none;
}

.g-item img.loaded { opacity: 1; }

.g-counter {
  margin-top: 4px;
  text-align: center;
  font: 400 11px/1.6 var(--serif);
  letter-spacing: 0.3em;
  color: var(--ink-soft);
}

/* ---------- 08 导航 ---------- */
.loc-name {
  font: 500 18px/1.8 var(--serif);
  letter-spacing: 0.12em;
  color: var(--ink);
}

.loc-addr {
  margin: 8px 0 30px;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
}

.btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 34px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  color: var(--gold-soft);
  font-size: 14px;
  letter-spacing: 0.22em;
  text-indent: 0.1em;
  text-decoration: none;
  background: rgba(216, 181, 108, 0.06);
  transition: background .25s ease, transform .25s ease;
}

.btn-nav:active {
  background: rgba(216, 181, 108, 0.18);
  transform: scale(.97);
}

/* ---------- 09 结尾 ---------- */
.ending {
  position: relative;
  min-height: 80svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.ending .ch-inner { padding-bottom: calc(env(safe-area-inset-bottom) + 72px); }

.ending-line {
  font: 400 16px/2.3 var(--serif);
  letter-spacing: 0.12em;
  color: rgba(253, 251, 246, 0.94);
  text-shadow: 0 1px 14px rgba(11, 14, 31, 0.8);
  margin-bottom: 22px;
}

.ending-sign {
  font-size: 13px;
  letter-spacing: 0.24em;
  color: #fdfaf4;
}

.foot {
  padding: 34px 0 46px;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.4em;
  text-indent: 0.4em;
  color: rgba(66, 45, 22, 0.35);
}

/* ---------- 暖色主题收尾覆盖 ---------- */
body { background: #efe5d4; }

.btn-nav {
  color: #8a6420;
  background: rgba(184, 135, 59, 0.08);
}

.cd-cell b { color: var(--gold); }

.music-btn {
  border-color: rgba(184, 135, 59, 0.8);
  background: rgba(251, 246, 238, 0.92);
  color: #8a6420;
  box-shadow: 0 6px 18px rgba(66, 45, 22, 0.12);
}

/* ---------- 全站中文字体 ---------- */
body,
button,
input,
.hero-name,
.hero-date,
.ch-title,
.ch-line,
.ending-sign,
.sec-title,
.invite-line,
.info-label,
.info-value,
.invite-note,
.loc-name,
.loc-addr,
.cd-cell b,
.cd-label,
.gal-title,
.foot {
  font-family: "LXGW WenKai", "霞鹜文楷", "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* ---------- 内嵌字体：霞鹜文楷（仅含页面用到的 454 字） ---------- */
@font-face {
  font-family: "LXGW WenKai";
  src: url("../fonts/LXGWWenKai-Regular-subset.woff2?v=2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "LXGW WenKai";
  src: url("../fonts/LXGWWenKai-Medium-subset.woff2?v=2") format("woff2");
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- 全屏看图 ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(5, 6, 14, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox[hidden] { display: none; }

.lb-img {
  max-width: 100%;
  max-height: 86%;
  object-fit: contain;
  animation: lbIn .25s ease;
}

@keyframes lbIn { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }

.lb-btn {
  position: absolute;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  background: rgba(11, 14, 31, 0.5);
  color: var(--gold-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lb-close { top: calc(env(safe-area-inset-top) + 14px); right: 14px; }
.lb-prev  { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next  { right: 12px; top: 50%; transform: translateY(-50%); }

.lb-count {
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom) + 18px);
  left: 0;
  right: 0;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--ink-dim);
}

/* ---------- 音乐按钮 ---------- */
.music-btn {
  position: fixed;
  z-index: 9;
  top: calc(env(safe-area-inset-top) + 16px);
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: rgba(11, 14, 31, 0.55);
  color: var(--gold-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

@media (min-width: 560px) {
  .music-btn { right: calc(50% - 244px); }
}

.music-btn.playing svg { animation: spin 6s linear infinite; }

.music-btn.paused svg { opacity: .55; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 滚动 reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .9s ease, transform .9s cubic-bezier(.22,.61,.36,1);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- 降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  .bokeh, .scroll-hint span, .music-btn.playing svg, .fade-item, .lb-img { animation: none !important; }
  .fade-item, .reveal { opacity: 1; transform: none; transition: none; }
  .hero-bg { opacity: 1; animation: none; }
}
