*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-body);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

:root {
  --color-dark: #271334;
  --color-paper: #E9E8EA;
  --color-body: #1D1523;
  --color-brand: #8A13DD;
  --color-accent: #9EED6E;
  --color-text-light: #E9E8EA;
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 2px solid var(--color-body);
  --card-shadow: 4px 4px 0 var(--color-body);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 960px;
}

/* 表面取色变量覆盖 */
.surface-dark { background: var(--color-dark); color: var(--color-text-light); }
.surface-dark .eyebrow, .surface-dark .hl { color: var(--color-accent); }
.surface-dark a:not(.btn):not(img) { color: var(--color-accent); text-decoration: underline; text-underline-offset: 3px; }
.surface-dark .card { background: var(--color-paper); color: var(--color-body); border-color: var(--color-body); }
.surface-dark .card .eyebrow, .surface-dark .card .hl { color: var(--color-brand); }
.surface-dark table td, .surface-dark table th { color: var(--color-body); }
.surface-dark .table-row:nth-child(even) { background: rgba(0,0,0,0.06); }

.surface-light { background: var(--color-paper); color: var(--color-body); }
.surface-light .eyebrow, .surface-light .hl { color: var(--color-brand); }
.surface-light a:not(.btn):not(img) { color: var(--color-brand); text-decoration: underline; text-underline-offset: 3px; }
.surface-light .card { background: var(--color-paper); color: var(--color-body); border-color: var(--color-body); }

/* 容器与网格 */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding-block: var(--section-y); position: relative; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.grid-2 > *, .grid-3 > * { min-width: 0; }

/* 排版 */
h1, h2, h3 { font-weight: 700; letter-spacing: 0.02em; line-height: 1.2; }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: var(--gap); }
h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }
p { max-width: 38em; margin-bottom: 1rem; }
.eyebrow { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 0.5rem; display: block; }
.hl { font-weight: 800; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.85rem 1.6rem; border-radius: var(--radius-btn);
  font-weight: 600; font-size: 1rem; cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  text-align: center; justify-content: center; border: none;
}
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-secondary { background: transparent; border: 2px solid currentColor; }
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.surface-dark .btn-primary { background: var(--color-accent); color: var(--color-dark); }
.surface-dark .btn-secondary { border-color: var(--color-text-light); color: var(--color-text-light); }

/* 卡片 */
.card {
  border: var(--card-border); border-radius: var(--radius-card);
  box-shadow: var(--card-shadow); padding: var(--gap);
  background: var(--color-paper); margin-bottom: var(--gap);
  width: 100%; min-width: 0;
}
.card h3 { margin-top: 0; }

/* 表格 */
table { width: 100%; border-collapse: collapse; margin: var(--gap) 0; table-layout: auto; min-width: 0; }
th, td { padding: 0.75rem 1rem; border-bottom: 1px solid currentColor; text-align: left; min-width: 0; word-break: break-word; overflow-wrap: anywhere; }
th { font-weight: 700; }
tr:last-child td { border-bottom: none; }

/* FAQ */
details { border: var(--card-border); border-radius: var(--radius-card); margin-bottom: var(--gap); padding: 1rem; background: var(--color-paper); }
summary { 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.2rem; transition: transform 0.2s; }
details[open] summary::after { transform: rotate(45deg); }
details p { margin-top: 0.75rem; }

/* 页头页脚 */
header { position: sticky; top: 0; z-index: 100; background: var(--color-paper); border-bottom: 1px solid currentColor; backdrop-filter: blur(8px); }
.surface-dark header { background: var(--color-dark); }
.nav-inner { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.brand { display: flex; align-items: center; gap: 0.75rem; font-weight: 800; font-size: 1.2rem; }
.brand img { height: 32px; width: auto; }
nav ul { display: flex; gap: 1.5rem; }
nav a { font-weight: 500; padding: 0.5rem 0; position: relative; }
nav a[aria-current="page"], nav a:hover { color: var(--color-brand); }
.surface-dark nav a[aria-current="page"], .surface-dark nav a:hover { color: var(--color-accent); }
footer { padding: var(--section-y) 0; border-top: 1px solid currentColor; margin-top: var(--section-y); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--gap); }
.footer-links { display: flex; gap: 1rem; }

/* SVG 动效基础 */
.svg-panel { width: 100%; height: auto; max-width: 100%; overflow: hidden; }
.svg-panel svg { width: 100%; height: auto; }
.grid-node { stroke-dasharray: 1; stroke-dashoffset: 0; fill: none; stroke-width: 2; }
@keyframes nodeGlow { 0%, 100% { stroke-dashoffset: 1; stroke-opacity: 0.2; } 50% { stroke-dashoffset: 0; stroke-opacity: 1; stroke-width: 3; } }
.g1 { animation: nodeGlow 4s ease-in-out infinite 0s; }
.g2 { animation: nodeGlow 4s ease-in-out infinite 0.5s; }
.g3 { animation: nodeGlow 4s ease-in-out infinite 1s; }
.g4 { animation: nodeGlow 4s ease-in-out infinite 1.5s; }
.g5 { animation: nodeGlow 4s ease-in-out infinite 2s; }
.float-slow { animation: floatY 6s ease-in-out infinite; }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.draw-path { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawDash 5s ease-in-out infinite; }
@keyframes drawDash { 0%, 100% { stroke-dashoffset: 1; } 50% { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .g1,.g2,.g3,.g4,.g5,.float-slow,.draw-path { animation: none !important; }
}
