/* === 基础重置与变量 === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  line-height: 1.75;
  color: var(--text-body);
  background: var(--bg-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* === 设计 Token === */
:root {
  --bg-dark: #13102D;
  --bg-paper: #D6D4ED;
  --text-body: #171523;
  --brand-color: #2714EB;
  --accent-color: #89ED6E;
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 1px solid rgba(23, 21, 35, 0.16);
  --card-shadow: none;
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1120px;
  --header-h: 64px;
}

/* === 主题覆盖 === */
.theme-paper {
  --text-main: var(--text-body);
  --hl: var(--brand-color);
  --sec-border: rgba(23, 21, 35, 0.1);
  --card-bg: transparent;
  --btn-bg: var(--accent-color);
  --btn-text: var(--bg-dark);
  --sec-border: rgba(23, 21, 35, 0.1);
}
.theme-dark {
  --text-main: var(--bg-paper);
  --hl: var(--accent-color);
  --sec-border: rgba(214, 212, 237, 0.15);
  --card-bg: transparent;
  --btn-bg: var(--accent-color);
  --btn-text: var(--bg-dark);
  --sec-border: rgba(214, 212, 237, 0.15);
}

/* === 布局容器 === */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}
.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
  position: relative;
}
.section + .section { border-top: 1px solid var(--sec-border); }
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
  align-items: center;
}

/* === 排版 === */
.megatag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
  text-transform: uppercase;
}
.theme-paper .megatag { color: var(--brand-color); }
.theme-dark .megatag { color: var(--accent-color); }

h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 1.2rem;
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text-main);
  margin-bottom: 1.6rem;
  text-wrap: balance;
}
h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-main);
  margin-bottom: 0.8rem;
}
p { margin-bottom: 1rem; max-width: 38em; color: var(--text-main); }
.hero-text p { color: #171523; }
.hl { color: var(--hl); }

/* === 按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  height: 48px;
  padding: 0 1.5rem;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  border: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--btn-bg);
  color: var(--btn-text);
}
.btn-secondary {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--text-main);
}
.btn:hover { transform: translateY(-1px); filter: brightness(0.95); }
.btn:focus-visible { outline: 2px solid var(--hl); outline-offset: 3px; }

/* === 卡片与面板 === */
.card {
  background: var(--card-bg);
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 1.5rem;
  transition: transform 0.2s ease;
}
.card:hover { transform: translateY(-2px); }
.visual-panel {
  background: var(--bg-dark);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.theme-paper .visual-panel { background: var(--bg-dark); }
.theme-dark .visual-panel { background: rgba(214, 212, 237, 0.08); border: 1px solid var(--sec-border); }

/* === 表格 === */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  color: var(--text-main);
}
th, td { padding: 0.8rem 1rem; text-align: left; border-bottom: 1px solid var(--sec-border); white-space: normal; word-break: break-word; }
th { font-weight: 600; }

/* === FAQ === */
details {
  border: var(--card-border);
  border-radius: var(--radius-card);
  margin-bottom: 0.8rem;
  background: var(--card-bg);
  transition: background 0.2s ease;
}
summary {
  padding: 1rem 1.2rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-main);
  list-style: none;
  position: relative;
  padding-right: 2.5rem;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  position: absolute;
  right: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 400;
  color: var(--hl);
}
details[open] summary::after { content: "−"; }
details p { padding: 0 1.2rem 1rem; margin: 0; font-size: 0.95rem; color: var(--text-main); }

/* === 步骤条 === */
.steps { display: flex; flex-wrap: wrap; gap: var(--gap); counter-reset: step; }
.step-item { flex: 1 1 220px; position: relative; }
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  background: var(--hl);
  color: var(--bg-dark);
  font-weight: 700;
  border-radius: 8px;
  margin-bottom: 0.6rem;
}
.step-item h4 { font-size: 1.1rem; margin-bottom: 0.4rem; color: var(--text-main); }
.step-item p { font-size: 0.95rem; margin: 0; }

/* === 场景卡片 === */
.scenario-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--gap); }
.scenario-card { border: var(--card-border); border-radius: var(--radius-card); padding: 1.5rem; background: var(--card-bg); }
.scenario-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  margin-bottom: 0.8rem;
  background: rgba(39, 20, 235, 0.1);
  color: var(--brand-color);
}
.theme-dark .scenario-tag { background: rgba(137, 237, 110, 0.15); color: var(--accent-color); }
.scenario-flow { display: flex; flex-direction: column; gap: 0.6rem; }
.flow-line { padding-left: 0.8rem; border-left: 2px solid var(--hl); font-size: 0.95rem; color: var(--text-main); }

/* === 新闻网格 === */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--gap); }
.news-card { border: var(--card-border); border-radius: var(--radius-card); padding: 1.2rem; background: var(--card-bg); display: flex; flex-direction: column; }
.news-card time { font-size: 0.8rem; color: var(--hl); margin-bottom: 0.4rem; }
.news-card h4 { font-size: 1.05rem; margin-bottom: 0.5rem; color: var(--text-main); line-height: 1.3; }
.news-card p { font-size: 0.9rem; margin: 0; color: var(--text-main); }

/* === 页头页脚 === */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(214, 212, 237, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, background 0.2s;
}
.theme-dark .site-header { background: rgba(19, 16, 45, 0.9); }
.site-header.scrolled { border-bottom-color: var(--sec-border); }
.header-inner {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
}
.nav-list { display: flex; gap: 1.5rem; align-items: center; }
.nav-link { font-weight: 500; font-size: 0.95rem; color: var(--text-main); position: relative; }
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--hl); }
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--sec-border);
  font-size: 0.9rem;
  color: var(--text-main);
}
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.footer-links { display: flex; gap: 1.2rem; }
.footer-links a { color: var(--text-main); }
.footer-links a:hover { color: var(--hl); }

/* === SVG 动效 === */
.svg-container { width: 100%; height: auto; }
svg { width: 100%; height: 100%; }
.anim-breathe { animation: breathe 6s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.anim-breathe-slow { animation: breathe 8s ease-in-out infinite 1s; transform-origin: center; transform-box: fill-box; }
.anim-breathe-fast { animation: breathe 4.5s ease-in-out infinite 0.5s; transform-origin: center; transform-box: fill-box; }
.anim-float { animation: float 5s ease-in-out infinite; }
.anim-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawLine 3s ease forwards infinite; }
.anim-opacity-pulse { animation: opPulse 4s ease-in-out infinite; }

@keyframes breathe {
  0%, 100% { transform: scale(0.96); opacity: 0.7; }
  50% { transform: scale(1.04); opacity: 1; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes drawLine {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}
@keyframes opPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    animation: none !important;
  }
  .svg-container { height: auto; }
}

/* === 响应式微调 === */
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .steps { flex-direction: column; }
  .header-inner { flex-direction: column; height: auto; padding: 0.8rem 0; }
  .nav-list { margin-top: 0.8rem; }
  h1 { font-size: clamp(2rem, 8vw, 3rem); }
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
