/* 设计变量与基础重置 */
:root {
  --dark-bg: #1B1231;
  --paper-bg: #F4F3F7;
  --body-text: #191523;
  --brand-color: #5214EB;
  --accent-color: #9977EE;
  --text-on-dark: #F4F3F7;
  --text-on-paper: #191523;

  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 2px solid var(--body-text);
  --card-shadow: 4px 4px 0 var(--body-text);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 960px;

  --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

*, *::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.65;
  color: var(--body-text);
  background: var(--paper-bg);
  -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; }

/* 排版系统 */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}
.section { padding: var(--section-y) 0; }
.section-dark { background: var(--dark-bg); color: var(--text-on-dark); }
.section-paper { background: var(--paper-bg); color: var(--text-on-paper); }

h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: var(--gap); text-wrap: balance; }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); margin-bottom: 0.5em; }
p { margin-bottom: 1em; max-width: 38em; }
.text-hl { color: var(--brand-color); }
.section-dark .text-hl { color: var(--accent-color); }

/* 眉标 */
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75em;
  color: var(--brand-color);
}
.section-dark .eyebrow { color: var(--accent-color); }

/* 导航与页头 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(244, 243, 247, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  transition: background 0.2s;
}
.section-dark ~ .site-header { background: rgba(27, 18, 49, 0.95); border-bottom-color: rgba(255,255,255,0.1); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-link { font-weight: 500; font-size: 0.95rem; position: relative; }
.nav-link[aria-current="page"] { color: var(--brand-color); font-weight: 700; }
.section-dark .nav-link { color: var(--text-on-dark); }
.section-dark .nav-link[aria-current="page"] { color: var(--accent-color); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 48px;
  padding: 0 1.5rem;
  border-radius: var(--radius-btn);
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, filter 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 2px; }
.btn-primary {
  background: var(--accent-color);
  color: var(--dark-bg);
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-secondary {
  background: transparent;
  border: 2px solid var(--body-text);
  color: var(--body-text);
}
.section-dark .btn-secondary {
  border-color: var(--text-on-dark);
  color: var(--text-on-dark);
}
.btn-icon { width: 20px; height: 20px; stroke-width: 2; }

/* 卡片与面板 */
.card {
  background: var(--paper-bg);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
}
.panel {
  background: var(--dark-bg);
  border-radius: 20px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}
.section-dark .panel { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); }

/* 表格 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  min-width: 500px;
}
th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}
.section-dark th, .section-dark td { border-bottom-color: rgba(255,255,255,0.15); }
th { font-weight: 600; }
td strong { font-weight: 700; }

/* FAQ */
.faq-item {
  border-bottom: 1px solid rgba(0,0,0,0.1);
  padding: 1rem 0;
}
.section-dark .faq-item { border-bottom-color: rgba(255,255,255,0.15); }
summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.2rem; font-weight: 400; }
details[open] summary::after { content: "−"; }
.faq-answer { padding-top: 0.75rem; color: inherit; opacity: 0.9; }

/* 步骤徽标 */
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--accent-color);
  color: var(--dark-bg);
  font-weight: 700;
  border-radius: 8px;
  margin-right: 0.75rem;
  flex-shrink: 0;
}
.step-list { counter-reset: step; }
.step-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.step-list li::before { content: counter(step); counter-increment: step; display: none; }

/* SVG 通用容器 */
.svg-container {
  width: 100%;
  height: auto;
  display: block;
}
.svg-container svg {
  width: 100%;
  height: auto;
}

/* SVG 动效定义 */
.grid-dot {
  fill: var(--accent-color);
  opacity: 0.25;
  animation: nodeLight 6s ease-in-out infinite;
}
.node-line {
  stroke: var(--accent-color);
  stroke-width: 2;
  fill: none;
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: dashFlow 4s linear infinite;
}
.bubble {
  animation: floatBubble 5s ease-in-out infinite;
}
.input-dots circle {
  fill: var(--accent-color);
  animation: breathe 2s ease-in-out infinite;
}
.input-dots circle:nth-child(2) { animation-delay: 0.3s; }
.input-dots circle:nth-child(3) { animation-delay: 0.6s; }

@keyframes nodeLight {
  0%, 100% { opacity: 0.25; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}
@keyframes dashFlow {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes floatBubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.3; r: 2; }
  50% { opacity: 1; r: 3.5; }
}

/* 减少动态效果 */
@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;
  }
}

/* 响应式布局 */
@media (max-width: 768px) {
  .two-col { flex-direction: column; }
  .three-col { grid-template-columns: 1fr; }
  h1 { font-size: clamp(2rem, 8vw, 3rem); }
  .container { padding: 0 1rem; }
}
@media (min-width: 769px) {
  .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: center; }
  .three-col { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
  .flex-row { display: flex; gap: var(--gap); align-items: center; }
  .flex-row.reverse { flex-direction: row-reverse; }
}
.long-text { min-width: 0; overflow-wrap: anywhere; }
