:root {
  --c-dark: #140E25;
  --c-paper: #F7F5F3;
  --c-text: #191523;
  --c-brand: #5214EB;
  --c-accent: #C8ED6E;
  --radius-card: 8px;
  --radius-btn: 6px;
  --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;
  --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);
  background: var(--c-paper);
  color: var(--c-text);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.75rem 1rem; border-bottom: var(--card-border); text-align: left; vertical-align: top; min-width: 0; max-width: 100%; overflow-wrap: break-word; }
th { font-weight: 600; }

/* Surface Contexts */
.surface-paper { background: var(--c-paper); color: var(--c-text); }
.surface-paper .link, .surface-paper a:not(.btn) { color: var(--c-brand); }
.surface-dark { background: var(--c-dark); color: var(--c-paper); }
.surface-dark .link, .surface-dark a:not(.btn) { color: var(--c-accent); }
.card-light { background: var(--c-paper); color: var(--c-text); border: var(--card-border); border-radius: var(--radius-card); }
.card-light a { color: var(--c-brand); }

/* Layout */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding: var(--section-y) 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.text-col { max-width: 38em; }

/* Typography */
h1, h2, h3 { font-weight: 700; letter-spacing: 0.02em; line-height: 1.25; margin-bottom: var(--gap); text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: 1.25rem; }
.marker { display: block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--c-brand); margin-bottom: 0.5rem; }
.surface-dark .marker { color: var(--c-accent); }
.hl { color: var(--c-brand); }
.surface-dark .hl { color: var(--c-accent); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0 1.5rem; height: 52px; border-radius: var(--radius-btn);
  font-weight: 600; font-size: 1rem; cursor: pointer; transition: transform 0.2s ease, opacity 0.2s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--c-accent); color: var(--c-dark); border: none; }
.btn-secondary { background: transparent; border: 1px solid var(--c-text); color: var(--c-text); }
.surface-dark .btn-secondary { border-color: var(--c-paper); color: var(--c-paper); }
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 2px solid var(--c-brand); outline-offset: 2px; }
.surface-dark .btn:focus-visible { outline-color: var(--c-accent); }

/* Components */
.card { padding: var(--gap); }
.def-list dt { font-weight: 600; margin-bottom: 0.25rem; }
.def-list dd { margin-left: 1.5rem; margin-bottom: var(--gap); color: var(--c-text); }
.surface-dark .def-list dd { color: var(--c-paper); }

.flow-bar, .steps-bar { display: flex; gap: var(--gap); flex-wrap: wrap; }
.flow-item, .step-item { flex: 1 1 200px; padding: var(--gap); border: var(--card-border); border-radius: var(--radius-card); background: var(--c-paper); color: var(--c-text); }
.surface-dark .flow-item, .surface-dark .step-item { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.1); color: var(--c-paper); }
.step-num { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; background: var(--c-accent); color: var(--c-dark); font-weight: 700; border-radius: 4px; margin-right: 0.5rem; }

/* Details/FAQ */
details { border: var(--card-border); border-radius: var(--radius-card); margin-bottom: var(--gap); }
summary { padding: var(--gap); cursor: pointer; font-weight: 600; list-style: none; position: relative; padding-left: 1.5rem; }
summary::-webkit-details-marker { display: none; }
summary::before { content: '+'; position: absolute; left: 0; top: 50%; transform: translateY(-50%); color: var(--c-brand); }
.surface-dark details summary::before { color: var(--c-accent); }
details[open] summary::before { content: '-'; }
details p { padding: 0 var(--gap) var(--gap); line-height: 1.55; }

/* Header/Footer */
header { position: sticky; top: 0; z-index: 10; background: var(--c-paper); border-bottom: 1px solid rgba(25,21,35,0.1); padding: 1rem 0; }
.nav-row { display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 800; font-size: 1.2rem; color: var(--c-text); text-decoration: none; }
.logo img { width: 32px; height: 32px; }
nav ul { display: flex; gap: 1.5rem; list-style: none; }
nav a { font-weight: 500; }
nav a[aria-current="page"] { color: var(--c-brand); font-weight: 700; }
.surface-dark nav a[aria-current="page"] { color: var(--c-accent); }
footer { background: var(--c-dark); color: var(--c-paper); padding: var(--section-y) 0; text-align: center; }
footer nav ul { justify-content: center; gap: 1.5rem; margin-bottom: 1rem; }
footer p { font-size: 0.9rem; opacity: 0.8; }

/* SVG Animations */
.svg-anim-part { transform-box: fill-box; transform-origin: center; }
.star { animation: twinkle 4s ease-in-out infinite alternate; }
.line-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawLine 6s linear infinite; }
.bubble { animation: float 5s ease-in-out infinite alternate; }
.notif { animation: slideIn 7s ease-in-out infinite; }

@keyframes twinkle { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
@keyframes drawLine { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
@keyframes float { 0% { transform: translateY(0); } 100% { transform: translateY(-8px); } }
@keyframes slideIn { 0%, 10% { transform: translateX(100%); opacity: 0; } 20%, 80% { transform: translateX(0); opacity: 1; } 90%, 100% { transform: translateX(100%); opacity: 0; } }

/* 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; }
}

/* Responsive */
@media (max-width: 768px) {
  .flow-bar, .steps-bar { flex-direction: column; }
  nav ul { gap: 1rem; }
  h1 { font-size: clamp(1.8rem, 6vw, 2.8rem); }
}

/* 兜底：裁掉横向溢出 */
div.text-col {
  overflow-x: clip;
}
