:root {
  color-scheme: light;
  --paper: #f4f8f6;
  --white: #fff;
  --ink: #172b26;
  --muted: #536961;
  --line: #dce8e2;
  --primary: #087e6b;
  --primary-hover: #066755;
  --accent: #e4f5ef;
  --green: #0a6d58;
  --green-bg: #e6f5ee;
  --focus: #00836c;
  --dark-teal: #12443b;
  --balance-line: #4a7569;
  font: 14px/1.5 "Inter", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .53; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 3px;
}
h1, h2, h3, p { margin: 0; }
.icon-library, .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.brand-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--primary); color: #fff; flex: none; }
.sign-in { display: grid; place-items: center; min-height: 100vh; min-height: 100svh; padding: 32px 20px; }
.sign-in-layout { width: min(100%, 410px); }
.sign-in-brand { display: grid; justify-items: center; gap: 12px; margin-bottom: 24px; text-align: center; }
.sign-in-brand .brand-icon { width: 48px; height: 48px; }
.sign-in-brand .icon { width: 27px; height: 27px; }
.sign-in-brand h1 { font-size: 26px; line-height: 1.3; font-weight: 720; }
.auth-panel { padding: 23px 25px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 8px 24px #204a3e0a; }
.auth-panel h2 { font-size: 18px; margin-bottom: 13px; }
.auth-panel .auth-modes { width: 100%; margin-bottom: 15px; }
.auth-modes button { flex: 1 1 0; min-height: 35px; }
.auth-panel input:not([type="checkbox"]), .auth-panel .primary { min-height: 44px; }
.auth-footer { display: grid; justify-items: center; margin-top: 16px; }
.auth-footer .text-button { border: 0; background: none; padding: 4px; }
.auth-terms { display: block; width: max-content; margin: 15px auto 0; color: var(--muted); font-size: 13px; }
.auth-terms:hover { color: var(--primary); text-decoration: underline; }
.topbar { background: var(--white); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1224px; min-height: 72px; padding: 0 24px; margin: auto; display: grid; grid-template-columns: minmax(max-content, 1fr) auto minmax(0, 1fr); align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 9px; width: max-content; white-space: nowrap; font-size: 15px; font-weight: 720; }
.tabs { display: flex; align-items: center; justify-content: center; gap: 5px; }
.tabs a { white-space: nowrap; padding: 9px 13px; border-radius: 7px; color: var(--muted); font-weight: 580; display: flex; align-items: center; gap: 7px; }
.tabs a:hover, .tabs a[aria-current] { color: var(--green); background: var(--accent); }
.account-action { justify-self: end; max-width: 100%; }
#account-name { overflow: hidden; text-overflow: ellipsis; }
.shell { max-width: 1224px; padding: 0 24px; margin: auto; }
.page-head { padding: 33px 0 25px; display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.page-head h1 { font-size: 32px; line-height: 1.25; font-weight: 760; }
.page-head p { margin-top: 8px; color: var(--muted); }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.57fr) minmax(340px, 1fr); gap: 20px; }
.stack { display: grid; align-content: start; gap: 20px; min-width: 0; }
.balance { display: flex; flex-direction: column; min-height: 292px; padding: 26px 28px 21px; border-radius: 8px; color: #fff; background: var(--dark-teal); }
.balance-heading, .title-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.icon-tile { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 7px; background: #286557; color: #f1fff9; flex: none; }
.icon-tile.quiet { color: var(--muted); background: var(--paper); }
.icon-tile.green { color: var(--green); background: var(--green-bg); }
.balance h2, .panel h2 { font-size: 17px; font-weight: 700; }
.balance-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 9px; margin-top: 13px; }
.balance-total strong { font-size: 52px; line-height: 1.15; font-weight: 710; overflow-wrap: anywhere; }
.balance-total span, .balance-note, .balance-stats span { color: #cde9df; }
.balance-note { margin: 4px 0 16px; }
.balance-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: auto; padding-top: 14px; border-top: 1px solid var(--balance-line); }
.balance-stats div { padding: 0 12px; border-left: 1px solid var(--balance-line); }
.balance-stats div:first-child { padding-left: 0; border-left: 0; }
.balance-stats span, .balance-stats b { display: block; }
.balance-stats b { margin-top: 3px; font-size: 20px; line-height: 1.2; overflow-wrap: anywhere; }
.balance-total strong, .balance-stats b, .money, .charge-summary b, td, .price-grid b { font-variant-numeric: tabular-nums; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 70px; padding: 14px 21px; border-bottom: 1px solid var(--line); }
.panel-body { padding: 19px 21px; }
.button, .icon-button, .text-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.button { min-height: 40px; padding: 7px 12px; border: 1px solid transparent; border-radius: 6px; font-weight: 660; white-space: nowrap; }
.button.small { min-height: 33px; padding: 4px 9px; font-size: 13px; }
.button.primary { background: var(--primary); color: #fff; }
.button.primary:hover:not(:disabled) { background: var(--primary-hover); }
.button.secondary { background: #fff; color: #384e45; border-color: var(--line); }
.button.secondary:hover:not(:disabled) { background: var(--paper); }
.button.wide { width: 100%; }
.text-button { width: max-content; max-width: 100%; white-space: nowrap; color: var(--green); font-weight: 640; }
.text-button:hover { text-decoration: underline; }
.text-button .icon { width: 15px; height: 15px; }
.rate { color: var(--green); background: var(--green-bg); padding: 4px 8px; border-radius: 5px; font-variant-numeric: tabular-nums; font-weight: 680; white-space: nowrap; font-size: 12px; }
fieldset { margin: 0 0 14px; padding: 0; border: 0; min-width: 0; }
legend, label { margin-bottom: 6px; display: block; color: #3e554b; font-weight: 660; font-size: 13px; }
.amount-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.amount-options button { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 8px 3px; color: var(--ink); min-width: 0; min-height: 62px; }
.amount-options button:hover, .amount-options button[aria-pressed="true"] { border-color: #3c9b83; background: var(--accent); color: var(--green); }
.amount-options span { display: block; }
.amount-options .money { font-size: 17px; font-weight: 740; }
.amount-options .points { font-size: 11px; color: var(--muted); }
input, select, .amount-field, .search { border: 1px solid #cdded6; border-radius: 6px; background: #fff; color: var(--ink); min-width: 0; min-height: 40px; }
input, select { padding: 7px 11px; }
input::placeholder { color: #647a70; }
.amount-field, .search { display: flex; align-items: center; padding: 0 11px; gap: 8px; }
.amount-field input, .search input { flex: 1; background: transparent; padding-left: 0; border: 0; min-height: 38px; outline: 0; }
.amount-field:focus-within, .search:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.amount-field span, .search .icon { color: var(--muted); }
.amount-field span:last-child { font-size: 12px; }
.charge-summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 13px 0; color: var(--muted); }
.charge-summary b { color: var(--ink); font-size: 16px; }
.form-message { margin-top: 8px; color: var(--muted); overflow-wrap: anywhere; }
.form-message:empty { display: none; }
.form-message[data-kind="error"] { color: #a63343; }
.form-message[data-kind="success"] { color: var(--green); }
.redeem { margin-top: 14px; padding-top: 11px; border-top: 1px solid var(--line); }
.redeem summary { cursor: pointer; width: fit-content; color: var(--green); }
.redeem form { margin-top: 10px; }
.inline { display: flex; align-items: center; gap: 8px; min-width: 0; }
.inline input, .inline select { flex: 1 1 110px; width: 0; }
.wrap { flex-wrap: wrap; }
.shortcut { padding: 17px 21px; display: grid; gap: 12px; }
.shortcut p { color: var(--muted); margin-top: 3px; }
.shortcut .text-button { margin-left: 48px; }
.empty { min-height: 157px; padding: 22px 10px; display: flex; flex-direction: column; gap: 9px; align-items: center; justify-content: center; color: var(--muted); text-align: center; }
.empty > .icon { width: 24px; height: 24px; color: #55766a; }
.empty strong { color: #384e45; font-weight: 640; }
.empty .button { margin-top: 4px; }
.table-wrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: var(--paper); color: var(--muted); font-weight: 650; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.numeric { text-align: right; white-space: nowrap; }
.muted { color: var(--muted); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.search { width: min(100%, 340px); }
.model-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 12px; }
.model-grid > .empty { grid-column: 1 / -1; }
.model { padding: 17px; display: flex; flex-direction: column; gap: 12px; }
.model .provider { font-size: 12px; color: var(--muted); font-weight: 650; }
.model h3 { font-size: 16px; overflow-wrap: anywhere; }
.model code, .path-list code { overflow-wrap: anywhere; }
.price-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 10px 0; border-block: 1px solid var(--line); }
.price-grid span, .price-grid b { display: block; overflow-wrap: anywhere; }
.price-grid span { color: var(--muted); font-size: 12px; }
.model details { font-size: 12px; color: var(--muted); }
.model summary { cursor: pointer; }
.model details p { padding: 2px 0; }
.model > .text-button { margin-top: auto; }
.connect-grid { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings, .setup { display: grid; gap: 8px; }
.settings label { margin: 4px 0 0; }
.settings > .button { margin-top: 8px; }
.settings > .text-button { margin-top: 8px; }
.setup { gap: 13px; }
.setup ol { margin: 0; padding-left: 19px; }
.setup li + li { margin-top: 6px; }
.path-list { display: grid; gap: 5px; padding: 9px 11px; background: var(--paper); border-radius: 6px; }
.path-list b { display: inline-block; min-width: 76px; }
.segmented { display: flex; width: max-content; max-width: 100%; gap: 2px; padding: 3px; background: #eff5f1; border-radius: 7px; }
.segmented button { border: 1px solid transparent; background: transparent; border-radius: 5px; white-space: nowrap; color: var(--muted); padding: 6px 11px; }
.segmented button[aria-pressed="true"] { background: #fff; color: var(--green); border-color: var(--line); font-weight: 680; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0 12px 16px; }
.status { color: #7a4c10; }
.status.paid, .positive { color: var(--green); }
.status.closed, .status.failed { color: var(--muted); }
footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 9px 18px; margin-top: 30px; border-top: 1px solid var(--line); padding: 17px 0 25px; color: var(--muted); font-size: 13px; }
footer a:hover { color: var(--primary); }
dialog { padding: 0; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); width: min(440px, calc(100% - 24px)); max-height: calc(100% - 24px); box-shadow: 0 18px 70px #142f2840; }
dialog::backdrop { background: #132d2588; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 18px; }
.dialog-body { padding: 17px 18px 20px; }
.icon-button { min-width: 34px; min-height: 34px; padding: 5px; background: #fff; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); }
.icon-button:hover { background: var(--paper); }
.checkbox { display: flex; align-items: center; gap: 7px; }
.checkbox input { min-height: auto; }
.checkbox a { color: var(--primary); }
.captcha { padding: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--paper); }
.captcha img { display: block; }
.payment iframe { border: 1px solid var(--line); width: 100%; height: 320px; border-radius: 6px; margin-bottom: 10px; }
.payment > .charge-summary { padding-top: 0; }
.toast { position: fixed; right: 20px; bottom: 20px; max-width: calc(100vw - 40px); z-index: 4; padding: 11px 15px; background: var(--dark-teal); color: #fff; border-radius: 6px; }
@media (max-width: 900px) {
  .topbar-inner { column-gap: 12px; }
  .tabs a { padding-inline: 8px; }
  .tabs a .icon { display: none; }
  .balance-stats span { font-size: 12px; white-space: nowrap; }
  .model-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 710px) {
  .topbar-inner { grid-template-columns: minmax(0, 1fr) max-content; gap: 6px 12px; padding: 10px 15px 0; }
  .tabs { grid-row: 2; grid-column: 1 / -1; justify-content: start; padding: 3px 0 7px; overflow-x: auto; }
  .account-action { grid-column: 2; grid-row: 1; max-width: 124px; }
  .shell { padding: 0 15px; }
  .page-head { padding: 23px 0 17px; }
  .page-head h1 { font-size: 25px; }
  .overview-grid, .connect-grid { grid-template-columns: minmax(0, 1fr); }
  .overview-grid, .overview-grid .stack { gap: 13px; }
  .overview-grid .stack { display: contents; }
  .recharge { grid-row: 2; }
  .shortcut { grid-row: 3; }
  .balance { min-height: 234px; padding: 18px; }
  .balance-total strong { font-size: 40px; }
  .balance-stats div { padding-inline: 7px; }
  .balance-stats span { font-size: 12px; }
  .panel-head, .panel-body, .shortcut { padding-inline: 15px; }
  .billing-head { flex-wrap: wrap; }
}
@media (max-width: 420px) {
  .auth-panel { padding-inline: 17px; }
  .sign-in-brand h1 { font-size: 23px; }
  .model-grid { grid-template-columns: minmax(0, 1fr); }
  .page-head { align-items: start; }
  #refresh { font-size: 12px; padding-inline: 6px; gap: 4px; }
  #refresh .icon { width: 14px; height: 14px; }
  th, td { padding-inline: 7px; }
}
