/* RedWolf 管理台 */
:root {
    --adm-bg: #0f1218;
    --adm-panel: #171b24;
    --adm-border: rgba(255, 255, 255, 0.08);
    --adm-text: #e8ecf4;
    --adm-muted: #8b93a7;
    --adm-accent: #3d8bfd;
    --adm-danger: #e35d6a;
    --adm-ok: #3dd68c;
    --adm-radius: 12px;
    --adm-font: "DM Sans", "Noto Sans SC", system-ui, sans-serif;
    --adm-header-bg: rgba(15, 18, 24, 0.85);
    --adm-table-head: rgba(0, 0, 0, 0.2);
    --adm-ctx-bg: #1e2430;
    --adm-page-grad-a: #1a2740;
    --adm-page-grad-b: #152018;
    --adm-badge-vip-bg: rgba(61, 139, 253, 0.2);
    --adm-badge-vip-fg: #9ec5ff;
    --adm-badge-svip-bg: rgba(246, 194, 68, 0.2);
    --adm-badge-svip-fg: #f6c244;
    --adm-badge-ok-bg: rgba(34, 197, 94, 0.18);
    --adm-badge-ok-fg: #4ade80;
    --adm-badge-ban-bg: rgba(227, 93, 106, 0.2);
    --adm-badge-ban-fg: #ff8b96;
    --adm-badge-admin-bg: rgba(227, 93, 106, 0.22);
    --adm-badge-admin-fg: #ff6b7a;
    --adm-tab-active-bg: rgba(61, 139, 253, 0.22);
    --adm-tab-active-border: rgba(61, 139, 253, 0.45);
    --adm-backdrop: rgba(0, 0, 0, 0.55);
    --adm-table-wrap: rgba(23, 27, 36, 0.7);
    --adm-shadow: none;
}
html.light, body.light {
    --adm-bg: #ffffff;
    --adm-panel: #ffffff;
    --adm-border: rgba(15, 23, 42, 0.1);
    --adm-text: #111827;
    --adm-muted: #6b7280;
    --adm-accent: #2563eb;
    --adm-danger: #dc2626;
    --adm-ok: #059669;
    --adm-header-bg: rgba(255, 255, 255, 0.92);
    --adm-table-head: #f3f4f6;
    --adm-table-wrap: #ffffff;
    --adm-ctx-bg: #ffffff;
    --adm-page-grad-a: transparent;
    --adm-page-grad-b: transparent;
    --adm-badge-vip-bg: rgba(37, 99, 235, 0.1);
    --adm-badge-vip-fg: #1d4ed8;
    --adm-badge-svip-bg: rgba(217, 119, 6, 0.12);
    --adm-badge-svip-fg: #b45309;
    --adm-badge-ok-bg: rgba(22, 163, 74, 0.12);
    --adm-badge-ok-fg: #15803d;
    --adm-badge-ban-bg: rgba(220, 38, 38, 0.1);
    --adm-badge-ban-fg: #b91c1c;
    --adm-badge-admin-bg: rgba(220, 38, 38, 0.12);
    --adm-badge-admin-fg: #dc2626;
    --adm-tab-active-bg: rgba(37, 99, 235, 0.1);
    --adm-tab-active-border: rgba(37, 99, 235, 0.28);
    --adm-backdrop: rgba(15, 23, 42, 0.28);
    --adm-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
}
body.adm-body {
    margin: 0;
    height: 100vh;
    height: 100dvh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    background: radial-gradient(1200px 600px at 10% -10%, var(--adm-page-grad-a) 0%, transparent 55%),
        radial-gradient(900px 500px at 100% 0%, var(--adm-page-grad-b) 0%, transparent 50%),
        var(--adm-bg);
    color: var(--adm-text);
    font-family: var(--adm-font);
}
.adm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 22px;
    border-bottom: 1px solid var(--adm-border);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--adm-header-bg);
}
.adm-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    cursor: pointer;
}
.adm-brand img { width: 28px; height: 28px; border-radius: 6px; }
.adm-header-right { display: flex; align-items: center; gap: 12px; color: var(--adm-muted); font-size: 13px; }
.adm-layout {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    min-height: 0;
    overflow: hidden;
}
.adm-nav {
    min-width: 0;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    border-right: 1px solid var(--adm-border);
    padding: 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.adm-nav button {
    flex-shrink: 0;
    text-align: left;
    border: 0;
    background: transparent;
    color: var(--adm-muted);
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}
.adm-nav button.active, .adm-nav button:hover {
    background: var(--adm-tab-active-bg);
    color: var(--adm-text);
}
.adm-main {
    min-width: 0;
    min-height: 0;
    padding: 20px 22px 40px;
    overflow: auto;
    overscroll-behavior: contain;
}
.adm-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}
.adm-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--adm-text);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.adm-check input {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--adm-accent);
    cursor: pointer;
}
.adm-toolbar input, .adm-toolbar select, .adm-drawer input, .adm-drawer select, .adm-modal input, .adm-modal select {
    background: var(--adm-panel);
    border: 1px solid var(--adm-border);
    color: var(--adm-text);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    outline: none;
}
.adm-toolbar input:focus, .adm-drawer input:focus, .adm-modal input:focus {
    border-color: rgba(61, 139, 253, 0.6);
}
.adm-btn {
    border: 1px solid var(--adm-border);
    background: var(--adm-panel);
    color: var(--adm-text);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
}
.adm-btn:hover { border-color: rgba(61, 139, 253, 0.5); }
.adm-btn-primary { background: var(--adm-accent); border-color: transparent; color: #fff; font-weight: 600; }
.adm-btn-danger { color: var(--adm-danger); border-color: color-mix(in srgb, var(--adm-danger) 35%, transparent); }
.adm-table-wrap {
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius);
    overflow: auto;
    background: var(--adm-table-wrap);
    box-shadow: var(--adm-shadow);
}
table.adm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.adm-table th, .adm-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--adm-border);
    text-align: left;
    white-space: nowrap;
}
.adm-table th { color: var(--adm-muted); font-weight: 600; background: var(--adm-table-head); }
.adm-table tr:hover td { background: rgba(61, 139, 253, 0.06); }
.adm-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    background: rgba(255,255,255,0.08);
}
html.light .adm-badge, body.light .adm-badge {
    background: rgba(15, 23, 42, 0.06);
}
.adm-badge.vip { background: var(--adm-badge-vip-bg); color: var(--adm-badge-vip-fg); }
.adm-badge.svip { background: var(--adm-badge-svip-bg); color: var(--adm-badge-svip-fg); }
.adm-badge.active { background: var(--adm-badge-ok-bg); color: var(--adm-badge-ok-fg); font-weight: 650; }
.adm-badge.banned { background: var(--adm-badge-ban-bg); color: var(--adm-badge-ban-fg); font-weight: 650; }
.adm-badge.admin { background: var(--adm-badge-admin-bg); color: var(--adm-badge-admin-fg); font-weight: 650; }
.adm-muted { color: var(--adm-muted); }
.adm-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.adm-tier-select {
    background: var(--adm-panel);
    border: 1px solid var(--adm-border);
    color: var(--adm-text);
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 13px;
    min-width: 96px;
    cursor: pointer;
}
.adm-tier-select:focus {
    outline: none;
    border-color: rgba(61, 139, 253, 0.55);
}
.adm-th-sort {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: inherit;
    padding: 0;
    cursor: pointer;
}
.adm-th-sort .adm-sort-icon {
    display: inline-flex;
    color: var(--adm-muted);
    opacity: 0.75;
    transition: color .15s, opacity .15s;
}
.adm-th-sort:hover .adm-sort-icon {
    color: var(--adm-text);
    opacity: 1;
}
.adm-th-sort.active {
    color: var(--adm-text);
}
.adm-th-sort.active .adm-sort-icon {
    color: var(--adm-accent);
    opacity: 1;
}
.adm-drawer-backdrop, .adm-modal-backdrop {
    position: fixed; inset: 0; background: var(--adm-backdrop); z-index: 100;
    display: none; align-items: stretch; justify-content: flex-end;
}
.adm-drawer-backdrop.show, .adm-modal-backdrop.show { display: flex; }
.adm-modal-backdrop { justify-content: center; align-items: center; padding: 16px; }
.adm-drawer {
    width: min(480px, 96vw);
    background: var(--adm-panel);
    border-left: 1px solid var(--adm-border);
    padding: 18px;
    overflow: auto;
}
.adm-drawer.adm-usage-drawer {
    width: min(1584px, 96vw); /* 1440 → +10% */
    height: 100%;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 20px 22px 28px;
    box-sizing: border-box;
    background:
        linear-gradient(180deg, rgba(61, 139, 253, 0.04), transparent 120px),
        var(--adm-panel);
}
html.light .adm-drawer.adm-usage-drawer,
body.light .adm-drawer.adm-usage-drawer {
    background:
        linear-gradient(180deg, rgba(37, 99, 235, 0.035), transparent 140px),
        var(--adm-panel);
}
.adm-usage-top { flex: 0 0 auto; }
.adm-usage-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}
.adm-usage-title {
    margin: 0 0 6px !important;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.adm-usage-hint {
    margin: 0;
    max-width: 720px;
    font-size: 12px;
    line-height: 1.55;
    color: var(--adm-muted);
}
.adm-section-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--adm-muted);
    margin-bottom: 8px;
}
.adm-quota-section {
    margin-bottom: 14px;
    padding: 12px 14px 10px;
    border: 1px solid var(--adm-border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--adm-table-head) 55%, transparent);
}
.adm-quota-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 10px;
}
.adm-quota-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 0;
    padding: 12px 14px;
    border: 1px solid var(--adm-border);
    border-radius: 10px;
    background: var(--adm-panel);
    font-size: 12px;
}
.adm-quota-main {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) auto auto;
    gap: 12px;
    align-items: center;
    width: 100%;
    min-width: 0;
}
.adm-quota-meta { min-width: 0; }
.adm-quota-bar {
    width: 100%;
    height: 5px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
    overflow: hidden;
}
.adm-quota-bar.is-zero {
    background: rgba(107, 114, 128, 0.35);
}
.adm-quota-bar-fill {
    height: 100%;
    min-width: 0;
    border-radius: inherit;
    transition: width 0.25s ease, background-color 0.25s ease;
}
.adm-quota-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    line-height: 1.35;
    min-width: 0;
}
.adm-quota-name {
    font-size: 14px;
    font-weight: 650;
    letter-spacing: 0.02em;
    color: var(--adm-badge-vip-fg);
    word-break: break-word;
}
.adm-quota-provider {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #111827;
    background: none;
}
.adm-quota-today {
    text-align: right;
    padding: 0 4px;
}
.adm-quota-today-label {
    display: block;
    font-size: 10px;
    color: var(--adm-muted);
    margin-bottom: 2px;
}
.adm-quota-today-val {
    font-size: 18px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
    color: var(--adm-text);
    line-height: 1.1;
}
.adm-quota-today-val small {
    margin-left: 2px;
    font-size: 11px;
    font-weight: 600;
    color: var(--adm-muted);
}
.adm-quota-today-val small.adm-quota-min {
    margin-left: 4px;
    font-weight: 500;
}
.adm-quota-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: flex-end;
    min-width: 0;
    width: auto;
    max-width: 100%;
}
.adm-quota-field-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--adm-muted);
    align-self: flex-start;
}
.adm-quota-input-row {
    display: flex;
    align-items: center;
    gap: 6px;
    width: auto;
    flex-wrap: nowrap;
}
.adm-quota-input {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 0 0 auto;
    width: 148px;
    min-width: 0;
    height: 30px;
    min-height: 30px;
    box-sizing: border-box;
    padding: 0 8px 0 0;
    border: 1px solid var(--adm-border);
    border-radius: 7px;
    background: var(--adm-bg);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.adm-quota-add-btn {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--adm-border);
    border-radius: 7px;
    background: var(--adm-panel);
    color: var(--adm-accent);
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.adm-quota-add-btn:hover {
    border-color: var(--adm-tab-active-border);
    background: var(--adm-tab-active-bg);
    color: var(--adm-text);
}
.adm-quota-add-btn[hidden] { display: none !important; }
.adm-quota-add-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}
.adm-quota-add-inline[hidden] { display: none !important; }
.adm-quota-add-inline input[data-quota-add-input] {
    width: 72px;
    height: 30px;
    margin: 0;
    padding: 0 8px;
    border: 1px solid var(--adm-border);
    border-radius: 7px;
    background: var(--adm-bg);
    color: var(--adm-text);
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: right;
    -moz-appearance: textfield;
    appearance: textfield;
}
.adm-quota-add-inline input[data-quota-add-input]::-webkit-outer-spin-button,
.adm-quota-add-inline input[data-quota-add-input]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.adm-quota-add-inline input[data-quota-add-input]:focus {
    outline: none;
    border-color: var(--adm-tab-active-border);
    box-shadow: 0 0 0 2px var(--adm-tab-active-bg);
}
.adm-quota-add-confirm {
    height: 30px;
    padding: 0 10px !important;
    font-size: 12px !important;
    line-height: 28px;
    white-space: nowrap;
}
.adm-quota-input:focus-within {
    border-color: var(--adm-tab-active-border);
    box-shadow: 0 0 0 2px var(--adm-tab-active-bg);
}
.adm-quota-field input,
.adm-quota-input input {
    width: 41px;
    max-width: 41px;
    flex: 0 0 41px;
    height: 28px;
    margin: 0;
    padding: 0 2px 0 6px !important;
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    border-radius: 7px 0 0 7px;
    text-align: right;
    font-size: 12px !important;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 28px;
    color: var(--adm-text);
    -moz-appearance: textfield;
    appearance: textfield;
}
.adm-quota-input input::-webkit-outer-spin-button,
.adm-quota-input input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.adm-quota-input input::placeholder {
    color: var(--adm-muted);
    font-weight: 500;
    opacity: 0.85;
}
.adm-quota-unit {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 4px 0 6px;
    border-left: 1px solid var(--adm-border);
    font-size: 11px;
    font-weight: 600;
    color: var(--adm-muted);
    line-height: 1;
    white-space: nowrap;
}
.adm-quota-unit .adm-quota-min {
    margin-left: 2px;
    font-weight: 500;
}
.adm-quota-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}
.adm-usage-tabs-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-top: 2px;
    border-bottom: 1px solid var(--adm-border);
}
.adm-underline-tabs {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin: 0;
    flex-wrap: nowrap;
    overflow: visible;
}
.adm-underline-tab {
    position: relative;
    border: 0;
    background: transparent;
    color: var(--adm-muted);
    padding: 10px 10px 12px;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    flex-shrink: 0;
}
.adm-underline-tab:hover {
    color: var(--adm-text);
}
.adm-underline-tab.active {
    color: var(--adm-text);
}
.adm-underline-tab.active::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: -1px;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: var(--adm-accent);
}
.adm-usage-panel {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-top: 14px;
}
.adm-billing-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.adm-billing-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.adm-billing-note {
    margin: 0;
    font-size: 12px;
}
.adm-range-control {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 0;
}
.adm-range-caption {
    font-size: 12px;
    color: var(--adm-muted);
    font-variant-numeric: tabular-nums;
    line-height: 1.35;
    text-align: right;
    max-width: min(46em, 100%);
}
.adm-seg {
    display: inline-flex;
    flex-shrink: 0;
    padding: 3px;
    border: 1px solid var(--adm-border);
    border-radius: 999px;
    background: color-mix(in srgb, var(--adm-table-head) 85%, var(--adm-panel));
    gap: 2px;
}
.adm-seg-btn {
    border: 0;
    background: transparent;
    color: var(--adm-muted);
    padding: 6px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 650;
    min-width: 40px;
    line-height: 1.2;
    transition: background 0.15s ease, color 0.15s ease;
}
.adm-seg-btn:hover { color: var(--adm-text); }
.adm-seg-btn.active {
    background: var(--adm-panel);
    color: var(--adm-text);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), inset 0 0 0 1px var(--adm-border);
}
html:not(.light) .adm-seg-btn.active,
body:not(.light) .adm-seg-btn.active {
    background: color-mix(in srgb, var(--adm-accent) 18%, var(--adm-panel));
    box-shadow: inset 0 0 0 1px var(--adm-tab-active-border);
}
.adm-billing-block { margin-top: 0; flex: 1 1 auto; min-height: 0; overflow: auto; padding-right: 2px; }
.adm-billing-range-pill {
    display: inline-flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    color: var(--adm-badge-vip-fg);
    background: var(--adm-badge-vip-bg);
}
.adm-billing-group { margin-bottom: 16px; }
.adm-billing-group-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.adm-billing-group-title {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--adm-text);
}
.adm-billing-group-meta {
    font-size: 12px;
    color: var(--adm-muted);
    font-variant-numeric: tabular-nums;
}
.adm-billing-table-wrap {
    border: 1px solid var(--adm-border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--adm-panel);
}
.adm-billing-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.adm-billing-table th,
.adm-billing-table td {
    border-bottom: 1px solid var(--adm-border);
    padding: 8px 12px;
    text-align: left;
    white-space: nowrap;
}
.adm-billing-table th {
    color: var(--adm-muted);
    font-weight: 600;
    background: var(--adm-table-head);
    font-size: 11px;
}
.adm-billing-table th.num,
.adm-billing-table td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.adm-billing-model {
    font-weight: 500;
}
.adm-billing-table tbody tr.is-idle td {
    color: var(--adm-muted);
    opacity: 0.72;
}
.adm-billing-table tbody tr:last-child td { border-bottom: 0; }
.adm-billing-table tbody tr:not(.is-idle):hover td {
    background: color-mix(in srgb, var(--adm-accent) 6%, transparent);
}
.adm-billing-table input.adm-billing-price {
    width: 96px;
    padding: 4px 6px;
}
.adm-billing-table tfoot td {
    border-bottom: none;
    border-top: 1px solid var(--adm-border);
    padding-top: 10px;
    padding-bottom: 10px;
    color: var(--adm-text);
    font-weight: 650;
    background: color-mix(in srgb, var(--adm-table-head) 80%, transparent);
}
.adm-billing-subtotal td:first-child {
    color: var(--adm-muted);
    font-weight: 650;
}
.adm-billing-cost {
    font-weight: 700;
    color: var(--adm-text);
}
.adm-billing-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 4px;
    padding: 12px 14px;
    border: 1px solid var(--adm-border);
    border-radius: 10px;
    background: color-mix(in srgb, var(--adm-accent) 8%, var(--adm-panel));
    font-size: 13px;
    color: var(--adm-muted);
    font-weight: 600;
}
.adm-billing-total strong {
    color: var(--adm-text);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}
