:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --panel: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --accent: #2563eb;
  --accent-2: #7c3aed;
  --accent-soft: #eff6ff;
  --sidebar: #0b1220;
  --sidebar-ink: #cbd5e1;
  --sidebar-muted: #8290a8;
  --danger: #b91c1c;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow: 0 20px 55px rgb(15 23 42 / 0.08);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

code,
kbd,
pre {
  font-family: var(--mono);
}

code {
  background: #eef2f7;
  border-radius: 5px;
  padding: 0.12em 0.38em;
  font-size: 0.9em;
}

pre {
  margin: 0;
  overflow: auto;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  transform: translateY(-160%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.skip-link:focus {
  transform: translateY(0);
}

.app {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  min-height: 100vh;
}

/* ------------------------------------------------------------------------- */
/* Sidebar                                                                    */
/* ------------------------------------------------------------------------- */

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 26px 20px;
  overflow-y: auto;
  background:
    radial-gradient(640px 420px at 8% -8%, rgb(37 99 235 / 0.34), transparent 62%),
    radial-gradient(520px 380px at 100% 108%, rgb(124 58 237 / 0.2), transparent 64%),
    var(--sidebar);
  color: var(--sidebar-ink);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px;
  border-radius: 12px;
  color: #fff;
  text-decoration: none;
}

.brand:focus-visible,
.site-nav__link:focus-visible,
.sidebar__footer a:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.brand__icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  color: #93c5fd;
}

.brand__text {
  display: grid;
  line-height: 1.25;
}

.brand__text strong {
  font-size: 16px;
  letter-spacing: -0.01em;
}

.brand__text small {
  color: var(--sidebar-muted);
  font-size: 11px;
}

.site-nav {
  display: grid;
  gap: 3px;
}

.site-nav__link {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 12px;
  border-left: 2px solid transparent;
  border-radius: 10px;
  color: var(--sidebar-muted);
  font-size: 14px;
  text-decoration: none;
  transition:
    color 150ms ease,
    background 150ms ease,
    border-color 150ms ease;
}

.site-nav__link span {
  color: #52617a;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.site-nav__link:hover {
  background: rgb(148 163 184 / 0.08);
  color: #e2e8f0;
}

.site-nav__link.is-active {
  border-left-color: #60a5fa;
  background: linear-gradient(90deg, rgb(37 99 235 / 0.24), rgb(37 99 235 / 0.03));
  color: #fff;
}

.site-nav__link.is-active span {
  color: #93c5fd;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 0 12px;
  color: #52617a;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.lang-switch a {
  color: var(--sidebar-muted);
  text-decoration: none;
}

.lang-switch a:hover,
.lang-switch a[aria-current='true'] {
  color: #93c5fd;
}

.lang-switch a[aria-current='true'] {
  font-weight: 600;
}

.sidebar__footer {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 18px 8px 4px;
  border-top: 1px solid rgb(148 163 184 / 0.14);
  color: var(--sidebar-muted);
  font-size: 12px;
}

.sidebar__footer a {
  color: #dbeafe;
  text-decoration: none;
}

.sidebar__footer a:hover {
  color: #fff;
}

/* ------------------------------------------------------------------------- */
/* Content shell                                                              */
/* ------------------------------------------------------------------------- */

.content {
  min-width: 0;
}

.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 88px clamp(24px, 5vw, 72px);
  scroll-margin-top: 24px;
}

.section + .section {
  border-top: 1px solid rgb(226 232 240 / 0.7);
}

.section__head {
  max-width: 720px;
  margin-bottom: 36px;
}

.section__head h2 {
  margin: 10px 0 14px;
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.18;
  letter-spacing: -0.025em;
}

