/* ================= 设计变量与基础重置 ================= */
:root {
  --color-deep: #2D1438;
  --color-paper: #F6F3F7;
  --color-text: #1F1523;
  --color-brand: #9E13DD;
  --color-accent: #6EEDA8;
  --color-bg: var(--color-paper);
  --color-fg: var(--color-text);
  --color-link: var(--color-brand);
  --color-highlight: var(--color-brand);
  --color-border: rgba(31, 21, 35, 0.12);
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(31, 21, 35, 0.3);
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 960px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --line-height-base: 1.55;
}

/* 深色面覆盖 */
.dark-face {
  --color-bg: var(--color-deep);
  --color-fg: var(--color-paper);
  --color-link: var(--color-accent);
  --color-highlight: var(--color-accent);
  --color-border: rgba(246, 243, 247, 0.15);
}

/* 浅色卡片在深色区块内恢复纸面取色 */
.card-light {
  --color-bg: var(--color-paper);
  --color-fg: var(--color-text);
  --color-link: var(--color-brand);
  --color-highlight: var(--color-brand);
  --color-border: rgba(31, 21, 35, 0.12);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-fg);
  line-height: var(--line-height-base);
  font-size: 16px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--color-link); text-decoration: none; transition: color 0.2s ease; }
a:hover { opacity: 0.85; }
ul, ol { padding-left: 1.2em; margin: 0; }
li { margin-bottom: 0.5em; }

/* ================= 布局容器 ================= */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}
.section {
  padding-block: var(--section-y);
  border-bottom: 1px solid var(--color-border);
}
.section:last-child { border-bottom: none; }
.section-inner {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* ================= 排版层级 ================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-link);
  margin-bottom: 0.5em;
}
.badge::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
}
h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0.4em 0;
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500;
  line-height: 1.25;
  margin: 0 0 0.6em;
  text-wrap: balance;
}
h3 {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 600;
  line-height: 1.3;
  margin: 1.2em 0 0.5em;
}
p { margin: 0; max-width: 38em; }
.hl { color: var(--color-highlight); font-weight: 600; }

/* ================= 组件：按钮 ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  height: 52px;
  padding: 0 1.4em;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.btn-primary {
  background: var(--color-accent);
  color: var(--color-deep);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(110, 237, 168, 0.35); }
.btn-secondary {
  background: transparent;
  color: var(--color-fg);
  border-color: var(--color-fg);
}
.btn-secondary:hover { background: rgba(31, 21, 35, 0.06); }
.dark-face .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }
.dark-face .btn-secondary:hover { background: rgba(246, 243, 247, 0.1); }

/* ================= 组件：卡片与面板 ================= */
.card {
  background: var(--color-bg);
  border: var(--card-border) solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  transition: box-shadow 0.2s ease;
}
.card:hover { box-shadow: 0 14px 32px -12px rgba(31, 21, 35, 0.38); }
.panel-dark {
  background: var(--color-deep);
  border-radius: var(--radius-card);
  padding: var(--gap);
  position: relative;
  overflow: hidden;
}

/* ================= 组件：表格 ================= */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
th, td {
  padding: 0.9em 1.2em;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}
th { font-weight: 600; background: rgba(31, 21, 35, 0.04); }
td a { word-break: break-all; }
tr:last-child td { border-bottom: none; }

/* ================= 组件：FAQ ================= */
details {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  margin-bottom: 0.8em;
  overflow: hidden;
}
summary {
  padding: 1em 1.2em;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(31, 21, 35, 0.02);
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  font-weight: 400;
  font-size: 1.2em;
  transition: transform 0.2s ease;
}
details[open] summary::after { transform: rotate(45deg); }
details p { padding: 1em 1.2em; margin: 0; color: var(--color-fg); opacity: 0.9; }

/* ================= 组件：时间轴 ================= */
.timeline {
  position: relative;
  padding-left: 1.5em;
  border-left: 2px solid var(--color-border);
}
.timeline-item {
  position: relative;
  margin-bottom: 1.8em;
  padding-left: 1em;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.75em;
  top: 0.4em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-brand);
  border: 2px solid var(--color-bg);
}
.timeline-time {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-highlight);
  margin-bottom: 0.2em;
}

/* ================= 组件：步骤徽标 ================= */
.step-list { counter-reset: step; }
.step-list li {
  counter-increment: step;
  list-style: none;
  position: relative;
  padding-left: 2.8em;
  margin-bottom: 1.2em;
}
.step-list li::before {
  content: "0" counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  background: var(--color-accent);
  color: var(--color-deep);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ================= SVG 通用 ================= */
.svg-container {
  width: 100%;
  height: auto;
}
.svg-panel {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 4 / 3;
  margin-inline: auto;
}

/* ================= SVG 动效关键帧 ================= */
@keyframes grid-light {
  0%, 100% { opacity: 0.15; }
  15% { opacity: 1; }
  30% { opacity: 0.15; }
}
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
@keyframes slide-in {
  0% { transform: translateX(20px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}
@keyframes dash-flow {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}

.anim-grid-light { animation: grid-light 4s ease-in-out infinite; }
.anim-grid-light:nth-child(2n) { animation-delay: 0.4s; }
.anim-grid-light:nth-child(3n) { animation-delay: 0.8s; }
.anim-grid-light:nth-child(5n) { animation-delay: 1.2s; }
.anim-float { animation: float-y 5s ease-in-out infinite; }
.anim-breathe { animation: breathe 3s ease-in-out infinite; }
.anim-slide-in { animation: slide-in 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
.anim-draw { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: dash-flow 2s linear infinite; }

/* 子元素旋转/缩放中心 */
svg .anim-sub {
  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;
    animation-delay: 0ms !important;
  }
}

/* ================= 响应式调整 ================= */
@media (min-width: 768px) {
  .split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: var(--gap);
  }
  .split-layout.reverse .panel-wrap { order: -1; }
  .features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: var(--gap);
  }
  .news-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
  @media (min-width: 960px) {
    .news-grid { grid-template-columns: repeat(3, 1fr); }
  }
}
@media (max-width: 767px) {
  .news-grid { grid-template-columns: 1fr; }
}
