:root {
  --bg0: #1a090a;
  --bg1: #3d1216;
  --red: #c23a3f;
  --red-soft: #e8a0a3;
  --gold: #d4b56a;
  --gold-2: #f0dfb0;
  --cream: #fff7f2;
  --ink: #2a1517;
  --muted: rgba(255, 247, 242, 0.72);
  --card: rgba(255, 250, 247, 0.94);
  --line: rgba(212, 181, 106, 0.45);
  --serif: "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--cream);
  background: var(--bg0);
  overflow-x: hidden;
  cursor: none;
}

@media (hover: none), (pointer: coarse) {
  body { cursor: auto; }
  .cursor-glow { display: none !important; }
}

.cursor-glow {
  position: fixed;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  background: radial-gradient(circle, rgba(240, 223, 176, 0.85), rgba(194, 58, 63, 0.2) 60%, transparent 70%);
  will-change: left, top;
}

.fx-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 40;
}

/* —— Cover —— */
.cover {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 2rem;
  transition: opacity 0.85s ease, visibility 0.85s, transform 0.85s ease;
}
.cover.is-hide {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.04);
  pointer-events: none;
}
.cover-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 55% at 50% 30%, #6b2228 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(212, 181, 106, 0.18), transparent 50%),
    linear-gradient(180deg, #2a0d10 0%, #140607 100%);
}
.cover-bg::after {
  content: "";
  position: absolute;
  inset: 1.25rem;
  border: 1px solid rgba(212, 181, 106, 0.35);
  pointer-events: none;
}
.seal {
  position: relative;
  width: 5.5rem;
  height: 5.5rem;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 2.4rem;
  color: var(--gold-2);
  background: radial-gradient(circle at 35% 30%, #a83238, #5c1519 70%);
  box-shadow:
    0 0 0 6px rgba(212, 181, 106, 0.25),
    0 16px 40px rgba(0, 0, 0, 0.35);
  animation: seal-pulse 2.8s ease-in-out infinite;
}
.cover-en {
  position: relative;
  margin: 0;
  letter-spacing: 0.42em;
  font-size: 0.72rem;
  color: var(--gold);
  text-indent: 0.42em;
}
.cover-names {
  position: relative;
  margin: 0.85rem 0 1.8rem;
  font-family: var(--serif);
  font-size: clamp(2rem, 8vw, 2.8rem);
  font-weight: 400;
  letter-spacing: 0.12em;
}
.cover-names i {
  font-style: normal;
  color: var(--gold);
  margin: 0 0.35em;
  font-size: 0.7em;
}
.cover-btn {
  position: relative;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold-2);
  font: inherit;
  letter-spacing: 0.35em;
  text-indent: 0.35em;
  padding: 0.9rem 2rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s, transform 0.25s;
}
.cover-btn:hover {
  background: rgba(212, 181, 106, 0.12);
  transform: translateY(-2px);
}
.cover-tip {
  position: relative;
  margin: 1rem 0 0;
  font-size: 0.8rem;
  color: rgba(240, 223, 176, 0.55);
  letter-spacing: 0.2em;
  animation: bob 2s ease-in-out infinite;
}

/* Music */
.music-btn {
  position: fixed;
  top: max(1rem, env(safe-area-inset-top));
  right: max(1rem, env(safe-area-inset-right));
  z-index: 60;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgba(212, 181, 106, 0.55);
  border-radius: 50%;
  background: rgba(26, 9, 10, 0.55);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.music-disc {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  border: 2px solid var(--gold);
  position: relative;
}
.music-disc::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--gold);
}
.music-btn.is-on .music-disc { animation: spin 3.2s linear infinite; }

/* —— Fullscreen deck（市面 H5 一屏一页） —— */
.deck {
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
}

