:root {
  --c-dark: #21163C;
  --c-paper: #F4F3F7;
  --c-text: #191523;
  --c-brand: #5214EB;
  --c-accent: #ED926E;
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(25, 21, 35, 0.3);
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1280px;
  --font-title-weight: 500;
  --line-height-title: 1.15;
  --line-height-body: 1.75;
}

*, *::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;
  background: var(--c-paper);
  color: var(--c-text);
  line-height: var(--line-height-body);
  font-size: 1.125rem;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding-top: var(--section-y); padding-bottom: var(--section-y); }

/* Typography */
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); font-weight: var(--font-title-weight); line-height: var(--line-height-title); letter-spacing: -0.02em; margin-bottom: 1.5rem; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: var(--font-title-weight); line-height: var(--line-height-title); margin-bottom: 1.5rem; }
h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.3; margin-bottom: 0.75rem; }
p { margin-bottom: 1rem; max-width: 38em; }
.text-small { font-size: 0.875rem; opacity: 0.8; }

/* Theme Colors */
.hl { color: var(--c-brand); }
.tag { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; color: var(--c-brand); margin-bottom: 0.5rem; text-transform: uppercase; }
.dark-surface { background: var(--c-dark); color: var(--c-paper); }
.dark-surface .hl { color: var(--c-accent); }
.dark-surface .tag { color: var(--c-accent); }
.dark-surface .btn-secondary { border-color: var(--c-paper); color: var(--c-paper); }
.dark-surface .card { background: var(--c-paper); color: var(--c-text); }
.dark-surface .card .hl { color: var(--c-brand); }
.dark-surface .card .tag { color: var(--c-brand); }
.dark-surface .btn-primary { color: var(--c-dark); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0 1.5rem; height: 52px; border-radius: var(--radius-btn); font-weight: 600; text-decoration: none; transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease; cursor: pointer; border: none; font-size: 1rem; }
.btn-primary { background: var(--c-accent); color: var(--c-dark); }
.btn-secondary { background: transparent; border: 1px solid var(--c-text); color: var(--c-text); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.btn:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; }

/* Cards & Panels */
.card { background: var(--c-paper); border: var(--card-border); border-radius: var(--radius-card); box-shadow: var(--card-shadow); padding: 1.5rem; transition: box-shadow 0.2s ease; }
.card:hover { box-shadow: 0 12px 32px -12px rgba(25, 21, 35, 0.35); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--gap); }

/* Tables */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 1rem; }
th, td { padding: 0.875rem 1rem; text-align: left; border-bottom: 1px solid rgba(25, 21, 35, 0.1); word-break: break-word; overflow-wrap: anywhere; min-width: 0; }
th { font-weight: 600; }
.dark-surface table th, .dark-surface table td { border-bottom-color: rgba(244, 243, 247, 0.15); }

/* FAQ */
details { margin-bottom: 1rem; border: 1px solid rgba(25, 21, 35, 0.1); border-radius: var(--radius-card); padding: 1rem 1.25rem; }
summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.2rem; font-weight: 400; }
details[open] summary::after { content: "-"; }
details p { margin-top: 0.75rem; margin-bottom: 0; }

/* Header & Footer */
header { position: sticky; top: 0; background: rgba(244, 243, 247, 0.92); backdrop-filter: blur(10px); z-index: 100; border-bottom: 1px solid rgba(25, 21, 35, 0.06); }
.nav-inner { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.logo-wrap { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: inherit; }
.logo-img { height: 32px; width: auto; display: block; }
.logo-text { font-weight: 700; font-size: 1.1rem; letter-spacing: -0.01em; }
nav ul { display: flex; gap: 1.5rem; list-style: none; }
nav a { text-decoration: none; color: var(--c-text); font-weight: 500; transition: color 0.2s; }
nav a:hover { color: var(--c-brand); }
nav a[aria-current="page"] { color: var(--c-brand); font-weight: 700; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--gap); }
.footer-grid a { color: var(--c-paper); text-decoration: none; opacity: 0.8; transition: opacity 0.2s; }
.footer-grid a:hover { opacity: 1; }
.footer-grid a[aria-current="page"] { opacity: 1; font-weight: 600; }
.footer-bottom { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid rgba(244, 243, 247, 0.1); font-size: 0.875rem; opacity: 0.7; }

/* SVG & Animations */
svg { overflow: visible; }
.svg-panel { width: 100%; height: auto; max-width: 100%; display: block; }
.anim-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw-line 5s ease-in-out infinite alternate; }
.anim-float { animation: float-gentle 6s ease-in-out infinite alternate; }
.anim-rotate { animation: rotate-slow 14s linear infinite; transform-box: fill-box; transform-origin: center; }
.anim-breathe circle { animation: pulse-dots 3s ease-in-out infinite; }
.anim-breathe circle:nth-child(2) { animation-delay: 0.4s; }
.anim-breathe circle:nth-child(3) { animation-delay: 0.8s; }
.anim-slide-in { animation: slide-in 0.8s ease-out forwards; }

@keyframes draw-line { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
@keyframes float-gentle { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes rotate-slow { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes pulse-dots { 0%, 80%, 100% { opacity: 0.2; } 40% { opacity: 1; } }
@keyframes slide-in { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: translateX(0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  nav ul { gap: 1rem; }
  h1 { font-size: clamp(2rem, 8vw, 3.2rem); }
}
