:root {
  --color-dark: #141838;
  --color-paper: #F7F5F3;
  --color-body: #151723;
  --color-brand: #142CEB;
  --color-accent: #6EAFED;
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 0;
  --card-shadow: none;
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1280px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 取色上下文覆盖 */
.bg-dark {
  --text-primary: var(--color-paper);
  --text-secondary: rgba(247, 245, 243, 0.75);
  --highlight: var(--color-accent);
  --link-color: var(--color-accent);
  --bg-card: #1a1f45;
  --border-subtle: rgba(247, 245, 243, 0.1);
}
.bg-paper {
  --text-primary: var(--color-body);
  --text-secondary: #4a4d5e;
  --highlight: var(--color-brand);
  --link-color: var(--color-brand);
  --bg-card: #eae8e6;
  --border-subtle: rgba(0, 0, 0, 0.08);
}
.card-light-on-dark {
  --text-primary: var(--color-body);
  --text-secondary: #4a4d5e;
  --highlight: var(--color-brand);
  --link-color: var(--color-brand);
  --bg-card: var(--color-paper);
  --border-subtle: rgba(0, 0, 0, 0.08);
}

*, *::before, *::after { box-sizing: border-box; }
body {
  font-family: var(--font-sans);
  background: var(--color-paper);
  color: var(--color-body);
  line-height: 1.55;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: var(--gap); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: var(--gap); }
p { margin: 0 0 var(--gap); max-width: 38em; }
a { color: var(--link-color); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.85; }
img, svg { display: block; max-width: 100%; height: auto; }
svg { width: 100%; height: auto; }

.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding: var(--section-y) 0; position: relative; }
section:not(:last-child)::after { content: ""; display: block; height: 1px; background: var(--border-subtle); margin-top: var(--section-y); }

/* 页头与导航 */
header { position: sticky; top: 0; z-index: 100; background: var(--color-paper); border-bottom: 1px solid var(--border-subtle); padding: 1rem 0; transition: box-shadow 0.3s; }
header.scrolled { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.nav-inner { display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 0.75rem; font-weight: 700; font-size: 1.1rem; color: var(--text-primary); }
.logo img { width: 32px; height: 32px; object-fit: contain; }
nav ul { list-style: none; display: flex; gap: 1.5rem; margin: 0; padding: 0; }
nav a { color: var(--text-primary); font-weight: 500; padding: 0.5rem 0; position: relative; }
nav a[aria-current="page"], nav a:hover { color: var(--highlight); }
nav a[aria-current="page"]::after { content: ""; position: absolute; bottom: 0; left: 0; width: 100%; height: 2px; background: var(--highlight); }

/* 按钮 */
.btn { display: inline-flex; align-items: center; gap: 0.75rem; height: 52px; padding: 0 1.5rem; font-size: 1rem; font-weight: 600; border-radius: var(--radius-btn); cursor: pointer; transition: transform 0.2s, opacity 0.2s, background-color 0.2s; border: none; white-space: nowrap; }
.btn:focus-visible { outline: 2px solid var(--highlight); outline-offset: 2px; }
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-primary:hover { transform: translateY(-1px); opacity: 0.95; }
.btn-secondary { background: transparent; border: 1px solid currentColor; color: inherit; }
.bg-dark .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.btn svg { width: 20px; height: 20px; }

/* 卡片与面板 */
.card { background: var(--bg-card); border: var(--card-border); box-shadow: var(--card-shadow); border-radius: var(--radius-card); padding: var(--gap); transition: transform 0.2s; }
.card:hover { transform: translateY(-2px); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }

/* 表格 */
table { width: 100%; border-collapse: collapse; margin: var(--gap) 0; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border-subtle); }
th { font-weight: 600; }

/* FAQ */
details { margin-bottom: var(--gap); border-radius: var(--radius-card); background: var(--bg-card); padding: 1rem; }
summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 0.5rem; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; display: inline-block; width: 1em; text-align: center; color: var(--highlight); }
details[open] summary::before { content: "-"; }
details p { margin-top: var(--gap); color: var(--text-secondary); }

/* 眉标与高亮 */
.tag { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; padding: 0.25rem 0.6rem; border-radius: 4px; margin-bottom: 0.75rem; }
.tag-paper { background: rgba(20, 44, 235, 0.1); color: var(--color-brand); }
.tag-dark { background: rgba(110, 175, 237, 0.15); color: var(--color-accent); }
.hl { color: var(--highlight); }

/* 布局辅助 */
.flex-col { display: flex; flex-direction: column; gap: var(--gap); }
.grid-layout { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: center; }
@media (max-width: 768px) { .grid-layout { grid-template-columns: 1fr; } }
.steps-h { display: flex; gap: var(--gap); overflow-x: auto; padding-bottom: 0.5rem; }
.step-item { flex: 1 1 200px; min-width: 0; }
.step-num { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; background: var(--color-accent); color: var(--color-dark); font-weight: 700; border-radius: 6px; margin-bottom: 0.5rem; }

/* 页脚 */
footer { background: var(--color-dark); color: var(--color-paper); padding: 2rem 0; margin-top: var(--section-y); }
footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem; }
footer nav ul { flex-direction: column; gap: 0.75rem; }
footer a { color: var(--color-paper); opacity: 0.8; }
footer a:hover { opacity: 1; }

/* SVG 动效 */
@keyframes drawPath { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
@keyframes slideIn { from { transform: translateX(-12px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes gridLight { 0%, 100% { fill: rgba(110, 175, 237, 0.15); } 50% { fill: var(--color-accent); } }

.anim-draw { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawPath 6s ease-in-out infinite alternate; }
.anim-float { animation: float 6s ease-in-out infinite; }
.anim-pulse { animation: pulse 4s ease-in-out infinite; }
.anim-slide { animation: slideIn 5s ease-out infinite alternate; }
.anim-grid-node { animation: gridLight 5s ease-in-out infinite; }
.anim-grid-node:nth-child(odd) { animation-delay: 0.8s; }
.anim-grid-node:nth-child(3n) { animation-delay: 1.6s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .anim-draw, .anim-float, .anim-pulse, .anim-slide, .anim-grid-node { animation: none !important; }
}

/* 兜底：裁掉横向溢出 */
div.grid-layout,
div.container {
  overflow-x: clip;
}
