/* === 设计 Token 与全局变量 === */
:root {
  /* 颜色系统 */
  --bg-dark: #19102D;
  --bg-paper: #FCFCFD;
  --text-body: #191523;
  --brand-color: #5214EB;
  --accent-color: #D66EED;
  --border-light: rgba(25, 21, 35, 0.1);
  
  /* 圆角与边框 */
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 2px solid var(--text-body);
  --card-shadow: 4px 4px 0 var(--text-body);
  --input-border: 1px solid var(--text-body);
  
  /* 节奏与间距 */
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --line-height: 1.75;
  
  /* 内容宽度 */
  --content-max: 960px;
  
  /* 字体 */
  --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* === 基础重置 === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-main);
  background-color: var(--bg-paper);
  color: var(--text-body);
  line-height: var(--line-height);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: opacity 0.2s; }
ul, ol { list-style: none; }

/* === 布局容器 === */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}
.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
  position: relative;
}
.section + .section {
  border-top: 1px solid var(--border-light);
}
.dark-section {
  background-color: var(--bg-dark);
  color: var(--bg-paper);
}
.dark-section .section-header h2,
.dark-section .section-header p {
  color: var(--bg-paper);
}
.dark-section .hl { color: var(--accent-color); }
.dark-section a { color: var(--accent-color); }
.dark-section a:hover { text-decoration: underline; }

/* === 排版 === */
.section-header {
  margin-bottom: var(--gap);
  max-width: 80ch;
}
.section-number {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-color);
  margin-bottom: 0.5rem;
}
.dark-section .section-number { color: var(--accent-color); }
h1, h2, h3 {
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(2.2rem, 4.5vw, 3.2rem); margin-bottom: 1.5rem; text-wrap: balance; width: 100%; min-width: 0; }
h2 { font-size: clamp(1.8rem, 4vw, 3rem); margin-bottom: 1rem; }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.6rem); margin-bottom: 0.75rem; }
p { margin-bottom: 1rem; max-width: 38em; }
.hl { color: var(--brand-color); }
.dark-section .hl { color: var(--accent-color); }

/* === 按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 48px;
  padding: 0 24px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s, background-color 0.2s, color 0.2s;
}
.btn:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 2px; }
.btn-primary {
  background-color: var(--accent-color);
  color: var(--bg-dark);
  border: none;
}
.dark-section .btn-primary {
  background-color: var(--accent-color);
  color: #19102D;
  border: none;
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn-secondary {
  background-color: transparent;
  color: var(--text-body);
  border: 1px solid var(--text-body);
}
.dark-section .btn-secondary {
  color: var(--bg-paper);
  border-color: var(--bg-paper);
}
.btn-secondary:hover { background-color: rgba(25, 21, 35, 0.05); }
.dark-section .btn-secondary:hover { background-color: rgba(252, 252, 253, 0.1); }

/* === 导航与页头 === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-paper);
  border-bottom: 1px solid var(--border-light);
  backdrop-filter: blur(8px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo img { height: 32px; width: auto; display: block; }
.nav-links { display: flex; gap: 24px; }
.nav-links a { font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--brand-color); }
.dark-section .nav-links a { color: var(--bg-paper); }
.dark-section .nav-links a:hover, .dark-section .nav-links a[aria-current="page"] { color: var(--accent-color); }

/* === 组件：卡片与面板 === */
.card {
  background: var(--bg-paper);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  border-radius: var(--radius-card);
}
.panel {
  background: var(--bg-dark);
  border-radius: var(--radius-card);
  padding: var(--gap);
  position: relative;
  overflow: hidden;
}

/* === 组件：表格 === */
.table-wrapper { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
th, td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
}
th { font-weight: 600; }
td:first-child { font-weight: 600; color: var(--brand-color); }
.dark-section th, .dark-section td { border-color: rgba(252, 252, 253, 0.1); }
.dark-section td:first-child { color: var(--accent-color); }

/* === 组件：FAQ === */
details {
  border-bottom: 1px solid var(--border-light);
  padding: 16px 0;
}
summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-left: 24px;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "+";
  position: absolute;
  left: 0;
  color: var(--brand-color);
  font-weight: 400;
}
details[open] summary::before { content: "-"; }
details p { margin-top: 12px; margin-bottom: 0; color: var(--text-body); }

/* === 组件：Tab 切换 (Radio Hack) === */
.tab-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.tab-nav label {
  padding: 8px 16px;
  border: 1px solid var(--border-light);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}
.tab-nav input[type="radio"] { display: none; }
.tab-nav input[type="radio"]:checked + label {
  background-color: var(--brand-color);
  color: white;
  border-color: var(--brand-color);
}
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* === 组件：步骤条 === */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--gap);
}
.step-item {
  position: relative;
  padding-top: 40px;
}
.step-num {
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  background: var(--accent-color);
  color: var(--bg-dark);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-btn);
}

/* === 组件：场景卡片 === */
.scenario-card {
  display: grid;
  gap: 16px;
}
.scenario-tag {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand-color);
  margin-bottom: 4px;
}
.dark-section .scenario-tag { color: var(--accent-color); }

/* === 组件：新闻卡片 === */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap);
}
.news-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.news-card time {
  font-size: 0.85rem;
  color: var(--text-body);
  opacity: 0.7;
  margin-bottom: 8px;
}
.dark-section .news-card time { color: var(--bg-paper); }

/* === SVG 动效 === */
.svg-anim { width: 100%; height: auto; }
.float-slow { animation: floatSlow 6s ease-in-out infinite; }
.float-fast { animation: floatFast 4s ease-in-out infinite; }
.draw-line {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLine 3s ease-in-out infinite alternate;
}
.blink-dot { animation: blink 2s step-end infinite; }
@keyframes floatSlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
@keyframes floatFast {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes drawLine {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* === 响应式 === */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .steps-grid { grid-template-columns: 1fr; }
  .news-grid { grid-template-columns: 1fr; }
  h1 { font-size: clamp(2rem, 8vw, 3rem); }
}

/* === 减少动态效果 === */
@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;
  }
}
/* factory-contrast-width */
@media (max-width: 390px) {
  [data-fc-390="paper"] {
    color: #fcfcfd !important;
    -webkit-text-fill-color: #fcfcfd !important;
  }
}
@media (min-width: 391px) {
  [data-fc-390="paper"] {
    color: #191523 !important;
    -webkit-text-fill-color: #191523 !important;
  }
}
