:root {
  color-scheme: dark;
  --ink: #fff7df;
  --muted: #ead6ba;
  --gold: #f2cf7a;
  --gold-deep: #b77a27;
  --rose: #d98ed3;
  --purple: #72007c;
  --purple-deep: #44004f;
  --panel: rgba(74, 0, 82, 0.54);
  --panel-strong: rgba(54, 0, 64, 0.72);
  --line: rgba(255, 229, 153, 0.38);
  --shadow: rgba(30, 0, 42, 0.36);
  font-family:
    "Microsoft YaHei", "PingFang SC", "Noto Sans SC", "Source Han Sans SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  height: 100%;
  overflow: hidden;
  scroll-behavior: auto;
}

body {
  position: relative;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #5b0067;
  color: var(--ink);
}

body::after {
  position: fixed;
  inset: -10% 0;
  z-index: 8;
  content: "";
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(180deg, transparent 0%, rgba(255, 232, 156, 0.24) 44%, rgba(68, 0, 79, 0.78) 54%, transparent 100%);
  transform: translate3d(0, 28%, 0);
}

body.is-page-turning::after {
  animation: curtainDown 1120ms cubic-bezier(0.2, 0.76, 0.24, 1) both;
}

body.is-page-turning.turn-up::after {
  animation-name: curtainUp;
}

@keyframes curtainDown {
  0% {
    opacity: 0;
    transform: translate3d(0, -42%, 0) scaleY(0.92);
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(0, 42%, 0) scaleY(1.05);
  }
}

@keyframes curtainUp {
  0% {
    opacity: 0;
    transform: translate3d(0, 42%, 0) scaleY(0.92);
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(0, -42%, 0) scaleY(1.05);
  }
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.share-image {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.school-brand {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  z-index: 12;
  width: min(340px, calc(100vw - 92px));
  pointer-events: none;
}

.school-brand img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(28, 0, 36, 0.36));
}

.kv-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(65, 0, 78, 0.2), rgba(55, 0, 68, 0.42)),
    url("assets/kv-bg.jpg") center bottom / cover no-repeat;
  transform: translateZ(0);
  pointer-events: none;
}

.kv-background::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 230, 153, 0.14), transparent 32%),
    radial-gradient(circle at 88% 70%, rgba(217, 142, 211, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(41, 0, 49, 0.12), rgba(41, 0, 49, 0.58));
}

.gold-motion {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100svh;
  opacity: 0.92;
  pointer-events: none;
  transform: translateZ(0);
  will-change: opacity;
}

.flow-band,
.flow-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform-box: fill-box;
  transform-origin: center;
  vector-effect: non-scaling-stroke;
}

.flow-a {
  stroke: url("#flowGold");
  stroke-width: 116;
  opacity: 0.46;
  animation: flowA 14.5s ease-in-out infinite alternate;
}

.flow-b {
  stroke: url("#flowRose");
  stroke-width: 146;
  opacity: 0.36;
  animation: flowB 17.5s ease-in-out infinite alternate;
}

.flow-line {
  stroke: url("#flowGold");
  stroke-width: 1.6;
  opacity: 0.62;
  animation: flowLine 15.5s ease-in-out infinite alternate;
}

.flow-line-b {
  stroke-width: 1.1;
  opacity: 0.46;
  animation-duration: 18.5s;
}

.flow-spark {
  fill: var(--gold);
  opacity: 0.42;
  animation: sparkle 5.3s ease-in-out infinite alternate;
}

body.is-page-turning .flow-band,
body.is-page-turning .flow-line,
body.is-page-turning .flow-spark {
  animation-play-state: paused;
}

@keyframes flowA {
  from {
    transform: translate3d(-12px, 16px, 0) scale(1.04);
  }
  to {
    transform: translate3d(18px, -22px, 0) scale(1.08);
  }
}

@keyframes flowB {
  from {
    transform: translate3d(18px, -8px, 0) scale(1.05);
  }
  to {
    transform: translate3d(-18px, 22px, 0) scale(1.09);
  }
}

@keyframes flowLine {
  from {
    transform: translate3d(-8px, 10px, 0);
  }
  to {
    transform: translate3d(12px, -14px, 0);
  }
}

@keyframes sparkle {
  from {
    opacity: 0.22;
  }
  to {
    opacity: 0.58;
  }
}

