:root {
  --dark: #13102D;
  --paper: #F7F5F3;
  --text: #171523;
  --brand: #2714EB;
  --accent: #89ED6E;
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(23, 21, 35, 0.3);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1120px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* 主题上下文：深色面与浅色纸面取色隔离 */
.theme-dark { background: var(--dark); color: var(--paper); }
.theme-dark a { color: var(--accent); }
.theme-dark .hl { color: var(--accent); }
.theme-dark .badge { color: var(--accent); }
.theme-dark input, .theme-dark textarea, .theme-dark select { background: rgba(247, 245, 243, 0.08); color: var(--paper); border: 1px solid rgba(247, 245, 243, 0.15); }
.theme-paper { background: var(--paper); color: var(--text); }
.theme-paper a { color: var(--brand); }
.theme-paper .hl { color: var(--brand); }
.theme-paper .badge { color: var(--brand); }

/* 布局容器 */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
.section { padding-block: var(--section-y); }
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.flex-row { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: center; }
.flex-col { display: flex; flex-direction: column; gap: var(--gap); }
.split-layout { display: grid; grid-template-columns: 1fr 1fr; gap: var(--content-max / 2); align-items: center; }
@media (max-width: 768px) { .split-layout { grid-template-columns: 1fr; } }

/* 排版层级 */
h1, h2, h3, h4 { line-height: 1.15; font-weight: 500; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); margin-bottom: var(--gap); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: calc(var(--gap) * 1.5); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: var(--gap); }
p { margin-bottom: 1em; max-width: 38em; }
.subtitle { font-size: clamp(1rem, 1.5vw, 1.25rem); opacity: 0.9; margin-bottom: var(--gap); }
.badge { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 0.5em; }

/* 组件：按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  padding: 0 1.5em; height: 48px; border-radius: var(--radius-btn);
  font-weight: 600; font-size: 1rem; cursor: pointer; border: none; transition: transform 0.2s ease, opacity 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); color: #003300; }
.btn-secondary { background: transparent; border: 1.5px solid currentColor; color: inherit; }

/* 对比度修复 */
.container.split-layout .flex-col .flex-row a.btn.btn-primary { color: #003300; }
.theme-paper .container.flex-row .flex-row a { color: var(--text); }

/* 组件：卡片 */
.card {
  background: var(--paper); color: var(--text); border-radius: var(--radius-card);
  border: var(--card-border); box-shadow: var(--card-shadow); padding: var(--gap);
  transition: box-shadow 0.3s ease;
}
.card:hover { box-shadow: 0 14px 32px -12px rgba(23, 21, 35, 0.35); }
.theme-dark .card { background: var(--dark); color: var(--paper); border: 1px solid rgba(247, 245, 243, 0.1); box-shadow: none; }

/* 组件：表格 */
table { width: 100%; border-collapse: collapse; margin: 1em 0; table-layout: fixed; }
th, td { padding: 0.8em 1em; text-align: left; border-bottom: 1px solid rgba(23, 21, 35, 0.1); overflow-wrap: break-word; word-break: break-word; }
th { font-weight: 600; }
.theme-dark th, .theme-dark td { border-bottom-color: rgba(247, 245, 243, 0.1); }

/* 组件：FAQ */
details { margin-bottom: 1em; border-bottom: 1px solid rgba(23, 21, 35, 0.1); padding-bottom: 1em; }
summary { 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.2em; transition: transform 0.2s; }
details[open] summary::after { transform: rotate(45deg); }
.theme-dark details { border-bottom-color: rgba(247, 245, 243, 0.15); }

/* SVG 动效基础 */
.svg-panel { width: 100%; height: auto; max-width: 100%; overflow: visible; }
.orbit-circle { fill: none; stroke-width: 1.5; stroke-linecap: round; }
.anim-breathe { animation: breathe 6s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
.anim-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawLine 8s linear infinite; }
.anim-slide { opacity: 0.8; animation: slideFloat 7s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
.anim-pulse { animation: pulse 4s ease-in-out infinite; }

@keyframes breathe {
  0% { transform: scale(0.95); opacity: 0.6; }
  100% { transform: scale(1.05); opacity: 1; }
}
@keyframes drawLine {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}
@keyframes slideFloat {
  0% { transform: translateY(0px); }
  100% { transform: translateY(-6px); }
}
@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* 系统减少动态效果适配 */
@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-breathe, .anim-draw, .anim-slide, .anim-pulse { animation: none !important; opacity: 1 !important; transform: none !important; stroke-dashoffset: 0 !important; }
}