.adm-usage-pager {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 10px;
    margin-top: 4px;
    border-top: 1px solid var(--adm-border);
}
.adm-usage-pager-btns { display: flex; gap: 8px; }
.adm-modal {
    width: min(420px, 96vw);
    background: var(--adm-panel);
    border: 1px solid var(--adm-border);
    border-radius: 14px;
    padding: 18px;
}
.adm-drawer h3, .adm-modal h3 { margin: 0 0 12px; font-size: 16px; }
.adm-form-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.adm-form-row label { font-size: 12px; color: var(--adm-muted); }
.adm-range-modal { width: min(480px, 96vw); }
.adm-range-lead { margin: 0 0 12px; font-size: 12px; }
.adm-range-fields {
    display: flex;
    gap: 8px;
    align-items: center;
}
.adm-range-fields input[type="date"],
.adm-range-fields input[type="time"] {
    flex: 1;
    min-width: 0;
    width: 100%;
}
html:not(.light) .adm-range-fields input[type="date"],
html:not(.light) .adm-range-fields input[type="time"] {
    color-scheme: dark;
}
html.light .adm-range-fields input[type="date"],
html.light .adm-range-fields input[type="time"] {
    color-scheme: light;
}
.adm-range-preview {
    margin: 0 0 8px;
    font-size: 12px;
    line-height: 1.55;
    color: var(--adm-muted);
}
.adm-range-error {
    margin: 0 0 8px;
    font-size: 12px;
    color: var(--adm-danger);
}
.adm-seg-btn[data-model-overview-range="custom"],
.adm-seg-btn[data-model-usage-range="custom"],
.adm-seg-btn[data-billing-range="custom"],
.adm-seg-btn[data-usage-events-range="custom"],
.adm-seg-btn[data-stats-range="custom"] {
    min-width: 52px;
    padding-left: 10px;
    padding-right: 10px;
}
/* —— 模型管理（双层下划线选项卡） —— */
.adm-models-panel {
    max-width: min(1400px, 100%);
    display: flex;
    flex-direction: column;
    /* 顶栏约 57px + .adm-main 上下 padding 20+40 */
    height: calc(100vh - 57px - 60px);
    max-height: calc(100vh - 57px - 60px);
    min-height: 0;
    box-sizing: border-box;
    overflow: hidden;
}
.adm-models-panel .adm-models-layer {
    margin-top: 0;
    flex-shrink: 0;
}
.adm-models-panel .adm-models-layer + .adm-models-layer {
    margin-top: 2px;
}
.adm-models-layer-hint {
    margin: 10px 0 0;
    font-size: 12px;
    line-height: 1.4;
    flex-shrink: 0;
}
.adm-models-pane {
    padding-top: 10px;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.adm-model-usage {
    margin-top: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}
.adm-models-table tbody tr.adm-model-row-selected td {
    background: color-mix(in srgb, var(--adm-accent) 10%, transparent);
}
.adm-models-table tbody tr[data-filter-model] {
    cursor: pointer;
}
.adm-models-table tbody tr[data-filter-model]:hover td {
    background: color-mix(in srgb, var(--adm-accent) 6%, transparent);
}
.adm-model-usage .adm-billing-toolbar {
    flex-shrink: 0;
    align-items: flex-start;
}
.adm-model-usage .adm-billing-note {
    margin: 0;
    max-width: 56em;
}
.adm-model-usage .adm-usage-list {
    flex: 1 1 auto;
    max-height: none;
    min-height: 0;
    height: auto;
    overflow: auto;
}
.adm-model-usage .adm-usage-pager {
    flex-shrink: 0;
    margin-top: 0;
}
.adm-overview-table {
    min-width: 1080px;
}
.adm-overview-table th,
.adm-overview-table td {
    white-space: nowrap;
    font-size: 12px;
}
.adm-overview-num {
    font-variant-numeric: tabular-nums;
    text-align: right;
}
.adm-overview-seq {
    width: 3.2em;
    min-width: 3.2em;
}
.adm-models-table-wrap {
    border-radius: 12px;
    overflow: auto;
    max-height: min(70vh, 720px);
    box-shadow: var(--adm-shadow);
}
.adm-models-table th {
    font-size: 12px;
    letter-spacing: 0.02em;
    text-transform: none;
    position: sticky;
    top: 0;
    z-index: 1;
}
.adm-models-table td {
    padding: 8px 12px;
    vertical-align: middle;
    white-space: normal;
}
.adm-models-table tbody tr:last-child td { border-bottom: none; }
.adm-model-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.adm-model-cell-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.adm-model-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    font-weight: 650;
    letter-spacing: -0.02em;
    color: var(--adm-text);
}
.adm-res-chip {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--adm-accent);
    background: color-mix(in srgb, var(--adm-accent) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--adm-accent) 22%, transparent);
}
.adm-model-key {
    font-size: 11px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: var(--adm-muted);
    word-break: break-all;
}
.adm-tier-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.adm-badge.normal {
    background: color-mix(in srgb, var(--adm-muted) 16%, transparent);
    color: var(--adm-muted);
    font-weight: 600;
}
html.light .adm-badge.normal, body.light .adm-badge.normal {
    background: rgba(15, 23, 42, 0.06);
    color: #4b5563;
}
.adm-badge.vip,
.adm-badge.svip { font-weight: 650; }
.adm-models-table .adm-btn-edit {
    min-width: 72px;
}
.adm-model-edit-modal { width: min(440px, 96vw); }
.adm-model-edit-hint {
    margin: -4px 0 14px;
    font-size: 12px;
    line-height: 1.5;
}
.adm-model-edit-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 4px;
}
.adm-tier-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
}
.adm-tier-pill {
    display: inline-flex;
    cursor: pointer;
    margin: 0;
}
.adm-tier-pill input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.adm-tier-pill-ui {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 76px;
    height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--adm-border);
    background: var(--adm-panel);
    color: var(--adm-muted);
    font-size: 13px;
    font-weight: 650;
    transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}