.section__head p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h3 {
  margin: 0 0 8px;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.muted {
  color: var(--muted);
}

/* ------------------------------------------------------------------------- */
/* Hero                                                                       */
/* ------------------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.hero__glow {
  position: absolute;
  top: 8%;
  right: -140px;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(37 99 235 / 0.2), transparent 66%);
  filter: blur(8px);
  pointer-events: none;
}

.hero h1 {
  position: relative;
  margin: 18px 0 22px;
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.gradient-text {
  background: linear-gradient(110deg, var(--accent), var(--accent-2));
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.hero__lead {
  position: relative;
  max-width: 660px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.hero__lead code {
  color: var(--ink);
  background: #e5ebf5;
}

.hero__actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 32px 0 26px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 10px 18px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    border-color 150ms ease;
}

.button:hover {
  border-color: #94a3b8;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgb(15 23 42 / 0.08);
}

.button:focus-visible,
select:focus-visible,
input:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.button--primary {
  border-color: transparent;
  background: linear-gradient(120deg, #2563eb, #4f46e5);
  color: #fff;
  box-shadow: 0 10px 26px rgb(37 99 235 / 0.28);
}

.button--primary:hover {
  border-color: transparent;
  box-shadow: 0 14px 30px rgb(37 99 235 / 0.34);
}

.button--small {
  padding: 7px 12px;
  font-size: 13px;
}

.tags {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tags li {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.7);
  padding: 4px 11px;
  color: var(--muted);
  font-size: 12px;
}

.hero__stats {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 18px 48px;
  margin: 52px 0 0;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.hero__stats div {
  min-width: 104px;
}

.hero__stats dt {
  color: var(--muted);
  font-size: 12px;
}

.hero__stats dd {
  margin: 2px 0 0;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ------------------------------------------------------------------------- */
/* Pipeline                                                                   */
/* ------------------------------------------------------------------------- */

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

.flow {
  --flow-pad: 20px;
  --flow-index: 46px;
  --flow-indent: 20px;
  display: grid;
  gap: 16px;
}

.flow__legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  color: var(--muted);
  font-size: 12px;
}

.flow__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.flow__legend-item i {
  width: 12px;
  height: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
}

.flow__legend-item--core i {
  border-color: #0f172a;
  background: #0f172a;
}

.flow__legend-item--feature i {
  border-color: #93c5fd;
  background: #dbeafe;
}

.flow__legend-item--extension i {
  border-style: dashed;
  background: #fff;
}

.flow__list {
  position: relative;
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0 0 0 var(--flow-indent);
  list-style: none;
}

.flow__list::before {
  content: "";
  position: absolute;
  top: 26px;
  bottom: 26px;
  left: 8px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, #bfdbfe, #e2e8f0);
}

.flow__stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(270px, 0.8fr);
  gap: 14px 20px;
  align-items: stretch;
}

