:root {
  --color-bg-dark: #141838;
  --color-bg-paper: #F7F5F3;
  --color-text-body: #151723;
  --color-brand: #142CEB;
  --color-accent: #6EAFED;
  --radius-card: 8px;
  --radius-btn: 6px;
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1280px;
  --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --text-color: var(--color-text-body);
  --highlight-color: var(--color-brand);
  --bg-surface: var(--color-bg-paper);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-color);
  background: var(--bg-surface);
  -webkit-font-smoothing: antialiased;
}

/* 主题层覆盖 */
.bg-dark { --text-color: var(--color-bg-paper); --highlight-color: var(--color-accent); --bg-surface: var(--color-bg-dark); }
.bg-paper { --text-color: var(--color-text-body); --highlight-color: var(--color-brand); --bg-surface: var(--color-bg-paper); }
.card-light { --text-color: var(--color-text-body); --highlight-color: var(--color-brand); --bg-surface: #EBE9E6; }

/* 排版 */
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); font-weight: 500; line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 500; line-height: 1.25; margin-bottom: var(--gap); }
h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.4; margin-top: var(--gap); margin-bottom: 0.5rem; }
p { max-width: 38em; margin-bottom: var(--gap); }
.small-text { font-size: 0.875rem; opacity: 0.85; }
.highlight { color: var(--highlight-color); }

/* 布局容器 */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
.section { padding: var(--section-y) 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.flex-row { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: center; }

/* 组件：按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  height: 48px; padding: 0 1.25rem; border-radius: var(--radius-btn);
  font-size: 1rem; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}
.btn-primary { background: var(--color-accent); color: var(--color-bg-dark); border: none; }
.btn-primary:hover { transform: translateY(-1px); filter: brightness(0.95); }
.btn-secondary { background: transparent; border: 1px solid var(--text-color); color: var(--text-color); }
.btn-secondary:hover { background: rgba(128,128,128,0.08); }
.btn:focus-visible { outline: 2px solid var(--highlight-color); outline-offset: 2px; }
.btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }

/* 组件：卡片 */
.card {
  background: var(--bg-surface); border-radius: var(--radius-card);
  padding: var(--gap); border: var(--card-border, 1px solid rgba(128,128,128,0.15));
  box-shadow: var(--card-shadow, none);
}
.card-light { background: #EBE9E6; }
.bg-dark .card-light { background: #F7F5F3; }

/* 组件：表格 */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 500px; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid rgba(128,128,128,0.2); }
th { font-weight: 600; white-space: nowrap; }
td { vertical-align: top; }

/* 组件：FAQ */
.faq-item { border-bottom: 1px solid rgba(128,128,128,0.2); padding: 1rem 0; }
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: 1.2em; height: 1.2em; line-height: 1.2em; text-align: center; border-radius: 4px; background: rgba(128,128,128,0.1); font-size: 0.9rem; }
details[open] summary::before { content: "-"; }
details p { margin-top: 0.75rem; color: var(--text-color); opacity: 0.9; }

/* 组件：眉标 */
.badge {
  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;
  background: rgba(var(--highlight-color), 0.1); color: var(--highlight-color);
}
.bg-dark .badge { background: rgba(var(--highlight-color), 0.15); }

/* 页头页脚 */
.header { position: sticky; top: 0; z-index: 100; background: var(--bg-surface); border-bottom: 1px solid rgba(128,128,128,0.1); padding: 0.75rem 0; }
.nav-list { list-style: none; display: flex; gap: 1.5rem; }
.nav-list a { text-decoration: none; color: var(--text-color); font-weight: 500; opacity: 0.8; transition: opacity 0.2s; }
.nav-list a:hover, .nav-list a[aria-current="page"] { opacity: 1; color: var(--highlight-color); }
.footer { border-top: 1px solid rgba(128,128,128,0.15); padding: 2rem 0; margin-top: var(--section-y); }
.footer-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.footer-links a { color: var(--text-color); text-decoration: none; opacity: 0.7; }
.footer-links a:hover { opacity: 1; color: var(--highlight-color); }

/* SVG 动效基础 */
.svg-container { width: 100%; height: auto; max-width: 100%; overflow: hidden; }
.svg-container svg { width: 100%; height: auto; display: block; }
.draw-line {
  pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0;
  animation: drawPath 6s ease-in-out infinite alternate;
}
.float-element {
  animation: floatY 5s ease-in-out infinite alternate;
  transform-box: fill-box; transform-origin: center;
}
.breathe-opacity {
  animation: breathe 4s ease-in-out infinite alternate;
}
@keyframes drawPath {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes floatY {
  0% { transform: translateY(0); }
  100% { transform: translateY(-6px); }
}
@keyframes breathe {
  0% { opacity: 0.75; }
  100% { 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;
  }
  .draw-line, .float-element, .breathe-opacity { animation: none !important; }
}

/* 响应式适配 */
@media (max-width: 768px) {
  .hero-grid { grid-template-columns: 1fr; }
  .magazine-layout { grid-template-columns: 1fr; }
  .scenario-box { grid-template-columns: 1fr; }
  .feature-row { flex-direction: column; }
  .feature-row.reverse { flex-direction: column; }
}
