:root {
  --color-dark: #21163C;
  --color-paper: #E9E8EA;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #ED926E;
  --card-border-color: rgba(25, 21, 35, 0.16);
  --radius-card: 20px;
  --radius-btn: 12px;
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1280px;
  --font-sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Arial, sans-serif;
  --line-height-body: 1.55;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--line-height-body);
  color: var(--color-text);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
}

.container { max-width: var(--content-max); margin-inline: auto; padding-inline: var(--gap); }
img, svg { display: block; max-width: 100%; }

/* Typography */
h1, h2, h3 { font-weight: 500; line-height: 1.15; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: var(--gap); }
h3 { font-size: 1.25rem; margin-bottom: calc(var(--gap) * 0.5); }
p { max-width: 38em; margin-bottom: var(--gap); }
ul, ol { margin-bottom: var(--gap); padding-left: 1.5em; }
li { margin-bottom: 0.5em; }

/* Eyebrow & Highlights */
.eyebrow { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; margin-bottom: calc(var(--gap) * 0.5); }
.eyebrow.brand { color: var(--color-brand); }
.eyebrow.accent { color: var(--color-accent); }
.hl { font-weight: 700; }
.hl.brand { color: var(--color-brand); }
.hl.accent { color: var(--color-accent); }

/* Background & Text Context Classes */
.dark-bg { background: var(--color-dark); }
.paper-bg { background: var(--color-paper); }
.text-on-dark { color: var(--color-paper); }
.text-on-paper { color: var(--color-text); }
.divider-light { border-top: 1px solid var(--card-border-color); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  padding: 0.75em 1.5em; height: 52px; border-radius: var(--radius-btn);
  font-size: 1rem; font-weight: 600; text-decoration: none;
  transition: transform 0.2s ease, filter 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  cursor: pointer; border: none; white-space: nowrap;
}
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-primary:hover { transform: translateY(-2px); filter: brightness(0.95); }
.btn-secondary { background: transparent; border: 1px solid currentColor; }
.btn-secondary.text-on-paper { color: var(--color-text); border-color: var(--color-text); }
.btn-secondary.text-on-dark { color: var(--color-paper); border-color: var(--color-paper); }
.btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* Layout & Grids */
section { padding-block: var(--section-y); position: relative; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.flex-col { display: flex; flex-direction: column; gap: var(--gap); }
.min-w-0 { min-width: 0; }

/* Cards */
.card {
  background: var(--color-paper); border: 1px solid var(--card-border-color);
  border-radius: var(--radius-card); padding: var(--gap);
  box-shadow: var(--card-shadow, none);
}

/* Header & Nav */
header {
  position: sticky; top: 0; z-index: 100; background: var(--color-paper);
  border-bottom: 1px solid var(--card-border-color);
}
header .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
nav { display: flex; gap: 0.25em; }
nav a {
  color: var(--color-text); text-decoration: none; font-weight: 500;
  padding: 0.5em 1em; border-radius: 8px; transition: background 0.2s, color 0.2s;
}
nav a:hover, nav a[aria-current="page"] { background: rgba(82, 20, 235, 0.08); color: var(--color-brand); }

/* Footer */
footer { background: var(--color-dark); color: var(--color-paper); padding-block: var(--section-y); }
footer .container { display: flex; flex-direction: column; gap: var(--gap); }
footer nav { justify-content: center; }
footer nav a { color: var(--color-paper); }
footer nav a:hover { color: var(--color-accent); }
.footer-copy { text-align: center; font-size: 0.85rem; opacity: 0.8; }

/* Definition List */
dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
dt { font-weight: 600; color: var(--color-brand); margin-bottom: 0.25em; display: flex; align-items: center; gap: 0.5em; }
dd { color: var(--color-text); margin-bottom: 0.5em; }

/* Timeline */
.timeline { position: relative; padding-left: 2rem; border-left: 2px solid var(--color-brand); }
.timeline-item { position: relative; margin-bottom: var(--section-y); }
.timeline-item::before {
  content: ""; position: absolute; left: -2.55rem; top: 0.25rem;
  width: 12px; height: 12px; border-radius: 50%; background: var(--color-accent);
}
.timeline-time { font-size: 0.85rem; font-weight: 700; color: var(--color-brand); margin-bottom: 0.25em; letter-spacing: 0.02em; }

/* News Cards */
.news-card article { display: flex; flex-direction: column; height: 100%; }
.news-card time { font-size: 0.8rem; color: var(--color-text); opacity: 0.7; margin-bottom: 0.5em; }
.news-card h3 { font-size: 1.1rem; margin-bottom: 0.5em; }
.news-card p { font-size: 0.95rem; margin-bottom: 0; }

/* Security List */
.security-list { list-style: none; padding: 0; }
.security-list li {
  display: flex; align-items: flex-start; gap: 0.75em; margin-bottom: var(--gap);
  padding: 1rem; border: 1px solid var(--card-border-color); border-radius: var(--radius-card);
}
.security-list svg { flex-shrink: 0; margin-top: 0.15em; }

/* FAQ */
details { margin-bottom: var(--gap); border: 1px solid var(--card-border-color); border-radius: var(--radius-card); overflow: hidden; }
summary {
  padding: 1rem var(--gap); cursor: pointer; font-weight: 600; list-style: none;
  display: flex; align-items: center; gap: 0.5em; transition: background 0.2s;
}
summary:hover { background: rgba(82, 20, 235, 0.04); }
summary::-webkit-details-marker { display: none; }
summary::before {
  content: ""; display: inline-block; width: 14px; height: 14px;
  background: var(--color-brand); mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M9 18l6-6-6-6'/%3E%3C/svg%3E") no-repeat center/contain;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M9 18l6-6-6-6'/%3E%3C/svg%3E") no-repeat center/contain;
  transform: rotate(-90deg); transition: transform 0.2s ease;
}
details[open] summary::before { transform: rotate(0); }
details p { padding: 0 1rem 1rem; }

/* Table */
table { width: 100%; border-collapse: collapse; margin-bottom: var(--gap); }
th, td { text-align: left; padding: 0.75rem 1rem; border-bottom: 1px solid var(--card-border-color); }
th { font-weight: 600; background: rgba(82, 20, 235, 0.04); }
td:first-child { font-weight: 500; }

/* SVG Animations */
.svg-responsive { width: 100%; height: auto; }
.anim-flow { stroke-dasharray: 1; stroke-dashoffset: 0; }
.anim-float { transform-box: fill-box; transform-origin: center; }
.anim-spin { transform-box: fill-box; transform-origin: center; }
.anim-breathe { transform-box: fill-box; transform-origin: center; }
.anim-slide { transform-box: fill-box; transform-origin: center; }

@keyframes flow-line {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 0; }
}
@keyframes float-bubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes spin-sync {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes breathe-dots {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
@keyframes slide-notif {
  0%, 10% { transform: translateX(20px); opacity: 0; }
  20%, 80% { transform: translateX(0); opacity: 1; }
  90%, 100% { transform: translateX(20px); opacity: 0; }
}

.anim-flow { animation: flow-line 6s ease-in-out infinite alternate; }
.anim-float { animation: float-bubble 5s ease-in-out infinite; }
.anim-spin { animation: spin-sync 12s linear infinite; }
.anim-breathe { animation: breathe-dots 3s ease-in-out infinite; }
.anim-slide { animation: slide-notif 8s ease-in-out infinite; }

@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 Tweaks */
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  header .container { flex-direction: column; height: auto; padding: 1rem; gap: 1rem; }
  nav { width: 100%; justify-content: center; flex-wrap: wrap; }
  .hero-layout { flex-direction: column-reverse; }
  .hero-svg-wrap { width: 100%; max-width: 100%; }
}
