/* === 设计变量 === */
:root {
  --color-dark: #240F29;
  --color-paper: #F6F3F7;
  --color-text: #201523;
  --color-brand: #A711CF;
  --color-accent: #ED6E73;
  --color-text-on-dark: #F6F3F7;
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 0;
  --card-shadow: none;
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 960px;
  --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-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
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-block: var(--section-y); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.flex-row { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: center; }

/* === 排版系统 === */
.subtitle {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-brand);
  margin-bottom: calc(var(--gap) / 2);
}
.dark-section .subtitle { color: var(--color-accent); }

h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
  margin-bottom: var(--gap);
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
  margin-bottom: var(--gap);
  text-wrap: balance;
}
h3 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: calc(var(--gap) / 2);
}
p { margin-bottom: var(--gap); max-width: 38em; }
.hl { color: var(--color-brand); }
.dark-section .hl { color: var(--color-accent); }
.dark-section p { color: #f6f3f7; }

/* === 组件：按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  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, color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
  border: 2px solid var(--color-accent);
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(0.95); }
.btn-primary:focus-visible { outline: 3px solid var(--color-brand); outline-offset: 2px; }

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 2px solid var(--color-text);
}
.btn-secondary:hover { transform: translateY(-2px); background-color: rgba(0,0,0,0.04); }
.dark-section .btn-secondary { color: var(--color-text-on-dark); border-color: var(--color-text-on-dark); }
.dark-section .btn-secondary:hover { background-color: rgba(255,255,255,0.08); }
.dark-section .btn-primary:focus-visible { outline-color: var(--color-accent); }

/* === 组件：卡片 === */
.card {
  background-color: rgba(0,0,0,0.03);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  margin-bottom: var(--gap);
  border-radius: var(--radius-card);
}
.dark-section .card { background-color: rgba(255,255,255,0.05); }

/* === 组件：表格 === */
table { width: 100%; border-collapse: collapse; margin-bottom: var(--gap); }
th, td { padding: 12px 0; text-align: left; border-bottom: 1px solid rgba(0,0,0,0.1); max-width: 100%; overflow-wrap: break-word; word-break: break-all; }
th { font-weight: 700; }
.dark-section th, .dark-section td { border-bottom-color: rgba(255,255,255,0.1); }

/* === 组件：FAQ === */
details[role="list"] summary {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  padding: var(--gap) 0;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  position: relative;
}
details[role="list"] summary::-webkit-details-marker { display: none; }
details[role="list"] summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-weight: 400; }
details[role="list"][open] summary::after { content: "-"; }
.dark-section details[role="list"] summary { border-bottom-color: rgba(255,255,255,0.1); }
details[role="list"] p { margin-top: var(--gap); color: inherit; }

/* === 组件：列表与编号 === */
.step-list { counter-reset: step; }
.step-list li {
  counter-increment: step;
  padding-left: 2.5rem;
  position: relative;
  margin-bottom: var(--gap);
}
.step-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  background-color: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-btn);
  font-size: 0.9rem;
}
.feature-list dt { font-weight: 700; margin-bottom: calc(var(--gap) / 4); }
.feature-list dd { margin-left: 0; margin-bottom: var(--gap); color: var(--color-text); opacity: 0.9; }

/* === 页头与页脚 === */
header {
  position: sticky; top: 0; z-index: 100;
  background-color: var(--color-paper);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  padding: 16px 0;
}
.dark-header { background-color: var(--color-dark); border-bottom-color: rgba(255,255,255,0.1); }
.header-inner { display: flex; justify-content: space-between; align-items: center; }
nav { display: flex; align-items: center; }
nav a { margin-left: 24px; font-weight: 500; font-size: 0.95rem; }
.dark-nav a { color: var(--color-text-on-dark); }
.dark-nav a:hover { color: var(--color-accent); }
nav a[aria-current="page"] { color: var(--color-brand); }
.dark-nav a[aria-current="page"] { color: var(--color-accent); }

footer {
  background-color: var(--color-dark);
  color: var(--color-text-on-dark);
  padding: 48px 0;
  margin-top: var(--section-y);
}
.footer-inner { display: flex; flex-direction: column; gap: var(--gap); }
.footer-links { display: flex; flex-wrap: wrap; gap: 24px; }
.footer-links a { color: var(--color-accent); }
.footer-links a:hover { text-decoration: underline; }
.footer-meta { font-size: 0.85rem; opacity: 0.7; margin-top: 16px; }

/* === SVG 动效 === */
svg { width: 100%; height: auto; }
svg g circle, svg g path, svg g rect { transform-box: fill-box; transform-origin: center; }

.star { animation: twinkle 4s ease-in-out infinite; }
.star:nth-child(odd) { animation-delay: 1.2s; }
.star:nth-child(3n) { animation-duration: 5.5s; }

.line-flow {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: flowLine 6s linear infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
@keyframes flowLine {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .star, .line-flow { animation: none !important; }
}

/* === 响应式微调 === */
@media (max-width: 768px) {
  .header-inner { flex-direction: column; gap: 12px; }
  nav { margin-top: 8px; }
  nav a { margin: 0 12px; }
  .grid-2 { grid-template-columns: 1fr; }
  .hero-layout { flex-direction: column-reverse; }
}