.invite-shell {
  position: relative;
  z-index: 2;
  height: 100svh;
  overflow: hidden;
  overscroll-behavior: contain;
  scrollbar-width: none;
  touch-action: none;
}

.invite-shell::-webkit-scrollbar {
  display: none;
}

.invite-shell.is-turning {
  pointer-events: none;
}

.page-track {
  height: 100%;
  transform: translate3d(0, var(--page-offset, 0svh), 0);
  transition: transform 1120ms cubic-bezier(0.2, 0.76, 0.24, 1);
  will-change: transform;
  backface-visibility: hidden;
}

.section {
  position: relative;
  display: grid;
  align-items: center;
  min-height: 100svh;
  height: 100svh;
  padding: max(42px, env(safe-area-inset-top)) 20px max(36px, env(safe-area-inset-bottom));
  isolation: isolate;
  overflow: hidden;
}

.section:not(.hero) {
  align-items: start;
  padding-top: max(68px, env(safe-area-inset-top));
  padding-bottom: max(18px, env(safe-area-inset-bottom));
}

.section::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 239, 184, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(60, 0, 74, 0.08), rgba(39, 0, 48, 0.5));
}

.section::after {
  position: absolute;
  right: 24px;
  bottom: 20px;
  left: 24px;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

.section.page-leave {
  opacity: 0.86;
}

.section.page-enter {
  animation: pageBreathe 1120ms cubic-bezier(0.19, 1, 0.22, 1) both;
}

@keyframes pageBreathe {
  0% {
    opacity: 0.72;
  }
  60% {
    opacity: 0.95;
  }
  100% {
    opacity: 1;
  }
}

.section-inner,
.hero-content {
  position: relative;
  z-index: 2;
  width: min(100%, 560px);
  margin: 0 auto;
}

.hero {
  align-items: center;
}

.hero::before {
  background:
    radial-gradient(circle at 52% 20%, rgba(255, 235, 163, 0.18), transparent 30%),
    linear-gradient(180deg, rgba(70, 0, 82, 0.04), rgba(50, 0, 62, 0.48));
}

.hero-content {
  text-align: center;
}

.hero-meta {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 2px 4px 0;
  text-shadow: 0 2px 18px var(--shadow);
}

.eyebrow,
.kicker {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 0.9rem;
  line-height: 1.5;
}

.kicker {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.08em;
}

h1,
h2,
h3,
p,
dd,
address {
  margin-top: 0;
  overflow-wrap: anywhere;
}

h1,
h2 {
  font-family:
    "STZhongsong", "Songti SC", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  font-weight: 800;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(2.2rem, 12vw, 3.35rem);
  line-height: 1.08;
  background: linear-gradient(180deg, #fff8db 0%, #f2cf7a 46%, #bd7a2b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 16px 34px rgba(38, 0, 45, 0.42);
}

.hero h1 {
  margin-bottom: 0;
  font-family:
    "STXingkai", "华文行楷", "KaiTi", "Kaiti SC", "STKaiti", "STZhongsong", "Songti SC", serif;
  font-size: clamp(4.6rem, 23vw, 7.4rem);
  font-weight: 500;
  line-height: 0.96;
  letter-spacing: 0;
  background: linear-gradient(180deg, #fff8d9 0%, #ffe59e 34%, #d39a3e 68%, #fff2bc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 18px 30px rgba(32, 0, 38, 0.42));
  text-shadow:
    0 1px 0 rgba(255, 249, 221, 0.42),
    0 3px 0 rgba(104, 39, 0, 0.14);
}

.invite-title {
  position: relative;
  display: inline-block;
  padding: 18px 18px 12px;
}

.invite-title::before,
.invite-title::after {
  content: "";
  position: absolute;
  left: 50%;
  width: min(62vw, 260px);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(255, 236, 166, 0.72), transparent);
  box-shadow: 0 0 18px rgba(255, 225, 138, 0.42);
}

.invite-title::before {
  top: 0;
}

.invite-title::after {
  bottom: 0;
}

.hero-slogan {
  margin: 0;
  color: #fff3c9;
  font-family:
    "STZhongsong", "Songti SC", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  font-size: clamp(1.16rem, 5vw, 1.7rem);
  font-weight: 800;
  line-height: 1.35;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.28),
    0 12px 28px rgba(38, 0, 45, 0.4);
}

h2 {
  margin-bottom: 20px;
  color: #fff5d8;
  font-size: clamp(1.74rem, 7vw, 2.25rem);
  line-height: 1.22;
  text-shadow: 0 12px 28px rgba(38, 0, 45, 0.36);
}

h3 {
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 1.04rem;
  line-height: 1.42;
}

.subtitle {
  margin-bottom: 8px;
  color: #fff0cb;
  font-size: 1.08rem;
  line-height: 1.5;
}

.lead,
.section-inner > p,
.closing,
.qr-intro,
.qr-note,
address {
  color: rgba(255, 247, 223, 0.92);
  font-size: 1.02rem;
  line-height: 1.85;
}

.lead {
  margin-bottom: 26px;
  font-size: 1.08rem;
}

.hero-actions,
.location-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 116px;
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid rgba(255, 235, 166, 0.72);
  border-radius: 6px;
  font: inherit;
  font-size: 0.96rem;
  line-height: 1.2;
  cursor: pointer;
  transition:
    transform 720ms ease,
    background-color 720ms ease,
    border-color 720ms ease;
}

