:root {
  color-scheme: light;
  --ink: #152925;
  --muted: #4f6660;
  --line: #d9e4df;
  --paper: #f4f7f5;
  --accent: #08654f;
  font: 16px/1.55 Inter, "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body, h1, h2, h3, p, ul, pre { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, .button { cursor: pointer; }
button, .button {
  display: inline-flex; justify-content: center; align-items: center; gap: .6rem;
  border: 1px solid transparent; border-radius: 8px; padding: .56rem .9rem;
  background: var(--accent); color: white; font-weight: 650; white-space: nowrap;
}
button:hover, .button:hover { filter: brightness(.91); }
button:disabled { opacity: .6; cursor: wait; }
:focus-visible { outline: 3px solid #59bd9f; outline-offset: 3px; }
.secondary { background: white; color: var(--ink); border-color: var(--line); }
.quiet-danger { background: white; color: #a12b29; border-color: #ead0ce; }
.wrap { width: min(1152px, calc(100% - 3rem)); margin-inline: auto; }
.top { background: white; border-bottom: 1px solid var(--line); }
.bar, nav, .brand, .section-head, .code-head, .footer { display: flex; align-items: center; }
.bar, .section-head, .code-head, .footer { justify-content: space-between; gap: 1rem; }
.bar { min-height: 68px; }
nav { gap: 1.25rem; flex-wrap: wrap; }
.brand { gap: .65rem; font-weight: 800; letter-spacing: -.035em; font-size: 1.14rem; }
.mark { display: grid; place-items: center; color: white; background: var(--accent); border-radius: 10px; width: 2.25rem; height: 2.25rem; }
.hero { display: grid; grid-template-columns: 1fr 1.04fr; align-items: center; gap: clamp(1.6rem, 6vw, 5rem); padding: 4.8rem 0 2.6rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .65rem; }
.eyebrow { color: var(--accent); font-size: .84rem; letter-spacing: .07em; font-weight: 800; }
.dot { display: inline-block; width: .55rem; height: .55rem; background: #2d9e7e; border-radius: 50%; margin-right: .3rem; }
h1 { font-size: clamp(2.15rem, 5.1vw, 4.4rem); line-height: 1.12; letter-spacing: -.06em; margin-top: .65rem; }
h2 { font-size: 1.52rem; letter-spacing: -.035em; }
h3 { font-size: 1rem; overflow-wrap: anywhere; }
.lead { max-width: 34rem; margin: 1.15rem 0 1.5rem; font-size: 1.06rem; }
.lead, .section-head p, .muted, .footer { color: var(--muted); }
.endpoint, pre { background: #17372f; color: #edf8f5; }
.endpoint { background: linear-gradient(150deg, #173d34, #142f29); border-radius: 18px; padding: clamp(1.15rem, 3vw, 1.8rem); min-width: 0; box-shadow: 0 16px 38px #173d3420; }
.endpoint .eyebrow { color: #9fe0cc; margin-bottom: .55rem; }
.endpoint-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; margin-bottom: .4rem; }
.endpoint-heading p { padding-top: .3rem; }
.endpoint-heading button { background: #ffffff14; border-color: #ffffff33; color: #effaf3; padding: .27rem .55rem; font-size: .77rem; }
code { font-family: "IBM Plex Mono", Consolas, monospace; }
#base-url { font-size: clamp(.85rem, 2vw, 1.2rem); overflow-wrap: anywhere; }
.endpoint ul { list-style: none; padding: 0; margin-top: 1.2rem; }
.endpoint li { display: flex; gap: .75rem; align-items: center; padding: .55rem .1rem; border-top: 1px solid #ffffff25; }
.endpoint b { width: 2.7rem; color: #9fe0cc; font-size: .72rem; }
.section { margin: 2.5rem 0; scroll-margin-top: 1rem; }
.section-head { margin-bottom: 1rem; align-items: flex-end; }
.grid { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.panel { background: white; border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.model-card, .form-panel { padding: 1.15rem; }
.model-card { box-shadow: 0 2px 7px #173d3408; }
.model-card h3 { font-size: 1.05rem; margin-bottom: .45rem; }
.pill { display: inline-block; color: #185544; background: #e7f3ed; border-radius: 20px; font-size: .78rem; padding: .19rem .5rem; margin: .2rem .3rem .2rem 0; overflow-wrap: anywhere; }
.pill.off { color: #6a4d26; background: #fff1d8; }
.tabs, .actions { display: flex; gap: .45rem; flex-wrap: wrap; }
.tabs { padding: .75rem; border-bottom: 1px solid var(--line); }
.tabs button { background: transparent; color: var(--muted); }
.tabs button[aria-pressed="true"] { background: #e3f1eb; color: var(--accent); }
.code-head { padding: .5rem 1rem; }
.code-head button { font-size: .82rem; padding: .24rem .55rem; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; padding: 1rem; border-radius: 0 0 11px 11px; }
.footer { border-top: 1px solid var(--line); padding: 1.3rem 0 2rem; font-size: .9rem; }
.console { padding: 2.5rem 0; }
.console h1 { font-size: clamp(2rem, 4vw, 3.2rem); margin: .25rem 0 .65rem; }
.login { max-width: 430px; margin: 2rem auto; }
.form-panel { margin-top: .75rem; }
form label { display: grid; gap: .3rem; margin-bottom: .85rem; font-weight: 650; }
input, select { width: 100%; padding: .58rem .65rem; background: #fff; border: 1px solid #becfca; border-radius: 7px; color: var(--ink); }
select[multiple] { min-height: 6rem; }
.status { min-height: 1.6rem; margin: .75rem 0; color: var(--accent); overflow-wrap: anywhere; }
.status[data-error="true"] { color: #a12b29; }
.metric { padding: .85rem 1rem; }
.metric strong { display: block; font-size: 1.75rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .9rem; }
th, td { padding: .75rem; vertical-align: top; border-bottom: 1px solid var(--line); }
th { color: var(--muted); background: #f4f8f6; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td code { overflow-wrap: anywhere; }
td button { font-size: .82rem; padding: .4rem .6rem; }
details { margin-top: .6rem; }
summary { cursor: pointer; color: var(--accent); }
details pre { background: #eef5f2; color: var(--ink); margin-top: .45rem; border-radius: 8px; }
[hidden] { display: none !important; }
.admin-shell { display: grid; grid-template-columns: 218px minmax(0, 1fr); min-height: 100vh; }
.admin-sidebar { background: #fff; border-right: 1px solid var(--line); padding: 1.35rem .95rem; display: flex; flex-direction: column; gap: 1.15rem; position: sticky; top: 0; height: 100dvh; overflow-y: auto; }
.sidebar-heading { display: flex; flex-direction: column; align-items: flex-start; gap: .65rem; padding: 0 .55rem; }
.admin-sidebar nav { display: grid; align-items: stretch; gap: 1rem; }
.nav-group { display: grid; gap: .16rem; }
.nav-group p { font-size: .74rem; color: var(--muted); padding: .25rem .7rem; font-weight: 650; }
.admin-sidebar nav a, .admin-sidebar-bottom a, .admin-sidebar-bottom button { padding: .53rem .7rem; border-radius: 8px; font-size: .88rem; white-space: nowrap; }
.admin-sidebar nav a:hover, .admin-sidebar-bottom a:hover { background: var(--paper); }
.admin-sidebar nav a[aria-current="page"] { background: #e3f1e9; color: #075943; font-weight: 750; }
.admin-sidebar-bottom { display: flex; flex-direction: column; align-items: flex-start; margin-top: auto; border-top: 1px solid var(--line); padding-top: .65rem; }
.admin-sidebar-bottom button { background: transparent; font-weight: 500; color: var(--muted); }
.admin-main { width: min(100%, 1620px); min-width: 0; margin-inline: auto; padding: 2.25rem clamp(1.1rem, 3.2vw, 3.15rem); }
.admin-header, .admin-tools, .admin-toolbar, .node-title, .account-top {
  display: flex; justify-content: space-between; align-items: center; gap: .8rem;
}
.admin-header { align-items: flex-start; margin-bottom: 1.35rem; }
.admin h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.65rem); letter-spacing: -.045em; }
.admin-header p, .login-card > p { margin-top: .4rem; }
.admin-tools { flex-wrap: wrap; justify-content: flex-end; }
.admin #metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .68rem; }
.admin .metric { padding: .9rem 1rem; box-shadow: 0 2px 7px #173d3408; }
.admin .metric span { font-size: .8rem; }
.admin .metric strong { font-size: clamp(1.35rem, 2.4vw, 1.85rem); font-variant-numeric: tabular-nums; color: #174b3d; }
.admin #status:empty { min-height: 0; margin: .6rem 0; }
.admin-toolbar { padding: .8rem; flex-wrap: wrap; }
.admin-toolbar input { flex: 1 1 175px; width: auto; min-width: 0; }
.admin-toolbar select { width: auto; max-width: 100%; }
.admin-toolbar .muted { margin-right: auto; }
.node-group { margin-top: 1rem; }
.node-title { padding: .86rem 1rem; border-bottom: 1px solid var(--line); background: #f7faf8; border-radius: 11px 11px 0 0; }
.node-title h2 { font-size: 1.05rem; overflow-wrap: anywhere; }
.account-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; align-items: center; gap: .75rem; padding: .85rem 1rem; border-bottom: 1px solid var(--line); }
.account-row:last-child { border-bottom: 0; border-radius: 0 0 11px 11px; }
.account-row:hover { background: #fafcfb; }
.account-row code { color: var(--muted); font-size: .77rem; }
.account-top { justify-content: flex-start; flex-wrap: wrap; }
.account-row code, .admin td { overflow-wrap: anywhere; }
.account-row small { display: block; }
.admin .actions button { font-size: .84rem; }
.admin #content { min-width: 0; }
.admin #content h2 { font-size: 1.13rem; margin-block: .9rem .55rem; }
.admin #content .node-title h2 { margin: 0; }
.admin .table-wrap { margin-block: .6rem .95rem; max-width: 100%; }
.admin table { font-size: .84rem; }
.admin th { background: #f0f6f2; font-size: .79rem; font-weight: 750; }
.admin td, .admin th { padding: .65rem .85rem; }
.admin tr:hover td { background: #f9fcfa; }
.admin td code { font-size: .78rem; }
.cell-stack { display: grid; gap: .17rem; min-width: 0; }
.cell-stack small { font-size: .76rem; }
.id-copy { width: fit-content; padding: .16rem .36rem; background: #f0f5f2; color: #245749; font: .72rem/1.4 "IBM Plex Mono", Consolas, monospace; }
.request-state { width: fit-content; margin: 0; }
.request-data { margin: 0; }
.request-data pre { max-width: 22rem; max-height: 12rem; overflow: auto; font-size: .75rem; }
.usage-page { max-width: 900px; padding: clamp(1.4rem, 5vw, 3.4rem) 0 3rem; }
.usage-page h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
.usage-form { display: flex; align-items: flex-end; flex-wrap: wrap; gap: .7rem; }
.usage-form label { flex: 1 1 16rem; margin: 0; }
.usage-metrics { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.usage-page h2 { margin: .85rem 0 .45rem; }
.usage-page .table-wrap { margin-top: .65rem; }
.usage-facts { display: grid; grid-template-columns: minmax(7rem, auto) 1fr; gap: .45rem 1rem; margin: .7rem 0 0; }
.usage-facts dt { color: var(--muted); }
.usage-facts dd { margin: 0; overflow-wrap: anywhere; }
.admin #content .panel + .panel, .admin .admin-toolbar + div { margin-top: .75rem; }
.admin .primary { background: var(--accent); }
.admin .request-pager { margin-top: .75rem; }
.admin dialog .quiet-danger { margin-top: .8rem; }
.account-detail { display: grid; gap: .8rem; }
.account-back { color: var(--accent); justify-self: start; }
.account-card > details { padding: 0 1rem 1rem; }
.account-summary { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .85rem 1rem; }
.account-detail .actions { min-width: 7rem; }
.credit-usage > h2 { margin-top: 1rem; }
.credit-usage > p { margin: .3rem 0 .65rem; }
.credit-metrics { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); margin-bottom: .8rem; }
.credit-accounts { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); align-items: start; }
.credit-account { padding: .9rem 1rem; }
.credit-account-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .4rem; }
.credit-account-heading a { font-weight: 750; }
.credit-account small { display: block; }
.credit-amount { display: block; margin-top: .45rem; font-size: 1.44rem; color: var(--accent); }
.credit-account .usage-facts { font-size: .85rem; }
.credit-details { border-top: 1px solid var(--line); margin-top: .75rem; padding-top: .65rem; }
.credit-details button { width: 100%; }
.admin dialog:has(.credit-dialog) { width: min(1040px, calc(100% - 1.5rem)); }
.credit-dialog-facts { padding: .8rem 1rem; border-radius: 10px; background: var(--paper); margin-bottom: .9rem; }
.admin .account-detail > .panel + .panel { margin-top: 0; }
.admin .empty { padding: 2rem 1rem; text-align: center; }
.admin .pill.offline { color: #584f51; background: #ede7e9; }
.admin .pill.error { color: #942928; background: #fae5e5; }
.admin dialog { width: min(580px, calc(100% - 1.5rem)); max-height: calc(100dvh - 2rem); border: 1px solid var(--line); border-radius: 15px; padding: 1.35rem; color: var(--ink); box-shadow: 0 20px 80px #14282d35; }
.admin dialog::backdrop { background: #12282e90; }
.admin dialog header { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.admin dialog .form-panel { padding: 0; }
.admin dialog .status:empty { display: none; }
.admin fieldset { padding: .6rem .75rem; margin: 0 0 .85rem; border: 1px solid var(--line); border-radius: 8px; }
.admin fieldset label { display: flex; align-items: center; gap: .5rem; margin: .24rem 0; font-weight: 400; }
.admin fieldset input { width: auto; accent-color: var(--accent); }
.node-facts { display: grid; grid-template-columns: minmax(5rem, auto) minmax(0, 1fr); gap: .5rem 1rem; margin: 1rem 0; }
.node-facts dt { color: var(--muted); }
.node-facts dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.admin-login { min-height: 100dvh; display: grid; place-items: center; padding: 1rem; background: radial-gradient(ellipse at top, #dceee4, var(--paper) 64%); }
.login-card { width: min(100%, 440px); background: white; border: 1px solid var(--line); border-radius: 18px; padding: clamp(1.3rem, 5vw, 2.4rem); box-shadow: 0 16px 48px #173d341c; }
.login-card .brand { margin-bottom: 1.65rem; }
.login-card form { margin-top: 1.2rem; }
.login-card button { width: 100%; }
.admin .issued { padding: 1rem; border: 1px solid #a8d1c1; border-radius: 10px; background: #eaf6ef; }
.admin .issued code { display: block; margin: .65rem 0; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: minmax(0, 1fr); }
  .admin-sidebar { height: auto; padding: .65rem .75rem .35rem; gap: .35rem; z-index: 2; border: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .sidebar-heading { flex-direction: row; align-items: center; padding: 0; }
  .admin-sidebar nav { display: flex; flex-wrap: nowrap; gap: .2rem; overflow-x: auto; padding: .3rem 0; }
  .nav-group { display: flex; flex-shrink: 0; gap: .16rem; }
  .nav-group p { display: none; }
  .admin-sidebar nav a { padding: .45rem .6rem; }
  .admin-sidebar-bottom { flex-direction: row; border: 0; position: absolute; top: .52rem; right: .65rem; padding: 0; align-items: center; }
  .admin-sidebar-bottom a, .admin-sidebar-bottom button { padding: .38rem .45rem; font-size: .77rem; }
}
@media (max-width: 600px) {
  .admin #metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin #metrics .metric:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .account-row { grid-template-columns: minmax(0, 1fr); }
  .admin-main { padding: 1.2rem .85rem; }
  .admin-tools small { display: none; }
  .admin-sidebar-bottom a { display: none; }
  .admin-sidebar nav { flex-wrap: wrap; overflow: visible; }
  .nav-group { display: contents; }
  .admin-sidebar nav a { font-size: .78rem; padding: .39rem .54rem; }
  .request-list { display: grid; }
  .request-results { order: 1; }
  .admin .table-wrap table, .admin .table-wrap tbody, .admin .table-wrap tr { display: block; }
  .admin .table-wrap thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .admin .table-wrap tbody tr { border-bottom: 1px solid var(--line); padding: .45rem .75rem; }
  .admin .table-wrap tbody tr:last-child { border-bottom: 0; }
  .admin .table-wrap td { display: grid; grid-template-columns: minmax(5.25rem, 30%) minmax(0, 1fr); gap: .5rem; align-items: start; border: 0; padding: .36rem 0; }
  .admin .table-wrap td::before { content: attr(data-label); color: var(--muted); font-size: .72rem; font-weight: 650; }
}
@media (max-width: 700px) {
  .wrap { width: calc(100% - 1.6rem); }
  .hero { grid-template-columns: 1fr; padding: 2.5rem 0 1rem; gap: 1.5rem; }
  nav { gap: .55rem; }
  nav a { font-size: .85rem; }
  .top nav a[href^="#"] { display: none; }
  .section-head { align-items: flex-start; }
  th, td { min-width: 90px; }
}
