/* Voypace Partner API docs */
:root {
  --brand: #5B5BD6; --brand-2: #12A594; --brand-soft: rgba(91, 91, 214, .10);
  --bg: #F6F7FB; --surface: #FFFFFF; --surface-2: #F1F2F7; --code-bg: #F3F4F8;
  --text: #0F172A; --muted: #5B6475; --line: rgba(15, 23, 42, .09);
  --req: #E5484D; --rec: #D98A00; --opt: #6B7280;
  --ok: #30A46C; --shadow: 0 10px 30px -18px rgba(15, 23, 42, .35);
  --tk-key: #7C3AED; --tk-str: #0F7B5F; --tk-num: #B45309; --tk-com: #8A94A6; --tk-fn: #2563EB; --tk-attr: #5B5BD6;
  --top-h: 60px; --side-w: 264px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E0F13; --surface: #16181D; --surface-2: #1C1F26; --code-bg: #0B0C10;
    --text: #ECEDEF; --muted: #9BA1AD; --line: rgba(255, 255, 255, .09); --brand-soft: rgba(124, 124, 240, .16);
    --rec: #F5A524; --opt: #9BA1AD; --shadow: 0 10px 30px -18px rgba(0, 0, 0, .8);
    --tk-key: #C4A7FF; --tk-str: #6EE7B7; --tk-num: #FBBF77; --tk-com: #6B7280; --tk-fn: #93C5FD; --tk-attr: #A5A5FF;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E0F13; --surface: #16181D; --surface-2: #1C1F26; --code-bg: #0B0C10;
  --text: #ECEDEF; --muted: #9BA1AD; --line: rgba(255, 255, 255, .09); --brand-soft: rgba(124, 124, 240, .16);
  --rec: #F5A524; --opt: #9BA1AD; --shadow: 0 10px 30px -18px rgba(0, 0, 0, .8);
  --tk-key: #C4A7FF; --tk-str: #6EE7B7; --tk-num: #FBBF77; --tk-com: #6B7280; --tk-fn: #93C5FD; --tk-attr: #A5A5FF;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top-h) + 16px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 15.5px/1.7 Inter, system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; overflow-x: hidden; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, kbd { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 30; height: var(--top-h); display: flex; align-items: center; gap: 16px; padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 15px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand b { font-weight: 800; letter-spacing: -.2px; }
.brand em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--brand); background: var(--brand-soft); padding: 1px 7px; border-radius: 99px; }
.top-nav { display: flex; gap: 4px; margin-left: 12px; }
.top-nav a { color: var(--muted); font-weight: 600; font-size: 14px; padding: 6px 10px; border-radius: 8px; transition: color .2s, background .2s; }
.top-nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.top-nav a.on { color: var(--brand); background: var(--brand-soft); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.lang-btn { font-weight: 600; font-size: 13px; color: var(--text); border: 1px solid var(--line); background: var(--surface); padding: 5px 11px; border-radius: 99px; }
button.lang-btn { font-family: inherit; cursor: pointer; }
.lang-btn:hover { text-decoration: none; border-color: var(--brand); }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 0; background: transparent; color: var(--text); border-radius: 10px; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }
.menu-btn { display: none; margin-left: -8px; }

