:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-soft: #f2f4f7;
  --text: #17202e;
  --text-secondary: #5d6878;
  --text-muted: #8993a1;
  --border: #e4e8ee;
  --border-strong: #d5dae2;
  --brand: #0a9b83;
  --brand-strong: #087b6a;
  --brand-soft: #e6f6f2;
  --brand-ink: #086c5d;
  --code-bg: #111827;
  --code-text: #e5edf7;
  --post: #087f6d;
  --danger: #c2414b;
  --warning: #a76405;
  --shadow: 0 16px 44px rgb(19 32 52 / 10%);
  --topbar-height: 68px;
  --sidebar-width: 276px;
  --content-width: 1120px;
  --radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c1117;
  --surface: #101720;
  --surface-raised: #151e29;
  --surface-soft: #19232f;
  --text: #edf3f8;
  --text-secondary: #a7b2c0;
  --text-muted: #718093;
  --border: #24303d;
  --border-strong: #334151;
  --brand: #2cc5a9;
  --brand-strong: #6ee7cd;
  --brand-soft: #12352f;
  --brand-ink: #76ead3;
  --code-bg: #070b10;
  --code-text: #d9e5f1;
  --post: #42d2b6;
  --danger: #ff7982;
  --warning: #f1b85b;
  --shadow: 0 18px 52px rgb(0 0 0 / 32%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-height) + 22px); }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.68; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--brand-strong); text-decoration: none; }
svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.access-locked { overflow: hidden; }
.access-locked .app-shell { visibility: hidden; }
.access-gate { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--brand) 15%, transparent), transparent 38%), var(--bg); }
.access-gate[hidden] { display: none; }
.access-card { width: min(420px, 100%); padding: 38px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.access-logo { display: grid; place-items: center; width: 50px; height: 50px; margin: 0 auto 14px; border-radius: 14px; background: linear-gradient(145deg, #13b899, #087864); color: #fff; font-size: 26px; font-weight: 850; box-shadow: 0 10px 28px rgb(10 155 131 / 25%); }
.access-eyebrow { color: var(--brand-strong); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.access-card h1 { margin: 10px 0 8px; font-size: 27px; }
.access-card > p { margin: 0 auto 24px; max-width: 330px; font-size: 13px; }
.access-card form { text-align: left; }
.access-card label { display: block; margin-bottom: 7px; color: var(--text); font-size: 12px; font-weight: 700; }
.password-field { display: flex; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface); transition: border-color .18s, box-shadow .18s; }
.password-field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.password-field input { flex: 1; min-width: 0; height: 45px; padding: 0 13px; border: 0; outline: 0; background: transparent; color: var(--text); }
.password-field button { width: 55px; border: 0; background: transparent; color: var(--text-muted); font-size: 11px; cursor: pointer; }
.password-field button:hover { color: var(--brand-strong); }
.access-error { min-height: 21px; margin: 5px 0 4px; color: var(--danger); font-size: 11px; }
.access-submit { width: 100%; height: 44px; border: 0; border-radius: 9px; background: var(--brand); color: #fff; font-weight: 750; cursor: pointer; box-shadow: 0 8px 22px rgb(10 155 131 / 20%); }
.access-submit:hover { background: var(--brand-strong); }
.access-submit:disabled { opacity: .65; cursor: wait; }
.access-card > small { display: block; margin-top: 18px; color: var(--text-muted); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
.access-card.shake { animation: access-shake .28s ease; }
@keyframes access-shake { 0%, 100% { transform: translateX(0); } 30% { transform: translateX(-7px); } 70% { transform: translateX(7px); } }

.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--topbar-height);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
  background: color-mix(in srgb, var(--surface) 91%, transparent); border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); min-width: calc(var(--sidebar-width) - 24px); }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: linear-gradient(145deg, #13b899, #087864); color: white; font-weight: 800; font-size: 20px; box-shadow: 0 7px 18px rgb(10 155 131 / 22%); }
.brand-copy { display: flex; align-items: baseline; gap: 7px; letter-spacing: -.02em; }
.brand-copy strong { font-size: 18px; }
.brand-copy small { color: var(--text-secondary); font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.icon-button, .search-trigger, .logout-button { height: 40px; border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); border-radius: 10px; cursor: pointer; transition: .18s ease; }
.icon-button:hover, .search-trigger:hover, .logout-button:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-soft); }
.icon-button { width: 40px; display: grid; place-items: center; }
.icon-button svg { width: 19px; height: 19px; }
.search-trigger { min-width: 238px; display: flex; align-items: center; gap: 9px; padding: 0 10px 0 13px; text-align: left; }
.search-trigger svg { width: 18px; height: 18px; }
.search-trigger span { flex: 1; }
.logout-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 12px; }
.logout-button svg { width: 17px; height: 17px; }
.logout-button span { font-size: 12px; font-weight: 650; }
kbd { border: 1px solid var(--border-strong); background: var(--surface-soft); color: var(--text-muted); border-radius: 5px; padding: 1px 6px; font: 11px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; box-shadow: 0 1px 0 var(--border); }
.mobile-menu { display: none; }
.moon-icon { display: none; }
[data-theme="dark"] .sun-icon { display: none; }
[data-theme="dark"] .moon-icon { display: block; }

