:root {
  color-scheme: light; font-family: Arial, "Microsoft YaHei", sans-serif; font-synthesis: none;
  --ink: #16191c; --text: #303539; --muted: #8b9296; --faint: #92979a; --line: #e3e4e6; --control: #dedfe2; --hover: #f5f7f8; --surface: #fafbfc;
  --accent: #285d7a; --accent-soft: #edf3f6; --focus: #2c6481;
  --success: #3f8a78; --success-soft: #eaf2f0; --warning: #b07714; --warning-soft: #fbf3e2; --danger: #c22534; --danger-soft: #fbecee;
  --neutral: #6f7478; --neutral-soft: #f1f2f3; --disabled: #8a7272; --disabled-soft: #f4eded;
  --mono: Consolas, "Microsoft YaHei", monospace;
  color: var(--ink); background: #fff;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: #fff; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button { color: #44494e; background: white; border: 1px solid var(--control); border-radius: 4px; padding: 8px 12px; transition: background .15s, border-color .15s, color .15s; }
button:hover { background: var(--hover); border-color: #b6bcc2; }
button:disabled { opacity: .4; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
#accounts:focus, #bulk-bar:focus { outline: none; } /* Programmatic focus targets only, never reached by Tab. */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.page { padding: 0 20px 26px 54px; max-width: 2000px; margin: 0 auto; }
.login-screen { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: var(--surface); }
.login-card { width: 100%; max-width: 390px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 32px; box-shadow: 0 8px 35px #19252d06; }
.login-icon { width: 48px; height: 48px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); border-radius: 12px; margin-bottom: 23px; }
.login-card h1 { font-size: 22px; margin: 0 0 10px; font-weight: 600; }
.login-description { margin: 0 0 28px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.login-label { display: block; font-size: 12px; color: #646c72; margin-bottom: 9px; }
.password-field { display: flex; border: 1px solid var(--control); border-radius: 5px; }
.password-field:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.password-field input { min-width: 0; flex: 1; font-size: 14px; padding: 13px 12px; border: 0; background: transparent; outline: none; }
.password-field button { border: 0; background: transparent; font-size: 12px; color: #818a91; }
.login-error { font-size: 12px; color: #bc3444; min-height: 18px; margin: 10px 0; }
.login-submit, button.primary { width: 100%; padding: 12px; background: #161b1f; color: #fff; border-color: #161b1f; }
.login-submit:hover, button.primary:hover { background: #303a42; border-color: #303a42; }
.footer-session { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.footer-session button { font-size: 12px; }
/* Tones shared by badges, dots and bars. */
.tone-success { color: var(--success); background: var(--success-soft); }
.tone-warning { color: var(--warning); background: var(--warning-soft); }
.tone-danger { color: var(--danger); background: var(--danger-soft); }
.tone-neutral { color: var(--neutral); background: var(--neutral-soft); }
.tone-muted { color: var(--disabled); background: var(--disabled-soft); }
.tone-info { color: var(--accent); background: var(--accent-soft); }
.tone-text-success { color: var(--success); } .tone-text-warning { color: var(--warning); } .tone-text-danger { color: var(--danger); } .tone-text-muted { color: var(--muted); }
.tone-bar-success { background: var(--success); } .tone-bar-warning { background: var(--warning); } .tone-bar-danger { background: var(--danger); }
.dot-available { background: #4f9c88; } .dot-quota { background: #d29a2e; } .dot-rate { background: #e0b84c; } .dot-overload { background: #d24b57; }
.dot-temp { background: #8e7cc3; } .dot-error { background: #a3202d; } .dot-paused { background: #a9aeb2; } .dot-disabled { background: #d7cfcf; }
.pool-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 22px 0 16px; }
.pool-title { display: flex; align-items: center; gap: 10px; }
.pool-title h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.3px; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.auto-refresh { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #757b7e; }
.auto-refresh select { height: 34px; padding: 0 8px; border: 1px solid var(--control); border-radius: 4px; color: var(--text); background: #fff; font-size: 12px; }
.header-actions #refresh { font-size: 12px; padding: 7px 14px; }
.overview { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)) minmax(360px, 2fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.metric { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 14px 16px 15px; background: #fff; }
.metric-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.metric-label { font-size: 11px; color: #757b7e; }
.metric-value { font-size: 24px; font-weight: 700; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.metric-hint { font-size: 11px; color: var(--faint); line-height: 1.4; }
.pool-bar { display: flex; gap: 2px; height: 6px; margin: 4px 0 10px; border-radius: 3px; overflow: hidden; background: var(--neutral-soft); }
.pool-bar .seg { min-width: 3px; }
.status-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.status-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; font-size: 11px; border-radius: 999px; color: #555b60; }
.status-chip .dot { width: 7px; height: 7px; border-radius: 50%; }
.status-chip[aria-pressed="true"] { color: #fff; background: #15191c; border-color: #15191c; }
.chip-count { font: 700 11px var(--mono); font-variant-numeric: tabular-nums; }
.toolbar { display: flex; align-items: flex-end; gap: 10px; margin-top: 14px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px 13px; }
.field { display: flex; flex-direction: column; gap: 7px; font-size: 11px; color: #757b7e; min-width: 0; }
.field input, .field select { height: 38px; width: 100%; padding: 0 11px; border: 1px solid var(--control); border-radius: 4px; color: var(--text); background-color: #fff; font-size: 14px; }
.field input::placeholder { color: #969b9e; }
.search-field { width: 190px; }
.status-field { width: 150px; }
.group-field { width: 125px; }
.sort-field { width: 175px; }
.page-size { width: 86px; }
.reset-field { width: 118px; }
.toolbar-actions { display: flex; margin-left: auto; align-items: center; gap: 10px; padding-bottom: 7px; white-space: nowrap; }
.result-count { color: #8b9094; font: 11px Consolas, monospace; margin-right: 1px; }
.toolbar-actions button { font-size: 12px; padding: 7px 11px; }
.view-toggle { display: flex; }
.view-toggle button:first-child { border-radius: 4px 0 0 4px; }
.view-toggle button:last-child { border-radius: 0 4px 4px 0; border-left: 0; }
.view-toggle .active { background: #15191c; color: #fff; border-color: #15191c; }
.columns-menu { position: relative; }
.columns-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; display: grid; gap: 2px; min-width: 150px; margin: 0; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px #19252d14; }
.columns-panel legend { float: left; width: 100%; padding: 2px 6px 6px; font-size: 11px; color: var(--muted); }
.columns-panel label { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 4px; font-size: 13px; color: var(--text); cursor: pointer; }
.columns-panel label:hover { background: var(--hover); }
.bulk-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; min-height: 44px; margin-top: 14px; padding: 6px 12px; border-radius: 8px; background: var(--surface); border: 1px dashed var(--line); font-size: 12px; color: var(--muted); }
.bulk-bar.active { position: sticky; top: 8px; z-index: 20; color: var(--ink); background: var(--accent-soft); border: 1px solid #cfdfe7; box-shadow: 0 6px 20px #19252d10; }
.bulk-info, .bulk-actions { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; }
.bulk-count { font-weight: 700; }
.bulk-bar:not(.active) .bulk-count { font-weight: 400; }
.link-button { padding: 2px 0; border: 0; background: none; color: var(--accent); font-size: 12px; }
.link-button:hover { background: none; text-decoration: underline; }
.bulk-actions { gap: 6px; }
.bulk-actions button { font-size: 12px; padding: 6px 10px; }
button.danger { color: var(--danger); }
button.danger:hover { background: var(--danger-soft); border-color: #e6b6bc; }
.accounts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.account-card { border: 1px solid var(--line); border-radius: 13px; padding: 15px 15px 15px; min-width: 0; box-shadow: 0 0 0 1px #f7f7f8; transition: border-color .15s, box-shadow .15s; }
.account-card:hover { border-color: #cfd3d6; }
.account-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.account-heading { display: flex; gap: 10px; align-items: flex-start; }
.avatar { position: relative; display: grid; place-items: center; flex: 0 0 33px; height: 33px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 16px; cursor: pointer; }
.state-disabled .avatar { background: var(--neutral-soft); color: #9a9fa3; }
.avatar input, .row-check input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.row-check { position: relative; display: inline-grid; place-items: center; width: 18px; height: 18px; border: 1.5px solid #b9bfc4; border-radius: 4px; background: #fff; }
.row-check:has(input:checked) { background: var(--accent); border-color: var(--accent); }
.row-check:has(input:checked)::after { content: ""; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.row-check:has(input:focus-visible), .avatar:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.avatar-check { display: none; }
.avatar:hover .avatar-letter, .avatar:has(input:focus-visible) .avatar-letter, .avatar:has(input:checked) .avatar-letter { display: none; }
.avatar:hover .avatar-check, .avatar:has(input:focus-visible) .avatar-check, .avatar:has(input:checked) .avatar-check { display: block; }
.avatar:hover { opacity: .75; }
.avatar:has(input:checked) { background: var(--accent); color: #fff; opacity: 1; }
.identity { min-width: 0; flex: 1; }
.identity-line { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; min-height: 25px; }
.email { font-size: 17px; font-weight: 700; letter-spacing: -.35px; overflow-wrap: anywhere; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 3px; font-size: 11px; line-height: 1; white-space: nowrap; }
.badge[title] { cursor: help; }
.badge-countdown { font: 10px var(--mono); opacity: .8; }
.last-used { font-size: 12px; color: var(--muted); margin-top: 2px; }
.added { font: 11px var(--mono); color: var(--faint); margin-top: 4px; }
.icon-button { display: grid; place-items: center; flex: 0 0 auto; width: 30px; height: 30px; padding: 0; border-color: transparent; background: transparent; color: #7c8388; border-radius: 6px; }
.icon-button:hover, .icon-button[aria-expanded="true"] { background: var(--hover); border-color: var(--line); color: var(--ink); }
.meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 0 0 43px; }
.chip { display: inline-flex; align-items: center; padding: 3px 7px; border-radius: 4px; font-size: 11px; line-height: 1.2; color: #5e6468; background: var(--neutral-soft); white-space: nowrap; }
.chip-plan { color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.chip-proxy { font-family: var(--mono); }
.chip-empty { color: var(--faint); background: transparent; border: 1px dashed var(--control); }
.chip[title] { cursor: help; }
.capacity-list { display: inline-flex; gap: 5px; margin-left: auto; }
.capacity { padding: 3px 6px; border-radius: 4px; font: 10px var(--mono); white-space: nowrap; cursor: help; }
.cap-idle { color: #7d8387; background: var(--neutral-soft); }
.cap-busy { color: var(--success); background: var(--success-soft); }
.cap-warning { color: var(--warning); background: var(--warning-soft); }
.cap-danger { color: var(--danger); background: var(--danger-soft); }
.quota-area { margin-top: 14px; }
.quota-info { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 17px; margin-bottom: 5px; }
.quota-label { color: var(--faint); font-size: 12px; white-space: nowrap; }
.reset-time { font: 10px var(--mono); margin-left: 5px; }
.percentage { font-size: 12px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.track { height: 3px; width: 100%; background: #f2f3f4; border-radius: 2px; overflow: hidden; }
.fill { height: 100%; width: var(--used); background: var(--bar-color); border-radius: 2px; }
.secondary-quotas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 10px; }
.secondary-quotas .quota-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin-top: 15px; padding-top: 11px; border-top: 1px solid #f0f1f2; font: 12px Consolas, monospace; color: #757d80; }
.card-usage { display: inline-flex; flex-wrap: wrap; gap: 4px 9px; font-size: 11px; color: var(--faint); }
.card-usage span, .today-stack span { cursor: help; }
.cost { color: var(--success); font-weight: 700; }
.footer-controls, .online { display: inline-flex; align-items: center; gap: 8px; }
.footer-controls { gap: 12px; margin-left: auto; }
.online { cursor: help; }
.provider { color: #9b9fa2; }
.online-dot { width: 7px; height: 7px; border-radius: 50%; }
.switch { position: relative; flex: 0 0 auto; width: 34px; height: 20px; padding: 0; border: 0; border-radius: 999px; background: #d5d9dc; }
.switch:hover { background: #c3c8cc; border: 0; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]:hover { background: #1f4b63; }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px #0003; transition: transform .18s; }
.switch[aria-checked="true"] .switch-thumb { transform: translateX(14px); }
.switch:disabled { opacity: .45; }
.accounts.list { display: block; }
.table-scroll { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.account-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.account-table th { padding: 10px 12px; text-align: left; font-size: 11px; font-weight: 400; color: #757b7e; background: var(--surface); border-bottom: 1px solid var(--line); white-space: nowrap; }
.account-table td { padding: 11px 12px; vertical-align: middle; border-bottom: 1px solid #f0f1f2; }
.account-table tbody tr:last-child td { border-bottom: 0; }
.account-row:hover td { background: #fbfcfc; }
.account-row.selected td { background: #f3f8fa; }
.col-select { width: 40px; padding-right: 0 !important; }
.col-actions { width: 46px; text-align: right; }
.col-account .email { font-size: 14px; }
.row-sub { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 3px; }
.row-sub .last-used, .row-sub .added { margin: 0; }
.cell-note { margin-top: 4px; font: 10px var(--mono); color: var(--faint); white-space: nowrap; }
.chip-list { display: flex; flex-wrap: wrap; gap: 4px; max-width: 220px; }
.capacity-list.stacked { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; margin: 0; }
.today-stack { display: grid; gap: 2px; font: 11px var(--mono); color: #6b7175; white-space: nowrap; }
.mini-quota { display: grid; grid-template-columns: 46px 40px 34px auto; align-items: center; gap: 6px; font-size: 10px; line-height: 17px; white-space: nowrap; cursor: help; }
.mini-label { color: #6b7175; }
.mini-track { height: 5px; border-radius: 3px; background: #eceef0; overflow: hidden; }
.mini-track span { display: block; height: 100%; border-radius: 3px; }
.mini-value { font: 700 10px var(--mono); text-align: right; }
.mini-value.tone-text-success { color: #5b6166; }
.mini-reset { font: 10px var(--mono); color: var(--faint); }
.priority { font: 700 13px var(--mono); }
.action-menu { position: fixed; z-index: 60; width: 176px; padding: 5px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 14px 34px #19252d1f; }
.menu-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; font-size: 13px; color: var(--text); text-align: left; }
.menu-item svg { color: #7c8388; }
.menu-item:hover, .menu-item:focus-visible { background: var(--hover); outline: none; box-shadow: inset 0 0 0 1.5px var(--focus); }
.menu-item:hover { box-shadow: none; }
.menu-item.danger, .menu-item.danger svg { color: var(--danger); }
.menu-divider { height: 1px; margin: 4px 2px; background: #eef0f1; }
.dialog { width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 0; border: 0; border-radius: 14px; color: var(--ink); background: #fff; box-shadow: 0 24px 70px #0f1a2233; overflow: hidden; }
/* Header and footer stay in view on short screens; only the body scrolls. */
.dialog-panel { display: flex; flex-direction: column; max-height: calc(100dvh - 48px); }
.dialog-panel > .dialog-header, .dialog-panel > .dialog-footer { flex: 0 0 auto; }
.dialog-panel > .dialog-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.load-error { flex-wrap: wrap; color: var(--danger); }
.load-error button { font-size: 12px; }
.dialog-wide { width: min(720px, calc(100vw - 32px)); }
.dialog::backdrop { background: #10171c66; }
.dialog-header, .dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; }
.dialog-header { border-bottom: 1px solid #f0f1f2; }
.dialog-header h2 { margin: 0; font-size: 16px; }
.dialog-footer { justify-content: flex-end; border-top: 1px solid #f0f1f2; }
.dialog-footer button { font-size: 13px; }
.dialog-footer .primary { width: auto; padding: 8px 16px; }
.dialog-body { display: grid; gap: 14px; padding: 18px 20px 20px; }
.dialog-account { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.dialog-avatar { display: grid; place-items: center; flex: 0 0 38px; height: 38px; border-radius: 10px; color: #fff; background: var(--accent); font-weight: 700; }
.dialog-identity { display: grid; gap: 3px; min-width: 0; flex: 1; }
.dialog-identity strong { overflow-wrap: anywhere; }
.dialog-identity span { font-size: 12px; color: var(--muted); }
.dialog-note { margin: -4px 0 0; font-size: 12px; line-height: 1.6; color: #6b7175; }
.dialog-section { margin: 4px 0 -4px; font-size: 12px; font-weight: 400; color: #757b7e; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.stat-tile { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.stat-tile span, .stat-tile small { font-size: 11px; color: var(--muted); }
.stat-tile strong { font-size: 19px; font-variant-numeric: tabular-nums; }
.usage-chart { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.chart-bar { display: grid; justify-items: center; gap: 6px; font-size: 10px; color: var(--muted); cursor: help; }
.bar-value { font: 10px var(--mono); }
.bar-track { display: flex; align-items: flex-end; width: 100%; max-width: 44px; height: 120px; border-radius: 5px; background: #f3f4f5; overflow: hidden; }
.bar-fill { width: 100%; background: var(--accent); border-radius: 5px 5px 0 0; }
.chart-bar.before .bar-track { background: repeating-linear-gradient(135deg, #f3f4f5 0 4px, #fff 4px 8px); }
.chart-empty { margin: 0; padding: 26px; text-align: center; font-size: 13px; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; }
.stat-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-panel { align-content: start; gap: 8px; }
.tile-pairs { display: grid; gap: 4px; margin: 0; }
.tile-pairs div { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.tile-pairs dt { color: var(--muted); }
.tile-pairs dd { margin: 0; font: 700 12px var(--mono); font-variant-numeric: tabular-nums; }
.user-cost { color: var(--accent); }
.model-table-wrap:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.model-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.model-table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.model-table th, .model-table td { padding: 8px 10px; text-align: right; border-bottom: 1px solid #f0f1f2; white-space: nowrap; }
.model-table thead th { font-weight: 400; font-size: 11px; color: #757b7e; background: var(--surface); }
.model-table th[scope="row"], .model-table thead th:first-child { text-align: left; font-family: var(--mono); font-weight: 400; }
.model-table tbody tr:last-child > * { border-bottom: 0; }
.test-log { display: grid; gap: 6px; min-height: 120px; margin: 0; padding: 12px 14px 12px 32px; border-radius: 8px; background: #15191c; font: 12px/1.5 var(--mono); color: #c7cdd1; }
.test-log .tone-text-muted { color: #9aa3a8; }
.test-log .tone-text-success { color: #7fd1b8; } .test-log .tone-text-warning { color: #f1c56b; } .test-log .tone-text-danger { color: #ff8f99; }
.test-status { margin: -4px 0 0; font-size: 12px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 80; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 8px; color: #fff; background: #15191c; font-size: 13px; box-shadow: 0 10px 30px #0f1a2240; opacity: 0; pointer-events: none; transform: translate(-50%, 8px); transition: opacity .18s, transform .18s; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.toast[data-tone="success"]::before { content: "✓ "; color: #7fd1b8; }
.toast[data-tone="danger"] { background: #8f1d29; }
.toast[data-tone="danger"]::before { content: "! "; font-weight: 700; }
/* Requests in flight: buttons keep focus and show progress instead of becoming disabled. */
[aria-busy="true"] { cursor: progress; }
button[aria-busy="true"], .bulk-actions[aria-busy="true"] button { opacity: .65; }
.switch.pending { opacity: .55; }
.switch.pending .switch-thumb { animation: pulse .8s ease-in-out infinite alternate; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; grid-column: 1 / -1; padding: 48px 16px; color: var(--muted); font-size: 13px; }
.dialog-body .loading { padding: 36px 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { to { opacity: .4; } }
.form-error { margin: 0; font-size: 12px; line-height: 1.6; color: var(--danger); white-space: pre-line; }
.form-error:empty { display: none; }
.confirm-message { margin: 0; font-size: 14px; line-height: 1.7; color: var(--text); overflow-wrap: anywhere; }
button.danger-solid { color: #fff; background: var(--danger); border-color: var(--danger); }
button.danger-solid:hover { background: #a31d2b; border-color: #a31d2b; }
.dialog-footer.split { justify-content: space-between; }
/* Re-authorization, after sub2api's ReAuthAccountModal and OAuthAuthorizationFlow. */
.dialog-reauth { width: min(560px, calc(100vw - 32px)); }
.avatar-claude { background: linear-gradient(135deg, #e07a4b, #c4572d); }
.radio-row { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; padding: 0; border: 0; font-size: 13px; color: var(--text); }
.radio-row legend { width: 100%; margin-bottom: 8px; padding: 0; font-size: 12px; color: #646c72; }
.radio-row label { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.radio-row input { margin: 0; accent-color: var(--accent); }
.radio-row.compact legend { color: var(--accent); }
.oauth-panel { display: flex; gap: 14px; padding: 16px; border: 1px solid #cfdfe7; border-radius: 10px; background: var(--accent-soft); }
.oauth-icon { display: grid; place-items: center; flex: 0 0 36px; height: 36px; border-radius: 9px; color: #fff; background: var(--accent); }
.oauth-content { display: grid; gap: 14px; flex: 1; min-width: 0; }
.oauth-content h3 { margin: 0; font-size: 14px; color: #1d4459; }
.oauth-text { margin: 0; font-size: 12px; line-height: 1.6; color: #3d6276; }
.oauth-steps { display: grid; gap: 10px; margin: 10px 0 0; padding: 0; list-style: none; counter-reset: step; }
.oauth-steps li { position: relative; display: grid; gap: 8px; padding: 12px 12px 12px 44px; border: 1px solid #cfdfe7; border-radius: 8px; background: #fffc; font-size: 13px; counter-increment: step; }
.oauth-steps li::before { content: counter(step); position: absolute; left: 12px; top: 11px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; background: var(--accent); font: 700 11px var(--mono); }
.oauth-steps strong { color: #1d4459; font-weight: 600; }
button.primary-inline { justify-self: start; padding: 7px 14px; font-size: 12px; color: #fff; background: var(--accent); border-color: var(--accent); }
button.primary-inline:hover { background: #1f4b63; border-color: #1f4b63; }
.url-box { display: grid; gap: 6px; }
.url-row { display: flex; gap: 6px; }
.url-row input { flex: 1; min-width: 0; height: 34px; padding: 0 9px; border: 1px solid var(--control); border-radius: 4px; background: var(--surface); font: 11px var(--mono); color: var(--text); }
.url-row button { flex: 0 0 auto; font-size: 12px; padding: 6px 11px; }
.url-links { display: flex; gap: 14px; font-size: 12px; }
.url-links a { color: var(--accent); }
.oauth-warning { margin: 0; padding: 8px 10px; border: 1px solid #f0dcaa; border-radius: 6px; background: var(--warning-soft); font-size: 11px; line-height: 1.6; color: #8a5d0f; }
.oauth-hint { margin: 0; font-size: 11px; color: var(--muted); }
.field textarea { width: 100%; min-height: 72px; padding: 9px 11px; border: 1px solid var(--control); border-radius: 4px; color: var(--text); background: #fff; font: 12px/1.5 var(--mono); resize: vertical; }
.field textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.oauth-help { font-size: 12px; color: #8a5d0f; }
.oauth-help summary { cursor: pointer; color: var(--accent); }
.oauth-help ol { margin: 8px 0 4px; padding-left: 20px; line-height: 1.8; }
.oauth-help p { margin: 0; }
#reauth-cookie { display: grid; gap: 12px; }
#reauth-cookie[hidden], #reauth-manual[hidden] { display: none; }
.page-footer { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-top: 25px; color: var(--muted); font-size: 12px; }
.pagination { display: flex; align-items: center; gap: 15px; }
.pagination button { font-size: 12px; }
.empty { padding: 70px 20px; text-align: center; color: #858c91; }
.empty-icon { font-size: 40px; }
.empty h2 { font-size: 17px; color: #424a50; }
.empty p { font-size: 13px; }
/* Page tabs: the account pool and its request log. */
.page-tabs { display: flex; gap: 4px; margin-left: 14px; }
.page-tabs a { padding: 6px 10px; border-radius: 6px; font-size: 13px; color: #5e6468; text-decoration: none; transition: background .15s, color .15s; }
.page-tabs a:hover { background: var(--hover); color: var(--ink); }
.page-tabs a[aria-current="page"] { color: #fff; background: #15191c; }
.page-tabs a[aria-current="page"]:hover { background: #303a42; }
.page-tabs a:focus-visible, .table-scroll:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* Request log, after sub2api's usage records. New small text in the table keeps at least 4.5:1 contrast;
   the shared toolbar, count and badge styles are left as the account page has them. */
.log-overview { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.log-overview .nowrap { white-space: nowrap; }
.log-search-field { width: 230px; }
.log-model-field { width: 175px; }
.log-status-field { width: 96px; }
.logs { margin-top: 14px; }
.logs[aria-busy="true"] .table-scroll { opacity: .55; transition: opacity .15s; }
.log-table td { padding: 9px 12px; vertical-align: top; }
.log-row:hover td { background: #fbfcfc; }
.log-table td.col-time, .log-table td.col-model { font-family: var(--mono); white-space: nowrap; }
.log-table td.col-time { color: #5e6468; }
.log-table .cell-note { color: #6b7175; }
.log-account { padding: 0; border: 0; background: none; font-size: 13px; font-weight: 700; color: var(--ink); text-align: left; text-decoration: underline dashed #b6bcc2; text-underline-offset: 3px; }
.log-account:hover { background: none; color: var(--accent); text-decoration-color: var(--accent); }
.token-line { display: flex; gap: 10px; font: 11px var(--mono); color: #4a5055; white-space: nowrap; }
.token-line + .token-line { margin-top: 3px; }
.cache-read { color: #2b6f8e; }
.cache-write { color: #8a5d0f; }
.ttl { margin-left: 4px; padding: 0 3px; border-radius: 3px; font-size: 10px; color: #fff; background: #b84a22; }
.cost-main { font: 700 12px var(--mono); color: var(--accent); white-space: nowrap; }
.cost-sub { margin-top: 3px; font: 10px var(--mono); color: #6b7175; white-space: nowrap; }
.log-latency { display: grid; grid-template-columns: auto auto; justify-content: start; gap: 2px 8px; margin: 0; font-size: 11px; white-space: nowrap; }
.log-latency dt { color: #6b7175; }
.log-latency dd { margin: 0; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.lat-1 { color: #8a5d0f; } .lat-2 { color: #b84a22; } .lat-3 { color: var(--danger); font-weight: 700; }
.log-error { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.log-request { display: block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 11px var(--mono); color: #6b7175; }
.log-notice { margin: 10px 0 0; padding: 8px 12px; border-radius: 6px; font-size: 12px; color: var(--accent); background: var(--accent-soft); }
.log-user { font-weight: 700; color: var(--ink); white-space: nowrap; }
/* Server build: user name sign-in, who is signed in, guests' read-only cards, and the 管理后台. */
.login-input { display: block; width: 100%; margin-bottom: 16px; padding: 13px 12px; font-size: 14px; border: 1px solid var(--control); border-radius: 5px; color: var(--text); }
.login-input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.session-user { font-size: 12px; color: #6b7175; }
.avatar.static { cursor: default; }
.avatar.static:hover { opacity: 1; }
.switch.readonly { cursor: default; }
.switch.readonly:hover { background: #d5d9dc; }
.switch.readonly[aria-checked="true"], .switch.readonly[aria-checked="true"]:hover { background: var(--accent); }
.field input[readonly] { color: #5e6468; background: var(--surface); }
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.admin-ok { color: #2f6f5f; } /* 5.9:1 on white; the shared success green is lighter. */
.admin-card h3:focus, #admin-title:focus { outline: none; }
.admin-card { margin-top: 14px; padding: 16px 18px 18px; border: 1px solid var(--line); border-radius: 10px; }
.admin-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 14px; }
.admin-head h3 { margin: 0 0 6px; font-size: 15px; }
.admin-note { margin: 0; max-width: 760px; font-size: 12px; line-height: 1.6; color: #6b7175; }
.admin-empty { margin: 0; padding: 22px; text-align: center; font-size: 13px; color: #6b7175; background: var(--surface); border-radius: 8px; }
.admin-table td { vertical-align: top; }
.admin-table .log-error { max-width: 260px; }
.admin-name { font-size: 13px; font-weight: 700; color: var(--ink); }
.admin-actions { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }
.admin-actions button { font-size: 12px; padding: 5px 9px; }
.field-hint { font-size: 11px; line-height: 1.5; color: #6b7175; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.check-field { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); cursor: pointer; }
.check-field input { width: 16px; height: 16px; margin: 0; }
.input-with-button { display: flex; gap: 6px; }
.input-with-button input { flex: 1; min-width: 0; font-family: var(--mono); }
.input-with-button button { flex: 0 0 auto; font-size: 12px; }
.admin-test { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; }
.admin-test button { font-size: 12px; padding: 6px 11px; }
@media (min-width: 1700px) { .account-card { padding: 17px; } .quota-area { margin-top: 18px; } .card-footer { margin-top: 18px; } }
@media (max-width: 1390px) { .toolbar { flex-wrap: wrap; } .toolbar-actions { padding-bottom: 4px; } .reset-time { font-size: 9px; margin-left: 3px; } .secondary-quotas { gap: 9px; } .email { font-size: 15px; } .overview { grid-template-columns: repeat(4, minmax(0, 1fr)); } .metric-status { grid-column: 1 / -1; } }
@media (max-width: 1100px) { .page { padding-left: 24px; padding-right: 24px; } .accounts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .toolbar-actions { flex: 1; justify-content: flex-end; } .overview { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 650px) {
  .page { padding: 0 14px 20px; }
  .pool-header { padding: 16px 0 12px; }
  .metric { padding: 12px; } .metric-value { font-size: 20px; }
  .toolbar { gap: 12px; padding: 12px; }
  .toolbar .field { width: calc(50% - 6px); min-width: 0; } /* Toolbar fields pair up; fields in dialogs stay full width. */
  .toolbar-actions { flex-basis: 100%; margin-top: 2px; padding-bottom: 0; }
  .result-count { margin-right: auto; }
  .accounts { grid-template-columns: 1fr; gap: 12px; }
  .email { font-size: 16px; } .col-account .email { font-size: 14px; }
  .reset-time { font-size: 10px; }
  .meta-row { margin-left: 0; }
  .capacity-list { margin-left: 0; }
  .secondary-quotas { grid-template-columns: 1fr; gap: 10px; }
  .page-footer { flex-direction: column; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid-3 { grid-template-columns: 1fr; }
  .usage-chart { gap: 4px; }
}
@media (max-width: 650px) { .oauth-panel { padding: 12px; } .oauth-icon { display: none; } .oauth-steps li { padding-left: 40px; } }
@media (max-width: 650px) { .page-tabs { margin-left: 2px; } .page-tabs a { padding: 6px 8px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation-duration: 1.5s !important; } }
