:root {
  --color-dark: #1B1231;
  --color-paper: #DBD4ED;
  --color-body: #191523;
  --color-brand: #5214EB;
  --color-accent: #9977EE;
  --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;
  --font-main: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  line-height: 1.75;
  color: var(--color-body);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.face-paper {
  --text-primary: var(--color-body);
  --text-secondary: rgba(25, 21, 35, 0.6);
  --highlight: var(--color-brand);
  --link-color: var(--color-brand);
}
.dark-face {
  --text-primary: var(--color-paper);
  --text-secondary: rgba(219, 212, 237, 0.65);
  --highlight: var(--color-accent);
  --link-color: var(--color-accent);
}
.light-card {
  --text-primary: var(--color-body);
  --text-secondary: rgba(25, 21, 35, 0.5);
  --highlight: var(--color-brand);
  --link-color: var(--color-brand);
  background-color: var(--color-paper);
}

.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding: var(--section-y) 0; }

h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: var(--gap);
  text-wrap: balance;
}
h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}
p { margin-bottom: 1.25rem; max-width: 38em; }
.eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--highlight);
  margin-bottom: 0.5rem;
  display: block;
}
.hl { color: var(--highlight); }

a { color: var(--link-color); text-decoration: underline; text-underline-offset: 3px; }
a:hover { opacity: 0.85; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1.5rem;
  height: 52px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
  border: none;
}
.btn-secondary {
  background: transparent;
  border: 1px solid var(--text-primary);
  color: var(--text-primary);
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--highlight); outline-offset: 2px; }
.icon { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.5; fill: none; vertical-align: middle; }

.grid { display: grid; gap: var(--gap); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.card {
  padding: var(--gap);
  border-radius: var(--radius-card);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
}
.panel {
  background-color: var(--color-dark);
  border-radius: var(--radius-card);
  padding: var(--gap);
  overflow: hidden;
}

table { width: 100%; border-collapse: collapse; margin: var(--gap) 0; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--text-secondary); }
th { font-weight: 700; }
td:first-child { font-weight: 600; }

dl { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
dt { font-weight: 700; margin-bottom: 0.25rem; display: flex; align-items: center; gap: 0.5rem; }
dd { margin-left: 0; padding-left: 1.5rem; color: var(--text-secondary); }

details {
  margin-bottom: 1rem;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--color-paper);
}
.summary-row { padding: 1rem; cursor: pointer; font-weight: 600; list-style: none; position: relative; }
.summary-row::-webkit-details-marker { display: none; }
.summary-row::after { content: "+"; position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); }
details[open] .summary-row::after { content: "-"; }
details > div { padding: 0 1rem 1rem; line-height: 1.7; color: var(--text-secondary); }

.step-list { list-style: none; counter-reset: step; }
.step-list li {
  counter-increment: step;
  position: relative;
  padding: 1.25rem 0 1.25rem 3.5rem;
  border-bottom: 1px solid var(--text-secondary);
}
.step-list li:last-child { border-bottom: none; }
.step-list li::before {
  content: counter(step, zero-width-digit);
  position: absolute;
  left: 0;
  top: 1.25rem;
  width: 28px;
  height: 28px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-paper);
  border-bottom: 1px solid var(--text-secondary);
  backdrop-filter: blur(8px);
}
.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}
.logo-link { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--text-primary); font-weight: 700; }
.logo-img { width: 32px; height: 32px; object-fit: contain; }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { text-decoration: none; color: var(--text-primary); font-weight: 500; font-size: 0.95rem; }
.nav-links a[aria-current="page"] { color: var(--highlight); font-weight: 700; }
@media (max-width: 768px) {
  .nav-links { gap: 1rem; }
  .nav-links .hide-mobile { display: none; }
}

footer { padding: var(--section-y) 0; border-top: 1px solid var(--text-secondary); }
.footer-inner { display: flex; flex-direction: column; gap: 2rem; align-items: center; text-align: center; }
.footer-links { display: flex; gap: 2rem; flex-wrap: wrap; justify-content: center; }
.footer-links a { text-decoration: none; color: var(--text-secondary); font-size: 0.9rem; }
.footer-copy { font-size: 0.85rem; color: var(--text-secondary); }

/* SVG Animation Utilities */
.svg-anim { width: 100%; height: auto; max-width: 100%; display: block; }
.anim-draw { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawPath 6s ease-in-out infinite alternate; }
.anim-flow { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: dashFlow 4s linear infinite; }
.anim-float { animation: floatUp 5s ease-in-out infinite alternate; }
.anim-breathe { animation: breatheDot 3s ease-in-out infinite; }
.anim-slide { animation: slideInPanel 6s ease-out forwards; }
.anim-twinkle { animation: twinkleStar 4s ease-in-out infinite alternate; }

@keyframes drawPath { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
@keyframes dashFlow { 0% { stroke-dashoffset: 1; } 50% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 1; } }
@keyframes floatUp { 0% { transform: translateY(0); } 100% { transform: translateY(-8px); } }
@keyframes breatheDot { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
@keyframes slideInPanel { 0% { transform: translateX(24px); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } }
@keyframes twinkleStar { 0% { opacity: 0.2; } 100% { opacity: 0.9; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
