:root {
  --color-dark: #1B1231;
  --color-paper: #DBD4ED;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #9977EE;
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 2px solid var(--color-text);
  --card-shadow: 4px 4px 0 var(--color-text);
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1120px;
  --font-main: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  line-height: 1.55;
  color: var(--color-text);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
.section { padding-block: var(--section-y); }
.bg-paper { background: var(--color-paper); color: var(--color-text); }
.bg-dark { background: var(--color-dark); color: var(--color-paper); }

/* 取色覆盖规则 */
.bg-dark .hl { color: var(--color-accent); }
.bg-paper .hl { color: var(--color-brand); }
.bg-dark .badge { color: var(--color-accent); }
.bg-paper .badge { color: var(--color-brand); }
.bg-dark .card { background: var(--color-paper); color: var(--color-text); border-color: var(--color-text); box-shadow: var(--card-shadow); }

/* 排版 */
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 600; line-height: 1.25; letter-spacing: 0; text-wrap: balance; margin-bottom: var(--gap); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 600; line-height: 1.25; margin-bottom: var(--gap); }
h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.3; margin-bottom: 0.5em; }
p { margin-bottom: 1em; }
.lead { font-size: 1.125rem; line-height: 1.6; max-width: 40ch; margin-bottom: 1.5em; }
.text-small { font-size: 0.875rem; opacity: 0.85; }

/* 组件基础 */
.badge { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; margin-bottom: 0.5em; }
.link { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.bg-paper .link { color: var(--color-brand); }
.bg-dark .link { color: var(--color-accent); }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5em; padding: 0.75em 1.5em; border-radius: var(--radius-btn); font-weight: 600; text-decoration: none; cursor: pointer; border: none; height: 52px; transition: transform 0.2s ease, filter 0.2s ease; }
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.1); }
.btn-secondary { background: transparent; border: 2px solid currentColor; color: inherit; }
.bg-paper .btn-secondary { border-color: var(--color-text); color: var(--color-text); }
.bg-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 { background: var(--color-paper); color: var(--color-text); border: var(--card-border); border-radius: var(--radius-card); box-shadow: var(--card-shadow); padding: var(--gap); margin-bottom: var(--gap); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }

/* 表格 */
.table-wrap { overflow-x: auto; margin-bottom: var(--gap); }
table { width: 100%; border-collapse: collapse; min-width: 320px; }
th, td { padding: 0.75em 1em; border-bottom: 1px solid currentColor; text-align: left; vertical-align: top; }
th { font-weight: 600; white-space: nowrap; }

/* FAQ */
details { margin-bottom: var(--gap); border: 1px solid currentColor; border-radius: 12px; padding: 1em; background: transparent; }
summary { cursor: pointer; font-weight: 600; list-style: none; position: relative; padding-right: 1.5em; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-weight: 700; }
details[open] summary::after { content: "-"; }
details p { margin-top: 0.75em; margin-bottom: 0; }

/* 步骤 */
.step-list { list-style: none; counter-reset: step; }
.step-list li { counter-increment: step; position: relative; padding-left: 3em; margin-bottom: 1.5em; }
.step-list li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 2em; height: 2em; background: var(--color-accent); color: var(--color-dark); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-weight: 700; }

/* 布局网格 */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.flex-center { display: flex; align-items: center; justify-content: center; }

/* 页头 */
header { position: sticky; top: 0; z-index: 100; background: rgba(219, 212, 237, 0.92); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(25, 21, 35, 0.1); padding: 0.75em 0; transition: background 0.3s ease, border-color 0.3s ease; }
header.scrolled { background: rgba(27, 18, 49, 0.95); border-color: rgba(219, 212, 237, 0.2); }
.header-inner { display: flex; justify-content: space-between; align-items: center; }
.nav { display: flex; gap: 1.5em; list-style: none; }
.nav-link { text-decoration: none; color: var(--color-text); font-weight: 500; padding: 0.25em 0; }
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--color-brand); }
header.scrolled .nav-link { color: var(--color-paper); }
header.scrolled .nav-link:hover, header.scrolled .nav-link[aria-current="page"] { color: var(--color-accent); }
.logo-img { height: 32px; width: auto; vertical-align: middle; }
header.scrolled .logo-img { filter: brightness(0) invert(1); }

/* 页脚 */
footer { padding-block: var(--section-y); border-top: 1px solid currentColor; margin-top: var(--section-y); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--gap); }
.footer-links { display: flex; gap: 1em; list-style: none; }
.footer-links a { color: inherit; text-decoration: none; }
.footer-copy { font-size: 0.875rem; opacity: 0.8; }

/* SVG 动效 */
.hero-svg { width: 100%; height: auto; max-width: 520px; }
@keyframes orbit-breathe { 0%, 100% { transform: scale(1); opacity: 0.7; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes orbit-pulse { 0%, 100% { transform: scale(1); opacity: 0.5; } 50% { transform: scale(1.12); opacity: 0.9; } }
@keyframes dash-flow { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
.anim-orbit-1 { animation: orbit-breathe 7s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-orbit-2 { animation: orbit-pulse 9s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-draw { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: dash-flow 4s ease forwards; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 768px) {
  .nav { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hero-layout { flex-direction: column; text-align: center; }
  .hero-layout .lead { margin-left: auto; margin-right: auto; }
}
