:root {
  --navy-950: #081522;
  --navy-900: #102131;
  --ink: #17242d;
  --ink-soft: #50616d;
  --muted: #768590;
  --line: #d9e1e3;
  --surface: #ffffff;
  --surface-soft: #f3f6f6;
  --canvas: #eaf0f0;
  --teal: #0b8f83;
  --teal-dark: #076d65;
  --teal-soft: #e1f4f1;
  --amber: #a85c00;
  --amber-soft: #fff4dc;
  --code: #0e1b27;
  --header-height: 64px;
  --sidebar-width: 252px;
  --toc-width: 208px;
  color-scheme: light;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-synthesis: none;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0;
}

body.menu-open {
  overflow: hidden;
}

a {
  color: var(--teal-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--teal);
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid #f6a720;
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 12px;
  padding: 8px 12px;
  color: #fff;
  background: var(--teal-dark);
  border-radius: 4px;
  transform: translateY(-150%);
}

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

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 max(20px, calc((100vw - 1320px) / 2));
  color: #fff;
  background: var(--navy-950);
  border-bottom: 1px solid #203342;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  color: #fff;
  text-decoration: none;
}

.brand:hover {
  color: #fff;
}

.brand-mark {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #061a1a;
  background: #32c7b8;
  border-radius: 6px;
  font-weight: 800;
  line-height: 1;
}

.brand > span:last-child {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.brand strong {
  font-size: 16px;
}

.brand small {
  color: #9fb3bf;
  font-size: 13px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-link,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  color: #dce7eb;
  background: transparent;
  border: 0;
  text-decoration: none;
  cursor: pointer;
}

.header-link {
  gap: 7px;
  padding: 0 12px;
  border-radius: 4px;
  font-size: 14px;
}

.header-link:hover,
.icon-button:hover {
  color: #fff;
  background: #172b3a;
}

.icon-button {
  width: 40px;
  padding: 0;
  border-radius: 4px;
}

.icon {
  flex: 0 0 auto;
  vertical-align: -0.15em;
}

.menu-button,
.sidebar-mobile-head {
  display: none;
}

.site-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 760px) var(--toc-width);
  gap: 36px;
  width: min(1320px, 100%);
  min-height: calc(100vh - var(--header-height));
  margin: 0 auto;
  padding: 0 20px;
}

.sidebar,
.toc {
  position: sticky;
  top: var(--header-height);
  align-self: start;
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  scrollbar-width: thin;
}

.sidebar {
  padding: 28px 12px 32px 0;
}

.search-wrap {
  position: relative;
  margin-bottom: 28px;
}

.search-wrap > .icon {
  position: absolute;
  z-index: 1;
  top: 12px;
  left: 12px;
  color: var(--muted);
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  height: 42px;
  padding: 0 12px 0 38px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid #cbd6d8;
  border-radius: 6px;
}

.search-wrap input::placeholder {
  color: #788991;
}

.search-results {
  position: absolute;
  z-index: 10;
  top: 48px;
  right: 0;
  left: 0;
  max-height: 360px;
  padding: 6px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid #cbd6d8;
  border-radius: 6px;
  box-shadow: 0 12px 30px rgb(8 21 34 / 14%);
}

.search-result {
  display: block;
  padding: 9px 10px;
  color: var(--ink);
  border-radius: 4px;
  text-decoration: none;
}

.search-result:hover,
.search-result[aria-selected="true"] {
  color: var(--ink);
  background: var(--teal-soft);
}

.search-result strong,
.search-result small {
  display: block;
}

.search-result strong {
  font-size: 14px;
  line-height: 1.45;
}

.search-result small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.search-empty {
  margin: 0;
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
}

.nav-group + .nav-group {
  margin-top: 28px;
}

