:root {
  --bg: #06162f;
  --bg-2: #0a2451;
  --blue: #2ea8ff;
  --cyan: #69f0ff;
  --gold: #f3c766;
  --gold-soft: #ffe4a3;
  --text: #f7fbff;
  --muted: rgba(226, 238, 255, 0.72);
  --panel: rgba(7, 32, 73, 0.74);
  --line: rgba(139, 207, 255, 0.26);
  --shadow: 0 18px 58px rgba(0, 0, 0, 0.28);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  font-family: "HarmonyOS Sans SC", "Microsoft YaHei", "PingFang SC", "Source Han Sans SC", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 12%, rgba(64, 172, 255, 0.24), transparent 28%),
    radial-gradient(circle at 84% 22%, rgba(239, 191, 83, 0.18), transparent 28%),
    linear-gradient(150deg, #031026 0%, #08285c 55%, #05142f 100%);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

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

button {
  font: inherit;
}

.app-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 100%;
  overflow: hidden;
  isolation: isolate;
}

.app-shell::before,
.app-shell::after {
  position: absolute;
  z-index: -2;
  content: "";
  pointer-events: none;
}

.app-shell::before {
  inset: -12% -28% auto auto;
  width: 74vw;
  height: 74vw;
  border: 1px solid rgba(105, 240, 255, 0.18);
  border-radius: 999px;
  box-shadow: inset 0 0 60px rgba(105, 240, 255, 0.1), 0 0 48px rgba(105, 240, 255, 0.12);
}

.app-shell::after {
  inset: auto auto -18% -22%;
  width: 84vw;
  height: 52vw;
  border-top: 1px solid rgba(243, 199, 102, 0.2);
  border-radius: 50%;
  transform: rotate(-12deg);
}

.particle-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.82;
  pointer-events: none;
}

.topbar {
  position: fixed;
  z-index: 20;
  top: max(12px, calc(var(--safe-top) + 8px));
  left: 50%;
  display: grid;
  width: min(92vw, 420px);
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
}

.icon-button,
.map-floating,
.primary-action,
.qr-modal__close {
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text);
  background: rgba(6, 22, 47, 0.56);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(14px);
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  cursor: pointer;
}

.icon-button:disabled {
  opacity: 0.34;
  cursor: default;
}

.page-counter {
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.84);
  background: rgba(5, 19, 43, 0.38);
  font-size: 12px;
  line-height: 36px;
  text-align: center;
  backdrop-filter: blur(14px);
}

.deck,
.page {
  width: 100%;
  height: 100vh;
  height: 100dvh;
}

.deck {
  position: relative;
}

.page {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(76px + var(--safe-top)) 18px calc(58px + var(--safe-bottom));
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(9vh) scale(0.985);
  transition: transform 640ms cubic-bezier(0.22, 1, 0.36, 1), opacity 500ms ease;
}

.page.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.page.is-before {
  transform: translateY(-9vh) scale(0.985);
}

.page__inner {
  position: relative;
  width: min(100%, 430px);
  max-height: calc(100vh - 134px - var(--safe-top) - var(--safe-bottom));
  max-height: calc(100dvh - 134px - var(--safe-top) - var(--safe-bottom));
  overflow: hidden;
}

.page__inner::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 540ms ease, transform 540ms ease;
}

.is-active .reveal {
  opacity: 1;
  transform: translateY(0);
}

.is-active .reveal:nth-child(2) {
  transition-delay: 80ms;
}

.is-active .reveal:nth-child(3) {
  transition-delay: 150ms;
}

.is-active .reveal:nth-child(4) {
  transition-delay: 220ms;
}

.is-active .reveal:nth-child(5) {
  transition-delay: 290ms;
}

.kicker {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin-bottom: 12px;
  padding: 0 12px;
  border: 1px solid rgba(243, 199, 102, 0.36);
  border-radius: 999px;
  color: var(--gold-soft);
  background: rgba(243, 199, 102, 0.08);
  font-size: 13px;
}