.adm-tier-pill input:focus-visible + .adm-tier-pill-ui {
    outline: 2px solid color-mix(in srgb, var(--adm-accent) 55%, transparent);
    outline-offset: 2px;
}
.adm-tier-pill input:checked + .adm-tier-pill-ui.normal {
    color: var(--adm-text);
    border-color: color-mix(in srgb, var(--adm-muted) 45%, transparent);
    background: color-mix(in srgb, var(--adm-muted) 14%, transparent);
}
.adm-tier-pill input:checked + .adm-tier-pill-ui.vip {
    color: var(--adm-badge-vip-fg);
    border-color: color-mix(in srgb, var(--adm-badge-vip-fg) 45%, transparent);
    background: var(--adm-badge-vip-bg);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--adm-badge-vip-fg) 20%, transparent);
}
.adm-tier-pill input:checked + .adm-tier-pill-ui.svip {
    color: var(--adm-badge-svip-fg);
    border-color: color-mix(in srgb, var(--adm-badge-svip-fg) 45%, transparent);
    background: var(--adm-badge-svip-bg);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--adm-badge-svip-fg) 20%, transparent);
}
.adm-tier-checks label:not(.adm-tier-pill) {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--adm-text);
    cursor: pointer;
}
.adm-ctx {
    position: fixed;
    z-index: 200;
    min-width: 160px;
    background: var(--adm-ctx-bg);
    border: 1px solid var(--adm-border);
    border-radius: 10px;
    box-shadow: var(--adm-shadow, 0 12px 40px rgba(0,0,0,0.45));
    padding: 6px;
    display: none;
}
.adm-ctx.show { display: block; }
.adm-ctx button {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    color: var(--adm-text);
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}
.adm-ctx button:hover { background: rgba(61,139,253,0.15); }
.adm-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--adm-panel);
    color: var(--adm-text);
    border: 1px solid var(--adm-border);
    box-shadow: var(--adm-shadow);
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 13px;
    z-index: 300;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
}
.adm-toast.show { opacity: 1; }
.adm-toast.show.error {
    color: var(--adm-danger);
    border-color: color-mix(in srgb, var(--adm-danger) 45%, transparent);
}
.adm-empty { padding: 40px; text-align: center; color: var(--adm-muted); }
.adm-usage-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: auto;
    font-size: 12px;
    margin-top: 0;
}
.adm-usage-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}
.adm-usage-table th,
.adm-usage-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--adm-border);
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}
.adm-usage-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--adm-panel);
    color: var(--adm-muted);
    font-weight: 600;
    font-size: 12px;
}
.adm-usage-table td {
    color: var(--adm-text);
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.adm-usage-table td.adm-usage-cell-wrap {
    white-space: normal;
    word-break: break-all;
    max-width: 280px;
}
.adm-usage-table td.adm-usage-status {
    white-space: normal;
    max-width: 420px;
    overflow: visible;
    text-overflow: unset;
    word-break: break-word;
}
.adm-usage-table td.adm-usage-status.is-ok { color: #1a7f4b; }
.adm-usage-table td.adm-usage-status.is-bad { color: #b42318; }
.adm-usage-table td.adm-usage-status.is-run { color: #b54708; }
.adm-usage-status-cell {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px 8px;
    max-width: 100%;
}
.adm-usage-status-text {
    min-width: 0;
    flex: 1 1 12em;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    word-break: break-word;
    line-height: 1.45;
}
.adm-usage-view-btn {
    flex-shrink: 0;
    padding: 2px 8px;
    font-size: 12px;
    line-height: 1.4;
    border: 1px solid var(--adm-border);
    border-radius: 4px;
    background: var(--adm-panel);
    color: var(--adm-text);
    cursor: pointer;
}
.adm-usage-view-btn:hover { border-color: var(--adm-accent); color: var(--adm-accent); }
.adm-usage-view-btn:disabled { opacity: 0.55; cursor: wait; }

.adm-media-lightbox {
    position: fixed;
    inset: 0;
    z-index: 220;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px 24px 24px;
    background: rgba(0, 0, 0, 0.82);
}
.adm-media-lightbox.show { display: flex; }
.adm-media-lightbox-close {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}
.adm-media-lightbox-close:hover { background: rgba(255, 255, 255, 0.22); }
.adm-media-lightbox-stage {
    max-width: min(1200px, 96vw);
    max-height: min(86vh, 900px);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.adm-media-lightbox-stage video,
.adm-media-lightbox-stage img {
    max-width: 100%;
    max-height: min(86vh, 900px);
    width: auto;
    height: auto;
    border-radius: 6px;
    background: #000;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.adm-media-lightbox-stage img { background: transparent; }
.adm-lib-browse {
    width: min(920px, 100vw);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
/* 精品漫项目详情：宽度为原库浏览抽屉的 1.5 倍 */
.adm-lib-browse.adm-pro-browse {
    width: min(1380px, 98vw);
}
.adm-lib-browse-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.adm-lib-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border-bottom: 1px solid var(--adm-border);
    padding-bottom: 10px;
}
.adm-lib-tab {
    border: 0;
    background: transparent;
    color: var(--adm-muted);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
}
.adm-lib-tab.active, .adm-lib-tab:hover {
    background: rgba(61, 139, 253, 0.12);
    color: var(--adm-text);
}
.adm-lib-crumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--adm-muted);
}
.adm-lib-crumb button {
    border: 0;
    background: transparent;
    color: var(--adm-accent);
    cursor: pointer;
    padding: 0;
    font-size: 12px;
}
.adm-lib-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    flex: 1;
    overflow: auto;
    align-content: start;
    min-height: 240px;
}
.adm-lib-card {
    border: 1px solid var(--adm-border);
    border-radius: 10px;
    background: rgba(255,255,255,0.02);
    overflow: hidden;
    cursor: default;
    display: flex;
    flex-direction: column;
    min-height: 160px;
}
.adm-lib-card.is-folder { cursor: pointer; }
.adm-lib-card.is-folder:hover { border-color: rgba(61,139,253,0.45); }
.adm-lib-thumb {
    aspect-ratio: 1;
    background: #12161f;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--adm-muted);
    font-size: 12px;
    overflow: hidden;
}
.adm-lib-thumb img, .adm-lib-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* 库创作结果：完整展示、等比缩放，不裁切不拉伸 */
#admProGenGrid .adm-lib-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}
.adm-sd-video-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 160px;
}
.adm-sd-video-cell a {
    flex: 0 0 auto;
    color: #a78bfa;
    text-decoration: none;
    white-space: nowrap;
}
.adm-sd-video-cell a:hover { text-decoration: underline; }
.adm-sd-vid-thumb {
    position: relative;
    width: 112px;
    height: 63px;
    flex: 0 0 auto;
    border-radius: 6px;
    overflow: hidden;
    background: #12161f;
    border: 1px solid var(--adm-border);
}
.adm-sd-vid-thumb img,
.adm-sd-vid-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.adm-sd-vid-thumb .adm-sd-vid-fallback { display: none; }
.adm-lib-card-body { padding: 8px 10px 10px; }
.adm-lib-card-title {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.adm-lib-card-meta {
    margin-top: 2px;
    font-size: 11px;
    color: var(--adm-muted);
}
.adm-demo-upload {
    max-width: none;
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius);
    background: var(--adm-table-wrap);
}
.adm-demo-queue-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 4px;
}
.adm-demo-queue-toolbar label.adm-btn {
    margin: 0;
    cursor: pointer;
    display: inline-block;
}
.adm-demo-queue-wrap { margin: 0; }
.adm-demo-drag {
    width: 36px;
    height: 44px;
    border: 0;
    padding: 0;
    margin: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--adm-muted);
    cursor: grab;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
    user-select: none;
}
.adm-demo-drag:hover { background: var(--adm-tab-active-bg); color: var(--adm-text); }
.adm-demo-drag:active,
tbody.is-reordering .adm-demo-drag { cursor: grabbing; }
.adm-demo-drag-grip {
    display: block;
    width: 16px;
    height: 11px;
    background:
        linear-gradient(currentColor, currentColor) 0 0 / 100% 2px no-repeat,
        linear-gradient(currentColor, currentColor) 0 4.5px / 100% 2px no-repeat,
        linear-gradient(currentColor, currentColor) 0 9px / 100% 2px no-repeat;
    border-radius: 1px;
    pointer-events: none;
}
tbody.is-reordering tr {
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
tbody.is-reordering tr.is-dragging {
    position: relative;
    z-index: 12;
    transition: none;
    opacity: 0.97;
}
tbody.is-reordering tr.is-dragging td {
    background: var(--adm-panel);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}
tbody.is-reordering tr.is-dragging td:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}
tbody.is-reordering tr.is-dragging td:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}
.adm-demo-queue-table textarea,
.adm-demo-queue-table input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--adm-border);
    border-radius: 8px;
    background: var(--adm-panel);
    color: var(--adm-text);
    padding: 6px 8px;
    font: inherit;
    font-size: 13px;
}
.adm-demo-queue-table textarea {
    resize: vertical;
    min-height: 52px;
}
.adm-demo-status { font-size: 12px; color: var(--adm-muted); }
.adm-demo-status.is-up { color: var(--adm-accent); }
.adm-demo-status.is-ok { color: var(--adm-ok); }
.adm-demo-status.is-err { color: var(--adm-danger); }
.adm-demo-published-title {
    margin: 8px 0 10px;
    font-size: 14px;
    font-weight: 600;
}
.adm-demo-upload.is-drop {
    outline: 2px dashed var(--adm-accent);
    outline-offset: 2px;
}
.adm-demo-upload .adm-form-row input[type="text"],
.adm-demo-upload .adm-form-row input[type="file"],
.adm-demo-upload .adm-form-row textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--adm-border);
    border-radius: 8px;
    background: var(--adm-panel);
    color: var(--adm-text);
    padding: 8px 10px;
    font: inherit;
    font-size: 13px;
}
.adm-demo-upload .adm-form-row textarea { resize: vertical; min-height: 64px; }
.adm-demo-thumb {
    width: 88px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    background: #000;
    display: block;
    pointer-events: none;
    -webkit-user-drag: none;
    user-select: none;
}
.adm-demo-thumb-video {
    width: 88px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    background: #000;
    display: block;
    pointer-events: none;
    -webkit-user-drag: none;
    user-select: none;
}
.adm-demo-cover-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    min-width: 88px;
}
.adm-demo-cover-empty {
    width: 88px;
    height: 56px;
    border-radius: 6px;
    border: 1px dashed var(--adm-border);
    background: var(--adm-panel);
    color: var(--adm-muted);
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}
.adm-demo-cover-pick {
    margin: 0;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    color: var(--adm-accent);
}
.adm-demo-cover-pick input { display: none; }
.adm-demo-cover-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.adm-demo-cover-actions .adm-btn { font-size: 12px; padding: 4px 8px; }
.adm-demo-published-table {
    table-layout: fixed;
}
.adm-demo-published-table th,
.adm-demo-published-table td {
    vertical-align: middle;
}
.adm-demo-published-table td:nth-child(3),
.adm-demo-published-table td:nth-child(4),
.adm-demo-published-table td:nth-child(6) {
    white-space: normal;
}
.adm-demo-published-table td:last-child {
    white-space: nowrap;
    width: 128px;
}
.adm-demo-row-actions {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
}
.adm-demo-row-actions .adm-btn {
    flex: 0 0 auto;
    padding: 6px 10px;
}
.adm-table textarea[data-demo-p-field],
.adm-table input[data-demo-p-field] {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--adm-border);
    border-radius: 8px;
    background: var(--adm-panel);
    color: var(--adm-text);
    padding: 6px 8px;
    font: inherit;
    font-size: 13px;
}
.adm-table textarea[data-demo-p-field] {
    resize: vertical;
    min-height: 52px;
}
.adm-demo-uploader {
    font-size: 12px;
    color: var(--adm-muted);
    line-height: 1.4;
}

