/* === 设计变量与基础重置 === */
:root {
  --bg-dark: #19102D;
  --bg-paper: #FCFCFD;
  --text-main: #191523;
  --brand: #5214EB;
  --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: 1120px;
  
  --bg-card-alt: #F2F2F5;
  --bg-card-alt-dark: #251B3D;
  --divider-color: #E0E0E5;
  
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-main);
  background-color: var(--bg-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100vw;
  max-width: 100%;
}

img, svg { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* === 排版系统 === */
h1, h2, h3, h4 { font-weight: 600; letter-spacing: 0; line-height: 1.25; color: var(--text-main); }
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: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: 0.75em; }
p { margin-bottom: 1em; max-width: 38em; }

.section-divider {
  border: none;
  border-top: 1px solid var(--divider-color);
  margin: var(--section-y) 0;
}

.dark-section {
  background-color: var(--bg-dark);
  color: var(--bg-paper);
}
.dark-section h1, .dark-section h2, .dark-section h3, .dark-section p, .dark-section span, .dark-section li {
  color: var(--bg-paper);
}
.light-card {
  background-color: var(--bg-paper);
  color: var(--text-main);
  padding: var(--gap);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
}
.light-card h1, .light-card h2, .light-card h3, .light-card p, .light-card span, .light-card li {
  color: var(--text-main);
}

.hl { color: var(--brand); font-weight: 600; }
.dark-section .hl { color: var(--accent); }

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.5em;
  color: var(--brand);
}
.dark-section .eyebrow { color: var(--accent); }

/* === 导航与页头 === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-paper);
  border-bottom: 1px solid var(--divider-color);
  padding: 16px 0;
  transition: box-shadow 0.2s ease;
}
.site-header.scrolled { box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.1rem; }
.brand img { width: 32px; height: 32px; object-fit: contain; }
nav ul { display: flex; gap: 24px; }
nav a { font-weight: 500; font-size: 0.95rem; padding: 4px 0; border-bottom: 2px solid transparent; transition: border-color 0.2s; }
nav a:hover, nav a[aria-current="page"] { border-bottom-color: var(--brand); }
.dark-section nav a { color: var(--bg-paper); }
.dark-section nav a:hover, .dark-section nav a[aria-current="page"] { border-bottom-color: var(--accent); }

.mobile-menu-btn { display: none; background: none; border: none; cursor: pointer; color: var(--text-main); }
.dark-section .mobile-menu-btn { color: var(--bg-paper); }

/* === 按钮组件 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 24px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.btn-primary {
  background-color: var(--accent);
  color: var(--bg-dark);
  border: none;
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn-secondary {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--text-main);
}
.dark-section .btn-secondary { color: var(--bg-paper); border-color: var(--bg-paper); }
.btn-secondary:hover { transform: translateY(-2px); opacity: 0.9; }

/* === 卡片与网格 === */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}
.card {
  background-color: var(--bg-card-alt);
  padding: var(--gap);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dark-section .card { background-color: var(--bg-card-alt-dark); }

/* === 表格 === */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--gap) 0;
}
.data-table th, .data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--divider-color);
}
.data-table th { font-weight: 600; background-color: var(--bg-card-alt); }
.dark-section .data-table th { background-color: var(--bg-card-alt-dark); }
.data-table tr:last-child td { border-bottom: none; }

/* === FAQ === */
.faq-item { border-bottom: 1px solid var(--divider-color); }
.faq-item summary {
  padding: 16px 0;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-left: 24px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background-color: var(--brand);
}
.dark-section .faq-item summary::before { background-color: var(--accent); }
.faq-item summary:hover { color: var(--brand); }
.dark-section .faq-item summary:hover { color: var(--accent); }
.faq-item p { margin-top: 12px; margin-bottom: 0; font-size: 0.95rem; }

/* === 步骤条 === */
.step-bar {
  display: flex;
  gap: var(--gap);
  overflow-x: auto;
  padding-bottom: 16px;
}
.step-item {
  flex: 1 1 200px;
  min-width: 0;
  position: relative;
  padding-left: 32px;
}
.step-num {
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  background-color: var(--accent);
  color: var(--bg-dark);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}
.step-title { font-weight: 600; margin-bottom: 4px; }
.step-desc { font-size: 0.9rem; color: #555; }
.dark-section .step-desc { color: #ccc; }

/* === 场景卡片 === */
.scene-card {
  background-color: var(--bg-card-alt);
  padding: var(--gap);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.scene-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  background-color: rgba(82, 20, 235, 0.1);
  color: var(--brand);
  width: fit-content;
}
.dark-section .scene-tag { background-color: rgba(214, 110, 237, 0.15); color: var(--accent); }

/* === 新闻卡片 === */
.news-card {
  background-color: var(--bg-card-alt);
  padding: var(--gap);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.news-date { font-size: 0.85rem; color: #666; }
.dark-section .news-date { color: #aaa; }

/* === SVG 动效基类 === */
.svg-anim { width: 100%; height: auto; }
.svg-anim svg { width: 100%; height: 100%; }

/* 浮动 */
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.anim-float { animation: float-y 6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-float-delay { animation: float-y 6s ease-in-out infinite 2s; transform-box: fill-box; transform-origin: center; }

/* 呼吸点 */
@keyframes breathe {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
.anim-breathe { animation: breathe 3s ease-in-out infinite; }

/* 滑入通知 */
@keyframes slide-in-right {
  0%, 20% { transform: translateX(100%); opacity: 0; }
  25%, 85% { transform: translateX(0); opacity: 1; }
  90%, 100% { transform: translateX(100%); opacity: 0; }
}
.anim-slide-in { animation: slide-in-right 12s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }

/* 描边绘制 */
@keyframes draw-stroke {
  0%, 100% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
}
.anim-draw { animation: draw-stroke 8s ease-in-out infinite; }

/* 减少动态效果 */
@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;
  }
  .anim-float, .anim-float-delay, .anim-breathe, .anim-slide-in, .anim-draw {
    animation: none !important;
  }
}

/* === 响应式适配 === */
@media (max-width: 768px) {
  nav ul { display: none; }
  .mobile-menu-btn { display: block; }
  .hero-layout { flex-direction: column; }
  .step-bar { flex-direction: column; }
  .step-item { padding-left: 0; margin-bottom: 24px; }
  .step-num { position: static; width: 32px; height: 32px; margin-bottom: 8px; }
}

/* === 页脚 === */
.site-footer {
  background-color: var(--bg-dark);
  color: var(--bg-paper);
  padding: var(--section-y) 0;
  margin-top: var(--section-y);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
  margin-bottom: var(--gap);
}
.footer-col h4 { font-size: 1rem; margin-bottom: 12px; color: var(--bg-paper); }
.footer-col a { display: block; padding: 6px 0; color: #ccc; font-size: 0.9rem; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  text-align: center;
  font-size: 0.85rem;
  color: #888;
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