.nav-label {
  margin: 0 0 8px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.nav-link {
  display: block;
  padding: 9px 10px;
  color: #344651;
  border-left: 3px solid transparent;
  text-decoration: none;
}

.nav-link:hover {
  color: var(--ink);
  background: rgb(255 255 255 / 62%);
}

.nav-link.active {
  color: var(--teal-dark);
  background: var(--teal-soft);
  border-left-color: var(--teal);
  font-weight: 700;
}

.nav-link span,
.nav-link small {
  display: block;
}

.nav-link span {
  font-size: 14px;
}

.nav-link small {
  margin-top: 1px;
  color: #74848d;
  font-size: 12px;
  font-weight: 400;
}

.sidebar-note {
  margin: 34px 10px 0;
  padding-top: 18px;
  border-top: 1px solid #ced9da;
}

.sidebar-note p,
.sidebar-note strong {
  margin: 0;
  font-size: 12px;
}

.sidebar-note p {
  color: var(--muted);
}

.sidebar-note strong {
  color: #435761;
}

.main {
  min-width: 0;
  padding: 28px 0 72px;
}

.doc {
  min-height: calc(100vh - var(--header-height) - 56px);
  padding: 42px 52px;
  background: var(--surface);
  border: 1px solid #d5dfe1;
  box-shadow: 0 8px 28px rgb(8 21 34 / 7%);
}

.doc-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12px;
}

.doc h1,
.doc h2,
.doc h3 {
  position: relative;
  color: var(--ink);
  line-height: 1.35;
  letter-spacing: 0;
}

.doc h1 {
  margin: 0 0 24px;
  font-size: 40px;
}

.doc h2 {
  margin: 52px 0 18px;
  padding-top: 4px;
  border-top: 1px solid #e5ebec;
  font-size: 26px;
}

.doc h2::before {
  display: block;
  width: 38px;
  height: 3px;
  margin: -5px 0 20px;
  background: var(--teal);
  content: "";
}

.doc h3 {
  margin: 32px 0 12px;
  font-size: 20px;
}

.heading-anchor {
  position: absolute;
  left: -24px;
  padding-right: 6px;
  color: #9aabb2;
  font-weight: 400;
  opacity: 0;
  text-decoration: none;
}

.doc h1:hover .heading-anchor,
.doc h2:hover .heading-anchor,
.doc h3:hover .heading-anchor,
.heading-anchor:focus {
  opacity: 1;
}

.doc p {
  margin: 14px 0;
}

.doc ul,
.doc ol {
  padding-left: 1.55em;
}

.doc li {
  margin: 6px 0;
}

.doc strong {
  color: #0c2930;
}

.doc blockquote {
  margin: 22px 0;
  padding: 14px 18px;
  color: #304850;
  background: var(--teal-soft);
  border-left: 4px solid var(--teal);
}

.doc blockquote p {
  margin: 0;
}

.doc figure {
  margin: 28px 0 36px;
}

.doc figure img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 660px;
  object-fit: contain;
  background: var(--navy-950);
  border: 1px solid #c9d5d7;
  border-radius: 6px;
}