.adm-stats-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: calc(100vh - 57px - 60px);
    max-height: calc(100vh - 57px - 60px);
}
.adm-stats-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-shrink: 0;
}
.adm-picker { position: relative; }
.adm-picker-toggle {
    min-width: 132px;
    text-align: left;
}
.adm-picker-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 40;
    width: min(340px, 78vw);
    max-height: min(420px, 60vh);
    display: flex;
    flex-direction: column;
    padding: 10px;
    border: 1px solid var(--adm-border);
    border-radius: 12px;
    background: var(--adm-panel);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
}
.adm-picker-panel-wide { width: min(420px, 86vw); }
.adm-picker-panel[hidden] { display: none !important; }
.adm-picker-panel input[type="search"] {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 8px;
    background: var(--adm-panel);
    border: 1px solid var(--adm-border);
    color: var(--adm-text);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
}
.adm-picker-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}
.adm-picker-list {
    overflow: auto;
    min-height: 120px;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.adm-picker-group {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid var(--adm-border);
}
.adm-picker-group:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}
.adm-picker-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 650;
    color: var(--adm-muted);
    margin-bottom: 4px;
}
.adm-picker-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 5px 4px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--adm-text);
    cursor: pointer;
}
.adm-picker-item:hover { background: var(--adm-tab-active-bg); }
.adm-picker-item input { margin-top: 2px; flex-shrink: 0; }
.adm-picker-item-text { min-width: 0; line-height: 1.35; }
.adm-picker-item-sub {
    display: block;
    font-size: 11px;
    color: var(--adm-muted);
}
.adm-stats-model-modal {
    width: min(1080px, 96vw);
    height: min(760px, 92vh);
    max-height: 92vh;
    padding: 16px 16px 12px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    box-sizing: border-box;
}
.adm-stats-model-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}
.adm-stats-model-head h3 { margin: 0; }
.adm-stats-model-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 12px 0 10px;
    flex-shrink: 0;
}
.adm-stats-model-toolbar input[type="search"] {
    flex: 1 1 240px;
    min-width: 180px;
}
.adm-stats-model-body {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: 196px 1fr;
    gap: 12px;
}
.adm-stats-model-nav {
    overflow: auto;
    border: 1px solid var(--adm-border);
    border-radius: 12px;
    padding: 6px;
    background: color-mix(in srgb, var(--adm-table-head) 70%, var(--adm-panel));
}
.adm-stats-model-nav-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 0;
    background: transparent;
    color: var(--adm-text);
    text-align: left;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
}
.adm-stats-model-nav-btn > span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.adm-stats-model-nav-btn:hover,
.adm-stats-model-nav-btn.active {
    background: var(--adm-panel);
}
.adm-stats-model-nav-count {
    color: var(--adm-muted);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}
