:root {
  --color-dark: #21163C;
  --color-paper: #E9E8EA;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #ED926E;
  --card-border: 1px solid rgba(25, 21, 35, 0.16);
  --card-shadow: none;
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1120px;
  --radius-card: 20px;
  --radius-btn: 12px;
  --line-height-body: 1.55;
  --line-height-title: 1.25;
  --font-sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background-color: var(--color-paper);
  line-height: var(--line-height-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section {
  padding-block: var(--section-y);
}

.divider {
  border-top: 1px solid rgba(25, 21, 35, 0.12);
  margin: 0 calc(var(--gap) * -1);
}

/* Typography */
h1, h2, h3, h4 {
  font-weight: 600;
  line-height: var(--line-height-title);
  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: calc(var(--gap) * 1.5);
}

h3 {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  margin-bottom: 0.75em;
}

p {
  margin-bottom: 1em;
  max-width: 38em;
}

.eyebrow {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.5em;
}

.paper-face .eyebrow, .paper-face .hl {
  color: var(--color-brand);
}

.dark-face .eyebrow, .dark-face .hl {
  color: var(--color-accent);
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  height: 48px;
  padding: 0 1.25em;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}

.btn-secondary {
  background: transparent;
  border: 1px solid currentColor;
}

.paper-face .btn-secondary {
  color: var(--color-text);
  border-color: var(--color-text);
}

.dark-face .btn-secondary {
  color: var(--color-paper);
  border-color: var(--color-paper);
}

.btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* Cards & Grids */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: var(--gap);
}

.card {
  background: var(--color-paper);
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: var(--gap);
  box-shadow: var(--card-shadow);
}

.dark-face .card {
  background: var(--color-dark);
  border-color: rgba(233, 232, 234, 0.15);
  color: var(--color-paper);
}

.card-inner {
  background: var(--color-paper);
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: var(--gap);
}

.dark-face .card-inner {
  background: var(--color-dark);
  border-color: rgba(233, 232, 234, 0.15);
  color: var(--color-text);
}

/* Alternating Layout */
.split-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: center;
  overflow-x: hidden;
}

.split-row.reverse {
  direction: rtl;
}

.split-row.reverse > * {
  direction: ltr;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 0.95rem;
}

th, td {
  padding: 0.75em 1em;
  text-align: left;
  border-bottom: 1px solid rgba(25, 21, 35, 0.12);
}

th {
  font-weight: 600;
  background: rgba(25, 21, 35, 0.04);
}

td:first-child {
  font-weight: 600;
  white-space: nowrap;
}

/* FAQ */
details {
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: 1em 1.25em;
  margin-bottom: 0.75em;
  background: var(--color-paper);
}

summary {
  font-weight: 600;
  cursor: pointer;
  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 p {
  margin-top: 0.75em;
  margin-bottom: 0;
  color: var(--color-text);
}

.dark-face details {
  background: var(--color-dark);
  border-color: rgba(233, 232, 234, 0.15);
}

.dark-face details p {
  color: var(--color-paper);
}

/* Header & Footer */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(233, 232, 234, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(25, 21, 35, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-weight: 700;
  font-size: 1.1rem;
}

.brand img {
  height: 32px;
  width: auto;
  display: block;
}

nav {
  display: flex;
  gap: 1.5em;
  align-items: center;
}

nav a {
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0.8;
  transition: opacity 0.2s;
}

nav a:hover, nav a[aria-current="page"] {
  opacity: 1;
  color: var(--color-brand);
}

.dark-face nav a {
  color: var(--color-paper);
}

.dark-face nav a:hover, .dark-face nav a[aria-current="page"] {
  color: var(--color-accent);
}

.site-footer {
  background: var(--color-dark);
  color: var(--color-paper);
  padding: var(--section-y) 0;
  margin-top: var(--section-y);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5em;
  align-items: center;
  text-align: center;
}

.footer-links {
  display: flex;
  gap: 2em;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  color: rgba(233, 232, 234, 0.7);
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--color-accent);
}

/* SVG Panels */
.svg-panel {
  width: 100%;
  height: auto;
  display: block;
}

.svg-panel svg {
  width: 100%;
  height: auto;
}

/* Animations */
@keyframes flowLine {
  0%, 100% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
}

@keyframes floatSoft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes breathe {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

@keyframes slideIn {
  0%, 100% { transform: translateX(0); opacity: 1; }
  50% { transform: translateX(-4px); opacity: 0.7; }
}

.anim-flow {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: flowLine 4s ease-in-out infinite;
}

.anim-float {
  animation: floatSoft 5s ease-in-out infinite;
}

.anim-breathe {
  animation: breathe 3s ease-in-out infinite;
}

.anim-slide {
  animation: slideIn 6s ease-in-out infinite;
}

.transform-box-center {
  transform-box: fill-box;
  transform-origin: center;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .anim-flow, .anim-float, .anim-breathe, .anim-slide {
    animation: none !important;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .split-row {
    grid-template-columns: 1fr;
  }
  .split-row.reverse {
    direction: ltr;
  }
  .header-inner {
    flex-direction: column;
    height: auto;
    padding: 1em 0;
    gap: 1em;
  }
  nav {
    flex-wrap: wrap;
    justify-content: center;
  }
  h1 {
    font-size: clamp(1.8rem, 6vw, 2.6rem);
  }
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
