/* 设计变量与站点 Token */
:root {
  --color-dark: #251943;
  --color-paper: #DBD4ED;
  --color-light-paper: #EDE8F7;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #ED6E89;
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(25, 21, 35, 0.3);
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1120px;
  --font-main: 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-main);
  font-size: 16px;
  line-height: 1.55;
  color: var(--color-text);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
}
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: var(--section-y) var(--gap);
}
.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}
.section--dark {
  background: var(--color-dark);
  color: var(--color-paper);
}
.section--dark .section__subtitle,
.section--dark h2,
.section--dark h3,
.section--dark p,
.section--dark li { color: var(--color-paper); }
.section--dark .section__label,
.section--dark a:not(.btn) { color: var(--color-accent); }
.section--light-paper { background: var(--color-light-paper); }

/* 标题系统 */
.section__label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.5em;
  color: var(--color-brand);
}
.section--dark .section__label { color: var(--color-accent); }
h1 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
  margin-bottom: var(--gap);
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: calc(var(--gap) * 0.75);
  text-wrap: balance;
}
h3 {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.5em;
}
p { margin-bottom: 0.8em; max-width: 38em; }
.hl { color: var(--color-brand); }
.section--dark .hl { color: var(--color-accent); }

/* 按钮组件 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  height: 52px;
  padding: 0 1.5em;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn--primary {
  background: var(--color-accent);
  color: var(--color-dark);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(237, 110, 137, 0.4); }
.btn--secondary {
  background: transparent;
  border: 1px solid var(--color-text);
  color: var(--color-text);
}
.section--dark .btn--secondary {
  border-color: var(--color-paper);
  color: var(--color-paper);
}
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }

/* 卡片网格 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: var(--gap);
}
.card {
  background: var(--color-paper);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
  transition: box-shadow 0.2s ease;
}
.section--dark .card { background: #2f2454; box-shadow: 0 8px 24px -12px rgba(0,0,0,0.4); }
.card:hover { box-shadow: 0 12px 32px -10px rgba(25, 21, 35, 0.35); }

/* 表格样式 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 0.95rem;
}
.data-table th, .data-table td {
  padding: 0.75em 1em;
  text-align: left;
  border-bottom: 1px solid rgba(25, 21, 35, 0.12);
}
.section--dark .data-table th,
.section--dark .data-table td { border-bottom-color: rgba(219, 212, 237, 0.15); }
.data-table th { font-weight: 600; }

/* FAQ 折叠面板 */
details {
  margin-bottom: 0.75em;
  border-bottom: 1px solid rgba(25, 21, 35, 0.1);
  padding-bottom: 0.75em;
}
.section--dark details { border-bottom-color: rgba(219, 212, 237, 0.15); }
summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 1.5em;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 0;
  transition: transform 0.2s;
}
details[open] summary::after { content: "-"; }
details p { margin-top: 0.5em; font-size: 0.95rem; }

/* 步骤徽标 */
.step-list { counter-reset: step; }
.step-item {
  counter-increment: step;
  display: flex;
  gap: 1em;
  margin-bottom: 1.25em;
  align-items: flex-start;
}
.step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-btn);
}

/* 页头与页脚 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(219, 212, 237, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(25, 21, 35, 0.08);
}
.section--dark ~ .site-header,
body:not(.section--dark) .site-header { background: rgba(219, 212, 237, 0.95); }
.header-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0.75em var(--gap);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-links { display: flex; gap: 1.5em; align-items: center; }
.nav-links a { font-weight: 500; font-size: 0.95rem; }
.nav-links a[aria-current="page"] { color: var(--color-brand); font-weight: 700; }
.section--dark .nav-links a { color: var(--color-paper); }
.section--dark .nav-links a[aria-current="page"] { color: var(--color-accent); }
.site-footer {
  background: var(--color-dark);
  color: var(--color-paper);
  padding: 2em var(--gap);
  text-align: center;
  font-size: 0.9rem;
}
.footer-links { display: flex; justify-content: center; gap: 1.5em; margin-bottom: 1em; }
.footer-links a { color: var(--color-paper); opacity: 0.8; }
.footer-links a:hover { opacity: 1; text-decoration: underline; }

/* SVG 响应式与动效 */
svg { width: 100%; height: auto; display: block; }
.svg-panel {
  background: #2f2454;
  border-radius: var(--radius-card);
  padding: 1em;
  box-shadow: var(--card-shadow);
}
.anim-draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: dash-flow 4s linear infinite;
}
.anim-dot {
  animation: dot-travel 3s ease-in-out infinite;
}
.anim-float {
  animation: float-panel 6s ease-in-out infinite;
}
.anim-pulse {
  animation: pulse-opacity 3s ease-in-out infinite;
}
@keyframes dash-flow {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes dot-travel {
  0% { transform: translate(0, 0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translate(var(--tx, 120px), var(--ty, -40px)); opacity: 0; }
}
@keyframes float-panel {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes pulse-opacity {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
[class*="anim"] { transform-box: fill-box; transform-origin: center; }

/* 减少动态效果 */
@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) {
  .hero-layout { flex-direction: column; }
  .hero-visual { order: -1; width: 100%; max-width: 400px; margin: 0 auto; }
  .card-grid { grid-template-columns: 1fr; }
  .nav-links { gap: 1em; }
  .btn { width: 100%; justify-content: center; }
}
@media (min-width: 769px) {
  .hero-layout { display: flex; gap: 2em; align-items: center; }
  .hero-text { flex: 1; min-width: 0; }
  .hero-visual { flex: 1; min-width: 0; }
}