.panel {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: grid;
  place-items: center;
  padding: max(4.5rem, env(safe-area-inset-top)) 1.35rem max(2.5rem, env(safe-area-inset-bottom));
  background:
    radial-gradient(ellipse 90% 60% at 50% 0%, rgba(122, 40, 46, 0.55), transparent 55%),
    linear-gradient(180deg, #241012 0%, #140809 100%);
}

.panel-hero {
  background:
    radial-gradient(ellipse 70% 50% at 50% 25%, rgba(194, 58, 63, 0.35), transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(212, 181, 106, 0.12), transparent 50%),
    linear-gradient(180deg, #2c1014 0%, #120708 100%);
}

.panel-inner {
  width: min(100%, 26rem);
  text-align: center;
}
.panel-inner.narrow { width: min(100%, 22rem); }

.label {
  margin: 0 0 0.85rem;
  font-size: 0.72rem;
  letter-spacing: 0.38em;
  color: var(--gold);
  text-indent: 0.38em;
}
.panel h3 {
  margin: 0 0 1rem;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 6vw, 2.2rem);
  font-weight: 400;
  letter-spacing: 0.18em;
}
.xi {
  font-family: var(--serif);
  font-size: clamp(4.8rem, 20vw, 7rem);
  line-height: 1;
  color: transparent;
  background: linear-gradient(180deg, var(--gold-2), var(--gold) 45%, #a8843a);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 10px 30px rgba(212, 181, 106, 0.25));
  animation: soft-breathe 3.5s ease-in-out infinite;
}
.names {
  margin: 0.9rem 0 0.5rem;
  font-family: var(--serif);
  font-size: clamp(2.1rem, 8vw, 2.8rem);
  font-weight: 400;
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 0.55rem;
  flex-wrap: wrap;
  letter-spacing: 0.08em;
}
.names em {
  font-style: normal;
  color: var(--red-soft);
  font-size: 0.7em;
  animation: heartbeat 1.4s ease-in-out infinite;
}
.verse {
  margin: 0;
  color: var(--muted);
  letter-spacing: 0.28em;
  font-size: 0.92rem;
  text-indent: 0.28em;
}
.when {
  margin: 1.4rem 0 0;
  display: inline-block;
  padding: 0.45rem 1.1rem;
  border: 1px solid rgba(212, 181, 106, 0.35);
  border-radius: 999px;
  color: var(--gold-2);
  letter-spacing: 0.12em;
  font-size: 0.95rem;
}
.hint {
  margin-top: 2.8rem;
  color: rgba(255, 247, 242, 0.45);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
}
.hint i {
  display: block;
  width: 16px;
  height: 26px;
  margin: 0 auto 0.45rem;
  border: 1px solid rgba(212, 181, 106, 0.45);
  border-radius: 10px;
  position: relative;
}
.hint i::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 50%;
  width: 2px;
  height: 6px;
  margin-left: -1px;
  border-radius: 1px;
  background: var(--gold);
  animation: scroll-dot 1.6s ease-in-out infinite;
}

.lead {
  margin: 0 0 1.8rem;
  color: var(--muted);
  line-height: 2;
  font-size: 0.98rem;
  letter-spacing: 0.06em;
}
.lead.short { margin-bottom: 1.3rem; }

.meta {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 0.5rem;
  border-top: 1px solid rgba(212, 181, 106, 0.25);
  border-bottom: 1px solid rgba(212, 181, 106, 0.25);
}
.meta span {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  color: var(--gold);
  margin-bottom: 0.35rem;
}
.meta strong {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 400;
}
.meta-heart {
  color: var(--red-soft);
  font-size: 1.1rem;
  opacity: 0.9;
}

.facts {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: left;
}
.facts li {
  padding: 1.1rem 0;
  border-bottom: 1px solid rgba(212, 181, 106, 0.18);
}
.facts li:last-child { border-bottom: 0; }
.facts span {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  color: var(--gold);
  margin-bottom: 0.45rem;
}
.facts p {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--cream);
}
.soft-note {
  margin: 1.4rem 0 0;
  font-size: 0.8rem;
  color: rgba(255, 247, 242, 0.42);
  letter-spacing: 0.04em;
}

.photos {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  grid-template-rows: 1fr 1fr;
  gap: 0.65rem;
  height: min(52vh, 360px);
}
.ph {
  margin: 0;
  border-radius: 0.7rem;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    linear-gradient(145deg, rgba(194, 58, 63, 0.18), rgba(212, 181, 106, 0.12)),
    #2a1416;
  border: 1px solid rgba(212, 181, 106, 0.22);
  color: rgba(240, 223, 176, 0.45);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
}
.ph.tall { grid-row: span 2; }
.ph.wide { grid-column: span 2; height: auto; min-height: 0; }
.photos .ph.wide { display: none; }
.ph img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rsvp {
  display: grid;
  gap: 0.9rem;
  text-align: left;
}
.rsvp label, .rsvp fieldset {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  border: 0;
}
.rsvp span, .rsvp legend {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: var(--gold);
}
.rsvp input, .rsvp textarea {
  width: 100%;
  border: 1px solid rgba(212, 181, 106, 0.28);
  background: rgba(255, 247, 242, 0.06);
  color: var(--cream);
  border-radius: 0.65rem;
  padding: 0.75rem 0.85rem;
  font: inherit;
}
.rsvp input:focus, .rsvp textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 181, 106, 0.15);
}
.rsvp input::placeholder, .rsvp textarea::placeholder {
  color: rgba(255, 247, 242, 0.35);
}
.row2 {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 0.75rem;
  align-items: end;
}
.row2 fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.opt { display: inline-flex !important; }
.opt input { display: none; }
.opt i {
  font-style: normal;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(212, 181, 106, 0.3);
  font-size: 0.88rem;
  color: var(--muted);
  cursor: pointer;
}
.opt input:checked + i {
  background: linear-gradient(135deg, #a83238, #6b1c21);
  border-color: transparent;
  color: var(--cream);
}
.rsvp button {
  margin-top: 0.2rem;
  border: 0;
  border-radius: 999px;
  padding: 0.9rem 1rem;
  background: linear-gradient(135deg, #c23a3f, #7a1f24);
  color: var(--cream);
  font: inherit;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(122, 31, 36, 0.35);
}
.form-tip {
  margin: 0;
  text-align: center;
  color: var(--gold-2);
  font-size: 0.9rem;
}
.form-tip.ok { color: #9dcea8; }

.end {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(212, 181, 106, 0.2);
  color: rgba(255, 247, 242, 0.45);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
}
.end p { margin: 0.25rem 0; }

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}

@keyframes seal-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 6px rgba(212, 181, 106, 0.22), 0 16px 40px rgba(0,0,0,0.35); }
  50% { transform: scale(1.04); box-shadow: 0 0 0 10px rgba(212, 181, 106, 0.12), 0 18px 44px rgba(0,0,0,0.4); }
}
@keyframes soft-breathe {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 10px 30px rgba(212, 181, 106, 0.22)); }
  50% { transform: scale(1.03); filter: drop-shadow(0 14px 36px rgba(212, 181, 106, 0.35)); }
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  20% { transform: scale(1.18); }
  40% { transform: scale(1); }
}
@keyframes bob {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(5px); opacity: 0.9; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes scroll-dot {
  0% { top: 5px; opacity: 1; }
  100% { top: 14px; opacity: 0; }
}

@media (min-width: 768px) {
  .panel-inner { width: min(100%, 28rem); }
  .photos { height: min(56vh, 420px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .deck { scroll-snap-type: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  body { cursor: auto; }
  .cursor-glow, .fx-canvas { display: none !important; }
  .reveal { opacity: 1; transform: none; }
}