.doc figcaption {
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.doc code {
  padding: 0.14em 0.38em;
  color: #0a625b;
  background: #e8f3f1;
  border-radius: 3px;
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

.code-block {
  margin: 22px 0;
  overflow: hidden;
  background: var(--code);
  border: 1px solid #22384a;
  border-radius: 6px;
}

.code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 0 8px 0 16px;
  color: #94a8b7;
  background: #142534;
  border-bottom: 1px solid #243a4a;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12px;
}

.copy-code {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 8px;
  color: #c9d6de;
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.copy-code:hover {
  color: #fff;
  background: #213849;
}

.code-block pre {
  max-width: 100%;
  margin: 0;
  padding: 18px;
  overflow-x: auto;
  color: #e4edf2;
  line-height: 1.65;
}

.code-block pre code {
  padding: 0;
  color: inherit;
  background: transparent;
  border-radius: 0;
  overflow-wrap: normal;
  white-space: pre;
}

.doc table {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 24px 0;
  overflow-x: auto;
  border-collapse: collapse;
  border-spacing: 0;
}

.doc th,
.doc td {
  min-width: 160px;
  padding: 11px 13px;
  border: 1px solid #d5dfe1;
  text-align: left;
  vertical-align: top;
}

.doc th {
  color: #263a44;
  background: var(--surface-soft);
}

.doc tr:nth-child(even) td {
  background: #fafcfc;
}

.doc a .icon {
  margin-left: 3px;
}

.doc-footer {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.doc-footer p {
  color: var(--ink-soft);
}

.doc-footer a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
}

.toc {
  padding: 32px 0 30px;
}

.toc > p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.toc nav {
  padding-left: 12px;
  border-left: 1px solid #c9d5d7;
}

.toc-link {
  display: block;
  padding: 5px 0;
  color: #657781;
  font-size: 13px;
  line-height: 1.45;
  text-decoration: none;
}

.toc-link.depth-3 {
  padding-left: 12px;
}

.toc-link:hover,
.toc-link.active {
  color: var(--teal-dark);
}

.toc-link.active {
  font-weight: 700;
}

.sidebar-scrim {
  display: none;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: 20px;
  padding: 9px 14px;
  color: #fff;
  background: #15333b;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgb(8 21 34 / 22%);
  font-size: 13px;
}

@media (max-width: 1180px) {
  .site-layout {
    grid-template-columns: var(--sidebar-width) minmax(0, 820px);
    max-width: 1120px;
  }

  .toc {
    display: none;
  }
}

@media (max-width: 820px) {
  :root {
    --header-height: 58px;
  }

  .site-header {
    padding: 0 14px;
  }

  .brand small,
  .support-link {
    display: none;
  }

  .header-link {
    padding: 0 8px;
  }

  .header-link span {
    display: none;
  }

  .menu-button {
    display: inline-flex;
  }

  .site-layout {
    display: block;
    width: 100%;
    padding: 0;
  }

  .sidebar {
    position: fixed;
    z-index: 80;
    top: 0;
    left: 0;
    width: min(86vw, 320px);
    height: 100dvh;
    padding: 0 16px 30px;
    background: var(--canvas);
    box-shadow: 14px 0 36px rgb(8 21 34 / 24%);
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .menu-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 58px;
    margin-bottom: 14px;
    border-bottom: 1px solid #ccd8da;
  }

  .sidebar-mobile-head .icon-button {
    color: #435761;
  }

  .sidebar-scrim {
    position: fixed;
    z-index: 70;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    background: rgb(8 21 34 / 48%);
    border: 0;
  }

  .menu-open .sidebar-scrim {
    display: block;
  }

  .main {
    padding: 0;
  }

  .doc {
    min-height: calc(100vh - var(--header-height));
    padding: 28px 20px 52px;
    border: 0;
    box-shadow: none;
  }

  .doc h1 {
    font-size: 31px;
  }

  .doc h2 {
    margin-top: 44px;
    font-size: 23px;
  }

  .doc h3 {
    font-size: 19px;
  }

  .heading-anchor {
    display: none;
  }

  .doc-meta {
    flex-wrap: wrap;
    gap: 4px 12px;
  }
}

@media (max-width: 430px) {
  .brand > span:last-child {
    gap: 0;
  }

  .doc {
    padding-right: 16px;
    padding-left: 16px;
  }

  .doc h1 {
    font-size: 28px;
  }

  .doc th,
  .doc td {
    min-width: 140px;
    padding: 9px 10px;
  }

  .code-block pre {
    padding: 14px;
  }
}

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

  .sidebar {
    transition: none;
  }
}

@media print {
  .site-header,
  .sidebar,
  .toc,
  .doc-meta,
  .copy-code,
  .sidebar-scrim {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .site-layout,
  .main {
    display: block;
    width: 100%;
    padding: 0;
  }

  .doc {
    padding: 0;
    border: 0;
    box-shadow: none;
  }
}