.section-title {
  margin: 0 0 18px;
  color: #fff;
  font-size: clamp(26px, 8vw, 36px);
  line-height: 1.16;
  font-weight: 800;
  text-shadow: 0 10px 36px rgba(46, 168, 255, 0.3);
}

.school-logo {
  width: min(64vw, 280px);
  height: auto;
  object-fit: contain;
  border-radius: 2px;
}

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

.hero-content {
  display: flex;
  min-height: min(560px, 70vh);
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero-orbit {
  position: absolute;
  width: min(88vw, 420px);
  height: min(88vw, 420px);
  border: 1px solid rgba(105, 240, 255, 0.28);
  border-radius: 50%;
  box-shadow: 0 0 42px rgba(105, 240, 255, 0.22), inset 0 0 36px rgba(243, 199, 102, 0.12);
  animation: breathe 3.8s ease-in-out infinite;
}

.hero-badge {
  margin-top: 22px;
  color: var(--gold-soft);
  font-size: 14px;
  letter-spacing: 0.12em;
}

.hero-title {
  margin: 12px 0 10px;
  color: #fff;
  font-size: clamp(38px, 11.5vw, 58px);
  line-height: 1.02;
  font-weight: 900;
  text-shadow: 0 0 24px rgba(105, 240, 255, 0.35), 0 10px 50px rgba(0, 0, 0, 0.38);
}

.hero-subtitle {
  width: min(100%, 360px);
  margin: 0 auto;
  color: rgba(246, 250, 255, 0.92);
  font-size: clamp(16px, 4.5vw, 21px);
  line-height: 1.48;
  font-weight: 700;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}

.hero-meta span,
.tag-cloud span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(105, 240, 255, 0.28);
  border-radius: 999px;
  background: rgba(9, 42, 91, 0.62);
  color: rgba(236, 248, 255, 0.92);
  font-size: 13px;
}

.hero-host {
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 14px;
}

.letter-card,
.agenda-card,
.map-card,
.qr-card,
.info-card,
.group-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(8, 36, 82, 0.9), rgba(7, 20, 48, 0.68));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.letter-card {
  padding: 22px;
  max-height: min(66vh, 560px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.salute,
.letter-text {
  margin: 0 0 14px;
  color: rgba(245, 250, 255, 0.88);
  font-size: 15px;
  line-height: 1.72;
  text-align: justify;
}

.salute {
  color: #fff;
  font-weight: 700;
}

.letter-sign {
  margin: 18px 0 0;
  color: var(--gold-soft);
  font-size: 15px;
  text-align: right;
}

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

.info-card {
  padding: 20px;
}

.info-card span,
.group-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--gold-soft);
  font-size: 13px;
}

.info-card strong {
  display: block;
  color: #fff;
  font-size: clamp(22px, 6.4vw, 30px);
  line-height: 1.2;
}

