/* === 设计 Token 与变量 === */
:root {
  --color-dark: #121531;
  --color-paper: #E8E9EA;
  --color-body: #151723;
  --color-brand: #142CEB;
  --color-accent: #ED7D6E;

  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 2px solid var(--color-body);
  --card-shadow: 4px 4px 0 var(--color-body);

  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 960px;

  --font-main: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --line-height-body: 1.75;
}

/* === 基础重置与排版 === */
*, *::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: var(--line-height-body);
  color: var(--color-body);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* === 容器与网格 === */
.container {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }

/* === 主题覆盖 === */
.theme-dark {
  background-color: var(--color-dark);
  color: var(--color-paper);
  --text-primary: var(--color-paper);
  --text-secondary: rgba(232, 233, 234, 0.85);
  --accent-color: var(--color-accent);
  --brand-color: var(--color-accent);
}
.theme-dark .hl, .theme-dark .badge { color: var(--color-accent); }
.theme-dark a:not(.btn) { color: var(--color-accent); }
.theme-dark a:not(.btn):hover { text-decoration: underline; }

.theme-light-card {
  background-color: var(--color-paper);
  color: var(--color-body);
  --text-primary: var(--color-body);
  --text-secondary: var(--color-body);
  --accent-color: var(--color-brand);
  --brand-color: var(--color-brand);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
}
.theme-light-card .hl, .theme-light-card .badge { color: var(--color-brand); }
.theme-light-card a:not(.btn) { color: var(--color-brand); }
.theme-light-card a:not(.btn):hover { text-decoration: underline; }

/* === 排版层级 === */
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.5em;
  color: var(--brand-color);
}
h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 0.8em;
  color: var(--text-primary);
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500;
  line-height: 1.25;
  margin-bottom: 0.6em;
  margin-top: 0;
  color: var(--text-primary);
}
h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.5em;
  margin-top: 1em;
  color: var(--text-primary);
}
p { margin-bottom: 1em; max-width: 38em; }
strong { font-weight: 600; }

/* === 按钮组件 === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  height: 52px;
  padding: 0 24px;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  border: none;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}
.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--text-primary);
}
.btn svg { width: 20px; height: 20px; stroke-width: 2; }

/* === 卡片与面板 === */
.card-panel {
  background: var(--color-dark);
  border-radius: var(--radius-card);
  padding: var(--gap);
  position: relative;
  overflow: hidden;
}
.panel-inner {
  width: 100%;
  aspect-ratio: 4 / 3;
  position: relative;
}
.panel-inner svg { width: 100%; height: auto; }

/* === 表格 === */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 1em; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid currentColor; }
th { font-weight: 600; opacity: 0.85; }
td:first-child { font-weight: 600; }

/* === FAQ === */
details {
  border: var(--card-border);
  border-radius: var(--radius-card);
  margin-bottom: 12px;
  background: var(--color-paper);
  overflow: hidden;
}
summary {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-right: 40px;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 400;
  color: var(--color-brand);
}
details[open] summary::after { content: "-"; }
details > div { padding: 0 20px 16px; color: var(--color-body); }

/* === 步骤徽标 === */
.step-list { counter-reset: step; }
.step-item {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  align-items: flex-start;
}
.step-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--color-accent);
  color: var(--color-dark);
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.9rem;
}

/* === 页头页脚 === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(232, 233, 234, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(21, 23, 35, 0.1);
}
.theme-dark .site-header { background: rgba(18, 21, 49, 0.9); border-bottom-color: rgba(232, 233, 234, 0.15); }
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; }
.brand img { width: 32px; height: 32px; object-fit: contain; }
.nav { display: flex; gap: 24px; align-items: center; }
.nav a { font-size: 0.95rem; font-weight: 500; opacity: 0.8; transition: opacity 0.2s; }
.nav a:hover, .nav a[aria-current="page"] { opacity: 1; }
.site-footer {
  padding: 48px 0;
  border-top: 1px solid currentColor;
  margin-top: var(--section-y);
  opacity: 0.85;
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--gap); }
.footer-col h4 { font-weight: 700; margin-bottom: 12px; }
.footer-col a { display: block; margin-bottom: 8px; font-size: 0.9rem; }

/* === SVG 动效系统 === */
.svg-base { width: 100%; height: auto; }
.anim-draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLine 6s ease-in-out infinite alternate;
}
.anim-flow {
  stroke-dasharray: 0.15 0.85;
  stroke-dashoffset: 0;
  animation: flowDash 3s linear infinite;
}
.anim-breathe {
  animation: breathe 3s ease-in-out infinite;
}
.anim-slide {
  animation: slideIn 5s ease-in-out infinite alternate;
}
.anim-float {
  animation: floatUp 4s ease-in-out infinite alternate;
}
.transform-box-center { transform-box: fill-box; transform-origin: center; }

@keyframes drawLine {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes flowDash {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -1; }
}
@keyframes breathe {
  0%, 100% { opacity: 0.4; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.05); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes floatUp {
  from { transform: translateY(0); }
  to { transform: translateY(-8px); }
}

@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-draw, .anim-flow, .anim-breathe, .anim-slide, .anim-float {
    animation: none !important;
  }
}
