:root {
  --color-dark: #21163C;
  --color-paper: #E9E8EA;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #ED926E;
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px var(--color-text);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1120px;
  --line-height-body: 1.65;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
  line-height: var(--line-height-body);
  background: var(--color-paper);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

/* 表面修饰器：统一接管区块内的颜色继承 */
.surface-paper { --bg: var(--color-paper); --fg: var(--color-text); --accent: var(--color-brand); }
.surface-dark { --bg: var(--color-dark); --fg: var(--color-paper); --accent: var(--color-accent); }
section { background: var(--bg); color: var(--fg); padding: var(--section-y) 0; }

.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }

/* 排版 */
h1, h2, h3 { font-weight: 700; letter-spacing: 0.02em; line-height: 1.25; }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); margin-bottom: 0.5em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: var(--gap); }
h3 { font-size: 1.25rem; margin-bottom: 0.5em; }
p { max-width: 38em; margin-bottom: 1em; line-height: var(--line-height-body); }
.micro-label { display: block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.5rem; }
.hl { color: var(--accent); }
.text-balance { text-wrap: balance; }

/* 布局辅助 */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.flex-row { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: center; }
.mt-1 { margin-top: var(--gap); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  padding: 0.75em 1.5em; border-radius: var(--radius-btn);
  font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  border: none; font-size: 1rem; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-secondary { background: transparent; border: 1px solid currentColor; color: inherit; }
.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); color: var(--fg);
  border-radius: var(--radius-card);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card:hover { box-shadow: calc(var(--card-shadow) * 1.2); transform: translateY(-2px); }

/* 表格 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-card); }
table { width: 100%; border-collapse: collapse; min-width: 500px; }
th, td { padding: 0.75em 1em; text-align: left; border-bottom: 1px solid rgba(128,128,128,0.2); }
th { font-weight: 700; }
td a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
td a:hover { text-decoration-thickness: 2px; }

/* 详情折叠 FAQ */
details { margin-bottom: 1em; border-bottom: 1px solid rgba(128,128,128,0.2); }
summary { cursor: pointer; font-weight: 600; padding: 1em 0; list-style: none; position: relative; padding-left: 1.5em; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; position: absolute; left: 0; top: 1em; font-weight: 700; }
details[open] summary::before { content: "-"; }
details p { margin-top: 0.5em; margin-bottom: 1em; }

/* 纯 CSS 分段导航（Tab） */
.tab-nav { display: flex; gap: 0.5em; flex-wrap: wrap; margin-bottom: var(--gap); }
.tab-nav input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.tab-nav label {
  padding: 0.5em 1em; border-radius: var(--radius-btn);
  background: rgba(128,128,128,0.1); cursor: pointer;
  font-weight: 600; transition: background 0.2s;
}
.tab-nav input:checked + label { background: var(--accent); color: var(--bg); }
.tab-panel { display: none; }
.tab-nav input:checked + label ~ .tab-panel { display: block; }
/* 窄屏降级：全部可见 */
@media (max-width: 640px) {
  .tab-panel { display: block !important; margin-bottom: var(--gap); }
  .tab-nav { display: none; }
}

/* 时间轴 */
.timeline { position: relative; padding-left: 2em; }
.timeline::before { content: ""; position: absolute; left: 0.5em; top: 0; bottom: 0; width: 2px; background: currentColor; opacity: 0.3; }
.timeline-item { position: relative; margin-bottom: var(--gap); }
.timeline-item::before {
  content: attr(data-time); position: absolute; left: -2em; top: 0;
  font-size: 0.8rem; font-weight: 700; color: var(--accent); width: 2em; text-align: right;
}
.step-number {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.5em; height: 2.5em; border-radius: 8px;
  background: var(--accent); color: var(--bg); font-weight: 800; font-size: 1.1rem;
  margin-bottom: 0.5em;
}

/* 列表标记 */
ul.check-list { list-style: none; padding-left: 0; }
ul.check-list li { position: relative; padding-left: 1.5em; margin-bottom: 0.75em; }
ul.check-list li::before {
  content: ""; position: absolute; left: 0; top: 0.5em;
  width: 8px; height: 8px; border-radius: 2px; background: var(--accent);
}

/* 头部与页脚 */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(233,232,234,0.85); backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  transition: background 0.3s, box-shadow 0.3s;
}
.surface-dark .site-header { background: rgba(33,22,60,0.9); border-bottom-color: rgba(255,255,255,0.06); }
.nav-inner { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.nav-links { display: flex; gap: 1.5em; align-items: center; }
.nav-links a { text-decoration: none; font-weight: 500; opacity: 0.85; transition: opacity 0.2s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { opacity: 1; color: var(--accent); }
.site-footer { padding: 2em 0; border-top: 1px solid rgba(128,128,128,0.2); text-align: center; font-size: 0.9rem; opacity: 0.8; }
.footer-links { display: flex; justify-content: center; gap: 1.5em; margin-bottom: 1em; flex-wrap: wrap; }
.footer-links a { color: inherit; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }

/* SVG 基础与响应式 */
.svg-canvas { width: 100%; height: auto; max-width: 100%; display: block; }
.svg-canvas svg { width: 100%; height: auto; }

/* SVG 动效关键帧 */
@keyframes twinkle { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
@keyframes drawLine { 0%, 100% { stroke-dashoffset: 1; } 50% { stroke-dashoffset: 0; } }
@keyframes floatBubble { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes pulseDot { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
@keyframes slideIn { 0% { transform: translateX(10px); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } }

.anim-twinkle { animation: twinkle 4s ease-in-out infinite; }
.anim-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawLine 6s ease-in-out infinite; }
.anim-float { animation: floatBubble 5s ease-in-out infinite; }
.anim-pulse { animation: pulseDot 3s ease-in-out infinite; }
.anim-slide { animation: slideIn 0.8s ease-out forwards; }

/* 旋转/缩放子元素修正原点 */
svg [class*="anim-"] { transform-box: fill-box; transform-origin: center; }

/* 减少动态效果 */
@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; }
}
