:root {
  --color-dark: #2D1438;
  --color-paper: #F6F3F7;
  --color-text: #1F1523;
  --color-brand: #9E13DD;
  --color-accent: #6EEDA8;
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 1px solid rgba(31, 21, 35, 0.16);
  --card-shadow: none;
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 960px;
  --font-main: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "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); background: var(--color-paper); color: var(--color-text); line-height: 1.75; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* Typography */
h1, h2, h3 { font-weight: 600; line-height: 1.25; letter-spacing: 0; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: var(--gap); }
h3 { font-size: 1.25rem; margin-bottom: 0.5em; }
p { margin-bottom: 1em; max-width: 38em; }
.eyebrow { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; margin-bottom: 0.5em; display: inline-block; }
.paper-surface .eyebrow { color: var(--color-brand); }
.dark-surface .eyebrow { color: var(--color-accent); }
.hl { font-weight: 800; }
.paper-surface .hl { color: var(--color-brand); }
.dark-surface .hl { color: var(--color-accent); }

/* Layout */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding-top: var(--section-y); padding-bottom: var(--section-y); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); align-items: center; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--gap); }

/* Surface Colors */
.paper-surface { background: var(--color-paper); color: var(--color-text); }
.dark-surface { background: var(--color-dark); color: var(--color-paper); }
.dark-surface .hl { color: var(--color-accent); }
.dark-surface a:not(.btn) { color: var(--color-accent); }
.card-panel { background: var(--color-paper); border: var(--card-border); border-radius: var(--radius-card); padding: 2rem; box-shadow: var(--card-shadow); }
.dark-surface .card-panel { background: rgba(246, 243, 247, 0.08); border-color: rgba(246, 243, 247, 0.15); color: var(--color-paper); }

/* Components */
.btn { display: inline-flex; align-items: center; gap: 0.5em; height: 52px; padding: 0 1.5rem; border-radius: var(--radius-btn); font-weight: 600; font-size: 1rem; cursor: pointer; transition: transform 0.2s ease, background 0.2s ease, box-shadow 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); background: #5bd893; }
.btn-secondary { background: transparent; border: 2px solid var(--color-text); color: var(--color-text); }
.paper-surface .btn-secondary { border-color: var(--color-text); color: var(--color-text); }
.dark-surface .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.btn-icon { width: 20px; height: 20px; }

table { width: 100%; min-width: 0; border-collapse: collapse; margin: 1.5em 0; }
th, td { padding: 0.75em 1rem; text-align: left; border-bottom: 1px solid var(--card-border); overflow-wrap: break-word; }
th { font-weight: 600; }
.dark-surface th, .dark-surface td { border-bottom-color: rgba(246, 243, 247, 0.15); }

details { margin-bottom: 1em; border: var(--card-border); border-radius: var(--radius-card); padding: 1rem; background: rgba(246, 243, 247, 0.5); }
.dark-surface details { background: rgba(246, 243, 247, 0.05); border-color: rgba(246, 243, 247, 0.15); }
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.2em; transition: transform 0.2s; }
details[open] summary::after { transform: rotate(45deg); }
details > div { padding-top: 1em; }

/* Header & Footer */
header { position: sticky; top: 0; z-index: 100; background: var(--color-paper); border-bottom: 1px solid var(--card-border); padding: 1rem 0; }
.dark-surface header { background: var(--color-dark); border-bottom-color: rgba(246, 243, 247, 0.1); }
.nav-inner { display: flex; justify-content: space-between; align-items: center; }
.brand { display: flex; align-items: center; gap: 0.75rem; font-weight: 700; font-size: 1.1rem; }
.brand img { width: 32px; height: 32px; object-fit: contain; }
nav ul { display: flex; gap: 1.5rem; align-items: center; }
nav a { font-weight: 500; transition: color 0.2s; }
nav a:hover, nav a[aria-current="page"] { color: var(--color-brand); }
.dark-surface nav a:hover, .dark-surface nav a[aria-current="page"] { color: var(--color-accent); }
footer { padding: 3rem 0; border-top: 1px solid var(--card-border); text-align: center; font-size: 0.9rem; opacity: 0.8; }
.dark-surface footer { border-top-color: rgba(246, 243, 247, 0.1); }

/* SVG Animations */
.svg-anim { width: 100%; height: auto; max-width: 500px; }
.svg-anim path, .svg-anim rect, .svg-anim circle, .svg-anim line, .svg-anim polyline { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; }
@keyframes draw-path { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
@keyframes float-y { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes breathe { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
@keyframes slide-x { 0% { transform: translateX(20px); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } }
.draw-anim { animation: draw-path 6s ease forwards; }
.float-anim { animation: float-y 5s ease-in-out infinite; }
.breathe-anim { animation: breathe 3s ease-in-out infinite; }
.slide-anim { animation: slide-x 5s ease forwards; }
.svg-sub { transform-box: fill-box; transform-origin: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .hero-layout { flex-direction: column-reverse; }
  .svg-anim { max-width: 100%; margin-bottom: 1.5rem; }
}

/* 兜底：裁掉横向溢出 */
div {
  overflow-x: clip;
}
