/* =========================================
   设计变量与基础重置
   ========================================= */
:root {
  --color-bg: #080c14;
  --color-surface: #111827;
  --color-surface-hover: #1f2937;
  --color-border: #1f2937;
  --color-border-light: #374151;
  --color-text: #f3f4f6;
  --color-text-secondary: #9ca3af;
  --color-text-muted: #6b7280;
  --color-primary: #0ea5e9;
  --color-neon: #38bdf8;
  --color-accent-glow: rgba(56, 189, 248, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --font-base: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  --line-height-tight: 1.5;
  --line-height-base: 1.75;
  --line-height-loose: 1.9;
  --container-max: 1200px;
  --spacing-section: clamp(4rem, 8vw, 8rem);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-base);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: var(--line-height-base);
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color 0.2s ease, background-color 0.2s ease; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; background: none; border: none; }

/* =========================================
  排版与全局组件
  ========================================= */
.container { width: 100%; max-width: var(--container-max); margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 2.5rem); }
.section { padding: var(--spacing-section) 0; }
.section-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: clamp(1rem, 2vw, 1.5rem);
  line-height: var(--line-height-tight);
  color: var(--color-text);
}
.section-desc {
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  color: var(--color-text-secondary);
  max-width: 720px;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
  line-height: var(--line-height-loose);
}
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: clamp(1.5rem, 3vw, 2.5rem); align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: clamp(1.25rem, 2.5vw, 2rem); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.875rem 1.75rem; border-radius: var(--radius-md); font-weight: 500;
  cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  user-select: none; white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--color-neon); outline-offset: 2px; }
.btn-primary { background: linear-gradient(135deg, #0ea5e9, #38bdf8); color: #061224; box-shadow: 0 4px 16px rgba(14, 165, 233, 0.25); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(14, 165, 233, 0.35); }
.btn-secondary { background: var(--color-surface); border: 1px solid var(--color-border-light); color: var(--color-text); }
.btn-secondary:hover { background: var(--color-surface-hover); border-color: var(--color-neon); }

.card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: clamp(1.25rem, 2vw, 1.75rem);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
  position: relative; overflow: hidden;
}
.card:hover { border-color: var(--color-border-light); box-shadow: var(--shadow-card); transform: translateY(-4px); }
.card h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--color-text); }
.card p { font-size: 0.95rem; color: var(--color-text-secondary); line-height: var(--line-height-base); }
.card-meta { margin-top: 1rem; font-size: 0.85rem; color: var(--color-text-muted); display: flex; align-items: center; gap: 0.5rem; }
.card-link { font-size: 0.9rem; color: var(--color-primary); font-weight: 500; margin-top: 0.75rem; display: inline-block; }
.card-link:hover { color: var(--color-neon); text-decoration: underline; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-md); border: 1px solid var(--color-border); }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { padding: 0.875rem 1rem; text-align: left; border-bottom: 1px solid var(--color-border); }
th { background: #0f1623; color: var(--color-text-secondary); font-weight: 500; white-space: nowrap; }
td { color: var(--color-text); }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #111c2e; }

details { margin-bottom: 1rem; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); }
summary { padding: 1rem 1.25rem; cursor: pointer; font-weight: 500; color: var(--color-text); list-style: none; position: relative; padding-left: 2rem; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--color-primary); font-weight: 700; transition: transform 0.2s ease; }
details[open] summary::before { content: "−"; }
details > div { padding: 0 1.25rem 1.25rem; color: var(--color-text-secondary); line-height: var(--line-height-base); }

.related-list li { margin-bottom: 0.75rem; display: flex; align-items: baseline; gap: 0.75rem; }
.related-list a { display: flex; flex-direction: column; gap: 0.25rem; transition: color 0.2s ease; }
.related-list a:hover { color: var(--color-primary); }
.related-title { font-weight: 500; color: var(--color-text); line-height: 1.4; }
.related-desc { font-size: 0.85rem; color: var(--color-text-muted); line-height: 1.5; }

/* =========================================
  页头与页脚
  ========================================= */
.header { position: sticky; top: 0; z-index: 100; background: rgba(8, 12, 20, 0.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--color-border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 0.75rem; font-weight: 600; font-size: 1.1rem; }
.brand img { width: 32px; height: 32px; object-fit: contain; }
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a { font-size: 0.95rem; color: var(--color-text-secondary); padding: 0.25rem 0; position: relative; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--color-text); }
.nav-links a[aria-current="page"]::after { content: ""; position: absolute; bottom: -2px; left: 0; right: 0; height: 2px; background: var(--color-primary); border-radius: 1px; }

.footer { border-top: 1px solid var(--color-border); padding: 3rem 0 2rem; background: #060a12; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; margin-bottom: 2rem; }
.footer-col h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: 1rem; color: var(--color-text); }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col a { font-size: 0.9rem; color: var(--color-text-muted); }
.footer-col a:hover { color: var(--color-primary); }
.footer-bottom { border-top: 1px solid var(--color-border); padding-top: 1.5rem; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; font-size: 0.85rem; color: var(--color-text-muted); }

/* =========================================
  SVG 动效核心样式
  ========================================= */
.svg-canvas { width: 100%; height: auto; overflow: visible; }
.star-dot { fill: var(--color-neon); opacity: 0.4; }
.conn-line { stroke: var(--color-primary); stroke-width: 1.5; fill: none; pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; stroke-linecap: round; }
.animate-draw { animation: drawLine 6s ease-in-out infinite alternate; }
.animate-fade { animation: fadeInOut 8s ease-in-out infinite alternate; }
.animate-pulse { animation: pulseGlow 5s ease-in-out infinite; }

@keyframes drawLine {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes fadeInOut {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.8; }
}
@keyframes pulseGlow {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.05); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .animate-draw, .animate-fade, .animate-pulse { animation: none !important; }
  .svg-canvas * { animation: none !important; }
  html { scroll-behavior: auto; }
}

/* =========================================
  响应式微调
  ========================================= */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .header-inner { height: 56px; }
  .brand span { display: none; }
  .card { padding: 1.25rem; }
  th, td { padding: 0.75rem 0.875rem; font-size: 0.9rem; }
}
