:root {
  /* 色板 */
  --color-dark: #1B1231;
  --color-paper: #DBD4ED;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #9977EE;
  /* 卡片背景微调 */
  --card-bg-paper: #CFC8E8;
  --card-bg-dark: #2A2045;
  /* 结构 Token */
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: none;
  --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;
  --line-height-body: 1.75;
}

/* 基础重置与排版 */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--line-height-body);
  margin: 0;
  background-color: var(--color-paper);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

/* 表面取色规则 */
.surface-dark { background-color: var(--color-dark); color: var(--color-paper); }
.surface-dark h1, .surface-dark h2, .surface-dark h3, .surface-dark p, .surface-dark li { color: var(--color-paper); }
.surface-dark .marker, .surface-dark .hl, .surface-dark a:not(.btn), .surface-dark strong { color: var(--color-accent); }
.surface-paper { background-color: var(--color-paper); color: var(--color-text); }
.surface-paper h1, .surface-paper h2, .surface-paper h3, .surface-paper p, .surface-paper li { color: var(--color-text); }
.surface-paper .marker, .surface-paper .hl, .surface-paper a:not(.btn), .surface-paper strong { color: var(--color-brand); }

/* 卡片回退到纸面取色 */
.card-light {
  background-color: var(--color-paper);
  color: var(--color-text);
  border-radius: var(--radius-card);
  padding: var(--gap);
}
.card-light h3, .card-light p, .card-light li { color: var(--color-text); }
.card-light .hl, .card-light a { color: var(--color-brand); }

/* 布局容器 */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
.section { padding-top: var(--section-y); padding-bottom: var(--section-y); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }

/* 标题与眉标 */
.marker { display: block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 0.5rem; }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 700; letter-spacing: 0.02em; line-height: 1.2; margin: 0 0 1rem; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 700; letter-spacing: 0.02em; line-height: 1.25; margin: 0 0 0.5rem; }
h3 { font-size: 1.25rem; font-weight: 700; margin: 0 0 0.5rem; }
p { margin: 0 0 1rem; max-width: 38em; }
ul, ol { margin: 0 0 1rem; padding-left: 1.2em; }
li { margin-bottom: 0.5rem; }

/* 组件：按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  padding: 0 1.5em; height: 48px; border-radius: var(--radius-btn);
  font-size: 1rem; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
  border: 2px solid transparent;
}
.btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background-color: var(--color-accent); color: var(--color-dark); }
.btn-primary:hover { background-color: #8A66DD; }
.btn-outline { background: transparent; }
.surface-paper .btn-outline { color: var(--color-text); border-color: var(--color-text); }
.surface-dark .btn-outline { color: var(--color-paper); border-color: var(--color-paper); }
.btn-icon { width: 20px; height: 20px; flex-shrink: 0; }

/* 组件：卡片 */
.card {
  border-radius: var(--radius-card);
  padding: var(--gap);
  transition: transform 0.2s ease;
}
.card:hover { transform: translateY(-2px); }
.card-paper { background-color: var(--card-bg-paper); }
.card-dark { background-color: var(--card-bg-dark); }
.card-light { background-color: var(--color-paper); }

/* 组件：表格 */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1rem 0; }
table { width: 100%; border-collapse: collapse; min-width: 400px; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid currentColor; }
th { font-weight: 700; }
td:first-child { font-weight: 600; white-space: nowrap; }

/* 组件：FAQ */
details { margin-bottom: 1rem; border-bottom: 1px solid rgba(128,128,128,0.2); padding-bottom: 1rem; }
summary { cursor: pointer; font-weight: 600; list-style: none; position: relative; padding-left: 1.5em; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; position: absolute; left: 0; font-weight: 700; }
details[open] summary::before { content: "-"; }
details p { margin-top: 0.5rem; margin-bottom: 0; }

/* 组件：步骤徽标 */
.step-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  background-color: var(--color-accent); color: var(--color-dark);
  font-weight: 700; font-size: 0.9rem; margin-right: 0.75rem; flex-shrink: 0;
}
.step-item { display: flex; align-items: flex-start; margin-bottom: 1.5rem; }

/* 页头与页脚 */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background-color: rgba(219, 212, 237, 0.9); backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.surface-dark .site-header { background-color: rgba(27, 18, 49, 0.9); border-bottom-color: rgba(255,255,255,0.05); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: inherit; }
.brand img { height: 32px; width: auto; }
.nav { display: flex; gap: 1.5rem; align-items: center; }
.nav a { text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.nav a:hover { opacity: 0.8; }
.nav a[aria-current="page"] { font-weight: 700; }
.site-footer { padding: var(--section-y) 0; border-top: 1px solid rgba(128,128,128,0.15); margin-top: 2rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--gap); }
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-links a { text-decoration: none; font-size: 0.9rem; }
.footer-copy { font-size: 0.85rem; opacity: 0.8; margin-top: 1rem; }

/* SVG 动效基础 */
.svg-canvas { width: 100%; height: auto; display: block; }
.svg-anim-center { transform-box: fill-box; transform-origin: center; }
.anim-float-1 { animation: float1 6s ease-in-out infinite; }
.anim-float-2 { animation: float2 7s ease-in-out infinite 1.5s; }
.anim-float-3 { animation: float3 8s ease-in-out infinite 0.5s; }
.anim-breathe { animation: breathe 3s ease-in-out infinite; }
.anim-slide-in { animation: slideIn 1.2s ease-out forwards; }
.anim-draw { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawLine 2.5s ease-in-out infinite alternate; }
@keyframes float1 { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes float2 { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes float3 { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes breathe { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
@keyframes slideIn { from { transform: translateX(-15px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes drawLine { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .nav { display: none; } /* 简化移动端，实际项目可加汉堡菜单，此处保持静态兼容 */
}
