/* ================= 设计变量 ================= */
:root {
  --color-bg: #f0f4f8;
  --color-surface: #ffffff;
  --color-primary: #1d4ed8;
  --color-primary-hover: #1e40af;
  --color-accent: #00c6ff;
  --color-accent-glow: rgba(0, 198, 255, 0.25);
  --color-text: #0f172a;
  --color-text-muted: #475569;
  --color-border: #cbd5e1;
  --color-border-light: #e2e8f0;
  --font-stack: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --shadow-card: 0 4px 16px rgba(15, 23, 42, 0.06);
  --shadow-elevated: 0 12px 32px rgba(15, 23, 42, 0.12);
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================= 基础重置与排版 ================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  margin: 0;
  font-family: var(--font-stack);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; min-width: 0; }
a { color: var(--color-primary); text-decoration: none; transition: color var(--transition-base); }
a:hover { color: var(--color-primary-hover); }
button, input[type="submit"] { cursor: pointer; font: inherit; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* 流体字号 */
h1 { font-size: clamp(2rem, 1.6rem + 2.5vw, 3.25rem); line-height: 1.2; text-wrap: balance; margin-bottom: var(--space-sm); }
h2 { font-size: clamp(1.5rem, 1.3rem + 1.5vw, 2.25rem); line-height: 1.3; text-wrap: balance; margin-bottom: var(--space-xs); }
h3 { font-size: clamp(1.125rem, 1rem + 0.8vw, 1.35rem); line-height: 1.4; text-wrap: balance; margin-bottom: var(--space-xs); }
p { margin-bottom: var(--space-sm); text-wrap: pretty; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--space-md); }
.section { padding: var(--space-xl) 0; }
.section-alt { background: var(--color-surface); }

/* ================= 页头页脚 ================= */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(240, 244, 248, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border-light);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; min-width: 0; }
.logo-group { display: flex; align-items: center; gap: var(--space-xs); }
.logo-group img { height: 32px; width: auto; }
.logo-text { font-weight: 700; font-size: 1.1rem; color: var(--color-text); }
nav ul { display: flex; list-style: none; gap: var(--space-md); margin: 0; padding: 0; }
nav a { font-weight: 500; color: var(--color-text-muted); padding: 0.25rem 0.5rem; border-radius: var(--radius-sm); transition: color var(--transition-base), background var(--transition-base); }
nav a:hover { color: var(--color-primary); background: rgba(29, 78, 216, 0.05); }
nav a[aria-current="page"], nav a.active { color: var(--color-primary); font-weight: 600; }

.site-footer {
  background: #0f172a;
  color: #cbd5e1;
  padding: var(--space-lg) 0 var(--space-md);
  margin-top: var(--space-xl);
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-lg); }
.footer-col h4 { color: #fff; margin-top: 0; margin-bottom: var(--space-sm); font-size: 1rem; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 0.5rem; }
.footer-col a { color: #94a3b8; font-size: 0.9rem; }
.footer-col a:hover { color: var(--color-accent); }
.footer-bottom { text-align: center; margin-top: var(--space-lg); padding-top: var(--space-md); border-top: 1px solid #1e293b; font-size: 0.85rem; color: #64748b; }

/* ================= 通用组件 ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.5rem; border-radius: var(--radius-pill);
  font-weight: 600; font-size: 1rem; border: none; transition: all var(--transition-base);
  text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--color-primary); color: #fff; box-shadow: 0 4px 12px rgba(29, 78, 216, 0.3); }
.btn-primary:hover { background: var(--color-primary-hover); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(29, 78, 216, 0.4); }
.btn-outline { background: transparent; border: 1.5px solid var(--color-primary); color: var(--color-primary); }
.btn-outline:hover { background: rgba(29, 78, 216, 0.05); }

.card {
  background: var(--color-surface); border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg); padding: var(--space-md);
  box-shadow: var(--shadow-card); transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-elevated); }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); gap: var(--space-lg); }
.grid-2 > * { min-width: 0; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: var(--space-md); }
.grid-3 > * { min-width: 0; }

/* 表格样式 */
.table-wrapper { overflow-x: auto; margin: var(--space-md) 0; border: 1px solid var(--color-border-light); border-radius: var(--radius-md); background: var(--color-surface); }
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--color-border-light); }
th { background: #f8fafc; font-weight: 600; color: var(--color-text); }
tr:last-child td { border-bottom: none; }
td:first-child { font-weight: 500; color: var(--color-text); }

/* FAQ 样式 */
.faq-list { display: flex; flex-direction: column; gap: var(--space-xs); }
details {
  background: var(--color-surface); border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md); padding: 0.75rem 1rem; transition: box-shadow var(--transition-base);
}
details:hover { box-shadow: var(--shadow-card); }
summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between;
  font-weight: 600; color: var(--color-text); user-select: none;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: ""; width: 10px; height: 10px; border-right: 2px solid var(--color-text-muted); border-bottom: 2px solid var(--color-text-muted); transform: rotate(-45deg) translateY(-2px); transition: transform var(--transition-base); flex-shrink: 0; }
details[open] summary::after { transform: rotate(45deg) translateY(-2px); }
details p { margin: 0.5rem 0 0; color: var(--color-text-muted); font-size: 0.95rem; line-height: 1.7; }

/* 链接列表 */
.link-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-sm); }
.link-list li { padding: 0.75rem; background: var(--color-surface); border: 1px solid var(--color-border-light); border-radius: var(--radius-md); transition: border-color var(--transition-base), background var(--transition-base); }
.link-list li:hover { border-color: var(--color-accent); background: rgba(0, 198, 255, 0.03); }
.link-list a { font-weight: 500; display: block; color: var(--color-text); }
.link-list span { display: block; font-size: 0.85rem; color: var(--color-text-muted); margin-top: 0.25rem; }

/* 标签与时间 */
.tag { display: inline-block; padding: 0.25rem 0.6rem; background: rgba(29, 78, 216, 0.08); color: var(--color-primary); border-radius: var(--radius-pill); font-size: 0.8rem; font-weight: 500; }
.time { color: var(--color-text-muted); font-size: 0.85rem; }

/* ================= SVG 动效基础 ================= */
.svg-canvas { width: 100%; height: auto; overflow: hidden; }
.anim-star { opacity: 0.4; }
.anim-star.twinkle { animation: twinkle 6s ease-in-out infinite alternate; }
.anim-line { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; stroke-linecap: round; }
.anim-line.draw { animation: drawLine 8s linear infinite alternate; }
@keyframes twinkle {
  0% { opacity: 0.2; transform: scale(0.9); }
  100% { opacity: 0.7; transform: scale(1.1); }
}
@keyframes drawLine {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
.anim-draw { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; }
.anim-draw.slow { animation: drawLine 12s ease-in-out infinite alternate; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .anim-star.twinkle, .anim-line.draw, .anim-draw.slow { animation: none !important; }
}

/* ================= 响应式微调 ================= */
@media (max-width: 768px) {
  .header-inner { flex-direction: column; height: auto; padding: 0.5rem 0; gap: 0.5rem; }
  nav ul { gap: var(--space-sm); flex-wrap: wrap; justify-content: center; }
  .section { padding: var(--space-lg) 0; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