.sidebar {
  position: fixed; z-index: 40; top: var(--topbar-height); bottom: 0; left: 0; width: var(--sidebar-width);
  display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto;
}
#navigation { flex: 1; padding: 22px 14px; }
.nav-group + .nav-group { margin-top: 14px; }
.nav-group-title { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 0; background: none; color: var(--text-secondary); font-size: 12px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; cursor: pointer; }
.nav-group-title svg { width: 16px; height: 16px; color: var(--text-muted); }
.nav-group-title .chevron { margin-left: auto; transition: transform .2s ease; }
.nav-group.collapsed .chevron { transform: rotate(-90deg); }
.nav-group.collapsed .nav-items { display: none; }
.nav-items { display: grid; gap: 2px; }
.nav-link { position: relative; display: flex; align-items: center; gap: 9px; min-height: 37px; padding: 7px 11px 7px 35px; border-radius: 8px; color: var(--text-secondary); font-size: 13.5px; transition: .16s ease; }
.nav-link::before { content: ""; position: absolute; left: 20px; width: 4px; height: 4px; border-radius: 50%; background: var(--border-strong); }
.nav-link:hover { color: var(--text); background: var(--surface-soft); }
.nav-link.active { color: var(--brand-ink); background: var(--brand-soft); font-weight: 650; }
.nav-link.active::before { background: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
.nav-api-list { display: grid; gap: 1px; }
.nav-api-link { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 7px; min-height: 34px; padding: 6px 10px 6px 30px; border-radius: 8px; color: var(--text-secondary); font-size: 12.5px; }
.nav-api-link:hover, .nav-api-link.active { background: var(--surface-soft); color: var(--text); }
.nav-method { color: var(--post); font-size: 9px; font-weight: 800; letter-spacing: .035em; }
.nav-api-link span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer { padding: 16px 23px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 12px; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 13%, transparent); }

.main-content { min-height: 100vh; padding: calc(var(--topbar-height) + 48px) 5vw 100px calc(var(--sidebar-width) + 5vw); outline: none; }
.document { width: min(100%, var(--content-width)); margin: 0 auto; }
.document > :first-child { margin-top: 0; }
.doc-header { margin-bottom: 40px; padding-bottom: 28px; border-bottom: 1px solid var(--border); }
.breadcrumb { color: var(--brand-strong); font-size: 12px; font-weight: 720; letter-spacing: .06em; text-transform: uppercase; }
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -.025em; scroll-margin-top: calc(var(--topbar-height) + 24px); }
h1 { margin: 8px 0 12px; font-size: clamp(30px, 5vw, 44px); }
h2 { margin: 38px 0 14px; font-size: 24px; }
h3 { margin: 28px 0 10px; font-size: 18px; }
p { color: var(--text-secondary); }
.lead { max-width: 760px; color: var(--text-secondary); font-size: 17px; line-height: 1.75; }

