/* === 设计变量 === */
:root {
  --color-dark: #141838;
  --color-paper: #FCFCFD;
  --color-text: #151723;
  --color-brand: #142CEB;
  --color-accent: #6EAFED;
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 2px solid var(--text);
  --card-shadow: 4px 4px 0 var(--text);
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 960px;
}

/* === 基础重置与排版 === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
  background-color: var(--color-paper);
  color: var(--color-text);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* === 容器与布局 === */
.container { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
.section { padding-block: var(--section-y); }
.section-dark { background-color: var(--color-dark); color: var(--color-paper); }
.section-dark .hl { color: var(--color-accent); }
.section-dark .brand-link { color: var(--color-accent); }
.section-paper { background-color: var(--color-paper); color: var(--color-text); }
.section-paper .hl { color: var(--color-brand); }
.section-paper .brand-link { color: var(--color-brand); }

/* 卡片表面覆盖 */
.card-light { background: var(--color-paper); color: var(--color-text); border: var(--card-border); box-shadow: var(--card-shadow); border-radius: var(--radius-card); }
.card-dark { background: var(--color-dark); color: var(--color-paper); }

/* === 页头与页脚 === */
.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(21, 23, 35, 0.1);
  padding: 12px 0;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.logo-wrap { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; }
.logo-wrap img { height: 28px; width: auto; }
.main-nav { display: flex; gap: 24px; align-items: center; }
.main-nav a { font-weight: 500; font-size: 0.95rem; transition: color 0.2s; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--color-brand); }
.nav-actions { display: flex; align-items: center; gap: 12px; }

/* === 按钮 === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 20px; height: 48px; border-radius: var(--radius-btn);
  font-weight: 600; font-size: 0.95rem; cursor: pointer; transition: transform 0.2s, opacity 0.2s, background 0.2s;
}
.btn:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 2px; }
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-primary:hover { transform: translateY(-1px); opacity: 0.9; }
.btn-secondary { background: transparent; border: 1.5px solid var(--color-text); color: var(--color-text); }
.section-dark .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.btn-icon { width: 20px; height: 20px; flex-shrink: 0; }

/* === 标题与眉标 === */
.breadcrumb { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.section-dark .breadcrumb { color: var(--color-accent); }
.section-paper .breadcrumb { color: var(--color-brand); }
h1 { font-size: clamp(2.2rem, 5vw, 4rem); font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; margin-bottom: 16px; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 600; line-height: 1.25; margin-bottom: 24px; }
h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.3; margin-bottom: 12px; margin-top: 24px; }
p { margin-bottom: 16px; max-width: 38em; }
.hl { font-weight: 700; }

/* === 长文双栏布局 === */
.page-layout { display: flex; gap: var(--gap); align-items: flex-start; }
.toc-nav { width: 220px; position: sticky; top: 80px; align-self: flex-start; padding: 16px 0; border-right: 1px solid rgba(21,23,35,0.1); }
.toc-nav ul { display: flex; flex-direction: column; gap: 8px; }
.toc-nav a { display: block; padding: 6px 10px; border-radius: 4px; font-size: 0.9rem; color: var(--color-text); opacity: 0.8; transition: all 0.2s; }
.toc-nav a:hover, .toc-nav a.active { background: rgba(20, 44, 235, 0.08); opacity: 1; color: var(--color-brand); }
.main-body { flex: 1; min-width: 0; }

/* === 组件细节 === */
.card { padding: 24px; margin-bottom: var(--gap); }
.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); }
table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.95rem; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid rgba(21,23,35,0.1); word-break: break-all; }
th { font-weight: 600; }
td:first-child { font-weight: 600; width: 40%; }
.feature-list dt { font-weight: 600; margin-top: 16px; margin-bottom: 4px; }
.feature-list dd { margin-left: 0; margin-bottom: 12px; color: rgba(21,23,35,0.8); }
.step-badge { 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: 6px; margin-right: 10px; flex-shrink: 0; }
.timeline-item { display: flex; gap: 16px; margin-bottom: 24px; align-items: flex-start; }
.news-card { padding: 20px; }
.news-meta { font-size: 0.8rem; opacity: 0.7; margin-bottom: 8px; display: block; }
.tip-box { border-left: 4px solid var(--color-brand); padding: 12px 16px; margin: 16px 0; background: rgba(20, 44, 235, 0.04); border-radius: 0 var(--radius-card) var(--radius-card) 0; }
.section-dark .tip-box { border-color: var(--color-accent); background: rgba(110, 175, 237, 0.1); }

/* === FAQ === */
details { border: 1px solid rgba(21,23,35,0.15); border-radius: var(--radius-card); margin-bottom: 12px; overflow: hidden; }
.summary-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; cursor: pointer; font-weight: 600; background: rgba(21,23,35,0.02); }
.section-dark details { border-color: rgba(252,252,253,0.2); }
.section-dark .summary-row { background: rgba(252,252,253,0.05); color: var(--color-paper); }
summary { list-style: none; user-select: none; }
summary::-webkit-details-marker { display: none; }
.summary-row::after { content: ""; width: 10px; height: 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform 0.2s; }
details[open] .summary-row::after { transform: rotate(-135deg) translateY(-2px); }
.details-content { padding: 16px; line-height: 1.6; }

/* === SVG 图标通用 === */
.icon-svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.icon-svg.small { width: 20px; height: 20px; }
.icon-svg.large { width: 32px; height: 32px; }

/* === SVG 动效系统 === */
.svg-responsive { width: 100%; height: auto; display: block; }
.draw-line { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawLoop 6s ease-in-out infinite; }
.orbit-ring { animation: orbitPulse 8s ease-in-out infinite alternate; transform-origin: center; transform-box: fill-box; }
.float-bubble { animation: floatUp 5s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.slide-panel { animation: slideIn 7s ease-in-out infinite alternate; transform-origin: center; transform-box: fill-box; }
.line-flow { pathLength: 1; stroke-dasharray: 0.2 0.8; animation: dashFlow 3s linear infinite; }

@keyframes drawLoop {
  0%, 100% { stroke-dashoffset: 1; opacity: 0.4; }
  50% { stroke-dashoffset: 0; opacity: 1; }
}
@keyframes orbitPulse {
  0% { transform: scale(0.95); opacity: 0.6; }
  100% { transform: scale(1.05); opacity: 1; }
}
@keyframes floatUp {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes slideIn {
  0% { transform: translateX(0); opacity: 1; }
  50% { transform: translateX(4px); opacity: 0.8; }
  100% { transform: translateX(0); opacity: 1; }
}
@keyframes dashFlow {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    animation: none !important;
  }
}

/* === 响应式 === */
@media (max-width: 768px) {
  .page-layout { flex-direction: column; }
  .toc-nav { width: 100%; position: static; border-right: none; border-bottom: 1px solid rgba(21,23,35,0.1); padding: 12px 0; }
  .toc-nav ul { flex-direction: row; overflow-x: auto; white-space: nowrap; gap: 16px; }
  .hero-grid { flex-direction: column; }
  .scenario-col { flex-direction: column; }
}