.button:active {
  transform: translateY(1px);
}

.button.primary {
  background: linear-gradient(135deg, #ffe59b, #c4832c);
  color: #31003a;
  border-color: rgba(255, 244, 200, 0.8);
}

.button.secondary {
  background: rgba(79, 0, 90, 0.62);
  color: var(--ink);
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 22px;
  width: 28px;
  height: 28px;
  border-right: 1px solid rgba(255, 240, 191, 0.86);
  border-bottom: 1px solid rgba(255, 240, 191, 0.86);
  opacity: 0.82;
  transform: translateX(-50%) rotate(45deg);
  animation: cue 2.2s ease-in-out infinite;
}

.scroll-cue span {
  display: block;
}

@keyframes cue {
  0%,
  100% {
    transform: translate(-50%, 0) rotate(45deg);
  }
  50% {
    transform: translate(-50%, 8px) rotate(45deg);
  }
}

.audio-button {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  z-index: 10;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 235, 166, 0.72);
  border-radius: 50%;
  background: rgba(64, 0, 75, 0.72);
  color: var(--gold);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.audio-button.is-playing {
  animation: spin 4.3s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.letter .section-inner,
.details .section-inner,
.agenda .section-inner,
.activities .section-inner,
.qr-panel,
.location .section-inner {
  padding: 0;
}

.poem-lines {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.poem-lines span {
  display: block;
  padding: 13px 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid rgba(255, 229, 153, 0.18);
  color: #fff1c8;
  font-family:
    "STZhongsong", "Songti SC", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  font-size: 1.22rem;
}

.info-grid {
  display: grid;
  gap: 12px;
  margin: 0;
}

.info-grid div {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.info-grid div:last-child {
  border-bottom: 1px solid var(--line);
}

dt {
  margin-bottom: 7px;
  color: var(--gold);
  font-size: 0.9rem;
}

dd {
  margin: 0;
  color: rgba(255, 247, 223, 0.94);
  font-size: 1.05rem;
  line-height: 1.65;
}

.campus {
  align-content: center;
  gap: 20px;
}

.campus-photo {
  position: relative;
  z-index: 2;
  width: min(100%, 560px);
  height: min(34svh, 280px);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255, 229, 153, 0.34);
  border-radius: 8px;
  background: rgba(48, 0, 60, 0.42);
  box-shadow: 0 18px 38px rgba(32, 0, 38, 0.28);
}

.campus-photo::after {
  position: absolute;
  inset: 0;
  z-index: 3;
  content: "";
  background: linear-gradient(rgba(88, 0, 96, 0.08), rgba(58, 0, 70, 0.34));
  pointer-events: none;
}

.campus-carousel {
  position: absolute;
  inset: 0;
}

.campus-slide {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transform: translate3d(100%, 0, 0) scale(1.02);
  transition:
    opacity 1120ms cubic-bezier(0.2, 0.76, 0.24, 1),
    transform 1120ms cubic-bezier(0.2, 0.76, 0.24, 1);
  will-change: transform, opacity;
}

.campus-slide.is-active {
  z-index: 2;
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.campus-slide.is-prev {
  z-index: 1;
  opacity: 1;
  transform: translate3d(-100%, 0, 0) scale(1.02);
}

.campus .section-inner {
  align-self: start;
}

.timeline {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 229, 153, 0.32);
  border-radius: 7px;
  background: rgba(72, 0, 84, 0.46);
}

.timeline-item.featured {
  border-color: rgba(255, 230, 153, 0.68);
  background: rgba(111, 0, 125, 0.58);
}

.timeline time {
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.9rem;
  line-height: 1.35;
}

.timeline p {
  margin: 0;
  color: rgba(255, 247, 223, 0.84);
  font-size: 0.9rem;
  line-height: 1.55;
}

.activity-list {
  display: grid;
  gap: 16px;
}

.activity-card {
  padding: 18px 16px;
  border: 1px solid rgba(255, 229, 153, 0.36);
  border-radius: 8px;
  background: rgba(72, 0, 84, 0.48);
}

.activity-card span {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--gold);
  font-size: 0.88rem;
}

.activity-card h3 {
  margin-bottom: 12px;
  font-size: 1.24rem;
}

.activity-card p {
  margin-bottom: 7px;
  color: rgba(255, 247, 223, 0.88);
  font-size: 0.98rem;
  line-height: 1.62;
}

.qr-section,
.location {
  text-align: center;
}

.qr-intro {
  margin: 0 auto 22px;
  max-width: 24rem;
}

.qr-frame {
  width: min(72vw, 280px);
  margin: 0 auto;
  padding: 12px;
  border: 1px solid rgba(255, 229, 153, 0.74);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 236, 170, 0.24), rgba(217, 142, 211, 0.18));
}

