/* ============================================================
   TDSI 官网 · 基础层
   设计令牌 + 重置 + 排版 + 布局容器
   ============================================================ */

/* ---------- 1. 设计令牌 ---------- */
:root {
  /* 品牌色 */
  --c-brand: #0ea5e9;
  --c-brand-2: #6366f1;
  --c-brand-3: #1e40af;
  --c-grad: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
  --c-grad-rev: linear-gradient(135deg, #6366f1 0%, #0ea5e9 100%);

  /* 语义色 */
  --c-success: #10b981;
  --c-warn: #f59e0b;
  --c-danger: #ef4444;
  --c-info: #0ea5e9;

  /* 中性色（亮） */
  --bg-page: #f8fbff;
  --bg-page-2: #eef2f7;
  --bg-surface: rgba(255, 255, 255, 0.72);
  --bg-surface-solid: #ffffff;
  --bg-subtle: rgba(255, 255, 255, 0.45);
  --text-1: #0f172a;
  --text-2: #475569;
  --text-3: #64748b;
  --line: rgba(226, 232, 240, 0.9);
  --line-strong: rgba(148, 163, 184, 0.45);

  /* 阴影 */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 48px rgba(15, 23, 42, 0.10);
  --shadow-xl: 0 32px 80px rgba(15, 23, 42, 0.14);
  --shadow-inset: 0 1px 0 rgba(255, 255, 255, 0.85) inset;

  /* 圆角 */
  --r-xs: 8px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-2xl: 32px;
  --r-pill: 9999px;

  /* 间距 */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;

  /* 字体 */
  --font-ui: 'Inter', 'Noto Sans SC', -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-heading: 'Inter', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-serif: 'Noto Serif SC', 'Songti SC', 'SimSun', serif;

  /* 动效 */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 0.18s;
  --dur: 0.32s;
  --dur-slow: 0.5s;

  /* 布局 */
  --nav-h: 60px;
  --container: 1200px;

  color-scheme: light;
}

/* ---------- 2. 深色令牌 ---------- */
html.dark-mode {
  --bg-page: #0b1120;
  --bg-page-2: #111c33;
  --bg-surface: rgba(30, 41, 59, 0.68);
  --bg-surface-solid: #1e293b;
  --bg-subtle: rgba(30, 41, 59, 0.4);
  --text-1: #f1f5f9;
  --text-2: #a8b6c9;
  --text-3: #8496ae;
  --line: rgba(148, 163, 184, 0.16);
  --line-strong: rgba(148, 163, 184, 0.28);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 32px 80px rgba(0, 0, 0, 0.6);
  --shadow-inset: 0 1px 0 rgba(255, 255, 255, 0.04) inset;

  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-1);
  background-color: var(--bg-page);
  background-image:
    radial-gradient(circle at 14% 0%, rgba(14, 165, 233, 0.14), transparent 34rem),
    radial-gradient(circle at 86% 6%, rgba(99, 102, 241, 0.12), transparent 32rem),
    linear-gradient(180deg, var(--bg-page) 0%, var(--bg-page-2) 46%, var(--bg-page) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  padding-top: calc(var(--nav-h) + 20px);
  overflow-x: hidden;
  transition: background-color var(--dur-slow) ease, color var(--dur-slow) ease;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html.dark-mode body {
  background-image:
    radial-gradient(circle at 14% 0%, rgba(14, 165, 233, 0.10), transparent 34rem),
    radial-gradient(circle at 86% 6%, rgba(99, 102, 241, 0.09), transparent 32rem),
    linear-gradient(180deg, #0b1120 0%, #111c33 46%, #0b1120 100%);
}

img, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.25; font-weight: 800; }

::selection { background: rgba(14, 165, 233, 0.22); color: var(--text-1); }
html.dark-mode ::selection { background: rgba(99, 102, 241, 0.35); color: #fff; }

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

/* ---------- 4. 滚动条 ---------- */
* { scrollbar-width: thin; scrollbar-color: rgba(148, 163, 184, 0.55) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.5);
  border-radius: var(--r-pill);
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(100, 116, 139, 0.75); background-clip: padding-box; }
html.dark-mode ::-webkit-scrollbar-thumb { background: rgba(71, 85, 105, 0.85); background-clip: padding-box; }

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

.page {
  position: relative;
  z-index: 2;
  padding-bottom: var(--sp-9);
}

.section {
  position: relative;
  padding: var(--sp-8) 0;
}

.section-head {
  text-align: center;
  margin-bottom: var(--sp-7);
}

.section-title {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem);
  font-weight: 900;
  letter-spacing: -0.01em;
  margin-bottom: var(--sp-2);
}

.section-sub {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* 渐变文字 */
.grad-text {
  background: var(--c-grad);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

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

.bg-blob {
  position: absolute;
  width: 26rem;
  height: 26rem;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.35;
  will-change: transform;
  animation: blob-float 16s ease-in-out infinite;
}

.bg-blob--a {
  top: -12%;
  left: -8%;
  background: rgba(14, 165, 233, 0.45);
}

.bg-blob--b {
  top: 18%;
  right: -10%;
  background: rgba(99, 102, 241, 0.4);
  animation-delay: -6s;
}

html.dark-mode .bg-blob { opacity: 0.22; }

.bg-noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAwIDIwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZmlsdGVyIGlkPSJuIj48ZmVUdXJidWxlbmNlIHR5cGU9ImZyYWN0YWxOb2lzZSIgYmFzZUZyZXF1ZW5jeT0iMC43IiBudW1PY3RhdmVzPSIzIiBzdGl0Y2hUaWxlcz0ic3RpdGNoIi8+PC9maWx0ZXI+PHJlY3Qgd2lkdGg9IjIwMCIgaGVpZ2h0PSIyMDAiIGZpbHRlcj0idXJsKCNuKSIgb3BhY2l0eT0iMC43Ii8+PC9zdmc+");
}

@keyframes blob-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(28px, -46px) scale(1.08); }
  66% { transform: translate(-18px, 18px) scale(0.94); }
}

/* ---------- 7. 无障碍 ---------- */
.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: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  padding: 10px 20px;
  background: var(--c-brand);
  color: #fff;
  border-radius: 0 0 var(--r-md) var(--r-md);
  font-weight: 700;
  transition: top var(--dur) var(--ease-out);
}
.skip-link:focus { top: 0; }

/* ---------- 8. 减弱动画 ---------- */
@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;
  }
  .bg-blob { animation: none; }
}
