:root {
  color-scheme: light;
  font-family: system-ui, "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: #f4f7fc;
  --line: #dbe4f0;
  --blue: #2058cf;
  --ink: #162741;
  --muted: #405472;
}

* { box-sizing: border-box; }
body { margin: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
[hidden] { display: none !important; }
a { color: var(--blue); text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.topbar { display: flex; align-items: center; gap: 14px; min-height: 66px; padding: 10px 22px 10px 16px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 750; color: inherit; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: #235bd4; color: white; font-size: 15px; }
.topbar-controls { position: relative; display: flex; align-items: center; gap: 10px; margin-inline-start: auto; font-size: 14px; }
.announcement-trigger { width:34px; height:34px; border:0; border-radius:9px; background:transparent; color:#245ed8; font-size:18px; cursor:pointer; }
.announcement-trigger:hover { background:#edf4ff; }
select, input { min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: inherit; }
.balance { padding: 8px 12px; background: #edf4ff; border-radius: 8px; font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
.wallet-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--line); }
.wallet-metric { display: grid; align-content: start; gap: 8px; padding: clamp(14px, 2vw, 24px); background: #fff; min-width: 0; }
.wallet-metric-label { display: flex; align-items: center; gap: 9px; font-weight: 650; }
.wallet-metric-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 9px; background: #e8f0ff; color: #2058cf; }
.wallet-metric-icon[data-tone="balance"] { background: #e1f5ee; color: #137150; }
.wallet-metric-icon[data-tone="requests"] { background: #efeaff; color: #6546a9; }
.wallet-metric strong { font-size: clamp(20px, 3vw, 29px); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.wallet-metric small { color: #526886; }
.wallet-panel { margin-top: 16px; border: 1px solid var(--line); background: #fff; border-radius: 14px; }
.wallet-panel-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 16px 20px; }
.wallet-panel-header h2, .wallet-redeem h3 { margin: 0; }
.wallet-history-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.wallet-panel-body { padding: clamp(12px, 2vw, 22px); border-top: 1px solid var(--line); }
.wallet-redeem { display: grid; gap: 10px; padding: clamp(12px, 2vw, 20px); border: 1px solid var(--line); background: #f7faff; border-radius: 10px; }
.wallet-redeem h3 { font-size: 16px; }
.wallet-redeem label { font-size: 14px; font-weight: 650; }
.wallet-redeem-entry { display: flex; gap: 8px; width: min(100%, 565px); }
.wallet-redeem-entry input { flex: 1; }
.wallet-redeem-entry button { flex: none; }
.wallet-redeem-state { margin: 0; }
.wallet-redeem-state:empty { display: none; }
.key-dialog.wallet-history-dialog { width: min(900px, calc(100vw - 28px)); }
.wallet-history-dialog table { min-width: 540px; }
.wallet-change[data-tone="positive"] { color: #137150; }
.wallet-change[data-tone="negative"] { color: #a51b32; }
@media (max-width: 550px) {
  .wallet-metrics { grid-template-columns: minmax(0, 1fr); }
  .wallet-metric { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .wallet-metric small { padding-inline-start: 41px; }
}
.menu-toggle { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; background: #f5f8fd; color: #3c526e; }
.menu-toggle:hover { background: #e6efff; color: var(--blue); }
.mobile-menu-toggle { display: none; }
.menu-arrow { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.menu-toggle[aria-expanded="false"] .menu-arrow { transform: scaleX(-1); }
.account-trigger, .account-menu-initial { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; flex: none; border-radius: 50%; font-weight: 750; }
.account-trigger { border: 0; background: var(--blue); color: #fff; box-shadow: 0 2px 6px #2058cf38; }
.account-trigger:hover { background: #174bb6; }
.account-menu-initial { background: #e8f0ff; color: var(--blue); }
.account-menu-panel { position: absolute; z-index: 10; inset: calc(100% + 12px) 0 auto auto; width: min(288px, calc(100vw - 24px)); max-height: min(420px, calc(100dvh - 118px)); overflow-y: auto; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 12px 35px #16315b26; }
.account-menu-profile { display: flex; gap: 10px; padding: 9px 8px 12px; margin-bottom: 5px; border-bottom: 1px solid var(--line); }
.account-menu-info { display: grid; align-content: start; min-width: 0; gap: 4px; overflow-wrap: anywhere; }
#account-menu-balance { color: var(--blue); font-size: 13px; }
#account-membership-expiry { color: #526886; }
.account-membership { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.account-membership button { padding: 2px 7px; background: #edf4ff; font-size: 12px; }
.account-menu-panel > a, .account-menu-panel > button { display: block; width: 100%; min-height: 36px; padding: 9px 10px; border: 0; border-radius: 7px; background: #fff; color: inherit; font: inherit; text-align: start; }
.account-menu-panel > :is(a, button):hover { background: #edf4ff; }
.account-menu-panel > .account-logout, #account-action-error { color: #a51b32; }
#account-action-status { margin-top: 0; }

.layout { display: grid; grid-template-columns: var(--sidebar-width, 160px) minmax(0, 1fr); flex: 1; min-height: 0; }
#navigation { display: flex; flex-direction: column; min-height: 0; background: #fbfcff; border-right: 1px solid var(--line); }
.nav-links { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 11px; }
.nav-footer { display: flex; justify-content: flex-end; flex: none; padding: 8px 11px 12px; }
.nav-group + .nav-group { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.nav-group h2 { font-size: 12px; font-weight: 650; color: #4c617d; margin: 4px 10px 6px; }
.nav-group a { position: relative; display: flex; align-items: center; gap: 11px; min-height: 40px; padding: 8px 11px; margin: 3px 0; font-size: 14px; color: inherit; border-radius: 8px; }
.nav-icon { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; opacity: .86; }
.nav-group a:hover { background: #f3f7fc; }
.nav-group a[aria-current="page"] { background: #e6efff; color: #174bb6; font-weight: 700; }
.nav-group a[aria-current="page"]::before { position: absolute; inset: 10px auto 10px 0; width: 3px; border-radius: 3px; background: #2563eb; content: ''; }
@media (min-width: 721px) {
  .sidebar-collapsed { --sidebar-width: 66px; }
  .sidebar-collapsed .nav-group h2, .sidebar-collapsed .nav-label { display: none; }
  .sidebar-collapsed .nav-group a { justify-content: center; padding: 8px 0; }
  .sidebar-collapsed .nav-footer { justify-content: center; }
}

main { min-width: 0; min-height: 0; overflow: auto; }
#workspace { display: block; width: 100%; height: 100%; border: 0; background: #f4f7fc; }
.panel { width: 100%; padding: clamp(16px, 4vw, 40px); }
.key-dialog.key-usage-dialog { width: min(980px, calc(100vw - 24px)); }
.key-usage-heading { margin: 0 0 8px; font-weight: 650; overflow-wrap: anywhere; }
.key-usage-summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 8px; }
.key-usage-link { padding: 0; border: 0; font-size: 13px; background: transparent; }
.key-usage-link:hover { text-decoration: underline; }
h1 { margin: 0 0 20px; font-size: 26px; }
.panel h2 { font-size: 17px; margin: 22px 0 12px; }
.account-overview-panel { max-width: 1440px; margin-inline: auto; }
.account-overview-panel h1 { margin-bottom: 19px; color: #132951; font-size: clamp(25px, 3vw, 34px); line-height: 1.2; }
.account-overview { display: grid; gap: 18px; }
.account-overview [hidden] { display: none; }
.overview-announcement { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 13px 10px 16px; border: 1px solid #d1e0fa; border-left: 3px solid #4780e8; border-radius: 11px; background: #edf4ff; }
.overview-announcement-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.overview-announcement-heading span, .overview-announcement-dialog-head > span { flex: none; padding: 3px 8px; border-radius: 5px; background: #dce9ff; color: #174caa; font-size: 12px; font-weight: 700; }
.overview-announcement-heading strong { overflow: hidden; color: #183260; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.overview-announcement button { flex: none; min-height: 34px; padding: 5px 10px; border: 1px solid #c4d8fb; background: #f7faff; color: #194eaa; font-size: 13px; font-weight: 650; }
.overview-announcement button:hover { background: #e2edff; }
.overview-announcement-dialog { width: min(540px, calc(100% - 32px)); padding: 0; overflow: hidden; border: 1px solid #d3dff0; border-radius: 19px; background: #fff; color: var(--ink); box-shadow: 0 24px 80px #102c554d; }
.overview-announcement-dialog::backdrop { background: #0e203d80; }
.overview-announcement-dialog-head { padding: 22px 25px 17px; border-bottom: 1px solid #e1ebf8; background: #f1f6ff; }
.overview-announcement-dialog h2 { margin: 9px 0 0; overflow-wrap: anywhere; font-size: 23px; }
.overview-announcement-body { max-height: min(48dvh, 460px); padding: 20px 25px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.75; }
.overview-announcement-dialog-actions { display: flex; justify-content: flex-end; padding: 12px 25px 18px; }
.overview-announcement-dialog-actions button { min-width: 86px; min-height: 38px; }
.overview-announcement-list { display:grid; gap:8px; margin:8px 0 14px; }
.overview-announcement-list button { width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:left; }
.announcement-center-body{max-height:min(65dvh,620px);overflow:auto;padding:20px 25px 12px}
.announcement-featured{padding:18px 20px;border:1px solid #dfebfb;border-radius:13px;background:#f6f9ff}
.announcement-kicker{color:#2863c8;font-size:12px;font-weight:700}
.announcement-featured h3{margin:8px 0 12px;font-size:18px;color:#18345e;overflow-wrap:anywhere}
.announcement-featured-body{color:#425773;line-height:1.8;white-space:pre-wrap;overflow-wrap:anywhere}
.announcement-history-title{margin:22px 0 4px;color:#334765;font-size:14px}
.overview-announcement-list button{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:11px 13px;border:1px solid #e5edf8;border-radius:9px;background:#fff;color:#344a68}
.overview-announcement-list button span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.overview-announcement-list button:hover{background:#f5f8ff;border-color:#c8dcfa}
.announcement-pagination{display:flex;justify-content:flex-end;align-items:center;gap:10px;color:#7b8ba3;font-size:13px}
.announcement-pagination button{padding:6px 10px;border:1px solid #dce6f5;border-radius:7px;background:#fff;color:#315d9e}
.announcement-pagination button:disabled{opacity:.45}
.overview-filters { display: grid; gap: 12px; padding: 10px 13px; border: 1px solid #dce6f4; border-radius: 13px; background: #fff; }
.overview-filter-row, .overview-dates { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.overview-filter-row { justify-content: space-between; }
.overview-range-buttons, .overview-segment { display: flex; flex-wrap: wrap; gap: 3px; padding: 3px; border: 1px solid #e3eaf6; border-radius: 10px; background: #f3f6fb; }
.overview-range-buttons button, .overview-segment button { min-height: 34px; padding: 5px 11px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #435776; font-size: 13px; white-space: nowrap; }
.overview-range-buttons button:hover, .overview-segment button:hover { background: #e8eef9; }
.overview-range-buttons button[aria-pressed='true'], .overview-segment button[aria-pressed='true'] { border-color: #d5e1f2; background: #fff; color: #174caa; box-shadow: 0 1px 2px #0d306411; font-weight: 700; }
.overview-dates { align-items: end; padding-top: 11px; border-top: 1px solid #e9eef7; }
.overview-dates label { display: grid; min-width: 0; gap: 5px; color: var(--muted); font-size: 13px; }
.overview-dates input { max-width: 100%; min-height: 38px; padding: 6px 9px; border: 1px solid #d1dff1; border-radius: 8px; background: #fff; color: var(--ink); font: inherit; }
.overview-dates button { min-height: 38px; background: #2058cf; color: #fff; font-size: 13px; }
.overview-dates > label > input { margin-inline-start: 0; }
.overview-period { margin: 0; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.overview-metrics, .overview-charts { display: grid; gap: 14px; }
.overview-metrics { grid-template-columns: repeat(auto-fit, minmax(min(100%, 166px), 1fr)); }
.overview-charts { grid-template-columns: minmax(0, 1fr); }
.overview-metric, .overview-chart { min-width: 0; margin: 0; padding: clamp(15px, 2vw, 23px); border: 1px solid #dee8f6; border-radius: 16px; background: #fff; box-shadow: 0 4px 18px #1d437a08; }
.overview-metric { border-top: 2px solid #cdddf6; }
.overview-metric-featured { border-color: #234d9d; background: radial-gradient(ellipse at 100% 0, #3562ad, transparent 75%), linear-gradient(115deg, #18396f, #214f9d); color: #fff; }
.account-overview .overview-metric h2, .account-overview .overview-chart h2 { margin: 0; }
.account-overview .overview-metric h2 { color: #4b6386; font-size: 13px; font-weight: 680; }
.account-overview .overview-metric-featured h2, .overview-metric-featured .overview-metric-value span, .overview-metric-featured .overview-metric-note { color: #e2ecff; }
.overview-metric-value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 11px 0 7px; }
.overview-metric-value strong { overflow-wrap: anywhere; font-size: clamp(24px, 3.6vw, 38px); line-height: 1.06; font-weight: 720; font-variant-numeric: tabular-nums; }
.overview-metric-value span, .overview-metric-note, .overview-chart-detail, .overview-status, .overview-empty { color: var(--muted); font-size: 13px; }
.overview-metric-note, .overview-status { margin: 0; }
.overview-chart-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.account-overview .overview-chart h2 { color: #183260; font-size: 17px; }
.overview-bucket-label { padding: 4px 8px; border-radius: 6px; background: #ecf3fe; color: #405c87; font-size: 12px; }
.overview-time-chart { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; margin: 20px 0 0; }
.overview-axis { display: flex; flex-direction: column; justify-content: space-between; padding-bottom: 23px; text-align: right; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.overview-axis span:only-child { margin-top: auto; }
.overview-plot { display: flex; min-width: 0; height: clamp(164px, 24vw, 228px); gap: clamp(1px, .4vw, 5px); background: repeating-linear-gradient(to bottom, #dce7f6 0 1px, transparent 1px 50%) top / 100% calc(100% - 23px) no-repeat; }
.overview-column { display: grid; flex: 1 1 0; min-width: 0; grid-template-rows: minmax(0, 1fr) 23px; text-align: center; }
.overview-column .overview-column-button { display: flex; align-items: flex-end; justify-content: center; min-width: 0; min-height: 0; padding: 0; border: 0; border-bottom: 1px solid #e1e9f6; border-radius: 0; background: transparent; box-shadow: none; }
.overview-column-button:hover, .overview-column-button:focus-visible { background: #f0f5ff; }
.overview-column-button span { width: min(76%, 48px); border-radius: 5px 5px 0 0; background: linear-gradient(180deg, #75a3f9, #3b72dc); }
.overview-column-button:hover span, .overview-column-button:focus-visible span { background: #275dbf; }
.overview-tick { padding-top: 5px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.overview-chart-detail { min-height: 34px; margin: 8px 0 0; padding: 7px 10px; border-radius: 8px; background: #f2f6fd; font-variant-numeric: tabular-nums; }
.overview-models { display: grid; gap: 13px; max-height: 330px; margin: 16px 0 0; padding: 0 4px 0 0; overflow: auto; list-style: none; scrollbar-width: thin; }
.overview-models li { padding: 9px 12px 10px; border: 1px solid #e6edf8; border-radius: 9px; background: #f8faff; }
.overview-model-label { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 5px; font-size: 13px; }
.overview-model-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overview-model-label strong { flex: none; font-variant-numeric: tabular-nums; }
.overview-model-track { height: 7px; overflow: hidden; border-radius: 4px; background: #e4ecfa; }
.overview-model-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4079df, #76a1f1); }
@media (max-width: 560px) {
  .account-overview { gap: 12px; }
  .overview-filters { padding: 9px; }
  .overview-range-buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .overview-range-buttons button { padding-inline: 5px; }
  .overview-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-dates button { grid-column: 1 / -1; }
  .overview-metrics { gap: 9px; }
  .overview-metric { grid-column: 1 / -1; }
  .overview-axis { font-size: 10px; }
}
.surface { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.surface p:first-child { margin-top: 0; }
.surface + .table-wrap, #view-content .surface + div { margin-top: 12px; }
fieldset { border: 1px solid var(--line); margin: 12px 0; border-radius: 8px; }
fieldset label { margin-inline-end: 12px; }
form > label > input { margin-inline-start: 8px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
th { color: #405472; background: #f8faff; font-weight: 650; }
tr:last-child td { border-bottom: 0; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.button, button { padding: 7px 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--blue); }
.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.error { color: #a12235; }
.muted { color: #405472; }
code, pre { font-family: ui-monospace, Consolas, monospace; }
pre { overflow: auto; padding: 14px; background: #eef3fa; border-radius: 8px; }

.key-toolbar, .key-address, .key-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.key-toolbar { justify-content: space-between; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.key-address code { padding: 5px 8px; border-radius: 5px; background: #edf4ff; overflow-wrap: anywhere; }
.key-filters { margin: 16px 0 12px; }
.key-filters input { flex: 1 1 180px; max-width: 290px; }
.key-table table { min-width: 1060px; }
.key-secret { display: flex; align-items: center; gap: 8px; min-width: 200px; }
.key-secret code { overflow-wrap: anywhere; user-select: all; }
.key-secret-controls { display: flex; gap: 4px; }
.key-icon-button { width: 28px; height: 28px; padding: 4px; display: grid; place-items: center; }
.key-icon-button:hover:not(:disabled) { background: #edf4ff; }
.key-icon-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.key-secret-message { margin: 0 0 8px; font-size: 14px; line-height: 1.55; }
.key-secret-value { display: block; width: 100%; min-height: 84px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; color: inherit; background: #f8faff; font: 14px/1.5 ui-monospace, Consolas, monospace; resize: vertical; overflow-wrap: anywhere; }
.key-verify-form { display: grid; gap: 12px; }
.key-cell small { display: block; margin-top: 4px; }
.key-state { display: inline-block; white-space: nowrap; padding: 4px 7px; border-radius: 5px; font-size: 12px; }
.key-active { background: #e4f5ee; color: #126846; }
.key-disabled, .key-expired { background: #fff1df; color: #875118; }
.key-revoked { background: #eff2f6; color: #536178; }
.key-row-actions { display: flex; flex-wrap: wrap; gap: 5px; min-width: 92px; }
.key-row-actions button { padding: 3px 6px; }
.key-dialog { width: min(620px, calc(100vw - 28px)); max-height: 88dvh; border: 1px solid var(--line); border-radius: 14px; padding: 0; box-shadow: 0 12px 42px #1228473d; color: inherit; }
.key-dialog::backdrop { background: #16274180; }
.key-editor { --gutter: clamp(14px, 4vw, 24px); display: flex; flex-direction: column; max-height: 88dvh; }
.key-editor-header, .key-editor-footer { display: flex; align-items: center; flex: none; padding: 14px var(--gutter); }
.key-editor-header { justify-content: space-between; border-bottom: 1px solid var(--line); }
.key-editor-header h2 { margin: 0; font-size: 19px; }
.key-editor-header .key-icon-button { font-size: 20px; line-height: 1; }
.key-editor-body { min-height: 0; padding: 16px var(--gutter); overflow-y: auto; }
.key-editor-section + .key-editor-section { margin-top: 20px; }
.key-editor-section h3 { margin: 0 0 12px; display: flex; align-items: center; gap: 10px; color: #405472; font-size: 13px; }
.key-editor-section h3::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.key-editor-footer { justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); }
.key-editor-error { margin: 12px 0 0; }
.key-editor-error:empty { display: none; }
.key-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.key-field { display: grid; align-content: start; gap: 5px; font-size: 14px; }
.key-expiry-fields { display: grid; align-content: start; gap: 8px; }
.key-field textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; resize: vertical; }
.key-editor fieldset { border-radius: 8px; }
.key-editor fieldset p { margin: 0 0 6px; font-size: 13px; }
.key-editor .key-quota { display: inline-flex; padding: 3px; margin: 0 0 12px; border: 0; background: #edf2f9; }
.key-quota label { margin: 0; position: relative; }
.key-quota input { position: absolute; opacity: 0; }
.key-quota span { display: block; padding: 6px 10px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.key-quota input:checked + span { color: var(--blue); background: #fff; box-shadow: 0 1px 4px #22365d22; }
.key-quota input:focus-visible + span { outline: 2px solid var(--blue); }
.key-quota input:disabled + span { cursor: default; }
.key-model-picker summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #405472; font-size: 14px; cursor: pointer; list-style: none; }
.key-model-picker summary::-webkit-details-marker { display: none; }
.key-model-picker summary::after { content: ''; flex: 0 0 7px; height: 7px; border-right: 1.5px solid; border-bottom: 1.5px solid; transform: rotate(45deg) translateY(-2px); margin-inline-end: 3px; }
.key-model-picker[open] summary::after { transform: rotate(225deg) translateY(-2px); }
.key-model-picker summary span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.key-model-panel { margin-top: 4px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.key-model-search { width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; font-size: 13px; }
.key-model-search:focus-visible { outline-offset: -2px; }
.key-model-list { max-height: min(230px, 32dvh); overflow: auto; padding: 4px; }
.key-model-option { display: flex; align-items: center; gap: 8px; margin: 0; padding: 5px 7px; border-radius: 5px; font-size: 13px; overflow-wrap: anywhere; cursor: pointer; }
.key-model-option:hover, .key-model-option:focus-within { background: #edf4ff; }
.key-model-option input { flex: none; margin: 0; }
.key-model-list .key-model-empty { margin: 0; padding: 8px 7px; }

.console-log { container-type: inline-size; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 8px 26px #243d6310; }
.usage-toolbar, .usage-toolbar-heading { display: flex; align-items: center; gap: 10px; }
.usage-toolbar { justify-content: space-between; flex-wrap: wrap; padding: 13px 18px; }
.usage-toolbar-heading { flex-wrap: wrap; }
.usage-toolbar-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #eaf1ff; color: #235bd4; }
.usage-toolbar h2 { margin: 0; font-size: 16px; }
.usage-count { padding: 4px 8px; border-radius: 6px; background: #eff3f9; color: #405472; font-size: 12px; white-space: nowrap; }
.usage-display { min-height: 112px; border-block: 1px solid var(--line); }
.log-table { max-height: min(720px, max(240px, calc(100dvh - 264px))); overflow: auto; border: 0; border-radius: 0; }
.log-table:focus-visible { outline-offset: -2px; }
.log-table table { table-layout: fixed; }
.log-table th { position: sticky; top: 0; z-index: 1; background: #edf3fb; box-shadow: inset 0 -1px var(--line); border: 0; font-size: 13px; }
.usage-table th, .usage-table td { padding: 10px 16px; }
.usage-table th:first-child { width: 18%; }
.usage-table th:nth-child(2) { width: 22%; }
.usage-table th:nth-child(3) { width: 12%; }
.usage-table th:nth-child(4), .usage-table th:nth-child(5) { width: 12%; text-align: right; }
.log-table tbody tr:nth-child(even) { background: #fbfcfe; }
.log-table tbody tr:hover, .log-table tbody tr:focus-within { background: #f2f6fe; }
.log-table time { color: #405472; font-size: 13px; font-variant-numeric: tabular-nums; }
.usage-model { display: grid; gap: 3px; }
.usage-model strong { font-weight: 650; }
.usage-model small { color: #526581; font-size: 12px; }
.usage-state { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 999px; background: #eef1f6; color: #465671; font-size: 12px; font-weight: 650; line-height: 1.2; white-space: nowrap; }
.usage-state::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.usage-state[data-tone="success"] { background: #e4f5ec; color: #126445; }
.usage-state[data-tone="error"] { background: #fcebf0; color: #a12235; }
.usage-state[data-tone="active"] { background: #e9f1ff; color: #2252ad; }
.usage-state[data-tone="pending"] { background: #fcf1d9; color: #80520a; }
.usage-credits { display: block; text-align: right; font-variant-numeric: tabular-nums; }
.usage-table td:nth-child(5) .usage-credits { font-weight: 650; }
.usage-mobile-label { display: none; }
.usage-request { display: flex; align-items: center; gap: 7px; }
.usage-request code { min-width: 0; overflow: hidden; color: #405472; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; user-select: all; }
.usage-request button { flex-shrink: 0; }
.console-log .actions { margin: 0; padding: 11px 18px; }
.console-log .actions span { margin-inline-end: auto; font-size: 13px; }
.usage-empty { margin: 0; padding: 40px 16px; text-align: center; }

@container (max-width: 660px) {
  .usage-table { max-height: none; }
  .usage-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .usage-table table, .usage-table tbody { display: block; }
  .usage-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 8px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .usage-table tbody tr:last-child { border-bottom: 0; }
  .usage-table td { padding: 0; border: 0; }
  .usage-table td:first-child { grid-row: 2; grid-column: 1 / -1; }
  .usage-table td:nth-child(2) { grid-row: 1; grid-column: 1; }
  .usage-table td:nth-child(3) { grid-row: 1; grid-column: 2; justify-self: end; }
  .usage-table td:last-child { grid-column: 1 / -1; }
  .usage-credits { display: flex; gap: 5px; align-items: baseline; text-align: left; }
  .usage-mobile-label { display: inline; color: #526581; font-size: 12px; font-weight: 400; }
  .usage-toolbar, .usage-log .actions { padding-inline: 14px; }
}

.task-table th, .task-table td { padding: 10px 12px; }
.task-table th:first-child { width: 182px; }
.task-table th:nth-child(2) { width: 54px; }
.task-table th:nth-child(3) { width: 18%; }
.task-table th:nth-child(4) { width: 14%; }
.task-table th:nth-child(5), .task-table th:nth-child(6) { width: 90px; }
.task-table th:nth-child(8), .task-table th:nth-child(9) { width: 72px; }
.task-times { display: grid; gap: 4px; }
.task-times > div { display: flex; align-items: baseline; gap: 5px; }
.task-times span { color: #526581; font-size: 12px; flex: none; }
.task-times time { white-space: nowrap; }
.task-table code { font-size: 13px; font-weight: 650; }
.task-source { display: inline-block; padding: 4px 7px; border-radius: 6px; background: #eef3f9; color: #405472; font-size: 12px; }
.task-source[data-source="api"] { background: #eaf1ff; color: #2252ad; }
.task-source[data-source="project"] { background: #eff4fb; color: #28456f; }
.task-elapsed { font-size: 13px; font-variant-numeric: tabular-nums; }
.task-result { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #405472; font-size: 13px; }
.task-table button, .task-download { display: inline-block; padding: 5px 9px; font-size: 13px; white-space: nowrap; }
.task-table button:hover, .task-download:hover { background: #edf4ff; }
.task-dialog { width: min(1080px, calc(100% - 24px)); max-height: 92dvh; padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: inherit; }
.task-dialog::backdrop { background: #17274180; }
.task-dialog > header { position: sticky; z-index: 1; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #fff; }
.task-dialog > header h2 { margin: 0; font-size: 18px; }
.task-dialog-body { padding: 16px 18px; }
.task-dialog-body > p:first-child { margin: 0; }
.task-dialog-body h3 { margin: 18px 0 7px; font-size: 14px; }
.task-preview { display: flex; align-items: center; justify-content: center; gap: 12px; min-width: 0; padding: 12px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 10px; background: #f5f8fc; }
.task-preview img, .task-preview video { display: block; max-width: 100%; max-height: min(52dvh, 520px); border-radius: 8px; object-fit: contain; }
.task-preview video { width: min(100%, 760px); min-height: 130px; background: #101828; }
.task-preview-original { display: block; max-width: 100%; cursor: zoom-in; }
.task-preview p { margin: 0; }
.task-detail-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; margin: 0; }
.task-detail-fields > div { min-width: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #f8faff; }
.task-detail-fields dt { font-size: 12px; color: #526581; }
.task-detail-fields dd { margin: 4px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.task-detail-text { margin: 0; padding: 11px; border: 1px solid var(--line); border-radius: 8px; background: #f8faff; font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }

@container (max-width: 920px) {
  .task-table { max-height: none; }
  .task-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .task-table table, .task-table tbody { display: block; }
  .task-table tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .task-table tbody tr:last-child { border-bottom: 0; }
  .task-table td { padding: 0; border: 0; }
  .task-table td:first-child { grid-row: 2; grid-column: 1 / -1; }
  .task-table td:nth-child(3) { grid-row: 1; grid-column: 1; }
  .task-table td:nth-child(5) { grid-row: 1; grid-column: 2; justify-self: end; }
  .task-table td:last-child { justify-self: end; }
  .task-elapsed::before { content: '耗时 '; color: #526581; }
}

.api-docs { width: 100%; padding: clamp(16px, 4vw, 40px); }
.docs-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.docs-sections { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; min-width: 0; }
.docs-sections .surface { padding: clamp(14px, 2vw, 24px); scroll-margin-top: 14px; }
.api-docs h2 { margin: 0 0 12px; font-size: 20px; }
.api-docs h3 { margin: 18px 0 8px; font-size: 16px; }
.api-docs p, .api-docs li { line-height: 1.65; }
.api-docs p { margin: 10px 0; }
.api-docs code { overflow-wrap: anywhere; }
.api-docs pre { margin: 8px 0 0; font-size: 13px; line-height: 1.55; }
.api-docs .table-wrap { margin-top: 10px; }
.api-docs .table-wrap:focus-visible, .api-docs pre:focus-visible { outline-offset: -2px; }
.api-docs ol { padding-inline-start: 22px; }
.docs-intro { margin-bottom: 18px; }
.docs-base { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: baseline; }
.docs-base code, .docs-method { background: #e9f1ff; color: #1948a2; padding: 3px 7px; border-radius: 5px; }
.docs-toc { display: flex; flex-wrap: wrap; gap: 5px; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.docs-toc a { padding: 6px 8px; border-radius: 5px; font-size: 13px; }
.docs-toc a:hover { background: #edf4ff; }
.docs-examples { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 425px), 1fr)); gap: 16px; }
.docs-examples > div { min-width: 0; }
.docs-endpoint { display: flex; flex-wrap: wrap; gap: 6px 9px; align-items: baseline; }
.docs-method { font: 650 12px ui-monospace, Consolas, monospace; }
.docs-method.post { color: #156752; background: #e6f6ef; }
@media (min-width: 1100px) {
  .docs-layout { grid-template-columns: 154px minmax(0, 1fr); }
  .docs-toc { position: sticky; top: 16px; display: grid; }
}

@media (max-width: 720px) {
  .topbar { padding: 8px 12px; flex-wrap: wrap; }
  .topbar-controls { margin-inline-start: auto; }
  .mobile-menu-toggle { display: grid; }
  .layout { position: relative; display: block; }
  main { height: 100%; }
  #navigation { display: none; position: absolute; inset: 0 auto 0 0; width: min(160px, 85vw); z-index: 2; box-shadow: 8px 0 22px #22365d29; }
  #navigation.open { display: flex; }
}
@media (max-width: 440px) {
  .topbar { gap: 8px; }
  .topbar-controls { gap: 6px; }
  .balance { padding-inline: 7px; }
  .key-fields { grid-template-columns: minmax(0, 1fr); }
}
