:root {
  color-scheme: dark;
  --panel: rgba(44, 20, 15, 0.56);
  --panel-header: rgba(255, 209, 130, 0.09);
  --panel-line: rgba(255, 217, 145, 0.26);
  --contact: #fff1cc;
  font-family: "KaiTi", "STKaiti", "楷体", "Microsoft YaHei UI", serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: #120807;
}

body {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  color: #fff;
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 198, 91, 0.22), transparent 30rem),
    radial-gradient(circle at 84% 18%, rgba(255, 115, 64, 0.17), transparent 32rem),
    radial-gradient(circle at 52% 88%, rgba(255, 209, 102, 0.12), transparent 30rem),
    linear-gradient(150deg, #2a120b 0%, #1a0b09 42%, #271016 72%, #0e0808 100%);
}

body::before {
  content: "";
  position: fixed;
  z-index: 0;
  top: 34%;
  left: -18%;
  width: 138%;
  height: 34%;
  pointer-events: none;
  opacity: 0.82;
  background:
    url("../assets/xiu-hu-logo.png") right 1rem center / min(42vw, 420px) auto no-repeat,
    url("../assets/xiu-hu-logo.png") left 2rem bottom -4rem / min(36vw, 320px) auto no-repeat,
    radial-gradient(ellipse at 18% 50%, rgba(255, 179, 71, 0.22), transparent 24%),
    radial-gradient(ellipse at 50% 45%, rgba(255, 107, 53, 0.18), transparent 29%),
    radial-gradient(ellipse at 78% 56%, rgba(255, 209, 102, 0.2), transparent 25%);
  background-blend-mode: soft-light, soft-light, normal, normal, normal;
  filter: blur(34px);
  transform: rotate(-8deg);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.44;
  background:
    url("../assets/xiu-hu-logo.png") right -4rem top 3rem / min(36vw, 360px) auto no-repeat,
    url("../assets/xiu-hu-logo.png") left -5rem bottom 2rem / min(32vw, 300px) auto no-repeat,
    repeating-linear-gradient(118deg, transparent 0 48px, rgba(255, 163, 26, 0.045) 48px 56px, transparent 56px 96px),
    radial-gradient(circle at 9% 28%, transparent 0 34px, rgba(255, 204, 113, 0.18) 35px 39px, transparent 40px),
    radial-gradient(circle at 82% 68%, transparent 0 24px, rgba(255, 204, 113, 0.13) 25px 29px, transparent 30px),
    radial-gradient(ellipse at 50% 50%, transparent 32%, rgba(0, 0, 0, 0.24) 100%);
  background-blend-mode: soft-light, soft-light, normal, normal, normal, normal;
}

#starfield {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

button {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

.page {
  position: relative;
  z-index: 2;
  display: grid;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  padding: max(28px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom));
  place-items: center;
}

.portal {
  position: relative;
  width: min(100%, 430px);
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(230, 241, 255, 0.42);
  border-radius: 8px;
  background:
    radial-gradient(circle at 16% 10%, rgba(255, 209, 102, 0.16), transparent 36%),
    linear-gradient(135deg, rgba(255, 217, 145, 0.12), transparent 28%),
    var(--panel);
  box-shadow:
    0 28px 72px rgba(12, 5, 4, 0.42),
    0 0 58px rgba(255, 179, 71, 0.18),
    inset 0 1px 0 rgba(255, 245, 219, 0.22);
  backdrop-filter: blur(22px) saturate(128%);
}

.portal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8%;
  z-index: 0;
  width: 84%;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 232, 191, 0.88), transparent);
}

.portal::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -110px;
  z-index: 0;
  width: 270px;
  height: 270px;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 179, 71, 0.13), transparent 68%);
}

.portal-header {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 72px;
  padding: 13px 20px;
  place-items: center;
  border-bottom: 1px solid var(--panel-line);
  background: var(--panel-header);
  text-align: center;
}

.portal-header h1 {
  margin: 0;
  color: var(--contact);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 16px rgba(255, 179, 71, 0.28);
}

.portal-actions {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
  padding: 24px 44px 30px;
}

.portal-button {
  position: relative;
  width: 100%;
  min-height: 68px;
  padding: 12px 18px;
  color: #fff;
  border: 1px solid rgba(255, 217, 145, 0.26);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.48);
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 219, 0.24),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2),
    0 12px 25px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(13px) saturate(145%);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, filter 160ms ease;
}

.portal-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: 9%;
  width: 82%;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 240, 196, 0.72), transparent);
}

.portal-button:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 229, 180, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 16px 32px rgba(0, 0, 0, 0.27);
  filter: brightness(1.12);
}

.portal-button:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 1px 8px rgba(0, 0, 0, 0.2),
    0 6px 14px rgba(0, 0, 0, 0.2);
}

.portal-button:focus-visible {
  outline: 2px solid rgba(222, 239, 255, 0.88);
  outline-offset: 3px;
}

.route-a {
  background:
    linear-gradient(110deg, rgba(255, 234, 176, 0.6), rgba(255, 168, 75, 0.44)),
    rgba(128, 74, 34, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 12px 28px rgba(255, 179, 71, 0.18);
}

.route-b {
  background:
    linear-gradient(110deg, rgba(255, 190, 119, 0.56), rgba(221, 106, 52, 0.4)),
    rgba(132, 57, 28, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 12px 28px rgba(249, 115, 22, 0.16);
}

.login {
  background:
    linear-gradient(110deg, rgba(255, 215, 145, 0.48), rgba(129, 74, 45, 0.34)),
    rgba(74, 42, 38, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 12px 28px rgba(255, 179, 71, 0.13);
}

.more {
  background:
    linear-gradient(110deg, rgba(255, 241, 204, 0.45), rgba(180, 102, 44, 0.36)),
    rgba(87, 49, 28, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 12px 28px rgba(255, 194, 102, 0.14);
}

.toast {
  position: fixed;
  z-index: 5;
  right: 18px;
  bottom: 18px;
  max-width: min(360px, calc(100% - 36px));
  padding: 11px 15px;
  color: #fff;
  border-radius: 6px;
  background: rgba(45, 45, 45, 0.94);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 520px) {
  .page {
    padding-inline: 12px;
  }

  .portal {
    min-height: auto;
  }

  .portal-header {
    min-height: 64px;
    padding: 11px 14px;
  }

  .portal-header h1 {
    font-size: 16px;
  }

  .portal-actions {
    gap: 14px;
    padding: 20px 24px 24px;
  }

  .portal-button {
    min-height: 62px;
    font-size: 24px;
  }
}

@media (max-width: 360px) {
  .portal-header h1 {
    font-size: 14px;
  }

  .portal-actions {
    padding-inline: 18px;
  }

  .portal-button {
    min-height: 58px;
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
