:root {
  --color-dark: #19102D;
  --color-paper: #FCFCFD;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #D66EED;
  --color-border-light: #E2E2E8;

  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 2px solid var(--color-text);
  --card-shadow: 4px 4px 0 var(--color-text);
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 960px;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fs-h1: clamp(2.4rem, 6vw, 4.5rem);
  --fs-h2: clamp(1.6rem, 3vw, 2.4rem);
  --fs-body: 1rem;
  --lh-body: 1.75;
  --lh-title: 1.1;
  --tracking-title: -0.02em;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--color-paper);
  color: var(--color-text);
  line-height: var(--lh-body);
  font-size: var(--fs-body);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--color-brand); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.8; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4, h5, h6 { font-weight: 800; line-height: var(--lh-title); letter-spacing: var(--tracking-title); }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); margin-bottom: var(--gap); }
h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }
p { max-width: 38em; margin-bottom: 1rem; }
ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: 0.5rem; }
table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; overflow-x: auto; }
th, td { text-align: left; padding: 0.75rem; border-bottom: 1px solid var(--color-border-light); }
th { font-weight: 700; }
details { border: var(--card-border); background: var(--color-paper); margin-bottom: 1rem; }
summary { padding: 1rem; cursor: pointer; font-weight: 700; list-style: none; position: relative; padding-left: 1.5rem; }
summary::-webkit-details-marker { display: none; }
summary::before {
  content: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='9 18 15 12 9 6'/></svg>");
  position: absolute; left: 0; top: 1.1rem; width: 1em; height: 1em; transition: transform 0.2s;
}
details[open] summary::before { transform: rotate(90deg); }
.summary-text { word-break: break-word; }

.container { max-width: var(--content-max); margin: 0 auto; padding: 0 1.5rem; }
.section { padding-top: var(--section-y); padding-bottom: var(--section-y); }
.marker { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; margin-bottom: 0.5rem; color: var(--color-brand); }
.dark-section .marker { color: var(--color-accent); }
.hl { color: var(--color-brand); }
.dark-section .hl { color: var(--color-accent); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0 1.25rem; height: 52px; font-weight: 700; font-size: 1rem; border: none; cursor: pointer; transition: transform 0.2s, background-color 0.2s, color 0.2s; }
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-primary:hover { transform: translateY(-2px); filter: brightness(0.9); }
.btn-secondary { background: transparent; border: 2px solid var(--color-text); color: var(--color-text); }
.dark-section .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }

.card-grid { display: grid; gap: var(--gap); }
@media (min-width: 768px) { .card-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .card-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { border: var(--card-border); background: var(--color-paper); box-shadow: var(--card-shadow); padding: 1.5rem; }
.card.dark { background: var(--color-dark); color: var(--color-paper); border-color: var(--color-accent); box-shadow: 4px 4px 0 var(--color-accent); }
.card-group-header { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.75rem; color: var(--color-brand); }
.dark-section .card-group-header { color: var(--color-accent); }

.timeline { position: relative; padding-left: 2rem; border-left: 2px solid var(--color-border-light); }
.timeline-item { position: relative; margin-bottom: 2rem; }
.timeline-item::before { content: attr(data-step); position: absolute; left: -2.6rem; top: 0; width: 2rem; height: 2rem; background: var(--color-accent); color: var(--color-dark); font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; }
.tip-list { counter-reset: tip; list-style: none; padding: 0; }
.tip-list li { counter-increment: tip; padding-left: 2.5rem; position: relative; margin-bottom: 1rem; }
.tip-list li::before { content: "T" counter(tip); position: absolute; left: 0; top: 0; font-weight: 800; color: var(--color-brand); font-size: 0.9rem; }

header { position: sticky; top: 0; z-index: 100; background: rgba(252, 252, 253, 0.95); border-bottom: 1px solid var(--color-border-light); }
.nav-inner { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.logo { display: flex; align-items: center; gap: 0.75rem; font-weight: 800; font-size: 1.25rem; color: var(--color-text); }
.logo img { width: 32px; height: 32px; }
nav ul { display: flex; gap: 1.5rem; list-style: none; }
nav a { font-weight: 600; color: var(--color-text); }
nav a:hover, nav a[aria-current="page"] { color: var(--color-brand); }

footer { background: var(--color-dark); color: var(--color-paper); padding: var(--section-y) 0; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--gap); }
.footer-col h4 { color: var(--color-accent); margin-bottom: 1rem; font-weight: 700; }
.footer-col ul { list-style: none; }
.footer-col a { color: var(--color-paper); opacity: 0.8; display: block; margin-bottom: 0.5rem; }
.footer-col a:hover { opacity: 1; text-decoration: underline; }

/* SVG Containers & Animations */
.svg-container { width: 100%; height: auto; overflow: visible; }
.draw-path { stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw-line 6s ease-in-out infinite; }
.float-soft { animation: float-soft 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.slide-in-up { animation: slide-in-up 5s ease-in-out infinite; }
.dot-pulse { animation: dot-pulse 2s ease-in-out infinite; }
.line-flow { stroke-dasharray: 0.5 0.5; animation: flow-line 3s linear infinite; }

@keyframes draw-line { 0% { stroke-dashoffset: 1; } 20%, 80% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 1; } }
@keyframes float-soft { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes slide-in-up { 0%, 100% { transform: translateY(10px); opacity: 0.6; } 20%, 80% { transform: translateY(0); opacity: 1; } }
@keyframes dot-pulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
@keyframes flow-line { to { stroke-dashoffset: -1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* 兜底：裁掉横向溢出 */
div.container {
  overflow-x: clip;
}
