/* === 设计变量 === */
:root {
  --color-dark: #19102D;
  --color-paper: #F4F3F7;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #D66EED;
  --color-card-bg: #FFFFFF;
  --color-card-alt: #EAE9EE;
  --color-line: #DAD8E0;
  
  --radius-card: 0;
  --radius-btn: 0;
  
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1120px;
  
  --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.75;
  color: var(--color-text);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  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: 0 auto;
  padding: 0 var(--gap);
}
section {
  padding: var(--section-y) 0;
  position: relative;
}
/* 纸面区块之间的细线分节 */
section:not(.dark-face):not(:last-child)::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: var(--gap);
  right: var(--gap);
  height: 1px;
  background: var(--color-line);
}

/* === 排版 === */
h1, h2, h3, h4 { font-weight: 500; line-height: 1.15; color: var(--color-text); }
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); letter-spacing: -0.02em; }
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.75rem; }
p { margin-bottom: 1rem; max-width: 38em; }
.hl { color: var(--color-brand); }
.dark-face .hl { color: var(--color-accent); }
.subtitle {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-brand);
  margin-bottom: 0.5rem;
  display: block;
}
.dark-face .subtitle { color: var(--color-accent); }

/* === 页头与页脚 === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(244, 243, 247, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-line);
}
.dark-face .site-header { background: rgba(25, 16, 45, 0.95); border-bottom-color: rgba(214, 110, 237, 0.2); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 1.1rem; }
.brand img { width: 32px; height: 32px; object-fit: contain; }
nav { display: flex; gap: 24px; align-items: center; }
nav a { font-size: 0.95rem; font-weight: 500; position: relative; padding: 4px 0; }
nav a:hover, nav a[aria-current="page"] { color: var(--color-brand); }
.dark-face nav a { color: var(--color-paper); }
.dark-face nav a:hover, nav a[aria-current="page"] { color: var(--color-accent); }
.site-footer {
  background: var(--color-dark);
  color: var(--color-paper);
  padding: var(--section-y) 0 48px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--gap);
  margin-bottom: var(--gap);
}
.footer-col h4 { color: var(--color-accent); margin-bottom: 16px; font-size: 1rem; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col a { color: rgba(244, 243, 247, 0.8); font-size: 0.9rem; }
.footer-col a:hover { color: var(--color-accent); }
.footer-bottom {
  border-top: 1px solid rgba(244, 243, 247, 0.15);
  padding-top: 24px;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(244, 243, 247, 0.6);
}

/* === 按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 28px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  border-radius: var(--radius-btn);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover { transform: translateY(-2px); background: #C95CE0; }
.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-text);
}
.dark-face .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }
.dark-face .btn-secondary:hover { background: rgba(244, 243, 247, 0.1); }

/* === 卡片与面板 === */
.card {
  background: var(--color-card-bg);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: 24px;
  position: relative;
}
.card.alt { background: var(--color-card-alt); }
.panel {
  background: var(--color-dark);
  border-radius: var(--radius-card);
  padding: 32px;
  color: var(--color-paper);
  position: relative;
  overflow: hidden;
}
.panel.light-card {
  background: var(--color-card-bg);
  color: var(--color-text);
  border: 1px solid var(--color-line);
}
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  nav { display: none; } /* 简化移动端，实际项目可加汉堡菜单 */
}

/* === 表格 === */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.data-table th, .data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-line);
}
.data-table th { font-weight: 600; color: var(--color-text); background: var(--color-card-alt); }
.dark-face .data-table th { background: rgba(244, 243, 247, 0.05); color: var(--color-paper); border-color: rgba(244, 243, 247, 0.15); }

/* === FAQ === */
.faq-item { border-bottom: 1px solid var(--color-line); }
.faq-item summary {
  padding: 16px 0;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.2rem; transition: transform 0.2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding: 0 0 16px; color: rgba(25, 21, 35, 0.85); }

/* === SVG 动效 === */
.svg-container { width: 100%; height: auto; }
svg { width: 100%; height: auto; }
.node-light { animation: nodePulse 6s ease-in-out infinite; }
.node-light:nth-child(odd) { animation-delay: 1.5s; }
.node-light:nth-child(even) { animation-delay: 3s; }
.draw-path { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawLine 4s ease forwards; }
.bubble-float { animation: floatY 5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.dots-breathe { animation: breathe 3s ease-in-out infinite; }
.slide-panel { animation: slideIn 5s ease-in-out infinite alternate; }
@keyframes nodePulse {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.1); }
}
@keyframes drawLine {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
@keyframes slideIn {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}

/* === 减少动态效果 === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
