.documentation-page {
  --doc-ink: var(--theme-ink, #17201d);
  --doc-muted: var(--theme-muted, #64706b);
  --doc-line: var(--theme-line, #dce4df);
  --doc-line-strong: var(--theme-line-strong, #c7d2cc);
  --doc-surface: var(--theme-surface, #ffffff);
  --doc-soft: var(--theme-surface-soft, #f5f8f6);
  --doc-accent: var(--theme-strong, #256b5b);
  --doc-accent-hover: var(--theme-strong-hover, #1f594d);
  --doc-accent-soft: var(--theme-accent-soft, #eaf4ef);
  position: relative;
  color: var(--doc-ink);
}

html:has(.documentation-page.active),
body:has(.documentation-page.active) {
  overflow-x: clip;
  overflow-y: visible;
}

.documentation-language-panel[hidden] {
  display: none !important;
}

html[data-documentation-language="zh"] .documentation-language-panel[data-doc-language-panel="en"],
html[data-documentation-language="en"] .documentation-language-panel[data-doc-language-panel="zh"] {
  display: none !important;
}

html[data-documentation-language="zh"] .documentation-language-panel[data-doc-language-panel="zh"],
html[data-documentation-language="en"] .documentation-language-panel[data-doc-language-panel="en"] {
  display: block !important;
}

.documentation-language-panel {
  min-width: 0;
}

.documentation-language-switch {
  position: absolute;
  top: 28px;
  right: 0;
  z-index: 12;
  display: inline-flex;
  gap: 4px;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--doc-accent) 22%, var(--doc-line));
  border-radius: 999px;
  padding: 4px;
  background: color-mix(in srgb, var(--doc-surface) 88%, transparent);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--doc-ink) 8%, transparent);
  backdrop-filter: blur(14px);
}

.documentation-language-switch button {
  display: inline-flex;
  gap: 7px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  background: transparent;
  color: var(--doc-muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.documentation-language-switch button > span {
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid color-mix(in srgb, currentColor 24%, transparent);
  border-radius: 50%;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
}

.documentation-language-switch button:hover,
.documentation-language-switch button:focus-visible {
  color: var(--doc-accent);
  outline: none;
}

.documentation-language-switch button.active {
  background: var(--doc-accent);
  color: #fff;
  box-shadow: 0 5px 14px color-mix(in srgb, var(--doc-accent) 24%, transparent);
}

.documentation-page :where(h1, h2, h3, p) {
  margin-top: 0;
}

.documentation-page button,
.documentation-page a {
  font-family: inherit;
}

.documentation-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 48px;
  align-items: center;
  width: 100%;
  min-height: 300px;
  margin: 0;
  padding: 44px 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--theme-hero, #e9edf0);
  box-shadow: 0 0 0 100vmax var(--theme-hero, #e9edf0);
  clip-path: inset(0 -100vmax);
}

.documentation-hero::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  background-image: repeating-linear-gradient(
    135deg,
    transparent 0,
    transparent 158px,
    var(--theme-pattern, rgba(88, 108, 118, 0.075)) 159px,
    var(--theme-pattern, rgba(88, 108, 118, 0.075)) 161px,
    transparent 162px,
    transparent 320px
  );
  background-position: 32px 0;
  content: "";
  opacity: 0.56;
  pointer-events: none;
}

.documentation-hero::after {
  position: absolute;
  z-index: 0;
  top: 50%;
  right: -155px;
  width: 460px;
  height: 460px;
  border: 2px solid var(--theme-ring, rgba(88, 108, 118, 0.11));
  border-radius: 50%;
  box-shadow:
    0 0 0 52px color-mix(in srgb, var(--theme-ring, rgba(88, 108, 118, 0.11)) 48%, transparent),
    0 0 0 104px color-mix(in srgb, var(--theme-ring, rgba(88, 108, 118, 0.11)) 24%, transparent);
  content: "";
  transform: translateY(-50%);
  pointer-events: none;
}

.documentation-hero > * {
  position: relative;
  z-index: 1;
}

.documentation-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.documentation-kicker span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--doc-accent) 28%, var(--doc-line));
  border-radius: 999px;
  padding: 4px 11px;
  background: color-mix(in srgb, var(--doc-surface) 76%, transparent);
  color: var(--doc-accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.page-hero-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.page-hero-kicker span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--theme-strong, #30393e) 28%, var(--theme-line, #d9d4cb));
  border-radius: 999px;
  padding: 4px 11px;
  background: color-mix(in srgb, var(--theme-surface, #fff) 76%, transparent);
  color: var(--theme-strong, #30393e);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.site-language-switch {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 3px;
  align-items: center;
  border: 1px solid var(--theme-line-strong, #c7d2cc);
  border-radius: 999px;
  padding: 3px;
  background: color-mix(in srgb, var(--theme-surface, #fff) 88%, transparent);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--theme-ink, #17201d) 7%, transparent);
}

.site-language-switch button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 999px;
  padding: 5px 10px;
  background: transparent;
  color: var(--theme-muted, #64706b);
  cursor: pointer;
}

.site-language-switch button > span {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border: 1px solid color-mix(in srgb, currentColor 24%, transparent);
  border-radius: 50%;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
}

.site-language-switch button > b {
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.site-language-switch button.active {
  background: var(--theme-strong, #30393e);
  color: #fff;
}

@media (max-width: 720px) {
  .site-language-switch button {
    width: 34px;
    min-width: 34px;
    padding: 0;
  }

  .site-language-switch button > b {
    display: none;
  }
}

.documentation-hero h1 {
  max-width: 760px;
  margin-bottom: 22px;
  color: var(--doc-ink);
  font-size: clamp(44px, 5vw, 72px);
  font-weight: 860;
  letter-spacing: -0.055em;
  line-height: 1.04;
}

/* Keep every product-page title on the Documentation hero's type system. */
.page-hero-title {
  box-sizing: border-box;
  width: min(760px, 100%);
  max-width: 760px !important;
  margin-top: 0 !important;
  margin-bottom: 22px !important;
  font-size: clamp(44px, 5vw, 72px) !important;
  font-weight: 860 !important;
  letter-spacing: -0.055em !important;
  line-height: 1.04 !important;
  text-align: left !important;
}

/* Keep the shared Home/Leaderboard name on one line at desktop widths. */
@media (min-width: 900px) {
  :is(#home, #public, #multimodel, #coding) .page-hero-title.single-line-title {
    width: max-content !important;
    max-width: none !important;
    white-space: nowrap !important;
  }

  #home > .home-hero > .hero-copy,
  :is(#public, #multimodel, #coding) > .figma-page-hero > .hero-copy {
    max-width: 1200px !important;
  }
}

/* Keep the complete title/background band aligned across every desktop page. */
@media (min-width: 1181px) {
  #home > .home-hero,
  #public > .figma-page-hero,
  #multimodel > .figma-page-hero,
  #coding > .figma-page-hero,
  #run > .figma-page-hero,
  #benchmark-details > .figma-page-hero,
  #rules > .figma-page-hero,
  #api-guide > .figma-page-hero,
  .documentation-language-panel > .documentation-hero {
    box-sizing: border-box !important;
    height: 420px !important;
    min-height: 420px !important;
  }

  .documentation-hero {
    padding-top: 44px;
    padding-bottom: 44px;
  }

  .documentation-hero-copy {
    align-self: center;
    transform: none;
  }
}

.documentation-hero-copy > p {
  box-sizing: border-box;
  width: min(900px, 100%);
  max-width: 900px;
  min-height: 3.1em;
  margin-right: auto;
  margin-bottom: 30px;
  color: var(--theme-muted, var(--doc-muted));
  font-size: 18px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0;
  text-align: left;
  text-wrap: balance;
  white-space: normal;
}

.documentation-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.documentation-hero-actions button {
  width: 176px;
  min-height: 46px;
  justify-content: center;
}

.documentation-principle-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto auto;
  gap: 8px;
  align-self: center;
  width: 100%;
  max-width: 340px;
  height: 307px;
  justify-self: end;
  border: 1px solid var(--theme-line-strong, var(--doc-line));
  border-radius: 16px;
  padding: 20px 22px;
  overflow: hidden;
  background: color-mix(in srgb, var(--theme-surface, var(--doc-surface)) 82%, transparent);
  box-shadow: 0 12px 30px color-mix(in srgb, var(--theme-ink, var(--doc-ink)) 8%, transparent);
}

.documentation-principle-card::after {
  position: absolute;
  right: -60px;
  bottom: -80px;
  width: 190px;
  height: 190px;
  border: 30px solid color-mix(in srgb, var(--doc-accent) 8%, transparent);
  border-radius: 50%;
  content: "";
}

.documentation-card-index {
  color: var(--doc-accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.documentation-principle-card h2 {
  display: flex;
  align-items: center;
  max-width: 460px;
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.25;
}

.documentation-principle-card > p {
  position: relative;
  z-index: 1;
  margin-bottom: 0;
  color: var(--doc-muted);
  font-size: 14px;
  line-height: 1.5;
}

.documentation-responsibility-line {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding-top: 3px;
}

.documentation-responsibility-line span {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: var(--doc-ink);
  font-size: 12px;
  font-weight: 800;
}

.documentation-responsibility-line i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--doc-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--doc-accent) 12%, transparent);
}

.documentation-responsibility-line b {
  color: var(--doc-line-strong);
  font-weight: 500;
}

.documentation-layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 64px;
  align-items: start;
  padding-top: 56px;
}

.documentation-toc {
  position: sticky;
  top: calc(var(--top-nav-height, 72px) + 28px);
  display: grid;
  gap: 14px;
  max-height: calc(100vh - var(--top-nav-height, 72px) - 48px);
  padding-bottom: 40px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.documentation-toc-title {
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--doc-line);
  color: var(--doc-muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.documentation-toc nav {
  display: grid;
  gap: 2px;
}

.documentation-toc a {
  display: grid;
  grid-template-columns: 27px 1fr;
  gap: 8px;
  align-items: center;
  min-height: 40px;
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--doc-muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.documentation-toc a span {
  color: color-mix(in srgb, var(--doc-muted) 65%, transparent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
}

.documentation-toc a:hover,
.documentation-toc a:focus-visible {
  background: var(--doc-accent-soft);
  color: var(--doc-accent);
  outline: none;
  transform: translateX(3px);
}

.documentation-content {
  min-width: 0;
}

.doc-section {
  padding: 24px 0 72px;
  border-bottom: 1px solid var(--doc-line);
  scroll-margin-top: calc(var(--top-nav-height, 72px) + 24px);
}

.doc-section:first-child {
  padding-top: 0;
}

.doc-section:last-child {
  border-bottom: 0;
}

.doc-section-heading {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.doc-section-heading > span {
  display: inline-flex;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--doc-accent) 26%, var(--doc-line));
  border-radius: 10px;
  background: var(--doc-accent-soft);
  color: var(--doc-accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 900;
}

.doc-section-heading p {
  margin-bottom: 5px;
  color: var(--doc-accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.doc-section-heading h2 {
  margin-bottom: 0;
  color: var(--doc-ink);
  font-size: clamp(28px, 3vw, 40px);
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.doc-benchmark-groups {
  display: grid;
  gap: 42px;
}

.doc-benchmark-group {
  display: grid;
  gap: 18px;
}

.doc-benchmark-group > h3 {
  margin: 0;
  color: var(--doc-ink);
  font-size: 20px;
  letter-spacing: -0.015em;
}

.documentation-page .doc-benchmark-group .dataset-card-grid,
.documentation-page .doc-benchmark-group .dataset-card-grid.two {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.documentation-page .doc-benchmark-group .dataset-card-grid article {
  min-height: 196px;
  height: auto;
  border: 1px solid var(--doc-line);
  border-radius: 12px;
  padding: 20px;
  background: color-mix(in srgb, var(--doc-surface) 82%, var(--doc-soft));
  box-shadow: none;
}

.documentation-page .doc-benchmark-group .dataset-card-grid article > span {
  min-width: 0;
  min-height: 24px;
  border: 1px solid color-mix(in srgb, var(--doc-accent) 24%, var(--doc-line));
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--doc-accent-soft);
  color: var(--doc-accent);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.documentation-page .doc-benchmark-group .dataset-card-grid h3 {
  margin: 18px 0 8px;
  color: var(--doc-ink);
  font-size: 18px;
  letter-spacing: -0.02em;
}

.documentation-page .doc-benchmark-group .dataset-card-grid p {
  margin: 0 0 18px;
  color: var(--doc-muted);
  font-size: 13px;
  line-height: 1.65;
}

.documentation-page .doc-benchmark-group .dataset-card-actions a {
  color: var(--doc-accent);
  font-size: 12px;
  font-weight: 850;
}

.documentation-page .doc-benchmark-group .dataset-card-actions a:hover,
.documentation-page .doc-benchmark-group .dataset-card-actions a:focus-visible {
  color: var(--doc-accent-hover);
  outline: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.doc-lead {
  max-width: 930px;
  margin-bottom: 28px;
  color: var(--doc-muted);
  font-size: 16px;
  line-height: 1.9;
}

.doc-pipeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 30px 0;
}

.doc-pipeline article {
  position: relative;
  min-height: 170px;
  border: 1px solid var(--doc-line);
  border-radius: 14px;
  padding: 22px 18px;
  background: var(--doc-surface);
}

.doc-pipeline article:not(:last-child)::after {
  position: absolute;
  top: 32px;
  right: -18px;
  z-index: 2;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--doc-line);
  border-radius: 50%;
  background: var(--doc-surface);
  color: var(--doc-accent);
  content: "→";
  font-size: 12px;
}

.doc-pipeline article > span {
  display: block;
  margin-bottom: 22px;
  color: var(--doc-accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 900;
}

.doc-pipeline h3,
.doc-audience-grid h3,
.doc-steps h3,
.doc-security-grid h3,
.doc-result-flow h3 {
  margin-bottom: 8px;
  color: var(--doc-ink);
  font-size: 17px;
}

.doc-pipeline p,
.doc-audience-grid p,
.doc-steps p,
.doc-security-grid p,
.doc-result-flow p {
  margin-bottom: 0;
  color: var(--doc-muted);
  font-size: 14px;
  line-height: 1.72;
}

.doc-callout {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 24px;
  align-items: start;
  border-left: 3px solid var(--doc-accent);
  border-radius: 0 12px 12px 0;
  padding: 20px 22px;
  background: var(--doc-accent-soft);
}

.doc-callout strong {
  color: var(--doc-accent);
  font-size: 14px;
}

.doc-callout p {
  margin-bottom: 0;
  color: var(--doc-muted);
  line-height: 1.75;
}

.doc-audience-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.doc-audience-grid article {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 16px;
  min-height: 264px;
  border: 1px solid var(--doc-line);
  border-radius: 16px;
  padding: 26px;
  background: var(--doc-surface);
  box-shadow: 0 12px 30px color-mix(in srgb, var(--doc-ink) 4%, transparent);
}

.doc-audience-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 12px;
  background: var(--doc-accent-soft);
  color: var(--doc-accent);
}

.doc-audience-label {
  align-self: center;
  color: var(--doc-accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.doc-audience-grid h3,
.doc-audience-grid p,
.doc-audience-grid button {
  grid-column: 1 / -1;
}

.doc-audience-grid h3 {
  margin: 6px 0 0;
  font-size: 22px;
}

.doc-audience-grid button {
  justify-self: start;
  align-self: end;
  border: 0;
  padding: 4px 0;
  background: transparent;
  color: var(--doc-accent);
  font-weight: 800;
  cursor: pointer;
}

.doc-audience-grid button span {
  display: inline-block;
  margin-left: 5px;
  transition: transform 140ms ease;
}

.doc-audience-grid button:hover span {
  transform: translateX(4px);
}

.doc-steps {
  display: grid;
  gap: 0;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.doc-steps li {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 22px;
  min-height: 126px;
}

.doc-steps li > span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--doc-accent) 28%, var(--doc-line));
  border-radius: 50%;
  background: var(--doc-surface);
  color: var(--doc-accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 900;
}

.doc-steps li:not(:last-child) > span::after {
  position: absolute;
  top: 48px;
  left: 23px;
  width: 1px;
  height: 78px;
  background: var(--doc-line-strong);
  content: "";
}

.doc-steps li > div {
  padding: 3px 0 28px;
}

.doc-steps h3 {
  font-size: 18px;
}

.doc-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--doc-line);
  border-radius: 14px;
  background: var(--doc-surface);
}

.doc-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

.doc-table th,
.doc-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--doc-line);
  color: var(--doc-muted);
  font-size: 13px;
  line-height: 1.65;
  text-align: left;
  vertical-align: top;
}

.doc-table th {
  background: var(--doc-soft);
  color: var(--doc-ink);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.doc-table tr:last-child td {
  border-bottom: 0;
}

.doc-table strong {
  color: var(--doc-ink);
}

.doc-mode-badge {
  display: inline-flex;
  min-width: 64px;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 900;
}

.doc-mode-badge.smoke { background: #eef4ff; color: #2456a6; }
.doc-mode-badge.light { background: #fff5dd; color: #8a5a00; }
.doc-mode-badge.full { background: var(--doc-accent-soft); color: var(--doc-accent); }

.doc-mode-table + * {
  margin-top: 0;
}

#doc-modes .doc-callout {
  margin-top: 20px;
}

.doc-contract-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 26px 0;
}

.doc-contract-summary article {
  border: 1px solid var(--doc-line);
  border-radius: 13px;
  padding: 18px;
  background: var(--doc-surface);
}

.doc-contract-summary span {
  color: var(--doc-muted);
  font-size: 11px;
  font-weight: 800;
}

.doc-contract-summary h3 {
  margin: 8px 0 7px;
  color: var(--doc-accent);
  font-size: 24px;
}

.doc-contract-summary p {
  margin-bottom: 0;
  color: var(--doc-muted);
  font-size: 12px;
  line-height: 1.6;
}

.documentation-page code {
  border-radius: 4px;
  padding: 1px 5px;
  background: color-mix(in srgb, var(--doc-ink) 6%, transparent);
  color: color-mix(in srgb, var(--doc-ink) 90%, var(--doc-accent));
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.doc-contract-block {
  margin-top: 20px;
  overflow: hidden;
  border: 1px solid var(--doc-line);
  border-radius: 16px;
  background: var(--doc-surface);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--doc-ink) 4%, transparent);
}

.doc-contract-block > header {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1.3fr);
  gap: 24px;
  align-items: center;
  padding: 20px 22px;
  border-bottom: 1px solid var(--doc-line);
  background: var(--doc-soft);
}

.doc-contract-block > header > div {
  display: flex;
  gap: 12px;
  align-items: center;
}

.doc-contract-block h3 {
  margin-bottom: 0;
  color: var(--doc-ink);
  font-size: 18px;
}

.doc-contract-block > header > p {
  margin-bottom: 0;
  color: var(--doc-muted);
  font-size: 13px;
  line-height: 1.7;
}

.doc-method {
  display: inline-flex;
  min-width: 52px;
  min-height: 25px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 4px 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.doc-method.post { background: #e7f4ef; color: #12624f; }
.doc-method.response { background: #eef2ff; color: #4051a3; }

.doc-contract-body {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  min-width: 0;
}

.doc-contract-body > pre,
.doc-contract-body > div > pre {
  margin: 0;
  overflow-x: auto;
  border: 0;
  border-radius: 0;
  padding: 24px;
  background: #111915;
  color: #d9f0e5;
  font-size: 12px;
  line-height: 1.7;
}

.doc-contract-body pre code {
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
}

.doc-field-list {
  display: grid;
  align-content: start;
  padding: 10px 22px;
}

.doc-field-list > div {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--doc-line);
}

.doc-field-list > div:last-child {
  border-bottom: 0;
}

.doc-field-list p {
  margin-bottom: 0;
  color: var(--doc-muted);
  font-size: 12px;
  line-height: 1.65;
}

.doc-contract-note {
  padding: 17px 22px;
  border-top: 1px solid var(--doc-line);
  color: var(--doc-muted);
  font-size: 13px;
  line-height: 1.75;
}

.doc-contract-note strong {
  color: var(--doc-ink);
}

.doc-error-table td:first-child code {
  display: inline-flex;
  min-width: 44px;
  justify-content: center;
  color: var(--doc-ink);
  font-weight: 900;
}

.doc-error-policy {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.doc-error-policy article {
  border: 1px solid var(--doc-line);
  border-radius: 12px;
  padding: 18px 20px;
  background: var(--doc-soft);
}

.doc-error-policy strong {
  color: var(--doc-ink);
  font-size: 13px;
}

.doc-error-policy p {
  margin: 8px 0 0;
  color: var(--doc-muted);
  font-size: 13px;
  line-height: 1.7;
}

.doc-security-grid,
.doc-result-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.doc-security-grid article,
.doc-result-flow article {
  min-height: 205px;
  border: 1px solid var(--doc-line);
  border-radius: 14px;
  padding: 22px;
  background: var(--doc-surface);
}

.doc-security-grid article > span,
.doc-result-flow article > span {
  display: block;
  margin-bottom: 28px;
  color: var(--doc-accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.doc-callout-security {
  margin-top: 18px;
}

.doc-result-flow article {
  position: relative;
  overflow: hidden;
}

.doc-result-flow article::after {
  position: absolute;
  right: -20px;
  bottom: -28px;
  color: color-mix(in srgb, var(--doc-accent) 6%, transparent);
  content: attr(data-step);
  font-size: 80px;
  font-weight: 900;
}

.doc-publication-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 22px;
  align-items: start;
  margin-top: 18px;
  border: 1px solid color-mix(in srgb, var(--doc-accent) 25%, var(--doc-line));
  border-radius: 16px;
  padding: 26px;
  background: var(--doc-accent-soft);
}

.doc-publication-card > div {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 14px;
  background: var(--doc-accent);
  color: #fff;
}

.doc-publication-card > div .button-icon {
  width: 24px;
  height: 24px;
}

.doc-publication-card section > span {
  color: var(--doc-accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.doc-publication-card h3 {
  margin: 7px 0 8px;
  color: var(--doc-ink);
  font-size: 20px;
}

.doc-publication-card p {
  margin-bottom: 0;
  color: var(--doc-muted);
  line-height: 1.75;
}

@media (max-width: 1180px) {
  .documentation-hero {
    height: auto !important;
    min-height: 300px;
    padding-inline: 0;
  }

  .documentation-principle-card {
    max-width: 760px;
  }

  .documentation-layout {
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 36px;
  }

  .doc-pipeline,
  .doc-security-grid,
  .doc-result-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .documentation-page .doc-benchmark-group .dataset-card-grid,
  .documentation-page .doc-benchmark-group .dataset-card-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .doc-pipeline article:not(:last-child)::after {
    display: none;
  }

  .doc-contract-body {
    grid-template-columns: 1fr;
  }

  .doc-contract-body > pre {
    max-height: 520px;
  }
}

@media (max-width: 980px) {
  .documentation-hero {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .documentation-principle-card {
    max-width: 520px;
    height: auto;
    justify-self: start;
  }
}

@media (max-width: 840px) {
  .documentation-language-switch {
    top: 14px;
    right: 0;
  }

  .documentation-hero {
    margin: 0;
    padding: 44px 0;
  }

  .documentation-hero h1 {
    font-size: clamp(40px, 11vw, 58px);
  }

  .documentation-layout {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-top: 28px;
  }

  .documentation-toc {
    position: static;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0 8px;
    overscroll-behavior: auto;
  }

  .documentation-toc-title {
    display: none;
  }

  .documentation-toc nav {
    display: flex;
    width: max-content;
    gap: 6px;
  }

  .documentation-toc a {
    display: inline-flex;
    min-height: 36px;
    border: 1px solid var(--doc-line);
    border-radius: 999px;
    background: var(--doc-surface);
  }

  .documentation-toc a span {
    display: none;
  }

  .doc-audience-grid,
  .doc-contract-summary,
  .doc-error-policy {
    grid-template-columns: 1fr;
  }

  .doc-contract-block > header {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .doc-callout {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 720px) {
  .documentation-hero::before {
    background-position: 12px 0;
    opacity: 0.42;
  }

  .documentation-hero::after {
    display: none;
  }
}

@media (max-width: 580px) {
  .documentation-language-switch {
    position: relative;
    top: auto;
    right: auto;
    z-index: 2;
    width: max-content;
    margin: 12px 0 0 auto;
  }

  .documentation-hero {
    margin: 0;
    padding: 38px 0;
  }

  .page-hero-title {
    font-size: clamp(40px, 12vw, 52px) !important;
  }

  .documentation-principle-card {
    grid-template-rows: auto auto auto auto;
    height: auto;
    padding: 22px;
  }

  .documentation-responsibility-line b {
    display: none;
  }

  .doc-pipeline,
  .doc-security-grid,
  .doc-result-flow {
    grid-template-columns: 1fr;
  }

  .documentation-page .doc-benchmark-group .dataset-card-grid,
  .documentation-page .doc-benchmark-group .dataset-card-grid.two {
    grid-template-columns: 1fr;
  }

  .doc-pipeline article,
  .doc-security-grid article,
  .doc-result-flow article {
    min-height: 0;
  }

  .doc-steps li {
    grid-template-columns: 48px 1fr;
    gap: 14px;
  }

  .doc-steps li > span {
    width: 40px;
    height: 40px;
  }

  .doc-steps li:not(:last-child) > span::after {
    top: 40px;
    left: 19px;
    height: 86px;
  }

  .doc-field-list {
    padding: 8px 16px;
  }

  .doc-field-list > div {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .doc-publication-card {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .documentation-toc a,
  .doc-audience-grid button span,
  .documentation-language-switch button {
    transition: none;
  }
}

/* Keep leaderboard subsection labels as plain headings, not nested cards. */
:is(#public, #multimodel, #coding) .leaderboard-detail-head {
  min-height: 0 !important;
  padding: 0 2px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
}

:is(#public, #multimodel, #coding) .leaderboard-detail-head strong {
  font-weight: 700 !important;
}

:is(#public, #multimodel, #coding) .leaderboard-overall-panel > .leaderboard-detail-head {
  margin-bottom: 12px !important;
}

/* Give the longer API Guide title enough measure and breathing room. */
#api-guide .page-hero-title {
  width: min(900px, 100%) !important;
  max-width: 900px !important;
  margin-bottom: 26px !important;
  line-height: 1.1 !important;
}

/* Restore the Guide's standard card rhythm around Evaluation Data. */
#api-guide .api-contract-list + .guide-data-section {
  margin-top: 28px !important;
}

#api-guide .guide-data-section {
  min-height: 0 !important;
  align-content: start;
  gap: 22px !important;
  padding: 28px 30px 30px !important;
}

#api-guide .guide-data-section .api-section-head {
  gap: 6px;
}

/* Increase data-row height by 1.5x while leaving table headers untouched. */
#home .flow-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#home :is(.preview-table, .home-preview-table) tbody tr,
:is(#public, #multimodel, #coding) .leaderboard-table tbody tr {
  height: 72px;
}

#home :is(.preview-table, .home-preview-table) tbody td,
:is(#public, #multimodel, #coding) .leaderboard-table tbody td {
  height: 72px !important;
}

/* Shared research-partner footer. */
.site-footer {
  width: 100%;
  border-top: 1px solid color-mix(in srgb, var(--theme-line, #d9d4cb) 82%, transparent);
  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--theme-accent, #4f8587) 7%, transparent), transparent 28%),
    var(--theme-bg, #f7f6f3);
  color: var(--theme-muted, #68706c);
}

.site-footer-inner {
  width: 100%;
  margin: 0 auto;
  padding: 26px 0 30px;
}

.site-footer-head {
  display: flex;
  width: min(1440px, 100%);
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin: 0 auto 20px;
  padding: 0 80px;
}

.site-footer-heading {
  display: grid;
  gap: 5px;
}

.site-footer-heading span {
  color: var(--theme-accent, #4f8587);
  font-size: 9px;
  font-weight: 760;
  letter-spacing: 0.19em;
}

.site-footer-heading strong {
  color: var(--theme-ink, #252c30);
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(18px, 1.5vw, 23px);
  font-weight: 620;
  letter-spacing: -0.02em;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--theme-ink, #252c30);
  text-decoration: underline;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 22px;
  font-size: 12px;
}

.institution-marquee {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 3px 0 5px;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.institution-marquee-track {
  display: flex;
  width: max-content;
  will-change: transform;
  animation: institution-marquee-scroll 52s linear infinite;
}

.institution-marquee:hover .institution-marquee-track {
  animation-play-state: paused;
}

.institution-marquee-group {
  display: flex;
  flex: none;
  gap: 12px;
  padding-right: 12px;
}

.institution-card {
  display: grid;
  width: 242px;
  height: 78px;
  flex: 0 0 242px;
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  border: 1px solid color-mix(in srgb, var(--theme-line, #d9d4cb) 76%, transparent);
  border-radius: 12px;
  padding: 10px 14px 10px 12px;
  background: color-mix(in srgb, #fff 88%, var(--theme-bg, #f7f6f3));
  box-shadow: 0 5px 15px rgba(37, 44, 48, 0.035);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.institution-card:hover {
  border-color: color-mix(in srgb, var(--theme-accent, #4f8587) 38%, var(--theme-line, #d9d4cb));
  box-shadow: 0 9px 24px rgba(37, 44, 48, 0.08);
  transform: translateY(-2px);
}

.institution-logo {
  position: relative;
  display: grid;
  width: 62px;
  height: 48px;
  place-items: center;
  overflow: hidden;
  border-right: 1px solid color-mix(in srgb, var(--theme-line, #d9d4cb) 70%, transparent);
  padding-right: 10px;
}

.institution-logo b {
  color: color-mix(in srgb, var(--theme-accent, #4f8587) 82%, #24343a);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: -0.04em;
}

.institution-logo img {
  position: absolute;
  inset: 3px 10px 3px 0;
  display: block;
  width: calc(100% - 10px);
  height: calc(100% - 6px);
  object-fit: contain;
  opacity: 0;
  visibility: hidden;
  background: color-mix(in srgb, #fff 88%, var(--theme-bg, #f7f6f3));
  filter: none;
  transition: filter 180ms ease, opacity 140ms ease, transform 180ms ease;
}

.institution-logo.is-loaded img {
  opacity: 1;
  visibility: visible;
}

.institution-logo-crop-left img {
  right: auto;
  width: auto;
  max-width: none;
  object-fit: initial;
  object-position: left center;
}

.institution-logo-shlab img {
  inset: 13px auto auto 1px;
  width: 50px;
  height: auto;
  clip-path: inset(0 0 31% 0);
}

.institution-logo-ntu img {
  inset: 2px auto auto 8px;
  width: auto;
  height: 44px;
  clip-path: inset(0 calc(100% - 34px) 0 0);
}

.institution-logo-nju img {
  inset: 2px auto auto 4px;
  width: auto;
  max-width: none;
  height: 44px;
  object-fit: initial;
  object-position: left center;
  clip-path: inset(0 calc(100% - 34px) 0 0);
}

.institution-card:hover .institution-logo img {
  filter: none;
  transform: scale(1.035);
}

.institution-name {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.institution-name strong {
  overflow: hidden;
  color: var(--theme-ink, #252c30);
  font-size: 13px;
  font-weight: 680;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.institution-name small {
  display: -webkit-box;
  overflow: hidden;
  color: color-mix(in srgb, var(--theme-muted, #68706c) 86%, transparent);
  font-size: 7.5px;
  font-weight: 650;
  letter-spacing: 0.065em;
  line-height: 1.28;
  text-transform: uppercase;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

@keyframes institution-marquee-scroll {
  to { transform: translateX(-50%); }
}

@media (max-width: 720px) {
  .site-footer-inner {
    padding: 24px 0 26px;
  }

  .site-footer-head {
    align-items: flex-start;
    padding: 0 24px;
  }

  .site-footer-links {
    justify-content: flex-end;
    gap: 8px 16px;
  }

  .institution-marquee {
    mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  }

  .institution-marquee-track {
    animation-duration: 45s;
  }

  .institution-card {
    width: 224px;
    flex-basis: 224px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .institution-marquee {
    overflow-x: auto;
    mask-image: none;
    scrollbar-width: thin;
  }

  .institution-marquee-track {
    animation: none;
  }

  .institution-marquee-group[aria-hidden="true"] {
    display: none;
  }
}
