:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #252a30;
  background: #fff;
  font-size: 14px;
  line-height: 1.55;
  font-synthesis: none;
  letter-spacing: 0;
  --line: #e2e7eb;
  --muted: #717980;
  --green: #087f6d;
  --green-bg: #e8f5ef;
  --red: #bc3546;
  --red-bg: #fff0f1;
  --amber: #876209;
  --amber-bg: #fcf7e7;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
button, input, textarea, select { border-radius: 6px; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid #80cbbb;
  outline-offset: 3px;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; font-weight: 650; line-height: 1.35; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 600; }
svg { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 1.7; }
small { font-size: 12px; }
code, .mono { font-family: "Cascadia Code", Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.initial-loading { min-height: 80vh; display: flex; align-items: center; justify-content: center; gap: 12px; }
.initial-loading span { font-size: 20px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 36px; padding: 7px 13px; border: 1px solid #d8dfe4;
  background: #fff; color: #353d45; font-weight: 500; white-space: nowrap;
}
.button:hover { background: #f4f6f8; text-decoration: none; }
.button.primary { background: var(--green); border-color: var(--green); color: #fff; }
.button.primary:hover { background: #056c5d; }
.button.danger { color: var(--red); border-color: #e7b9bf; }
.button.danger:hover { background: var(--red-bg); }
.icon-button {
  border: 1px solid transparent; background: transparent; color: #64707a;
  width: 34px; height: 34px; flex: 0 0 34px; padding: 7px;
  display: inline-flex; align-items: center; justify-content: center; position: relative;
}
.icon-button:hover { background: #edf2f4; color: #242e37; }
.icon-button.danger:hover { background: var(--red-bg); color: var(--red); }
[data-tip]::after {
  content: attr(data-tip); position: absolute; z-index: 40; bottom: calc(100% + 7px);
  left: 50%; transform: translateX(-50%); color: #fff; background: #303a40;
  font-size: 11px; padding: 4px 7px; border-radius: 4px; white-space: nowrap;
  visibility: hidden; pointer-events: none; font-weight: 400;
}
[data-tip]:hover::after, [data-tip]:focus-visible::after { visibility: visible; }
.button.is-loading svg, .icon-button.is-loading svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand img { width: 34px; height: 34px; flex-shrink: 0; }
.brand strong { font-size: 20px; font-weight: 650; display: block; line-height: 1.2; }
.brand small { color: #7b848b; font-size: 11px; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 214px; background: #f5f7f8;
  border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 28px 16px 18px;
}
.sidebar .brand { margin: 0 13px 38px; }
.nav { display: grid; gap: 6px; }
.nav button {
  display: flex; align-items: center; gap: 12px; border: 0; background: transparent;
  color: #69737d; min-height: 42px; padding: 9px 14px; text-align: left; font-size: 13px;
}
.nav button:hover { background: #eaf0f1; }
.nav button[aria-current="page"] { color: #08735f; background: #e1efe9; font-weight: 600; }
.sidebar-bottom { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.service-state { display: flex; align-items: center; gap: 7px; color: #697780; font-size: 12px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: #25926f; flex-shrink: 0; }
.dot.offline { background: var(--red); }
.main { margin-left: 214px; padding: 35px 40px; max-width: 1510px; min-height: 100vh; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; min-height: 68px; }
.page-header .subtitle { color: var(--muted); font-size: 12px; margin-top: 7px; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stat-band { display: grid; grid-template-columns: repeat(4, 1fr); border-block: 1px solid var(--line); padding: 25px 0; margin: 10px 0 27px; }
.stat { padding: 0 24px; border-left: 1px solid var(--line); }
.stat:first-child { padding-left: 0; border-left: 0; }
.stat .label { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 7px; }
.stat .label svg { width: 15px; height: 15px; color: #89939c; }
.stat-value { margin-top: 10px; font-size: 28px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 13px; color: #8b939a; font-weight: 400; margin-left: 8px; }
.stat:nth-child(2) .stat-value { color: var(--green); }
.stat:nth-child(4) .stat-value { color: #5d6380; }
.notice { padding: 12px 14px; background: var(--amber-bg); border-left: 3px solid #d8b650; display: flex; align-items: center; gap: 12px; margin-bottom: 25px; }
.notice > svg { color: var(--amber); }
.notice > div { min-width: 0; flex: 1; }
.notice p { font-size: 13px; }
.notice .button { min-height: 31px; font-size: 12px; }
.notice.error { background: var(--red-bg); border-color: #d98992; }
.section { margin: 29px 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.section-heading > .muted { font-size: 12px; }
.connection { border-block: 1px solid var(--line); }
.connection-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px 0; min-height: 64px; }
.connection-row + .connection-row { border-top: 1px solid #edf0f2; }
.connection-label { color: #68747d; font-size: 12px; }
.connection-value { min-width: 0; font-family: "Cascadia Code", Consolas, monospace; font-size: 13px; overflow-wrap: anywhere; line-height: 1.65; }
.model-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.model-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 6px; padding: 16px; min-height: 89px; }
.model-symbol { display: grid; place-items: center; background: #f3eee9; color: #936840; width: 34px; height: 34px; border-radius: 6px; }
.model-item:nth-child(2n) .model-symbol { background: #eff0f7; color: #70769d; }
.model-name { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.model-id { color: var(--muted); font-size: 10px; margin-top: 2px; }
.model-state { margin-top: 6px; font-size: 11px; color: var(--muted); }
.model-state.success { color: var(--green); }
.table-wrap { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; table-layout: fixed; font-size: 12px; }
th { background: #f8fafb; font-size: 11px; font-weight: 500; color: #859099; padding: 11px 12px; border-block: 1px solid var(--line); }
td { padding: 13px 12px; border-bottom: 1px solid #ebeff2; vertical-align: middle; overflow-wrap: anywhere; }
td:first-child, th:first-child { padding-left: 8px; }
tbody tr:hover { background: #fbfcfd; }
.account-name { color: #323e46; font-size: 13px; font-weight: 500; }
.account-id { font-size: 10px; color: #96a0a8; margin-top: 3px; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 3px; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; white-space: nowrap; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge.ready, .badge.success { color: var(--green); }
.badge.unchecked { color: #8b762c; }
.badge.disabled, .badge.cancelled { color: #8a9197; }
.badge.exhausted, .badge.rejected, .badge.error { color: var(--red); }
.empty { min-height: 215px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); border-block: 1px solid var(--line); }
.empty > svg { width: 34px; height: 34px; color: #a7b5b8; margin-bottom: 1px; }
.empty p { font-size: 13px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 22px 0 17px; flex-wrap: wrap; }
.filter-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.search { position: relative; }
.search > svg { position: absolute; left: 11px; top: 10px; width: 16px; height: 16px; color: #89949a; }
input, textarea, select { border: 1px solid #dbe2e7; background: #fff; color: #2f3941; padding: 9px 11px; width: 100%; min-width: 0; }
input::placeholder, textarea::placeholder { color: #a0a8ae; }
.search input { padding-left: 35px; width: 242px; font-size: 12px; height: 36px; }
select { width: auto; min-height: 36px; font-size: 12px; max-width: 100%; }
.toggle { display: inline-flex; align-items: center; position: relative; width: 30px; height: 18px; flex: 0 0 30px; margin-right: 5px; }
.toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.toggle span { width: 30px; height: 18px; border-radius: 10px; background: #d1d9de; transition: background .15s; }
.toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: transform .15s; }
.toggle input:checked + span { background: #258b75; }
.toggle input:checked + span::after { transform: translateX(12px); }
.toggle input:focus-visible + span { outline: 3px solid #80cbbb; outline-offset: 3px; }
.segmented { display: inline-flex; background: #f0f3f5; padding: 3px; border-radius: 6px; }
.segmented button { border: 0; background: transparent; color: #78828a; padding: 5px 13px; min-height: 29px; font-size: 12px; }
.segmented button[aria-selected="true"] { background: #fff; color: #34424a; box-shadow: 0 1px 3px #14283812; }
.pagination { display: flex; justify-content: space-between; align-items: center; padding-top: 15px; font-size: 12px; color: var(--muted); }
.pagination .actions { gap: 6px; }
.pagination .page-number { min-width: 56px; text-align: center; font-variant-numeric: tabular-nums; }
.form-grid { display: grid; gap: 17px; max-width: 650px; }
.field { display: grid; gap: 7px; min-width: 0; font-size: 12px; color: #5d6870; }
.field-label { display: flex; align-items: center; justify-content: space-between; min-height: 19px; }
.field small { color: #929ca3; font-size: 11px; }
.field textarea { resize: vertical; min-height: 130px; line-height: 1.7; font-family: Consolas, monospace; }
.secret-input { -webkit-text-security: disc; }
.form-footer { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.form-error { color: var(--red); font-size: 12px; min-height: 19px; overflow-wrap: anywhere; }
.settings-section { padding-block: 27px; border-bottom: 1px solid var(--line); }
.settings-section:first-of-type { padding-top: 9px; }
.settings-section h2 { margin-bottom: 18px; }
.password-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 650px; }
.password-grid .field:first-child { grid-column: 1 / -1; }
.model-form-row { display: grid; grid-template-columns: minmax(0, 1fr) 34px; align-items: end; gap: 10px; }
.fineprint { display: flex; gap: 18px; color: #929ba2; font-size: 11px; flex-wrap: wrap; padding-top: 28px; }
.fineprint span { display: flex; align-items: center; gap: 5px; }
.fineprint svg { width: 13px; height: 13px; }
dialog { padding: 0; border: 1px solid var(--line); border-radius: 8px; width: 510px; max-width: calc(100% - 32px); max-height: calc(100dvh - 40px); color: #2e3941; box-shadow: 0 18px 70px #1226322a; overflow: auto; }
dialog::backdrop { background: #14252d66; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 12px; }
.modal-header h2 { font-size: 18px; }
.modal-body { padding: 8px 22px 23px; }
.modal-body .form-grid { gap: 14px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 9px; padding-top: 22px; }
.official-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 18px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.official-label { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.official-label svg { color: #899da1; }
.glossary { margin: 0 0 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 5px 12px; font-size: 11px; color: #8a959d; }
.glossary span:nth-child(2n) { text-align: right; color: #687680; }
.detail-grid { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 11px; font-size: 12px; margin: 4px 0 25px; }
.detail-grid dt { color: var(--muted); }
.detail-grid dd { margin: 0; overflow-wrap: anywhere; }
.attempt-list { list-style: none; margin: 12px 0 0; padding: 0; }
.attempt-list li { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 12px 0; border-bottom: 1px solid #edf0f2; font-size: 12px; }
.attempt-list li:last-child { border-bottom: 0; }
#toast { position: fixed; left: 50%; bottom: 25px; transform: translateX(-50%); max-width: calc(100% - 32px); width: max-content; padding: 11px 18px; background: #263c38; color: #fff; border-radius: 6px; box-shadow: 0 6px 24px #10292725; font-size: 12px; z-index: 100; }
#toast[data-error="true"] { background: #903b48; }
.login-layout { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto; }
.login-top { display: flex; justify-content: space-between; align-items: center; padding: 25px 34px; border-bottom: 1px solid #eef1f3; }
.login-top > span { font-size: 11px; color: var(--muted); }
.login-main { display: flex; align-items: center; justify-content: center; min-width: 0; padding: 40px 24px; }
.login-form { width: 350px; max-width: 100%; min-width: 0; }
.login-symbol { width: 45px; height: 45px; display: grid; place-items: center; border: 1px solid #dde9e6; background: #f3f8f6; border-radius: 8px; margin-bottom: 22px; color: var(--green); }
.login-symbol svg { width: 22px; height: 22px; }
.login-form h1 { font-size: 24px; margin-bottom: 29px; }
.login-form .button { width: 100%; margin-top: 19px; min-height: 41px; }
.login-form .form-error { margin-top: 10px; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 45px; }
.password-wrap .icon-button { position: absolute; right: 4px; top: 4px; }
.login-footer { padding: 20px 24px; color: #949ea5; text-align: center; font-size: 11px; }
.global-error { margin: 12px 0; }
.text-button { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; color: var(--muted); font-size: 12px; padding: 4px; }
.text-button:hover { color: var(--green); }
.align-right { text-align: right; }
.account-col-name { width: 29%; }
.account-col-status { width: 13%; }
.account-col-balance { width: 16%; }
.account-col-date { width: 23%; }
.account-col-actions { width: 154px; }
.log-col-time { width: 22%; }
.log-col-model { width: 23%; }
.log-col-account { width: 23%; }
.log-col-status { width: 12%; }
.log-col-duration { width: 14%; }
.log-col-action { width: 40px; }
.audit-table { min-width: 500px; }
.log-filters { justify-content: flex-end; }
.confirm-copy { font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.model-id { overflow-wrap: anywhere; }
.form-footer .form-error { flex: 1; }
.field-label .icon-button { width: 26px; height: 26px; padding: 5px; }
button[aria-busy="true"] { opacity: .6; }
[hidden] { display: none !important; }
@media (min-width: 1600px) {
  .main { padding-inline: 58px; }
}
@media (max-width: 1050px) {
  .sidebar { width: 185px; padding-inline: 11px; }
  .sidebar .brand { margin-left: 10px; }
  .main { margin-left: 185px; padding: 30px 24px; }
  .model-list { grid-template-columns: 1fr; }
  .account-table { min-width: 710px; }
  .request-table { min-width: 630px; }
  .stat { padding-inline: 15px; }
}
@media (max-width: 700px) {
  body { min-width: 320px; }
  .sidebar { position: sticky; inset: 0 0 auto; width: 100%; height: auto; z-index: 10; padding: 0; border-right: 0; background: #f7f9fa; }
  .sidebar .brand { margin: 0; padding: 14px 18px; height: 64px; }
  .brand img { width: 29px; height: 29px; }
  .brand strong { font-size: 18px; }
  .brand small { font-size: 10px; }
  .nav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; padding: 0 10px; border-bottom: 1px solid var(--line); }
  .nav button { flex-direction: column; justify-content: center; gap: 5px; font-size: 11px; padding: 8px 3px 10px; border-radius: 0; min-height: 57px; border-bottom: 2px solid transparent; }
  .nav button[aria-current="page"] { background: transparent; border-bottom-color: var(--green); }
  .nav button svg { width: 18px; height: 18px; }
  .sidebar-bottom { position: absolute; top: 15px; right: 13px; padding: 0; border: 0; gap: 9px; }
  .service-state { font-size: 10px; }
  .main { margin: 0; padding: 25px 18px 40px; min-height: calc(100dvh - 121px); }
  h1 { font-size: 21px; }
  .page-header { min-height: 65px; align-items: flex-start; }
  .page-header .subtitle { font-size: 11px; }
  .page-header > .actions .button { font-size: 12px; padding-inline: 10px; min-height: 34px; }
  .stat-band { grid-template-columns: 1fr 1fr; padding: 0; margin: 4px 0 22px; }
  .stat { padding: 18px 12px; }
  .stat:first-child { padding: 18px 12px 18px 0; }
  .stat:nth-child(3) { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); }
  .stat:nth-child(4) { border-top: 1px solid var(--line); }
  .stat-value { font-size: 25px; margin-top: 8px; }
  .stat .label { font-size: 11px; }
  .notice { gap: 9px; padding: 10px; }
  .notice p { font-size: 12px; }
  .notice .button { padding-inline: 9px; }
  .connection-row { grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; padding-block: 12px; }
  .connection-label { grid-column: 1; font-size: 11px; }
  .connection-value { grid-column: 1; font-size: 12px; }
  .connection-row .actions { grid-column: 2; grid-row: span 2; align-self: center; }
  .connection-row { position: relative; }
  .connection-row > .actions { grid-row: 1 / 3; }
  .section-heading > .muted { font-size: 10px; }
  .model-item { padding: 13px; }
  .model-id { font-size: 10px; }
  .search { flex: 1; min-width: 160px; }
  .search input { width: 100%; }
  .filter-group { width: 100%; flex: 1; }
  .toolbar { margin-top: 15px; }
  .toolbar > .actions { margin-left: auto; }
  .account-table { min-width: 0; }
  .account-table colgroup { display: none; }
  .account-table thead { display: none; }
  .account-table tbody { display: block; }
  .account-table tr { display: grid; grid-template-columns: minmax(0, 1fr) 118px; padding: 16px 0; border-top: 1px solid var(--line); gap: 8px; }
  .account-table tr:last-child { border-bottom: 1px solid var(--line); }
  .account-table td { border: 0; padding: 0; }
  .account-table td:nth-child(1) { grid-column: 1; grid-row: 1; }
  .account-table td:nth-child(2) { grid-column: 1; grid-row: 2; }
  .account-table td:nth-child(3) { grid-column: 1; grid-row: 3; color: #747e86; }
  .account-table td:nth-child(4) { display: none; }
  .account-table td:nth-child(5) { grid-column: 2; grid-row: 1 / 4; align-self: center; }
  .row-actions { gap: 0; flex-wrap: wrap; }
  .row-actions .icon-button { width: 29px; height: 30px; flex-basis: 29px; padding: 5px; }
  .toggle { margin-right: 2px; width: 30px; }
  .request-table { min-width: 0; }
  .request-table colgroup, .request-table thead { display: none; }
  .request-table tbody { display: block; }
  .request-table tr { display: grid; grid-template-columns: minmax(0, 1fr) 65px 30px; gap: 6px 8px; padding: 14px 0; border-top: 1px solid var(--line); }
  .request-table tr:last-child { border-bottom: 1px solid var(--line); }
  .request-table td { padding: 0; border: 0; }
  .request-table td:nth-child(1) { grid-column: 1; grid-row: 1; font-size: 10px; }
  .request-table td:nth-child(2) { grid-column: 1; grid-row: 2; }
  .request-table td:nth-child(3) { grid-column: 1; grid-row: 3; font-size: 10px; color: var(--muted); }
  .request-table td:nth-child(4) { grid-column: 2; grid-row: 1; text-align: right; }
  .request-table td:nth-child(5) { grid-column: 2; grid-row: 2; text-align: right; font-size: 10px; }
  .request-table td:nth-child(6) { grid-column: 3; grid-row: 1 / 4; align-self: center; }
  .request-table .icon-button { width: 30px; height: 32px; padding: 6px; }
  .pagination { font-size: 11px; }
  .password-grid { grid-template-columns: 1fr; }
  .login-top { padding: 20px; }
  .login-top > span { display: none; }
  .modal-header { padding-inline: 18px; }
  .modal-body { padding-inline: 18px; }
  .modal-header h2 { font-size: 17px; }
  .official-link { gap: 7px; }
  .official-link .button { font-size: 11px; padding-inline: 10px; }
  .glossary { font-size: 10px; }
  .fineprint { gap: 8px 15px; }
  .log-filters { justify-content: flex-start; }
  .page-header { flex-wrap: wrap; padding-bottom: 12px; }
  .page-header > .actions { margin-left: auto; }
  .official-label { min-width: 0; }
  .form-footer { flex-wrap: wrap; }
  [data-tip]::after { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
