:root {
  --ink: #172033;
  --muted: #667085;
  --line: #e6e9f0;
  --soft: #f6f8fc;
  --panel: #ffffff;
  --primary: #5b55e7;
  --primary-soft: #eeedff;
  --blue: #3f72ee;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background: #fff;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 94px; }
body { min-width: 320px; margin: 0; background: #fff; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }

.docs-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 72px;
  padding: 0 32px;
  display: grid;
  grid-template-columns: minmax(250px, 1fr) auto minmax(250px, 1fr);
  align-items: center;
  gap: 28px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.docs-brand { display: flex; align-items: center; gap: 11px; width: fit-content; }
.docs-brand img { width: 38px; height: 38px; }
.docs-brand strong { font-size: 20px; }
.docs-brand span { padding-left: 12px; color: #747b89; border-left: 1px solid #dfe3ea; font-size: 14px; }
.docs-header nav { display: flex; align-items: center; gap: 8px; }
.docs-header nav a { padding: 9px 14px; color: #515968; border-radius: 6px; font-size: 14px; }
.docs-header nav a:hover, .docs-header nav a.active { color: var(--primary); background: var(--primary-soft); }
.console-link { justify-self: end; padding: 10px 18px; color: #fff; background: var(--primary); border-radius: 6px; font-size: 14px; font-weight: 700; }
.console-link:hover { background: #4a43d3; }
.docs-menu { display: none; width: 38px; height: 38px; padding: 9px; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.docs-menu span { display: block; height: 2px; margin: 4px 0; background: #394150; }

.docs-shell { display: grid; grid-template-columns: 280px minmax(0, 900px) 180px; justify-content: center; align-items: start; }
.docs-sidebar {
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  padding: 24px 18px 18px;
  overflow-y: auto;
  background: #fafbfe;
  border-right: 1px solid var(--line);
}
.docs-search { position: relative; margin: 0 0 18px; }
.docs-search span { position: absolute; top: 12px; left: 13px; width: 14px; height: 14px; border: 1.7px solid #818898; border-radius: 50%; }
.docs-search span::after { content: ""; position: absolute; right: -5px; bottom: -3px; width: 6px; height: 1.7px; background: #818898; transform: rotate(45deg); }
.docs-search input { width: 100%; height: 40px; padding: 0 12px 0 38px; color: var(--ink); background: #fff; border: 1px solid #dfe3ea; border-radius: 6px; outline: none; }
.docs-search input:focus { border-color: #9d99ef; box-shadow: 0 0 0 3px rgba(91,85,231,.08); }
.docs-nav { display: grid; }
.docs-nav > a, .docs-nav summary { min-height: 52px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #242c3a; border-bottom: 1px solid #e5e8ee; font-size: 16px; }
.docs-nav > a { border-left: 3px solid transparent; }
.docs-nav > a:hover { color: var(--primary); background: #f1f2fb; }
.docs-nav i { width: 9px; height: 9px; display: block; flex: 0 0 auto; border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor; transform: rotate(-45deg); transition: transform .18s ease; }
.docs-nav details { border-bottom: 1px solid #e5e8ee; }
.docs-nav summary { border: 0; cursor: pointer; list-style: none; }
.docs-nav summary::-webkit-details-marker { display: none; }
.docs-nav details[open] summary i { transform: rotate(45deg) translate(-2px,-2px); }
.docs-nav details > div { display: grid; padding: 0 0 8px; }
.docs-nav details > div a { min-height: 42px; padding: 10px 16px 10px 32px; display: flex; align-items: center; color: #626a79; border-left: 3px solid transparent; font-size: 14px; }
.docs-nav details > div a:hover { color: var(--primary); background: #f2f3fb; }
.docs-nav a.active { color: #fff !important; background: #5687ea !important; border-left-color: #315ec6 !important; }
.docs-sidebar-foot { margin-top: 22px; padding: 13px; display: flex; align-items: center; justify-content: space-between; color: #7d8493; background: #fff; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; }
.docs-sidebar-foot strong { display: flex; align-items: center; gap: 6px; color: #397f62; }
.docs-sidebar-foot strong i { width: 7px; height: 7px; background: #35a875; border-radius: 50%; box-shadow: 0 0 0 3px rgba(53,168,117,.12); }

.docs-main { min-width: 0; padding: 30px 50px 70px; overflow-x: hidden; border-right: 1px solid #f0f1f4; }
.docs-breadcrumb { display: flex; gap: 9px; color: #8b92a0; font-size: 13px; }
.docs-breadcrumb a:hover { color: var(--primary); }
.doc-section { min-width: 0; max-width: 100%; padding: 46px 0; border-bottom: 1px solid #eceef2; }
.doc-section:first-of-type { padding-top: 38px; }
.doc-section[hidden] { display: none; }
.doc-eyebrow, .section-kicker { margin: 0 0 10px; color: var(--primary); font-size: 13px; font-weight: 800; text-transform: uppercase; }
.doc-section h1 { max-width: 720px; margin: 0; font-size: 42px; line-height: 1.2; letter-spacing: 0; }
.doc-section h2 { margin: 0 0 14px; font-size: 29px; line-height: 1.3; letter-spacing: 0; }
.doc-section h3 { margin: 28px 0 12px; font-size: 20px; letter-spacing: 0; }
.doc-section > p, .doc-subsection p, .doc-grid p, .api-entry p { color: var(--muted); font-size: 15px; line-height: 1.85; }
.doc-lead { max-width: 720px; margin: 18px 0 0; font-size: 17px !important; }
.doc-highlights { margin-top: 32px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.doc-highlights a { min-height: 118px; padding: 20px; display: flex; flex-direction: column; justify-content: center; background: #f7f8fc; border: 1px solid #e8eaf0; border-radius: 7px; transition: transform .18s ease, border-color .18s ease; }
.doc-highlights a:hover { transform: translateY(-2px); border-color: #b9b6ef; }
.doc-highlights strong { margin-bottom: 9px; font-size: 15px; }
.doc-highlights span { color: #757d8c; font-size: 13px; line-height: 1.55; }

.doc-steps { margin: 28px 0 0; padding: 0; display: grid; gap: 0; list-style: none; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.doc-steps li { padding: 20px; display: grid; grid-template-columns: 34px 1fr; gap: 15px; background: #fff; border-bottom: 1px solid var(--line); }
.doc-steps li:last-child { border-bottom: 0; }
.doc-steps li > span { width: 30px; height: 30px; display: grid; place-items: center; color: #fff; background: var(--primary); border-radius: 50%; font-size: 13px; font-weight: 800; }
.doc-steps strong { font-size: 15px; }
.doc-steps p { margin: 5px 0 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.doc-note, .doc-warning { margin-top: 20px; padding: 15px 17px; display: grid; grid-template-columns: auto 1fr; gap: 12px; color: #4c5470; background: #f3f2ff; border-left: 3px solid var(--primary); border-radius: 4px; font-size: 14px; line-height: 1.65; }
.doc-note p { margin: 0; }
.doc-warning { display: block; color: #765b28; background: #fff8e8; border-left-color: #e4aa35; }
.doc-warning strong { margin-right: 8px; }

.doc-subsection { padding: 28px 0; display: grid; grid-template-columns: 52px 1fr; gap: 20px; border-top: 1px solid #eceef2; }
.doc-subsection:first-of-type { margin-top: 30px; }
.doc-subsection.compact { display: block; padding: 34px 0; }
.doc-subsection.compact .subsection-wide { min-width: 0; max-width: 100%; }
.doc-subsection.compact h3:first-child { margin-top: 0; }
.subsection-number { width: 42px; height: 42px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); border-radius: 6px; font-size: 13px; font-weight: 800; }
.doc-subsection h3 { margin-top: 7px; }
.text-link { display: inline-flex; gap: 7px; color: var(--primary); font-size: 14px; font-weight: 700; }
.text-link:hover span { transform: translateX(3px); }
.text-link span { transition: transform .18s ease; }

code { font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace; }
.code-block { margin-top: 20px; overflow: hidden; background: #161b2a; border: 1px solid #242a3a; border-radius: 7px; }
.code-head { height: 42px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; color: #aeb6c8; background: #202637; border-bottom: 1px solid #2e3548; font-size: 12px; }
.code-head button, .endpoint button { padding: 6px 10px; color: #dfe4ee; background: #30384c; border: 0; border-radius: 4px; font-size: 12px; }
.code-head button:hover { background: #3d4760; }
pre { margin: 0; padding: 19px; overflow-x: auto; color: #e6e9f0; font-size: 13px; line-height: 1.75; tab-size: 2; }
.endpoint { margin: 20px 0 26px; min-height: 54px; padding: 10px 12px 10px 16px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 15px; background: #f6f7fb; border: 1px solid #e2e5ec; border-radius: 6px; }
.endpoint span { color: #737b89; font-size: 12px; font-weight: 800; }
.endpoint code { overflow-wrap: anywhere; color: #343b4a; font-size: 14px; }
.endpoint button { color: #fff; background: var(--primary); }
.api-entry { padding: 18px 0; border-top: 1px solid #eceef2; }
.api-entry > div { display: flex; align-items: center; gap: 12px; }
.api-entry p { margin-bottom: 0; }
.method { min-width: 50px; padding: 5px 8px; color: #fff; border-radius: 4px; text-align: center; font-size: 11px; font-weight: 800; }
.method.get { background: #228a68; }
.method.post { background: #4e66cf; }
.method.anthropic { background: #bf6845; }
.method.neutral { background: #707888; }
.protocol-endpoints { margin: 16px 0 4px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.protocol-endpoints > div { min-width: 0; padding: 13px 15px; display: grid; gap: 6px; background: #f7f8fb; border: 1px solid #e5e8ee; border-radius: 6px; }
.protocol-endpoints span { color: #7a8291; font-size: 11px; font-weight: 800; }
.protocol-endpoints code { overflow-wrap: anywhere; color: #343b4a; font-size: 12px; }

.doc-grid { margin-top: 22px; display: grid; gap: 12px; }
.doc-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.doc-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.doc-grid > div { min-height: 130px; padding: 21px; background: #f8f9fc; border: 1px solid #e9ebf0; border-radius: 7px; }
.doc-grid strong { font-size: 15px; }
.doc-grid p { margin-bottom: 0; font-size: 14px; }
.response-notes > div { min-height: 104px; }

.doc-table-wrap { width: 100%; max-width: 100%; margin: 20px 0 26px; overflow-x: auto; border: 1px solid #e2e5ec; border-radius: 7px; }
.doc-table { width: 100%; min-width: 700px; border-collapse: collapse; background: #fff; text-align: left; font-size: 13px; line-height: 1.65; }
.doc-table th { padding: 12px 15px; color: #525b6b; background: #f5f7fb; border-bottom: 1px solid #dfe3ea; font-size: 12px; font-weight: 800; }
.doc-table td { padding: 13px 15px; color: #5d6676; border-bottom: 1px solid #eceef2; vertical-align: top; }
.doc-table tr:last-child td { border-bottom: 0; }
.doc-table tbody tr:hover td { background: #fafaff; }
.doc-table td:first-child code { color: #423bc7; font-weight: 700; }
.required { display: inline-flex; padding: 2px 7px; color: #a33b4a; background: #fff0f2; border-radius: 4px; font-size: 11px; font-weight: 800; }
.status-code { display: inline-flex; min-width: 54px; justify-content: center; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 800; }
.status-code.client { color: #835c16; background: #fff4d8; }
.status-code.auth { color: #9b3948; background: #ffedf0; }
.status-code.limit { color: #815228; background: #fff0e5; }
.status-code.server { color: #4b4ab2; background: #eeedff; }

.check-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.check-grid > div { position: relative; min-height: 146px; padding: 22px 22px 20px 58px; background: #f8f9fc; border: 1px solid #e8eaf0; border-radius: 7px; }
.check-grid span { position: absolute; top: 22px; left: 20px; width: 27px; height: 27px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); border-radius: 50%; font-size: 10px; font-weight: 800; }
.check-grid strong { font-size: 15px; }
.check-grid p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.doc-list { margin: 20px 0 0; padding: 0; display: grid; list-style: none; }
.doc-list li { position: relative; padding: 14px 12px 14px 32px; color: #596171; border-bottom: 1px solid #eceef2; font-size: 14px; line-height: 1.7; }
.doc-list li::before { content: ""; position: absolute; top: 22px; left: 10px; width: 7px; height: 7px; background: var(--primary); border-radius: 50%; }
.faq-list { margin-top: 22px; border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary { min-height: 64px; padding: 18px 8px; display: flex; align-items: center; justify-content: space-between; gap: 20px; cursor: pointer; list-style: none; font-size: 15px; font-weight: 700; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary i { width: 9px; height: 9px; border-right: 2px solid #737b89; border-bottom: 2px solid #737b89; transform: rotate(45deg); transition: transform .18s ease; }
.faq-list details[open] summary i { transform: rotate(225deg); }
.faq-list p { margin: 0; padding: 0 8px 20px; color: var(--muted); font-size: 14px; line-height: 1.75; }

.docs-toc { position: sticky; top: 96px; margin: 42px 0 0; padding: 0 0 0 22px; display: grid; gap: 12px; border-left: 1px solid var(--line); }
.docs-toc strong { margin-bottom: 3px; font-size: 13px; }
.docs-toc a { color: #7b8391; font-size: 12px; }
.docs-toc a:hover { color: var(--primary); }
.docs-empty { margin: 80px auto; padding: 40px; text-align: center; }
.docs-empty p { color: var(--muted); }
.hidden { display: none !important; }
.docs-footer { padding: 30px 0 0; display: flex; justify-content: space-between; gap: 20px; color: #9298a4; font-size: 12px; }
.docs-footer a:hover { color: var(--primary); }
.sidebar-mask { display: none; }
.copy-toast { position: fixed; right: 24px; bottom: 24px; z-index: 80; padding: 10px 16px; color: #fff; background: #202637; border-radius: 5px; font-size: 13px; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
.copy-toast.show { opacity: 1; transform: none; }

@media (max-width: 1180px) {
  .docs-shell { grid-template-columns: 260px minmax(0, 900px); }
  .docs-toc { display: none; }
}
@media (max-width: 820px) {
  html { scroll-padding-top: 78px; }
  .docs-header { height: 64px; padding: 0 16px; grid-template-columns: 1fr auto; gap: 10px; }
  .docs-brand img { width: 34px; height: 34px; }
  .docs-brand strong { font-size: 18px; }
  .docs-brand span, .docs-header nav, .console-link { display: none; }
  .docs-menu { display: block; }
  .docs-shell { display: block; }
  .docs-sidebar { position: fixed; top: 64px; left: 0; z-index: 60; width: min(330px, 88vw); height: calc(100vh - 64px); transform: translateX(-105%); box-shadow: 18px 0 40px rgba(23,32,51,.16); transition: transform .22s ease; }
  .docs-sidebar.open { transform: none; }
  .sidebar-mask { position: fixed; inset: 64px 0 0; z-index: 55; display: block; background: rgba(18,24,39,.35); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .sidebar-mask.show { opacity: 1; pointer-events: auto; }
  .docs-main { padding: 24px 22px 50px; border: 0; }
  .doc-section h1 { font-size: 34px; }
  .doc-section h2 { font-size: 25px; }
  .doc-highlights { grid-template-columns: 1fr; }
  .doc-highlights a { min-height: 92px; }
  .doc-grid.three { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .docs-main { padding: 20px 16px 40px; }
  .doc-section { padding: 36px 0; }
  .doc-section h1 { font-size: 30px; }
  .doc-section h2 { font-size: 23px; }
  .doc-subsection { grid-template-columns: 1fr; gap: 5px; }
  .doc-grid.two { grid-template-columns: 1fr; }
  .protocol-endpoints { grid-template-columns: 1fr; }
  .check-grid { grid-template-columns: 1fr; }
  .endpoint { grid-template-columns: 1fr auto; }
  .endpoint span { grid-column: 1 / -1; }
  .docs-footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