.info-card em {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  font-style: normal;
  line-height: 1.55;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.agenda-card {
  padding: 18px;
}

.agenda-head {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.agenda-head span {
  width: fit-content;
  padding: 7px 10px;
  border-radius: 4px;
  color: #07142b;
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  font-weight: 800;
}

.agenda-head strong {
  color: #fff;
  font-size: 18px;
  line-height: 1.36;
}

.muted {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.52;
}

.agenda-list {
  display: grid;
  gap: 9px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: agenda;
}

.agenda-list li {
  position: relative;
  min-height: 36px;
  padding: 8px 10px 8px 42px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: rgba(246, 250, 255, 0.9);
  background: rgba(255, 255, 255, 0.045);
  font-size: 14px;
  line-height: 1.42;
  counter-increment: agenda;
}

.agenda-list li::before {
  position: absolute;
  top: 8px;
  left: 10px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  color: #06162f;
  background: var(--cyan);
  content: counter(agenda);
  font-size: 12px;
  font-weight: 800;
}

.agenda-list--timed li {
  display: block;
}

.agenda-list--timed time {
  color: var(--gold-soft);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.42;
}

.agenda-list--timed span {
  color: rgba(247, 251, 255, 0.9);
}

.timeline {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 10px;
  align-items: start;
  padding: 9px 10px;
  border: 1px solid rgba(105, 240, 255, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
}

.timeline-item time {
  color: var(--gold-soft);
  font-size: 13px;
  font-weight: 800;
}

.timeline-item p {
  margin: 0;
  color: rgba(247, 251, 255, 0.9);
  font-size: 14px;
  line-height: 1.42;
}

.group-stack {
  display: grid;
  gap: 10px;
}

.group-card {
  padding: 14px;
}

.group-card h3 {
  margin: 0 0 10px;
  color: var(--gold-soft);
  font-size: 18px;
}

.group-card p {
  margin: 0 0 8px;
  color: rgba(247, 251, 255, 0.88);
  font-size: 13px;
  line-height: 1.44;
}

.group-card span {
  display: inline-block;
  min-width: 46px;
  margin: 0 8px 0 0;
}

.map-card {
  padding: 20px;
  text-align: center;
}

.tencent-map-wrap {
  position: relative;
  width: min(100%, 320px);
  height: 150px;
  margin: 0 auto 18px;
  overflow: hidden;
  border: 1px solid rgba(105, 240, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(105, 240, 255, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(105, 240, 255, 0.08) 1px, transparent 1px),
    linear-gradient(145deg, rgba(11, 59, 119, 0.88), rgba(5, 20, 47, 0.72));
  background-size: 32px 32px, 32px 32px, auto;
}

.tencent-map,
.tencent-map > div {
  width: 100%;
  height: 100%;
}

.map-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  padding: 18px;
  color: rgba(247, 251, 255, 0.9);
  text-align: center;
}

.map-placeholder p {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.map-placeholder small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.map-pin {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 50%;
  color: #06162f;
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  box-shadow: 0 0 32px rgba(243, 199, 102, 0.5);
  transform: translate(-50%, -50%);
  font-size: 28px;
  font-weight: 800;
}

.map-card h3,
.qr-card h3 {
  margin: 0 0 14px;
  color: #fff;
  font-size: clamp(24px, 7vw, 32px);
  line-height: 1.2;
}

.place-list {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  text-align: left;
}

.place-list li {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: rgba(246, 250, 255, 0.9);
  background: rgba(255, 255, 255, 0.045);
  font-size: 14px;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 260px);
  min-height: 48px;
  margin: 0 auto 14px;
  border-color: rgba(243, 199, 102, 0.62);
  border-radius: 6px;
  color: #06162f;
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  font-weight: 800;
  cursor: pointer;
}

.qr-card {
  padding: 18px;
  text-align: center;
}

.qr-title {
  margin: 0 0 12px;
  color: var(--gold-soft);
  font-size: 14px;
  line-height: 1.4;
}

.qr-title--above {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  max-width: 100%;
  padding: 0 10px;
  border: 1px solid rgba(243, 199, 102, 0.32);
  border-radius: 999px;
  background: rgba(243, 199, 102, 0.08);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.qr-button {
  width: min(72vw, 274px);
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
  cursor: pointer;
}

.qr-button img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.qr-card h3 {
  margin-top: 16px;
}

.qr-card p {
  color: rgba(247, 251, 255, 0.88);
  font-size: 14px;
  line-height: 1.48;
}

.thanks {
  display: grid;
  gap: 5px;
  margin-top: 14px;
  text-align: center;
}

.thanks strong {
  color: var(--gold-soft);
  font-size: 17px;
}

.thanks span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.side-dots {
  position: fixed;
  z-index: 18;
  top: 50%;
  right: 10px;
  display: grid;
  gap: 8px;
  transform: translateY(-50%);
}

.side-dots button {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.34);
}

.side-dots button.is-active {
  height: 20px;
  border-radius: 999px;
  background: var(--gold);
}

.map-floating {
  position: fixed;
  z-index: 18;
  right: 14px;
  bottom: calc(20px + var(--safe-bottom));
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--gold-soft);
  cursor: pointer;
}

.map-floating[hidden] {
  display: none;
}

.swipe-hint {
  position: fixed;
  z-index: 17;
  bottom: calc(16px + var(--safe-bottom));
  left: 50%;
  width: 46px;
  height: 28px;
  transform: translateX(-50%);
  pointer-events: none;
}

.swipe-hint span {
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='46' height='28' viewBox='0 0 46 28' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 8 L23 20 L37 8' fill='none' stroke='rgba(255,255,255,0.78)' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: swipeArrow 1.4s ease-in-out infinite;
}

.swipe-hint span::before,
.swipe-hint span::after {
  content: none;
}

.qr-modal {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 7, 20, 0.78);
  backdrop-filter: blur(12px);
}

.qr-modal[aria-hidden="false"] {
  display: flex;
}

.qr-modal__panel {
  width: min(94vw, 390px);
  padding: 14px;
  border-radius: 8px;
  background: #fff;
  color: #0c1830;
  text-align: center;
}

.qr-modal__panel img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.qr-modal__panel p {
  margin: 12px 0 2px;
  color: #29344d;
  font-size: 14px;
}

.qr-modal__close {
  position: absolute;
  top: max(18px, calc(var(--safe-top) + 12px));
  right: 18px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  font-size: 28px;
  cursor: pointer;
}

.modal-open {
  overflow: hidden;
}

.noscript {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  margin: 0;
  place-items: center;
  padding: 24px;
  color: #fff;
  background: #06162f;
  text-align: center;
}

@keyframes breathe {
  0%,
  100% {
    opacity: 0.58;
    transform: scale(0.96);
  }
  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}

@keyframes swipeArrow {
  0% {
    opacity: 0;
    transform: translateY(-8px);
  }
  45% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (max-height: 720px) {
  .page {
    padding-top: calc(64px + var(--safe-top));
    padding-bottom: calc(46px + var(--safe-bottom));
  }

  .page__inner {
    max-height: calc(100vh - 110px - var(--safe-top) - var(--safe-bottom));
    max-height: calc(100dvh - 110px - var(--safe-top) - var(--safe-bottom));
  }

  .section-title {
    margin-bottom: 12px;
    font-size: clamp(24px, 7vw, 31px);
  }

  .letter-card,
  .agenda-card,
  .map-card,
  .qr-card {
    padding: 14px;
  }

  .letter-card {
    max-height: min(66vh, 520px);
  }

  .salute,
  .letter-text {
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.56;
  }

  .hero-title {
    font-size: clamp(34px, 10.4vw, 48px);
  }

  .hero-subtitle {
    font-size: clamp(15px, 4.1vw, 18px);
  }

  .timeline {
    gap: 6px;
  }

  .timeline-item,
  .agenda-list li,
  .group-card p,
  .place-list li {
    font-size: 12.5px;
  }

  .group-stack {
    gap: 6px;
  }

  .group-card {
    padding: 9px 10px;
  }

  .group-card h3 {
    margin-bottom: 6px;
    font-size: 15px;
  }

  .group-card p {
    margin-bottom: 4px;
    line-height: 1.25;
  }

  .page--groups .kicker {
    min-height: 26px;
    margin-bottom: 8px;
    font-size: 12px;
  }

  .page--groups .section-title {
    margin-bottom: 8px;
    font-size: clamp(22px, 6.5vw, 28px);
    line-height: 1.1;
  }

  .tencent-map-wrap {
    height: 112px;
  }

  .map-placeholder p {
    font-size: 12.5px;
  }

  .qr-button {
    width: min(64vw, 226px);
  }
}

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

  .page__inner {
    width: min(680px, 86vw);
  }

  .info-grid,
  .group-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .group-stack {
    align-items: stretch;
  }

  .group-card:last-child {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
