:root {
  color-scheme: dark;
  --bg: #0c1117;
  --panel: #111820;
  --panel-2: #151e27;
  --line: #25313d;
  --line-soft: #1c2731;
  --muted: #94a4b4;
  --text: #e6edf3;
  --accent: #e7a657;
  --accent-strong: #f2b966;
  --accent-soft: #332719;
  --blue: #84b9fa;
  --code: #0a1017;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 92px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.8 var(--font); -webkit-font-smoothing: antialiased; }
body.menu-open, body.search-open { overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
code { font-family: var(--mono); }
[hidden] { display: none !important; }

.skip-link { position: fixed; top: -60px; left: 20px; z-index: 100; background: var(--accent); color: #181008; padding: 8px 14px; border-radius: 0 0 6px 6px; font-weight: 700; }
.skip-link:focus { top: 0; }
.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; }

.topbar { height: 72px; position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 24px; padding: 0 32px; border-bottom: 1px solid var(--line); background: rgb(12 17 23 / 96%); backdrop-filter: blur(16px); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 18px; font-weight: 760; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 7px; background: var(--accent); color: #171008; font-size: 16px; font-weight: 850; transform: rotate(-6deg); box-shadow: 0 0 24px rgb(231 166 87 / 15%); }
.brand em { margin-left: 7px; padding-left: 16px; border-left: 1px solid var(--line); color: var(--muted); font-size: 12px; font-style: normal; font-weight: 450; }
.menu-toggle { display: none; width: 34px; height: 34px; border: 0; background: transparent; color: var(--text); font-size: 20px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.search-button { display: flex; align-items: center; gap: 9px; min-width: 174px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--muted); font-size: 12px; text-align: left; }
.search-button > span:first-child { font-size: 18px; line-height: 1; }
.search-button kbd { margin-left: auto; padding: 1px 5px; border: 1px solid #35414c; border-radius: 4px; background: #202a33; color: #8999a8; font: 10px var(--font); }
.console-link { color: #cad3dc; font-size: 13px; white-space: nowrap; }
.console-link span { color: var(--accent); }

.search-panel { position: fixed; z-index: 80; top: 96px; left: 50%; width: min(600px, calc(100% - 32px)); transform: translateX(-50%); padding: 18px; border: 1px solid #4d4335; border-radius: 8px; background: #111820; box-shadow: 0 24px 80px rgb(0 0 0 / 60%); }
.search-panel > label { display: block; margin-bottom: 8px; color: #cbd5de; font-size: 12px; font-weight: 650; }
.search-field { display: flex; align-items: center; gap: 10px; padding: 8px 11px; border: 1px solid #46515b; border-radius: 6px; background: var(--code); color: var(--muted); }
.search-field input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); }
.search-close { border: 0; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; }
.search-results { max-height: 50vh; overflow: auto; margin-top: 10px; }
.search-results a { display: block; padding: 10px 12px; border-radius: 6px; color: var(--text); }
.search-results a:hover, .search-results a:focus { background: var(--panel-2); text-decoration: none; }
.search-results strong { display: block; font-size: 13px; }
.search-results small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.search-empty { padding: 12px; color: var(--muted); font-size: 12px; }

.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr) 205px; max-width: 1600px; margin: 0 auto; }
.sidebar { position: sticky; top: 72px; height: calc(100vh - 72px); overflow: auto; display: flex; flex-direction: column; padding: 28px 18px 24px 24px; border-right: 1px solid var(--line); background: var(--bg); }
.sidebar nav { display: flex; flex-direction: column; gap: 3px; }
.nav-label { margin: 17px 11px 7px; color: #718496; font-size: 10px; font-weight: 750; letter-spacing: 1.4px; text-transform: uppercase; }
.nav-label:first-child { margin-top: 0; }
.nav-link { display: flex; align-items: center; gap: 10px; min-height: 39px; padding: 7px 10px; border: 1px solid transparent; border-radius: 6px; color: #aebbc7; font-size: 12px; line-height: 1.4; }
.nav-link:hover { background: #151d25; color: var(--text); text-decoration: none; }
.nav-link.active { border-color: #5a4228; background: #2b2117; color: var(--accent); }
.nav-icon { display: inline-flex; justify-content: center; width: 18px; color: #7d8e9e; font-size: 15px; }
.nav-icon.braces { font-size: 11px; font-weight: 700; }
.nav-link.active .nav-icon { color: var(--accent); }
.nav-badge { margin-left: auto; padding: 1px 5px; border-radius: 3px; background: #46331e; color: var(--accent); font-size: 8px; font-weight: 700; }
.sidebar-meta { margin-top: auto; padding: 24px 11px 0; color: #718293; font-size: 10px; line-height: 1.7; }
.live-dot { display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px rgb(231 166 87 / 55%); }

main { min-width: 0; padding: 39px 54px 70px; }
.breadcrumb { display: flex; align-items: center; gap: 8px; margin-bottom: 24px; color: #7d8fa0; font-size: 11px; }
.breadcrumb span:last-child { color: #bcc8d2; }
.doc-section { position: relative; max-width: 880px; padding: 34px 0 74px; border-bottom: 1px solid var(--line); scroll-margin-top: 72px; }
.hero-section { padding-top: 0; }
.section-number { position: absolute; top: 40px; right: 0; color: #222d37; font: 700 54px/1 var(--mono); }
.eyebrow { display: flex; align-items: center; gap: 8px; color: var(--accent); font-size: 10px; font-weight: 750; letter-spacing: 1.8px; }
.eyebrow::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgb(231 166 87 / 50%); }
h1 { margin: 12px 0 12px; font-size: 36px; line-height: 1.3; letter-spacing: 0; }
h2 { margin: 38px 0 13px; font-size: 20px; line-height: 1.5; letter-spacing: 0; scroll-margin-top: 92px; }
h3 { margin: 0; font-size: 14px; line-height: 1.5; letter-spacing: 0; }
p { margin: 9px 0 15px; color: #b3c0cc; }
.lead { max-width: 660px; color: #9dafbd; font-size: 15px; line-height: 1.9; }
p code, li code, td code, .key-value-grid code, .config-strip code { padding: 2px 5px; border: 1px solid #403629; border-radius: 4px; background: #251e16; color: #f0bd7d; font-size: 12px; overflow-wrap: anywhere; }
.hero-actions { display: flex; align-items: center; gap: 21px; margin-top: 23px; }
.primary-button { display: inline-flex; align-items: center; gap: 18px; padding: 8px 16px; border-radius: 6px; background: var(--accent); color: #1b1208; font-size: 13px; font-weight: 750; }
.primary-button:hover { background: var(--accent-strong); text-decoration: none; }
.text-link { color: #c0cbd4; font-size: 13px; }
.signal-row { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 27px; color: #8193a3; font-size: 11px; }
.signal-row span { display: flex; align-items: center; gap: 7px; }
.signal-row i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; margin: 18px 0 28px; }
.step { min-height: 150px; padding: 16px; border: 1px solid var(--line); border-radius: 7px; background: linear-gradient(145deg, #151d25, #10171e); }
.step > span, .verify-grid article > span { display: grid; place-items: center; width: 26px; height: 26px; margin-bottom: 12px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); font-size: 10px; font-weight: 800; }
.step p { margin: 6px 0 0; color: #889aaa; font-size: 12px; line-height: 1.7; }

.code-block { margin: 16px 0 22px; overflow: hidden; border: 1px solid #293744; border-radius: 8px; background: var(--code); }
.code-header { height: 40px; display: flex; align-items: center; padding: 0 12px 0 14px; border-bottom: 1px solid #21303c; color: #8da1b2; font-size: 11px; }
.code-type { display: flex; align-items: center; gap: 8px; }
.code-type i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: .75; }
.copy-button { margin-left: auto; padding: 3px 7px; border: 0; border-radius: 4px; background: transparent; color: #9eb0bf; font-size: 11px; }
.copy-button:hover { background: #2a241c; color: var(--accent); }
.code-block pre { margin: 0; padding: 18px; overflow: auto; color: #c8d6e1; font: 12px/1.8 var(--mono); tab-size: 2; }
.code-block code { font: inherit; white-space: pre; }
.endpoint { display: flex; align-items: center; gap: 11px; margin: 14px 0; padding: 10px 13px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); overflow-wrap: anywhere; }
.endpoint code { color: #c5d2dc; font-size: 12px; }
.method { padding: 1px 7px; border-radius: 3px; background: #49351f; color: #f1b96e; font-size: 9px; font-weight: 800; }
.callout { display: flex; gap: 11px; margin: 18px 0; padding: 12px 14px; border: 1px solid #31475b; border-radius: 7px; background: #142330; color: #aac0d2; font-size: 12px; }
.callout > span { flex: 0 0 16px; color: var(--blue); font-weight: 800; }
.callout p { margin: 0; color: inherit; }
.callout.warn { border-color: #51412b; background: #2a2319; color: #d2bd9d; }
.callout.warn > span { color: var(--accent); }

.next-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.next-card { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--text); }
.next-card:hover { border-color: #6b5132; text-decoration: none; }
.card-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 13px; }
.next-card strong, .next-card small { display: block; }
.next-card strong { font-size: 13px; }
.next-card small { margin-top: 3px; color: #8799a8; font-size: 11px; }
.next-card b { color: #697b8b; }

.key-value-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; overflow: hidden; margin: 16px 0; border: 1px solid var(--line); border-radius: 7px; background: var(--line); }
.key-value-grid > div { min-width: 0; padding: 13px 14px; background: var(--panel); }
.key-value-grid span, .config-strip span, .night-watch span { display: block; margin-bottom: 5px; color: #7f92a3; font-size: 10px; text-transform: uppercase; letter-spacing: .7px; }
.key-value-grid code { display: inline; }
.table-wrap { margin: 15px 0 7px; overflow: auto; border: 1px solid var(--line); border-radius: 7px; }
table { width: 100%; min-width: 600px; border-collapse: collapse; text-align: left; font-size: 12px; }
th { padding: 10px 13px; border-bottom: 1px solid var(--line); background: #141e27; color: #8fa3b4; font-size: 10px; font-weight: 650; white-space: nowrap; }
td { padding: 11px 13px; border-bottom: 1px solid var(--line-soft); color: #b6c3ce; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td strong { color: #dbe4ec; font-weight: 600; }
.rate { color: var(--accent); font-family: var(--mono); }
.compact-table { max-width: 620px; }
.compact-table table { min-width: 430px; }
.price-note { margin-top: 8px; color: #75899b; font-size: 11px; }

.config-strip { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 12px; margin: 16px 0; }
.config-strip > div { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.config-strip code { display: block; overflow-wrap: anywhere; }
.config-arrow { margin: 0 !important; color: #586b7a !important; }
.client-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.client-list article { display: flex; gap: 13px; padding: 15px; border-top: 1px solid var(--line); }
.client-mark { flex: 0 0 34px; height: 34px; display: grid; place-items: center; border: 1px solid #4b3b28; border-radius: 6px; background: #211b14; color: var(--accent); font: 700 11px var(--mono); }
.client-list p { margin: 4px 0 0; color: #8ea0af; font-size: 12px; line-height: 1.7; }

.formula { display: flex; align-items: center; justify-content: center; gap: 13px; margin: 24px 0 30px; padding: 18px; border: 1px solid #4b3b28; border-radius: 7px; background: #171813; color: #d4dee6; font: 13px var(--mono); }
.formula span { padding: 7px 10px; border: 1px solid #303b44; border-radius: 5px; background: var(--panel); }
.formula b { color: var(--accent); font-size: 16px; }
.calculation-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 17px; }
.calculation-grid article { padding: 15px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.calculation-grid span { color: #8b9dac; font-size: 11px; }
.calculation-grid strong { display: block; margin: 5px 0 8px; color: var(--accent); font: 650 20px var(--mono); }
.calculation-grid code { color: #9badbb; font-size: 10px; white-space: nowrap; }

.verify-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 17px 0; }
.verify-grid article { padding: 15px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.verify-grid p { margin: 4px 0 0; color: #8b9cab; font-size: 11px; }
.night-watch { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 1px; overflow: hidden; margin: 16px 0; border: 1px solid var(--line); border-radius: 7px; background: var(--line); }
.night-watch > div { padding: 15px; background: var(--panel); }
.night-watch strong { display: block; color: var(--text); font: 650 21px var(--mono); }
.night-watch small { color: #718596; font-size: 10px; }

.error-list { margin-top: 20px; border-top: 1px solid var(--line); }
.error-list article { display: grid; grid-template-columns: 78px 1fr; gap: 18px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.error-list > article > code { align-self: start; padding: 4px 8px; border: 1px solid #4b3b28; border-radius: 4px; background: var(--accent-soft); color: var(--accent); text-align: center; font-size: 11px; }
.error-list h2 { margin: 0; font-size: 15px; }
.error-list p { margin: 5px 0 0; font-size: 13px; }
.limits-list { margin-top: 21px; }
.limits-list article { display: grid; grid-template-columns: 42px 1fr; gap: 16px; padding: 19px 0; border-top: 1px solid var(--line); }
.limits-list article > span { color: #586b7c; font: 11px var(--mono); }
.limits-list h2 { margin: 0; font-size: 15px; }
.limits-list p { margin: 5px 0 0; font-size: 13px; }

.rightbar { position: sticky; top: 72px; height: calc(100vh - 72px); padding: 44px 18px 20px 8px; font-size: 11px; }
.right-title { margin-bottom: 12px; color: #bdc9d3; font-weight: 650; }
.outline { display: flex; flex-direction: column; gap: 10px; padding-left: 13px; border-left: 1px solid #263743; }
.outline a { color: #778c9d; line-height: 1.5; }
.outline a:hover { color: var(--accent); text-decoration: none; }
.outline a.active { color: var(--accent); }
.aside-note { margin-top: 24px; padding-top: 17px; border-top: 1px solid var(--line); color: #6c8192; line-height: 1.7; }
.site-footer { max-width: 880px; display: flex; justify-content: space-between; gap: 18px; padding: 28px 0 0; color: #65798a; font-size: 11px; }
.site-footer a { color: #94a8b8; }
.noscript { position: fixed; right: 16px; bottom: 16px; z-index: 100; padding: 12px; border: 1px solid #51412b; background: #2a2319; color: #d2bd9d; font-size: 12px; }
.mobile-shade { display: none; }

@media (min-width: 1600px) {
  .layout { border-right: 1px solid var(--line); border-left: 1px solid var(--line); }
}

@media (max-width: 1200px) {
  .layout { grid-template-columns: 230px minmax(0, 1fr); }
  .rightbar { display: none; }
  main { padding-right: 40px; padding-left: 40px; }
}

@media (max-width: 900px) {
  html { scroll-padding-top: 76px; }
  .topbar { height: 62px; padding: 0 16px; gap: 10px; }
  .menu-toggle { display: grid; place-items: center; }
  .brand { font-size: 16px; }
  .brand-mark { width: 26px; height: 26px; font-size: 14px; }
  .brand em { display: none; }
  .search-button { min-width: 34px; width: 34px; height: 34px; justify-content: center; padding: 0; border: 0; background: transparent; }
  .search-button .search-label, .search-button kbd { display: none; }
  .console-link { padding: 6px 9px; border: 1px solid var(--line); border-radius: 5px; font-size: 11px; }
  .layout { display: block; }
  .sidebar { position: fixed; z-index: 50; top: 62px; left: 0; width: 278px; height: calc(100dvh - 62px); padding-top: 22px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 18px 0 45px rgb(0 0 0 / 35%); }
  .sidebar.open { transform: translateX(0); }
  .mobile-shade.open { position: fixed; z-index: 45; inset: 62px 0 0; display: block; background: rgb(0 0 0 / 65%); }
  main { padding: 28px 24px 48px; }
  .doc-section { scroll-margin-top: 62px; }
}

@media (max-width: 640px) {
  body { font-size: 14px; }
  .top-actions { gap: 4px; }
  .console-link { border: 0; padding-right: 0; }
  main { padding: 24px 18px 40px; }
  .breadcrumb { margin-bottom: 21px; font-size: 10px; }
  .doc-section { padding: 32px 0 58px; }
  .hero-section { padding-top: 0; }
  .section-number { top: 37px; font-size: 40px; }
  h1 { font-size: 29px; }
  h2 { margin-top: 32px; font-size: 18px; }
  .lead { font-size: 14px; }
  .steps, .next-grid, .client-list, .calculation-grid, .verify-grid { grid-template-columns: 1fr; }
  .step { min-height: 0; display: grid; grid-template-columns: 30px 1fr; gap: 0 9px; }
  .step > span { grid-row: span 2; margin: 0; }
  .step p { grid-column: 2; }
  .key-value-grid { grid-template-columns: 1fr; }
  .config-strip { grid-template-columns: 1fr; }
  .config-arrow { display: none !important; }
  .formula { gap: 7px; padding: 13px 8px; font-size: 10px; }
  .formula span { padding: 6px; }
  .night-watch { grid-template-columns: 1fr; }
  .error-list article { grid-template-columns: 64px 1fr; gap: 13px; }
  .code-block pre { padding: 15px; font-size: 11px; }
  .site-footer { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
