/* === 基础变量与设计 Token === */
:root {
  /* 色板 */
  --color-dark: #19102D;
  --color-paper: #FCFCFD;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #D66EED;

  /* 结构性约束 */
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 0;
  --card-shadow: none;
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 960px;

  /* 字体与排版 */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  --lh-tight: 1.1;
  --lh-normal: 1.65;
  --lh-body: 1.7;
}

/* === 重置与基础 === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-family: var(--font-sans); font-size: 16px; line-height: var(--lh-normal); color: var(--color-text); background: var(--color-paper); }
body { min-height: 100vh; display: flex; flex-direction: column; 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-inline: auto; padding-inline: var(--gap); }
section { padding-block: var(--section-y); }
.section-inner { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }

/* === 面与取色规则 === */
.surface-paper { background: var(--color-paper); color: var(--color-text); }
.surface-dark { background: var(--color-dark); color: var(--color-paper); }
.surface-dark .hl { color: var(--color-accent); }
.surface-dark .label-tag { color: var(--color-accent); }
.surface-dark .link-accent { color: var(--color-accent); }
.surface-paper .hl { color: var(--color-brand); }
.surface-paper .label-tag { color: var(--color-brand); }
.surface-paper .link-accent { color: var(--color-brand); }

/* 卡片背景区分（无阴影无边框） */
.card-light { background: rgba(0,0,0,0.02); }
.card-dark { background: rgba(255,255,255,0.05); }

/* === 排版层级 === */
.label-tag { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; display: inline-block; margin-bottom: 0.5rem; }
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); font-weight: 800; line-height: var(--lh-tight); letter-spacing: -0.02em; text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 800; line-height: 1.25; letter-spacing: -0.01em; margin-bottom: 0.5rem; }
h3 { font-size: 1.25rem; font-weight: 700; line-height: 1.3; margin-bottom: 0.75rem; }
p { margin-bottom: 1rem; max-width: 38em; }
.text-small { font-size: 0.875rem; opacity: 0.85; }

/* === 组件：按钮 === */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; height: 52px; padding: 0 24px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: transform 0.2s ease, opacity 0.2s ease; }
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-primary:hover { transform: translateY(-2px); opacity: 0.9; }
.btn-secondary { background: transparent; border: 1px solid var(--color-text); color: var(--color-text); }
.surface-dark .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }

/* === 组件：卡片与表格 === */
.card { background: var(--card-bg, rgba(0,0,0,0.03)); border: var(--card-border, 0); box-shadow: var(--card-shadow, none); padding: var(--gap); display: flex; flex-direction: column; gap: 0.75rem; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 400px; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid rgba(128,128,128,0.2); }
th { font-weight: 700; }

/* === 组件：FAQ === */
details { border-bottom: 1px solid rgba(128,128,128,0.2); padding: 1rem 0; }
summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 0.5rem; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; display: inline-block; width: 1.2em; text-align: center; }
details[open] summary::before { content: "-"; }
details p { margin-top: 0.75rem; font-size: 0.95rem; line-height: 1.7; }

/* === 页头与页脚 === */
.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(0,0,0,0.08); }
.surface-dark .site-header { background: rgba(25,16,45,0.9); border-bottom-color: rgba(255,255,255,0.08); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 0.75rem; font-weight: 800; font-size: 1.1rem; }
.brand img { width: 28px; height: 28px; object-fit: contain; }
.nav { display: flex; gap: 1.5rem; align-items: center; }
.nav a { font-size: 0.95rem; font-weight: 500; opacity: 0.8; transition: opacity 0.2s; }
.nav a:hover, .nav a[aria-current="page"] { opacity: 1; color: var(--color-brand); }
.surface-dark .nav a { color: var(--color-paper); }
.surface-dark .nav a:hover, .surface-dark .nav a[aria-current="page"] { color: var(--color-accent); }
.site-footer { border-top: 1px solid rgba(0,0,0,0.08); padding: 2rem 0; margin-top: auto; }
.surface-dark .site-footer { border-top-color: rgba(255,255,255,0.08); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { font-size: 0.9rem; opacity: 0.7; }
.footer-links a:hover { opacity: 1; }

/* === SVG 通用样式 === */
.svg-panel { width: 100%; height: auto; max-width: 100%; }
.svg-panel svg { width: 100%; height: auto; display: block; }
.svg-icon { width: 24px; height: 24px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* === SVG 动效 Keyframes === */
@keyframes drawLine {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes floatBubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes breatheDots {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
@keyframes rotateInterlock {
  0% { transform: rotate(0deg) translate(0, 0); }
  50% { transform: rotate(180deg) translate(4px, -4px); }
  100% { transform: rotate(360deg) translate(0, 0); }
}
@keyframes slideInPanel {
  0% { transform: translateX(20px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}
@keyframes pulseNode {
  0%, 100% { r: 3; opacity: 0.6; }
  50% { r: 4.5; opacity: 1; }
}

/* 动效类绑定 */
.draw-line { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawLine 3s ease-in-out infinite alternate; }
.float-bubble { animation: floatBubble 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.breathe-dots { animation: breatheDots 2.5s ease-in-out infinite; }
.rotate-geo { animation: rotateInterlock 12s linear infinite; transform-box: fill-box; transform-origin: center; }
.slide-panel { animation: slideInPanel 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.pulse-node { animation: pulseNode 3s ease-in-out infinite; }

/* 延迟控制 */
.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.5s; }
.delay-3 { animation-delay: 0.8s; }
.delay-4 { animation-delay: 1.1s; }

/* === 响应式与无障碍 === */
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .steps-row { flex-direction: column; }
  h1 { font-size: clamp(2rem, 8vw, 3.2rem); }
}
@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, .breathe-dots, .rotate-geo, .slide-panel, .pulse-node { animation: none !important; }
}
