:root {
  color-scheme: dark;
  --page-bg: #262625;
  --panel-bg: #221f20;
  --accent: #ffe102;
  --accent-soft: #fff36a;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--page-bg);
  color: #fff;
  font-family: "Alibaba PuHuiTi", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

img {
  display: block;
}

.is-loading .landing {
  visibility: hidden;
}

.page-loader {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  background: var(--page-bg);
}

.page-loader img {
  width: min(280px, 72vw);
  height: auto;
}

.page-loader p {
  margin: 0;
  color: var(--accent);
  font-size: 14px;
  letter-spacing: 4px;
}

.loader-ring {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 225, 2, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: loader-spin 800ms linear infinite;
}

.is-ready .page-loader {
  display: none;
}

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

.landing {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--page-bg);
}

.stage {
  display: flex;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  flex-direction: column;
  align-items: center;
  padding: clamp(40px, 10.6667vw, 80px) 16px clamp(40px, 10.6667vw, 80px);
  background: var(--page-bg);
}

.brand {
  display: block;
  width: min(455px, 60.6667vw);
  flex: 0 0 auto;
  aspect-ratio: 455 / 129;
}

.brand img {
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.route-list {
  display: grid;
  width: min(640px, calc(100vw - 32px));
  gap: clamp(20px, 5.3333vw, 40px);
  margin-top: clamp(28px, 7.6vw, 57px);
}

.route-card {
  display: flex;
  width: 100%;
  height: clamp(64px, 11.7333vw, 88px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--accent);
  border-radius: clamp(10px, 1.8667vw, 14px);
  background: var(--panel-bg);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.route-card strong,
.route-card span {
  white-space: nowrap;
}

.route-card strong {
  font-size: clamp(16px, 3.2vw, 24px);
  font-weight: 700;
  line-height: 1.2;
  transition: color 180ms ease;
}

.route-card span {
  margin-top: 1px;
  color: var(--accent);
  font-size: clamp(16px, 3.2vw, 24px);
  font-weight: 400;
  line-height: 1.2;
}

.email-panel {
  position: relative;
  display: grid;
  width: min(640px, calc(100vw - 32px));
  height: clamp(64px, 11.7333vw, 88px);
  flex: 0 0 auto;
  place-items: center;
  margin-top: clamp(24px, 5.3333vw, 40px);
  overflow: hidden;
  border: 1px solid var(--accent);
  border-radius: clamp(10px, 1.8667vw, 14px);
  background: url("./assets/rainbow/email-panel.webp") center / cover no-repeat;
  text-align: center;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.email-panel span {
  position: relative;
  z-index: 1;
  padding: 0 8px;
  font-size: clamp(10px, 2.9333vw, 22px);
  font-weight: 400;
  line-height: 1.36;
  white-space: nowrap;
}

.email-panel b {
  color: var(--accent);
  font-weight: 500;
}

.recovery-links {
  display: grid;
  width: min(688px, calc(100vw - 16px));
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: clamp(32px, 6.4vw, 48px);
}

.recovery-link {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.recovery-link img {
  width: clamp(52px, 10.1333vw, 76px);
  height: clamp(52px, 10.1333vw, 76px);
  object-fit: fill;
  transition: transform 180ms ease, filter 180ms ease;
}

.recovery-link span {
  margin-top: clamp(12px, 2.4vw, 18px);
  font-size: clamp(14px, 3.2vw, 24px);
  font-weight: 400;
  line-height: 1.375;
  white-space: nowrap;
  transition: color 180ms ease, transform 180ms ease;
}

.footer {
  flex: 0 0 auto;
  text-align: center;
}

.footer p,
.bookmark-tip {
  margin: 0;
}

.desktop-footer {
  display: none;
}

.mobile-footer {
  width: min(566px, calc(100vw - 32px));
  margin-top: clamp(40px, 11.2vw, 84px);
  font-size: clamp(15px, 3.2vw, 24px);
  font-weight: 400;
  line-height: 1.375;
  white-space: nowrap;
}

.bookmark-tip {
  margin-top: clamp(48px, 18.9333vw, 142px);
  color: #ffe347;
  font-size: clamp(20px, 4.8vw, 36px);
  font-weight: 400;
  line-height: 1.36;
  white-space: nowrap;
}

.mobile-only {
  display: block;
}

a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

.route-card:active,
.email-panel:active {
  transform: translateY(0) scale(0.99);
}

.recovery-link:active img {
  transform: scale(0.94);
}

@media (hover: hover) and (pointer: fine) {
  .route-card:hover,
  .route-card:focus-visible {
    transform: translateY(-4px);
    border-color: var(--accent-soft);
    background: #2d2a21;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 225, 2, 0.14);
  }

  .route-card:hover strong,
  .route-card:focus-visible strong {
    color: var(--accent);
  }

  .email-panel:hover,
  .email-panel:focus-visible {
    transform: translateY(-4px);
    border-color: var(--accent-soft);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32), 0 0 0 1px rgba(255, 225, 2, 0.14);
    filter: brightness(1.12);
  }

  .recovery-link:hover img,
  .recovery-link:focus-visible img {
    transform: translateY(-5px) scale(1.08);
    filter: brightness(1.18);
  }

  .recovery-link:hover span,
  .recovery-link:focus-visible span {
    color: var(--accent);
    transform: translateY(-2px);
  }
}

@media (min-width: 900px) and (orientation: landscape) {
  .stage {
    padding: clamp(40px, calc(20.2dvh - 115px), 103px) 24px clamp(20px, 4dvh, 43px);
  }

  .brand {
    width: clamp(420px, 31.8229vw, 611px);
    aspect-ratio: 611 / 177;
  }

  .route-list {
    width: min(640px, calc(100vw - 48px));
    gap: clamp(12px, 1.8519dvh, 20px);
    margin-top: clamp(20px, 2.6852dvh, 29px);
  }

  .route-card {
    height: clamp(72px, 8.1481dvh, 88px);
    border-radius: 14px;
  }

  .route-card strong,
  .route-card span {
    font-size: 16px;
    line-height: 20px;
  }

  .route-card span {
    margin-top: 4px;
  }

  .email-panel {
    width: min(640px, calc(100vw - 48px));
    height: clamp(72px, 8.1481dvh, 88px);
    margin-top: clamp(12px, 1.8519dvh, 20px);
    border-radius: 14px;
  }

  .email-panel span {
    font-size: 14px;
    line-height: 19px;
  }

  .mobile-only {
    display: none;
  }

  .recovery-links {
    width: min(652px, calc(100vw - 48px));
    margin-top: clamp(28px, 3.8889dvh, 42px);
  }

  .recovery-link img {
    width: clamp(52px, 5.5556dvh, 60px);
    height: clamp(52px, 5.5556dvh, 60px);
  }

  .recovery-link span {
    margin-top: clamp(14px, 1.6667dvh, 18px);
    font-size: 14px;
    line-height: 19px;
  }

  .desktop-footer {
    display: block;
    width: min(600px, calc(100vw - 48px));
    margin-top: clamp(32px, 4.537dvh, 49px);
    font-size: clamp(14px, 1.4815dvh, 16px);
    line-height: clamp(20px, 2.037dvh, 22px);
    white-space: nowrap;
  }

  .mobile-footer,
  .bookmark-tip {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .route-card,
  .email-panel,
  .recovery-link img,
  .recovery-link span {
    transition-duration: 0.01ms;
  }

  .route-card:hover,
  .route-card:focus-visible,
  .email-panel:hover,
  .email-panel:focus-visible,
  .recovery-link:hover img,
  .recovery-link:focus-visible img,
  .recovery-link:hover span,
  .recovery-link:focus-visible span {
    transform: none;
  }
}
