:root {
  --color-dark: #2D1438;
  --color-paper: #F6F3F7;
  --color-text: #1F1523;
  --color-brand: #9E13DD;
  --color-accent: #6EEDA8;
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(31, 21, 35, 0.3);
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1120px;
  --font-title-weight: 600;
  --font-title-lh: 1.25;
  --font-body-lh: 1.55;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--color-paper);
  color: var(--color-text);
  line-height: var(--font-body-lh);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}

/* Typography */
h1, h2, h3, h4 {
  font-weight: var(--font-title-weight);
  line-height: var(--font-title-lh);
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  margin-bottom: var(--gap);
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: calc(var(--gap) * 1.2);
}

h3 {
  font-size: 1.25rem;
  margin-top: calc(var(--gap) * 1.5);
  margin-bottom: var(--gap);
}

p {
  margin-bottom: var(--gap);
  max-width: 38em;
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
  color: var(--color-brand);
}

.dark-face .eyebrow {
  color: #ffffff;
}

.hl {
  color: var(--color-brand);
}

.dark-face .hl {
  color: #ffffff;
}

/* Layout */
section {
  padding-block: var(--section-y);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
  align-items: center;
}

.flex-col {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.text-center {
  text-align: center;
}

.mt-lg {
  margin-top: calc(var(--section-y) * 1.5);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 52px;
  padding: 0 1.5rem;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

.btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--color-text);
  color: var(--color-text);
}

.dark-face .btn-secondary {
  border-color: var(--color-paper);
  color: var(--color-paper);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* Cards */
.card {
  background: #ffffff;
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  border: var(--card-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px -12px rgba(31, 21, 35, 0.35);
}

.dark-face .card {
  background: rgba(255, 255, 255, 0.06);
}

.paper-face {
  background: var(--color-paper);
  color: var(--color-text);
}

.paper-face .hl { color: var(--color-brand); }
.paper-face .eyebrow { color: var(--color-brand); }

/* Tables */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-card);
  background: #fff;
  box-shadow: var(--card-shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 320px;
}

th, td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  vertical-align: top;
}

th {
  font-weight: 600;
  width: 40%;
  background: rgba(0,0,0,0.02);
}

td {
  word-break: break-all;
  overflow-wrap: anywhere;
}

tr:last-child td, tr:last-child th {
  border-bottom: none;
}

/* FAQ */
details {
  background: #ffffff;
  border-radius: var(--radius-card);
  padding: var(--gap);
  margin-bottom: var(--gap);
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s ease;
}

details:hover {
  box-shadow: 0 4px 16px rgba(31, 21, 35, 0.08);
}

summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
}

summary::-webkit-details-marker { display: none; }
summary::marker { display: none; content: ""; }

summary::after {
  content: "+";
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--color-brand);
  transition: transform 0.2s ease;
}

details[open] summary::after {
  content: "−";
}

details p {
  margin-top: var(--gap);
  color: #3d3440;
  line-height: 1.65;
}

/* Lists */
ul.check-list {
  list-style: none;
  padding-left: 0;
}

ul.check-list li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.75rem;
}

ul.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35rem;
  width: 1.2rem;
  height: 1.2rem;
  background: var(--color-brand);
  mask: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>') no-repeat center;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>') no-repeat center;
}

/* Header & Footer */
header {
  position: sticky;
  top: 0;
  background: var(--color-paper);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  z-index: 100;
  backdrop-filter: saturate(180%) blur(8px);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block: var(--gap);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 700;
  font-size: 1.1rem;
}

.brand img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

nav a {
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease;
}

nav a:hover, nav a[aria-current="page"] {
  background: rgba(0,0,0,0.04);
  color: var(--color-brand);
}

footer {
  background: var(--color-dark);
  color: var(--color-paper);
  padding-block: var(--section-y);
  margin-top: var(--section-y);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--gap);
}

.footer-grid h4 {
  color: var(--color-accent);
  margin-bottom: 0.8rem;
  font-size: 1rem;
}

.footer-grid ul {
  list-style: none;
}

.footer-grid a {
  color: rgba(246, 243, 247, 0.8);
  text-decoration: none;
  display: block;
  padding: 0.3rem 0;
  transition: color 0.2s ease;
}

.footer-grid a:hover {
  color: var(--color-accent);
}

.copyright {
  margin-top: var(--gap);
  padding-top: var(--gap);
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 0.85rem;
  color: rgba(246, 243, 247, 0.6);
}

/* SVG Animation Base */
.svg-panel {
  width: 100%;
  height: auto;
  max-width: 100%;
}

.svg-panel svg {
  width: 100%;
  height: auto;
  display: block;
}

.node-light {
  transform-box: fill-box;
  transform-origin: center;
  animation: grid-light 5s ease-in-out infinite;
}

.node-light:nth-child(odd) { animation-delay: 0.2s; }
.node-light:nth-child(3n) { animation-delay: 0.7s; }
.node-light:nth-child(5n) { animation-delay: 1.2s; }
.node-light:nth-child(7n) { animation-delay: 1.8s; }

.draw-line {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-path 3.5s ease forwards;
}

.bubble-float {
  transform-box: fill-box;
  transform-origin: center;
  animation: float-up 4s ease-in-out infinite alternate;
}

.bubble-float.delay-1 { animation-delay: 0.5s; }
.bubble-float.delay-2 { animation-delay: 1.2s; }

@keyframes grid-light {
  0%, 100% { opacity: 0.25; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}

@keyframes draw-path {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}

@keyframes float-up {
  0% { transform: translateY(0); }
  100% { transform: translateY(-6px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .node-light, .bubble-float {
    opacity: 1 !important;
    transform: none !important;
  }
}

@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .header-inner { flex-wrap: wrap; gap: 0.5rem; }
  nav { order: 3; width: 100%; justify-content: space-around; }
  h1 { font-size: clamp(1.8rem, 6vw, 2.6rem); }
}
