/* ================= 设计变量 ================= */
:root {
  --color-dark: #17203F;
  --color-paper: #FCFCFD;
  --color-body: #151823;
  --color-brand: #1441EB;
  --color-accent: #6EEDBD;
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(21, 24, 35, 0.3);
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1280px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --text-h1: clamp(2.6rem, 6.4vw, 5rem);
  --text-h2: clamp(1.8rem, 3.5vw, 2.8rem);
  --text-body: 1rem;
  --line-body: 1.75;
}

/* ================= 基础重置 ================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--line-body);
  color: var(--color-body);
  background: var(--color-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; }

/* ================= 布局系统 ================= */
.site-layout {
  display: flex;
  min-height: 100vh;
}
.sidebar-nav {
  width: 240px;
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--color-dark);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2rem 1.5rem;
  z-index: 10;
}
.top-nav {
  display: none;
  position: sticky;
  top: 0;
  background: var(--color-paper);
  border-bottom: 1px solid rgba(21, 24, 35, 0.08);
  padding: 0.75rem 1.5rem;
  z-index: 20;
  align-items: center;
  gap: 1rem;
}
.page-content {
  flex: 1;
  overflow-x: hidden;
}
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}
.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}
.section.dark {
  background: var(--color-dark);
  color: var(--color-paper);
}
.section.dark .hl { color: var(--color-accent); }
.section.paper {
  background: var(--color-paper);
  color: var(--color-body);
}
.section.paper .hl { color: var(--color-brand); }

/* ================= 导航与品牌 ================= */
.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-paper);
}
.brand-link img { width: 28px; height: 28px; object-fit: contain; }
.nav-list { display: flex; flex-direction: column; gap: 0.5rem; }
.sidebar-nav .nav-list a {
  color: #fcfcfd;
}
.nav-list a {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-btn);
  font-size: 0.9rem;
  opacity: 0.85;
  transition: opacity 0.2s, background 0.2s;
}
.nav-list a:hover, .nav-list a[aria-current="page"] {
  opacity: 1;
  background: rgba(255,255,255,0.08);
}
.top-nav .brand-link { color: var(--color-body); }
.top-nav .nav-links { margin-left: auto; display: flex; gap: 1rem; font-size: 0.9rem; }
.top-nav .btn-sm { font-size: 0.85rem; padding: 0.5rem 1rem; }

/* ================= 排版组件 ================= */
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  background: rgba(20, 65, 235, 0.08);
  color: var(--color-brand);
}
.section.dark .badge {
  background: rgba(110, 237, 189, 0.12);
  color: var(--color-accent);
}
h1 {
  font-size: var(--text-h1);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  text-wrap: balance;
}
h2 {
  font-size: var(--text-h2);
  font-weight: 500;
  line-height: 1.25;
  margin-bottom: 1rem;
  text-wrap: balance;
}
h3 {
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 1.5rem 0 0.75rem;
}
p { margin-bottom: 1rem; max-width: 38em; }
.hl { font-weight: 600; }

/* ================= 按钮 ================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 48px;
  padding: 0 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s, box-shadow 0.2s;
  border: none;
}
.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 { transform: translateY(-1px); background: #5bd9aa; }
.btn-secondary {
  background: transparent;
  border: 1px solid var(--color-body);
  color: var(--color-body);
}
.section.dark .btn-secondary {
  border-color: var(--color-paper);
  color: var(--color-paper);
}
.btn-secondary:hover { background: rgba(21, 24, 35, 0.05); }
.section.dark .btn-secondary:hover { background: rgba(252, 252, 253, 0.08); }
.btn-icon { width: 20px; height: 20px; stroke-width: 1.8; }

/* ================= 卡片与面板 ================= */
.card {
  background: var(--color-paper);
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 1.5rem;
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: 0 14px 32px -12px rgba(21, 24, 35, 0.35); }
.panel {
  background: var(--color-dark);
  border-radius: 12px;
  padding: 1.5rem;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.section.paper .panel { background: #f4f6fa; }

/* ================= 表格 ================= */
.table-wrap { overflow-x: auto; margin: 1.5rem 0; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(21, 24, 35, 0.08);
}
th { font-weight: 600; background: rgba(21, 24, 35, 0.03); }
td a { color: var(--color-brand); text-decoration: underline; text-underline-offset: 2px; }
.section.dark td a { color: var(--color-accent); }

/* ================= FAQ ================= */
details {
  border: 1px solid rgba(21, 24, 35, 0.1);
  border-radius: var(--radius-card);
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.summary {
  padding: 1rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  background: rgba(21, 24, 35, 0.02);
  user-select: none;
}
.details-content { padding: 1rem 1.25rem; line-height: 1.7; }
details[open] .summary { border-bottom: 1px solid rgba(21, 24, 35, 0.08); }

/* ================= 流程条 ================= */
.flow-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin: 1.5rem 0;
}
.flow-node {
  flex: 1;
  min-width: 180px;
  background: rgba(21, 24, 35, 0.03);
  padding: 1rem;
  border-radius: var(--radius-card);
  text-align: center;
  font-weight: 500;
}
.arrow { font-size: 1.2rem; opacity: 0.5; }

/* ================= SVG 动效 ================= */
.svg-scene { width: 100%; height: auto; max-width: 100%; }
.geo-shape {
  transform-box: fill-box;
  transform-origin: center;
}
.shape-a { animation: geo-spin 8s linear infinite; }
.shape-b { animation: geo-spin 12s linear infinite reverse; }
.shape-c { animation: geo-sync 6s ease-in-out infinite; }
.path-draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-cycle 4s ease-in-out infinite;
}
.bubble-appear {
  opacity: 0.6;
  animation: float-bubble 5s ease-in-out infinite;
}
.notif-slide {
  transform: translateY(0);
  animation: slide-in 6s ease-in-out infinite;
}
@keyframes geo-spin {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.05); }
}
@keyframes geo-sync {
  0%, 100% { transform: rotate(0deg) translateX(0); }
  50% { transform: rotate(90deg) translateX(8px); }
}
@keyframes draw-cycle {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}
@keyframes float-bubble {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(-6px); opacity: 0.9; }
}
@keyframes slide-in {
  0%, 100% { transform: translateY(0); opacity: 1; }
  20% { transform: translateY(-4px); opacity: 1; }
  40% { transform: translateY(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ================= 响应式 ================= */
@media (max-width: 900px) {
  .site-layout { flex-direction: column; }
  .sidebar-nav { display: none; }
  .top-nav { display: flex; }
  h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); }
  .panel { aspect-ratio: 16/10; }
}
@media (min-width: 901px) {
  .top-nav { display: none !important; }
}
/* factory-contrast-width */
@media (min-width: 1440px) {
  [data-fc-1440="paper"] {
    color: #fcfcfd !important;
    -webkit-text-fill-color: #fcfcfd !important;
  }
}
