/* 设计变量与 Token */
:root {
  --color-dark: #140E25;
  --color-paper: #F7F5F3;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #C8ED6E;
  --color-accent-text: #140E25;
  --color-border: rgba(25, 21, 35, 0.12);

  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(25, 21, 35, 0.3);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 960px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --line-height-base: 1.65;
  --header-height: 64px;
}

/* 基础重置与排版 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--color-paper);
  color: var(--color-text);
  line-height: var(--line-height-base);
  font-size: 16px;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* 容器与布局 */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}
.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
  border-bottom: 1px solid var(--color-border);
  position: relative;
}
.section:last-child { border-bottom: none; }
.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); }

/* 色面覆盖变量 */
.section-dark {
  background: var(--color-dark);
  --bg-surface: var(--color-dark);
  --text-primary: var(--color-paper);
  --text-secondary: rgba(247, 245, 243, 0.85);
  --accent-color: var(--color-accent);
  --brand-color: var(--color-accent);
  --border-color: rgba(247, 245, 243, 0.15);
}
.section-light {
  background: var(--color-paper);
  --bg-surface: var(--color-paper);
  --text-primary: var(--color-text);
  --text-secondary: var(--color-text);
  --accent-color: var(--color-brand);
  --brand-color: var(--color-brand);
  --border-color: rgba(25, 21, 35, 0.12);
}
.card-light {
  background: var(--color-paper);
  --text-primary: var(--color-text);
  --text-secondary: var(--color-text);
  --accent-color: var(--color-brand);
  --brand-color: var(--color-brand);
}

/* 排版层级 */
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--accent-color);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}
h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  text-wrap: balance;
}
h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}
p { margin-bottom: 1rem; max-width: 38em; }
.hl { color: var(--brand-color); font-weight: 600; }
.text-secondary { color: var(--text-secondary); }

/* 组件：按钮 */
.btn-group { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.5rem; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 48px;
  padding: 0 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 2px; }
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--color-accent);
  color: var(--color-accent-text);
  border: none;
}
.btn-primary:hover { background: #d4f582; }
.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--text-primary);
}
.section-dark .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }
.btn svg { width: 20px; height: 20px; stroke-width: 2; }

/* 组件：卡片与表格 */
.card {
  background: var(--bg-surface);
  border: var(--card-border) solid var(--border-color);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
  transition: box-shadow 0.2s ease;
}
.card:hover { box-shadow: 0 12px 32px -12px rgba(25, 21, 35, 0.4); }
.table-wrap { overflow-x: auto; margin: 1.5rem 0; border: 1px solid var(--border-color); border-radius: var(--radius-card); }
table { width: 100%; border-collapse: collapse; min-width: 500px; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border-color); }
th { background: rgba(25, 21, 35, 0.04); font-weight: 600; }
.section-dark th { background: rgba(247, 245, 243, 0.08); }

/* 组件：FAQ */
.faq-item { border-bottom: 1px solid var(--border-color); }
.faq-item summary {
  padding: 1rem 0;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: var(--border-color);
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}
.faq-item[open] summary::before { transform: rotate(45deg); }
.faq-item p { padding-bottom: 1rem; color: var(--text-secondary); }

/* 组件：页头页脚 */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-paper);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
  backdrop-filter: blur(8px);
}
.section-dark .header { background: rgba(20, 14, 37, 0.9); border-color: rgba(247, 245, 243, 0.1); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
.logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.1rem; }
.logo img { width: 28px; height: 28px; object-fit: contain; }
.nav { display: flex; gap: 1.5rem; align-items: center; }
.nav a { font-size: 0.95rem; font-weight: 500; transition: color 0.2s; }
.nav a:hover { color: var(--accent-color); }
.nav a[aria-current="page"] { color: var(--accent-color); font-weight: 600; }
.footer {
  background: var(--color-dark);
  color: var(--color-paper);
  padding: var(--section-y) 0;
  border-top: 1px solid rgba(247, 245, 243, 0.1);
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--gap); }
.footer h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 1rem; color: var(--color-accent); }
.footer ul li { margin-bottom: 0.5rem; }
.footer ul a { font-size: 0.9rem; color: rgba(247, 245, 243, 0.7); transition: color 0.2s; }
.footer ul a:hover { color: var(--color-paper); }
.footer-bottom { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid rgba(247, 245, 243, 0.1); text-align: center; font-size: 0.85rem; color: rgba(247, 245, 243, 0.5); }

/* SVG 动效方向 */
.svg-panel { width: 100%; height: auto; }
.svg-draw { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; }
@keyframes draw-line { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
@keyframes breath-opacity { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
@keyframes float-y { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes slide-right { 0% { transform: translateX(16px); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } }
@keyframes pulse-ring { 0% { transform: scale(0.9); opacity: 0.8; } 100% { transform: scale(1.1); opacity: 0; } }

.anim-draw { animation: draw-line 5s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate; }
.anim-breath { animation: breath-opacity 3.5s ease-in-out infinite; }
.anim-float { animation: float-y 6s ease-in-out infinite; }
.anim-slide { animation: slide-right 1.2s cubic-bezier(0.2, 0, 0.2, 1) both; }
.anim-pulse { animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.transform-box-center { transform-box: fill-box; transform-origin: center; }

/* 响应式与无障碍 */
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .nav { gap: 1rem; }
  .btn { width: 100%; }
}
@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-breath, .anim-float, .anim-slide, .anim-pulse { animation: none !important; }
}