.adm-stats-model-board {
    overflow: auto;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    align-content: start;
    gap: 10px;
}
.adm-stats-model-card {
    border: 1px solid var(--adm-border);
    border-radius: 12px;
    padding: 10px;
    background: var(--adm-panel);
    min-width: 0;
}
.adm-stats-model-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.adm-stats-model-card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--adm-text);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.adm-stats-model-card-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.adm-stats-model-card-actions .adm-btn {
    padding: 2px 8px;
    font-size: 11px;
}
.adm-stats-model-chips {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 6px;
}
.adm-stats-model-chip {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 0;
    padding: 6px 8px;
    border: 1px solid var(--adm-border);
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.3;
    cursor: pointer;
    min-width: 0;
}
.adm-stats-model-chip:hover {
    background: var(--adm-tab-active-bg);
}
.adm-stats-model-chip.is-on {
    border-color: color-mix(in srgb, var(--adm-accent) 45%, var(--adm-border));
    background: color-mix(in srgb, var(--adm-accent) 10%, var(--adm-panel));
}
.adm-stats-model-chip input { margin-top: 1px; flex-shrink: 0; }
.adm-stats-model-chip span {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.adm-stats-model-chip b {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.adm-stats-model-chip i {
    font-style: normal;
    font-size: 11px;
    color: var(--adm-muted);
}
.adm-stats-model-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
    flex-shrink: 0;
}
.adm-stats-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
    flex-shrink: 0;
}
.adm-stats-kpi {
    border: 1px solid var(--adm-border);
    border-radius: 12px;
    padding: 10px 12px;
    background: var(--adm-panel);
}
.adm-stats-kpi-label {
    font-size: 12px;
    color: var(--adm-muted);
}
.adm-stats-kpi-value {
    margin-top: 4px;
    font-size: 18px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--adm-text);
}
.adm-stats-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}
.adm-stats-chart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.adm-stats-chart {
    min-height: 380px;
}
.adm-stats-colchart {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 8px;
    height: min(52vh, 520px);
    min-height: 360px;
}
.adm-stats-colchart-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    padding: 26px 0 52px;
    font-size: 11px;
    line-height: 1;
    color: var(--adm-muted);
    font-variant-numeric: tabular-nums;
}
.adm-stats-colchart-main {
    position: relative;
    min-width: 0;
    border-left: 1px solid var(--adm-border);
    border-bottom: 1px solid var(--adm-border);
}
.adm-stats-colchart-grid {
    position: absolute;
    inset: 26px 0 52px 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}
