:root {
  --color-dark: #10112D;
  --color-paper: #F5F0E5;
  --color-text: #151523;
  --color-brand: #1416EB;
  --color-accent: #89ED6E;
  --color-text-light: #F5F0E5;

  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 1px solid rgba(21, 21, 35, 0.16);
  --card-shadow: none;
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1280px;
  --line-height-body: 1.65;
  --font-weight-heading: 600;
  --line-height-heading: 1.25;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: var(--line-height-body);
  color: var(--color-text);
  background-color: var(--color-paper);
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* Typography */
h1, h2, h3, h4 {
  font-weight: var(--font-weight-heading);
  line-height: var(--line-height-heading);
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  letter-spacing: 0;
}

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;
}

.hl {
  color: var(--color-brand);
}

.surface-dark .hl {
  color: var(--color-accent);
}

/* Layout */
.container {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}

.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;
}

.surface-dark {
  background-color: var(--color-dark);
  color: var(--color-text-light);
}

.surface-dark a:not(.btn-primary):not(.btn-secondary) {
  color: var(--color-accent);
}

.surface-dark .hl {
  color: var(--color-accent);
}

.surface-paper {
  background-color: var(--color-paper);
  color: var(--color-text);
}

.surface-paper a:not(.btn-primary):not(.btn-secondary) {
  color: var(--color-brand);
}

.surface-paper .hl {
  color: var(--color-brand);
}

/* Components */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: var(--color-accent);
  color: var(--color-dark);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius-btn);
  transition: transform 0.2s ease, filter 0.2s ease;
  white-space: nowrap;
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-text);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius-btn);
  transition: transform 0.2s ease, background-color 0.2s ease;
  white-space: nowrap;
}

.surface-dark .btn-secondary {
  color: var(--color-text-light);
  border-color: var(--color-text-light);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  background-color: rgba(0,0,0,0.05);
}

.card {
  background-color: var(--color-paper);
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: var(--gap);
  box-shadow: var(--card-shadow);
}

.surface-dark .card {
  background-color: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.95rem;
}

th, td {
  padding: 0.875rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--card-border);
}

th {
  font-weight: 600;
}

details {
  border: var(--card-border);
  border-radius: var(--radius-card);
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: background-color 0.2s ease;
}

details[open] {
  background-color: rgba(0,0,0,0.02);
}

summary {
  padding: 1rem 1rem 1rem 2.5rem;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  position: relative;
}

summary::-webkit-details-marker {
  display: none;
}

summary::before {
  content: "+";
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--color-brand);
}

.details-open summary::before {
  content: "-";
}

details[open] summary::before {
  content: "-";
}

details p {
  padding: 0 1rem 1rem;
  line-height: 1.7;
}

.badge-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background-color: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: 8px;
  margin-right: 0.75rem;
  flex-shrink: 0;
}

.step-list li {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.step-list li p {
  margin-bottom: 0;
}

.nav-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(245, 240, 229, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--card-border);
}

.surface-dark .nav-header {
  background-color: rgba(16, 17, 45, 0.95);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  font-weight: 500;
  font-size: 0.95rem;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  opacity: 1;
  color: var(--color-brand);
}

.surface-dark .nav-links a:hover,
.surface-dark .nav-links a[aria-current="page"] {
  color: var(--color-accent);
}

.footer {
  padding-block: 3rem;
  border-top: 1px solid var(--card-border);
  margin-top: var(--section-y);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}

.footer-col h4 {
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-col a {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  opacity: 0.8;
}

.footer-col a:hover {
  opacity: 1;
  color: var(--color-brand);
}

.surface-dark .footer-col a:hover {
  color: var(--color-accent);
}

/* SVG Animation Classes */
svg.panel-svg {
  width: 100%;
  height: auto;
  max-width: 100%;
}

.anim-draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLine 6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes drawLine {
  0%, 100% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
}

.anim-rotate {
  animation: rotateSync 8s cubic-bezier(0.34, 1.56, 0.64, 1) infinite alternate;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes rotateSync {
  from { transform: rotate(-12deg) scale(0.96); opacity: 0.85; }
  to { transform: rotate(12deg) scale(1.04); opacity: 1; }
}

.anim-float {
  animation: floatPanel 5s ease-in-out infinite;
}

@keyframes floatPanel {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.typing-dot {
  animation: blinkDot 1.5s infinite both;
}

.typing-dot:nth-child(2) { animation-delay: 0.25s; }
.typing-dot:nth-child(3) { animation-delay: 0.5s; }

@keyframes blinkDot {
  0%, 80%, 100% { opacity: 0.2; }
  40% { opacity: 1; }
}

/* Focus & Accessibility */
:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

.surface-dark :focus-visible {
  outline-color: var(--color-accent);
}

@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;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .hero-layout {
    flex-direction: column-reverse;
  }
  .nav-links {
    display: none;
  }
}
