/* === 设计变量 === */
:root {
  /* 色板 */
  --color-dark: #271334;
  --color-paper: #E9E8EA;
  --color-text: #1D1523;
  --color-brand: #8A13DD;
  --color-accent: #9EED6E;
  --color-bg-alt: #dcdbe0;
  --color-surface-dark-text: #E9E8EA;
  --color-surface-dark-accent: #9EED6E;

  /* 结构 Token */
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 0;
  --card-shadow: none;
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1120px;

  /* 排版 */
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* === 基础重置 === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  line-height: 1.55;
  color: var(--color-text);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* === 容器与分节 === */
.container { max-width: var(--content-max); margin-inline: auto; padding-inline: var(--gap); }
section { padding-block: var(--section-y); }

/* === 表面色彩类 === */
.surface-paper { background: var(--color-paper); color: var(--color-text); }
.surface-dark { background: var(--color-dark); color: var(--color-surface-dark-text); }
.surface-light-paper { background: var(--color-bg-alt); color: var(--color-text); }

/* 表面内的取色覆盖 */
.surface-dark a { color: var(--color-surface-dark-accent); }
.surface-dark .hl { color: var(--color-surface-dark-accent); }
.surface-dark .label { color: var(--color-surface-dark-accent); }
.surface-dark .btn-secondary { color: var(--color-surface-dark-text); border-color: var(--color-surface-dark-text); }

/* === 排版 === */
h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin-bottom: calc(var(--gap) * 0.75); }
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); text-wrap: balance; }
h3 { font-size: 1.25rem; }
p { margin-bottom: calc(var(--gap) * 0.75); max-width: 38em; }
.label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: calc(var(--gap) * 0.5);
  color: var(--color-brand);
}
.surface-dark .label { color: var(--color-surface-dark-accent); }
.hl { color: var(--color-brand); }
.surface-dark .hl { color: var(--color-surface-dark-accent); }

/* === 按钮 === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 24px; height: 52px; border-radius: var(--radius-btn);
  font-weight: 600; font-size: 1rem; cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  border: none; text-align: center; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-secondary { background: transparent; border: 1px solid var(--color-text); color: var(--color-text); }
.surface-dark .btn-primary { color: var(--color-dark); }

/* === 卡片与面板 === */
.card {
  border-radius: var(--radius-card);
  padding: var(--gap);
  background: var(--color-bg-alt);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
}
.surface-dark .card { background: rgba(255, 255, 255, 0.08); }
.panel {
  border-radius: var(--radius-card);
  padding: calc(var(--gap) * 1.5);
  background: var(--color-dark);
  position: relative;
}
.surface-paper .panel { background: var(--color-dark); }

/* === 表格 === */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-card); }
table { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 600px; }
th, td { padding: 16px; text-align: left; vertical-align: top; word-break: break-word; }
thead th { font-weight: 700; border-bottom: 1px solid currentColor; opacity: 0.85; }
tbody tr { border-bottom: 1px solid rgba(0,0,0,0.06); }
.surface-dark tbody tr { border-bottom-color: rgba(255,255,255,0.1); }
tbody tr:last-child { border-bottom: none; }

/* === 步骤与列表 === */
.step-list { counter-reset: step; }
.step-item { display: flex; gap: 16px; margin-bottom: 24px; align-items: flex-start; }
.step-num {
  flex-shrink: 0; width: 32px; height: 32px;
  background: var(--color-accent); color: var(--color-dark);
  border-radius: 8px; display: grid; place-items: center;
  font-weight: 700; font-size: 0.9rem;
}
.step-content h4 { margin-bottom: 4px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--gap); }

/* === FAQ (Details) === */
details { border-radius: var(--radius-card); margin-bottom: 12px; overflow: hidden; }
details[open] summary { border-bottom: 1px solid rgba(0,0,0,0.06); }
.summary-row {
  padding: 16px 20px; cursor: pointer; font-weight: 600;
  display: flex; justify-content: space-between; align-items: center;
}
.surface-dark details { background: rgba(255,255,255,0.05); }
.surface-dark details[open] summary { border-bottom-color: rgba(255,255,255,0.1); }
details p { padding: 16px 20px; line-height: 1.6; }

/* === SVG 动效 === */
.hero-svg { width: 100%; height: auto; }
.anim-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-line 4s ease-in-out infinite alternate;
}
.anim-breathe { animation: breathe 4s ease-in-out infinite; }
.anim-float { animation: float 6s ease-in-out infinite; }
.anim-slide { animation: slide-in 0.8s ease forwards; }
.anim-delay-1 { animation-delay: 0.5s; }
.anim-delay-2 { animation-delay: 1s; }
.anim-delay-3 { animation-delay: 1.5s; }

@keyframes draw-line {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes breathe {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes slide-in {
  from { transform: translateX(-10px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* 旋转/缩放子元素中心对齐 */
svg [class*="anim"] { transform-box: fill-box; transform-origin: center; }

/* === 响应式与无障碍 === */
@media (max-width: 768px) {
  .grid-2-col { grid-template-columns: 1fr !important; }
  .hero-layout { grid-template-columns: 1fr !important; }
  .hero-layout > :nth-child(2) { order: -1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* === 页头页脚 === */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--color-paper);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  backdrop-filter: blur(8px);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; max-width: var(--content-max); margin-inline: auto; padding-inline: var(--gap);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; }
.brand img { height: 32px; width: auto; }
.nav { display: flex; gap: 24px; align-items: center; }
.nav a { font-weight: 500; opacity: 0.8; transition: opacity 0.2s; }
.nav a:hover, .nav a[aria-current="page"] { opacity: 1; color: var(--color-brand); }
.nav a[aria-current="page"] { font-weight: 700; }
@media (max-width: 640px) { .nav { display: none; } }

.site-footer {
  padding: 48px 0; border-top: 1px solid rgba(0,0,0,0.06);
  font-size: 0.9rem; opacity: 0.8;
}
.footer-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px;
}
.footer-grid h4 { margin-bottom: 12px; font-size: 0.95rem; }
.footer-grid ul li { margin-bottom: 8px; }
.footer-grid a:hover { text-decoration: underline; }
.copyright { margin-top: 32px; text-align: center; opacity: 0.6; }

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
