:root {
  --color-dark: #140E25;
  --color-paper: #F5F0E5;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #C8ED6E;
  --color-text-light: var(--color-paper);

  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 1px solid rgba(25, 21, 35, 0.16);
  --card-shadow: none;
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 960px;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --line-height-base: 1.75;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--color-paper);
  color: var(--color-text);
  line-height: var(--line-height-base);
  font-size: 16px;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* 容器与布局 */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section {
  padding: var(--section-y) 0;
  position: relative;
}

.section-divider {
  border-top: 1px solid rgba(25, 21, 35, 0.12);
  margin: 0;
}

/* 背景主题与取色变量 */
.bg-dark {
  background: var(--color-dark);
  color: var(--color-text-light);
}
.bg-paper {
  background: var(--color-paper);
  color: var(--color-text);
}

.bg-dark .hl, .bg-dark .eyebrow { color: var(--color-accent); }
.bg-paper .hl, .bg-paper .eyebrow { color: var(--color-brand); }
.bg-dark a:not(.btn) { color: var(--color-accent); }
.bg-paper a:not(.btn) { color: var(--color-brand); }

/* 卡片继承修正 */
.card {
  background: var(--color-bg, var(--color-paper));
  color: var(--color-fg, var(--color-text));
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: var(--gap);
}
.bg-dark .card {
  --color-bg: var(--color-paper);
  --color-fg: var(--color-text);
  --color-border: var(--card-border);
  border-color: var(--card-border);
}

/* 排版 */
h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  margin-bottom: 0.5rem;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1rem;
  max-width: 38em;
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  display: block;
}

.lead {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  max-width: 42em;
}

.text-sm {
  font-size: 0.9rem;
  opacity: 0.85;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  border: none;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover {
  background: #b8dc5e;
}

.btn-secondary {
  background: transparent;
  border: 1px solid currentColor;
}
.bg-paper .btn-secondary {
  color: var(--color-text);
  border-color: var(--color-text);
}
.bg-dark .btn-secondary {
  color: var(--color-text-light);
  border-color: var(--color-text-light);
}
.bg-paper .btn-secondary:hover {
  background: rgba(25, 21, 35, 0.05);
}
.bg-dark .btn-secondary:hover {
  background: rgba(245, 240, 229, 0.08);
}

/* 网格系统 */
.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)); }

/* 头部与导航 */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-paper);
  border-bottom: 1px solid rgba(25, 21, 35, 0.12);
  padding: 1rem 0;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
header.scrolled {
  background: rgba(245, 240, 229, 0.95);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 rgba(25, 21, 35, 0.08);
}
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-text);
}
.logo img {
  height: 32px;
  width: auto;
}
nav ul {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}
nav a {
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
}
nav a:hover {
  opacity: 0.8;
}
nav a[aria-current="page"] {
  color: var(--color-brand);
  font-weight: 700;
}

/* 页脚 */
footer {
  background: var(--color-dark);
  color: var(--color-text-light);
  padding: var(--section-y) 0 2rem;
  margin-top: var(--section-y);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
  margin-bottom: var(--gap);
}
.footer-col h4 {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.8rem;
  color: var(--color-accent);
}
.footer-col a {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  opacity: 0.85;
}
.footer-col a:hover {
  opacity: 1;
  text-decoration: underline;
}
.footer-bottom {
  border-top: 1px solid rgba(245, 240, 229, 0.12);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.7;
}

/* 组件：特性列表 */
.feature-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}
.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  background: var(--color-brand);
  border-radius: 50%;
}
.bg-dark .feature-list li::before {
  background: var(--color-accent);
}

/* 组件：时间线 */
.timeline {
  border-left: 2px solid rgba(25, 21, 35, 0.12);
  padding-left: 1.5rem;
  margin-left: 0.5rem;
}
.bg-dark .timeline {
  border-left-color: rgba(245, 240, 229, 0.15);
}
.timeline-step {
  position: relative;
  margin-bottom: 2rem;
}
.timeline-step:last-child {
  margin-bottom: 0;
}
.step-badge {
  position: absolute;
  left: -1.8rem;
  top: 0;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--color-accent);
  color: var(--color-dark);
  border-radius: var(--radius-btn);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

/* 组件：表格 */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.95rem;
}
th, td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(25, 21, 35, 0.12);
}
th {
  font-weight: 600;
  background: rgba(25, 21, 35, 0.03);
}
.bg-dark table th {
  background: rgba(245, 240, 229, 0.05);
  border-bottom-color: rgba(245, 240, 229, 0.12);
}

/* 组件：FAQ */
details {
  margin-bottom: 0.5rem;
}
summary {
  cursor: pointer;
  font-weight: 600;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(25, 21, 35, 0.12);
  list-style: none;
  position: relative;
  padding-right: 2rem;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 1rem;
  font-weight: 400;
  opacity: 0.6;
}
details[open] summary::after { content: "-"; }
details p {
  padding: 0.75rem 0 1rem;
  line-height: 1.7;
  opacity: 0.9;
}

/* 组件：资讯卡片 */
.news-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.news-meta {
  font-size: 0.8rem;
  opacity: 0.7;
  margin-bottom: 0.5rem;
}
.news-card p {
  font-size: 0.95rem;
  flex-grow: 1;
}

/* 组件：流程条 */
.flow-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}
.flow-node {
  background: rgba(25, 21, 35, 0.05);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}
.bg-dark .flow-node {
  background: rgba(245, 240, 229, 0.08);
}
.flow-arrow {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  opacity: 0.5;
}

/* SVG 基础与动效 */
.svg-panel {
  width: 100%;
  height: auto;
  max-width: 100%;
}
.svg-panel svg {
  width: 100%;
  height: auto;
}
.anim-flow {
  animation: flowDash 4s linear infinite;
}
.anim-float {
  animation: floatY 6s ease-in-out infinite;
}
.anim-pulse {
  animation: pulseScale 3s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.anim-slide {
  animation: slideRight 0.8s ease-out forwards;
}
@keyframes flowDash {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes pulseScale {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
}
@keyframes slideRight {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .anim-flow, .anim-float, .anim-pulse, .anim-slide {
    animation: none !important;
  }
}

/* 响应式微调 */
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .nav { flex-wrap: wrap; gap: 1rem; }
  nav ul { gap: 1rem; }
  .flow-bar { flex-direction: column; align-items: flex-start; }
  .flow-arrow { transform: rotate(90deg); }
}