.hero-panel { position: relative; overflow: hidden; padding: clamp(30px, 5vw, 58px); border: 1px solid var(--border); border-radius: 20px; background: radial-gradient(circle at 90% 15%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 35%), var(--surface); box-shadow: var(--shadow); }
.hero-panel::after { content: ""; position: absolute; width: 230px; height: 230px; right: -130px; bottom: -155px; border: 42px solid color-mix(in srgb, var(--brand) 10%, transparent); border-radius: 50%; }
.hero-panel h1 { max-width: 640px; margin-top: 10px; font-size: clamp(36px, 6vw, 60px); }
.eyebrow { color: var(--brand-strong); font-size: 12px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 27px; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 43px; padding: 0 18px; border-radius: 9px; font-weight: 700; font-size: 13px; }
.primary-button { background: var(--brand); color: white; box-shadow: 0 8px 22px rgb(10 155 131 / 24%); }
.primary-button:hover { background: var(--brand-strong); color: white; }
.secondary-button { border: 1px solid var(--border-strong); color: var(--text); background: var(--surface); }
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 22px; }
.quick-card { padding: 23px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.quick-card h2 { margin: 11px 0 6px; font-size: 16px; }
.quick-card p { margin: 0; font-size: 13px; }
.quick-number { color: var(--brand); font: 750 12px ui-monospace, SFMono-Regular, Consolas, monospace; }
.info-banner, .admonition { margin: 24px 0; padding: 16px 18px; border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--border)); border-left: 3px solid var(--brand); border-radius: 10px; background: var(--brand-soft); }
.info-banner p, .admonition p { margin: 4px 0 0; color: var(--text-secondary); }

