/* ============================================================
   king-RG 官网 · 设计系统
   深色为主，蓝色科技感，克制的动效
   ============================================================ */

:root {
  /* 背景层级 */
  --bg-0: #060810;
  --bg-1: #0A0E18;
  --bg-2: #0F1520;
  --bg-3: #141C2B;
  --bg-4: #1A2436;

  /* 边框 */
  --line-1: #161D2B;
  --line-2: #1E2739;
  --line-3: #27334A;

  /* 文字 */
  --text-1: #F0F4FA;
  --text-2: #B4BECD;
  --text-3: #7A879B;
  --text-4: #566175;

  /* 品牌色 */
  --brand-1: #3B82F6;
  --brand-2: #06B6D4;
  --brand-3: #22D3EE;
  --brand-glow: rgba(59, 130, 246, 0.35);

  /* 语义色 */
  --ok: #22C55E;
  --warn: #F59E0B;
  --danger: #EF4444;

  /* 渐变 */
  --grad-brand: linear-gradient(135deg, #3B82F6 0%, #06B6D4 100%);
  --grad-text: linear-gradient(135deg, #60A5FA 0%, #22D3EE 60%, #67E8F9 100%);
  --grad-card: linear-gradient(160deg, rgba(59, 130, 246, 0.08) 0%, transparent 55%);

  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
  --shadow-brand: 0 12px 40px rgba(59, 130, 246, 0.25);

  /* 圆角 */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;

  /* 间距节奏（8px 基准） */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;

  /* 缓动曲线 */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* 容器 */
  --container: 1200px;
  --container-narrow: 820px;

  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas,
    "Liberation Mono", Menlo, monospace;
}

/* ---------- 重置 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-2);
  background: var(--bg-0);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

input {
  font: inherit;
}

::selection {
  background: rgba(59, 130, 246, 0.35);
  color: var(--text-1);
}

/* ---------- 排版 ---------- */
h1,
h2,
h3,
h4 {
  color: var(--text-1);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.8rem);
  letter-spacing: -0.03em;
}

.h3 {
  font-size: clamp(1.15rem, 2vw, 1.4rem);
}

.lead {
  font-size: clamp(1rem, 1.6vw, 1.175rem);
  color: var(--text-3);
  line-height: 1.8;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

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

/* ---------- 可访问性 ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-1);
}

::-webkit-scrollbar-thumb {
  background: var(--line-3);
  border-radius: 5px;
  border: 2px solid var(--bg-1);
}

::-webkit-scrollbar-thumb:hover {
  background: #35435e;
}

/* ---------- 减少动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
