/* =========================================================
   Media — base: tokens, reset, typography, utilities
   ========================================================= */

:root {
  --bg: #08070d;
  --bg-soft: #0c0a13;
  --bg-elev: #12101b;
  --text: #f4f1ff;
  --muted: #a9a3bd;
  --dim: #8b84a1;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .17);
  --surface: rgba(255, 255, 255, .045);
  --surface-2: rgba(255, 255, 255, .075);
  --surface-3: rgba(255, 255, 255, .11);
  --accent: #a78bfa;
  --accent-2: #22d3ee;
  --accent-3: #f472b6;
  --accent-soft: rgba(167, 139, 250, .14);
  --grad: linear-gradient(112deg, #e5dbff 0%, #b79bff 28%, #8b5cf6 58%, #22d3ee 100%);
  --grad-soft: linear-gradient(140deg, rgba(139, 92, 246, .26), rgba(34, 211, 238, .1));
  --btn-bg: #f4f1ff;
  --btn-fg: #0b0714;
  --glass: rgba(12, 10, 20, .62);
  --glass-strong: rgba(11, 9, 18, .88);
  --shadow: 0 34px 90px rgba(0, 0, 0, .55);
  --shadow-soft: 0 18px 50px rgba(0, 0, 0, .3);
  --wrap: min(1900px, 96vw);
  --pad: clamp(20px, 4.5vw, 44px);
  --nav-h: 68px;
  --r-lg: 26px;
  --r-md: 18px;
  --r-sm: 12px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", "Cascadia Code", Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

[data-theme="light"] {
  --bg: #f6f3fc;
  --bg-soft: #efebf9;
  --bg-elev: #ffffff;
  --text: #151021;
  --muted: #5e5674;
  --dim: #6f6785;
  --line: rgba(25, 12, 48, .1);
  --line-strong: rgba(25, 12, 48, .2);
  --surface: rgba(255, 255, 255, .62);
  --surface-2: rgba(255, 255, 255, .85);
  --surface-3: rgba(255, 255, 255, .96);
  --accent: #5b3df0;
  --accent-2: #0891b2;
  --accent-3: #db2777;
  --accent-soft: rgba(109, 74, 255, .1);
  --grad: linear-gradient(112deg, #6d4aff 0%, #8b5cf6 38%, #0891b2 100%);
  --grad-soft: linear-gradient(140deg, rgba(139, 92, 246, .14), rgba(34, 211, 238, .08));
  --btn-bg: #171122;
  --btn-fg: #fbf9ff;
  --glass: rgba(255, 255, 255, .7);
  --glass-strong: rgba(255, 255, 255, .92);
  --shadow: 0 34px 80px rgba(40, 25, 80, .16);
  --shadow-soft: 0 18px 50px rgba(40, 25, 80, .1);
}

/* 深色区块：在浅色主题里也保持深色，形成节奏 */
.section-ink,
.site-footer {
  --bg: #08070d;
  --bg-soft: #0c0a13;
  --bg-elev: #12101b;
  --text: #f4f1ff;
  --muted: #a9a3bd;
  --dim: #8b84a1;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .17);
  --surface: rgba(255, 255, 255, .045);
  --surface-2: rgba(255, 255, 255, .075);
  --surface-3: rgba(255, 255, 255, .11);
  --accent: #a78bfa;
  --accent-2: #22d3ee;
  --accent-3: #f472b6;
  --accent-soft: rgba(167, 139, 250, .14);
  --grad: linear-gradient(112deg, #e5dbff 0%, #b79bff 28%, #8b5cf6 58%, #22d3ee 100%);
  --grad-soft: linear-gradient(140deg, rgba(139, 92, 246, .26), rgba(34, 211, 238, .1));
  --glass: rgba(12, 10, 20, .62);
  --glass-strong: rgba(11, 9, 18, .9);
  --shadow: 0 34px 90px rgba(0, 0, 0, .55);
  --shadow-soft: 0 18px 50px rgba(0, 0, 0, .3);
  background: var(--bg);
  color: var(--text);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--bg);
}

html.is-loading { overflow: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color .5s var(--ease), color .5s var(--ease);
}

body.menu-open { overflow: hidden; }

.section,
.marquee,
.site-footer,
.nav-inner {
  transition: background-color .45s var(--ease), border-color .45s var(--ease), color .45s var(--ease);
}

h1, h2, h3, h4, p, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
input, select, textarea { font: inherit; }
::selection { background: rgba(167, 139, 250, .35); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(167, 139, 250, .24);
  border: 3px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(167, 139, 250, .45); background-clip: padding-box; }

/* ---------- utilities ---------- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.section {
  position: relative;
  padding: clamp(82px, 9vw, 136px) 0;
  background: var(--bg);
}

.section-head { margin-bottom: clamp(38px, 5vw, 64px); }
.section-head.center {
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.section-head.split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(34px, 5vw, 80px);
  align-items: center;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.kicker > span:first-child {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .04em;
}
.kicker > span:last-child { line-height: 1.2; }

.h2 {
  font-size: clamp(2.05rem, 4.2vw, 3.6rem);
  font-weight: 750;
  letter-spacing: -.035em;
  line-height: 1.08;
  color: var(--text);
  text-wrap: balance;
}
.h3 {
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.2;
}

.lead {
  margin-top: 18px;
  max-width: 62ch;
  color: var(--muted);
  font-size: clamp(.95rem, 1.15vw, 1.06rem);
  line-height: 1.78;
  text-wrap: pretty;
}
.section-head.center .lead { margin-left: auto; margin-right: auto; }

.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dim);
}

.ic {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}
.ic-fill { fill: currentColor; stroke: none; }

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ---------- reveal ---------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  filter: blur(7px);
  transition:
    opacity .85s var(--ease-out),
    transform .85s var(--ease-out),
    filter .85s var(--ease-out);
  transition-delay: var(--d, 0s);
  will-change: opacity, transform, filter;
}
[data-reveal="left"] { transform: translateX(-34px); }
[data-reveal="right"] { transform: translateX(34px); }
[data-reveal="scale"] { transform: scale(.94); }
[data-reveal="fade"] { transform: none; }
[data-reveal].is-in {
  opacity: 1;
  transform: none;
  filter: none;
}

/* 页面载入完成后才播放 hero 行动画 */
.hero-title .line > span {
  display: block;
  transform: translateY(112%) rotate(2deg);
  transition: transform 1.05s var(--ease-out);
}
html.is-ready .hero-title .line > span { transform: none; }
html.is-ready .hero-title .line:nth-child(2) > span { transition-delay: .08s; }

/* JS 没跑起来时的兜底：1.2s 后自己把标题推上来，1.8s 后把内容露出来 */
html:not(.is-ready) .hero-title .line > span {
  animation: fallbackTitle .9s var(--ease-out) 1.2s forwards;
}
html:not(.is-ready) [data-reveal] {
  animation: fallbackReveal .8s var(--ease-out) 1.8s forwards;
}
@keyframes fallbackTitle { to { transform: none; } }
@keyframes fallbackReveal { to { opacity: 1; transform: none; filter: none; } }

/* ---------- misc ---------- */

.skip-link {
  position: fixed;
  top: -80px;
  left: 20px;
  z-index: 300;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 13px;
  font-weight: 700;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 14px; }

.scroll-progress {
  position: fixed;
  inset: 0 0 auto;
  height: 2px;
  z-index: 120;
  background: transparent;
  pointer-events: none;
}
.scroll-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--grad);
  box-shadow: 0 0 14px rgba(167, 139, 250, .7);
  transition: width .08s linear;
}

.noise {
  position: absolute;
  inset: 0;
  opacity: .035;
  pointer-events: none;
  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='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  mix-blend-mode: overlay;
}

/* ---------- motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee-track { animation: none !important; transform: none !important; }
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; filter: none; }
  .hero-title .line > span { transform: none; }
}

/* 锚点 / scrollIntoView 让出顶部悬浮导航 */
main section[id],
main [id="download"],
main [id="faq"] {
  scroll-margin-top: calc(var(--nav-h) + 18px);
}
