:root {
  --color-dark: #231334;
  --color-paper: #F5F3F7;
  --color-light-paper: #EDEAF1;
  --color-text: #1C1523;
  --color-brand: #7D14EB;
  --color-accent: #EDD26E;
  --radius-card: 20px;
  --radius-btn: 12px;
  --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-body: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); 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%; height: auto; }
a { color: var(--color-brand); text-decoration: none; transition: color 0.2s ease; }
a:hover { text-decoration: underline; }

/* 表面层变量覆盖 */
.surface-dark { background: var(--color-dark); color: var(--color-paper); }
.surface-dark a { color: var(--color-accent); }
.surface-dark .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.surface-dark .btn-secondary:hover { background: rgba(255,255,255,0.1); }
.surface-light-paper { background: var(--color-light-paper); }
.surface-dark .card { background: var(--color-paper); color: var(--color-text); }

/* 容器与网格 */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
.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; }
.max-w-prose { max-width: 38em; }

/* 排版 */
section { padding-block: var(--section-y); }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 700; letter-spacing: 0.02em; line-height: 1.15; 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); }
h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: calc(var(--gap) * 0.5); }
.badge { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-brand); margin-bottom: 0.5rem; }
.surface-dark .badge { color: var(--color-accent); }
.hl { color: var(--color-brand); }
.surface-dark .hl { color: var(--color-accent); }
.prose p { margin-bottom: 1rem; }
.prose ul, .prose ol { margin-left: 1.25rem; margin-bottom: 1rem; }
.prose li { margin-bottom: 0.5rem; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.875rem 1.75rem; font-size: 1rem; font-weight: 600; border-radius: var(--radius-btn); cursor: pointer; transition: transform 0.2s ease, filter 0.2s ease, background 0.2s ease; border: none; }
.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); filter: brightness(0.95); }
.btn-secondary { background: transparent; border: 2px solid var(--color-text); color: var(--color-text); }
.btn-secondary:hover { background: rgba(0,0,0,0.05); }

/* 卡片 */
.card { background: var(--color-paper); border: var(--card-border); box-shadow: var(--card-shadow); border-radius: var(--radius-card); padding: var(--gap); }

/* 表格 */
table { width: 100%; border-collapse: collapse; margin-bottom: var(--gap); overflow-x: auto; }
th, td { padding: 0.875rem 1rem; border-bottom: 1px solid var(--color-text); text-align: left; vertical-align: top; word-break: break-word; }
th { font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: none; }

/* FAQ */
details { border: var(--card-border); border-radius: var(--radius-card); margin-bottom: var(--gap); overflow: hidden; }
summary { padding: 1rem; cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.25rem; font-weight: 400; }
details[open] summary::after { content: "-"; }
details > div { padding: 0 1rem 1rem; }

/* 页头页脚 */
header { position: sticky; top: 0; z-index: 100; background: var(--color-paper); border-bottom: 1px solid rgba(0,0,0,0.08); padding: 0.75rem 0; }
.nav-inner { display: flex; justify-content: space-between; align-items: center; }
.logo { font-weight: 800; font-size: 1.25rem; color: var(--color-text); display: flex; align-items: center; gap: 0.5rem; }
nav a { margin-left: 1.5rem; font-weight: 500; }
nav a[aria-current="page"] { color: var(--color-brand); font-weight: 700; text-decoration: none; }
footer { padding: 3rem 0; background: var(--color-dark); color: var(--color-paper); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--gap); }
.footer-links a { display: inline-block; margin-right: 1.5rem; color: var(--color-accent); }
.copyright { margin-top: 2rem; font-size: 0.875rem; opacity: 0.8; }

/* SVG 动效 */
.svg-container { width: 100%; max-width: 600px; margin: 0 auto; }
.svg-container svg { width: 100%; height: auto; }
.anim-orbit { animation: orbit-breathe 8s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.anim-orbit-alt { animation: orbit-breathe-alt 10s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.anim-float { animation: float-gentle 6s ease-in-out infinite; }
.anim-draw { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw-fill 4s ease forwards; }
.anim-draw-delay { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw-fill 4s ease 1s forwards; }

@keyframes orbit-breathe {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.04); opacity: 1; }
}
@keyframes orbit-breathe-alt {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.06); opacity: 0.9; }
}
@keyframes float-gentle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes draw-fill {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; animation: none !important; }
}

/* 响应式微调 */
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .nav-inner { flex-direction: column; gap: 0.5rem; }
  nav a { margin: 0 0.5rem; }
}

/* 兜底：裁掉横向溢出 */
div.container {
  overflow-x: clip;
}
