/* 全站共享样式：设计变量、排版、组件、SVG动效 */
:root {
  --bg-paper: #fafaf8;
  --bg-surface: #ffffff;
  --ink: #111111;
  --ink-muted: #4a4a4a;
  --ink-light: #888888;
  --accent: #1a365d;
  --accent-hover: #0f2440;
  --border: #e2e2e2;
  --border-strong: #cccccc;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-soft: 0 2px 12px rgba(0,0,0,0.04);
  --shadow-hover: 0 8px 24px rgba(0,0,0,0.08);
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
  --max-width: 1180px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  background: var(--bg-paper);
  color: var(--ink);
  line-height: 1.65;
  -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; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; letter-spacing: -0.015em; color: var(--ink); }
h1 { font-size: clamp(2.25rem, 5.5vw, 3.5rem); text-wrap: balance; }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin-bottom: var(--space-sm); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); margin-bottom: var(--space-xs); }
p { margin-bottom: var(--space-sm); color: var(--ink-muted); max-width: 68ch; }
ul, ol { padding-left: var(--space-md); margin-bottom: var(--space-sm); color: var(--ink-muted); }
li { margin-bottom: 0.4rem; }

.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 var(--space-sm); }
section { padding: var(--space-lg) 0; }
.section-header { max-width: 720px; margin: 0 auto var(--space-md); text-align: center; }
.text-center { text-align: center; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--space-md); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-md); }
.mb-md { margin-bottom: var(--space-md); }

/* 页头与页脚 */
header { position: sticky; top: 0; background: rgba(250,250,248,0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); z-index: 100; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: var(--space-xs); font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.brand img { width: 32px; height: 32px; object-fit: contain; }
nav ul { display: flex; list-style: none; gap: var(--space-md); }
nav a { font-size: 0.95rem; font-weight: 500; padding: 0.5rem 0; border-bottom: 2px solid transparent; }
nav a:hover, nav a[aria-current="page"] { border-bottom-color: var(--accent); color: var(--accent); }

footer { border-top: 1px solid var(--border); padding: var(--space-lg) 0 var(--space-md); background: var(--bg-surface); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-md); }
.footer-col h4 { font-size: 0.95rem; margin-bottom: var(--space-sm); font-weight: 600; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.6rem; }
.footer-col a { color: var(--ink-muted); font-size: 0.9rem; }
.copyright { margin-top: var(--space-md); padding-top: var(--space-md); border-top: 1px solid var(--border); text-align: center; font-size: 0.82rem; color: var(--ink-light); }

/* 按钮组件 */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.85rem 1.8rem; font-weight: 600; font-size: 1rem; border-radius: var(--radius-md); cursor: pointer; transition: all 0.25s ease; border: 1px solid transparent; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-hover); }
.btn-outline { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: #fff; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.9rem; }

/* 卡片组件 */
.card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-sm); transition: box-shadow 0.25s ease, transform 0.25s ease; }
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.card-meta { font-size: 0.8rem; color: var(--ink-light); margin-bottom: 0.5rem; display: block; }
.card-title { font-weight: 600; margin-bottom: 0.4rem; font-size: 1.05rem; }
.card-desc { font-size: 0.92rem; margin-bottom: 0.8rem; }

/* 表格组件 */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-surface); margin-bottom: var(--space-md); }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { padding: 0.9rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
th { background: #f7f7f7; font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
td small { color: var(--ink-light); font-size: 0.85rem; }

/* FAQ 组件 */
details { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-surface); margin-bottom: 0.8rem; transition: box-shadow 0.2s ease; }
details:hover { box-shadow: var(--shadow-soft); }
summary { padding: 1rem; cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; font-size: 1.1rem; font-weight: 400; transition: transform 0.2s ease; }
details[open] summary::after { transform: rotate(45deg); }
details > div { padding: 0 1rem 1rem; color: var(--ink-muted); line-height: 1.7; }

/* SVG 动效基类 */
@keyframes sweep-glow {
  0% { transform: translateX(-100%) translateY(-100%); opacity: 0; }
  15% { opacity: 0.5; }
  85% { opacity: 0.5; }
  100% { transform: translateX(200%) translateY(200%); opacity: 0; }
}
@keyframes draw-line {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes float-slow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.svg-sweep { animation: sweep-glow 7s linear infinite; }
.svg-draw { animation: draw-line 5s ease-in-out infinite alternate; stroke-dasharray: 1; stroke-dashoffset: 0; }
.svg-float { animation: float-slow 6s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .svg-sweep, .svg-draw, .svg-float { animation: none !important; }
  * { transition: none !important; scroll-behavior: auto !important; }
}
