/* ==================== 基础变量与设计系统 ==================== */
:root {
  /* 色板 */
  --color-bg-paper: #FCFCFD;
  --color-bg-dark: #17203F;
  --color-text-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: 960px;
  
  /* 字体 */
  --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
}

/* ==================== 面主题切换 ==================== */
.surface-paper {
  --color-bg-surface: var(--color-bg-paper);
  --color-text-body: var(--color-text-body);
  --color-text-accent: var(--color-brand);
  --color-link: var(--color-brand);
  --color-link-hover: #0f32c4;
}

.surface-dark {
  --color-bg-surface: var(--color-bg-dark);
  --color-text-body: var(--color-bg-paper);
  --color-text-accent: var(--color-accent);
  --color-link: var(--color-accent);
  --color-link-hover: #5bd8aa;
}

.card-light {
  --color-bg-surface: var(--color-bg-paper);
  --color-text-body: var(--color-text-body);
  --color-text-accent: var(--color-brand);
  --color-link: var(--color-brand);
  --color-link-hover: #0f32c4;
  --card-shadow: 0 2px 12px rgba(21, 24, 35, 0.15);
}

/* ==================== 全局排版与重置 ==================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.75;
  color: var(--color-text-body);
  background: var(--color-bg-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--color-link); transition: color 0.2s ease; }
a:hover { color: var(--color-link-hover); text-decoration: underline; }

.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

section {
  padding-block: var(--section-y);
  background: var(--color-bg-surface);
}

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
  color: var(--color-text-body);
}
h1 { font-size: clamp(2rem, 4.2vw, 3rem); margin-bottom: 1.2em; text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 0.8em; }
h3 { font-size: 1.25rem; margin-bottom: 0.5em; }
p { margin-bottom: 1em; max-width: 38em; }
ul, ol { margin-bottom: 1em; padding-left: 1.5em; }
li { margin-bottom: 0.5em; }

.hl { color: var(--color-text-accent); }

/* ==================== 组件：按钮 ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  height: 48px;
  padding-inline: 1.25em;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  border: none;
}
.btn:focus-visible { outline: 2px solid var(--color-text-accent); outline-offset: 2px; }
.btn-primary {
  background: var(--color-accent);
  color: var(--color-bg-dark);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(110, 237, 189, 0.35); }
.btn-secondary {
  background: transparent;
  border: 1px solid var(--color-text-body);
  color: var(--color-text-body);
}
.btn-secondary:hover { background: rgba(21, 24, 35, 0.05); }
.surface-dark .btn-secondary { border-color: var(--color-bg-paper); color: var(--color-bg-paper); }
.surface-dark .btn-secondary:hover { background: rgba(252, 252, 253, 0.1); }

/* ==================== 组件：卡片与面板 ==================== */
.card {
  background: var(--color-bg-surface);
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 14px 32px -12px rgba(21, 24, 35, 0.35); }

.panel-dark {
  background: var(--color-bg-dark);
  border-radius: 12px;
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

/* ==================== 组件：表格 ==================== */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.data-table th, .data-table td {
  padding: 0.75em 1em;
  text-align: left;
  border-bottom: 1px solid rgba(21, 24, 35, 0.1);
}
.surface-dark .data-table th, .surface-dark .data-table td { border-bottom-color: rgba(252, 252, 253, 0.1); }
.data-table th { font-weight: 600; color: var(--color-text-accent); }
.data-table tr:last-child td { border-bottom: none; }

/* ==================== 组件：FAQ (details/summary) ==================== */
.faq-item {
  border-bottom: 1px solid rgba(21, 24, 35, 0.1);
  padding: 1em 0;
}
.surface-dark .faq-item { border-bottom-color: rgba(252, 252, 253, 0.1); }
.faq-item summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 2em;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 0;
  font-weight: 400;
  color: var(--color-text-accent);
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { margin-top: 0.5em; margin-bottom: 0; color: var(--color-text-body); }

/* ==================== 组件：眉标与徽标 ==================== */
.badge-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--color-text-accent);
  margin-bottom: 0.5em;
}
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--color-accent);
  color: var(--color-bg-dark);
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 6px;
  flex-shrink: 0;
}

/* ==================== 布局辅助 ==================== */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.flex-row { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: center; }
.text-center { text-align: center; }
.mt-sm { margin-top: 1em; }
.mb-md { margin-bottom: 1.5em; }

/* ==================== 页头与页脚 ==================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(252, 252, 253, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(21, 24, 35, 0.08);
  padding: 0.75em 0;
}
.surface-dark .site-header { background: rgba(23, 32, 63, 0.9); border-bottom-color: rgba(252, 252, 253, 0.08); }
.header-inner { display: flex; justify-content: space-between; align-items: center; }
.nav-links { display: flex; gap: 1.5em; align-items: center; }
.nav-links a { font-weight: 500; font-size: 0.95rem; }
.nav-links a[aria-current="page"], .nav-links a:hover { color: var(--color-text-accent); text-decoration: none; }
.footer {
  padding: 3em 0;
  border-top: 1px solid rgba(21, 24, 35, 0.08);
  text-align: center;
  font-size: 0.9rem;
  color: var(--color-text-body);
  opacity: 0.85;
}
.surface-dark .footer { border-top-color: rgba(252, 252, 253, 0.08); }

/* ==================== SVG 动效系统 ==================== */
svg.animated { width: 100%; height: auto; overflow: visible; }
svg.animated path, svg.animated circle, svg.animated rect, svg.animated polyline {
  vector-effect: non-scaling-stroke;
}
.draw-line {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawPath 4s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}
.float-bubble {
  animation: floatY 5s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.pulse-dot {
  animation: pulseOpacity 3s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.slide-panel {
  animation: slideIn 6s ease-in-out infinite alternate;
  transform-box: fill-box;
  transform-origin: center;
}
.flow-dot {
  animation: flowAlong 6s linear infinite;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes drawPath { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes pulseOpacity { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }
@keyframes slideIn { from { transform: translateX(12px); opacity: 0.7; } to { transform: translateX(0); opacity: 1; } }
@keyframes flowAlong { 
  0% { offset-distance: 0%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .draw-line, .float-bubble, .pulse-dot, .slide-panel, .flow-dot { animation: none !important; }
}
/* factory-contrast-width */
@media (min-width: 1440px) {
  [data-fc-1440="paper"] {
    color: #fcfcfd !important;
    -webkit-text-fill-color: #fcfcfd !important;
  }
}
@media (min-width: 1440px) {
  [data-fc-1440="paper"] {
    color: #fcfcfd !important;
    -webkit-text-fill-color: #fcfcfd !important;
  }
}
@media (min-width: 1440px) {
  [data-fc-1440="paper"] {
    color: #fcfcfd !important;
    -webkit-text-fill-color: #fcfcfd !important;
  }
}
@media (min-width: 1440px) {
  [data-fc-1440="paper"] {
    color: #fcfcfd !important;
    -webkit-text-fill-color: #fcfcfd !important;
  }
}
