:root {
  --color-dark: #231334;
  --color-paper: #F5F3F7;
  --color-text: #1C1523;
  --color-brand: #7D14EB;
  --color-accent: #EDD26E;
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 2px solid var(--color-text);
  --card-shadow: 4px 4px 0 var(--color-text);
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 960px;
  --line-h: 1.55;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  line-height: var(--line-h);
  color: var(--color-text);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* Surface Scoping */
.surface-dark {
  background: var(--color-dark);
  color: var(--color-paper);
}
.surface-dark .hl { color: var(--color-accent); }
.surface-dark a:not(.btn) { color: var(--color-accent); }
.surface-dark .divider { background: var(--color-paper); opacity: 0.15; }
.surface-dark .card {
  background: var(--color-dark);
  border-color: var(--color-paper);
  box-shadow: 4px 4px 0 var(--color-paper);
}

.surface-paper {
  background: var(--color-paper);
  color: var(--color-text);
}
.surface-paper .hl { color: var(--color-brand); }
.surface-paper a:not(.btn) { color: var(--color-brand); }
.surface-paper .divider { background: var(--color-text); opacity: 0.2; }
.surface-paper .card {
  background: var(--color-paper);
  border-color: var(--color-text);
  box-shadow: var(--card-shadow);
}

/* Typography */
h1 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
  margin-bottom: var(--gap);
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: var(--gap);
}
h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: calc(var(--gap) / 2);
}
p {
  margin-bottom: var(--gap);
  max-width: 38em;
}

/* Layout & Dividers */
.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}
.divider {
  height: 1px;
  margin: var(--section-y) 0;
  border: none;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}
.hero-layout {
  display: flex;
  align-items: center;
  gap: var(--gap);
}
@media (max-width: 768px) {
  .hero-layout { flex-direction: column; }
}

/* Components */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius-btn);
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease, filter 0.2s ease;
  cursor: pointer;
  border: none;
  font-size: 1rem;
}
.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}
.btn-secondary {
  background: transparent;
  border: 2px solid var(--color-text);
  color: var(--color-text);
}
.surface-dark .btn-secondary {
  border-color: var(--color-paper);
  color: var(--color-paper);
}
.btn-secondary:hover {
  transform: translateY(-2px);
  filter: brightness(0.9);
}
.surface-dark .btn-secondary:hover {
  filter: brightness(1.1);
}

.card {
  padding: var(--gap);
  border-radius: var(--radius-card);
  position: relative;
  transition: transform 0.2s ease;
}
.card:hover {
  transform: translateY(-2px);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--gap);
}
th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid currentColor;
  opacity: 0.85;
}
th { font-weight: 600; }

/* FAQ */
details {
  border: 1px solid currentColor;
  border-radius: var(--radius-card);
  padding: var(--gap);
  margin-bottom: var(--gap);
  background: inherit;
}
summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}
details[open] summary::before {
  transform: rotate(45deg);
}
details p {
  margin-top: var(--gap);
  margin-bottom: 0;
}

/* Navigation */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245, 243, 247, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(28, 21, 35, 0.1);
}
.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 700;
  font-size: 1.25rem;
}
.brand img {
  height: 32px;
  width: auto;
}
.nav-links {
  display: flex;
  gap: var(--gap);
  align-items: center;
}
.nav-links a {
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
}
.nav-links a[aria-current="page"] {
  color: var(--color-brand);
  font-weight: 700;
}
.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-brand);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}
.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after {
  transform: scaleX(1);
}

/* SVG & Animations */
svg {
  width: 100%;
  height: auto;
  max-width: 100%;
  overflow: visible;
}
.anim-float {
  animation: floatAnim 6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.anim-breathe {
  animation: breatheAnim 5s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.anim-slide {
  animation: slideInAnim 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  opacity: 0;
}
.anim-flow {
  animation: flowLineAnim 4s linear infinite;
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.anim-orbit {
  animation: orbitPulseAnim 8s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes floatAnim {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes breatheAnim {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.05); }
}
@keyframes slideInAnim {
  from { opacity: 0; transform: translateX(-24px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes flowLineAnim {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes orbitPulseAnim {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.08); opacity: 0.7; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* Utility */
.text-center { text-align: center; }
.mb-gap { margin-bottom: var(--gap); }
.mt-gap { margin-top: var(--gap); }
.tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: calc(var(--gap) / 2);
  text-transform: uppercase;
}
.surface-dark .tag { color: var(--color-accent); }
.surface-paper .tag { color: var(--color-brand); }

.step-list {
  counter-reset: step;
  list-style: none;
}
.step-list li {
  counter-increment: step;
  margin-bottom: var(--gap);
  padding-left: 2.5rem;
  position: relative;
}
.step-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.75rem;
  height: 1.75rem;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}
.surface-dark .step-list li::before {
  background: var(--color-accent);
  color: var(--color-dark);
}
