:root {
  --color-dark: #271231;
  --color-paper: #F5F0E5;
  --color-light-paper: #EDE8DC;
  --color-text: #1F1523;
  --color-brand: #9B12D8;
  --color-accent: #ED6EC0;
  
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 1px solid rgba(31, 21, 35, 0.16);
  --card-shadow: none;
  
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 960px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--color-paper);
  color: var(--color-text);
  line-height: 1.55;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4 { font-weight: 600; letter-spacing: 0; line-height: 1.25; margin-top: 0; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { margin-bottom: var(--gap); max-width: 38em; }
a { color: var(--color-brand); text-decoration: underline; text-underline-offset: 2px; }
.bg-dark a { color: var(--color-accent); }
ul, ol { padding-left: 1.25em; margin-bottom: var(--gap); }
li { margin-bottom: calc(var(--gap) * 0.5); }

/* Layout */
.container { max-width: var(--content-max); margin-inline: auto; padding-inline: var(--gap); }
section { padding-block: var(--section-y); }
.bg-dark { background: var(--color-dark); color: var(--color-paper); }
.bg-paper { background: var(--color-paper); color: var(--color-text); }
.bg-light-paper { background: var(--color-light-paper); color: var(--color-text); }

/* Headers & Meta */
.section-meta { display: inline-flex; align-items: center; gap: 0.5em; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; margin-bottom: var(--gap); }
.bg-dark .section-meta { color: var(--color-accent); }
.bg-paper .section-meta, .bg-light-paper .section-meta { color: var(--color-brand); }
.hl { font-weight: inherit; }
.bg-dark .hl { color: var(--color-accent); }
.bg-paper .hl, .bg-light-paper .hl { color: var(--color-brand); }

/* Buttons */
.btn-group { display: flex; flex-wrap: wrap; gap: var(--gap); margin-bottom: var(--gap); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 48px; padding-inline: 1.5em; font-size: 1rem; font-weight: 600;
  text-decoration: none; cursor: pointer; border: 2px solid transparent;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }
.btn-primary { background: var(--color-accent); color: var(--color-dark); border-color: var(--color-accent); }
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn-secondary { background: transparent; color: var(--color-text); border-color: var(--color-text); }
.bg-dark .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }
.btn-secondary:hover { filter: brightness(0.95); }
.btn-icon { width: 20px; height: 20px; flex-shrink: 0; }

/* Cards & Panels */
.card {
  background: var(--color-paper); border: var(--card-border); box-shadow: var(--card-shadow);
  border-radius: var(--radius-card); padding: var(--gap);
}
.panel {
  background: var(--color-dark); border-radius: var(--radius-card); padding: var(--gap);
  position: relative; overflow: hidden; aspect-ratio: 4/3;
}
.panel-light { background: var(--color-paper); border: var(--card-border); }

/* Grid & Flex */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.flex-row { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: center; }
.flex-col { display: flex; flex-direction: column; gap: var(--gap); }
@media (min-width: 768px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .flex-row-alt { flex-direction: row; }
  .flex-row-reverse-alt { flex-direction: row-reverse; }
}
.flex-row-alt, .flex-row-reverse-alt { flex-direction: column; }
@media (min-width: 768px) {
  .flex-row-alt, .flex-row-reverse-alt { flex-direction: row; }
}

/* Tables */
.data-table { width: 100%; border-collapse: collapse; margin-bottom: var(--gap); }
.data-table th, .data-table td { padding: 0.75em 1em; text-align: left; border-bottom: 1px solid rgba(31, 21, 35, 0.1); }
.data-table th { font-weight: 600; }
.bg-dark .data-table th, .bg-dark .data-table td { border-bottom-color: rgba(245, 240, 229, 0.1); }

/* Details / FAQ */
details { border: var(--card-border); margin-bottom: var(--gap); background: var(--color-paper); }
.bg-dark details { background: rgba(245, 240, 229, 0.08); border-color: rgba(245, 240, 229, 0.15); }
summary { padding: 1em; 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.2em; font-weight: 400; }
details[open] summary::after { content: "−"; }
details > div { padding: 0 1em 1em; line-height: 1.6; }

/* Header / Footer */
.site-header { position: sticky; top: 0; z-index: 100; background: var(--color-paper); border-bottom: 1px solid rgba(31, 21, 35, 0.1); padding: 0.75em 0; }
.bg-dark .site-header { background: var(--color-dark); border-bottom-color: rgba(245, 240, 229, 0.1); }
.header-inner { display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 0.5em; font-weight: 700; font-size: 1.1rem; text-decoration: none; color: inherit; }
.logo img { height: 32px; width: auto; }
nav ul { display: flex; gap: var(--gap); list-style: none; margin: 0; padding: 0; }
nav a { text-decoration: none; font-weight: 500; padding: 0.25em 0; }
nav a[aria-current="page"] { color: var(--color-brand); border-bottom: 2px solid var(--color-brand); }
.bg-dark nav a[aria-current="page"] { color: var(--color-accent); border-bottom-color: var(--color-accent); }
.site-footer { padding: 2em 0; border-top: 1px solid rgba(31, 21, 35, 0.1); font-size: 0.9rem; }
.bg-dark .site-footer { border-top-color: rgba(245, 240, 229, 0.1); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--gap); }

/* SVG Animations */
.svg-container { width: 100%; height: auto; max-width: 100%; display: block; }
.svg-element { transform-box: fill-box; transform-origin: center; }
.draw-stroke { stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawStroke 8s ease-in-out infinite; }
.breathe { animation: breathe 6s ease-in-out infinite; }
.slide-in { animation: slideIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; opacity: 0; }
.float-slow { animation: floatSlow 7s ease-in-out infinite; }

@keyframes drawStroke {
  0%, 100% { stroke-dashoffset: 1; }
  30%, 70% { stroke-dashoffset: 0; }
}
@keyframes breathe {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.02); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes floatSlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Reduced Motion */
@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;
  }
  .draw-stroke, .breathe, .slide-in, .float-slow { animation: none !important; }
  .slide-in { opacity: 1; transform: none; }
}

/* Utilities */
.text-center { text-align: center; }
.mt-lg { margin-top: var(--section-y); }
.mb-md { margin-bottom: var(--gap); }
.overflow-hidden { overflow: hidden; }
.min-w-0 { min-width: 0; }
.w-full { width: 100%; }
.max-w-prose { max-width: 38em; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; background: var(--color-accent); color: var(--color-dark);
  font-weight: 700; font-size: 0.9rem; margin-right: 0.5em; flex-shrink: 0;
}
.timeline-line { position: absolute; left: 15px; top: 0; bottom: 0; width: 2px; background: rgba(31, 21, 35, 0.15); }
.bg-dark .timeline-line { background: rgba(245, 240, 229, 0.15); }
.timeline-item { position: relative; padding-left: 48px; margin-bottom: var(--section-y); }
@media (min-width: 768px) { .timeline-item { padding-left: 56px; } }
.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--gap); }
@media (min-width: 768px) { .news-grid { grid-template-columns: repeat(3, 1fr); } }
.feature-row { display: flex; flex-direction: column; gap: var(--gap); }
@media (min-width: 768px) { .feature-row { flex-direction: row; align-items: stretch; } }
.feature-text { flex: 1; min-width: 0; }
.feature-panel { flex: 1; min-width: 0; }
