/* ============================================================
 * 婚礼邀请函 · 简约现代（米白留白）
 * 变量集中在 :root，想换主色改这里即可
 * ============================================================ */

:root {
  --paper: #FBF8F3;
  --paper-soft: #F5F0E6;
  --ink: #2A2724;
  --ink-soft: #6E6659;
  --ink-faint: #A39A8B;
  --line: #E3DACA;
  --gold: #A9834F;

  --serif: "Songti SC", "Source Han Serif SC", "Noto Serif SC", "STSong", "SimSun", serif;
  --sans: "PingFang SC", "HarmonyOS Sans SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  --pad: clamp(24px, 7vw, 48px);
  --maxw: 640px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: .02em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 极淡的纸面渐变，避免大面积纯色显得死板 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .55;
  background-image:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, .9), transparent 60%),
    radial-gradient(90% 60% at 50% 100%, rgba(238, 230, 216, .55), transparent 70%);
}

img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }
li { list-style: none; }

/* ---------------- 加载遮罩 ---------------- */
.boot {
  position: fixed;
  inset: 0;
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  transition: opacity .6s var(--ease);
}
.boot span {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
.boot.is-gone { opacity: 0; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- 通用容器 ---------------- */
.page {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.section {
  padding-block: clamp(64px, 15vw, 112px);
  border-top: 1px solid var(--line);
}

.index {
  font-size: 11px;
  letter-spacing: .34em;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin-bottom: 28px;
}

.title {
  font-family: var(--serif);
  font-size: clamp(1.45rem, 5.6vw, 1.85rem);
  letter-spacing: .16em;
  margin-bottom: 36px;
  position: relative;
  padding-bottom: 22px;
}
.title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 34px;
  height: 1px;
  background: var(--gold);
  opacity: .6;
}

/* ---------------- 封面 ---------------- */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  padding: clamp(56px, 12vh, 96px) 0;
}

.hero__frame {
  position: absolute;
  inset: 18px;
  border: 1px solid var(--line);
  pointer-events: none;
}
.hero__frame::before,
.hero__frame::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  background: var(--gold);
  opacity: .55;
  border-radius: 50%;
}
.hero__frame::before { top: -3px; left: -3px; }
.hero__frame::after { bottom: -3px; right: -3px; }

.eyebrow {
  font-size: 10.5px;
  letter-spacing: .42em;
  color: var(--ink-faint);
  text-indent: .42em;
  margin-bottom: clamp(30px, 6vh, 48px);
}

.hero__names {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 3vw, 20px);
  font-family: var(--serif);
  font-size: clamp(2rem, 8.6vw, 3.1rem);
  letter-spacing: .04em;
  line-height: 1.25;
}
.hero__name { white-space: nowrap; }

.hero__amp {
  font-style: italic;
  font-size: .5em;
  color: var(--gold);
  transform: translateY(-.14em);
  letter-spacing: 0;
}

.hero__rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: clamp(26px, 5vh, 40px) 0 clamp(20px, 4vh, 28px);
  width: min(240px, 70%);
}
.hero__rule::before,
.hero__rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}
.hero__rule i {
  width: 4px;
  height: 4px;
  background: var(--gold);
  transform: rotate(45deg);
  opacity: .7;
}

.hero__season {
  font-size: 12px;
  letter-spacing: .26em;
  color: var(--ink-soft);
  text-indent: .26em;
}

.hero__places {
  margin-top: clamp(28px, 6vh, 42px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 5vw, 30px);
}
.hero__places span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  letter-spacing: .14em;
  color: var(--ink-soft);
}
.hero__places b {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 15px;
  letter-spacing: .1em;
  color: var(--ink);
}
.hero__places i {
  display: block;
  width: 1px;
  height: 26px;
  background: var(--line);
}

.scroll-cue {
  position: absolute;
  bottom: clamp(26px, 6vh, 44px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.scroll-cue span {
  font-size: 9px;
  letter-spacing: .34em;
  color: var(--ink-faint);
  text-indent: .34em;
}
.scroll-cue i {
  width: 1px;
  height: 40px;
  background: linear-gradient(var(--line), transparent);
  position: relative;
  overflow: hidden;
}
.scroll-cue i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gold);
  animation: cue 2.4s var(--ease) infinite;
}
@keyframes cue {
  0% { transform: translateY(-100%); opacity: 0; }
  40% { opacity: .8; }
  100% { transform: translateY(100%); opacity: 0; }
}

/* ---------------- 01 致辞（姓名拼接口） ---------------- */
.section--greet { border-top: 0; }

