:root {
  --color-primary: #7c3aed;
  --color-primary-light: #a78bfa;
  --color-secondary: #ec4899;
  --color-accent: #c084fc;
  --color-bg: #f5f3ff;
  --color-bg-alt: #ffffff;
  --color-surface: rgba(255, 255, 255, 0.72);
  --color-surface-hover: rgba(255, 255, 255, 0.88);
  --color-text: #1e1b4b;
  --color-text-muted: #6b7280;
  --color-border: rgba(124, 58, 237, 0.18);
  --color-focus: #7c3aed;
  
  --font-stack: 'PingFang SC', 'Noto Sans SC', 'Segoe UI Variable Text', system-ui, -apple-system, sans-serif;
  --radius-sm: 0.5rem;
  --radius-md: 0.875rem;
  --radius-lg: 1.25rem;
  --radius-xl: 1.5rem;
  
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2.5rem;
  --spacing-xl: 4rem;
  
  --shadow-soft: 0 4px 24px rgba(124, 58, 237, 0.10);
  --shadow-card: 0 8px 32px rgba(124, 58, 237, 0.12);
  --shadow-glow: 0 0 0 3px rgba(124, 58, 237, 0.15);
  
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --transition-fast: 0.2s var(--ease-out);
  --transition-base: 0.35s var(--ease-out);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-stack);
  font-size: clamp(0.95rem, 0.85rem + 0.4vw, 1.05rem);
  line-height: 1.75;
  color: var(--color-text);
  background: var(--color-bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

.container {
  width: min(92%, 1280px);
  margin-inline: auto;
  padding: 0 var(--spacing-sm);
}

/* Typography */
h1, h2, h3, h4 { letter-spacing: -0.02em; line-height: 1.25; font-weight: 700; text-wrap: balance; }
h1 { font-size: clamp(2rem, 1.5rem + 3vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 1.2rem + 2vw, 2.25rem); margin-bottom: var(--spacing-md); }
h3 { font-size: clamp(1.25rem, 1.1rem + 1.2vw, 1.5rem); margin-bottom: var(--spacing-xs); }
p { margin-bottom: var(--spacing-sm); color: var(--color-text-muted); }
strong { color: var(--color-text); font-weight: 600; }

/* Layout Helpers */
.grid-auto {
  display: grid;
  gap: var(--spacing-md);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}
.flex-center { display: flex; align-items: center; justify-content: center; }
.section { padding: var(--spacing-xl) 0; }
.section-header { text-align: center; max-width: 780px; margin: 0 auto var(--spacing-lg); }

/* Header & Nav */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(245, 243, 255, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 0.75rem; font-weight: 600; font-size: 1.1rem; }
.brand img { width: 32px; height: 32px; object-fit: contain; }
.nav-links { display: flex; gap: var(--spacing-sm); }
.nav-link {
  padding: 0.4rem 0.8rem; border-radius: var(--radius-sm);
  font-size: 0.95rem; color: var(--color-text-muted); transition: var(--transition-fast);
}
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--color-primary); background: rgba(124, 58, 237, 0.06); }
.nav-link[aria-current="page"] { font-weight: 600; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.5rem; border-radius: var(--radius-md);
  font-weight: 600; cursor: pointer; border: none; font-family: inherit;
  transition: var(--transition-base); position: relative; overflow: hidden;
}
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: #fff; box-shadow: var(--shadow-soft);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); filter: brightness(1.05); }
.btn-primary:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }
.btn-outline {
  background: transparent; border: 1.5px solid var(--color-primary-light); color: var(--color-primary);
}
.btn-outline:hover { background: rgba(124, 58, 237, 0.08); border-color: var(--color-primary); }

/* Glass Card */
.glass-card {
  background: var(--color-surface);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  box-shadow: var(--shadow-soft);
  transition: var(--transition-base);
}
.glass-card:hover { background: var(--color-surface-hover); transform: translateY(-3px); box-shadow: var(--shadow-card); }

/* Tables */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--color-border); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { padding: 0.85rem 1rem; text-align: left; border-bottom: 1px solid var(--color-border); }
th { background: rgba(124, 58, 237, 0.06); font-weight: 600; }
tr:last-child td { border-bottom: none; }
tr:nth-child(even) { background: rgba(245, 243, 255, 0.5); }

/* FAQ (Details/Summary) */
.faq-item { margin-bottom: 0.75rem; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: #fff; }
.faq-summary {
  padding: 1rem 1.25rem; cursor: pointer; font-weight: 600; display: flex; justify-content: space-between; align-items: center;
  list-style: none; user-select: none; transition: var(--transition-fast);
}
.faq-summary::-webkit-details-marker { display: none; }
.faq-summary::after {
  content: "+"; font-size: 1.25rem; color: var(--color-primary); font-weight: 400; transition: transform var(--transition-fast);
}
.faq-item[open] .faq-summary::after { transform: rotate(45deg); }
.faq-content { padding: 0 1.25rem 1rem; color: var(--color-text-muted); line-height: 1.7; }
.faq-content p { margin-bottom: 0.5rem; }

/* Links List */
.related-list { display: flex; flex-direction: column; gap: 0.75rem; }
.related-item {
  display: flex; align-items: baseline; gap: 0.75rem; padding: 0.75rem 1rem;
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-md);
  transition: var(--transition-fast);
}
.related-item:hover { border-color: var(--color-primary-light); background: rgba(245, 243, 255, 0.6); }
.related-num { font-weight: 700; color: var(--color-primary-light); min-width: 1.5rem; }
.related-title { font-weight: 600; color: var(--color-text); }
.related-desc { font-size: 0.9rem; color: var(--color-text-muted); margin-top: 0.25rem; }

/* Footer */
.site-footer {
  margin-top: var(--spacing-xl); padding: var(--spacing-lg) 0; border-top: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.6); backdrop-filter: blur(8px);
}
.footer-grid { display: grid; gap: var(--spacing-md); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.footer-col h4 { margin-bottom: 0.75rem; font-size: 1rem; color: var(--color-text); }
.footer-col ul { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-col a { font-size: 0.95rem; color: var(--color-text-muted); transition: var(--transition-fast); }
.footer-col a:hover { color: var(--color-primary); }
.footer-bottom { margin-top: var(--spacing-md); padding-top: var(--spacing-md); border-top: 1px dashed var(--color-border); text-align: center; font-size: 0.85rem; color: var(--color-text-muted); }

/* SVG Animation Classes */
.svg-draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawPath 5s ease-out forwards, breathe 7s ease-in-out infinite 5s;
  transform-box: fill-box;
  transform-origin: center;
}
.svg-draw.stagger-1 { animation-delay: 0s, 5s; }
.svg-draw.stagger-2 { animation-delay: 0.8s, 5.8s; }
.svg-draw.stagger-3 { animation-delay: 1.6s, 6.6s; }

@keyframes drawPath {
  0% { stroke-dashoffset: 1; }
  20% { stroke-dashoffset: 1; }
  40% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 0; }
}
@keyframes breathe {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.88; transform: scale(1.015); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .svg-draw { stroke-dashoffset: 0; animation: none; }
}

/* Responsive */
@media (max-width: 768px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: 0.75rem 0; }
  .nav-links { width: 100%; flex-wrap: wrap; justify-content: center; margin-top: 0.5rem; }
  .grid-auto { grid-template-columns: 1fr; }
  .section { padding: var(--spacing-lg) 0; }
}
