/* ==========================================================================
   基础样式：重置 / 排版 / 背景氛围 / 通用原子类
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

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

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

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0;
}

p {
  margin: 0;
}

::selection {
  background: color-mix(in srgb, var(--accent) 45%, transparent);
  color: #fff;
}

:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 80%, white 10%);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
  background-clip: content-box;
}

/* ---------- 背景氛围：极光 + 噪点 ---------- */
.aurora {
  position: fixed;
  inset: -20vmax;
  z-index: -2;
  pointer-events: none;
  filter: blur(90px) saturate(150%);
  opacity: 0.55;
}

.aurora span {
  position: absolute;
  display: block;
  width: 46vmax;
  height: 46vmax;
  border-radius: 50%;
  mix-blend-mode: screen;
  animation: aurora-drift 26s var(--ease) infinite alternate;
}

.aurora span:nth-child(1) {
  top: 4%;
  left: 6%;
  background: radial-gradient(circle at 30% 30%, var(--accent), transparent 65%);
}
.aurora span:nth-child(2) {
  top: 26%;
  right: 2%;
  background: radial-gradient(circle at 60% 40%, var(--accent-2), transparent 62%);
  animation-delay: -8s;
  animation-duration: 32s;
}
.aurora span:nth-child(3) {
  bottom: 0;
  left: 32%;
  background: radial-gradient(circle at 50% 50%, var(--accent-3), transparent 65%);
  animation-delay: -16s;
  animation-duration: 38s;
}

[data-theme="light"] .aurora {
  opacity: 0.32;
}

@keyframes aurora-drift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(4vmax, -3vmax, 0) scale(1.12);
  }
  100% {
    transform: translate3d(-3vmax, 4vmax, 0) scale(0.95);
  }
}

.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 布局 ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.section {
  padding: var(--space-7) 0;
}

.stack {
  display: flex;
  flex-direction: column;
}
.stack-2 { gap: var(--space-2); }
.stack-3 { gap: var(--space-3); }
.stack-4 { gap: var(--space-4); }
.stack-5 { gap: var(--space-5); }
.stack-6 { gap: var(--space-6); }

.row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.center { text-align: center; }

.hidden { display: none !important; }
.muted { color: var(--text-3); }
.dim { color: var(--text-2); }
.mono { font-family: var(--font-mono); font-size: 0.86em; }
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 文字 ---------- */
.display {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.6vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.gradient-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section-title {
  font-size: 1.05rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.section-title::before {
  content: "";
  width: 3px;
  height: 16px;
  border-radius: 999px;
  background: var(--grad-brand);
}

/* ---------- 入场动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px) scale(0.995);
  transition: opacity var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-out);
  will-change: opacity, transform;
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }
  .aurora span {
    animation: none;
  }
}

/* ---------- 无障碍 ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 100;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  transition: top var(--dur-2) var(--ease);
}
.skip-link:focus {
  top: 16px;
}
