:root {
  /* Type scale (Material Design 3 baseline): 32 / 22 / 16 / 14 / 12 px. */
  --blue: #4C72B0;
  --orange: #DD8452;
  --green: #55A868;
  --red: #C44E52;
  --purple: #8172B3;
  --gray: #8C8C8C;
  --ink: #1f2328;
  --muted: #5b6370;
  --line: #d8dbe0;
  --grid: #ececec;
  --panel: #ffffff;
  --page: #f6f7f9;
  --bar: #b9c3d3;
  /* Chinese text falls back to the system CJK fonts. */
  --font: Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", sans-serif;
  font-family: var(--font);
  color: var(--ink);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  font-size: 16px;
  line-height: 1.5;
}

.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 16px 64px;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 32px; margin: 4px 0 8px; letter-spacing: -0.01em; }
h2 { font-size: 22px; margin: 0 0 6px; }
h3 { font-size: 16px; margin: 0 0 4px; }
p { margin: 0 0 10px; }

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.lead { font-size: 16px; color: var(--muted); }
.note { font-size: 14px; color: var(--muted); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
}

.section { margin-top: 36px; }
.section > .intro { margin-bottom: 14px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

@media (max-width: 860px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.chips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 16px;
}
@media (max-width: 860px) { .chips { grid-template-columns: 1fr 1fr; } }
.chip {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
}
.chip b { display: block; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 20px 0 14px;
  padding: 10px 0;
}
.controls input[type=range] { flex: 1; min-width: 160px; accent-color: var(--blue); }
.controls output { font-variant-numeric: tabular-nums; min-width: 92px; font-size: 14px; }

button {
  font: inherit;
  font-size: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
}
button.primary { background: var(--blue); border-color: var(--blue); color: #fff; min-width: 76px; }
button[aria-pressed=true] { background: var(--ink); color: #fff; border-color: var(--ink); }
.speed { display: flex; gap: 4px; }
.speed button { padding: 6px 8px; }

.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tag { font-size: 12px; font-weight: bold; padding: 2px 8px; border-radius: 10px; color: #fff; white-space: nowrap; }
.tag.baseline { background: var(--orange); }
.tag.dgpg { background: var(--blue); }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 6px; }
.kpi { border-top: 1px solid var(--line); padding-top: 6px; }
.kpi span { display: block; font-size: 12px; color: var(--muted); }
.kpi strong { font-size: 22px; font-variant-numeric: tabular-nums; }

svg { display: block; width: 100%; height: auto; overflow: visible; }
svg text { font-family: var(--font); fill: var(--ink); }
.axis-label { font-size: 14px; }
.tick-label { font-size: 12px; }
.legend-label { font-size: 14px; }
.fleet .tile { cursor: pointer; }
.fleet .tile:hover rect.frame { stroke: var(--ink); }

.legend-inline { display: flex; flex-wrap: wrap; gap: 14px; font-size: 14px; color: var(--muted); margin-top: 8px; }
.legend-inline i { display: inline-block; width: 14px; height: 3px; vertical-align: middle; margin-right: 5px; }

.formula { font-size: 16px; background: #f0f2f5; border-radius: 6px; padding: 8px 12px; display: inline-block; margin: 4px 0 10px; }

.scenario-card { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: center; color: inherit; }
.scenario-card:hover { text-decoration: none; border-color: var(--blue); }
@media (max-width: 640px) { .scenario-card { grid-template-columns: 1fr; } }
.enter { display: inline-block; margin-top: 8px; font-weight: bold; color: var(--blue); }

.slider-row { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; font-size: 14px; }
.slider-row input { flex: 1; accent-color: var(--blue); }

.problem { margin-top: 8px; }
.spec { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 14px; margin-top: 18px; }
@media (max-width: 860px) { .spec { grid-template-columns: 1fr; } }
.spec > div { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; padding: 14px; border-radius: 10px; background: var(--page); }
.spec b { display: block; font-size: 14px; margin-bottom: 2px; }
.spec p { margin: 0; font-size: 16px; }
.spec-icon { width: 36px; height: 36px; padding: 7px; border-radius: 50%; background: #fff; fill: none; stroke: var(--blue); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.spec > div.goal { background: #e8eef7; }
.spec .goal b { color: var(--blue); }
.spec .goal p { font-weight: bold; }
.kpi em.delta { display: block; font-style: normal; font-size: 12px; font-weight: bold; color: var(--green); }
.kpi em.delta.worse { color: var(--muted); }
.steps { padding: 8px 20px; }
.step { position: relative; display: grid; grid-template-columns: 40px 200px 1fr; gap: 18px; align-items: center; padding: 18px 0; border-top: 1px solid var(--line); }
.step:first-of-type { border-top: none; }
.step-num { width: 32px; height: 32px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: bold; display: grid; place-items: center; z-index: 1; }
.step:not(:last-of-type)::before { content: ""; position: absolute; left: 15px; top: 50%; height: 100%; border-left: 2px solid #c9d4e5; }
.step-head b { display: block; font-size: 16px; }
.step-tag { display: inline-block; margin-top: 4px; font-size: 12px; color: var(--blue); background: #e8eef7; border-radius: 10px; padding: 1px 8px; }
.step-body { min-width: 0; }
/* A formula wider than the column scrolls sideways instead of being cut off. */
.step-formula { overflow-x: auto; overflow-y: hidden; padding: 2px 0 4px; -webkit-overflow-scrolling: touch; }
.step-body math { font-size: 19px; }
.step-body p { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
@media (max-width: 860px) { .step { grid-template-columns: 40px 1fr; } .step-body { grid-column: 2; } }
@media (max-width: 640px) {
  .steps { padding: 4px 14px; } .step { grid-template-columns: 32px 1fr; gap: 12px; } .step-body math { font-size: 16px; }
  /* Keep the problem diagram legible: it scrolls sideways instead of shrinking to fit. */
  #problem-diagram { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
  #problem-diagram svg { min-width: 720px; }
}
.more-right { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
.scaling { gap: 28px; align-items: start; }
.scaling h3 { margin-bottom: 8px; }
.steps-lead { margin: 0 0 6px; color: var(--muted); }
.steps-summary { margin: 4px 0 16px; padding: 14px 16px; border-radius: 10px; background: #e8eef7; font-weight: bold; }

/* Overview page */
.hero { position: relative; min-height: 520px; overflow: hidden; background: #060d1a; display: flex; align-items: center; }
.hero-art { position: absolute; inset: 0; }
.hero-art svg { width: 100%; height: 100%; }
.hero-text { position: relative; max-width: 1240px; width: 100%; margin: 0 auto; padding: 0 16px; }
.hero-text > * { max-width: 680px; }
.hero-text h1 { color: #f2f8ff; font-size: 44px; line-height: 1.15; margin: 8px 0 14px; }
.hero-text p { color: #a9c3e6; font-size: 18px; margin: 0; }
.hero-text .hero-eyebrow { color: #5cc8ff; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; }
@media (max-width: 860px) { .hero-text h1 { font-size: 32px; } }
.pulse { animation: pulse 2.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
.flow { stroke-dasharray: 6 10; animation: flow 1.6s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -32; } }
@media (prefers-reduced-motion: reduce) { .pulse, .flow { animation: none; } }

.scenarios { margin-top: 12px; }
.scenario { display: grid; grid-template-columns: 200px 1fr; gap: 18px; align-items: center; color: inherit; }
.scenario:hover, .more-scenarios:hover { text-decoration: none; border-color: var(--blue); }
.scenario-thumb svg { border-radius: 8px; }
.scenario h3 { font-size: 18px; margin-bottom: 6px; }
.scenario .note { margin-bottom: 6px; }
@media (max-width: 640px) { .scenario, .more-scenarios { grid-template-columns: 1fr; } }
.more-scenarios { display: grid; grid-template-columns: 200px 1fr; gap: 18px; align-items: center; margin-top: 16px; }
.scenario-thumb.small svg { max-height: 110px; }
.tutorial { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; padding: 24px; color: #e8f4ff; background: linear-gradient(120deg, #0b1d36, #13345f); border: none; }
.tutorial .eyebrow { color: #5cc8ff; }
.tutorial h2 { color: #f2f8ff; }
.tutorial .note { color: #a9c3e6; margin: 0; }
.tutorial > div:first-child { flex: 1 1 480px; min-width: 0; }
.tutorial-links { display: flex; gap: 10px; flex-wrap: wrap; flex: none; }
.tutorial + .tutorial { margin-top: 16px; }
.pill { display: inline-block; padding: 8px 16px; border-radius: 20px; border: 1px solid #5cc8ff; color: #e8f4ff; font-size: 14px; font-weight: bold; }
.pill:hover { background: rgba(92, 200, 255, 0.15); text-decoration: none; }

.site-footer { background: #060d1a; color: #a9c3e6; font-size: 14px; padding: 44px 0 20px; }
.site-footer a { color: #a9c3e6; }
.site-footer a:hover { color: #f2f8ff; text-decoration: none; }
.footer-inner { max-width: 1240px; margin: 0 auto; padding: 0 16px; display: grid; grid-template-columns: 1fr auto auto auto; gap: 72px; }
.footer-brand p { margin: 0 0 6px; max-width: 360px; }
.footer-title { color: #f2f8ff; font-size: 18px; font-weight: bold; }
.site-footer .footer-email { display: inline-flex; align-items: center; gap: 8px; color: #f2f8ff; font-size: 15px; font-weight: bold; white-space: nowrap; }
.site-footer .footer-email:hover { color: #5cc8ff; }
.footer-email svg { width: 15px; height: 15px; fill: #5cc8ff; flex: none; }
.footer-icons { display: flex; gap: 16px; margin-top: 6px; }
.footer-icons svg { width: 20px; height: 20px; fill: currentColor; display: block; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-head { margin: 0 0 4px; color: #5cc8ff; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.footer-bottom { max-width: 1208px; width: calc(100% - 32px); margin: 36px auto 0; padding-top: 16px; border-top: 1px solid #1c2c45; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12px; color: #6f86a8; }
.footer-bottom a { color: #6f86a8; }
@media (max-width: 960px) { .footer-inner { gap: 40px; } }
@media (max-width: 640px) { .footer-inner { grid-template-columns: 1fr 1fr; gap: 24px; } .footer-brand, .footer-contact { grid-column: 1 / -1; } }
body:has(> .site-footer) { min-height: 100vh; display: flex; flex-direction: column; }
body:has(> .site-footer) > main { flex: 1; width: 100%; }

.site-header { position: sticky; top: 0; z-index: 10; background: #060d1a; border-bottom: 1px solid #1c2c45; }
.header-inner { max-width: 1240px; margin: 0 auto; padding: 0 16px; height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.header-brand { color: #f2f8ff; font-weight: bold; font-size: 16px; white-space: nowrap; }
.header-brand:hover { color: #fff; text-decoration: none; }
.header-nav { display: flex; align-items: center; gap: 24px; font-size: 14px; }
.header-nav > a, .nav-menu summary { color: #a9c3e6; white-space: nowrap; cursor: pointer; }
.header-nav > a:hover, .nav-menu summary:hover, .nav-menu[open] summary { color: #f2f8ff; text-decoration: none; }
.nav-menu { position: relative; }
.nav-menu summary { list-style: none; }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-3px) rotate(45deg); }
.nav-menu[open] summary::after { transform: translateY(0) rotate(-135deg); }
.nav-menu-list { position: absolute; right: 0; top: calc(100% + 14px); min-width: 240px; max-height: 70vh; overflow-y: auto; padding: 6px; background: #0b1d36; border: 1px solid #1c2c45; border-radius: 10px; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35); display: flex; flex-direction: column; }
.nav-menu-list a { color: #a9c3e6; padding: 8px 12px; border-radius: 6px; white-space: nowrap; }
.nav-menu-list a:hover { background: rgba(92, 200, 255, 0.12); color: #f2f8ff; text-decoration: none; }
.nav-menu-list a[aria-current=page] { color: #f2f8ff; background: rgba(92, 200, 255, 0.18); }
.nav-menu-list .nav-menu-all { margin-top: 4px; padding-top: 10px; border-top: 1px solid #1c2c45; border-radius: 0 0 6px 6px; color: #5cc8ff; }
@media (max-width: 640px) { .header-nav { gap: 18px; } .nav-menu-list { right: -60px; } }

/* Language switch: EN / 中文, in the header and at the top right of the overview hero. */
html.i18n-pending body { visibility: hidden; }
.lang-switch { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid #2a4468; border-radius: 16px; }
.lang-switch button { border: 0; border-radius: 14px; background: transparent; color: #a9c3e6; font-size: 13px; line-height: 1.4; padding: 3px 10px; white-space: nowrap; }
.lang-switch button:hover { color: #f2f8ff; }
.lang-switch button[aria-pressed=true] { background: rgba(92, 200, 255, 0.18); color: #f2f8ff; cursor: default; }
.lang-switch button:focus-visible { outline: 2px solid #5cc8ff; outline-offset: 1px; }
.hero-lang { position: absolute; top: 0; left: 0; right: 0; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 18px 16px 0; display: flex; justify-content: flex-end; pointer-events: none; }
.hero-lang .lang-switch { pointer-events: auto; background: rgba(6, 13, 26, 0.6); }
/* On narrow screens only the other language is offered. */
@media (max-width: 640px) { .lang-switch button[aria-pressed=true] { display: none; } .lang-switch button { padding: 3px 8px; } }
@media (max-width: 460px) {
  .header-nav { gap: 14px; flex: none; }
  .header-brand { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
}

/* Robotaxi rebalancing page */
.timeline-card { margin-top: 16px; padding-bottom: 10px; }
.pattern-now { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-bottom: 8px; font-size: 16px; }
.pattern-now .note { margin: 0; }
.pattern-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; align-self: center; }
.city svg { max-width: 600px; margin: 8px auto 0; }
.road svg { max-width: 600px; margin: 8px auto 0; }
#problem-diagram svg { max-width: 560px; }
