/* ============================================================
   base.css — 设计变量 / 重置 / 排版 / 背景
   ============================================================ */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", Inter, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --maxw: 1320px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 0.24s;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #06070b;
  --bg-soft: #0a0c13;
  --panel: rgba(255, 255, 255, 0.034);
  --panel-hover: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.15);
  --text: #e9edf6;
  --text-dim: #98a2b6;
  --text-mute: #6a7387;
  --accent: #7c8cff;
  --accent-2: #22d3ee;
  --accent-ink: #06070b;
  --glow: rgba(124, 140, 255, 0.16);
  --shadow: 0 20px 44px -28px rgba(0, 0, 0, 0.95);
  --sk-base: rgba(255, 255, 255, 0.05);
  --sk-shine: rgba(255, 255, 255, 0.11);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6fb;
  --bg-soft: #ffffff;
  --panel: #ffffff;
  --panel-hover: #ffffff;
  --line: rgba(15, 22, 38, 0.09);
  --line-strong: rgba(15, 22, 38, 0.18);
  --text: #0e1320;
  --text-dim: #4c576b;
  --text-mute: #7b879b;
  --accent: #4f5bd5;
  --accent-2: #0891b2;
  --accent-ink: #ffffff;
  --glow: rgba(79, 91, 213, 0.12);
  --shadow: 0 18px 38px -30px rgba(16, 24, 40, 0.5);
  --sk-base: rgba(15, 22, 38, 0.055);
  --sk-shine: rgba(15, 22, 38, 0.1);
}

*,
*::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;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

p { margin: 0; }

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

input {
  font: inherit;
  color: inherit;
}

svg { display: block; }

/* 关键：类选择器里的 display 会覆盖浏览器默认的 [hidden]，必须显式兜底 */
[hidden] { display: none !important; }

::selection {
  background: color-mix(in srgb, var(--accent) 34%, transparent);
  color: var(--text);
}

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

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

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: clamp(16px, 3.4vw, 40px);
}

/* ---------------- 背景装饰 ---------------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
}

.orb-1 {
  width: 46vw;
  height: 46vw;
  top: -18vw;
  left: -10vw;
  background: radial-gradient(circle, rgba(124, 140, 255, 0.42), transparent 68%);
}

.orb-2 {
  width: 40vw;
  height: 40vw;
  bottom: -16vw;
  right: -8vw;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.28), transparent 68%);
}

html[data-theme="light"] .orb { opacity: 0.32; }
html[data-theme="light"] .orb-1 { background: radial-gradient(circle, rgba(124, 140, 255, 0.3), transparent 70%); }
html[data-theme="light"] .orb-2 { background: radial-gradient(circle, rgba(34, 211, 238, 0.22), transparent 70%); }

.grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 0%, transparent 78%);
}

.noscript {
  position: fixed;
  inset: auto 16px 16px 16px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: #b42318;
  color: #fff;
  text-align: center;
  z-index: 99;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  html { scroll-behavior: auto; }
}
