/* === 设计变量与基础配置 === */
:root {
  /* 色板 */
  --color-dark: #121531;
  --color-paper: #E8E9EA;
  --color-text: #151723;
  --color-brand: #142CEB;
  --color-accent: #ED7D6E;
  --color-dark-text: #F0F1F3;
  
  /* 结构尺寸 */
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: none;
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1280px;
  
  /* 排版 */
  --font-main: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --line-height-body: 1.65;
  --line-height-tight: 1.25;
}

/* === 重置与全局 === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-main);
  color: var(--color-text);
  background: var(--color-paper);
  line-height: var(--line-height-body);
  font-size: 16px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
ul, ol { list-style: none; }

/* === 容器与布局 === */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.flex-center { display: flex; align-items: center; justify-content: center; }

/* === 排版系统 === */
.overline {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-brand);
  margin-bottom: 0.75rem;
}
.bg-dark .overline { color: var(--color-accent); }
.hl { color: var(--color-brand); font-weight: 700; }
.bg-dark .hl { color: var(--color-accent); }

h1, h2, h3, h4 { line-height: var(--line-height-tight); font-weight: 700; letter-spacing: 0.02em; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); margin-bottom: 1.5rem; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 1.25rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }
p { margin-bottom: 1rem; max-width: 38em; }
strong { font-weight: 700; }

/* === 组件：按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 52px;
  padding: 0 1.5rem;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  border: none;
  text-align: center;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover { background: #d96b5c; }
.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 2px solid var(--color-text);
}
.bg-dark .btn-secondary { color: var(--color-dark-text); border-color: var(--color-dark-text); }
.bg-dark .btn-secondary:hover { background: rgba(255,255,255,0.1); }
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }

/* === 组件：卡片 === */
.card {
  background: color-mix(in srgb, var(--color-text) 4%, transparent);
  border: var(--card-border) solid currentColor;
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  transition: transform 0.2s ease;
}
.card:hover { transform: translateY(-3px); }
.bg-dark .card { background: #1a1d3c; }
.card-grid > .card { display: flex; flex-direction: column; }

/* === 组件：表格 === */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 500px; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid rgba(21,23,35,0.1); }
th { font-weight: 700; background: rgba(21,23,35,0.03); }
td { vertical-align: top; }
.bg-dark th, .bg-dark td { border-bottom-color: rgba(240,241,243,0.15); }

/* === 组件：FAQ / Details === */
details {
  background: color-mix(in srgb, var(--color-text) 3%, transparent);
  border-radius: var(--radius-card);
  margin-bottom: 0.75rem;
  overflow: hidden;
}
summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-right: 2.5rem;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 400;
  color: var(--color-brand);
}
details[open] summary::after { content: "−"; }
details > div { padding: 0 1.25rem 1rem; color: var(--color-text); }
.bg-dark details { background: #1a1d3c; }
.bg-dark summary::after { color: var(--color-accent); }

/* === 组件：步骤徽标 === */
.step-list { counter-reset: step; }
.step-item { counter-increment: step; display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1.5rem; }
.step-item::before {
  content: counter(step, decimal-leading-zero);
  flex-shrink: 0;
  width: 32px; height: 32px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bg-dark .step-item::before { background: var(--color-accent); }

/* === 页头与页脚 === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(232, 233, 234, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(21,23,35,0.08);
}
.header-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { font-weight: 500; font-size: 0.95rem; padding: 0.25rem 0; position: relative; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--color-brand); }
.nav-links a[aria-current="page"]::after {
  content: ""; position: absolute; bottom: -2px; left: 0; width: 100%; height: 2px; background: var(--color-brand);
}
.site-footer {
  background: var(--color-dark);
  color: var(--color-dark-text);
  padding: 3rem 0 1.5rem;
  margin-top: auto;
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; margin-bottom: 2rem; }
.footer-col h4 { font-size: 1rem; margin-bottom: 0.75rem; color: var(--color-accent); }
.footer-col a { display: block; padding: 0.25rem 0; opacity: 0.8; }
.footer-col a:hover { opacity: 1; text-decoration: underline; }
.footer-bottom { border-top: 1px solid rgba(240,241,243,0.15); padding-top: 1.5rem; text-align: center; font-size: 0.85rem; opacity: 0.7; }

/* === 面色上下文覆盖 === */
.bg-dark {
  background: var(--color-dark);
  color: var(--color-dark-text);
}
.bg-dark .hl, .bg-dark .overline, .bg-dark .btn-primary { color: var(--color-accent); }
.bg-dark .btn-secondary { color: var(--color-dark-text); border-color: var(--color-dark-text); }
.bg-dark .card { background: #1a1d3c; }
.bg-dark table th { background: rgba(240,241,243,0.05); }
.bg-dark table td, .bg-dark table th { border-color: rgba(240,241,243,0.12); }

/* === SVG 动效关键帧 === */
@keyframes draw-path {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes float-gentle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes breathe-opacity {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
@keyframes rotate-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.anim-draw { animation: draw-path 2.5s ease forwards; }
.anim-float { animation: float-gentle 4s ease-in-out infinite; }
.anim-breathe { animation: breathe-opacity 3s ease-in-out infinite; }
.anim-rotate { animation: rotate-slow 12s linear infinite; }
.anim-slide { animation: slide-up 1.2s ease forwards; }

/* 统一变换原点 */
[class^="anim-"] { transform-box: fill-box; transform-origin: center; }

@media (prefers-reduced-motion: reduce) {
  [class^="anim-"] { animation: none !important; }
}

/* === 响应式微调 === */
@media (max-width: 768px) {
  .grid-3 { grid-template-columns: 1fr; }
  .nav-links { gap: 1rem; }
  .btn { width: 100%; justify-content: center; }
  h1 { font-size: clamp(1.8rem, 6vw, 2.8rem); }
}