.qr-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  background: #fff;
}

.qr-note {
  margin: 16px auto 0;
  max-width: 22rem;
  color: var(--muted);
  font-size: 0.9rem;
}

address {
  margin: 0 auto 26px;
  font-style: normal;
}

.closing {
  max-width: 24rem;
  margin: 30px auto 0;
  color: #fff0cb;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 20;
  min-width: 160px;
  padding: 10px 14px;
  border-radius: 6px;
  background: rgba(55, 0, 66, 0.92);
  color: var(--ink);
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
  transition:
    opacity 680ms ease,
    transform 680ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.reveal {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition:
    opacity 1280ms cubic-bezier(0.2, 0.76, 0.24, 1),
    transform 1280ms cubic-bezier(0.2, 0.76, 0.24, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

@media (min-width: 760px) {
  .section {
    padding-inline: 32px;
  }

  .section-inner {
    width: min(100%, 620px);
  }

  .hero-content {
    width: min(100%, 840px);
  }

  .campus {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.78fr);
    gap: 40px;
    align-items: center;
  }

  .campus-photo {
    width: min(100%, 720px);
    height: 58svh;
    margin-right: 0;
  }

  .campus .section-inner {
    margin-left: 0;
  }
}

@media (max-width: 420px) {
  .school-brand {
    top: max(10px, env(safe-area-inset-top));
    left: max(11px, env(safe-area-inset-left));
    width: min(286px, calc(100vw - 80px));
  }

  .section {
    padding-inline: 17px;
  }

  .section:not(.hero) {
    padding-top: max(86px, env(safe-area-inset-top));
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }

  .eyebrow,
  .kicker {
    margin-bottom: 10px;
    font-size: 0.84rem;
  }

  .subtitle {
    margin-bottom: 16px;
    font-size: 1rem;
  }

  .lead,
  .section-inner > p,
  .closing,
  .qr-intro,
  .qr-note,
  address {
    font-size: 0.96rem;
    line-height: 1.72;
  }

  .poem-lines span {
    padding: 11px 13px;
    font-size: 1.08rem;
  }

  .timeline {
    gap: 8px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 10px 12px;
  }

  .timeline time {
    font-size: 0.84rem;
  }

  .timeline h3 {
    margin-bottom: 4px;
    font-size: 0.95rem;
  }

  .timeline p {
    font-size: 0.84rem;
    line-height: 1.46;
  }

  .activity-card {
    padding: 15px 14px;
  }

  .activity-card h3 {
    font-size: 1.12rem;
  }

  .button {
    min-width: 108px;
  }
}

@media (max-height: 720px) {
  .school-brand {
    top: max(8px, env(safe-area-inset-top));
    width: min(246px, calc(100vw - 80px));
  }

  .section {
    padding-top: 34px;
    padding-bottom: 28px;
  }

  .section:not(.hero) {
    padding-top: 74px;
    padding-bottom: 12px;
  }

  h2 {
    margin-bottom: 14px;
  }

  .timeline-item {
    padding-top: 9px;
    padding-bottom: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .page-track {
    transition: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
