:root {
  --ink: #18233a;
  --ink-soft: #5a6578;
  --paper: #eef1f6;
  --blush: #9a6b6e;
  --seal: #b56868;
  --line: rgba(24, 35, 58, 0.12);
  --shadow: 0 18px 40px rgba(24, 35, 58, 0.1);
  --font-display: "Songti SC", "STSong", "SimSun", "Noto Serif CJK SC", serif;
  --font-body: "Songti SC", "STSong", "SimSun", "Noto Serif CJK SC", serif;
  --font-en: "Palatino Linotype", Palatino, "Book Antiqua", "Songti SC", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(900px 520px at 0% 0%, #d9e4f2 0%, transparent 55%),
    radial-gradient(800px 480px at 100% 8%, #eadfe3 0%, transparent 50%),
    linear-gradient(180deg, #f5f7fb 0%, var(--paper) 45%, #e7ebf2 100%);
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

/* —— 音乐按钮 —— */
.music-btn {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(28, 36, 56, 0.42);
  backdrop-filter: blur(10px);
  color: #f7f4ef;
  border-radius: 999px;
  padding: 0.4rem 0.85rem 0.4rem 0.45rem;
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  cursor: pointer;
}

.music-disc {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(247, 244, 239, 0.85);
  background:
    radial-gradient(circle at center, #f7f4ef 0 3px, transparent 3px),
    conic-gradient(from 0deg, #b07a7a, #f7f4ef, #b07a7a);
  box-shadow: inset 0 0 0 4px rgba(28, 36, 56, 0.25);
}

.music-btn[aria-pressed="true"] .music-disc {
  animation: spinDisc 3.6s linear infinite;
}

.music-btn[aria-pressed="true"] {
  background: rgba(28, 36, 56, 0.72);
}

/* —— 页码点 —— */
.pager-dots {
  position: fixed;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 25;
  display: grid;
  gap: 10px;
}

.pager-dots button {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 1px solid rgba(28, 36, 56, 0.35);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease;
}

.pager-dots button.is-active {
  background: var(--ink);
  border-color: var(--ink);
  transform: scale(1.25);
}

.slide-cover ~ .pager-dots button,
body:has(.slide-cover.is-current) .pager-dots button {
  border-color: rgba(247, 244, 239, 0.55);
}

body:has(#cover.is-current) .pager-dots button {
  border-color: rgba(247, 244, 239, 0.55);
}

body:has(#cover.is-current) .pager-dots button.is-active {
  background: #f7f4ef;
  border-color: #f7f4ef;
}

body:has(#cover.is-current) .swipe-hint {
  color: rgba(247, 244, 239, 0.82);
}

body:has(#cover.is-current) .swipe-hint i {
  border-color: rgba(247, 244, 239, 0.82);
}

.swipe-hint {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 25;
  display: grid;
  justify-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.swipe-hint[hidden] {
  display: none;
}

.swipe-hint i {
  width: 12px;
  height: 12px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  animation: hintBounce 1.4s ease-in-out infinite;
}

.deck {
  position: relative;
  z-index: 1;
  height: 100svh;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.slide {
  position: relative;
  height: 100svh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: grid;
  place-items: center;
  padding:
    max(48px, env(safe-area-inset-top))
    28px
    max(64px, calc(env(safe-area-inset-bottom) + 48px));
}

.slide-inner {
  width: min(420px, 100%);
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 14px;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.slide.is-current .reveal {
  opacity: 1;
  transform: translateY(0);
}

/* —— 封面 —— */
.slide-cover {
  padding: 0;
  color: #f7f4ef;
  overflow: hidden;
}

.cover-photo {
  position: absolute;
  inset: 0;
  background:
    center / cover no-repeat url("./poster.jpg"),
    linear-gradient(160deg, #3a3340, #1c2438);
  transform: scale(1.05);
  animation: coverDrift 18s ease-in-out infinite alternate;
}

.cover-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(18, 22, 32, 0.28) 0%, rgba(18, 22, 32, 0.55) 45%, rgba(18, 22, 32, 0.78) 100%);
}

.cover-inner {
  position: relative;
  z-index: 1;
  width: min(420px, 88%);
  padding:
    max(64px, calc(env(safe-area-inset-top) + 36px))
    8px
    max(72px, calc(env(safe-area-inset-bottom) + 56px));
  gap: 12px;
}

.seal {
  margin: 0 0 4px;
  font-size: 2.4rem;
  line-height: 1;
  color: #f0c4c4;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  animation: sealPulse 4.5s ease-in-out infinite;
}

.eyebrow {
  margin: 0;
  font-family: var(--font-en);
  font-style: italic;
  letter-spacing: 0.28em;
  font-size: 0.88rem;
  color: rgba(247, 244, 239, 0.78);
}

.names-en {
  margin: 4px 0 0;
  font-family: var(--font-en);
  font-style: italic;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: rgba(247, 244, 239, 0.9);
}

.names-en .amp {
  margin: 0 0.35em;
  color: #f0c4c4;
}

.names {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 9vw, 3.2rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.12em;
}

.names-divider {
  margin: 0 0.2em;
  color: #f0c4c4;
  font-weight: 400;
}

.tagline {
  margin: 2px 0 0;
  max-width: 18em;
  color: rgba(247, 244, 239, 0.82);
  line-height: 1.75;
  font-size: 0.95rem;
}

.date-hero {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
  width: min(320px, 100%);
}

.date-hero-spacer {
  min-height: 4.6rem;
  pointer-events: none;
}

.date-block {
  flex: 1;
  display: grid;
  gap: 4px;
  padding: 10px 4px;
  border: 1px solid rgba(247, 244, 239, 0.28);
  background: rgba(255, 255, 255, 0.06);
}

.date-block b {
  font-family: var(--font-en);
  font-size: 1.55rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.04em;
}

.date-block span {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  color: rgba(247, 244, 239, 0.7);
}

.date-sep {
  width: 1px;
  align-self: stretch;
  background: rgba(247, 244, 239, 0.22);
}

.meta {
  display: grid;
  gap: 6px;
  margin-top: 2px;
}

.meta strong {
  letter-spacing: 0.06em;
  font-weight: 500;
}

.meta span,
.slide-cover .meta span {
  color: rgba(247, 244, 239, 0.72);
  font-size: 0.9rem;
}

.bless-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.bless-row span {
  padding: 0.28rem 0.7rem;
  border: 1px solid rgba(247, 244, 239, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: rgba(247, 244, 239, 0.78);
}

/* —— 邀请函 —— */
.letter {
  gap: 0;
  width: min(360px, 100%);
}

.letter-ornament {
  margin: 0 0 14px;
  color: var(--blush);
  font-size: 0.95rem;
  opacity: 0.85;
}

.letter-title {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 500;
  letter-spacing: 0.36em;
  text-indent: 0.36em;
}

.letter-quote {
  margin: 0 0 24px;
  max-width: 18em;
  color: var(--blush);
  font-size: 0.92rem;
  line-height: 1.8;
  letter-spacing: 0.06em;
}

.letter-body {
  display: grid;
  gap: 1.15em;
  width: 100%;
  text-align: justify;
  text-align-last: left;
}

.letter-body p {
  margin: 0;
  color: var(--ink);
  font-size: 1.02rem;
  line-height: 2;
  letter-spacing: 0.08em;
  text-indent: 2em;
}

.letter-sign {
  margin: 32px 0 0;
  width: 100%;
  text-align: right;
  font-family: var(--font-display);
  letter-spacing: 0.28em;
  font-size: 1.05rem;
  color: var(--ink-soft);
}

/* —— 视频 —— */
.section-kicker {
  margin: 0;
  font-family: var(--font-en);
  font-style: italic;
  letter-spacing: 0.22em;
  font-size: 0.82rem;
  color: var(--blush);
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.section-desc {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.7;
}

.slide-video .slide-inner {
  gap: 10px;
  height: 100%;
  max-height: 100%;
  align-content: center;
}

.media-shell {
  overflow: hidden;
  border-radius: 20px;
  background: #121826;
  box-shadow: var(--shadow);
  width: min(340px, 78vw);
  height: min(58svh, calc(min(340px, 78vw) * 16 / 9));
  max-height: 58svh;
  border: 1px solid rgba(28, 36, 56, 0.08);
}

.media-shell video,
.video-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: 0;
  background: #121826;
}

.video-placeholder {
  display: grid;
  place-items: center;
  padding: 24px;
  color: #d7deea;
  text-align: center;
  background: linear-gradient(145deg, #243049, #121826);
  line-height: 1.7;
}

/* —— 信息页 —— */
.info-inner {
  gap: 12px;
  width: min(400px, 100%);
  max-height: 100%;
  overflow: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
  margin-top: 4px;
}

.cd-cell {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.cd-num {
  width: 100%;
  padding: 12px 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #eef2f8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 8px 18px rgba(24, 35, 58, 0.06);
  border: 1px solid var(--line);
}

.cd-num b {
  font-family: var(--font-en);
  font-size: 1.45rem;
  font-weight: 500;
  line-height: 1;
}

.cd-cell span {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
}

.calendar {
  width: 100%;
  margin-top: 4px;
  padding: 14px 14px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
}

.cal-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
}

.cal-head strong {
  font-weight: 600;
}

.cal-head span {
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.cal-week,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}

.cal-week span {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  padding-bottom: 4px;
}

.cal-grid span {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  border-radius: 50%;
  color: var(--ink);
}

.cal-grid .is-muted {
  color: rgba(28, 36, 56, 0.28);
}

.cal-grid .is-wedding {
  background: var(--seal);
  color: #fffdf9;
  font-weight: 600;
  box-shadow: 0 6px 14px rgba(196, 92, 92, 0.28);
}

.info-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
  width: 100%;
  text-align: left;
}

.info-list li {
  display: grid;
  gap: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.info-list span {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
}

.info-list strong {
  font-size: 1rem;
  font-weight: 600;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
  margin-top: 4px;
  width: 100%;
}

.btn {
  appearance: none;
  flex: 1 1 calc(50% - 6px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #f7f4ef;
  padding: 0.72rem 0.8rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
}

.ico-map,
.ico-phone {
  width: 14px;
  height: 14px;
  display: inline-block;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  position: relative;
  flex: 0 0 auto;
}

.ico-map::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.ico-phone {
  border-radius: 3px;
  transform: rotate(-20deg);
}

.footer {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--ink-soft);
  line-height: 1.8;
  font-size: 0.88rem;
  width: 100%;
}

.footer p {
  margin: 0;
}

.footer-thanks {
  margin-top: 4px !important;
  font-family: var(--font-en);
  font-style: italic;
  letter-spacing: 0.28em;
  color: var(--blush);
}

@keyframes hintBounce {
  0%,
  100% {
    transform: rotate(45deg) translate(0, 0);
    opacity: 0.35;
  }
  50% {
    transform: rotate(45deg) translate(3px, 3px);
    opacity: 1;
  }
}

@keyframes coverDrift {
  from {
    transform: scale(1.05) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.12) translate3d(0, -1.5%, 0);
  }
}

@keyframes sealPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.06);
    opacity: 1;
  }
}

@keyframes spinDisc {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 480px) {
  .btn {
    width: auto;
    flex: 1 1 calc(50% - 6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .cover-photo,
  .seal,
  .music-disc,
  .swipe-hint i {
    animation: none !important;
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
