/* =========================================
   1. 设计变量与全局重置
   ========================================= */
:root {
  /* 色板 */
  --color-dark-bg: #19102D;
  --color-paper: #F4F3F7;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #D66EED;

  /* 结构性 Token */
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 0;
  --card-shadow: none;
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1280px;

  /* 字体与排版 */
  --font-sans: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --line-height-base: 1.75;
  --line-height-tight: 1.15;
}

*, *::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);
  font-size: 16px;
  line-height: var(--line-height-base);
  color: var(--color-text);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
}

/* =========================================
   2. 布局与容器
   ========================================= */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}

.section {
  padding-block: var(--section-y);
  position: relative;
}

.section-divider {
  border-top: 1px solid rgba(25, 21, 35, 0.1);
  margin-inline: auto;
  max-width: calc(var(--content-max) - 2 * var(--gap));
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr));
  gap: var(--gap);
}

.flex-col {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* =========================================
   3. 排版系统
   ========================================= */
h1, h2, h3, h4 {
  font-weight: 500;
  line-height: var(--line-height-tight);
  letter-spacing: -0.02em;
  color: var(--color-text);
}

h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
}

h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  margin-bottom: var(--gap);
}

h3 {
  font-size: clamp(1.3rem, 2vw, 1.6rem);
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1.5rem;
  max-width: 38em;
}

.text-accent {
  color: var(--color-accent);
}

.text-brand {
  color: var(--color-brand);
}

/* 眉标 */
.milestone {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.milestone.dark {
  color: var(--color-accent);
}

.milestone.light {
  color: var(--color-brand);
}

.milestone::before {
  content: "";
  display: block;
  width: 16px;
  height: 2px;
  background-color: currentColor;
}

/* 高亮关键词 */
.hl {
  color: var(--color-brand);
}

.dark .hl {
  color: var(--color-accent);
}

/* =========================================
   4. 通用组件
   ========================================= */
/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0 1.5rem;
  height: 52px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-btn);
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
  cursor: pointer;
}

.btn:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark-bg);
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-text);
}

.dark .btn-secondary {
  color: var(--color-paper);
  border-color: var(--color-paper);
}

.btn-secondary:hover {
  background-color: rgba(25, 21, 35, 0.05);
}

.dark .btn-secondary:hover {
  background-color: rgba(244, 243, 247, 0.1);
}

.btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

/* 卡片 */
.card {
  background-color: rgba(255, 255, 255, 0.6);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  border-radius: var(--radius-card);
  transition: transform 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
}

.dark .card {
  background-color: rgba(255, 255, 255, 0.05);
}

/* 表格 */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid rgba(25, 21, 35, 0.1);
  border-radius: var(--radius-card);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(25, 21, 35, 0.1);
}

th {
  font-weight: 700;
  background-color: rgba(25, 21, 35, 0.03);
}

tr:last-child td {
  border-bottom: none;
}

/* FAQ */
details {
  border-bottom: 1px solid rgba(25, 21, 35, 0.1);
  padding: 1.5rem 0;
}

summary {
  list-style: none;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  padding-right: 2rem;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 400;
  color: var(--color-brand);
}

details[open] summary::after {
  content: "-";
}

details p {
  margin-top: 1rem;
  color: rgba(25, 21, 35, 0.8);
}

/* 步骤条 */
.step-bar {
  display: flex;
  gap: var(--gap);
  counter-reset: step;
}

.step-item {
  flex: 1;
  position: relative;
  padding-left: 3rem;
}

.step-item::before {
  counter-increment: step;
  content: "0" counter(step);
  position: absolute;
  left: 0;
  top: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-paper);
  background-color: var(--color-accent);
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-card);
}

/* 场景卡片 */
.scene-block {
  border-left: 4px solid var(--color-brand);
  padding-left: 1.5rem;
  margin-bottom: 2rem;
}

.scene-tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background-color: rgba(82, 20, 235, 0.1);
  color: var(--color-brand);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.dark .scene-tag {
  background-color: rgba(214, 110, 237, 0.2);
  color: var(--color-accent);
}

/* =========================================
   5. 页头与页脚
   ========================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-paper);
  border-bottom: 1px solid rgba(25, 21, 35, 0.08);
  backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 800;
  font-size: 1.2rem;
}

.brand img {
  height: 32px;
  width: auto;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

nav a {
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}

nav a:hover, nav a[aria-current="page"] {
  color: var(--color-brand);
}

.site-footer {
  background-color: var(--color-dark-bg);
  color: var(--color-paper);
  padding-block: var(--section-y);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--gap);
}

.footer-grid h4 {
  color: var(--color-accent);
  margin-bottom: 1rem;
  font-size: 1rem;
}

.footer-grid ul {
  list-style: none;
}

.footer-grid li {
  margin-bottom: 0.75rem;
}

.footer-grid a {
  color: rgba(244, 243, 247, 0.7);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-grid a:hover {
  color: var(--color-accent);
}

.footer-bottom {
  margin-top: var(--gap);
  padding-top: var(--gap);
  border-top: 1px solid rgba(244, 243, 247, 0.1);
  text-align: center;
  font-size: 0.9rem;
  color: rgba(244, 243, 247, 0.5);
}

/* =========================================
   6. SVG 动效
   ========================================= */
.svg-flow-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: flowDash 4s linear infinite;
}

.svg-dot {
  fill: var(--color-accent);
  animation: dotMove 6s ease-in-out infinite alternate;
}

@keyframes flowDash {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes dotMove {
  0% {
    transform: translate(0, 0);
    opacity: 0.3;
  }
  100% {
    transform: translate(15px, -10px);
    opacity: 1;
  }
}

/* 减少动态效果偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .svg-flow-line, .svg-dot {
    animation: none;
  }
}

/* =========================================
   7. 响应式调整
   ========================================= */
@media (max-width: 768px) {
  .step-bar {
    flex-direction: column;
  }
  .step-item {
    padding-left: 0;
    padding-top: 3rem;
  }
  .step-item::before {
    top: 0;
    left: 0;
  }
  nav ul {
    display: none; /* 移动端简化处理，仅保留主按钮 */
  }
  h1 {
    font-size: clamp(2rem, 8vw, 3rem);
  }
}
