:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0f1014;
  color: #f5f5f7;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #0f1014; }
.api-requested .docs-landing { display: none; }
html[data-docs-locale="en"] [data-lang="zh-CN"],
html[data-docs-locale="zh-CN"] [data-lang="en"] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.docs-shell { min-height: 100vh; }
.docs-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: 326px;
  flex-direction: column;
  border-right: 1px solid #292b33;
  background: #15161b;
}

.sidebar-header { padding: 18px 16px 12px; border-bottom: 1px solid #292b33; }
.sidebar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; min-width: 0; align-items: center; gap: 9px; }
.brand-mark {
  display: block;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 8px;
  object-fit: contain;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; }
.brand small { margin-top: 2px; color: #9397a5; font-size: 12px; }
.language-switch {
  display: inline-flex;
  flex: none;
  gap: 2px;
  padding: 2px;
  border: 1px solid #343741;
  border-radius: 8px;
  background: #101116;
}
.language-switch button {
  min-width: 36px;
  min-height: 30px;
  padding: 4px 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #8d91a0;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}
.language-switch button:hover { color: #fff; }
.language-switch button[aria-pressed="true"] { background: #2d2343; color: #f4efff; }
.language-switch button:focus-visible { outline: 2px solid #a78bfa; outline-offset: 2px; }
.nav-close { display: none; }
.catalog-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  margin-top: 16px;
  padding: 0 11px;
  border: 1px solid #343741;
  border-radius: 8px;
  background: #101116;
  color: #8d91a0;
}
.catalog-search:focus-within { border-color: #8b5cf6; }
.catalog-search input { width: 100%; border: 0; outline: 0; background: transparent; color: #f5f5f7; }
.catalog-search input:disabled { cursor: progress; opacity: .6; }

.catalog { flex: 1; overflow: auto; padding: 10px 8px 24px; scrollbar-color: #454855 transparent; }
.catalog-status, .catalog-loading, .catalog-error { padding: 12px; color: #a9adba; font-size: 13px; }
.catalog-error { color: #fca5a5; }
.catalog-folder { margin: 2px 0; }
.catalog-folder > summary {
  position: relative;
  min-height: 34px;
  padding: 8px 26px 8px 12px;
  cursor: pointer;
  list-style: none;
  border-radius: 7px;
  color: #e1e3e9;
  font-size: 13px;
  font-weight: 600;
}
.catalog-folder > summary::-webkit-details-marker { display: none; }
.catalog-folder > summary::after {
  position: absolute;
  right: 10px;
  content: "›";
  color: #777b89;
  transform: rotate(0deg);
  transition: transform 120ms ease;
}
.catalog-folder[open] > summary::after { transform: rotate(90deg); }
.catalog-folder > summary:hover { background: #202229; }
.catalog-children { margin-left: 11px; padding-left: 7px; border-left: 1px solid #30323b; }
.catalog-api {
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  min-height: 34px;
  margin: 2px 0;
  padding: 7px 8px;
  border-radius: 7px;
  color: #b9bdc8;
  font-size: 12px;
  line-height: 1.45;
}
.catalog-api:hover { background: #202229; color: #fff; }
.catalog-api.is-active { background: #2d2343; color: #f4efff; box-shadow: inset 2px 0 #a78bfa; }
.api-name { overflow-wrap: anywhere; }
.method { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; font: 700 9px/18px ui-monospace, monospace; }
.method-get { color: #60a5fa; }
.method-post { color: #34d399; }
.method-put, .method-patch { color: #fbbf24; }
.method-delete { color: #fb7185; }
.sidebar-footer { display: flex; gap: 14px; padding: 12px 16px; border-top: 1px solid #292b33; color: #a9adba; font-size: 12px; }
.sidebar-footer a:hover { color: #fff; }

.docs-main { min-height: 100vh; margin-left: 326px; background: #0f1014; }
.nav-toggle { display: none; }
.reference-status {
  display: none;
  min-height: 70vh;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px;
  color: #aeb2be;
  font-size: 14px;
}
.api-requested .reference-status:not([hidden]) { display: flex; }
.reference-status[hidden] { display: none !important; }
.loading-indicator {
  width: 18px;
  height: 18px;
  flex: none;
  border: 2px solid #3b3e49;
  border-top-color: #a78bfa;
  border-radius: 50%;
  animation: docs-loading-spin 700ms linear infinite;
}
@keyframes docs-loading-spin { to { transform: rotate(360deg); } }
.docs-landing { max-width: 980px; padding: 96px 64px; }
.eyebrow { margin: 0 0 14px; color: #a78bfa; font: 700 11px/1.4 ui-monospace, monospace; letter-spacing: .14em; }
.docs-landing h1 { max-width: 720px; margin: 0; font-size: clamp(34px, 5vw, 60px); line-height: 1.05; letter-spacing: -.04em; }
.landing-lead { max-width: 760px; margin: 24px 0 40px; color: #aeb2be; font-size: 17px; line-height: 1.8; }
.landing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.landing-grid article { min-height: 135px; padding: 20px; border: 1px solid #2d3038; border-radius: 12px; background: #17181e; }
.landing-grid article > span { display: block; margin-bottom: 14px; color: #898e9c; font-size: 12px; }
.landing-grid code, .landing-grid p { overflow-wrap: anywhere; color: #e7e8ed; font-size: 13px; line-height: 1.6; }
.landing-note { margin-top: 20px; color: #777c89; font-size: 13px; }
.selected-context { padding: 17px 44px; border-bottom: 1px solid #292b33; background: #131419; }
.breadcrumb { margin: 0; color: #8f93a0; font-size: 12px; }
.selected-endpoint { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.selected-endpoint code { color: #c7cad3; font-size: 13px; overflow-wrap: anywhere; }
#reference { min-height: 70vh; }
#reference .scalar-app { --scalar-background-1: #0f1014; }
.sidebar-backdrop { display: none; }

@media (max-width: 820px) {
  body.nav-open { overflow: hidden; }
  .docs-sidebar { width: min(326px, calc(100vw - 24px)); transform: translateX(-100%); transition: transform 180ms ease; }
  .nav-open .docs-sidebar { transform: translateX(0); }
  .sidebar-toolbar { gap: 8px; }
  .nav-close {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    gap: 4px;
    padding: 5px 8px;
    border: 1px solid #343741;
    border-radius: 7px;
    background: #101116;
    color: #d8dae2;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
  }
  .nav-close > span[aria-hidden="true"] { font-size: 17px; font-weight: 400; line-height: 1; }
  .nav-close:hover { border-color: #565a68; color: #fff; }
  .nav-close:focus-visible, .nav-toggle:focus-visible { outline: 2px solid #a78bfa; outline-offset: 2px; }
  .docs-main { margin-left: 0; }
  .nav-toggle { position: sticky; top: 12px; z-index: 20; display: block; margin: 12px; padding: 8px 12px; border: 1px solid #383b45; border-radius: 8px; background: #191a20; color: #fff; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 20; background: #0009; }
  .nav-open .sidebar-backdrop { display: block; }
  .docs-landing { padding: 54px 22px; }
  .landing-grid { grid-template-columns: 1fr; }
  .selected-context { padding: 25px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .docs-sidebar { transition: none; }
  .loading-indicator { animation: none; }
}