.salutation {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 5.2vw, 1.6rem);
  letter-spacing: .08em;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 .5em;
  margin-bottom: 32px;
  line-height: 1.5;
}
.salutation__lead {
  font-size: .8em;
  color: var(--ink-soft);
  letter-spacing: .22em;
}
.salutation__name {
  position: relative;
  padding-bottom: 4px;
  background-image: linear-gradient(var(--gold), var(--gold));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 1px;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.salutation__name.is-long { font-size: .82em; }
.salutation__name.is-xlong { font-size: .68em; }
.salutation__title { font-size: .78em; color: var(--ink-soft); }

.greet {
  font-size: 15px;
  line-height: 2.15;
  color: var(--ink-soft);
  letter-spacing: .06em;
}

.sign {
  margin-top: 40px;
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: .18em;
  color: var(--ink);
  text-align: right;
}

/* ---------------- 02 两场喜宴 ---------------- */
.events { margin-top: -8px; }

.event {
  padding: 38px 0 34px;
  border-bottom: 1px solid var(--line);
}
.event:first-child { border-top: 1px solid var(--line); }

.event__tag {
  font-size: 11px;
  letter-spacing: .3em;
  color: var(--gold);
  text-indent: .3em;
  margin-bottom: 16px;
}

.event__date {
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-family: var(--serif);
  line-height: 1;
  font-size: clamp(2.5rem, 12vw, 3rem);
  letter-spacing: .02em;
}
.event__date b { font-weight: 400; }
.event__date i {
  font-style: normal;
  font-size: .62em;
  color: var(--gold);
  transform: translateY(-.14em);
}

.event__sub {
  margin-top: 14px;
  font-size: 12.5px;
  letter-spacing: .14em;
  color: var(--ink-soft);
}

.event__meta {
  margin-top: 26px;
  display: grid;
  gap: 16px;
}
.event__meta > div {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 14px;
  align-items: start;
}
.event__meta dt {
  font-size: 10.5px;
  letter-spacing: .2em;
  color: var(--ink-faint);
  padding-top: 5px;
}
.event__meta dd strong {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: .05em;
  line-height: 1.7;
}
.event__meta dd small {
  display: block;
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--ink-soft);
  letter-spacing: .03em;
  line-height: 1.85;
}

.event__cd {
  margin-top: 22px;
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--ink-faint);
}
.event__cd b {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.35em;
  color: var(--gold);
  margin: 0 2px;
}

.event .actions { margin-top: 24px; }

.events-fallback p {
  font-size: 14px;
  line-height: 2;
  color: var(--ink-soft);
  margin-bottom: 18px;
}

/* ---------------- 按钮 ---------------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.btn {
  flex: 1 1 auto;
  min-width: 128px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 20px;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: .16em;
  text-indent: .16em;
  text-decoration: none;
  cursor: pointer;
  border-radius: 2px;
  transition: opacity .25s var(--ease), background-color .25s var(--ease), color .25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn--solid {
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
}
.btn--solid:active { opacity: .82; }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn--ghost:active { background: var(--paper-soft); }
.btn--ghost.is-done { color: var(--gold); border-color: var(--gold); }

/* ---------------- 03 提示 ---------------- */
.tips li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.95;
  color: var(--ink-soft);
  letter-spacing: .04em;
}
.tips li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .85em;
  width: 9px;
  height: 1px;
  background: var(--gold);
  opacity: .7;
}

/* ---------------- 结尾 ---------------- */
.section--end {
  text-align: center;
  padding-bottom: max(64px, env(safe-area-inset-bottom));
}
.end__mark {
  font-family: var(--serif);
  font-size: 2.6rem;
  color: var(--gold);
  opacity: .3;
  line-height: 1;
  margin-bottom: 28px;
}
.end__text {
  font-family: var(--serif);
  font-size: clamp(1.1rem, 4.6vw, 1.3rem);
  letter-spacing: .24em;
  text-indent: .24em;
}
.end__sign {
  margin-top: 22px;
  font-size: 13px;
  letter-spacing: .2em;
  color: var(--ink-soft);
}
.end__date {
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: .28em;
  color: var(--ink-faint);
}

/* ---------------- 微信分享引导 ---------------- */
.share-tip {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(28, 26, 23, .62);
  display: flex;
  justify-content: flex-end;
  padding: 22px;
  animation: fade .3s var(--ease);
}
.share-tip__box {
  background: var(--paper);
  border-radius: 6px;
  padding: 22px 20px 16px;
  max-width: 240px;
  height: fit-content;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
}
.share-tip__box p {
  font-size: 13px;
  line-height: 1.9;
  color: var(--ink-soft);
  letter-spacing: .04em;
}
.share-tip__box b { color: var(--gold); }
.share-tip__box button {
  margin-top: 14px;
  width: 100%;
  height: 38px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 12.5px;
  letter-spacing: .14em;
  color: var(--ink);
  font-family: var(--sans);
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------------- 滚动入场 ---------------- */
.reveal { opacity: 1; transform: none; }

/* 仅在 JS 正常加载时隐藏初始状态，避免脚本失效导致白屏 */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  will-change: opacity, transform;
}
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-cue i::after { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------------- 大屏微调 ---------------- */
@media (min-width: 720px) {
  body { font-size: 17px; }
  .hero__frame { inset: 28px; }
  .greet { font-size: 15.5px; }
  .event { padding: 46px 0 40px; }
}
