:root {
  --doc-primary: #2563eb;
  --doc-primary-soft: #eff6ff;
  --doc-text: #111827;
  --doc-muted: #64748b;
  --doc-border: #e5e7eb;
  --doc-soft: #f8fafc;
  --doc-bg: #f4f6f8;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 82px; }
body { margin: 0; background: var(--doc-bg); color: var(--doc-text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif; letter-spacing: 0; }
button, a { font: inherit; }
button { letter-spacing: 0; }

.doc-topbar { position: sticky; top: 0; z-index: 30; height: 62px; border-bottom: 1px solid var(--doc-border); background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); }
.doc-topbar-inner { display: flex; align-items: center; justify-content: space-between; width: min(1480px, 100%); height: 100%; margin: 0 auto; padding: 0 24px; }
.doc-brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--doc-text); text-decoration: none; }
.doc-brand > span:last-child { min-width: 0; }
.doc-brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; overflow: hidden; border: 1px solid #dbeafe; border-radius: 7px; background: var(--doc-primary-soft); color: #1d4ed8; font-size: 15px; font-weight: 800; }
.doc-brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.doc-brand strong, .doc-brand small { display: block; }
.doc-brand strong { max-width: 360px; overflow: hidden; font-size: 15px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.doc-brand small { margin-top: 2px; color: #94a3b8; font-size: 9px; }
.doc-top-actions { display: flex; align-items: center; }
.doc-top-actions .back-link { display: inline-flex; align-items: center; min-height: 30px; padding: 0 11px; border: 1px solid #bfdbfe; border-radius: 6px; background: var(--doc-primary-soft); color: #1d4ed8; font-size: 12px; font-weight: 600; text-decoration: none; }
.doc-top-actions .back-link:hover { border-color: #93c5fd; background: #dbeafe; }

.doc-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); width: min(1480px, 100%); min-height: calc(100vh - 62px); margin: 0 auto; }
.doc-sidebar { position: sticky; top: 62px; align-self: start; height: calc(100vh - 62px); overflow-y: auto; border-right: 1px solid var(--doc-border); background: #fff; }
.doc-sidebar-head { position: relative; z-index: 2; padding: 12px; border-bottom: 1px solid #f1f5f9; }
.doc-version-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 52px; padding: 8px 10px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--doc-text); text-align: left; cursor: pointer; }
.doc-version-toggle:hover, .doc-version-toggle[aria-expanded="true"] { border-color: #dbeafe; background: #f8fbff; }
.doc-version-toggle:focus { outline: 0; }
.doc-version-toggle:focus-visible { border-color: #bfdbfe; box-shadow: 0 0 0 2px rgba(37, 99, 235, .12); }
.doc-version-toggle span, .doc-version-toggle strong, .doc-version-toggle small, .doc-version-option span, .doc-version-option strong, .doc-version-option small { display: block; }
.doc-version-toggle strong, .doc-version-option strong { font-size: 14px; line-height: 1.35; }
.doc-version-toggle small, .doc-version-option small { margin-top: 4px; color: #94a3b8; font-size: 11px; line-height: 1.2; }
.doc-version-toggle > i { width: 8px; height: 8px; flex: 0 0 8px; border-right: 1.5px solid #64748b; border-bottom: 1.5px solid #64748b; transform: rotate(45deg) translateY(-2px); transition: transform .16s ease; }
.doc-version-toggle[aria-expanded="true"] > i { transform: rotate(225deg) translate(-2px, -2px); }
.doc-version-menu { position: absolute; top: calc(100% - 5px); right: 12px; left: 12px; display: none; padding: 5px; border: 1px solid var(--doc-border); border-radius: 7px; background: #fff; box-shadow: 0 12px 30px rgba(15, 23, 42, .12); }
.doc-version-menu.open { display: block; }
.doc-version-option { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 54px; padding: 8px 10px; border-radius: 5px; color: #334155; text-decoration: none; }
.doc-version-option:hover { background: #f8fafc; }
.doc-version-option.active { background: var(--doc-primary-soft); color: #1d4ed8; }
.doc-version-option > i { display: none; width: 6px; height: 10px; flex: 0 0 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.doc-version-option.active > i { display: block; }
.doc-sidebar nav { padding: 10px; }
.doc-sidebar nav a { display: flex; align-items: center; gap: 9px; min-height: 38px; padding: 0 10px; border-radius: 6px; color: #475569; font-size: 13px; text-decoration: none; }
.doc-sidebar nav a span { width: 5px; height: 5px; border-radius: 50%; background: #cbd5e1; }
.doc-sidebar nav a:hover, .doc-sidebar nav a.active { background: var(--doc-primary-soft); color: #1d4ed8; }
.doc-sidebar nav a.active span { background: var(--doc-primary); }

.doc-main { min-width: 0; padding: 22px 24px 48px; }
.doc-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 23px 26px; border: 1px solid var(--doc-border); background: #fff; }
.doc-eyebrow { color: var(--doc-primary); font-size: 10px; font-weight: 800; }
.doc-hero h1 { margin: 5px 0 0; font-size: 24px; line-height: 1.3; }
.doc-hero p { margin: 6px 0 0; color: var(--doc-muted); font-size: 13px; line-height: 1.6; }
.doc-version-badge { display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 34px; flex: 0 0 54px; border: 1px solid #bfdbfe; border-radius: 6px; background: var(--doc-primary-soft); color: #1d4ed8; font-size: 13px; font-weight: 800; }

.doc-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 12px; border: 1px solid var(--doc-border); background: #fff; }
.doc-summary-item { min-width: 0; padding: 13px 16px; border-right: 1px solid var(--doc-border); }
.doc-summary-item:last-child { border-right: 0; }
.doc-summary-item span, .doc-summary-item strong { display: block; }
.doc-summary-item span { color: #94a3b8; font-size: 11px; }
.doc-summary-item strong { margin-top: 5px; overflow-wrap: anywhere; font-size: 13px; }

.doc-section { margin-top: 14px; border: 1px solid var(--doc-border); background: #fff; }
.doc-section-head { padding: 17px 20px 14px; border-bottom: 1px solid var(--doc-border); background: #fbfcfd; }
.doc-section-head h2 { margin: 0; font-size: 17px; line-height: 1.4; }
.doc-section-head p { margin: 4px 0 0; color: var(--doc-muted); font-size: 12px; line-height: 1.6; }
.doc-section-body { padding: 18px 20px 20px; }
.doc-section-body > * + * { margin-top: 16px; }
.doc-block-title { margin: 0 0 9px; color: #334155; font-size: 13px; line-height: 1.5; }

.doc-alert { padding: 12px 14px; border-left: 3px solid #60a5fa; background: #f5f9ff; }
.doc-alert strong { display: block; color: #1e40af; font-size: 13px; }
.doc-alert p { margin: 4px 0 0; color: #475569; font-size: 12px; line-height: 1.7; }
.doc-alert.success { border-color: #34d399; background: #f0fdf4; }
.doc-alert.success strong { color: #047857; }
.doc-alert.warning { border-color: #f59e0b; background: #fffbeb; }
.doc-alert.warning strong { color: #92400e; }

.doc-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--doc-border); }
.doc-facts > div { min-width: 0; padding: 12px 14px; border-right: 1px solid var(--doc-border); }
.doc-facts > div:last-child { border-right: 0; }
.doc-facts span, .doc-facts strong { display: block; }
.doc-facts span { color: #94a3b8; font-size: 11px; }
.doc-facts strong { margin-top: 5px; font-size: 13px; overflow-wrap: anywhere; }

.doc-table-scroll { width: 100%; overflow-x: auto; border: 1px solid var(--doc-border); scrollbar-width: thin; }
.doc-table-scroll table { width: 100%; min-width: 760px; border-collapse: collapse; table-layout: auto; }
.doc-table-scroll th, .doc-table-scroll td { padding: 11px 12px; border-bottom: 1px solid var(--doc-border); color: #475569; font-size: 12px; line-height: 1.55; text-align: left; vertical-align: top; }
.doc-table-scroll th { background: #f8fafc; color: #334155; font-weight: 700; white-space: nowrap; }
.doc-table-scroll tr:last-child td { border-bottom: 0; }
.doc-table-scroll code { color: #1d4ed8; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 11px; white-space: nowrap; }
.break-all { overflow-wrap: anywhere; }

.doc-steps ol { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.doc-steps li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 9px; align-items: start; }
.doc-steps li > span { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--doc-primary-soft); color: #1d4ed8; font-size: 11px; font-weight: 700; }
.doc-steps p { margin: 1px 0 0; color: #475569; font-size: 12px; line-height: 1.65; }

.doc-code, .doc-code-tabs { overflow: hidden; border: 1px solid #d8dee8; background: #fbfcfe; }
.doc-code-head, .doc-code-tabs-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 38px; padding: 0 12px; border-bottom: 1px solid #e5e7eb; background: #f8fafc; color: #334155; font-size: 11px; }
.doc-code-head button, .doc-code-tabs-head button, .doc-code-panel > button { border: 0; background: transparent; color: #2563eb; font-size: 11px; cursor: pointer; }
.doc-code-tabs-head > div { display: flex; align-items: center; gap: 4px; }
.doc-code-tabs-head button { height: 26px; padding: 0 8px; border-radius: 4px; color: #64748b; }
.doc-code-tabs-head button.active { background: #dbeafe; color: #1d4ed8; }
.doc-code pre, .doc-code-panel pre { margin: 0; padding: 14px; overflow-x: auto; background: #fbfcfe; color: #1f2937; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 11px; line-height: 1.7; white-space: pre; }
.doc-code-panel { position: relative; display: none; }
.doc-code-panel.active { display: block; }
.doc-code-panel > button { position: absolute; top: 10px; right: 10px; padding: 5px 7px; border-radius: 4px; background: #eff6ff; }

.doc-endpoint-meta { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(150px, .4fr) minmax(220px, .8fr); border: 1px solid var(--doc-border); }
.doc-endpoint-meta > div { min-width: 0; padding: 12px 14px; border-right: 1px solid var(--doc-border); }
.doc-endpoint-meta > div:last-child { border-right: 0; }
.doc-endpoint-meta span { display: block; margin-bottom: 6px; color: #94a3b8; font-size: 11px; }
.doc-endpoint-meta code { color: #1d4ed8; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 11px; overflow-wrap: anywhere; }
.doc-endpoint-meta button { float: right; margin-left: 8px; border: 0; background: transparent; color: var(--doc-primary); font-size: 11px; cursor: pointer; }
.doc-endpoint-meta strong { color: #334155; font-size: 12px; overflow-wrap: anywhere; }
.doc-method { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 4px; background: #ecfdf5; color: #047857 !important; }
.doc-response-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.doc-response-grid > * { margin: 0 !important; }
.doc-notes { padding: 12px 14px; border: 1px solid var(--doc-border); background: #fafafa; }
.doc-notes strong { font-size: 12px; }
.doc-notes ul { display: grid; gap: 5px; margin: 7px 0 0; padding-left: 18px; }
.doc-notes li { color: #475569; font-size: 12px; line-height: 1.6; }
.doc-footer { padding: 24px 0 2px; color: #94a3b8; font-size: 11px; text-align: center; }
.doc-mobile-nav, .doc-mask { display: none; }

@media (max-width: 900px) {
  html { scroll-padding-top: 108px; }
  .doc-topbar-inner { padding: 0 14px; }
  .doc-brand small { display: none; }
  .doc-brand strong { max-width: calc(100vw - 190px); }
  .doc-layout { display: block; min-height: 0; }
  .doc-mobile-nav { position: sticky; top: 62px; z-index: 25; display: flex; align-items: center; justify-content: space-between; height: 42px; padding: 0 12px; border-bottom: 1px solid var(--doc-border); background: #fff; }
  .doc-mobile-nav button { height: 28px; padding: 0 10px; border: 1px solid var(--doc-border); border-radius: 5px; background: #fff; color: #334155; font-size: 12px; }
  .doc-mobile-nav span { color: #64748b; font-size: 11px; }
  .doc-sidebar { position: fixed; z-index: 50; top: 0; left: 0; width: min(280px, 82vw); height: 100vh; transform: translateX(-102%); transition: transform .2s ease; box-shadow: 16px 0 40px rgba(15, 23, 42, .12); }
  .doc-sidebar.open { transform: translateX(0); }
  .doc-sidebar-head { padding-top: 18px; }
  .doc-mask { position: fixed; z-index: 45; inset: 0; background: rgba(15, 23, 42, .35); }
  .doc-mask.open { display: block; }
  .doc-main { padding: 12px 10px 34px; }
  .doc-hero { align-items: flex-start; padding: 17px 15px; }
  .doc-hero h1 { font-size: 19px; }
  .doc-hero p { font-size: 12px; }
  .doc-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc-summary-item:nth-child(2) { border-right: 0; }
  .doc-summary-item:nth-child(-n+2) { border-bottom: 1px solid var(--doc-border); }
  .doc-section-head { padding: 14px; }
  .doc-section-head h2 { font-size: 15px; }
  .doc-section-body { padding: 14px; }
  .doc-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc-facts > div:nth-child(2) { border-right: 0; }
  .doc-facts > div:nth-child(-n+2) { border-bottom: 1px solid var(--doc-border); }
  .doc-endpoint-meta { grid-template-columns: 1fr 1fr; }
  .doc-endpoint-meta > div:first-child { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--doc-border); }
  .doc-endpoint-meta > div:nth-child(2) { border-right: 1px solid var(--doc-border); }
  .doc-response-grid { grid-template-columns: 1fr; }
  .doc-code-tabs-head { align-items: flex-start; flex-direction: column; padding: 9px 10px; }
}

@media (max-width: 420px) {
  .doc-brand strong { font-size: 13px; }
  .doc-top-actions .back-link { min-height: 28px; padding: 0 8px; }
  .doc-hero p { max-width: 250px; }
  .doc-version-badge { width: 44px; flex-basis: 44px; }
  .doc-endpoint-meta { grid-template-columns: 1fr; }
  .doc-endpoint-meta > div { border-right: 0 !important; border-bottom: 1px solid var(--doc-border); }
  .doc-endpoint-meta > div:last-child { border-bottom: 0; }
}
