/* =========================================
   1. 设计变量 (Design Tokens)
   ========================================= */
:root {
  /* 色板 */
  --c-dark: #271231;
  --c-paper: #F6F3F7;
  --c-body: #1F1523;
  --c-brand: #9E13DD;
  --c-accent: #ED6EC0;

  /* 组件形状 */
  --radius-card: 0;
  --radius-btn: 0;

  /* 边界与阴影 */
  --card-border: 1px solid rgba(31, 21, 35, 0.16);
  --card-shadow: none;

  /* 间距与节奏 */
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);

  /* 布局宽度 */
  --content-max: 1280px;

  /* 字体 */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* =========================================
   2. 基础重置与排版 (Reset & Typography)
   ========================================= */
*, *::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: 1.65;
  color: var(--c-body);
  background-color: var(--c-paper);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
  color: var(--c-body);
}

h1 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  margin-bottom: var(--gap);
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: var(--gap);
}

h3 {
  font-size: 1.25rem;
  margin-top: calc(var(--gap) * 1.5);
  margin-bottom: calc(var(--gap) * 0.5);
}

p {
  margin-bottom: var(--gap);
  max-width: 38em;
}

a {
  color: var(--c-brand);
  text-decoration: none;
  transition: color 0.2s ease;
}

.dark-surface a {
  color: var(--c-accent);
}

a:hover {
  text-decoration: underline;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* =========================================
   3. 布局容器 (Layout Containers)
   ========================================= */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section {
  padding: var(--section-y) 0;
}

/* 左右分栏布局 (桌面端) */
.split-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: calc(var(--gap) * 3);
  align-items: start;
}

@media (max-width: 900px) {
  .split-layout {
    grid-template-columns: 1fr;
  }
  .sidebar-toc {
    position: static;
    padding-bottom: var(--gap);
    border-bottom: var(--card-border);
    margin-bottom: var(--gap);
  }
}

/* =========================================
   4. 通用组件 (Components)
   ========================================= */
/* 卡片 */
.card {
  border: var(--card-border);
  background: var(--c-paper);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  border-radius: var(--radius-card);
}

.dark-surface .card {
  background: var(--c-dark);
  color: var(--c-paper);
  border-color: rgba(246, 243, 247, 0.16);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 0 24px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--c-accent);
  color: var(--c-dark);
  border: none;
}

.btn-primary:hover {
  background-color: #d65ba8;
  transform: translateY(-2px);
  text-decoration: none;
}

.btn-secondary {
  background-color: transparent;
  color: var(--c-body);
  border: 1px solid var(--c-body);
}

.dark-surface .btn-secondary {
  color: var(--c-paper);
  border-color: var(--c-paper);
}

.btn-secondary:hover {
  background-color: rgba(31, 21, 35, 0.05);
  transform: translateY(-2px);
  text-decoration: none;
}

.dark-surface .btn-secondary:hover {
  background-color: rgba(246, 243, 247, 0.1);
}

.btn:focus-visible {
  outline: 3px solid var(--c-accent);
  outline-offset: 2px;
}

/* 眉标 (Eyebrow) */
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 12px;
  color: var(--c-brand);
}

.dark-surface .eyebrow {
  color: var(--c-accent);
}

/* 强调词 */
.hl {
  color: var(--c-brand);
}

.dark-surface .hl {
  color: var(--c-accent);
}

/* 表格 */
.table-wrapper {
  overflow-x: auto;
  width: 100%;
  margin-bottom: var(--gap);
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 100%;
  table-layout: fixed;
}

th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: var(--card-border);
}

th {
  font-weight: 700;
  color: var(--c-body);
}

.dark-surface th {
  color: var(--c-paper);
}

tr:last-child td {
  border-bottom: none;
}

/* FAQ Details */
details {
  border: var(--card-border);
  margin-bottom: 8px;
  border-radius: var(--radius-card);
  background: var(--c-paper);
}

.dark-surface details {
  background: rgba(246, 243, 247, 0.05);
  border-color: rgba(246, 243, 247, 0.16);
}

summary {
  padding: 16px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  font-size: 1.2rem;
  font-weight: 400;
}

details[open] summary::after {
  content: "-";
}

details p {
  padding: 0 16px 16px 16px;
  margin-bottom: 0;
}

/* 步骤徽标 */
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background-color: var(--c-accent);
  color: var(--c-dark);
  font-weight: 700;
  border-radius: var(--radius-btn);
  margin-right: 12px;
  flex-shrink: 0;
}

/* =========================================
   5. 页头与页脚 (Header & Footer)
   ========================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--c-paper);
  border-bottom: var(--card-border);
  padding: 16px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--c-body);
  text-decoration: none;
}

.brand img {
  height: 32px;
  width: auto;
}

.nav-list {
  display: flex;
  gap: 24px;
  list-style: none;
}

.nav-link {
  font-weight: 500;
  color: var(--c-body);
  text-decoration: none;
}

.nav-link:hover {
  color: var(--c-brand);
}

.nav-link[aria-current="page"] {
  color: var(--c-brand);
  font-weight: 700;
}

.site-footer {
  padding: 48px 0;
  border-top: var(--card-border);
  margin-top: var(--section-y);
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
}

.footer-col h4 {
  font-size: 1rem;
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 8px;
}

/* =========================================
   6. SVG 动效 (Animations)
   ========================================= */
@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.1); }
}

@keyframes dash-flow {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}

.star-point {
  animation: twinkle 4s infinite ease-in-out;
  transform-box: fill-box;
  transform-origin: center;
}

.sync-line {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: dash-flow 6s infinite ease-in-out;
}

svg {
  width: 100%;
  height: auto;
}

/* 减少动态效果偏好设置 */
@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;
  }
  .star-point, .sync-line {
    animation: none !important;
    opacity: 1 !important;
  }
}

/* =========================================
   7. 首页特定样式 (Index Specific)
   ========================================= */
.hero-section {
  background-color: var(--c-dark);
  color: var(--c-paper);
  padding: var(--section-y) 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: center;
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-visual {
    order: -1;
    margin-bottom: var(--gap);
  }
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: var(--gap);
  flex-wrap: wrap;
}

.fact-bar {
  margin-top: 24px;
  font-size: 0.85rem;
  opacity: 0.8;
  display: flex;
  gap: 24px;
}

.feature-list-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 24px;
}

.feature-name {
  font-weight: 700;
  color: var(--c-body);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--gap);
}

.news-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.news-date {
  font-size: 0.8rem;
  color: var(--c-brand);
  margin-bottom: 8px;
  display: block;
}

.dark-surface .news-date {
  color: var(--c-accent);
}

.quick-start-steps {
  counter-reset: step-counter;
}

.start-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.start-step p {
  margin-bottom: 0;
}

.toc-nav ul {
  list-style: none;
  position: sticky;
  top: 100px;
}

.toc-nav li {
  margin-bottom: 12px;
}

.toc-nav a {
  color: var(--c-body);
  font-weight: 500;
  font-size: 0.95rem;
  display: block;
  padding: 4px 0;
}

.toc-nav a:hover {
  color: var(--c-brand);
}

.cta-section {
  background-color: var(--c-dark);
  color: var(--c-paper);
  text-align: center;
  padding: calc(var(--section-y) * 1.5) 0;
}

.cta-section h2 {
  color: var(--c-paper);
}

.cta-section p {
  margin: 0 auto var(--gap) auto;
  opacity: 0.9;
}

.cta-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
