*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--color-text);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
ul, ol { list-style: none; }

:root {
  --color-dark: #1B1231;
  --color-paper: #DBD4ED;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #9977EE;
  --color-card-paper: #E8E4F5;
  --color-card-dark: #2C224A;
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: none;
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1280px;
  --line-height-body: 1.75;
}

/* 布局容器 */
.container { max-width: var(--content-max); margin-inline: auto; padding-inline: var(--gap); }
.section { padding-block: var(--section-y); position: relative; }
.section::after { content: ""; display: block; height: 4px; background: var(--color-brand); opacity: 0.15; margin-top: var(--section-y); }
.section:last-of-type::after { display: none; }

/* 上下文变量覆盖 */
.section--dark { background-color: var(--color-dark); color: var(--color-paper); }
.section--dark .eyebrow { color: var(--color-accent); }
.section--dark .hl { color: var(--color-accent); }
.section--dark .btn-primary { background: var(--color-accent); color: var(--color-dark); }
.section--dark .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.section--dark .card { background: var(--color-card-dark); color: var(--color-paper); }
.section--dark .card .hl { color: var(--color-accent); }
.section--dark table th, .section--dark table td { border-bottom-color: rgba(255,255,255,0.08); }

/* 排版 */
h1, h2, h3 { font-weight: 700; letter-spacing: 0.02em; line-height: 1.25; }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 0.5em; }
h3 { font-size: 1.25rem; margin-bottom: 0.5em; }
.eyebrow { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-brand); margin-bottom: 0.75rem; display: block; }
.hl { color: var(--color-brand); }
p { margin-bottom: 1em; max-width: 38em; }
strong { font-weight: 700; }

/* 组件：按钮 */
.btn { display: inline-flex; align-items: center; gap: 0.6em; padding: 0 1.6em; height: 52px; border-radius: var(--radius-btn); font-weight: 600; font-size: 1rem; cursor: pointer; transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease; border: none; vertical-align: middle; }
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-secondary { background: transparent; border: 1.5px solid var(--color-text); color: var(--color-text); }

/* 组件：卡片 */
.card { background: var(--color-card-paper); border-radius: var(--radius-card); padding: 1.5rem; box-shadow: var(--card-shadow); border: var(--card-border); }

/* 组件：表格 */
table { width: 100%; border-collapse: collapse; margin: 1rem 0; table-layout: fixed; overflow-wrap: anywhere; }
th, td { padding: 0.85rem 1rem; text-align: left; border-bottom: 1px solid rgba(0,0,0,0.08); word-break: break-word; }
th { font-weight: 700; }
tr:last-child td { border-bottom: none; }

/* 组件：FAQ */
details { margin-bottom: 1rem; border-radius: var(--radius-card); overflow: hidden; }
summary { padding: 1rem 1.5rem; cursor: pointer; font-weight: 600; background: var(--color-card-paper); list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.2rem; transition: transform 0.2s ease; }
details[open] summary::after { transform: rotate(45deg); }
.details-content { padding: 1rem 1.5rem; line-height: 1.75; }
.section--dark summary { background: var(--color-card-dark); color: var(--color-paper); }

/* 组件：小目录 */
.toc-mini { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; margin-bottom: 1.5rem; font-size: 0.9rem; }
.toc-mini a { color: var(--color-brand); text-decoration: underline; text-underline-offset: 3px; }
.section--dark .toc-mini a { color: var(--color-accent); }
.toc-mini a:hover { opacity: 0.8; }

/* 网格布局 */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }

/* 页头页脚 */
.header { position: sticky; top: 0; z-index: 100; background: rgba(219, 212, 237, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(0,0,0,0.06); }
.section--dark .header { background: rgba(27, 18, 49, 0.92); border-bottom-color: rgba(255,255,255,0.06); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav-list { display: flex; gap: 1.5rem; align-items: center; }
.nav-link { font-weight: 500; padding: 0.25rem 0; }
.nav-link:hover { color: var(--color-brand); }
.section--dark .nav-link:hover { color: var(--color-accent); }
.nav-link[aria-current="page"] { color: var(--color-brand); font-weight: 700; }
.section--dark .nav-link[aria-current="page"] { color: var(--color-accent); }
.footer { padding: 3rem 0; border-top: 1px solid rgba(0,0,0,0.08); margin-top: var(--section-y); }
.section--dark .footer { border-top-color: rgba(255,255,255,0.08); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem; }
.footer-links { display: flex; gap: 1.5rem; }
.footer-copy { font-size: 0.85rem; opacity: 0.8; }

/* SVG 动效 */
@keyframes nodePulse {
  0%, 100% { opacity: 0.15; fill: var(--color-brand); }
  50% { opacity: 1; fill: var(--color-accent); }
}
.grid-node { animation: nodePulse 4.5s infinite ease-in-out; }
.grid-node:nth-child(1) { animation-delay: 0s; }
.grid-node:nth-child(2) { animation-delay: 0.5s; }
.grid-node:nth-child(3) { animation-delay: 1.0s; }
.grid-node:nth-child(4) { animation-delay: 1.5s; }
.grid-node:nth-child(5) { animation-delay: 2.0s; }
.grid-node:nth-child(6) { animation-delay: 2.5s; }
.grid-node:nth-child(7) { animation-delay: 3.0s; }
.grid-node:nth-child(8) { animation-delay: 3.5s; }
.grid-node:nth-child(9) { animation-delay: 4.0s; }

@keyframes dashFlow {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
.flow-line { stroke-dasharray: 1; stroke-dashoffset: 0; animation: dashFlow 3s linear infinite; }

@keyframes floatSoft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.float-anim { animation: floatSoft 6s infinite ease-in-out; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