.adm-stats-colchart-grid i {
    display: block;
    height: 0;
    border-top: 1px dashed color-mix(in srgb, var(--adm-muted) 28%, transparent);
}
.adm-stats-colchart-grid i.is-base { border-top-color: transparent; }
.adm-stats-colchart-cols {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    align-items: stretch;
    justify-content: space-evenly;
    gap: 8px;
    padding: 0 10px;
    overflow-x: auto;
}
.adm-stats-col {
    flex: 1 1 72px;
    max-width: 128px;
    min-width: 56px;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.adm-stats-col-plot {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding-top: 26px;
}
.adm-stats-col-barwrap {
    width: 100%;
    height: var(--h);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}
.adm-stats-col-val {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--adm-text);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.adm-stats-col-bar {
    width: 58%;
    min-width: 18px;
    max-width: 44px;
    height: 100%;
    min-height: 4px;
    border-radius: 9px 9px 3px 3px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--c) 55%, #fff) 0%, var(--c) 62%);
    box-shadow: 0 10px 18px color-mix(in srgb, var(--c) 32%, transparent);
    transition: transform 0.16s ease, filter 0.16s ease;
}
.adm-stats-col:hover .adm-stats-col-bar {
    filter: brightness(1.08);
    transform: translateY(-3px);
}
.adm-stats-col-stack {
    width: 58%;
    min-width: 18px;
    max-width: 44px;
    height: 100%;
    min-height: 4px;
    display: flex;
    flex-direction: column-reverse;
    border-radius: 9px 9px 3px 3px;
    overflow: hidden;
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.14);
    transition: transform 0.16s ease, filter 0.16s ease;
}
.adm-stats-col:hover .adm-stats-col-stack {
    filter: brightness(1.06);
    transform: translateY(-3px);
}
.adm-stats-col-seg {
    display: block;
    width: 100%;
    min-height: 3px;
}
.adm-stats-col-label {
    flex: 0 0 52px;
    margin-top: 8px;
    font-size: 11px;
    line-height: 1.25;
    color: var(--adm-muted);
    text-align: center;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-all;
}
.adm-stats-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 12px;
    font-size: 12px;
    color: var(--adm-muted);
}
.adm-stats-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.adm-stats-legend-item i {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

@media (max-width: 800px) {
    .adm-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
    .adm-nav { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--adm-border); }
    .adm-nav button { white-space: nowrap; }
    /* 窄屏侧栏变顶栏，模型区高度再减一层导航 */
    .adm-models-panel {
        height: calc(100vh - 57px - 60px - 52px);
        max-height: calc(100vh - 57px - 60px - 52px);
    }
    .adm-stats-panel {
        height: auto;
        max-height: none;
    }
    .adm-stats-model-body {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 132px) minmax(0, 1fr);
    }
    .adm-stats-model-nav {
        display: flex;
        gap: 6px;
        overflow: auto;
        padding: 6px;
    }
    .adm-stats-model-nav-btn {
        width: auto;
        flex: 0 0 auto;
        white-space: nowrap;
    }
    .adm-stats-colchart {
        height: 320px;
        min-height: 280px;
        grid-template-columns: 48px minmax(0, 1fr);
    }
}

/* 模型配置与历史调用共用管理入口，编辑页延续独立权限检查。 */
.adm-model-routes-frame{display:block;width:100%;height:calc(100dvh - 180px);min-height:540px;border:0;border-radius:12px;color-scheme:normal}