.flow__core {
  position: relative;
  display: grid;
  grid-template-columns: var(--flow-index) minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  padding: 18px var(--flow-pad);
  box-shadow: 0 8px 24px rgb(15 23 42 / 0.04);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.flow__core:hover {
  border-color: #bfdbfe;
  box-shadow: 0 14px 32px rgb(15 23 42 / 0.07);
}

.flow__index {
  display: grid;
  place-items: center;
  width: var(--flow-index);
  height: var(--flow-index);
  border-radius: 12px;
  background: #0f172a;
  color: #fff;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.flow__body {
  min-width: 0;
}

.flow__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.flow__head h3 {
  margin: 0;
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.flow__kind {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  padding: 2px 8px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.flow__body p {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
}

.flow__io {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.flow__io code {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  padding: 3px 7px;
  color: #334155;
  font-size: 11px;
}

.flow__mounts {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  border-left: 1px dashed var(--line-strong);
  padding: 2px 0 2px 16px;
}

.flow__mount-label {
  width: 100%;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.flow__chip {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 7px;
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.flow__chip::before {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.flow__chip strong {
  color: inherit;
  font-weight: 600;
}

.flow__chip--feature {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.flow__chip--feature::before {
  background: currentColor;
}

.flow__chip--extension {
  border: 1px dashed var(--line-strong);
  background: #fff;
  color: var(--muted);
}

.flow__chip--extension::before {
  border: 1px solid currentColor;
  background: transparent;
}

.flow__loop {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin-left: var(--flow-indent);
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: #f8fafc;
  padding: 14px 18px;
  color: var(--muted);
  font-size: 12px;
}

.flow__loop-label {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.flow__loop code {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  padding: 1px 5px;
  color: #334155;
  font-size: 10.5px;
}

.callout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-top: 22px;
  border: 1px solid #dbeafe;
  border-radius: var(--radius);
  background: var(--accent-soft);
  padding: 18px 22px;
  color: #1e3a8a;
}

.callout__icon {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 18px;
  line-height: 1.5;
}

.callout code {
  background: rgb(255 255 255 / 0.8);
}

/* ------------------------------------------------------------------------- */
/* Algorithm                                                                  */
/* ------------------------------------------------------------------------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  gap: 40px;
  align-items: start;
}

.split--top {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
}

.prose > p {
  margin: 0 0 14px;
  color: var(--muted);
}

.prose h3 {
  margin-top: 4px;
}

.formula {
  margin: 12px 0 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 12px 16px;
  color: #1e293b;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre;
}

.compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.compare__item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  padding: 18px;
}

.compare__item h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 14px;
}

.compare__item p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
}

.badge {
  border-radius: 999px;
  background: #e0edff;
  padding: 2px 8px;
  color: #1d4ed8;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.badge--alt {
  background: #f3e8ff;
  color: #7e22ce;
}

.checklist {
  display: grid;
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.checklist li {
  position: relative;
  padding-left: 24px;
  color: var(--muted);
}

.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.formula-card {
  position: sticky;
  top: 96px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(420px 300px at 100% 0%, rgb(37 99 235 / 0.28), transparent 62%),
    #0b1220;
  padding: 26px;
  color: #dbeafe;
  box-shadow: 0 24px 60px rgb(15 23 42 / 0.2);
}

.formula-card__label {
  margin: 0 0 18px;
  color: #93c5fd;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.matrix {
  overflow-x: auto;
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.9;
  white-space: pre;
}

.formula-card__notes {
  display: grid;
  gap: 10px;
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid rgb(148 163 184 / 0.18);
}

.formula-card__notes div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
}

.formula-card__notes dt {
  color: #94a3b8;
  font-family: var(--mono);
}

.formula-card__notes dd {
  margin: 0;
  color: #e2e8f0;
  font-family: var(--mono);
  text-align: right;
}

.formula-card__hint {
  margin: 18px 0 0;
  color: #94a3b8;
  font-size: 12px;
}

/* ------------------------------------------------------------------------- */
/* Demo                                                                       */
/* ------------------------------------------------------------------------- */

.section--demo {
  max-width: 1320px;
}

.demo-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.demo-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  padding: 14px 18px;
}

.field {
  display: grid;
  gap: 5px;
}

.field > span {
  color: var(--muted);
  font-size: 11px;
}

.field select {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  padding: 7px 10px;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.field--range {
  grid-template-columns: minmax(110px, 180px) 48px;
  align-items: center;
  gap: 8px;
}

.field--range > span {
  grid-column: 1 / -1;
}

.field--range input {
  width: 100%;
  accent-color: var(--accent);
}

.field--range output {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  text-align: right;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding-bottom: 8px;
  color: #334155;
  font-size: 13px;
  cursor: pointer;
}

.check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.check input:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

select:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.demo-toolbar .button {
  margin-left: auto;
}

.demo-stage {
  background: #fff;
}

.demo-stage canvas {
  display: block;
  width: 100%;
  height: 540px;
  cursor: grab;
  touch-action: none;
}

.demo-stage canvas.is-dragging {
  cursor: grabbing;
}

.demo-stage canvas.is-scrollbar-hover,
.demo-stage canvas.is-scrollbar-dragging {
  cursor: default;
}

.demo-stage canvas.is-header-hover {
  cursor: pointer;
}

.demo-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
  padding: 10px 18px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.demo-status strong {
  color: var(--ink);
  font-weight: 600;
}

.demo-extensions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  border-top: 1px dashed var(--line);
  padding: 12px 18px;
  background: #fcfdff;
}

.demo-extensions__label {
  margin-right: 4px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.demo-extensions__options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.demo-extensions .check {
  padding-bottom: 0;
  color: #475569;
  font-size: 12px;
}

.demo-extensions .check input {
  width: 15px;
  height: 15px;
}

.demo-extensions__divider {
  width: 1px;
  height: 18px;
  background: var(--line);
}

.demo-extensions button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 5px 9px;
  color: #94a3b8;
  font: inherit;
  font-size: 12px;
  cursor: not-allowed;
}

.demo-extensions__hint {
  color: var(--muted);
  font-size: 11px;
}

.demo-error {
  margin: 0;
  border-top: 1px solid #fecaca;
  background: #fef2f2;
  padding: 10px 18px;
  color: var(--danger);
  font-size: 13px;
}

.demo-hint {
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: 12px;
}

kbd {
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: #fff;
  padding: 1px 5px;
  color: #334155;
  font-size: 10.5px;
}

/* ------------------------------------------------------------------------- */
/* Performance                                                                */
/* ------------------------------------------------------------------------- */

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.metric {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 22px;
}

.metric strong {
  display: block;
  background: linear-gradient(110deg, var(--accent), var(--accent-2));
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  font-family: var(--mono);
  font-size: 30px;
  letter-spacing: -0.03em;
}

.metric span {
  color: var(--muted);
  font-size: 12.5px;
}

.plan-card h3 {
  margin-bottom: 16px;
}

.plan-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.plan-list li {
  display: grid;
  gap: 2px;
  padding-left: 14px;
  border-left: 2px solid #e2e8f0;
}

.plan-list strong {
  font-size: 13px;
}

.plan-list span {
  color: var(--muted);
  font-size: 12.5px;
}

.text-link {
  display: inline-block;
  margin-top: 24px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ------------------------------------------------------------------------- */
/* Benchmark                                                                  */
/* ------------------------------------------------------------------------- */

.bench-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.bench-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 12px 32px rgb(15 23 42 / 0.05);
}

.bench-table-wrap {
  overflow-x: auto;
}

.bench-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.bench-table th,
.bench-table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 16px;
  text-align: right;
  white-space: nowrap;
}

.bench-table th {
  background: #f8fafc;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.bench-table th:first-child,
.bench-table td:first-child {
  text-align: left;
}

.bench-table td:first-child {
  font-family: var(--mono);
}

.bench-table tbody tr:last-child td {
  border-bottom: 0;
}

.bench-table tbody tr:hover {
  background: #fbfdff;
}

.bench-mode {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
}

.bench-mode--single {
  background: #e0edff;
  color: #1d4ed8;
}

.bench-mode--chunked {
  background: #f3e8ff;
  color: #7e22ce;
}

.bench-meta {
  margin: 0;
  border-top: 1px solid var(--line);
  background: #f8fafc;
  padding: 9px 16px;
  color: var(--muted);
  font-size: 11px;
}

.bench-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 24px;
  margin-top: 24px;
}

.bench-detail .checklist {
  margin-top: 12px;
}

.bench-source {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.bench-source a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.bench-source a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bench-error {
  color: var(--danger);
  text-align: left !important;
  white-space: normal;
}

/* ------------------------------------------------------------------------- */
/* Depth sweep                                                                */
/* ------------------------------------------------------------------------- */

.depth-subhead {
  margin: 28px 0 12px;
  color: #334155;
  font-size: 15px;
}

.depth-table {
  min-width: 720px;
}

.depth-table th:nth-child(-n + 2),
.depth-table td:nth-child(-n + 2) {
  text-align: left;
}

.depth-time {
  display: grid;
  gap: 4px;
  min-width: 110px;
  text-align: right;
}

.depth-time__value {
  font-variant-numeric: tabular-nums;
}

.depth-bar {
  display: block;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.depth-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #93c5fd, #2563eb);
}

.depth-bar i.is-over {
  background: var(--danger);
}

.depth-stop {
  margin: 0 0 4px;
  border-left: 3px solid var(--danger);
  border-radius: 0 8px 8px 0;
  background: #fef2f2;
  padding: 10px 14px;
  color: #991b1b;
  font-size: 13px;
}

.depth-stop.is-time {
  border-left-color: var(--accent);
  background: var(--accent-soft);
  color: #1e3a8a;
}

.depth-stop.is-complete {
  border-left-color: #16a34a;
  background: #f0fdf4;
  color: #166534;
}

.depth-failed td {
  background: #fff7f7;
  color: var(--danger);
}

.depth-table td:last-child {
  color: var(--muted);
}

/* ------------------------------------------------------------------------- */
/* Quickstart                                                                 */
/* ------------------------------------------------------------------------- */

.code-tabs {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.code-tabs__list {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.code-tabs__tab {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 6px 12px;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease;
}

.code-tabs__tab:hover {
  border-color: #bfdbfe;
  color: var(--ink);
}

.code-tabs__tab[aria-selected="true"] {
  border-color: #bfdbfe;
  background: var(--accent-soft);
  color: #1d4ed8;
  font-weight: 600;
}

.code-tabs__tab:focus-visible,
.code-card__copy:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.code-tabs__panel {
  min-width: 0;
}

.code-tabs__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.code-card__copy {
  border: 1px solid rgb(148 163 184 / 0.28);
  border-radius: 6px;
  background: rgb(148 163 184 / 0.12);
  padding: 2px 8px;
  color: #dbeafe;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  transition:
    background 150ms ease,
    border-color 150ms ease;
}

.code-card__copy:hover {
  border-color: rgb(147 197 253 / 0.6);
  background: rgb(148 163 184 / 0.2);
}

.code-card__copy-status {
  min-width: 3.5em;
  color: #93c5fd;
  font-size: 11px;
  text-align: right;
}

.code-tabs__note {
  margin: 0;
  border-top: 1px solid rgb(148 163 184 / 0.16);
  padding: 9px 18px;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.6;
}

.code-tabs__fallback {
  margin: 0;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: #f8fafc;
  padding: 18px;
  color: var(--muted);
  font-size: 13px;
}

.code-card {
  overflow: hidden;
  border-radius: var(--radius);
  background: #0b1220;
  color: #e2e8f0;
  box-shadow: 0 18px 44px rgb(15 23 42 / 0.16);
}

.code-card__bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgb(148 163 184 / 0.16);
  padding: 10px 18px;
  color: #94a3b8;
  font-family: var(--mono);
  font-size: 11px;
}

.code-card pre {
  padding: 20px;
  font-size: 12.5px;
  line-height: 1.75;
}

.code-card code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.quickstart__side {
  display: grid;
  gap: 16px;
}

.quickstart__side .card h3 {
  margin-bottom: 12px;
}

.custom-feature .plan-list {
  margin-top: 12px;
}

.custom-feature--wide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.75fr);
  gap: 24px 40px;
  margin-top: 20px;
}

.custom-feature__title {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 0;
}

.custom-feature__links {
  margin-top: 0;
}

.command {
  margin: 0 0 12px;
  border-radius: 10px;
  background: #0b1220;
  padding: 12px 14px;
  color: #dbeafe;
  font-size: 11.5px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.quickstart__side .muted {
  margin: 0 0 12px;
  font-size: 12px;
}

.link-list {
  display: grid;
  gap: 8px;
}

.link-list a {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.link-list a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ------------------------------------------------------------------------- */
/* Footer                                                                     */
/* ------------------------------------------------------------------------- */

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  max-width: 1180px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 24px clamp(24px, 5vw, 72px) 40px;
  color: var(--muted);
  font-size: 12px;
}

.footer a {
  color: var(--accent);
  text-decoration: none;
}

/* ------------------------------------------------------------------------- */
/* Responsive                                                                 */
/* ------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .app {
    grid-template-columns: 236px minmax(0, 1fr);
  }

  .split {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.9fr);
    gap: 28px;
  }
}

@media (max-width: 980px) {
  .app {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    overflow: visible;
    padding: 10px 16px;
    background: var(--sidebar);
  }

  .brand {
    flex: 0 0 auto;
    padding: 0;
  }

  .brand__icon {
    width: 28px;
    height: 28px;
  }

  .brand__text small {
    display: none;
  }

  .site-nav {
    display: flex;
    flex: 1;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-nav__link {
    flex: 0 0 auto;
    border-left: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 7px 9px;
    white-space: nowrap;
  }

  .site-nav__link span {
    display: none;
  }

  .site-nav__link.is-active {
    border-bottom-color: #60a5fa;
    background: transparent;
  }

  .sidebar__footer {
    display: none;
  }

  .lang-switch {
    flex: 0 0 auto;
    margin: 0;
    padding: 0 4px;
  }

  .section {
    padding: 64px 24px;
    scroll-margin-top: 86px;
  }

  .hero {
    min-height: auto;
    padding-top: 72px;
  }

  .hero__stats {
    margin-top: 40px;
  }

  .formula-card {
    position: static;
  }

  .split,
  .split--top {
    grid-template-columns: 1fr;
  }

  .bench-detail {
    grid-template-columns: 1fr;
  }

  .flow__stage {
    grid-template-columns: 1fr;
  }

  .flow__mounts {
    border-left: 0;
    border-top: 1px dashed var(--line);
    padding: 12px 0 0;
  }

  .custom-feature--wide {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .section {
    padding: 56px 18px;
  }

  .flow {
    --flow-pad: 14px;
    --flow-index: 38px;
    --flow-indent: 14px;
  }

  .flow__legend {
    gap: 8px 14px;
  }

  .flow__list::before {
    left: 2px;
  }

  .flow__core {
    gap: 10px;
    padding: 14px;
  }

  .flow__head h3 {
    font-size: 14px;
  }

  .flow__body p {
    font-size: 13px;
  }

  .flow__chip {
    width: 100%;
    border-radius: 10px;
  }

  .hero h1 {
    font-size: clamp(36px, 11vw, 46px);
  }

  .hero__lead {
    font-size: 16px;
  }

  .hero__actions .button {
    flex: 1 1 auto;
  }

  .hero__stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  .compare {
    grid-template-columns: 1fr;
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .bench-summary {
    grid-template-columns: 1fr;
  }

  .demo-toolbar {
    align-items: stretch;
  }

  .field,
  .field--range {
    flex: 1 1 100%;
  }

  .field--range {
    grid-template-columns: minmax(100px, 1fr) 48px;
  }

  .demo-toolbar .button {
    flex: 1 1 100%;
    margin-left: 0;
  }

  .demo-stage canvas {
    height: 420px;
  }

  .demo-status {
    flex-direction: column;
    gap: 3px;
  }

  .demo-extensions {
    align-items: flex-start;
  }

  .demo-extensions__options {
    flex: 1 1 100%;
    gap: 8px 14px;
  }

  .demo-extensions__divider {
    display: none;
  }

  .demo-extensions__hint {
    flex: 1 1 100%;
  }

  .footer {
    padding: 20px 18px 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