.api-overview { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.api-count { display: inline-flex; align-items: center; gap: 7px; color: var(--text-muted); font-size: 12px; }
.api-count strong { color: var(--brand-strong); font-size: 18px; }
.api-operation { margin: 0 0 34px; padding: 26px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: 0 4px 20px rgb(19 32 52 / 4%); }
.operation-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 17px; }
.operation-title { margin: 0 0 8px; font-size: 22px; }
.endpoint { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.method-badge { display: inline-grid; place-items: center; min-width: 51px; height: 24px; padding: 0 8px; border-radius: 6px; background: var(--brand-soft); color: var(--post); font: 800 10px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .04em; }
.endpoint code { color: var(--text); font: 600 13px ui-monospace, SFMono-Regular, Consolas, monospace; word-break: break-all; }
.deprecated { color: var(--danger); font-size: 11px; font-weight: 700; }
.operation-description { margin: 0 0 20px; white-space: pre-line; }
.section-label { display: flex; align-items: center; gap: 8px; margin: 26px 0 10px; color: var(--text); font-size: 14px; font-weight: 750; }
.field-count { display: inline-grid; place-items: center; min-width: 21px; height: 19px; padding: 0 6px; border-radius: 10px; background: var(--surface-soft); color: var(--text-muted); font-size: 10px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { background: var(--surface-soft); color: var(--text-muted); font-size: 11px; font-weight: 750; letter-spacing: .035em; text-align: left; text-transform: uppercase; }
th, td { padding: 11px 13px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td:first-child code { color: var(--brand-strong); font-weight: 650; }
.type-label { color: var(--warning); font: 600 11px ui-monospace, SFMono-Regular, Consolas, monospace; }
.required-mark { color: var(--danger); margin-left: 3px; }
.empty-state-cell { color: var(--text-muted); text-align: center; }
.response-block + .response-block { margin-top: 15px; }
.response-status { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.status-code { color: var(--brand-strong); font: 750 12px ui-monospace, SFMono-Regular, Consolas, monospace; }
.mime { color: var(--text-muted); font-size: 11px; }

.code-block { position: relative; margin: 11px 0 20px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--code-bg) 85%, white); border-radius: 10px; background: var(--code-bg); }
.code-block pre { margin: 0; padding: 18px; overflow-x: auto; color: var(--code-text); font: 12.5px/1.68 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; tab-size: 2; }
.copy-button { position: absolute; top: 9px; right: 9px; z-index: 1; padding: 5px 9px; border: 1px solid rgb(255 255 255 / 14%); border-radius: 6px; background: rgb(255 255 255 / 8%); color: #b8c6d5; font-size: 10px; cursor: pointer; }
.copy-button:hover { background: rgb(255 255 255 / 15%); color: white; }
code.inline-code, .markdown-body :not(pre) > code { padding: 2px 5px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-soft); color: var(--brand-strong); font: 12px ui-monospace, SFMono-Regular, Consolas, monospace; }
.json-key { color: #77c7ee; }.json-string { color: #a7d9a5; }.json-number { color: #efbe75; }.json-boolean { color: #c7a0ee; }.json-null { color: #97a6b6; }

.markdown-body { max-width: 900px; }
.markdown-body h1 { margin-top: 0; }
.markdown-body blockquote { margin: 20px 0; padding: 2px 18px; border-left: 3px solid var(--brand); background: var(--brand-soft); border-radius: 0 8px 8px 0; }
.markdown-body ul, .markdown-body ol { padding-left: 24px; color: var(--text-secondary); }
.markdown-body li + li { margin-top: 5px; }
.markdown-body .table-wrap { margin: 20px 0; }
.steps { position: relative; margin: 24px 0; padding-left: 33px; }
.steps::before { content: ""; position: absolute; left: 11px; top: 10px; bottom: 18px; width: 1px; background: var(--border-strong); }
.step { position: relative; padding: 0 0 24px 12px; }
.step::before { content: attr(data-step); position: absolute; left: -34px; top: 0; width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; background: var(--brand); color: white; font-size: 10px; font-weight: 750; box-shadow: 0 0 0 5px var(--surface); }
.step h3 { margin: 0 0 8px; font-size: 15px; }
.step > :last-child { margin-bottom: 0; }

.loading-state { display: grid; place-items: center; min-height: 50vh; color: var(--text-muted); }
.loading-state[hidden] { display: none; }
.loader { width: 27px; height: 27px; border: 2px solid var(--border-strong); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-state { padding: 30px; border: 1px solid color-mix(in srgb, var(--danger) 30%, var(--border)); border-radius: 12px; background: var(--surface); }
.error-state h1 { font-size: 24px; }

.search-dialog { position: fixed; z-index: 100; inset: 0; padding: 12vh 20px 20px; background: rgb(4 10 17 / 56%); backdrop-filter: blur(5px); }
.search-dialog[hidden] { display: none; }
.search-panel { width: min(680px, 100%); max-height: 70vh; margin: 0 auto; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 15px; background: var(--surface-raised); box-shadow: 0 28px 80px rgb(0 0 0 / 30%); }
.search-input-wrap { display: flex; align-items: center; gap: 11px; padding: 15px 17px; border-bottom: 1px solid var(--border); }
.search-input-wrap svg { width: 21px; height: 21px; color: var(--brand); }
.search-input-wrap input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 16px; }
.search-results { max-height: 50vh; overflow-y: auto; padding: 8px; }
.search-result { display: grid; grid-template-columns: 44px minmax(0,1fr); align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.search-result:hover, .search-result.selected { background: var(--brand-soft); }
.search-result-icon { display: grid; place-items: center; width: 38px; height: 34px; border: 1px solid var(--border); border-radius: 8px; color: var(--brand-strong); font-size: 9px; font-weight: 800; }
.search-result strong, .search-result small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result strong { font-size: 13px; }.search-result small { margin-top: 2px; color: var(--text-muted); font-size: 11px; }
.search-empty { padding: 44px 20px; color: var(--text-muted); text-align: center; }
.search-hint { display: flex; gap: 18px; padding: 9px 17px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 10px; }
.toast { position: fixed; z-index: 120; right: 24px; bottom: 24px; padding: 10px 15px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface-raised); color: var(--text); box-shadow: var(--shadow); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.sidebar-backdrop { display: none; }
.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; }

@media (max-width: 920px) {
  .mobile-menu { display: grid; }
  .brand { min-width: 0; }
  .brand-copy small { display: none; }
  .sidebar { transform: translateX(-100%); transition: transform .24s ease; box-shadow: var(--shadow); }
  body.menu-open .sidebar { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; z-index: 35; inset: var(--topbar-height) 0 0; background: rgb(0 0 0 / 32%); }
  body.menu-open .sidebar-backdrop { display: block; }
  .main-content { padding: calc(var(--topbar-height) + 38px) 5vw 80px; }
}

@media (max-width: 640px) {
  :root { --topbar-height: 60px; }
  .topbar { padding: 0 14px; }
  .brand-mark { width: 33px; height: 33px; }
  .search-trigger { min-width: 40px; width: 40px; justify-content: center; padding: 0; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .logout-button { width: 40px; padding: 0; }
  .logout-button span { display: none; }
  .main-content { padding-left: 14px; padding-right: 14px; }
  .hero-panel { padding: 27px 22px; }
  .hero-panel h1 { font-size: 35px; }
  .quick-grid { grid-template-columns: 1fr; }
  .api-operation { padding: 19px 15px; }
  .operation-heading { display: block; }
  .operation-title { font-size: 19px; }
  .table-wrap { margin-left: -3px; margin-right: -3px; }
  th, td { padding: 10px; min-width: 105px; }
  .search-dialog { padding: 8vh 10px 10px; }
  .access-card { padding: 30px 22px; }
}

@media print {
  .topbar, .sidebar, .copy-button { display: none !important; }
  .main-content { padding: 20px; }
  .api-operation { break-inside: avoid; box-shadow: none; }
}
