/* ==================== 设计变量与基础重置 ==================== */
:root {
  /* 色板 */
  --color-dark: #2D1438;
  --color-paper: #F6F3F7;
  --color-text: #1F1523;
  --color-brand: #9E13DD;
  --color-accent: #6EEDA8;

  /* 结构参数 */
  --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: 1120px;

  /* 排版 */
  --font-body: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  --line-height-body: 1.55;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  line-height: var(--line-height-body);
  color: var(--color-text);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ==================== 上下文取色系统 ==================== */
.bg-paper {
  --_bg: var(--color-paper);
  --_text: var(--color-text);
  --_highlight: var(--color-brand);
  --_link: var(--color-brand);
  background: var(--_bg);
  color: var(--_text);
}
.bg-dark {
  --_bg: var(--color-dark);
  --_text: var(--color-paper);
  --_highlight: var(--color-accent);
  --_link: var(--color-accent);
  background: var(--_bg);
  color: var(--_text);
}
.card-light {
  background: var(--color-paper);
  color: var(--color-text);
  --_highlight: var(--color-brand);
  --_link: var(--color-brand);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
}
/* 全局元素统一使用上下文变量 */
h1, h2, h3, h4, p, li, span, a, button {
  color: var(--_text, var(--color-text));
}
a.link-highlight, .hl {
  color: var(--_highlight, var(--color-brand));
}
.section-container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}
section {
  padding-block: var(--section-y);
}

/* ==================== 排版组件 ==================== */
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--_highlight, var(--color-brand));
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}
h1 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
  margin-bottom: var(--gap);
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 600;
  line-height: 1.25;
  margin-top: calc(var(--section-y) * 0.6);
  margin-bottom: var(--gap);
  text-wrap: balance;
}
h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: var(--gap);
}
p {
  margin-bottom: var(--gap);
  max-width: 38em;
  font-size: 1rem;
}
.hero-desc {
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  line-height: 1.6;
  max-width: 36em;
  margin-bottom: var(--gap);
  opacity: 0.9;
}

/* ==================== 导航与页脚 ==================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 243, 247, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(31, 21, 35, 0.08);
}
.bg-dark .site-header {
  background: rgba(45, 20, 56, 0.9);
  border-bottom: 1px solid rgba(246, 243, 247, 0.1);
}
.header-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--_text, var(--color-text));
}
.logo img { height: 32px; width: auto; }
.nav-list { display: flex; gap: var(--gap); align-items: center; }
.nav-link {
  font-weight: 500;
  font-size: 0.95rem;
  padding: 6px 12px;
  border-radius: 8px;
  transition: background 0.2s;
}
.nav-link:hover, .nav-link[aria-current="page"] {
  background: rgba(158, 19, 221, 0.08);
  color: var(--_highlight, var(--color-brand));
}
.site-footer {
  padding-block: var(--section-y);
  border-top: 1px solid rgba(31, 21, 35, 0.08);
  font-size: 0.9rem;
}
.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--gap);
}
.footer-col h4 { font-weight: 600; margin-bottom: 0.5rem; }
.footer-col ul { display: flex; flex-direction: column; gap: 0.4rem; }
.footer-col a { opacity: 0.8; transition: opacity 0.2s; }
.footer-col a:hover { opacity: 1; }

/* ==================== 按钮系统 ==================== */
.btn-group { display: flex; flex-wrap: wrap; gap: 12px; margin-top: var(--gap); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.btn:focus-visible { outline: 3px solid var(--_highlight, var(--color-brand)); outline-offset: 2px; }
.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(110, 237, 168, 0.3); }
.btn-secondary {
  background: transparent;
  border: 2px solid var(--_text, var(--color-text));
  color: var(--_text, var(--color-text));
}
.btn-secondary:hover { background: rgba(31, 21, 35, 0.05); }
.bg-dark .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.bg-dark .btn-secondary:hover { background: rgba(246, 243, 247, 0.1); }

/* ==================== 布局网格与面板 ==================== */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: center;
  margin-bottom: calc(var(--section-y) * 1.5);
}
.feature-row.reverse .feature-text { order: 2; }
.feature-row.reverse .feature-panel { order: 1; }
.feature-panel {
  background: var(--color-dark);
  border-radius: var(--radius-card);
  padding: var(--gap);
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.feature-panel svg { width: 100%; height: 100%; max-height: 320px; }

/* ==================== 表格与列表 ==================== */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-card); box-shadow: var(--card-shadow); }
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-paper);
  color: var(--color-text);
  table-layout: fixed;
}
.data-table th, .data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(31, 21, 35, 0.08);
  word-wrap: break-word;
}
.data-table th { font-weight: 600; background: rgba(31, 21, 35, 0.03); }
.data-table tr:last-child td { border-bottom: none; }
.check-list { display: flex; flex-direction: column; gap: 12px; }
.check-item { display: flex; gap: 12px; align-items: flex-start; }
.check-icon { flex-shrink: 0; width: 20px; height: 20px; stroke: var(--_highlight, var(--color-brand)); margin-top: 2px; }

/* ==================== FAQ 组件 ==================== */
.faq-list { display: flex; flex-direction: column; gap: 12px; }
details {
  background: rgba(31, 21, 35, 0.03);
  border-radius: 12px;
  padding: 16px 20px;
  transition: background 0.2s;
}
details:hover { background: rgba(31, 21, 35, 0.05); }
summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.2rem; font-weight: 400; transition: transform 0.2s; }
details[open] summary::after { transform: rotate(45deg); }
details p { margin-top: 12px; margin-bottom: 0; font-size: 0.95rem; opacity: 0.9; }

/* ==================== 步骤条 ==================== */
.steps-bar {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.step-card {
  flex: 1;
  min-width: 200px;
  background: rgba(31, 21, 35, 0.03);
  border-radius: 12px;
  padding: 20px;
  position: relative;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  border-radius: 8px;
  margin-bottom: 12px;
}

/* ==================== SVG 动效核心 ==================== */
.anim-svg { width: 100%; height: auto; shape-rendering: geometricPrecision; }
.anim-svg path, .anim-svg line, .anim-svg rect, .anim-svg circle {
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* 绘制动画 */
.draw-path {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLoop 6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes drawLoop {
  0% { stroke-dashoffset: 1; }
  20% { stroke-dashoffset: 0; }
  80% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}
/* 呼吸动画 */
.breathe {
  animation: breatheAnim 4s ease-in-out infinite;
}
@keyframes breatheAnim {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
/* 浮动层叠 */
.float-layer {
  animation: floatStack 8s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.float-layer:nth-child(2) { animation-delay: -2s; animation-duration: 9s; }
.float-layer:nth-child(3) { animation-delay: -4s; animation-duration: 7.5s; }
@keyframes floatStack {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
/* 滑入通知 */
.slide-in {
  animation: slideNotif 5s ease-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes slideNotif {
  0%, 10% { transform: translateX(0); opacity: 1; }
  15%, 85% { transform: translateX(15px); opacity: 0; }
  90%, 100% { transform: translateX(0); opacity: 1; }
}

/* ==================== 响应式与无障碍 ==================== */
@media (max-width: 768px) {
  .feature-row { grid-template-columns: 1fr; }
  .feature-row.reverse .feature-text { order: 1; }
  .feature-row.reverse .feature-panel { order: 2; }
  .steps-bar { flex-direction: column; }
  .step-card { min-width: unset; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .nav-list { gap: 8px; }
  .nav-link { font-size: 0.85rem; padding: 4px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .draw-path, .breathe, .float-layer, .slide-in {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
