:root {
  --color-dark: #141838;
  --color-paper: #F7F5F3;
  --color-text: #151723;
  --color-brand: #142CEB;
  --color-accent: #6EAFED;
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 2px solid var(--color-text);
  --card-shadow: 4px 4px 0 var(--color-text);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1280px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-family: var(--font-sans); background: var(--color-paper); color: var(--color-text); line-height: 1.65; scroll-behavior: smooth; }
body { margin: 0; padding: 0; min-width: 320px; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
svg { display: inline-block; max-width: 100%; height: auto; vertical-align: middle; }
.icon-svg { width: 20px; height: 20px; flex-shrink: 0; }
a { color: var(--color-brand); text-decoration: none; transition: color 0.2s ease; }
a:hover { text-decoration: underline; }
ul, ol { padding-left: 1.5rem; margin: 0 0 1rem; }
li { margin-bottom: 0.5rem; }

/* Surface Contexts */
.surface-dark { background: var(--color-dark); color: var(--color-paper); }
.surface-dark .hl { color: var(--color-accent); }
.surface-dark a { color: var(--color-accent); }
.surface-dark .eyebrow { color: var(--color-accent); }
.surface-dark .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }
.surface-dark .card { background: var(--color-paper); color: var(--color-text); border-color: var(--color-text); box-shadow: var(--card-shadow); }
.surface-dark th, .surface-dark td { border-color: var(--color-text); }

/* Typography */
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); font-weight: 500; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 1rem; text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 500; line-height: 1.25; margin: 0 0 1.5rem; text-wrap: balance; }
h3 { font-size: 1.25rem; font-weight: 500; line-height: 1.4; margin: 1.5rem 0 0.75rem; }
p { max-width: 38em; margin: 0 0 1rem; }
.hl { color: var(--color-brand); }
.eyebrow { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; margin-bottom: 0.5rem; text-transform: uppercase; }

/* 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: 1fr 1fr; gap: var(--gap); }
@media (max-width: 768px) { .grid-2 { grid-template-columns: 1fr; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0 1.25rem; height: 48px; border-radius: var(--radius-btn); font-weight: 500; cursor: pointer; border: none; transition: transform 0.2s ease, opacity 0.2s ease; white-space: nowrap; }
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-secondary { background: transparent; color: var(--color-text); border: 2px solid var(--color-text); }
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }

/* Cards */
.card { background: var(--color-paper); border: var(--card-border); box-shadow: var(--card-shadow); border-radius: var(--radius-card); padding: 1.5rem; display: flex; flex-direction: column; height: 100%; }
.card-title { font-weight: 600; font-size: 1.1rem; margin: 0 0 0.5rem; }
.card-meta { font-size: 0.85rem; opacity: 0.7; margin-bottom: 0.75rem; }

/* Tables */
.table-wrapper { overflow-x: auto; margin: 1rem 0; }
table { width: 100%; border-collapse: collapse; min-width: 400px; }
th, td { text-align: left; padding: 0.75rem 1rem; border-bottom: 1px solid var(--color-text); }
th { font-weight: 600; }
td a { text-decoration: underline; }

/* FAQ */
details { margin-bottom: 0.75rem; border: var(--card-border); border-radius: var(--radius-card); background: var(--color-paper); overflow: hidden; }
summary { padding: 1rem; cursor: pointer; font-weight: 500; list-style: none; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::marker { content: ""; }
summary::after { content: "+"; position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); transition: transform 0.2s ease; }
details[open] summary::after { content: "-"; }
details[open] summary { border-bottom: 1px solid var(--color-text); }
details p { padding: 1rem; margin: 0; }

/* Navigation */
header { position: sticky; top: 0; z-index: 100; background: var(--color-paper); border-bottom: 1px solid rgba(21,23,35,0.1); backdrop-filter: blur(8px); }
.nav-container { display: flex; justify-content: space-between; align-items: center; height: 64px; }
nav a { margin-left: 1.5rem; font-weight: 500; font-size: 0.95rem; }
nav a[aria-current="page"] { color: var(--color-brand); border-bottom: 2px solid var(--color-brand); padding-bottom: 2px; }
.mobile-menu-btn { display: none; background: none; border: none; color: var(--color-text); font-size: 1.5rem; cursor: pointer; }
@media (max-width: 768px) {
  .nav-links { display: none; }
  .mobile-menu-btn { display: block; }
}

/* Footer */
footer { padding: 3rem 0; border-top: 1px solid rgba(21,23,35,0.1); margin-top: var(--section-y); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; }
.footer-col h4 { font-size: 0.9rem; font-weight: 600; margin: 0 0 0.75rem; }
.footer-col a { display: block; margin-bottom: 0.5rem; font-size: 0.9rem; }

/* Magazine Layout for Deep Dive */
.magazine-layout { display: grid; grid-template-columns: 1fr 240px; gap: 2rem; }
.magazine-nav { position: sticky; top: 80px; align-self: start; }
.magazine-nav ul { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--color-brand); }
.magazine-nav li { margin-bottom: 0.5rem; }
.magazine-nav a { display: block; padding: 0.25rem 0 0.25rem 0.75rem; font-size: 0.9rem; color: var(--color-text); opacity: 0.7; transition: opacity 0.2s; }
.magazine-nav a:hover { opacity: 1; }
@media (max-width: 768px) { .magazine-layout { grid-template-columns: 1fr; } .magazine-nav { position: static; margin-bottom: 1.5rem; } }

/* Feature Alternating */
.feature-row { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: center; margin-bottom: 3rem; }
.feature-row.reverse .feature-text { order: 2; }
.feature-row.reverse .feature-visual { order: 1; }
@media (max-width: 768px) { .feature-row { grid-template-columns: 1fr; } .feature-row.reverse .feature-text { order: 1; } .feature-row.reverse .feature-visual { order: 2; } }

/* Scenario Blocks */
.scenario-block { background: var(--color-paper); border: var(--card-border); border-radius: var(--radius-card); padding: 1.5rem; margin-bottom: 1.5rem; }
.scenario-step { margin-bottom: 1rem; }
.step-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.25rem; }
.label-problem { color: #D32F2F; }
.label-action { color: var(--color-brand); }
.label-result { color: #2E7D32; }

/* Quick Start Steps */
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; counter-reset: step; }
.step-item { position: relative; padding-left: 2.5rem; }
.step-item::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; background: var(--color-accent); color: var(--color-dark); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; }
@media (max-width: 768px) { .steps-grid { grid-template-columns: 1fr; } }

/* SVG Animation Utilities */
.svg-panel { width: 100%; height: auto; overflow: visible; }
.anim-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: drawLine 4s ease forwards; }
.anim-float { animation: floatY 5s ease-in-out infinite; }
.anim-breathe { animation: breatheOp 3s ease-in-out infinite; }
.anim-slide { animation: slideInX 0.8s ease forwards; opacity: 0; }
.anim-fade { animation: fadeIn 1s ease forwards; opacity: 0; }
.svg-group { transform-box: fill-box; transform-origin: center; }

@keyframes drawLine { to { stroke-dashoffset: 0; } }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes breatheOp { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }
@keyframes slideInX { from { transform: translateX(-12px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@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; }
  .anim-draw, .anim-float, .anim-breathe, .anim-slide, .anim-fade { animation: none !important; opacity: 1 !important; transform: none !important; }
}
