/* =========================================================
   基础样式：重置、星空背景、排版、无障碍
   ========================================================= */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100%;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 207, 107, 0.12), transparent 26%),
    radial-gradient(circle at 84% 6%, rgba(139, 122, 255, 0.16), transparent 30%),
    radial-gradient(circle at 74% 88%, rgba(79, 195, 247, 0.08), transparent 28%),
    linear-gradient(180deg, #081028 0%, #0a1330 46%, #0d1a3f 100%);
  background-attachment: fixed;
  font-family: var(--font);
  font-size: 14.5px;
  font-weight: var(--w-body);
  line-height: 1.62;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
}

/* 星空颗粒 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 8% 18%, #fff 99%, transparent),
    radial-gradient(1.5px 1.5px at 22% 36%, #ffe9a8 99%, transparent),
    radial-gradient(1px 1px at 33% 12%, #fff 99%, transparent),
    radial-gradient(1.5px 1.5px at 47% 52%, #c9dcff 99%, transparent),
    radial-gradient(1px 1px at 62% 24%, #fff 99%, transparent),
    radial-gradient(1.5px 1.5px at 76% 44%, #fff 99%, transparent),
    radial-gradient(1px 1px at 88% 16%, #ffd98a 99%, transparent),
    radial-gradient(1px 1px at 92% 68%, #fff 99%, transparent),
    radial-gradient(1.5px 1.5px at 17% 76%, #d9c8ff 99%, transparent),
    radial-gradient(1px 1px at 71% 82%, #fff3c4 99%, transparent),
    radial-gradient(1px 1px at 44% 88%, #fff 99%, transparent);
  background-size: 100% 100%;
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}

/* 极淡的星云 */
body::after {
  content: "";
  position: fixed;
  width: 60vw;
  height: 60vw;
  max-width: 760px;
  max-height: 760px;
  top: -28vw;
  right: -18vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 77, 255, 0.16), transparent 66%);
  filter: blur(30px);
  pointer-events: none;
  z-index: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

img,
svg { display: block; max-width: 100%; }

a {
  color: var(--gold);
  text-decoration: none;
}

ul,
ol { list-style: none; }

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: var(--w-heavy);
  line-height: 1.28;
  letter-spacing: -0.01em;
  color: var(--text);
}

h1,
h2 { font-weight: var(--w-black); }

p { color: var(--text-soft); }

strong { color: var(--text); }

em {
  font-style: normal;
  color: var(--gold);
}

::selection {
  background: rgba(255, 215, 112, 0.35);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* 细滚动条 */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 215, 112, 0.28) transparent;
}

*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(255, 215, 112, 0.22);
  border-radius: 99px;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(255, 215, 112, 0.34); }

/* 通用工具 */
.hidden,
[hidden] { display: none !important; }

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--gold);
  font-weight: 600;
}

.muted { color: var(--muted); }
.gold { color: var(--gold); }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }

.noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg-0);
  z-index: 999;
}

/* 尊重系统的减弱动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* 应用内“减弱动效”开关 */
.app-window.reduce-motion *,
.app-window.reduce-motion *::before,
.app-window.reduce-motion *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}
