/* === 设计变量与全局重置 === */
:root {
  /* 色板 */
  --color-dark: #140E25;
  --color-paper: #F5F0E5;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #C8ED6E;
  --color-text-on-dark: #F5F0E5;
  
  /* 结构 Token */
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(25, 21, 35, 0.3);
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 960px;
  
  /* 排版基础 */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --line-height-base: 1.55;
}

/* 表面层颜色上下文控制 */
.surface-dark {
  --bg: var(--color-dark);
  --text: var(--color-text-on-dark);
  --heading: var(--color-text-on-dark);
  --accent: var(--color-accent);
  --brand: var(--color-accent);
  --divider: rgba(200, 237, 110, 0.25);
}
.surface-paper {
  --bg: var(--color-paper);
  --text: var(--color-text);
  --heading: var(--color-text);
  --accent: var(--color-accent);
  --brand: var(--color-brand);
  --divider: rgba(25, 21, 35, 0.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--color-paper);
  color: var(--color-text);
  line-height: var(--line-height-base);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* === 布局容器 === */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}
.section {
  padding-block: var(--section-y);
  position: relative;
}
.section + .section {
  border-top: 1px solid var(--divider);
}
.grid-2 { display: grid; gap: var(--gap); grid-template-columns: 1fr; }
.grid-3 { display: grid; gap: var(--gap); grid-template-columns: 1fr; }
@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.hero-layout {
  display: grid;
  gap: var(--gap);
  align-items: center;
}
@media (min-width: 768px) {
  .hero-layout { grid-template-columns: 1.1fr 0.9fr; }
}

/* === 排版 === */
.h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--heading);
  text-wrap: balance;
}
.h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.02em;
  color: var(--heading);
  margin-bottom: calc(var(--gap) * 1.5);
}
.h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--heading);
  margin-bottom: 0.75rem;
}
p { margin-bottom: 1rem; max-width: 38em; }
.hl { color: var(--accent); }
.surface-paper .hl { color: var(--brand); }
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 0.75rem;
}
.surface-dark .eyebrow { color: var(--accent); }

/* === 组件：按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  height: 52px;
  padding: 0 20px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
  border: none;
}
.btn-primary {
  background: var(--accent);
  color: var(--color-dark);
}
.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--text);
}
.surface-dark .btn-secondary {
  color: var(--text-on-dark);
  border-color: var(--text-on-dark);
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }

/* === 组件：卡片 === */
.card {
  background: var(--bg);
  border-radius: var(--radius-card);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  transition: box-shadow 0.2s ease;
}
.card:hover { box-shadow: 0 14px 32px -12px rgba(25, 21, 35, 0.4); }
.surface-dark .card { background: var(--color-paper); color: var(--color-text); }
.surface-dark .card h3, .surface-dark .card p { color: var(--color-text); }
.surface-dark .card .eyebrow { color: var(--color-brand); }

/* === 组件：表格 === */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.data-table th, .data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--divider);
}
.data-table th { font-weight: 700; width: 40%; }
.data-table tr:last-child td { border-bottom: none; }

/* === 组件：FAQ === */
.faq-item {
  border-bottom: 1px solid var(--divider);
  margin-bottom: 12px;
}
.faq-item summary {
  padding: 16px 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--heading);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.2rem;
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .answer {
  padding-bottom: 16px;
  color: var(--text);
  line-height: 1.7;
}

/* === 组件：Tab（纯CSS） === */
.tab-radio { display: none; }
.tab-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--divider);
  padding-bottom: 8px;
}
.tab-label {
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 600;
  border-radius: var(--radius-btn);
  transition: background 0.2s;
  user-select: none;
}
.tab-label:hover { background: rgba(25, 21, 35, 0.05); }
.tab-pane { display: none; }
.tab-radio:checked + .tab-label { background: var(--accent); color: var(--color-dark); }
.tab-radio:nth-of-type(1):checked ~ .tab-pane:nth-of-type(1),
.tab-radio:nth-of-type(2):checked ~ .tab-pane:nth-of-type(2),
.tab-radio:nth-of-type(3):checked ~ .tab-pane:nth-of-type(3),
.tab-radio:nth-of-type(4):checked ~ .tab-pane:nth-of-type(4) {
  display: block;
}

/* === 组件：步骤列表 === */
.step-list { list-style: none; counter-reset: step; }
.step-list li {
  counter-increment: step;
  position: relative;
  padding-left: 48px;
  margin-bottom: 24px;
}
.step-list li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0; top: 0;
  width: 36px; height: 36px;
  background: var(--accent);
  color: var(--color-dark);
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.surface-paper .step-list li::before { background: var(--brand); color: var(--color-paper); }

/* === SVG 动效系统 === */
svg.anim-svg {
  width: 100%;
  height: auto;
  max-width: 100%;
}
svg.anim-svg path, svg.anim-svg circle, svg.anim-svg rect, svg.anim-svg line {
  transform-box: fill-box;
  transform-origin: center;
}
/* 星点明灭 */
@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
.anim-twinkle { animation: twinkle 4s ease-in-out infinite; }
.anim-twinkle.delay-1 { animation-delay: 1.2s; }
.anim-twinkle.delay-2 { animation-delay: 2.5s; }
/* 连线绘制 */
@keyframes drawLine {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
.anim-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLine 6s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}
/* 轻微漂浮 */
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.anim-float { animation: floatY 5s ease-in-out infinite; }
.anim-float.delay-1 { animation-delay: 0.8s; }
/* 呼吸点 */
@keyframes breathe {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}
.anim-breathe { animation: breathe 3s ease-in-out infinite; }
/* 滑入卡片 */
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
.anim-slide { animation: slideIn 4s ease-out infinite alternate; }

/* 减少动态效果 */
@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-line, .anim-twinkle, .anim-float, .anim-breathe, .anim-slide {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* === 页头页脚 === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245, 240, 229, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--divider);
  padding: 12px 0;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo-area { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-img { width: 32px; height: 32px; object-fit: contain; }
.logo-text { font-weight: 800; font-size: 1.1rem; color: var(--color-text); }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a {
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--color-brand); }
.site-footer {
  background: var(--color-dark);
  color: var(--color-text-on-dark);
  padding: 48px 0 32px;
  margin-top: 64px;
}
.footer-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.footer-grid a { color: var(--color-text-on-dark); text-decoration: none; opacity: 0.85; }
.footer-grid a:hover { opacity: 1; text-decoration: underline; }
.copyright { margin-top: 32px; font-size: 0.85rem; opacity: 0.7; text-align: center; }
