/* 设计变量与全局设定 */
:root {
  --color-dark-bg: #231334;
  --color-paper: #F5F3F7;
  --color-text: #1C1523;
  --color-brand: #7D14EB;
  --color-accent: #EDD26E;
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 0;
  --card-shadow: none;
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1120px;
  --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --lh-body: 1.75;
  --lh-head: 1.15;
  --text-color: var(--color-text);
  --accent-color: var(--color-brand);
}

/* 区域颜色覆盖 */
.area-dark {
  --bg-color: var(--color-dark-bg);
  --text-color: var(--color-paper);
  --accent-color: var(--color-accent);
}
.area-light-card {
  --bg-color: var(--color-paper);
  --text-color: var(--color-text);
  --accent-color: var(--color-brand);
}

/* 重置与基础 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  background: var(--color-paper);
  color: var(--text-color);
  line-height: var(--lh-body);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--accent-color); text-decoration: none; transition: opacity .2s; }
a:hover { opacity: .85; }
ul { list-style: none; }

/* 布局容器 */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding: var(--section-y) 0; }
.divider { border-top: 1px solid rgba(125,20,235,.15); margin: 0 auto; width: 80%; }

/* 排版系统 */
h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  font-weight: 500;
  line-height: var(--lh-head);
  letter-spacing: -.02em;
  margin-bottom: .6em;
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500;
  line-height: var(--lh-head);
  margin-bottom: .5em;
  text-wrap: balance;
}
h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-weight: 500;
  line-height: var(--lh-head);
  margin-bottom: .4em;
}
p { max-width: 38em; margin-bottom: 1em; }
.eyebrow {
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .05em;
  margin-bottom: .4em;
  color: var(--accent-color);
}
.hl { color: var(--accent-color); }

/* 按钮组件 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  padding: .8em 1.6em;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform .2s, background .2s, color .2s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent-color);
  color: var(--color-dark-bg);
}
.btn-secondary {
  background: transparent;
  border: 1px solid var(--text-color);
  color: var(--text-color);
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--accent-color); outline-offset: 2px; }

/* 网格与卡片 */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.card {
  background: var(--bg-color, var(--color-paper));
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
}
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--gap); }

/* 表格 */
table { width: 100%; border-collapse: collapse; margin: 1.5em 0; }
th, td { padding: .8em 1em; text-align: left; border-bottom: 1px solid rgba(125,20,235,.1); }
th { font-weight: 600; }

/* 步骤编号徽标 */
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--accent-color);
  color: var(--color-dark-bg);
  font-weight: 700;
  font-size: .9rem;
  border-radius: 8px;
  margin-right: .6em;
  flex-shrink: 0;
}
.steps-list li { display: flex; align-items: flex-start; margin-bottom: 1.2em; }

/* 交互组件 (FAQ) */
details { margin-bottom: 1em; border-bottom: 1px solid rgba(125,20,235,.1); padding-bottom: 1em; }
summary { cursor: pointer; font-weight: 600; list-style: none; position: relative; padding-left: 1.5em; }
summary::before { content: "+"; position: absolute; left: 0; color: var(--accent-color); }
details[open] summary::before { content: "-"; }
details p { margin-top: .8em; margin-left: 1.5em; }

/* 页头页脚 */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245,243,247,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(125,20,235,.1);
}
.area-dark header { background: rgba(35,19,52,.92); border-color: rgba(237,210,110,.1); }
.nav-inner { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.logo { display: flex; align-items: center; gap: .5em; font-weight: 700; color: var(--text-color); }
.logo img { width: 28px; height: 28px; object-fit: contain; }
nav ul { display: flex; gap: 1.5em; list-style: none; }
nav a { color: var(--text-color); font-weight: 500; }
nav a[aria-current="page"], nav a:hover { color: var(--accent-color); }
footer { background: var(--color-dark-bg); color: var(--color-paper); padding: var(--section-y) 0; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--gap); }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.5em; }
.footer-links a { color: var(--color-accent); }

/* SVG 动效基座 */
.anim-svg { width: 100%; height: auto; overflow: visible; }
.anim-svg path, .anim-svg circle, .anim-svg rect { transform-box: fill-box; transform-origin: center; }
/* 描边绘制动效 */
@keyframes drawLoop {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}
.anim-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLoop 6s ease-in-out infinite;
}
/* 悬浮动效 */
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.anim-float { animation: floatY 5s ease-in-out infinite; }
/* 呼吸动效 */
@keyframes breathe {
  0%, 100% { opacity: .3; }
  50% { opacity: 1; }
}
.anim-breathe { animation: breathe 4s ease-in-out infinite; }
/* 数据点流动 */
@keyframes flowAlong {
  0% { offset-distance: 0%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}
.anim-flow-dot {
  offset-path: path("M20,100 Q120,40 220,100 T420,100");
  animation: flowAlong 8s linear infinite;
}

/* 无障碍：减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 焦点样式 */
:focus-visible { outline: 3px solid var(--accent-color); outline-offset: 2px; }

/* 响应式微调 */
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .nav-inner { flex-direction: column; height: auto; padding: 1em 0; }
  nav ul { flex-wrap: wrap; justify-content: center; margin-top: .5em; }
}
