/* Scoped to API pages; other site sections retain their existing theme. */
body.api-theme {
  --ink: #f3eefb;
  --muted: #bbb0ca;
  --line: #3b2e4a;
  --blue: #cfb3ff;
  --green: #79dfbe;
  --bg: #17101f;
  --soft: #17101f;
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(90deg, #28123d 0%, #140d1d 38%, #08070c 76%, #1e102e 100%);
  font: 15px/1.8 system-ui, "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  color-scheme: dark;
}
.api-theme *, .api-theme *::before, .api-theme *::after { box-sizing: border-box; }
.api-theme a { color: var(--blue); text-underline-offset: 4px; }
.api-theme a:hover { color: #eee2ff; }
.api-theme :focus-visible { outline: 2px solid #d7b8ff; outline-offset: 4px; }
.api-theme ::selection { background: #694292; color: #fff; }
.api-theme :is(h1,h2,h3,h4,strong,b,legend) { color: var(--ink); }
.api-theme :is(p,li,td,th,h1,h2,h3,h4,a,span) { overflow-wrap: anywhere; }
.api-theme :is(p,li) { line-height: 1.85; }
.api-theme :is(small,.meta,.kicker,.muted,.lede,figcaption,.row-meta,.crumbs,.cap-intro) { color: var(--muted); }
.api-theme :is(header,.topbar) { position: static; background: #100c17; border-color: var(--line); backdrop-filter: none; }
.api-theme :is(.shell,.top,.layout,.flow-wrap) { width: 100%; max-width: none; margin-inline: 0; }
.api-theme .shell { padding-inline: 40px; }
.api-theme :is(.top,.nav) { min-height: 72px; height: auto; gap: 20px; padding-block: 16px; flex-wrap: wrap; }
.api-theme .top { padding-inline: 40px; }
.api-theme :is(.brand,.nav-links a,.platform-access .platform-login) { color: #f0e6ff; }
.api-theme .platform-access .platform-sales { color: #bfb1ce; }
.api-theme .notice { background: #1b1128; border-color: var(--line); color: #c8bad8; padding: 9px 20px; }
.api-theme .notice strong { animation: none; color: #d8b6ff; }
.api-theme :is(.btn,button,.downloads a,.related a,.cap-groups a) { background: #21152e; color: #eadbff; border: 1px solid #59426f; border-radius: 6px; box-shadow: none; }
.api-theme :is(.btn,button,.downloads a,.related a):hover { background: #352246; border-color: #9976ba; }
.api-theme :is(.primary,.btn.primary,.nav-links .contact) { color: #fff; background: #7040a0; border-color: #9163bb; border-radius: 6px; }
.api-theme :is(.primary,.btn.primary,.nav-links .contact):hover { color: #fff; background: #8250b2; }
.api-theme .downloads { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0; }
.api-theme .downloads a { display: inline-flex; align-items: center; min-height: 42px; padding: 8px 14px; font-size: 13px; text-decoration: none; }
.api-theme .layout { display: grid; grid-template-columns: 256px minmax(0,1fr); align-items: start; gap: 36px; padding: 32px 40px 64px; }
.api-theme :is(.content,.article,.layout>article,.results) { min-width: 0; }
.api-theme .toc { display: block; position: sticky; top: 20px; align-self: start; padding: 0; max-height: calc(100vh - 40px); overflow: auto; border: 0; border-right: 1px solid var(--line); border-radius: 0; scrollbar-gutter: stable; }
.api-theme .toc summary { display: flex; justify-content: space-between; align-items: center; margin: 0; padding: 12px 19px; color: #eee2ff; font-size: 14px; line-height: 24px; border-bottom: 1px solid var(--line); list-style: none; }
.api-theme .toc summary::after { content: '+'; color: #cfb3ff; }
.api-theme .toc[open] summary::after { content: '\2212'; }
.api-theme .toc summary::-webkit-details-marker { display: none; }
.api-theme .toc nav { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; }
.api-theme .toc a { display: block; padding: 10px 16px; margin: 0; color: #c3b7d1; border-left: 3px solid transparent; border-radius: 0; text-decoration: none; text-align: left; line-height: 23px; font-size: 14px; }
.api-theme .toc a:hover,.api-theme .toc a[aria-current="location"] { color: #f4eaff; background: #30203f; border-left-color: #c18aef; }
.api-theme :is(.intro,.hero) { background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.api-reference .intro,.api-extension .intro { padding: 0 0 26px; margin: 0 0 12px; }
.api-theme .intro :is(p,small) { color: var(--muted); }
.api-theme h1,.api-theme .intro h1 { max-width: none; font-size: 34px; line-height: 1.4; margin: 10px 0 16px; }
.api-theme h2,.api-theme .content h2 { font-size: 24px; line-height: 1.45; }
.api-theme h3,.api-theme .content h3 { font-size: 18px; line-height: 1.5; }
.api-theme :is(.content section,.article section,.api-content>section) { padding: 28px 0; margin: 0; background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.api-theme .content section>h2 { margin-top: 0; }
.api-theme :is(.scroll,.table-scroll,.table-wrap) { max-width: 100%; overflow-x: auto; border-color: var(--line); scrollbar-color: #77508e #100c17; }
.api-theme table { width: 100%; border-collapse: collapse; font-size: 14px; }
.api-theme :is(th,td) { color: #e2d8ed; text-align: left; border: 1px solid var(--line); padding: 12px 14px; vertical-align: top; }
.api-theme th { background: #2a1b39; color: #f5eaff; }
.api-theme tr { background: #110d18; }
.api-theme tr:nth-child(even) { background: #1b1324; }
.api-theme code { color: #d8c3f1; background: #2a1d36; font-size: 13px; border-radius: 3px; padding: 2px 4px; }
.api-theme pre { background: #08090d !important; color: #e9e3f2 !important; border: 1px solid #3b3048 !important; padding: 22px; border-radius: 6px; overflow: auto; font: 13px/1.85 ui-monospace,Consolas,monospace; tab-size: 4; max-width: 100%; }
.api-theme pre code,.api-theme pre span { color: inherit !important; background: transparent !important; padding: 0; }
.api-theme .full-doc { padding: 0; margin-top: 28px; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.api-theme summary { color: #e4ccff; cursor: pointer; }
.api-theme .full-doc>summary { font-size: 20px; padding: 20px 0; }
.api-theme .doc-group { border-bottom: 1px solid var(--line); padding: 0 0 8px; }
.api-theme .doc-group>summary { padding: 14px 0; font-weight: 600; }
.api-theme .doc-group[open]>summary { margin-bottom: 10px; }
.api-theme :is(.callout,.cap-note) { background: #241831; color: #d4c4e3; border-left: 3px solid #b281dc; }
.api-theme #api-quotation strong { color: #8de5c4; }
.api-theme :is(.card,.summary,.cap-card,.faq details) { background: #18101f; border: 1px solid var(--line); border-radius: 6px; box-shadow: none; }
.api-theme :is(.band,.workbench,.cta) { background: #100c18a8; border-color: var(--line); }
.api-theme :is(.flow div,.flow .step) { background: #1b1325; }
.api-theme :is(.step b,.card .num,.copy-state) { color: #bda0e3; }
.api-theme :is(.card p,.step p,.faq p,.cta p,.stats span) { color: var(--muted); }
.api-theme :is(footer,.footer) { background: #100b17; border-color: var(--line); color: #b3a4c4; }
.api-service .hero { padding: 44px 0; }
.api-service .hero-grid { grid-template-columns: minmax(0,1.4fr) minmax(300px,.6fr); gap: 48px; }
.api-service section { padding-block: 44px; }
.api-service .section-head { max-width: none; }
.api-service .section-head h2,.api-service .cta h2 { font-size: 26px; }
.api-service .lede { max-width: none; font-size: 17px; }
.api-extension>nav { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; padding: 16px 40px; background: #100c17; border-bottom: 1px solid var(--line); }
.api-extension .cap-groups a { border-radius: 5px; }
.api-extension .cap-card { padding: 18px; }
.api-extension .cap-card code { color: #c7b4da; }
.api-extension .cap-feature { color: #c1b1d0; background: #2b2135; }
.api-extension .cap-feature.yes { color: #94e5cd; background: #153930; }
.api-theme :is(input,select,option,textarea) { background: #130e1c !important; color: #eee4f9 !important; border-color: #604876 !important; min-width: 0; }
.api-theme input::placeholder { color: #a796b9; }
.api-theme :is(.filters,.stats,.result-row,.flow-note) { border-color: var(--line); }
.api-theme .status { color: #8fe7c5; }
.api-theme .status.review { color: #efc982; }
.api-theme .status.excluded,.api-theme .error { color: #ffabae; }
.api-theme dialog { background: #170f21; color: #eee4f7; border-color: #72508c; border-radius: 8px; }
.api-theme dialog::backdrop { background: #050309b8; }
.api-diagram .flow-wrap { padding: 40px; background: transparent; min-height: calc(100vh - 150px); }
.api-diagram .flow { margin-block: 32px; }
.api-theme figure img { border-color: var(--line); }
@media(min-width:1700px) {
  .api-theme .layout { grid-template-columns: 280px minmax(0,1fr); gap: 44px; }
  .api-extension .cap-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
@media(max-width:900px) {
  .api-theme .shell,.api-theme .top { padding-inline: 24px; }
  .api-theme .layout { padding-inline: 24px; gap: 24px; grid-template-columns: 220px minmax(0,1fr); }
  .api-service .hero-grid { grid-template-columns: 1fr; gap: 24px; }
}
@media(max-width:800px) {
  .api-theme .layout { grid-template-columns: minmax(0,1fr); padding: 20px 18px 40px; gap: 22px; }
  .api-theme .toc { position: static; width: 100%; max-height: none; border: 1px solid var(--line); border-radius: 6px; }
  .api-theme .toc nav { max-height: 300px; overflow: auto; }
  .api-theme .toc:not([open]) summary { border-bottom: 0; }
  .api-theme .shell,.api-theme .top { padding-inline: 18px; }
  .api-theme :is(.top,.nav) { gap: 12px; }
  .api-theme .top nav { gap: 12px; flex-wrap: wrap; justify-content: flex-start; }
  .api-theme .brand span { display: inline; font-size: 15px; }
  .api-theme h1,.api-theme .intro h1 { font-size: 27px; }
  .api-theme h2,.api-theme .content h2 { font-size: 21px; }
  .api-theme .intro { padding-block: 22px; }
  .api-reference .intro,.api-extension .intro { padding-top: 0; }
  .api-theme table { min-width: 600px; }
  .api-theme #api-quotation table { min-width: 0; table-layout: fixed; }
  .api-theme #api-quotation :is(th,td) { padding: 10px; font-size: 13px; }
  .api-theme #api-quotation :is(th,td):nth-child(1) { width: 32%; }
  .api-theme #api-quotation :is(th,td):nth-child(2) { width: 42%; }
  .api-theme #api-quotation :is(th,td):nth-child(3) { width: 26%; }
  .api-theme pre { padding: 16px; }
  .api-theme .full-doc { padding: 0; }
  .api-extension>nav { padding: 16px 18px; gap: 12px; }
  .api-technical .toc { display: flex; flex-wrap: wrap; padding: 8px; }
  .api-technical .toc a { padding: 8px 10px; }
  .api-diagram .flow-wrap { padding: 24px 18px; }
}
@media(max-width:480px) {
  .api-theme .top .brand { flex-basis: 100%; }
  .api-theme .top nav { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); flex: 1 0 100%; align-items: center; font-size: 13px; }
  .api-theme .platform-access { margin-left: 0; align-items: flex-start; }
  .api-theme .downloads { gap: 8px; }
  .api-theme .downloads a { padding: 8px 10px; }
  .api-theme .filters fieldset { grid-template-columns: minmax(0,1fr); }
  .api-diagram .flow { grid-template-columns: minmax(0,1fr); }
}
@media(prefers-reduced-motion:reduce) { html { scroll-behavior: auto; } }
@media print {
  body.api-theme { background: white; color: black; }
  .api-theme :is(h1,h2,h3,h4,p,li,td,th,a,strong,b,code) { color: black; }
  .api-theme :is(header,.toc,.actions,.downloads,footer) { display: none; }
  .api-theme .layout { display: block; padding: 0; }
  .api-theme :is(pre,th,tr,tr:nth-child(even),.intro,.callout) { background: #f6f6f6 !important; color: black !important; }
  .api-theme pre { max-height: none; white-space: pre-wrap; overflow-wrap: anywhere; }
}