/* icons (CSS masks, no icon font) */
[class^="i-"] { display: inline-block; width: 18px; height: 18px; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.i-menu { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 6h18M3 12h18M3 18h18' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); }
.i-theme { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z' fill='black'/%3E%3C/svg%3E"); transition: transform .5s cubic-bezier(.2,.8,.2,1); }
[data-theme="dark"] .i-theme { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4.5' fill='black'/%3E%3Cpath d='M12 1.5v2.5M12 20v2.5M4.6 4.6l1.8 1.8M17.6 17.6l1.8 1.8M1.5 12H4M20 12h2.5M4.6 19.4l1.8-1.8M17.6 6.4l1.8-1.8' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); transform: rotate(180deg); }
.i-copy { width: 15px; height: 15px; --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='8' y='8' width='13' height='13' rx='2.5' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M16 8V5.5A2.5 2.5 0 0 0 13.5 3h-8A2.5 2.5 0 0 0 3 5.5v8A2.5 2.5 0 0 0 5.5 16H8' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E"); }
.copy.done .i-copy { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 12.5l5 5L20 6.5' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); color: var(--ok); animation: pop .35s cubic-bezier(.2,.8,.2,1); }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); max-width: 1320px; margin: 0 auto; }
.side { position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto; padding: 28px 16px 40px 24px; border-right: 1px solid var(--line); }
.side-title { font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin: 0 0 10px 12px; }
.toc { position: relative; display: flex; flex-direction: column; }
.toc a { position: relative; z-index: 1; color: var(--muted); font-size: 13.5px; line-height: 1.4; padding: 6px 12px; border-radius: 8px; transition: color .2s; }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.on { color: var(--brand); font-weight: 600; }
.toc a.toc-l3 { padding-left: 26px; font-size: 13px; }
.toc a code { font-size: .9em; }
.toc-ind { position: absolute; left: 0; right: 0; top: 0; height: 0; border-radius: 8px; background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); transition: transform .35s cubic-bezier(.2,.8,.2,1), height .35s cubic-bezier(.2,.8,.2,1), opacity .2s; opacity: 0; pointer-events: none; }
.content { min-width: 0; padding: 40px 56px 64px; max-width: 920px; }
.scrim { display: none; }

/* ---------- content ---------- */
.content h1 { font-size: 38px; line-height: 1.15; letter-spacing: -1px; font-weight: 800; margin: 8px 0 12px; }
.content h1 + p { font-size: 17px; color: var(--muted); max-width: 680px; }
.content h2 { font-size: 24px; letter-spacing: -.4px; font-weight: 750; margin: 56px 0 14px; padding-top: 22px; border-top: 1px solid var(--line); position: relative; }
.content h3 { font-size: 18px; font-weight: 700; margin: 32px 0 10px; position: relative; }
.anchor { position: absolute; left: -22px; color: var(--muted); opacity: 0; font-weight: 500; transition: opacity .2s; }
h2:hover .anchor, h3:hover .anchor { opacity: .7; text-decoration: none; }
.content p, .content li { max-width: 760px; }
.content ul, .content ol { padding-left: 22px; }
.content li { margin: 4px 0; }
.content :not(pre) > code { font-size: .86em; background: var(--surface-2); border: 1px solid var(--line); padding: .1em .38em; border-radius: 6px; word-break: break-word; }
.content strong { font-weight: 700; }

.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 26px 0 8px; }
.card { display: block; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s, border-color .25s; }
.card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.card b { display: block; font-size: 15px; }
.card span { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; }

.table { overflow-x: auto; margin: 14px 0 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; background: var(--surface-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }
.lv { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 99px; white-space: nowrap; }
.lv.req { color: var(--req); background: color-mix(in srgb, var(--req) 12%, transparent); }
.lv.rec { color: var(--rec); background: color-mix(in srgb, var(--rec) 14%, transparent); }
.lv.opt { color: var(--opt); background: color-mix(in srgb, var(--opt) 14%, transparent); }

/* ---------- code ---------- */
.code { margin: 14px 0 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--code-bg); overflow: hidden; }
.code-bar { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 4px 14px; border-bottom: 1px solid var(--line); }
.code-lang { font: 600 11.5px "JetBrains Mono", monospace; color: var(--muted); }
.copy { width: 30px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; transition: background .2s, color .2s, transform .15s; }
.copy:hover { background: var(--surface-2); color: var(--text); }
.copy:active { transform: scale(.9); }
pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-size: 13px; line-height: 1.65; tab-size: 4; }
.tabs { margin: 14px 0 18px; }
.tab-list { display: flex; gap: 4px; overflow-x: auto; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); scrollbar-width: none; }
.tab-list::-webkit-scrollbar { display: none; }
.tab { border: 0; background: transparent; color: var(--muted); font: 600 13px Inter, sans-serif; padding: 6px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap; transition: background .2s, color .2s; }
.tab:hover { color: var(--text); }
.tab.on { background: var(--surface); color: var(--brand); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.pane { display: none; }
.pane.on { display: block; animation: fadeUp .3s cubic-bezier(.2,.8,.2,1); }
.pane .code { margin-top: 8px; }

.hljs-keyword, .hljs-built_in, .hljs-literal, .hljs-type { color: var(--tk-key); }
.hljs-string, .hljs-regexp { color: var(--tk-str); }
.hljs-number { color: var(--tk-num); }
.hljs-comment, .hljs-meta { color: var(--tk-com); font-style: italic; }
.hljs-title, .hljs-title.function_ { color: var(--tk-fn); }
.hljs-attr, .hljs-attribute, .hljs-variable, .hljs-property, .hljs-params { color: var(--tk-attr); }
.hljs-section, .hljs-name { color: var(--tk-fn); font-weight: 600; }

.foot { margin-top: 64px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* ---------- reference ---------- */
html[data-page="reference"] body { background: var(--surface); }
.redoc-wrap { min-height: calc(100vh - var(--top-h)); }
.ref-loading { padding: 80px 24px; text-align: center; color: var(--muted); }
.ref-note { padding: 10px 24px; font-size: 13.5px; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.nf { max-width: 640px; margin: 15vh auto; padding: 0 16px; text-align: center; }
.nf h1 { font-size: 64px; margin: 0; color: var(--brand); }

/* ---------- motion ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.4); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
.js .reveal { opacity: 0; transform: translateY(10px); transition: opacity .5s cubic-bezier(.2,.8,.2,1), transform .5s cubic-bezier(.2,.8,.2,1); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1080px) { .content { padding: 32px 36px 56px; } }
@media (max-width: 900px) {
  :root { --top-h: 56px; }
  .menu-btn { display: grid; }
  .top { padding: 0 16px; gap: 8px; }
  .top-nav { display: none; }
  .brand span { font-size: 14px; }
  .layout { display: block; }
  .side { position: fixed; z-index: 40; top: var(--top-h); left: 0; bottom: 0; height: auto; width: min(300px, 86vw); background: var(--surface);
    transform: translateX(-102%); transition: transform .3s cubic-bezier(.2,.8,.2,1); box-shadow: var(--shadow); padding: 20px 12px 40px 14px; }
  body.nav-open .side { transform: none; }
  .scrim { display: block; position: fixed; inset: var(--top-h) 0 0 0; z-index: 35; background: rgba(0,0,0,.35); opacity: 0; pointer-events: none; transition: opacity .3s; }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .content { padding: 24px 16px 48px; }
  .content h1 { font-size: 30px; }
  .content h2 { font-size: 21px; margin-top: 44px; }
  .cards { grid-template-columns: 1fr; }
  .anchor { display: none; }
  /* tables become stacked cards on phones */
  .table { border: 0; background: transparent; overflow: visible; }
  .table table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table thead { display: none; }
  .table tr { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 8px 12px; margin-bottom: 10px; }
  .table td { border: 0; padding: 4px 0; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; }
  .table td::before { content: attr(data-label); font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
  .table td:first-child { font-weight: 600; }
  td code { white-space: normal; word-break: break-word; }
}
@media (max-width: 420px) { .brand em { display: none; } .lang-btn { padding: 4px 9px; } }

/* ---------- breadcrumb (article pages) ---------- */
.crumb-bar { border-bottom: 1px solid var(--line); background: var(--surface); }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 8px 24px; font-size: 13.5px; color: var(--muted); }
.crumbs a { color: var(--muted); font-weight: 500; }
.crumbs a:hover { color: var(--brand); }
.crumbs .home-link { color: var(--brand); font-weight: 700; margin-right: 6px; padding: 2px 10px; border-radius: 99px; background: var(--brand-soft); transition: transform .2s; }
.crumbs .home-link:hover { text-decoration: none; transform: translateX(-2px); }
.crumbs .sep { opacity: .5; }
.crumbs [aria-current] { color: var(--text); font-weight: 600; }

/* ---------- home ---------- */
html[data-lang="zh"] .l-en { display: none; }
html:not([data-lang="zh"]) .l-zh { display: none; }
.home { max-width: 1040px; margin: 0 auto; padding: 56px 24px 64px; }
.hero { text-align: center; padding: 24px 0 36px; }
.hero h1 { font-size: 44px; letter-spacing: -1.2px; line-height: 1.1; margin: 0; font-weight: 800;
  background: linear-gradient(120deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: 17px; max-width: 620px; margin: 14px auto 26px; }
.search { display: flex; align-items: center; gap: 10px; max-width: 560px; margin: 0 auto; padding: 0 16px; height: 52px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); transition: border-color .2s, box-shadow .2s; }
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; }
.srch-ico { width: 18px; height: 18px; flex: none; border: 2px solid var(--muted); border-radius: 50%; position: relative; }
.srch-ico::after { content: ""; position: absolute; width: 7px; height: 2px; background: var(--muted); right: -6px; bottom: -3px; transform: rotate(45deg); border-radius: 2px; }
.cat { margin-top: 28px; }
.cat h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 700; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.cat-n { font-size: 11px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: 0 8px; letter-spacing: 0; }
.arts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 14px; }
.art { display: flex; flex-direction: column; padding: 20px 22px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s, border-color .25s; }
.art:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.art[hidden], .cat[hidden] { display: none; }
.art-top { display: flex; justify-content: space-between; align-items: center; }
.art-id { font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--muted); }
.art-ver { font-size: 11px; font-weight: 700; color: var(--brand); background: var(--brand-soft); padding: 1px 8px; border-radius: 99px; }
.art h3 { font-size: 19px; margin: 8px 0 0; letter-spacing: -.2px; line-height: 1.35; }
.art-sub { margin: 2px 0 0; color: var(--muted); font-size: 14px; font-weight: 600; }
.art-sum { color: var(--muted); font-size: 14.5px; margin: 10px 0 14px; flex: 1; }
.art-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--muted); }
.art-go { color: var(--brand); font-size: 18px; transition: transform .2s; }
.art:hover .art-go { transform: translateX(4px); }
.empty { text-align: center; color: var(--muted); margin: 40px 0; }
.home .foot { text-align: center; margin-top: 56px; }
@media (max-width: 900px) {
  .crumbs { padding: 8px 16px; font-size: 13px; }
  .home { padding: 32px 16px 48px; }
  .hero h1 { font-size: 34px; }
  .hero p { font-size: 15.5px; }
}
