/* ================= 设计变量 ================= */
:root {
  --color-bg: #060b14;
  --color-surface: #0f172a;
  --color-surface-alt: #1e293b;
  --color-primary: #38bdf8;
  --color-neon: #22d3ee;
  --color-accent: #0ea5e9;
  --color-text: #f1f5f9;
  --color-text-muted: #94a3b8;
  --color-border: #334155;
  --color-success: #10b981;
  --font-heading: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-body: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2.5rem;
  --spacing-xl: 4rem;
  --container-max: 1120px;
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================= 基础重置与排版 ================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 100%; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color var(--transition-base); }
button, input[type="submit"] { font-family: inherit; cursor: pointer; border: none; background: none; }

/* 流体排版 */
h1 { font-size: clamp(2rem, 5vw + 0.5rem, 3.25rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
h2 { font-size: clamp(1.5rem, 3.5vw + 0.25rem, 2.25rem); font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; margin-bottom: var(--spacing-md); }
h3 { font-size: clamp(1.125rem, 2vw, 1.35rem); font-weight: 600; line-height: 1.4; margin-bottom: var(--spacing-sm); }
p { margin-bottom: var(--spacing-sm); color: var(--color-text-muted); max-width: 65ch; }
.text-center { text-align: center; }
.text-neon { color: var(--color-neon); }

/* ================= 布局容器 ================= */
.container { width: 100%; max-width: var(--container-max); margin: 0 auto; padding: 0 var(--spacing-md); }
.section { padding: var(--spacing-xl) 0; position: relative; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--spacing-lg); align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--spacing-md); }
.flex-center { display: flex; justify-content: center; align-items: center; }

/* ================= 组件：按钮 ================= */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.85rem 1.6rem; border-radius: 999px; font-weight: 500; font-size: 1rem;
  transition: all var(--transition-base); border: 1px solid transparent;
}
.btn-primary {
  background: linear-gradient(135deg, var(--color-accent), var(--color-neon));
  color: #000; box-shadow: 0 0 16px rgba(56, 189, 248, 0.25);
}
.btn-primary:hover, .btn-primary:focus-visible {
  transform: translateY(-2px); box-shadow: 0 6px 24px rgba(56, 189, 248, 0.4);
  filter: brightness(1.1);
}
.btn-outline {
  border-color: var(--color-border); color: var(--color-text);
  background: rgba(255,255,255,0.05);
}
.btn-outline:hover, .btn-outline:focus-visible {
  background: rgba(255,255,255,0.1); border-color: var(--color-primary); color: var(--color-primary);
}

/* ================= 组件：卡片 ================= */
.card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: var(--spacing-md);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.card:hover, .card:focus-within { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(0,0,0,0.4); border-color: var(--color-primary); }

/* ================= 组件：表格 ================= */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--color-border); }
table { width: 100%; border-collapse: collapse; min-width: 500px; }
th, td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--color-border); }
th { background: var(--color-surface-alt); font-weight: 600; color: var(--color-text); }
td { color: var(--color-text-muted); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(56, 189, 248, 0.05); }

/* ================= 组件：FAQ ================= */
.faq-list details {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); margin-bottom: var(--spacing-sm); overflow: hidden;
  transition: border-color var(--transition-base);
}
.faq-list details[open] { border-color: var(--color-primary); }
.faq-list summary {
  padding: 1rem var(--spacing-md); font-weight: 500; cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: ""; width: 8px; height: 8px; border-right: 2px solid var(--color-primary);
  border-bottom: 2px solid var(--color-primary); transform: rotate(45deg); margin-top: -4px;
  transition: transform 0.2s ease;
}
.faq-list details[open] summary::after { transform: rotate(-135deg); }
.faq-list p { padding: 0 var(--spacing-md) 1rem; margin: 0; }

/* ================= 页头页脚 ================= */
.site-header {
  position: sticky; top: 0; z-index: 50; background: rgba(6, 11, 20, 0.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border); padding: var(--spacing-sm) 0;
}
.header-inner { display: flex; justify-content: space-between; align-items: center; }
.brand { display: flex; align-items: center; gap: 0.75rem; font-weight: 700; font-size: 1.1rem; }
.brand img { height: 32px; width: auto; }
nav ul { display: flex; gap: var(--spacing-md); list-style: none; }
nav a { padding: 0.5rem 0; font-weight: 500; color: var(--color-text-muted); position: relative; }
nav a:hover, nav a:focus-visible { color: var(--color-primary); }
nav a[aria-current="page"] { color: var(--color-primary); }
nav a[aria-current="page"]::after {
  content: ""; position: absolute; bottom: 0; left: 0; width: 100%; height: 2px; background: var(--color-neon); border-radius: 2px;
}
.site-footer {
  background: var(--color-surface); border-top: 1px solid var(--color-border);
  padding: var(--spacing-lg) 0 var(--spacing-md); margin-top: var(--spacing-xl);
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--spacing-lg); margin-bottom: var(--spacing-lg); }
.footer-col h4 { margin-bottom: var(--spacing-sm); color: var(--color-text); }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.5rem; }
.footer-col a { color: var(--color-text-muted); font-size: 0.95rem; }
.footer-col a:hover { color: var(--color-primary); }
.copyright { text-align: center; color: var(--color-text-muted); font-size: 0.85rem; border-top: 1px solid var(--color-border); padding-top: var(--spacing-md); }

/* ================= SVG 动效基础 ================= */
.svg-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; overflow: hidden; }
.star-dot { fill: var(--color-primary); }
.line-path { fill: none; stroke: var(--color-neon); stroke-width: 1.5; stroke-linecap: round; }
.path-default { stroke-dasharray: 1; stroke-dashoffset: 0; pathLength: 1; }

/* 星点明灭 */
@keyframes starPulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.1); }
}
.blink-1 { animation: starPulse 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.blink-2 { animation: starPulse 5.2s ease-in-out infinite 1s; transform-box: fill-box; transform-origin: center; }
.blink-3 { animation: starPulse 6.5s ease-in-out infinite 2s; transform-box: fill-box; transform-origin: center; }

/* 描边绘制循环 */
@keyframes drawLoop {
  0%, 15% { stroke-dashoffset: 1; }
  35%, 65% { stroke-dashoffset: 0; }
  85%, 100% { stroke-dashoffset: 1; }
}
.draw-line { animation: drawLoop 12s cubic-bezier(0.4, 0, 0.2, 1) infinite; }

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  .blink-1, .blink-2, .blink-3 { animation: none; opacity: 0.6; transform: none; }
  .draw-line { animation: none; stroke-dashoffset: 0; }
  html { scroll-behavior: auto; }
  * { transition: none !important; animation-duration: 0.001ms !important; }
}

/* ================= 焦点可见性 ================= */
:focus-visible { outline: 2px solid var(--color-neon); outline-offset: 4px; border-radius: 4px; }
.skip-link { position: absolute; top: -100px; left: 0; background: var(--color-primary); color: #000; padding: 0.5rem 1rem; z-index: 100; }
.skip-link:focus { top: 0; }

/* ================= 响应式适配 ================= */
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  nav ul { gap: var(--spacing-sm); font-size: 0.9rem; }
  .btn { width: 100%; justify-content: center; }
  .svg-canvas { opacity: 0.6; }
}
