:root {
  /* 核心色板 */
  --dark-bg: #19102D;
  --paper-bg: #FCFCFD;
  --paper-alt: #F2F2F5;
  --text-color: #191523;
  --brand-color: #5214EB;
  --accent-color: #D66EED;

  /* 设计 Token */
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 2px solid var(--text-color);
  --card-shadow: 4px 4px 0 var(--text-color);
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1280px;

  /* 排版变量 */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --h1-size: clamp(2.6rem, 6.4vw, 5rem);
  --h2-size: clamp(1.8rem, 3.5vw, 2.8rem);
  --body-size: 1.125rem;
  --line-height-body: 1.75;
  --line-height-title: 1.15;
}

/* 上下文取色覆盖 */
.bg-dark { --text-color: #FCFCFD; --brand-color: #D66EED; --card-border: 2px solid #FCFCFD; --card-shadow: 4px 4px 0 #FCFCFD; }
.bg-paper-alt { --text-color: #191523; --brand-color: #5214EB; --card-border: 2px solid #191523; --card-shadow: 4px 4px 0 #191523; }

/* 基础重置 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: var(--body-size);
  line-height: var(--line-height-body);
  color: var(--text-color);
  background: var(--paper-bg);
  -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: 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: center; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }

/* 排版 */
h1, h2, h3, h4 { font-weight: 500; line-height: var(--line-height-title); letter-spacing: -0.02em; }
h1 { font-size: var(--h1-size); }
h2 { font-size: var(--h2-size); margin-bottom: calc(var(--gap) * 0.75); }
h3 { font-size: 1.35rem; margin-bottom: 0.75rem; }
p { margin-bottom: 1rem; max-width: 38em; }
.badge { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; margin-bottom: 0.5rem; text-transform: uppercase; }
.bg-paper .badge, .bg-paper-alt .badge { color: var(--brand-color); }
.bg-dark .badge { color: var(--accent-color); }
.hl { color: var(--brand-color); }
.bg-dark .hl { color: var(--accent-color); }

/* 组件：按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  height: 52px; padding: 0 24px; font-size: 1rem; font-weight: 600; cursor: pointer;
  border: none; transition: transform 0.2s ease, opacity 0.2s ease;
  border-radius: var(--radius-btn);
}
.btn-primary { background: var(--accent-color); color: var(--dark-bg); }
.btn-secondary { background: transparent; border: 2px solid var(--text-color); color: var(--text-color); }
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--brand-color); outline-offset: 2px; }
.btn svg { width: 20px; height: 20px; stroke-width: 2; }

/* 组件：卡片 */
.card {
  background: var(--paper-bg); border: var(--card-border); box-shadow: var(--card-shadow);
  padding: 1.5rem; position: relative; border-radius: var(--radius-card);
}
.bg-dark .card { background: var(--paper-bg); color: var(--text-color); border-color: #191523; box-shadow: 4px 4px 0 #191523; }
.card-header { font-weight: 700; font-size: 1.1rem; margin-bottom: 0.5rem; }

/* 组件：表格 */
table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
th, td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--text-color); text-align: left; }
th { font-weight: 700; }
.bg-dark th, .bg-dark td { border-color: #FCFCFD; }

/* 组件：FAQ */
details { border: var(--card-border); padding: 1rem; margin-bottom: 0.75rem; background: var(--paper-bg); border-radius: var(--radius-card); }
summary { font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.2rem; }
details[open] summary::after { content: "-"; }
details p { margin-top: 0.75rem; margin-bottom: 0; }

/* 页头与页脚 */
header { position: sticky; top: 0; z-index: 100; background: rgba(252,252,253,0.95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--text-color); }
.nav-inner { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.logo { display: flex; align-items: center; gap: 0.75rem; font-weight: 800; font-size: 1.2rem; }
.logo img { height: 32px; width: auto; }
nav ul { display: flex; gap: 1.5rem; }
nav a { font-weight: 500; padding: 0.5rem 0; position: relative; }
nav a::after { content: ""; position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background: var(--brand-color); transition: width 0.3s ease; }
nav a:hover::after, nav a[aria-current="page"]::after { width: 100%; }
footer { background: var(--dark-bg); color: var(--paper-bg); padding: 3rem 0; border-top: 1px solid #332B4A; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2rem; }
.footer-col h4 { color: var(--accent-color); margin-bottom: 1rem; font-size: 1rem; }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col a { color: #FCFCFD; opacity: 0.8; transition: opacity 0.2s; }
.footer-col a:hover { opacity: 1; }

/* SVG 动效系统 */
.svg-mockup { width: 100%; height: auto; max-width: 600px; }
.mock-layer { transform-origin: center; }
.draw-line { stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawLine 8s cubic-bezier(0.4, 0, 0.2, 1) infinite; }
.float-slow { animation: floatSlow 10s ease-in-out infinite; }
.breathe { animation: breathe 6s ease-in-out infinite; }
.slide-in { animation: slideIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }

/* 通用图标修正：防止 viewBox 24x24 的图标在非正方形容器中变形 */
svg:not(.svg-mockup) {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: middle;
}

@keyframes drawLine {
  0%, 100% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
}
@keyframes floatSlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.02); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* 减少动态效果适配 */
@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-slow, .breathe, .slide-in { animation: none !important; opacity: 1; transform: none; }
}

/* 响应式调整 */
@media (max-width: 768px) {
  .nav-inner { flex-direction: column; height: auto; padding: 1rem 0; }
  nav ul { flex-wrap: wrap; justify-content: center; gap: 1rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .steps-horizontal { flex-direction: column; }
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
