:root {
  --color-dark: #251943;
  --color-paper: #DBD4ED;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #ED6E89;
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 1px solid rgba(25, 21, 35, 0.16);
  --card-shadow: none;
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1120px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.75;
  color: var(--color-text);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Typography */
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 600; line-height: 1.25; letter-spacing: 0; margin-bottom: 1rem; text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 600; line-height: 1.25; margin-bottom: 1.5rem; margin-top: 2rem; text-wrap: balance; }
h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.3; margin-bottom: 0.75rem; margin-top: 1.5rem; }
p { margin-bottom: 1rem; max-width: 38em; }
a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
img, svg { display: block; max-width: 100%; height: auto; }

/* Badges & Highlights */
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  color: var(--color-brand);
}
.section-dark .badge { color: var(--color-accent); }
.hl { color: var(--color-brand); font-weight: 600; }
.section-dark .hl { color: var(--color-accent); }

/* Layout */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
.section { padding: var(--section-y) 0; position: relative; }
.section-paper { background-color: var(--color-paper); color: var(--color-text); }
.section-dark { background-color: var(--color-dark); color: var(--color-paper); }
.divider { border-top: 1px solid rgba(25, 21, 35, 0.1); margin: 0; }

/* Grid & Cards */
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.card {
  background: var(--bg-card, var(--color-paper));
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
}
.section-dark .card { --bg-card: var(--color-paper); color: var(--color-text); }
.section-dark .card .hl, .section-dark .card .badge { color: var(--color-brand); }
.section-dark .card a { color: var(--color-brand); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0 1.5rem; height: 52px; font-size: 1rem; font-weight: 600;
  border-radius: var(--radius-btn); cursor: pointer; text-decoration: none;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn-primary { background-color: var(--color-accent); color: var(--color-dark); border: 2px solid var(--color-accent); }
.btn-primary:hover { transform: translateY(-2px); background-color: #d95a75; border-color: #d95a75; }
.btn-secondary { background: transparent; color: var(--text-btn, var(--color-text)); border: 2px solid var(--text-btn, var(--color-text)); }
.btn-secondary:hover { background: var(--text-btn, var(--color-text)); color: var(--bg-btn, var(--color-paper)); }
.section-dark .btn-secondary { --text-btn: var(--color-paper); --bg-btn: var(--color-dark); }
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }

/* Table */
table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid rgba(25, 21, 35, 0.1); }
th { font-weight: 600; }
td:first-child { font-weight: 600; }
.section-dark table th, .section-dark table td { border-color: rgba(219, 212, 237, 0.15); }

/* FAQ */
details { border: var(--card-border); margin-bottom: 0.75rem; background: var(--bg-card, var(--color-paper)); }
.section-dark details { --bg-card: var(--color-paper); color: var(--color-text); }
summary { padding: 1rem; cursor: pointer; font-weight: 600; list-style: none; position: relative; padding-right: 2rem; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); transition: transform 0.2s; }
details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
details p { padding: 0 1rem 1rem; margin: 0; }

/* Header & Footer */
header { position: sticky; top: 0; z-index: 100; background: rgba(219, 212, 237, 0.95); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(25, 21, 35, 0.1); padding: 1rem 0; }
.header-inner { display: flex; align-items: center; justify-content: space-between; }
nav a { margin-left: 1.5rem; font-weight: 500; text-decoration: none; color: inherit; }
nav a[aria-current="page"] { color: var(--color-accent); font-weight: 700; }
.logo-img { height: 32px; width: auto; vertical-align: middle; }
.brand-name { font-weight: 700; margin-left: 0.5rem; font-size: 1.1rem; }

footer { padding: 2rem 0; border-top: 1px solid rgba(25, 21, 35, 0.1); margin-top: var(--section-y); }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; align-items: center; }
.footer-nav a { margin-right: 1rem; text-decoration: none; opacity: 0.8; }
.footer-nav a:hover { opacity: 1; }
.copyright { font-size: 0.85rem; opacity: 0.7; }

/* SVG Animations */
@keyframes drawLine { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes flowPath { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes floatObj { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pulseDot { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
@keyframes slideIn { from { transform: translateX(-20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.anim-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawLine 3s ease forwards; }
.anim-flow { stroke-dasharray: 1; stroke-dashoffset: 0; animation: flowPath 2.5s linear infinite; }
.anim-float { animation: floatObj 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-pulse { animation: pulseDot 2.5s ease-in-out infinite; }
.anim-slide { animation: slideIn 0.8s ease-out both; }
.anim-slide:nth-child(2) { animation-delay: 0.15s; }
.anim-slide:nth-child(3) { animation-delay: 0.3s; }

@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; }
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
