:root {
  --bg-dark: #19102D;
  --bg-paper: #F4F3F7;
  --text-body: #191523;
  --brand: #5214EB;
  --accent: #D66EED;
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 2px solid var(--text-body);
  --card-shadow: 4px 4px 0 var(--text-body);
  --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, sans-serif;
}

/* 基础重置与排版 */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-main);
  line-height: 1.55;
  background-color: var(--bg-paper);
  color: var(--text-body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 var(--gap) 0;
  text-wrap: balance;
}
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.25; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 var(--gap) 0; }
a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
img, svg { display: block; max-width: 100%; height: auto; }
ul, ol { padding-left: 1.2em; margin: 0 0 var(--gap) 0; }
li { margin-bottom: 0.5em; }

/* 容器与布局 */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding: var(--section-y) 0; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: center; }
@media (max-width: 768px) { .hero-grid { grid-template-columns: 1fr; } }
.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; }
.min-zero { min-width: 0; }

/* 表面层颜色系统 */
.surface-dark { background-color: var(--bg-dark); color: var(--bg-paper); }
.surface-dark a { color: var(--accent); }
.surface-dark a:hover { color: #e8b4f5; }
.surface-dark .hl, .surface-dark .overline { color: var(--accent); }
.surface-dark .btn-secondary { border-color: var(--bg-paper); color: var(--bg-paper); }
.surface-dark .card {
  background-color: var(--bg-paper);
  color: var(--text-body);
  border: 2px solid var(--text-body);
  box-shadow: 4px 4px 0 var(--text-body);
}
.surface-dark .card .hl, .surface-dark .card .overline { color: var(--brand); }
.surface-dark .card a { color: var(--brand); }

/* 组件样式 */
.overline { display: block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; margin-bottom: 0.5em; }
.hl { color: var(--brand); }
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  padding: 0.8em 1.6em; font-size: 1rem; font-weight: 600;
  text-decoration: none; border: none; cursor: pointer;
  background: var(--accent); color: var(--bg-dark);
  transition: transform 0.2s ease, background 0.2s ease;
}
.btn:hover { transform: translateY(-2px); background: #c95ce0; }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn-secondary { background: transparent; border: 2px solid var(--text-body); color: var(--text-body); }
.card { padding: var(--gap); border: var(--card-border); box-shadow: var(--card-shadow); background: var(--bg-paper); color: var(--text-body); }
table { width: 100%; border-collapse: collapse; margin-bottom: var(--gap); }
th, td { text-align: left; padding: 0.6em 0.8em; border-bottom: 1px solid currentColor; }
th { font-weight: 600; }
details { border: var(--card-border); padding: 0.8em 1em; margin-bottom: var(--gap); background: var(--bg-paper); }
summary { cursor: pointer; font-weight: 600; list-style: none; user-select: none; }
summary::-webkit-details-marker { display: none; }
summary::marker { display: none; content: ""; }

/* 步骤条 */
.step-list { counter-reset: step; list-style: none; padding: 0; }
.step-list li { position: relative; padding-left: 2.5em; margin-bottom: var(--gap); }
.step-list li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 1.8em; height: 1.8em; background: var(--accent); color: var(--bg-dark);
  display: grid; place-items: center; font-weight: 700;
}

/* SVG 动效 */
.grid-node { opacity: 0.2; fill: var(--accent); transform-box: fill-box; transform-origin: center; }
.grid-node:nth-child(1) { animation: nodePulse 5s ease-in-out infinite 0s; }
.grid-node:nth-child(2) { animation: nodePulse 5s ease-in-out infinite 0.5s; }
.grid-node:nth-child(3) { animation: nodePulse 5s ease-in-out infinite 1.0s; }
.grid-node:nth-child(4) { animation: nodePulse 5s ease-in-out infinite 1.5s; }
.grid-node:nth-child(5) { animation: nodePulse 5s ease-in-out infinite 2.0s; }
.grid-node:nth-child(6) { animation: nodePulse 5s ease-in-out infinite 2.5s; }
@keyframes nodePulse {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.1); }
}
.flow-path {
  stroke-dasharray: 1; stroke-dashoffset: 0; stroke: var(--accent); stroke-width: 2; fill: none;
  animation: dashFlow 3s linear infinite;
}
@keyframes dashFlow { to { stroke-dashoffset: -1; } }
.bubble-float { animation: floatBubble 4s ease-in-out infinite alternate; }
@keyframes floatBubble {
  0% { transform: translateY(0); opacity: 0.85; }
  100% { transform: translateY(-6px); opacity: 1; }
}
.notification-slide { animation: slideNotif 6s ease-in-out infinite alternate; }
@keyframes slideNotif {
  0% { transform: translateX(-4px); opacity: 0.7; }
  100% { transform: translateX(4px); opacity: 1; }
}

/* 响应式与无障碍 */
@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
  .flex-row { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* 导航与页脚 */
header { position: sticky; top: 0; z-index: 100; background: var(--bg-paper); border-bottom: 1px solid rgba(0,0,0,0.08); }
.surface-dark header { background: var(--bg-dark); border-color: rgba(255,255,255,0.08); }
.nav-inner { display: flex; justify-content: space-between; align-items: center; padding: 0.8em var(--gap); }
.nav-links { display: flex; gap: 1.5em; list-style: none; margin: 0; padding: 0; }
.nav-links a { text-decoration: none; font-weight: 500; color: inherit; }
.nav-links a[aria-current="page"] { font-weight: 700; text-decoration: underline; }
.footer-inner { text-align: center; padding: var(--section-y) 0; border-top: 1px solid currentColor; }
.footer-links { list-style: none; padding: 0; margin: 0 0 1em 0; display: flex; justify-content: center; gap: 1.5em; }
.footer-links a { text-decoration: none; color: inherit; }
.brand-logo { height: 32px; width: auto; vertical-align: middle; }
.logo-text { font-weight: 700; font-size: 1.1rem; margin-left: 0.5em; vertical-align: middle; }
.scene-tag { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 0.2em 0.5em; margin-bottom: 0.4em; border: 1px solid currentColor; }
.text-muted { opacity: 0.7; }
</style>
