/* === 设计 Token & 变量 === */
:root {
  /* 色板 */
  --color-dark-bg: #271334;
  --color-paper: #E9E8EA;
  --color-text: #1D1523;
  --color-brand: #8A13DD;
  --color-accent: #9EED6E;

  /* 圆角 */
  --radius-card: 20px;
  --radius-btn: 12px;

  /* 卡片边界 */
  --card-border: 2px solid var(--color-text);
  --card-shadow: 4px 4px 0 var(--color-text);

  /* 节奏与密度 */
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --line-height: 1.65;

  /* 内容最大宽度 */
  --content-max: 960px;

  /* 字体 */
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
}

/* === 基础排版 === */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  background-color: var(--color-paper);
  color: var(--color-text);
  line-height: var(--line-height);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }

/* 容器 */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* 标题系统 */
.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  color: var(--color-brand);
}
.dark-section .section-label { color: var(--color-accent); }

h1 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
  margin: 0.5rem 0 1rem;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 var(--gap);
}
h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 0.5rem;
}

/* 关键字高亮 */
.hl {
  color: var(--color-brand);
}
.dark-section .hl {
  color: var(--color-accent);
}

/* 按钮 */
.btn-group { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 48px;
  padding: 0 1.5rem;
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius-btn);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark-bg);
  border: none;
}
.btn-primary:hover { opacity: 0.9; }

.btn-secondary {
  background-color: transparent;
  color: var(--color-text);
  border: 2px solid var(--color-text);
}
.dark-section .btn-secondary {
  color: var(--color-paper);
  border-color: var(--color-paper);
}

/* 图标 SVG */
.icon-svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  flex-shrink: 0;
}

/* 区块通用 */
section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}
.dark-section {
  background-color: var(--color-dark-bg);
  color: var(--color-paper);
}

/* 卡片 (粗描边硬阴影) */
.card {
  background-color: var(--color-paper);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: 1.5rem;
}
.dark-section .card {
  /* 深色面上的浅色卡片恢复纸面取色 */
  background-color: var(--color-paper);
  color: var(--color-text);
  border-color: var(--color-text);
  box-shadow: 4px 4px 0 var(--color-text);
}

/* 网格布局 */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: var(--gap);
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: var(--gap);
}

/* 表格 */
.table-wrapper { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}
th, td {
  text-align: left;
  padding: 1rem;
  border-bottom: 2px solid var(--color-text);
}
.dark-section th, .dark-section td {
  border-bottom-color: var(--color-paper);
}
td:first-child { font-weight: 600; width: 40%; }

/* FAQ Details */
details {
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: 1rem 1.5rem;
  margin-bottom: var(--gap);
  background-color: var(--color-paper);
  cursor: pointer;
}
.dark-section details {
  background-color: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.2);
}
summary {
  list-style: none;
  font-weight: 600;
  position: relative;
  padding-right: 2rem;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 0;
  font-size: 1.5rem;
  line-height: 1;
}
details[open] summary::after { content: "-"; }
details > div { padding-top: 0.5rem; }

/* 页头页脚 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(233, 232, 234, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(29, 21, 35, 0.1);
}
.dark-section .site-header { background-color: rgba(39, 19, 52, 0.9); border-bottom-color: rgba(255,255,255,0.1); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo img { height: 32px; width: auto; }
nav ul { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
nav a { font-weight: 500; font-size: 0.95rem; }
nav a:hover { text-decoration: underline; }
nav a[aria-current="page"] { font-weight: 700; color: var(--color-brand); }
.dark-section nav a[aria-current="page"] { color: var(--color-accent); }

.site-footer {
  padding: 3rem 0;
  background-color: var(--color-dark-bg);
  color: var(--color-paper);
  font-size: 0.9rem;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-links { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }

/* 特殊组件 */
.timeline-step {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.step-number {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background-color: var(--color-accent);
  color: var(--color-dark-bg);
  font-weight: 800;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}
.dark-section .step-number { background-color: var(--color-accent); color: var(--color-dark-bg); }

.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: center;
}
.feature-row.reverse { direction: rtl; }
.feature-row.reverse > * { direction: ltr; }
.feature-panel {
  background-color: var(--color-dark-bg);
  border-radius: var(--radius-card);
  padding: 2rem;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === SVG 动效 === */
svg {
  width: 100%;
  height: auto;
  max-width: 100%;
}

/* 线条自绘 */
.draw-line {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLine 3s ease-in-out infinite;
}
@keyframes drawLine {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 0; }
}

/* 缓慢呼吸 */
.breath {
  animation: breathAnim 4s ease-in-out infinite;
}
@keyframes breathAnim {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.02); }
}

/* 浮动 */
.float-slow {
  animation: floatAnim 6s ease-in-out infinite;
}
@keyframes floatAnim {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* 滑入 */
.slide-in {
  animation: slideInAnim 4s ease-in-out infinite;
}
@keyframes slideInAnim {
  0%, 10% { transform: translateX(0); opacity: 0; }
  20%, 80% { transform: translateX(0); opacity: 1; }
  90%, 100% { transform: translateX(20px); opacity: 0; }
}

/* 减少动态效果 */
@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) {
  .feature-row, .feature-row.reverse {
    grid-template-columns: 1fr;
    direction: ltr;
  }
  .header-inner nav { display: none; } /* 简化移动端，仅保留 logo 和按钮 */
  .header-inner .mobile-menu-btn { display: block; } /* 实际项目中可加 JS 实现菜单 */
  .btn-group { flex-direction: column; }
  .btn { width: 100%; }
}
