:root {
  color-scheme: dark;
  --bg: #0b1017;
  --surface: #101820;
  --ink: #f0f3f5;
  --body: #bcc7cf;
  --muted: #9daab6;
  --accent: #83d9df;
  --warm: #d0b18a;
  --line: rgba(225,238,245,.13);
  --max: 1184px;
  --gutter: clamp(24px, 7vw, 104px);
  --header-h: 76px;
  --chapter-h: 108px;
  --section-y: clamp(48px, 6.5vh, 76px);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-snap-type: y proximity; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1rem/1.7 Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif; }
a { color: inherit; }
button { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.wrap { width: min(var(--max), calc(100% - 2 * var(--gutter))); margin-inline: auto; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 16px; z-index: 100; padding: 8px 12px; background: var(--surface); }
.site-header { border-bottom: 1px solid var(--line); }
.nav { min-height: var(--header-h); display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; white-space: nowrap; }
.brand-logo { position: relative; display: inline-block; flex-shrink: 0; width: 25px; height: 25px; }
.brand-logo i { position: absolute; display: block; width: 7px; border-radius: 2px; transform: skewY(-28deg); }
.brand-logo i:nth-child(1) { left: 1px; top: 8px; height: 14px; background: #f0a5a7; }
.brand-logo i:nth-child(2) { left: 9px; top: 4px; height: 18px; background: #e7373f; }
.brand-logo i:nth-child(3) { left: 17px; top: 8px; height: 14px; background: #f2b46d; }
.brand-word { font-size: 1.125rem; font-weight: 800; letter-spacing: .06em; }
.brand-product { margin-left: 6px; padding-left: 16px; border-left: 1px solid var(--line); color: var(--muted); font-size: .875rem; }
.nav-links { display: flex; gap: 28px; margin-left: auto; color: var(--muted); font-size: .875rem; }
.nav-links a, .nav-cta { text-decoration: none; }
.nav-cta { color: var(--muted); font-size: .875rem; }
.nav-links a:hover, .nav-cta:hover { color: var(--accent); }

/* Opening frame: the film carries the page, with a short introduction beside it. */
.hero { min-height: calc(100svh - var(--header-h) - var(--chapter-h)); display: flex; align-items: center; padding: var(--section-y) 0; }
.hero-grid { display: grid; grid-template-columns: .9fr 1.2fr; gap: 56px; align-items: center; }
.hero-grid > * { min-width: 0; }
.eyebrow, .section-kicker { margin: 0; color: var(--warm); font-size: .8125rem; font-weight: 500; letter-spacing: .12em; }
h1 { margin: 22px 0 0; font-size: clamp(3rem, 5.4vw, 5rem); font-weight: 750; letter-spacing: -.045em; line-height: 1.08; }
.hero-title-accent { color: var(--accent); }
.hero-lede { margin: 28px 0 0; max-width: 30em; color: var(--body); font-size: 1rem; line-height: 1.9; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; margin-top: 30px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 10px 18px; border: 1px solid transparent; border-radius: 5px; text-decoration: none; font-size: .875rem; font-weight: 600; cursor: pointer; }
.btn-primary { color: #0b1017; background: var(--accent); }
.btn-primary:hover { background: #a2e8ea; }
.btn svg { width: 16px; height: 16px; fill: currentColor; }
.story-link { padding: 10px 0; font-size: .875rem; color: var(--body); text-decoration: none; text-underline-offset: 5px; }
.story-link:hover { color: var(--ink); text-decoration: underline; }
.media-card { width: 100%; }
.media-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; color: var(--muted); font-size: .75rem; letter-spacing: .08em; }
.video-shell { overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #05080b; }
video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #05080b; }
.video-caption { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; color: var(--muted); font-size: .875rem; }
.play-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.control-btn { min-height: 36px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 4px; background: transparent; color: var(--body); font-size: .875rem; cursor: pointer; }
.control-btn.primary { color: var(--accent); }
.control-btn:hover { border-color: var(--accent); color: var(--ink); }
.duration { font-size: .75rem; font-variant-numeric: tabular-nums; }
.chapters { min-height: var(--chapter-h); display: flex; align-items: center; border-block: 1px solid var(--line); }
.chapters-inner { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.chapter { position: relative; width: 100%; min-height: var(--chapter-h); padding: 18px 0; border: 0; color: var(--muted); background: transparent; text-align: left; cursor: pointer; }
.chapter::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--accent); opacity: 0; transition: opacity .2s; }
.chapter.active::before, .chapter:hover::before { opacity: 1; }
.chapter.active, .chapter:hover { color: var(--ink); }
.chapter-no { display: block; color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; letter-spacing: .08em; }
.chapter-title { display: block; margin-top: 5px; font-size: 1.125rem; font-weight: 500; }

/* Three equal stills, their captions, and quiet technical annotations. */
.scene-section { min-height: 100svh; display: flex; align-items: center; padding: var(--section-y) 0; background: #0e161f; scroll-snap-align: start; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 36px; margin-bottom: 36px; }
h2 { margin: 12px 0 0; font-size: clamp(1.875rem, 2.8vw, 2.75rem); font-weight: 650; letter-spacing: -.035em; line-height: 1.25; }
.section-intro { max-width: 24em; margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.8; }
.scene-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.scene-card { display: flex; min-width: 0; flex-direction: column; }
.scene-media { position: relative; margin: 0; aspect-ratio: 16 / 10; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: #091118; }
.scene-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.scene-media::after { content: ""; position: absolute; inset: 50% 0 0; background: linear-gradient(transparent, rgba(5,10,14,.7)); pointer-events: none; }
.scene-time { position: absolute; left: 16px; bottom: 12px; z-index: 1; color: #f3f6f8; font-size: .75rem; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.scene-caption { display: flex; flex: 1; flex-direction: column; min-height: 202px; padding: 22px 0 0; }
.scene-caption h3 { margin: 0; color: var(--ink); font-size: 1.25rem; font-weight: 600; line-height: 1.5; }
.scene-caption p { margin: 12px 0 20px; color: var(--body); font-size: 1rem; line-height: 1.8; }
.scene-tech { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); color: #9cbfc3; font-size: .875rem; }
.scene-tech span + span::before { content: "·"; margin-right: 8px; color: var(--muted); }

/* A single continuous factory floor replaces the static architecture diagram. */
.behind-screen { min-height: 100svh; display: flex; flex-direction: column; background: var(--surface); scroll-snap-align: start; }
.tech-section { display: flex; flex: 1; align-items: center; padding: clamp(28px, 4vh, 48px) 0 20px; }
.tech-wrap { min-width: 0; }
.factory-title { margin: 0 0 18px; font-size: clamp(1.625rem, 2.3vw, 2.125rem); font-weight: 600; letter-spacing: -.035em; line-height: 1.25; }
.factory-stage { position: relative; width: 100%; height: clamp(390px, 56svh, 610px); overflow: hidden; border: 1px solid rgba(191,213,221,.13); border-radius: 8px; background: radial-gradient(ellipse at 50% 48%, #18232b 0%, #101820 62%, #0b1219 100%); isolation: isolate; }
.factory-stage::after { position: absolute; inset: 0; z-index: 1; border-radius: inherit; background: linear-gradient(90deg, rgba(7,13,18,.18), transparent 18%, transparent 82%, rgba(7,13,18,.2)), linear-gradient(0deg, rgba(6,11,16,.3), transparent 24%, transparent 82%, rgba(6,11,16,.1)); content: ""; pointer-events: none; }
.factory-stage canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.factory-labels { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.factory-tag { position: absolute; top: 0; left: 0; padding: 3px 8px 4px; border: 1px solid rgba(215,230,238,.16); border-radius: 3px; background: rgba(8,15,21,.82); color: #dce5e8; font-size: .875rem; font-weight: 550; letter-spacing: .015em; line-height: 1.35; white-space: nowrap; opacity: 0; transform: translate(-50%, -100%); transition: opacity .22s ease; }
.factory-tag[data-visible="true"] { opacity: 1; }
.vector-tag, .ddl-tag, .topk-tag { border-color: rgba(91,208,197,.38); color: #9be3d6; }
.tikv-tag, .tiflash-tag { border-color: rgba(218,166,86,.4); color: #edc17b; }
.raft-tag, .commit-tag { border-color: rgba(176,151,232,.4); color: #d5c4fa; }
.factory-fallback { display: none; width: 100%; height: 100%; object-fit: contain; padding: 22px; }
.factory-stage[data-error="true"] canvas, .factory-stage[data-error="true"] .factory-labels { display: none; }
.factory-stage[data-error="true"] .factory-fallback { display: block; }
.factory-notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin-top: 14px; }
.factory-notes > div { display: flex; min-width: 0; align-items: baseline; gap: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.factory-notes strong { color: var(--ink); font-size: 1rem; font-weight: 550; white-space: nowrap; }
.factory-notes span { color: var(--muted); font-size: .875rem; line-height: 1.5; }
.statement { padding: 42px 0 48px; border-top: 1px solid var(--line); background: var(--bg); }
.statement-inner { max-width: 800px; text-align: center; }
.statement-line { margin: 0; font-size: clamp(1.375rem, 2vw, 1.875rem); font-weight: 500; letter-spacing: .02em; line-height: 1.65; }
.statement-line span { color: var(--warm); }
.statement .small { margin: 16px 0 0; color: var(--muted); font-size: 1rem; }
.footer { padding: 24px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .75rem; }
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.footer-brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-size: .875rem; font-weight: 600; }
.footer a { text-decoration: none; font-size: .875rem; }
.footer a:hover { color: var(--accent); }
.page-nav { position: fixed; top: 50%; right: clamp(12px, 2vw, 32px); z-index: 30; display: flex; flex-direction: column; gap: 10px; transform: translateY(-50%); }
.page-nav-btn { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid rgba(235,243,249,.23); border-radius: 50%; color: var(--ink); background: radial-gradient(circle at 34% 24%, #394554, #202a38 45%, #111821); box-shadow: inset 0 1px 0 rgba(255,255,255,.14); cursor: pointer; }
.page-nav-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.page-nav-btn:not(:disabled):hover { border-color: var(--accent); color: var(--accent); }
.page-nav-btn:disabled { opacity: .35; cursor: default; }

@media (max-width: 1100px) {
  .hero-grid { gap: 32px; }
  .brand-product { display: none; }
  .scene-grid { gap: 20px; }
  .section-head { align-items: flex-start; flex-direction: column; gap: 16px; }
  .section-intro { max-width: 36em; }
  .factory-stage { height: clamp(390px, 55svh, 560px); }
  .factory-notes { gap: 18px; }
}
@media (max-width: 900px) {
  html { scroll-snap-type: none; }
  .hero { min-height: 0; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  h1 { font-size: clamp(3rem, 8vw, 4.5rem); }
  .hero-copy { max-width: 600px; }
  .scene-section, .behind-screen { min-height: 0; }
  .scene-grid { grid-template-columns: 1fr; gap: 40px; }
  .scene-media { aspect-ratio: 16 / 9; }
  .scene-caption { min-height: 0; }
  .scene-caption p { max-width: 38em; }
  .page-nav { display: none; }
  .tech-section { padding: 38px 0 20px; }
  .factory-title { margin-bottom: 14px; }
  .factory-stage { height: 440px; }
  .factory-notes { gap: 12px; margin-top: 12px; }
  .factory-notes > div { align-items: flex-start; flex-direction: column; gap: 2px; padding-top: 8px; }
  .factory-notes span { font-size: .8125rem; }
  .factory-tag { padding: 2px 6px 3px; font-size: .8125rem; }
}
@media (max-width: 600px) {
  :root { --gutter: 24px; --header-h: 68px; --chapter-h: 88px; --section-y: 48px; }
  .nav { gap: 16px; }
  .nav-links { gap: 16px; }
  .nav-cta { display: none; }
  h1 { font-size: clamp(2.75rem, 12vw, 3.5rem); }
  .hero-lede { margin-top: 24px; }
  .hero-actions { gap: 16px; }
  .video-caption { align-items: flex-start; flex-direction: column; }
  .chapters-inner { gap: 18px; }
  .chapter { padding: 15px 0; }
  .chapter-no { letter-spacing: 0; }
  .chapter-title { font-size: 1rem; }
  h2 { font-size: 1.75rem; }
  .section-head { margin-bottom: 28px; }
  .scene-caption { padding-top: 18px; }
  .result-row { grid-template-columns: 28px minmax(0, 1fr); column-gap: 12px; row-gap: 8px; }
  .result-title { display: flex; align-items: baseline; gap: 10px; }
  .result-body { grid-column: 2; }
  .statement { padding: 36px 0 40px; }
  .statement .small { font-size: .875rem; }
  .footer-row { flex-wrap: wrap; gap: 12px 20px; }
  .footer-row > span:nth-child(2) { order: 3; flex-basis: 100%; }
  .footer-row > a { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
