:root {
    color-scheme: light;
    --ink: #202925;
    --text: var(--ink);
    --muted: #69736f;
    --line: #dfe5e1;
    --surface: #ffffff;
    --surface-soft: #f7f9f8;
    --surface-muted: #f1f4f2;
    --surface-alt: #f7f9f8;
    --surface-hover: #f1f5f3;
    --line-soft: #edf0ee;
    --line-strong: #cad4cf;
    /* 弹窗尺寸档位（2026-10-21 定稿统一；2026-10-27 用户定稿：宽高全局档位制、默认视口 80%）：
       默认 large=80vw×80vh（业内大弹窗上限惯例：Ant Design 大 modal/GitHub 高级筛选≈80vw），
       small=小确认框（480px 档、高度自适应），full=铺满视口。
       全站弹窗一处调改；调用方用 AppModal 的 Size 档位，不再散装像素。 */
    --modal-width: 80vw;
    --modal-height: 80vh;
    --modal-width-small: 480px;
    --modal-height-small: auto;
    --canvas: #f5f7f6;
    --primary: #28745a;
    --primary-hover: #205f49;
    --primary-strong: #21684e;
    --primary-soft: #e9f7f1;
    --accent: var(--primary);
    --danger: #a64040;
    --danger-hover: #8c3434;
    --sidebar-bg: #ffffff;
    --sidebar-border: #e5e9e7;
    --sidebar-text: #56625d;
    --sidebar-muted: #8a9691;
    --sidebar-hover: #f2f5f3;
    --sidebar-active: #e9f7f1;
    --topbar-bg: rgba(255, 255, 255, .88);
    --popover-shadow: 0 14px 38px rgba(18, 28, 24, .14);
    --form-control-height: 40px;
    --form-control-color: #27322e;
    --form-control-bg: #ffffff;
    --form-control-border: #cad4cf;
    --form-control-placeholder: #a0aaa6;
    --form-control-focus: #5a9c82;
    --form-control-focus-ring: rgba(48, 135, 101, .12);
    --form-control-radius: 5px;
    --management-list-body-font: .83rem;
    --management-list-header-font: .76rem;
    --management-list-primary-font: .88rem;
    --management-list-secondary-font: .75rem;
    --management-list-action-font: .69rem;
    --management-list-control-font: .8rem;
    --management-list-pagination-font: .8rem;
    /* 语义别名：局部样式表里出现过的 --border/--text-muted 等此前从未定义，
       导致引用处边框/阴影/焦点环静默丢失；统一收敛到既有令牌（暗色主题随之联动）。 */
    --border: var(--line);
    --border-strong: var(--line-strong);
    --border-subtle: var(--line-soft);
    --text-muted: var(--muted);
    --text-secondary: var(--muted);
    --surface-subtle: var(--surface-soft);
    --success: #216448;
    --avatar-start: #2d8a68;
    --avatar-end: #4cb889;
    --account-avatar-start: #399777;
    --account-avatar-end: #21684e;
    --focus: var(--form-control-focus);
    --shadow-sm: 0 1px 3px rgba(22, 34, 28, .16);
    /* 图表色（与 frontend-blazor/Models/OpsChartPalette.cs 一一对应，改一处必须同步另一处） */
    --chart-volume: #0b76ce;   /* 蓝=量（请求量柱、E2E 样本） ↔ OpsChartPalette.Volume */
    --chart-quality: #ff9800;  /* 橙=质（错误率线、限流 429/529） ↔ OpsChartPalette.Quality */
    --chart-ttft: #7c3aed;     /* 紫=TTFT 样本、成功 2xx ↔ OpsChartPalette.Ttft（2026-10-23 用户裁决：统计图去绿） */
    --chart-error: #e4112f;    /* 红=5xx 硬错误 ↔ OpsChartPalette.Error */
    --chart-neutral: #7d8883;  /* 灰=客户端断开 499 ↔ OpsChartPalette.Neutral */
    --chart-amber: #ffc307;    /* 黄=其他状态码 ↔ OpsChartPalette.Amber */
    /* 状态语义色（ops 徽标/点/构成条/闪烁；收敛模型监控页由来已久的两档绿口径） */
    --status-ok: #059669;   --status-ok-soft: #d1fae5;
    --status-warn: #d97706; --status-warn-soft: #fef3c7;
    --status-bad: #dc2626;  --status-bad-soft: #fee2e2;
    --status-info: #2563eb; --status-info-soft: #eff6ff;
    font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    font-synthesis: none;
    letter-spacing: 0;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --ink: #f1f5f9;
    --muted: #94a3b8;
    --line: #26344a;
    --surface: #111c2c;
    --surface-soft: #0d1725;
    --surface-muted: #18263a;
    --surface-alt: #162337;
    --surface-hover: #19273b;
    --line-soft: #1e2c41;
    --line-strong: #3a4a61;
    --canvas: #050b16;
    --primary: #2dd4a7;
    --primary-hover: #5ee3bd;
    --primary-strong: #5ee3bd;
    --primary-soft: rgba(25, 190, 148, .15);
    --accent: var(--primary);
    --danger: #ef7777;
    --danger-hover: #f18d8d;
    --sidebar-bg: #111a2b;
    --sidebar-border: #223149;
    --sidebar-text: #c0cad8;
    --sidebar-muted: #78879d;
    --sidebar-hover: #1a2940;
    --sidebar-active: rgba(25, 190, 148, .15);
    --topbar-bg: rgba(20, 31, 48, .92);
    --popover-shadow: 0 18px 46px rgba(0, 0, 0, .38);
    --form-control-color: var(--ink);
    --form-control-bg: var(--surface);
    --form-control-border: #394640;
    --form-control-placeholder: #68756f;
    --form-control-focus: var(--primary);
    --success: #8be0ba;
    /* 状态语义色暗色覆盖（图表六色数据墨色中性，暗底可读保持不变） */
    --status-ok: #6ee7b7;   --status-ok-soft: rgba(4, 120, 87, .24);
    --status-warn: #fcd34d; --status-warn-soft: rgba(180, 83, 9, .24);
    --status-bad: #fda4af;  --status-bad-soft: rgba(190, 24, 93, .22);
    --status-info: #93c5fd; --status-info-soft: rgba(37, 99, 235, .2);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .4);
    --form-control-focus-ring: rgba(45, 212, 167, .16);
    --avatar-start: #2d8a68;
    --avatar-end: #4cb889;
    --account-avatar-start: #399777;
    --account-avatar-end: #21684e;
}

/* Optional B palette. Add data-accent="blue" to the document root to enable it. */
html[data-accent="blue"] {
    --primary: #1f6feb;
    --primary-hover: #1557b0;
    --primary-strong: #134e86;
    --primary-soft: #eaf3ff;
    --accent: var(--primary);
    --sidebar-active: #eaf3ff;
    --form-control-focus: #4f91e8;
    --form-control-focus-ring: rgba(31, 111, 235, .16);
    --avatar-start: #1f6feb;
    --avatar-end: #4f91e8;
    --account-avatar-start: #1f6feb;
    --account-avatar-end: #134e86;
}

html[data-theme="dark"][data-accent="blue"] {
    --primary: #4f9dff;
    --primary-hover: #78b5ff;
    --primary-strong: #9bc7ff;
    --primary-soft: rgba(79, 157, 255, .16);
    --sidebar-active: rgba(79, 157, 255, .16);
    --form-control-focus: var(--primary);
    --form-control-focus-ring: rgba(79, 157, 255, .18);
    --avatar-start: #1f6feb;
    --avatar-end: #4f9dff;
    --account-avatar-start: #1f6feb;
    --account-avatar-end: #134e86;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    min-width: 320px;
    min-height: 100%;
    margin: 0;
    color: var(--ink);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    background: var(--canvas);
    letter-spacing: 0;
}

button,
input,
select,
textarea {
    color: inherit;
    font: inherit;
    letter-spacing: 0;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button:not(:disabled),
select:not(:disabled) {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: .58;
}

/* 表单禁用态：不可编辑字段置灰、悬停显示禁用光标（全局覆盖所有新增/编辑弹窗）。 */
input:disabled,
select:disabled,
textarea:disabled {
    cursor: not-allowed;
    color: var(--muted);
    background: var(--surface-muted);
    opacity: .68;
}

/* 必填字段红星（沿用 AdminChannelMonitor 的 .required 约定，全局化）。 */
.required { color: var(--danger); font-weight: 650; }

a {
    color: var(--primary);
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1:focus {
    outline: none;
}

code {
    color: var(--ink);
    font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
    font-size: .82rem;
}

.markdown-body { max-width: 78ch; color: var(--ink); font-size: .9rem; line-height: 1.78; overflow-wrap: anywhere; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body > :last-child { margin-bottom: 0; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 { color: var(--ink); line-height: 1.28; letter-spacing: -.015em; }
.markdown-body h1 { margin: 0 0 16px; font-size: 1.72rem; }
.markdown-body h2 { margin: 28px 0 10px; padding-bottom: 7px; border-bottom: 1px solid var(--line); font-size: 1.22rem; }
.markdown-body h3 { margin: 22px 0 8px; font-size: 1rem; }
.markdown-body h4 { margin: 18px 0 6px; font-size: .9rem; }
.markdown-body p { margin: 0 0 14px; }
.markdown-body ul, .markdown-body ol { margin: 0 0 16px; padding-left: 1.4rem; }
.markdown-body li + li { margin-top: 5px; }
.markdown-body a { color: var(--primary); text-underline-offset: 3px; }
.markdown-body blockquote { margin: 18px 0; padding: 11px 15px; color: var(--muted); background: var(--surface-soft); border-left: 3px solid var(--primary); border-radius: 0 7px 7px 0; }
.markdown-body :not(pre) > code { padding: 2px 5px; color: var(--primary-strong); background: var(--surface-muted); border: 1px solid var(--line-soft); border-radius: 4px; }
.markdown-body table { display: block; max-width: 100%; margin: 18px 0; overflow-x: auto; border-collapse: collapse; }
.markdown-body th, .markdown-body td { padding: 8px 11px; text-align: left; border: 1px solid var(--line); }
.markdown-body th { color: var(--ink); font-weight: 700; background: var(--surface-soft); }
.markdown-code-block { margin: 18px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #17201d; box-shadow: 0 8px 22px rgba(18, 28, 24, .1); }
.markdown-code-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 10px 7px 13px; color: #b7c9bf; font: .68rem/1.2 "Cascadia Code", "SFMono-Regular", Consolas, monospace; background: #202c28; border-bottom: 1px solid #314039; }
.markdown-copy-button { padding: 4px 8px; color: #e5f3ec; background: transparent; border: 1px solid #60756a; border-radius: 5px; font: inherit; cursor: pointer; }
.markdown-copy-button:hover, .markdown-copy-button:focus-visible { color: #fff; background: #315142; border-color: #94c8ae; }
.markdown-code-block pre { margin: 0; padding: 15px 16px; overflow-x: auto; color: #e9f5ef; font: .78rem/1.65 "Cascadia Code", "SFMono-Regular", Consolas, monospace; }
.markdown-code-block pre code { color: inherit; font: inherit; white-space: pre; }
html[data-theme="dark"] .markdown-code-block { background: #0b1220; border-color: #26344a; }
html[data-theme="dark"] .markdown-code-toolbar { color: #a8b8c9; background: #111c2c; border-color: #26344a; }
html[data-theme="dark"] .markdown-copy-button { color: #c4d3e1; border-color: #4b6075; }
html[data-theme="dark"] .markdown-copy-button:hover, html[data-theme="dark"] .markdown-copy-button:focus-visible { color: #f8fafc; background: #1d3546; border-color: #78a7c4; }
@media (max-width: 680px) { .markdown-body { font-size: .86rem; } .markdown-body h1 { font-size: 1.45rem; } .markdown-body h2 { margin-top: 22px; font-size: 1.08rem; } .markdown-code-block pre { padding: 13px; font-size: .74rem; } }

.lucide-icon {
    display: block;
    flex: 0 0 auto;
}

.brand-logo {
    display: block;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.page-header h1 {
    margin-bottom: 3px;
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.25;
}

.page-header p,
.section-header p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: .83rem;
}

.page-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.section-header h2,
.settings-copy h2 {
    margin-bottom: 2px;
    font-size: 1rem;
    font-weight: 700;
}

.content-section {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.page-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.narrow-content {
    max-width: 980px;
}

.json-panel {
    min-width: 0;
}

.json-editor,
.json-readonly {
    display: block;
    width: calc(100% - 40px);
    min-height: 360px;
    margin: 20px;
    padding: 14px;
    overflow: auto;
    color: var(--ink);
    font: .78rem/1.6 "Cascadia Code", "SFMono-Regular", Consolas, monospace;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 5px;
}

.json-editor {
    resize: vertical;
}

.json-readonly {
    min-height: 120px;
    margin-top: 0;
}

.form-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    padding: 20px;
}

.form-row .grow {
    flex: 1 1 auto;
}

.announcement-list {
    display: grid;
    gap: 12px;
}

.announcement-item {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.announcement-item .section-header {
    padding: 16px 18px;
}

.announcement-content {
    padding: 18px;
    color: var(--ink);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.public-home {
    display: grid;
    min-height: min(620px, calc(100vh - 110px));
    align-items: center;
    padding: clamp(28px, 7vw, 90px);
    background: #17201d;
    border-radius: 8px;
    grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr);
    gap: clamp(34px, 7vw, 100px);
}

.public-home-copy {
    max-width: 720px;
    color: #f4faf7;
}

.public-home-copy .eyebrow {
    color: #75d1a7;
    font-size: .72rem;
    font-weight: 750;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.public-home-copy h1 {
    margin: 14px 0 16px;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.08;
}

.public-home-copy p {
    max-width: 620px;
    color: #b6c9c0;
    font-size: 1rem;
}

.public-home-copy .button.secondary {
    color: #ecf6f1;
    background: transparent;
    border-color: #71847b;
}

.public-home-facts {
    display: grid;
    gap: 10px;
}

.public-home-facts > div {
    display: grid;
    gap: 3px;
    padding: 15px 17px;
    color: #eaf4ef;
    background: #202c28;
    border: 1px solid #314039;
    border-radius: 5px;
}

.public-home-facts strong {
    font-size: .9rem;
}

.public-home-facts span {
    color: #a6bbb1;
    font-size: .74rem;
}

.auth-layout {
    min-height: 100vh;
}

.setup-page {
    display: grid;
    min-height: 100vh;
    padding: 38px 16px 54px;
    align-content: center;
    justify-items: center;
    background: var(--canvas);
}

.setup-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
}

.setup-success-icon {
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--primary);
    border-radius: 6px;
}

.setup-brand .brand-logo {
    display: block;
    width: 38px;
    height: 38px;
}

.setup-brand > span:last-child {
    display: grid;
    gap: 1px;
}

.setup-brand strong {
    font-size: 1.05rem;
}

.setup-brand small {
    color: var(--muted);
    font-size: .68rem;
}

.setup-panel {
    width: min(100%, 760px);
    padding: clamp(20px, 4vw, 34px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 7px;
    box-shadow: 0 14px 38px rgba(26, 38, 32, .08);
}

.setup-header {
    margin-bottom: 26px;
    text-align: center;
}

.setup-header .eyebrow {
    color: var(--primary);
    font-size: .7rem;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.setup-header h1 {
    margin: 8px 0 4px;
    font-size: 1.45rem;
}

.setup-header p,
.setup-step-heading p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: .8rem;
}

.setup-steps {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin-bottom: 28px;
}

.setup-step {
    display: grid;
    min-width: 64px;
    justify-items: center;
    gap: 6px;
    color: #98a39e;
    text-align: center;
}

.setup-step > span {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    color: #7c8782;
    font-size: .75rem;
    font-weight: 700;
    background: var(--surface-muted);
    border-radius: 50%;
}

.setup-step small {
    font-size: .68rem;
    white-space: nowrap;
}

.setup-step.active,
.setup-step.complete {
    color: var(--ink);
}

.setup-step.active > span,
.setup-step.complete > span {
    color: #fff;
    background: var(--primary);
}

.setup-step-line {
    width: clamp(20px, 8vw, 68px);
    height: 1px;
    margin: 15px 8px 0;
    background: var(--line);
}

.setup-step-line.complete {
    background: var(--primary);
}

.setup-form-step {
    display: grid;
    gap: 18px;
}

.setup-step-heading h2 {
    margin-bottom: 3px;
    font-size: 1.08rem;
}

.setup-test-button {
    justify-self: start;
}

.single-column {
    grid-template-columns: minmax(0, 1fr);
}

.setup-summary {
    display: grid;
    gap: 10px;
}

.setup-summary > div {
    display: grid;
    gap: 3px;
    padding: 13px 15px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 5px;
}

.setup-summary span {
    color: var(--muted);
    font-size: .7rem;
}

.setup-summary strong {
    overflow-wrap: anywhere;
    font-size: .84rem;
    font-weight: 650;
}

.setup-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.setup-success {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 26px 12px 14px;
    text-align: center;
}

.setup-success-icon {
    width: 52px;
    height: 52px;
}

.setup-success h2 {
    margin: 0;
    font-size: 1.15rem;
}

.setup-success p {
    margin: 0;
    color: var(--muted);
    font-size: .8rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 7px 14px;
    font-size: .82rem;
    font-weight: 650;
    line-height: 1.2;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 5px;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.button.small,
.button.compact {
    min-height: 36px;
    padding: 6px 11px;
    font-size: .78rem;
}

.button.primary {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

.button.primary:hover:not(:disabled) {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.button.secondary {
    color: var(--ink);
    background: var(--surface);
    border-color: var(--form-control-border);
}

.button.secondary:hover:not(:disabled) {
    background: var(--surface-hover);
    border-color: var(--line);
}

/* 自装 primary/secondary-button 已全站退役（2026-11-10 工具栏统一批次）：统一走 .button 体系。 */
.button.link {
    min-height: 30px;
    padding: 4px 7px;
    color: var(--primary);
    background: transparent;
    border-color: transparent;
    font-size: .76rem;
}

.button.link:hover:not(:disabled) {
    background: var(--surface-muted);
    border-color: var(--line);
}

.button.link.danger {
    color: var(--danger);
    background: transparent;
    border-color: transparent;
}

.button.link.danger:hover:not(:disabled) {
    color: var(--danger-hover);
    background: color-mix(in srgb, var(--danger) 9%, var(--surface));
    border-color: color-mix(in srgb, var(--danger) 22%, var(--line));
}

/* Shared view switcher: visually matches management toolbar secondary buttons. */
.segmented-control {
    display: inline-flex;
    padding: 0;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.segmented-control button {
    display: inline-flex;
    min-height: 38px;
    padding: 7px 14px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--form-control-border);
    border-radius: 5px;
    font: inherit;
    font-size: .82rem;
    font-weight: 650;
    line-height: 1.2;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.segmented-control button:hover:not(:disabled) {
    background: var(--surface-hover);
    border-color: var(--line);
}

.segmented-control button.active {
    color: var(--primary-strong);
    background: #edf7f3;
    border-color: #82ad9c;
}

.segmented-control.compact button {
    min-height: 34px;
    padding: 6px 11px;
    font-size: .78rem;
}

.button.danger {
    color: #fff;
    background: var(--danger);
    border-color: var(--danger);
}

.button.danger:hover:not(:disabled) {
    background: var(--danger-hover);
    border-color: var(--danger-hover);
}

.icon-button {
    display: inline-grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    padding: 0;
    place-items: center;
    color: var(--muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 5px;
}

.icon-button:hover:not(:disabled),
.icon-button:focus-visible {
    color: var(--ink);
    background: var(--surface-hover);
}

.icon-button.danger {
    color: var(--danger);
}

.icon-button.danger:hover:not(:disabled) {
    color: #fff;
    background: var(--danger);
}

/* Shared table actions used by the model-access and upstream sequence views.
   2026-10-27 全站操作栏统一（基准=上游厂商序列页签）：row-actions/row-action 提升为全局，
   各列表页行内操作一律竖排「图标+文案」按钮，删除页内私有 text-action/icon-button 变体。 */
.row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
}

/* 模型序列勾选列（批量删除）：窄列居中，表头复选框全选/清空本页。 */
.model-sequence-panel .seq-select-cell {
    width: 40px;
    min-width: 40px;
    text-align: center;
    white-space: nowrap;
}

.model-sequence-panel .seq-select-cell input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: var(--primary);
}

.row-action {
    display: inline-flex;
    min-width: 44px;
    min-height: 38px;
    padding: 5px 6px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    color: var(--muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: .75rem;
    line-height: 1.15;
    cursor: pointer;
    transition: color .15s ease, background .15s ease, border-color .15s ease;
}

.row-action:hover:not(:disabled),
.row-action:focus-visible {
    color: var(--primary);
    background: var(--surface-muted);
    border-color: var(--line);
}

.row-action.danger:hover:not(:disabled),
.row-action.danger:focus-visible {
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 9%, var(--surface));
    border-color: color-mix(in srgb, var(--danger) 22%, var(--line));
}

/* The vendor sequence switch is a button, so it needs the same reset as the
   checkbox based switch used by the legacy account table. */
/* 启停开关列（2026-10-28 对齐 Providers「参与调度」基准）：84px 窄列 + 列头/单元格居中——
   全站 schedule-column 语义统一（厂商序列/模型序列两页与 Providers 同款，值原样取自基准）。 */
.schedule-column { width: 84px; min-width: 84px; text-align: center !important; }
.schedule-column .table-sort { width: 100%; justify-content: center; }

.schedule-switch[role="switch"] {
    display: block;
    position: relative;
    width: 38px;
    height: 22px;
    margin: 0 auto;
    padding: 0;
    appearance: none;
    overflow: hidden;
    color: transparent;
    background: var(--line);
    border: 0;
    border-radius: 999px;
    box-sizing: border-box;
    line-height: 0;
    cursor: pointer;
    transition: background-color .18s ease;
}

.schedule-switch[role="switch"]::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    content: "";
    background: var(--surface);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
    transform: translateX(0);
    transition: transform .18s ease;
}

.schedule-switch[role="switch"].on {
    background: var(--primary);
}

.schedule-switch[role="switch"].on::after {
    transform: translateX(16px);
}

.schedule-switch[role="switch"]:focus-visible {
    outline: 3px solid rgba(48, 135, 101, .22);
    outline-offset: 2px;
}

.schedule-switch[role="switch"]:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.button:focus-visible,
.icon-button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(48, 135, 101, .22);
    outline-offset: 1px;
}

/* 性能指标帮助：? 触发按钮与「性能指标说明」弹窗（模型评测） */
.metric-help-trigger {
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 50%;
}

.metric-help-trigger:hover:not(:disabled),
.metric-help-trigger:focus-visible {
    color: var(--ink);
    background: var(--surface-hover);
}

.metric-help {
    display: grid;
    gap: 12px;
}

.metric-help-scenario {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.metric-help dl {
    margin: 0;
    display: grid;
    gap: 8px;
}

.metric-help dl > div {
    display: grid;
    gap: 3px;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.metric-help dt {
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
}

.metric-help dd {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.65;
}

.metric-help-tip {
    margin: 0;
    padding: 10px 12px;
    color: var(--ink);
    font-size: 13px;
    line-height: 1.65;
    background: rgba(48, 135, 101, .08);
    border-radius: 8px;
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: var(--primary);
    font-size: .8rem;
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
}

.text-link:hover {
    text-decoration: underline;
}

.toolbar {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    min-height: 54px;
    margin-bottom: 14px;
    padding: 8px 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.toolbar-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar-inline .text-input {
    min-width: 0;
    flex: 1 1 auto;
}

.picker-list {
    display: grid;
    max-height: 320px;
    gap: 6px;
    overflow-y: auto;
    padding: 6px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 5px;
}

.picker-option,
.picker-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 10px 11px;
    text-align: left;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 4px;
}

.picker-option {
    flex-direction: column;
    cursor: pointer;
}

.picker-option:hover,
.picker-option.active {
    background: #edf7f2;
    border-color: #7db69d;
}

.picker-option strong,
.picker-check strong {
    font-size: .78rem;
    font-weight: 650;
}

.picker-option span,
.picker-check small {
    color: var(--muted);
    font-size: .72rem;
}

.picker-check {
    align-items: center;
    cursor: pointer;
}

.picker-check input,
.content-section input[type="checkbox"] {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: var(--primary);
}

.picker-check span {
    display: grid;
    gap: 2px;
}

.search-box {
    display: flex;
    align-items: center;
    width: min(100%, 360px);
    height: 36px;
    padding: 0 10px;
    color: var(--muted);
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 5px;
}

.search-box input {
    width: 100%;
    min-width: 0;
    height: 100%;
    padding: 0 0 0 8px;
    color: var(--ink);
    background: transparent;
    border: 0;
    outline: 0;
}

.search-box:focus-within {
    border-color: var(--form-control-focus);
    box-shadow: 0 0 0 3px rgba(48, 135, 101, .12);
}

.filter-field {
    display: grid;
    gap: 3px;
    min-width: 250px;
}

.filter-field.compact {
    min-width: 190px;
}

.filter-field label {
    color: var(--muted);
    font-size: .67rem;
    font-weight: 650;
}

.filter-field select {
    height: 36px;
    padding: 0 30px 0 9px;
    background: var(--surface);
    border: 1px solid var(--form-control-border);
    border-radius: 4px;
}

.promo-code-cell {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.promo-code-cell code {
    max-width: 180px;
    overflow-wrap: anywhere;
    color: var(--ink);
    font: .78rem/1.35 "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

.pager-summary {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 14px;
    color: var(--muted);
    font-size: .78rem;
}

.result-count {
    margin-left: auto;
    padding-bottom: 8px;
    color: var(--muted);
    font-size: .75rem;
    white-space: nowrap;
}

.data-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.content-section .data-table-wrap {
    border: 0;
    border-radius: 0;
}

/* 管理列表表格（2026-10-21 统一到上游管理 accounts-data-table 口径）：
   表头 surface-muted 底 + .76rem 不大写、行高 43/48、9px 11px 内距、hover 用同一层灰。
   基准见 Pages/Providers.razor.css .accounts-data-table（td 不加 nowrap：这些页面存在长文本换行场景）。 */
.data-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    font-size: var(--management-list-body-font);
}

.wide-table .data-table {
    min-width: 1100px;
}

.providers-table {
    min-width: 1280px;
}

.users-table {
    min-width: 1120px;
}

.personal-usage-table .data-table {
    min-width: 900px;
}

.data-table th {
    height: 43px;
    padding: 9px 11px;
    color: var(--muted);
    font-size: var(--management-list-header-font);
    font-weight: 700;
    text-align: left;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.data-table td {
    max-width: 320px;
    height: 48px;
    padding: 9px 11px;
    color: var(--ink);
    vertical-align: middle;
    border-bottom: 1px solid var(--line);
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr:hover {
    background: color-mix(in srgb, var(--surface-muted) 60%, transparent);
}

/* 表脚合计行（2026-11 用量记录合计行）：与 AdminOps ops-total-row 同款口径——
   surface-soft 底 + line-strong 顶线 + 紧凑内距；AdminOps 为 scoped 实现，此为 data-table 通用版。 */
.data-table tfoot td {
    padding: 7px 10px;
    background: var(--surface-soft);
    border-top: 1px solid var(--line-strong);
    color: var(--ink);
    font-size: .8rem;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.data-table .primary-cell,
.data-table td > small {
    display: block;
}

.data-table .primary-cell {
    overflow-wrap: anywhere;
    color: var(--ink);
    font-weight: 650;
}

.data-table td > small {
    margin-top: 2px;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: var(--management-list-secondary-font);
}

/*
 * Every page-level data list follows the readable hierarchy established by
 * group management. Important declarations are intentional here: Blazor CSS
 * isolation is loaded after app.css and several legacy pages still carry
 * smaller component-scoped declarations.
 */
.page-content table {
    font-size: var(--management-list-body-font) !important;
    line-height: 1.5;
}

.page-content table thead th,
.page-content table thead th :where(*) {
    font-size: var(--management-list-header-font) !important;
    letter-spacing: 0 !important;
}

/* Shared management-list table rhythm. Page-specific tables may still set
   widths and sticky behavior, while these primitives keep their visual frame
   consistent across admin pages. */
.page-content table thead th {
    padding: 10px 12px;
    color: var(--muted);
    font-weight: 700;
    line-height: 1.35;
    vertical-align: middle;
    background: var(--surface-soft);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.page-content table tbody td {
    padding: 10px 12px;
    font-size: var(--management-list-body-font) !important;
    line-height: 1.5;
    vertical-align: middle;
    border-bottom: 1px solid var(--line);
}

.page-content table tbody tr:last-child td {
    border-bottom: 0;
}

.page-content table tbody tr:hover {
    background: var(--surface-hover);
}

.page-content table tbody td :where(*) {
    font-size: inherit !important;
    letter-spacing: 0 !important;
}

.page-content table tbody td :where(strong, b) {
    font-size: var(--management-list-primary-font) !important;
}

.page-content table tbody td :where(
    small,
    code,
    time,
    em,
    [class*="badge"],
    [class*="pill"],
    [class*="chip"],
    [class*="muted"],
    [class*="date"],
    [class*="meta"],
    [class*="hint"],
    [class*="numeric"],
    [class*="limit"],
    [class*="usage"],
    [class*="quota"],
    [class*="capacity"],
    [class*="count"]
) {
    font-size: var(--management-list-secondary-font) !important;
}

.page-content table tbody td :where(
    [class*="badge"],
    [class*="pill"],
    [class*="chip"],
    [class*="muted"],
    [class*="date"],
    [class*="meta"],
    [class*="hint"],
    [class*="numeric"],
    [class*="limit"],
    [class*="usage"],
    [class*="quota"],
    [class*="capacity"],
    [class*="count"]
) :where(*) {
    font-size: inherit !important;
}

.page-content table tbody td :where(button, a) {
    font-size: var(--management-list-action-font) !important;
}

.page-content table tbody td :where(input, select, textarea) {
    font-size: var(--management-list-control-font) !important;
}

.page-content :is(
    [class$="-pagination"],
    [class*="-pagination "],
    [class$="-pager"],
    [class*="-pager "],
    .table-footer,
    .pager-summary
) {
    font-size: var(--management-list-pagination-font) !important;
}

.page-content :is(
    [class$="-pagination"],
    [class*="-pagination "],
    [class$="-pager"],
    [class*="-pager "],
    .table-footer,
    .pager-summary
) :where(*) {
    font-size: inherit !important;
    letter-spacing: 0 !important;
}

.numeric-cell {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* 数字列右对齐（2026-10-26 全站定稿）：数字列 th/td 标记 numeric-cell 后整体靠右。
   表基类与页面 scoped 样式多以 th/td 标签选择器声明 left，且 Blazor CSS 隔离会附加
   [b-*] 属性选择器（实际特异性 0,2,1）并后加载——按本文件 .actions-column /
   .page-content table 的既有先例，用 !important 稳定覆盖。 */
table th.numeric-cell,
table td.numeric-cell {
    text-align: right !important;
}

/* cost-cell（成本计费列）同口径右对齐：原规则只挂在 .model-sequence-table 下，
   模型评测序列选择表（accounts-data-table）等其他使用者命不中。 */
table th.cost-cell,
table td.cost-cell {
    text-align: right !important;
}

.actions-column {
    width: 124px;
    text-align: right !important;
}

/* 操作列固定（2026-10-21 用户配置，默认开，侧栏底部「固定操作列」开关）：
   横向滚动时操作列（含表头）钉在右侧；作用于所有用 .actions-column 标记的标准列表。
   实底背景防止滚动内容从钉住的单元格下透出；无横向滚动的表格不受视觉影响。 */
.app-shell[data-sticky-actions="true"] table:has(.actions-column) th:last-child,
.app-shell[data-sticky-actions="true"] table:has(.actions-column) td:last-child,
.app-shell[data-sticky-actions="true"] .actions-column {
    position: sticky;
    right: 0;
    z-index: 2;
    background: var(--surface);
    border-left: 1px solid var(--line);
}

.actions-cell {
    text-align: right;
    white-space: nowrap;
}

.truncate-cell {
    display: block;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.key-prefix,
.request-id {
    display: inline-block;
    max-width: 180px;
    padding: 3px 6px;
    overflow: hidden;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
    background: var(--surface-muted);
    border-radius: 3px;
}

.status-badge,
.provider-badge {
    display: inline-flex;
    align-items: center;
    min-height: 23px;
    padding: 2px 8px;
    font-size: .68rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    border-radius: 999px;
}

.status-badge.success {
    color: #216448;
    background: #e4f4ec;
}

.status-badge.neutral {
    color: #65706c;
    background: #edf0ef;
}

.status-badge.info {
    color: #1d4ed8;
    background: #dbeafe;
}

.status-badge.violet {
    color: #6d28d9;
    background: #ede9fe;
}

.status-badge.danger {
    color: #963c3c;
    background: #fae8e8;
}

.status-badge.warning {
    color: #745312;
    background: #fff3cf;
}

/* 既有缺口补齐：多处模板已引用 ok/muted 变体（模型产品上游状态等），
   语义分别对齐 success（启用/在售）与 neutral（停用/弱化）。 */
.status-badge.ok {
    color: #216448;
    background: #e4f4ec;
}

.status-badge.muted {
    color: #65706c;
    background: #edf0ef;
}

.schedule-switch {
    position: relative;
    display: inline-flex;
    width: 38px;
    height: 22px;
    align-items: center;
    cursor: pointer;
}

.schedule-switch input {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.schedule-switch input:disabled { cursor: wait; }

.schedule-switch > span {
    position: relative;
    width: 38px;
    height: 22px;
    background: #b6c0bc;
    border-radius: 999px;
    transition: background-color .16s ease;
}

.schedule-switch > span::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    content: "";
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(22, 34, 28, .24);
    transition: transform .16s ease;
}

.schedule-switch input:checked + span {
    background: #2f7c5e;
}

.schedule-switch input:checked + span::after {
    transform: translateX(16px);
}

.schedule-switch input:focus-visible + span {
    outline: 2px solid #377b62;
    outline-offset: 2px;
}

.schedule-switch input:disabled + span {
    opacity: .55;
    cursor: wait;
}

.usage-window-cell {
    min-width: 245px;
}

.usage-windows {
    display: grid;
    min-width: 220px;
    gap: 7px;
}

.usage-window-row {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
}

.usage-window-label {
    display: inline-grid;
    width: 32px;
    height: 20px;
    place-items: center;
    color: #385d50;
    font-size: .65rem;
    font-weight: 750;
    background: #e5f1ec;
    border-radius: 4px;
}

.usage-window-label.short { color: #4e4f89; background: #ececfa; }
.usage-window-label.long { color: #1f694f; background: #e2f3eb; }
.usage-window-label.sonnet { color: #7a571c; background: #f8edcf; }

.usage-window-meter {
    display: grid;
    min-width: 0;
    grid-template-columns: 76px minmax(86px, 1fr);
    align-items: center;
    gap: 7px;
}

.usage-window-track {
    display: block;
    width: 76px;
    height: 6px;
    overflow: hidden;
    background: #e4e9e6;
    border-radius: 999px;
}

.usage-window-track > span {
    display: block;
    height: 100%;
    background: #318063;
    border-radius: inherit;
}

.usage-window-meter small {
    overflow: hidden;
    color: #66736d;
    font-size: .66rem;
    font-variant-numeric: tabular-nums;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.usage-window-empty {
    color: #89938f;
    font-size: .7rem;
    white-space: nowrap;
}

.model-sync-controls {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 15px;
}

.model-sync-controls .form-field {
    flex: 1 1 360px;
    margin-bottom: 0;
}

.model-sync-summary {
    display: flex;
    min-height: 38px;
    margin-bottom: 12px;
    padding: 8px 10px;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 18px;
    color: var(--muted);
    font-size: .75rem;
    background: var(--surface-soft);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.model-sync-summary strong {
    color: var(--ink);
    font-size: .88rem;
}

.model-sync-toolbar {
    display: flex;
    margin-bottom: 10px;
    align-items: center;
    gap: 8px;
}

.model-sync-toolbar .search-box {
    width: min(100%, 320px);
}

.model-sync-toolbar .result-count {
    padding-bottom: 0;
}

.model-sync-list {
    max-height: min(50vh, 520px);
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 5px;
}

.model-sync-row {
    display: grid;
    min-width: 1040px;
    min-height: 52px;
    padding: 8px 10px;
    grid-template-columns: 28px minmax(230px, 2fr) 82px repeat(5, 112px);
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-size: .74rem;
    border-bottom: 1px solid var(--line);
}

label.model-sync-row {
    cursor: pointer;
}

label.model-sync-row:hover {
    background: var(--surface-hover);
}

.model-sync-row:last-child {
    border-bottom: 0;
}

.model-sync-row-header {
    position: sticky;
    top: 0;
    z-index: 1;
    min-height: 36px;
    color: var(--muted);
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--surface-soft);
}

.model-sync-row input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--primary);
}

.model-sync-name {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.model-sync-name strong,
.model-sync-name code {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.model-sync-name strong {
    color: var(--ink);
    font-size: .76rem;
}

.model-sync-row > span > small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: .65rem;
}

.provider-badge.openai {
    color: var(--primary-hover);
    background: #e2f2eb;
}

.provider-badge.claude {
    color: #775518;
    background: #f8edcf;
}

.state-panel {
    display: flex;
    min-height: 260px;
    padding: 32px 20px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: var(--muted);
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.state-panel strong {
    color: var(--ink);
    font-size: .9rem;
}

.state-panel > span:not(.state-icon):not(.spinner) {
    max-width: 440px;
    font-size: .78rem;
}

.state-panel.compact-state {
    min-height: 180px;
    flex-direction: row;
    font-size: .8rem;
}

.state-icon {
    display: grid;
    width: 44px;
    height: 44px;
    margin-bottom: 4px;
    place-items: center;
    color: var(--muted);
    background: var(--surface-muted);
    border-radius: 50%;
}

.error-state .state-icon {
    color: #a64040;
    background: #f9eaea;
}

.state-action {
    margin-top: 8px;
}

.spinner {
    display: inline-block;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    border: 2px solid #c9d2ce;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.spinner.light {
    width: 15px;
    height: 15px;
    border-color: rgba(255, 255, 255, .45);
    border-top-color: #fff;
}

.spinner.compact {
    width: 16px;
    height: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.app-boot {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--muted);
    font-size: .8rem;
    background: var(--canvas);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.metric-card {
    display: grid;
    min-width: 0;
    padding: 16px;
    grid-template-columns: 38px minmax(0, 1fr);
    column-gap: 11px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.metric-icon {
    display: grid;
    width: 38px;
    height: 38px;
    grid-row: 1 / 3;
    place-items: center;
    border-radius: 5px;
}

.metric-icon.green { color: #24694f; background: #e0f1e9; }
.metric-icon.blue { color: #316897; background: #e5eff7; }
.metric-icon.amber { color: #87601b; background: #f8edcf; }
.metric-icon.red { color: #9b4141; background: #f8e7e7; }

.metric-label {
    overflow: hidden;
    color: var(--muted);
    font-size: .7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metric-card strong {
    min-width: 0;
    overflow: hidden;
    font-size: 1.2rem;
    font-variant-numeric: tabular-nums;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.summary-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.summary-strip > div {
    display: flex;
    min-width: 0;
    min-height: 60px;
    padding: 12px 18px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-right: 1px solid var(--line);
}

.summary-strip > div:last-child {
    border-right: 0;
}

.summary-strip span {
    color: var(--muted);
    font-size: .75rem;
}

.summary-strip strong {
    overflow: hidden;
    font-size: .9rem;
    font-variant-numeric: tabular-nums;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    width: auto;
    height: auto;
    padding: 24px;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    background: rgba(17, 24, 21, .5);
    opacity: 1;
}

html:has(.native-account-backdrop),
body:has(.native-account-backdrop) {
    overflow: hidden;
}

.modal-dialog {
    position: relative;
    /* 全站弹窗统一尺寸（2026-10-21 定稿；2026-10-27 用户定稿档位制）：默认 large=80vw×80vh（--modal-* 令牌）；
       size-small=小确认框（480px 档高度自适应）、size-full=铺满视口；
       旧调用注入的 --modal-max-width 仅作兼容上限；长内容在 modal-body 内滚动。 */
    width: var(--modal-width);
    max-width: var(--modal-max-width, 100%);
    height: var(--modal-height);
    min-height: 0;
    margin: auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 7px;
    box-shadow: 0 24px 60px rgba(16, 23, 20, .2);
    pointer-events: auto;
}

/* 小确认框档：删除确认/单项操作反馈——窄而矮，高度按内容自适应（业内小 modal 惯例 ≈480px，MUI xs 444 / AntD 520）。 */
.modal-dialog.size-small {
    width: min(var(--modal-width-small), 92vw);
    max-width: var(--modal-max-width, 100%);
    height: auto;
    max-height: var(--modal-height);
}

/* 铺满档：仅巨型工作台（如多栏对照编辑）使用。 */
.modal-dialog.size-full {
    width: 100vw;
    max-width: 100%;
    height: 100vh;
    border-radius: 0;
}

/* 兼容 2026-10-27 前的过渡期：旧调用只传 MaxWidth 未传 Size 的（如 720px 编辑器），
   仍按 large 档 80vw 起步、被 MaxWidth 帽住——行为与改造前一致，不产生视觉回归。 */
.modal-dialog:not(.size-small):not(.size-full) {
    /* large 默认档已在 .modal-dialog 基座生效，此处显式声明便于阅读。 */
    width: var(--modal-width);
    height: var(--modal-height);
}

.modal-header,
.modal-footer {
    display: flex;
    align-items: center;
    padding: 12px 16px;
}

.modal-header {
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}

.modal-header h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.modal-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 16px;
    overflow-y: auto;
}

.modal-footer {
    justify-content: flex-end;
    gap: 9px;
    background: var(--surface-soft);
    border-top: 1px solid var(--line);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 15px;
}

/* Child settings components have their own CSS-isolation scope, so their
   internal grids need a genuinely shared layout rule. */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 17px 20px;
    padding: 20px;
}

.form-field {
    display: grid;
    width: 100%;
    min-width: 0;
    align-self: start;
    align-content: start;
    gap: 5px;
    margin-bottom: 15px;
}

/* 2026-10-14 用户定稿：label 与「?」悬浮提示必须在同一行（? 紧跟 label 右边），
   不允许 ? 换行掉到 label 下方。.form-field 是 grid，label 与 .field-hint 平级
   会被各排一行——调用方把 label+FieldHint 包进 .field-label-row 亚行容器。 */
.field-label-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    color: var(--ink);
    font-size: .76rem;
    font-weight: 650;
}

.form-grid .form-field {
    margin-bottom: 0;
}

.form-field.full,
.toggle-row.full {
    grid-column: 1 / -1;
}

.form-grid .modal-subsection-title {
    grid-column: 1 / -1;
    margin-top: 6px;
}

.form-field label {
    color: var(--ink);
    font-size: .76rem;
    font-weight: 650;
}

.field-hint {
    color: var(--muted);
    font-size: .7rem;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    min-width: 0;
    padding: 7px 10px;
    color: var(--form-control-color);
    background: var(--form-control-bg);
    border: 1px solid var(--form-control-border);
    border-radius: var(--form-control-radius);
}

.form-field input,
.form-field select {
    height: var(--form-control-height);
}

.form-field textarea {
    min-height: var(--form-control-height);
    line-height: 1.5;
    resize: vertical;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
    color: var(--form-control-placeholder);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: var(--form-control-focus);
    outline: 0;
    box-shadow: 0 0 0 3px var(--form-control-focus-ring);
}

/* 弹窗表单统一为「左侧标签、右侧控件」的行式布局。复杂的价格/序列网格保留自己的布局。 */
.modal-body > .form-field,
.modal-body > .form-grid:not(.vendor-editor-stack):not(.sku-editor-grid):not(.sequence-editor-grid):not(.sequence-link-editor-grid):not(.attribute-form-grid) > .form-field,
.modal-section-body > .form-grid:not(.sku-editor-grid):not(.sequence-editor-grid):not(.sequence-link-editor-grid):not(.attribute-form-grid) > .form-field {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(118px, 150px) minmax(0, 1fr);
    align-items: center;
    column-gap: 12px;
    row-gap: 6px;
    margin-bottom: 0;
}
.modal-body > .form-field > label:first-child,
.modal-body > .form-field > .field-label-row,
.modal-body > .form-grid:not(.vendor-editor-stack):not(.sku-editor-grid):not(.sequence-editor-grid):not(.sequence-link-editor-grid):not(.attribute-form-grid) > .form-field > label:first-child,
.modal-body > .form-grid:not(.vendor-editor-stack):not(.sku-editor-grid):not(.sequence-editor-grid):not(.sequence-link-editor-grid):not(.attribute-form-grid) > .form-field > .field-label-row,
.modal-section-body > .form-grid:not(.sku-editor-grid):not(.sequence-editor-grid):not(.sequence-link-editor-grid):not(.attribute-form-grid) > .form-field > label:first-child,
.modal-section-body > .form-grid:not(.sku-editor-grid):not(.sequence-editor-grid):not(.sequence-link-editor-grid):not(.attribute-form-grid) > .form-field > .field-label-row {
    grid-column: 1;
    grid-row: 1;
    margin: 0;
}
.modal-body > .form-field > :not(label):not(.field-label-row),
.modal-body > .form-grid:not(.vendor-editor-stack):not(.sku-editor-grid):not(.sequence-editor-grid):not(.sequence-link-editor-grid):not(.attribute-form-grid) > .form-field > :not(label):not(.field-label-row),
.modal-section-body > .form-grid:not(.sku-editor-grid):not(.sequence-editor-grid):not(.sequence-link-editor-grid):not(.attribute-form-grid) > .form-field > :not(label):not(.field-label-row) {
    grid-column: 2;
    min-width: 0;
}
@media (max-width: 560px) {
    .modal-body > .form-field,
    .modal-body > .form-grid:not(.vendor-editor-stack):not(.sku-editor-grid):not(.sequence-editor-grid):not(.sequence-link-editor-grid):not(.attribute-form-grid) > .form-field,
    .modal-section-body > .form-grid:not(.sku-editor-grid):not(.sequence-editor-grid):not(.sequence-link-editor-grid):not(.attribute-form-grid) > .form-field { grid-template-columns: minmax(0, 1fr); }
    .modal-body > .form-field > label:first-child,
    .modal-body > .form-field > .field-label-row,
    .modal-body > .form-field > :not(label):not(.field-label-row),
    .modal-section-body > .form-grid:not(.sku-editor-grid):not(.sequence-editor-grid):not(.sequence-link-editor-grid):not(.attribute-form-grid) > .form-field > label:first-child,
    .modal-section-body > .form-grid:not(.sku-editor-grid):not(.sequence-editor-grid):not(.sequence-link-editor-grid):not(.attribute-form-grid) > .form-field > .field-label-row,
    .modal-section-body > .form-grid:not(.sku-editor-grid):not(.sequence-editor-grid):not(.sequence-link-editor-grid):not(.attribute-form-grid) > .form-field > :not(label):not(.field-label-row) { grid-column: 1; }
}

/* 价格编辑器内部保留紧凑的多列单价布局；其他分组表单也使用同一行式字段。 */
.modal-body > .form-field,
.modal-body > .form-grid:not(.sku-editor-grid) > .form-field,
.modal-section-body > .form-grid:not(.sku-editor-grid) > .form-field {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(118px, 150px) minmax(0, 1fr);
    align-items: center;
    column-gap: 12px;
    row-gap: 6px;
    margin-bottom: 0;
}
.modal-body > .form-field > label:first-child,
.modal-body > .form-field > .field-label-row,
.modal-body > .form-grid:not(.sku-editor-grid) > .form-field > label:first-child,
.modal-body > .form-grid:not(.sku-editor-grid) > .form-field > .field-label-row,
.modal-section-body > .form-grid:not(.sku-editor-grid) > .form-field > label:first-child,
.modal-section-body > .form-grid:not(.sku-editor-grid) > .form-field > .field-label-row {
    grid-column: 1;
    grid-row: 1;
    margin: 0;
}
.modal-body > .form-field > :not(label):not(.field-label-row),
.modal-body > .form-grid:not(.sku-editor-grid) > .form-field > :not(label):not(.field-label-row),
.modal-section-body > .form-grid:not(.sku-editor-grid) > .form-field > :not(label):not(.field-label-row) {
    grid-column: 2;
    min-width: 0;
}
.modal-section-body > .form-grid:not(.sku-editor-grid) > .price-section,
.modal-section-body > .form-grid:not(.sku-editor-grid) > .interval-heading,
.modal-section-body > .form-grid:not(.sku-editor-grid) > .pricing-empty,
.modal-section-body > .form-grid:not(.sku-editor-grid) > .accounts-table-shell,
.modal-section-body > .form-grid:not(.sku-editor-grid) > .inline-alert {
    grid-column: 1 / -1;
}
@media (max-width: 560px) {
    .modal-body > .form-field,
    .modal-body > .form-grid:not(.sku-editor-grid) > .form-field,
    .modal-section-body > .form-grid:not(.sku-editor-grid) > .form-field { grid-template-columns: minmax(0, 1fr); }
    .modal-body > .form-field > label:first-child,
    .modal-body > .form-field > .field-label-row,
    .modal-body > .form-field > :not(label):not(.field-label-row),
    .modal-body > .form-grid:not(.sku-editor-grid) > .form-field > label:first-child,
    .modal-body > .form-grid:not(.sku-editor-grid) > .form-field > .field-label-row,
    .modal-body > .form-grid:not(.sku-editor-grid) > .form-field > :not(label):not(.field-label-row),
    .modal-section-body > .form-grid:not(.sku-editor-grid) > .form-field > label:first-child,
    .modal-section-body > .form-grid:not(.sku-editor-grid) > .form-field > .field-label-row,
    .modal-section-body > .form-grid:not(.sku-editor-grid) > .form-field > :not(label):not(.field-label-row) { grid-column: 1; }
}

/* 页面级表单横向布局（2026-11-02 用户要求：文字在左、内容在右，全站统一）。
   与弹窗行式同款模板：label 列 minmax(118px,150px)、控件列自适应。
   适用：审计中心筛选区、系统设置/高级功能页面级 settings-grid、
   风控/备份等页面级 form-grid；复杂网格（编辑器/价格）不在选择器内。 */
.event-filters .form-field,
.filters .form-field,
.audit-filter-grid .form-field,
.filter-grid .form-field,
.log-filters .form-field,
.batch-filters .form-field,
.compact-toolbar .form-field,
.admin-usage-filter-grid .form-field,
.system-log-filters .form-field,
.alert-event-filters .form-field,
.settings-grid > .form-field,
.settings-form .form-field,
.risk-form .form-field {
    display: grid;
    grid-template-columns: minmax(118px, 150px) minmax(0, 1fr);
    align-items: center;
    column-gap: 12px;
    row-gap: 6px;
}

.event-filters .form-field > label:first-child,
.event-filters .form-field > .field-label-row,
.filters .form-field > label:first-child,
.filters .form-field > .field-label-row,
.audit-filter-grid .form-field > label:first-child,
.audit-filter-grid .form-field > .field-label-row,
.filter-grid .form-field > label:first-child,
.filter-grid .form-field > .field-label-row,
.log-filters .form-field > label:first-child,
.log-filters .form-field > .field-label-row,
.batch-filters .form-field > label:first-child,
.batch-filters .form-field > .field-label-row,
.compact-toolbar .form-field > label:first-child,
.compact-toolbar .form-field > .field-label-row,
.admin-usage-filter-grid .form-field > label:first-child,
.admin-usage-filter-grid .form-field > .field-label-row,
.settings-grid > .form-field > label:first-child,
.settings-grid > .form-field > .field-label-row,
.settings-form .form-field > label:first-child,
.settings-form .form-field > .field-label-row,
.risk-form .form-field > label:first-child,
.risk-form .form-field > .field-label-row {
    grid-column: 1;
    grid-row: 1;
    margin: 0;
}

.event-filters .form-field > :not(label):not(.field-label-row),
.filters .form-field > :not(label):not(.field-label-row),
.audit-filter-grid .form-field > :not(label):not(.field-label-row),
.filter-grid .form-field > :not(label):not(.field-label-row),
.log-filters .form-field > :not(label):not(.field-label-row),
.batch-filters .form-field > :not(label):not(.field-label-row),
.compact-toolbar .form-field > :not(label):not(.field-label-row),
.admin-usage-filter-grid .form-field > :not(label):not(.field-label-row),
.settings-grid > .form-field > :not(label):not(.field-label-row),
.settings-form .form-field > :not(label):not(.field-label-row),
.risk-form .form-field > :not(label):not(.field-label-row) {
    grid-column: 2;
    min-width: 0;
}

@media (max-width: 640px) {
    .event-filters .form-field,
    .filters .form-field,
    .audit-filter-grid .form-field,
    .filter-grid .form-field,
    .log-filters .form-field,
    .batch-filters .form-field,
    .compact-toolbar .form-field,
    .admin-usage-filter-grid .form-field,
    .settings-grid > .form-field,
    .settings-form .form-field,
    .risk-form .form-field { grid-template-columns: minmax(0, 1fr); }
    .event-filters .form-field > label:first-child,
    .event-filters .form-field > .field-label-row,
    .event-filters .form-field > :not(label):not(.field-label-row),
    .filters .form-field > label:first-child,
    .filters .form-field > .field-label-row,
    .filters .form-field > :not(label):not(.field-label-row),
    .audit-filter-grid .form-field > label:first-child,
    .audit-filter-grid .form-field > .field-label-row,
    .audit-filter-grid .form-field > :not(label):not(.field-label-row),
    .filter-grid .form-field > label:first-child,
    .filter-grid .form-field > .field-label-row,
    .filter-grid .form-field > :not(label):not(.field-label-row),
    .log-filters .form-field > label:first-child,
    .log-filters .form-field > .field-label-row,
    .log-filters .form-field > :not(label):not(.field-label-row),
    .batch-filters .form-field > label:first-child,
    .batch-filters .form-field > .field-label-row,
    .batch-filters .form-field > :not(label):not(.field-label-row),
    .compact-toolbar .form-field > label:first-child,
    .compact-toolbar .form-field > .field-label-row,
    .compact-toolbar .form-field > :not(label):not(.field-label-row),
    .admin-usage-filter-grid .form-field > label:first-child,
    .admin-usage-filter-grid .form-field > .field-label-row,
    .admin-usage-filter-grid .form-field > :not(label):not(.field-label-row),
    .settings-grid > .form-field > label:first-child,
    .settings-grid > .form-field > .field-label-row,
    .settings-grid > .form-field > :not(label):not(.field-label-row),
    .settings-form .form-field > label:first-child,
    .settings-form .form-field > .field-label-row,
    .settings-form .form-field > :not(label):not(.field-label-row),
    .risk-form .form-field > label:first-child,
    .risk-form .form-field > .field-label-row,
    .risk-form .form-field > :not(label):not(.field-label-row) { grid-column: 1; }
}

.password-input {
    position: relative;
}

.password-input input {
    padding-right: 44px;
}

.password-input .icon-button {
    position: absolute;
    top: 3px;
    right: 3px;
}

.toggle-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 5px;
    cursor: pointer;
}

.toggle-row input {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    margin-top: 2px;
    accent-color: var(--primary);
}

.toggle-row span {
    display: grid;
}

.toggle-row strong {
    font-size: .78rem;
}

.toggle-row small {
    color: var(--muted);
    font-size: .7rem;
}

.modal-section {
    margin-bottom: 18px;
    padding: 14px 16px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}

/* 无头分区（2026-10-21：厂商 Key 表单唯一分区去「基础配置」折叠头）：字段直接铺开，去卡片框。 */
.modal-section.modal-section-plain {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.modal-section:last-child {
    margin-bottom: 0;
}

.modal-section-heading {
    display: grid;
    margin: 0 0 12px;
    gap: 3px;
}

.modal-section-heading strong {
    color: var(--ink);
    font-size: .82rem;
}

.modal-section-heading small {
    color: var(--muted);
    font-size: .7rem;
    font-weight: 400;
    line-height: 1.45;
}

.modal-section-body {
    display: grid;
    gap: 12px;
}

.modal-section-collapsible {
    overflow: hidden;
    margin-bottom: 18px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.modal-section-optional {
    flex: 0 0 auto;
    padding: 3px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: .65rem;
    font-weight: 650;
    white-space: nowrap;
}

.modal-section-primary {
    box-shadow: 0 1px 0 color-mix(in srgb, var(--line) 45%, transparent);
}

.modal-section-collapsible > summary {
    display: flex;
    min-height: 64px;
    padding: 12px 15px;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    background: var(--surface-muted);
    cursor: pointer;
    list-style: none;
}

.modal-section-collapsible > summary::-webkit-details-marker {
    display: none;
}

.modal-section-collapsible > summary .modal-section-heading {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
}

.modal-section-collapsible > summary .lucide-icon {
    flex: 0 0 auto;
    color: var(--muted);
    transition: transform .16s ease;
}

.modal-section-collapsible[open] > summary .lucide-icon {
    transform: rotate(180deg);
}

.modal-section-collapsible > summary:hover,
.modal-section-collapsible > summary:focus-visible {
    background: color-mix(in srgb, var(--primary) 7%, var(--surface-muted));
}

.modal-section-collapsible > summary:focus-visible {
    outline: 2px solid var(--form-control-focus);
    outline-offset: -2px;
}

.modal-section-collapsible[open] > summary {
    border-bottom: 1px solid var(--line);
}

.modal-section-collapsible > .modal-section-body {
    padding: 16px;
}

@media (max-width: 600px) {
    .modal-section-collapsible > summary {
        padding: 12px;
        gap: 8px;
    }

    .modal-section-optional {
        padding: 2px 6px;
    }

    .modal-section-collapsible > .modal-section-body {
        padding: 12px;
    }
}

.modal-subsection-title {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: .68rem;
    font-weight: 680;
    letter-spacing: .04em;
}

.validation-message {
    color: var(--danger);
    font-size: .7rem;
}

.invalid:not([type="checkbox"]) {
    border-color: #b74a4a !important;
}

.valid.modified:not([type="checkbox"]) {
    border-color: #66a58c;
}

.inline-alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 15px;
    padding: 10px 11px;
    font-size: .76rem;
    border: 1px solid;
    border-radius: 5px;
}

/* 删除等危险操作二次确认弹窗正文（全局：各页删除确认 AppModal 复用） */
.delete-confirm {
    display: grid;
    grid-template-columns: auto 1fr;
    padding: 4px 0 12px;
    gap: 12px;
}

.delete-icon {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    color: var(--danger);
    background: rgba(197, 62, 62, .1);
    border-radius: 50%;
}

.delete-confirm strong { color: var(--ink); font-size: .76rem; }
.delete-confirm p { margin: 6px 0 0; color: var(--muted); font-size: .67rem; line-height: 1.55; }


.inline-alert.danger {
    color: #873838;
    background: #fceeee;
    border-color: #edcaca;
}

.inline-alert.success {
    color: #255f47;
    background: #edf7f2;
    border-color: #c4e4d5;
}

.inline-alert.warning {
    color: #745312;
    background: #fff8e5;
    border-color: #ebd99d;
}

.confirm-copy {
    margin-bottom: 0;
    color: var(--ink);
    font-size: .83rem;
}

.secret-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: 5px;
}

.secret-box code {
    min-width: 0;
    flex: 1;
    overflow-wrap: anywhere;
    user-select: all;
}

.toast-host {
    position: fixed;
    top: 76px;
    right: 18px;
    z-index: 200;
    display: grid;
    width: min(360px, calc(100vw - 32px));
    gap: 8px;
    pointer-events: none;
}

.toast-item {
    display: grid;
    min-height: 48px;
    padding: 10px 8px 10px 12px;
    grid-template-columns: 20px minmax(0, 1fr) 30px;
    align-items: center;
    gap: 9px;
    color: var(--ink);
    font-size: .78rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-left-width: 4px;
    border-radius: 5px;
    box-shadow: 0 12px 28px rgba(24, 35, 30, .14);
    pointer-events: auto;
}

.toast-success { border-left-color: #378063; }
.toast-success > .lucide-icon { color: var(--primary); }
.toast-error { border-left-color: #ad4545; }
.toast-error > .lucide-icon { color: #a64040; }
.toast-info { border-left-color: #3b75a2; }
.toast-info > .lucide-icon { color: #316897; }
.toast-close { width: 30px; height: 30px; }

.login-page {
    display: grid;
    width: min(100%, 430px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 54px 20px;
    align-content: center;
    gap: 22px;
}

.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-brand .brand-logo {
    display: block;
    width: 36px;
    height: 36px;
}

.login-brand > span:last-child {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.login-brand strong {
    font-size: 1.05rem;
}

.login-brand small {
    color: var(--muted);
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
}

.login-panel {
    padding: 26px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 7px;
    box-shadow: 0 14px 38px rgba(26, 38, 32, .08);
}

.login-panel header {
    margin-bottom: 22px;
}

.login-panel h1 {
    margin-bottom: 4px;
    font-size: 1.25rem;
}

.login-panel header p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: .8rem;
}

.login-button {
    width: 100%;
    margin-top: 4px;
}

.auth-footer {
    margin-top: 18px;
    color: var(--muted);
    font-size: .76rem;
    text-align: center;
}

.auth-links {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: -4px 0 14px;
    font-size: .78rem;
}

.auth-footer a {
    margin-left: 5px;
    color: var(--primary-strong);
    font-weight: 650;
}

.settings-section {
    display: grid;
    padding: 24px 0;
    grid-template-columns: minmax(220px, 340px) minmax(320px, 520px);
    gap: 50px;
    border-top: 1px solid var(--line);
}

.settings-copy p {
    max-width: 300px;
    color: var(--muted);
    font-size: .78rem;
}

.settings-form {
    min-width: 0;
}

.setting-inline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.switch-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--ink);
    font-size: .78rem;
    font-weight: 650;
    cursor: pointer;
}

.switch-label input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--primary);
}

.subform-panel {
    margin-top: 14px;
    padding: 15px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 5px;
}

.subform-panel h3 {
    margin: 0 0 6px;
    font-size: .86rem;
}

.button-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.totp-setup-code {
    margin: 12px 0;
    padding: 10px;
    overflow: auto;
    color: var(--ink);
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: 4px;
    font-size: .72rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.captcha-challenge {
    width: 100%;
    min-height: 0;
    margin: 14px 0;
}

.captcha-turnstile {
    width: 100%;
    min-height: 65px;
}

.captcha-turnstile iframe {
    max-width: 100%;
}

.captcha-action-button {
    width: 100%;
    min-height: 44px;
    justify-content: center;
}

.captcha-sdk-trigger {
    position: fixed;
    top: 0;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.totp-qr {
    display: flex;
    width: min(100%, 244px);
    min-height: 244px;
    margin: 12px 0 18px;
    padding: 12px;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.totp-qr img {
    display: block;
    width: 220px;
    max-width: 100%;
    height: auto;
    aspect-ratio: 1;
}

.auth-totp-panel h2 {
    margin: 0 0 6px;
    font-size: 1.05rem;
}

.account-facts {
    display: grid;
    margin: 0;
    overflow: hidden;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
    border-radius: 5px;
}

.account-facts > div {
    min-width: 0;
    padding: 12px 14px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.account-facts dt {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: .68rem;
    font-weight: 650;
}

.account-facts dd {
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--ink);
    font-size: .8rem;
    font-weight: 600;
}

.identity-binding-list {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 5px;
}

.identity-binding-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    border-bottom: 1px solid var(--line);
}

.identity-binding-row:last-of-type {
    border-bottom: 0;
}

.identity-binding-copy {
    min-width: 0;
}

.identity-binding-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 24px;
}

.identity-binding-title strong {
    font-size: .84rem;
}

.identity-binding-detail,
.identity-binding-note {
    margin-top: 4px;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: .74rem;
}

.identity-binding-detail {
    color: var(--ink);
    font-weight: 600;
}

.identity-binding-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
}

.identity-binding-form {
    padding: 14px;
    background: var(--surface-soft);
    border-bottom: 1px solid var(--line);
}

.input-action-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.input-action-row input {
    min-width: 0;
    flex: 1 1 auto;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
    color: var(--muted);
    font-size: .75rem;
}

.pagination .icon-button {
    background: var(--surface);
    border-color: var(--line);
}

.not-found-page {
    display: flex;
    min-height: 60vh;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
}

.not-found-page h1 {
    margin: 8px 0 4px;
    font-size: 1.25rem;
}

.not-found-page p {
    color: var(--muted);
    font-size: .8rem;
}

#blazor-error-ui {
    position: fixed;
    right: 16px;
    bottom: 16px;
    left: 16px;
    z-index: 1000;
    display: none;
    padding: 12px 44px 12px 14px;
    color: #772f2f;
    background: #fff0f0;
    border: 1px solid #e4bcbc;
    border-radius: 5px;
    box-shadow: 0 10px 30px rgba(30, 20, 20, .12);
}

#blazor-error-ui .dismiss {
    position: absolute;
    top: 8px;
    right: 12px;
    cursor: pointer;
}

.blazor-error-boundary {
    padding: 14px;
    color: #fff;
    background: var(--danger);
    border-radius: 5px;
}

@media (max-width: 1120px) {
    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .page-header {
        align-items: center;
    }

    .toolbar {
        flex-wrap: wrap;
        align-items: flex-end;
    }

    .search-box {
        width: 100%;
    }

    .filter-field,
    .filter-field.compact {
        min-width: min(100%, 220px);
        flex: 1;
    }

    .summary-strip {
        grid-template-columns: 1fr;
    }

    .summary-strip > div {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .summary-strip > div:last-child {
        border-bottom: 0;
    }

    .settings-section {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .public-home {
        min-height: auto;
        padding: 32px 24px;
        grid-template-columns: 1fr;
    }

    .public-home-copy h1 {
        font-size: 2.2rem;
    }

    .setup-panel {
        padding: 22px 18px;
    }

    .setup-step small {
        font-size: .62rem;
    }

    .setup-step-line {
        margin-right: 3px;
        margin-left: 3px;
    }

    .form-row {
        align-items: stretch;
        flex-direction: column;
    }

    .form-row .button {
        width: 100%;
    }

    .json-editor,
    .json-readonly {
        width: calc(100% - 24px);
        margin: 12px;
    }

    .data-table-wrap,
    .wide-table.data-table-wrap {
        overflow: visible;
        background: transparent;
        border: 0;
    }

    .data-table,
    .wide-table .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .data-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .data-table tbody {
        display: grid;
        gap: 10px;
    }

    .data-table tr {
        overflow: hidden;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: 6px;
    }

    .data-table tbody tr:hover {
        background: var(--surface-hover);
    }

    .data-table td {
        display: grid;
        max-width: none;
        min-height: 42px;
        padding: 9px 12px;
        grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
        align-items: center;
        gap: 10px;
        text-align: right;
    }

    .data-table td::before {
        content: attr(data-label);
        color: #75807c;
        font-size: .68rem;
        font-weight: 650;
        text-align: left;
    }

    .data-table td > * {
        justify-self: end;
    }

    .data-table .primary-cell,
    .data-table td > small {
        text-align: right;
    }

    .data-table td > small {
        grid-column: 2;
    }

    .data-table .truncate-cell {
        max-width: 100%;
    }

    .providers-table {
        min-width: 0;
    }

    .usage-window-cell .usage-windows {
        width: min(100%, 280px);
        min-width: 0;
        justify-self: end;
    }

    .content-section {
        overflow: visible;
        background: transparent;
        border: 0;
    }

    .content-section .section-header {
        margin-bottom: 10px;
        padding: 0;
        border-bottom: 0;
    }

    .content-section .data-table-wrap {
        border: 0;
    }
}

@media (max-width: 560px) {
    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-header > .button,
    .page-header-actions,
    .page-header-actions > .button {
        width: 100%;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .settings-grid {
        padding: 15px;
    }

    .form-field.full,
    .toggle-row.full {
        grid-column: auto;
    }

    .account-facts {
        grid-template-columns: 1fr;
    }

    .identity-binding-row {
        flex-direction: column;
    }

    .identity-binding-actions,
    .identity-binding-actions .button {
        width: 100%;
    }

    .input-action-row {
        align-items: stretch;
        flex-direction: column;
    }

    .modal-backdrop {
        padding: 12px;
        align-items: flex-end;
    }

    .modal-dialog {
        /* 小屏：宽度退化为视口减边距（80vw 在窄屏过窄），高度维持 80vh 令牌。 */
        width: calc(100vw - 24px);
        max-width: none;
        min-height: 0;
        max-height: calc(100vh - 24px);
    }

    .modal-body {
        padding: 16px;
    }

    .modal-footer {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .modal-footer .button:only-child {
        grid-column: 1 / -1;
    }

    .model-sync-controls,
    .model-sync-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .model-sync-controls .form-field,
    .model-sync-toolbar .search-box {
        width: 100%;
        flex-basis: auto;
    }

    .model-sync-toolbar .result-count {
        margin-left: 0;
    }

    .login-page {
        padding: 30px 16px;
    }

    .setup-page {
        padding: 24px 12px 36px;
    }

    .setup-steps {
        margin-right: -6px;
        margin-left: -6px;
    }

    .setup-step {
        min-width: 48px;
    }

    .setup-actions {
        align-items: stretch;
    }

    .setup-actions .button {
        flex: 1 1 0;
    }

    .login-panel {
        padding: 22px 18px;
    }

    .toast-host {
        top: 72px;
        right: 16px;
    }
}

/* 全站深色外观：与原管理端的 dark 模式保持同一信息层级。 */
html[data-theme="dark"] body,
html[data-theme="dark"] .app-boot {
    color: var(--ink);
    background: var(--canvas);
}

html[data-theme="dark"] body {
    background-image:
        radial-gradient(circle at 48% -12%, rgba(13, 148, 136, .11), transparent 36%),
        linear-gradient(180deg, #07111f 0, var(--canvas) 42%);
    background-attachment: fixed;
}

html[data-theme="dark"] code,
html[data-theme="dark"] .announcement-content,
html[data-theme="dark"] .data-table td,
html[data-theme="dark"] .data-table .primary-cell,
html[data-theme="dark"] .promo-code-cell code,
html[data-theme="dark"] .model-sync-row,
html[data-theme="dark"] .model-sync-name strong,
html[data-theme="dark"] .state-panel strong,
html[data-theme="dark"] .metric-card strong,
html[data-theme="dark"] .modal-header h2 {
    color: var(--ink);
}

html[data-theme="dark"] .content-section,
html[data-theme="dark"] .announcement-item,
html[data-theme="dark"] .toolbar,
html[data-theme="dark"] .data-table-wrap,
html[data-theme="dark"] .state-panel,
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .summary-strip,
html[data-theme="dark"] .modal-dialog,
html[data-theme="dark"] .picker-option,
html[data-theme="dark"] .picker-check,
html[data-theme="dark"] .toast,
html[data-theme="dark"] .dashboard-card,
html[data-theme="dark"] .admin-metric-card {
    background: var(--surface);
    border-color: var(--line);
}

html[data-theme="dark"] .toolbar,
html[data-theme="dark"] .picker-list,
html[data-theme="dark"] .search-box,
html[data-theme="dark"] .json-editor,
html[data-theme="dark"] .json-readonly,
html[data-theme="dark"] .model-sync-summary,
html[data-theme="dark"] .segmented-control {
    color: var(--ink);
    background: var(--surface-soft);
    border-color: var(--line);
}

html[data-theme="dark"] .page-content input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] .page-content select,
html[data-theme="dark"] .page-content textarea,
html[data-theme="dark"] .filter-field select,
html[data-theme="dark"] .granularity-filter select {
    color: var(--ink);
    background-color: var(--surface);
    border-color: #394640;
}

html[data-theme="dark"] .page-content input::placeholder,
html[data-theme="dark"] .page-content textarea::placeholder {
    color: #68756f;
}

html[data-theme="dark"] .data-table th,
html[data-theme="dark"] .model-sync-row-header,
html[data-theme="dark"] .compact-dashboard-table th {
    color: var(--muted);
    background: var(--surface-soft);
    border-color: var(--line);
}

html[data-theme="dark"] .data-table td,
html[data-theme="dark"] .model-sync-row,
html[data-theme="dark"] .compact-dashboard-table td {
    border-color: var(--line);
}

html[data-theme="dark"] .data-table tbody tr:hover,
html[data-theme="dark"] label.model-sync-row:hover,
html[data-theme="dark"] .clickable-row:hover,
html[data-theme="dark"] .quick-action:hover {
    background: var(--surface-hover);
}

html[data-theme="dark"] .button.secondary,
html[data-theme="dark"] .icon-button,
html[data-theme="dark"] .quick-action,
html[data-theme="dark"] .segmented-control button {
    color: var(--ink);
    background: var(--surface);
    border-color: #3a4741;
}

html[data-theme="dark"] .button.secondary:hover:not(:disabled),
html[data-theme="dark"] .icon-button:hover:not(:disabled),
html[data-theme="dark"] .segmented-control button:hover:not(:disabled) {
    color: var(--primary-strong);
    background: var(--surface-hover);
    border-color: #52625b;
}

html[data-theme="dark"] .segmented-control {
    background: transparent;
    border-color: transparent;
}

html[data-theme="dark"] .segmented-control button.active {
    color: #b9e2d2;
    background: #173a2e;
    border-color: #4e806c;
}

html[data-theme="dark"] .key-prefix,
html[data-theme="dark"] .request-id,
html[data-theme="dark"] .state-icon,
html[data-theme="dark"] .other-row {
    color: var(--muted);
    background: var(--surface-soft);
}

html[data-theme="dark"] .frozen-badge {
    color: #f4c86b;
    background: rgba(168, 112, 20, .22);
}

html[data-theme="dark"] .modal-backdrop {
    background: rgba(0, 0, 0, .68);
}

html[data-theme="dark"] .inline-alert.success { color: #8be0ba; background: rgba(33, 117, 82, .22); border-color: rgba(79, 178, 133, .38); }
html[data-theme="dark"] .inline-alert.warning { color: #e5c57b; background: rgba(138, 99, 30, .22); border-color: rgba(197, 151, 65, .4); }
html[data-theme="dark"] .inline-alert.danger { color: #f1a0a0; background: rgba(145, 48, 48, .22); border-color: rgba(209, 92, 92, .4); }

/* CSS-isolated components cannot target the document theme ancestor. Keep all
   cross-component dark rules here so the emitted selectors remain valid. */
html[data-theme="dark"] .auth-layout,
html[data-theme="dark"] .login-panel,
html[data-theme="dark"] .setup-summary > div,
html[data-theme="dark"] .modal-footer,
html[data-theme="dark"] .toggle-row,
html[data-theme="dark"] .secret-box,
html[data-theme="dark"] .subform-panel,
html[data-theme="dark"] .identity-binding-form,
html[data-theme="dark"] .pagination .icon-button,
html[data-theme="dark"] .toast-item {
    color: var(--ink);
    background: var(--surface);
    border-color: var(--line);
}

html[data-theme="dark"] .modal-footer,
html[data-theme="dark"] .toggle-row,
html[data-theme="dark"] .subform-panel,
html[data-theme="dark"] .identity-binding-form,
html[data-theme="dark"] .setup-summary > div {
    background: var(--surface-soft);
}

html[data-theme="dark"] .announcement-modal-summary {
    background: color-mix(in srgb, #2563eb 12%, var(--surface));
}

html[data-theme="dark"] .announcement-list-row.unread,
html[data-theme="dark"] .user-announcement-card.unread {
    background: color-mix(in srgb, #2563eb 10%, var(--surface));
    border-color: color-mix(in srgb, #60a5fa 35%, var(--line));
}

html[data-theme="dark"] .announcement-list-state,
html[data-theme="dark"] .announcement-card-icon,
html[data-theme="dark"] .announcement-summary-strip > article > span {
    color: #94a3b8;
    background: var(--surface-muted);
}

html[data-theme="dark"] .announcement-popup > header {
    background: color-mix(in srgb, #f59e0b 10%, var(--surface));
    border-color: color-mix(in srgb, #f59e0b 28%, var(--line));
}

html[data-theme="dark"] .announcement-card-title em,
html[data-theme="dark"] .announcement-card-read {
    color: #93c5fd;
    background: rgba(37, 99, 235, .2);
}

html[data-theme="dark"] .announcement-card-title em.read {
    color: #b7c8c1;
    background: var(--surface-muted);
}

html[data-theme="dark"] .announcement-card-title small {
    color: #f6c66b;
    background: rgba(180, 83, 9, .22);
}

html[data-theme="dark"] .admin-metric-icon.blue,
html[data-theme="dark"] .dashboard-stat-icon.blue,
html[data-theme="dark"] .usage-stat-icon.blue,
html[data-theme="dark"] .usage-row-icon,
html[data-theme="dark"] .quick-action-icon.blue {
    background: rgba(37, 99, 235, .2);
}

html[data-theme="dark"] .admin-metric-icon.green,
html[data-theme="dark"] .dashboard-stat-icon.emerald,
html[data-theme="dark"] .dashboard-stat-icon.green,
html[data-theme="dark"] .usage-stat-icon.green,
html[data-theme="dark"] .quick-action-icon.emerald {
    background: rgba(5, 150, 105, .2);
}

html[data-theme="dark"] .admin-metric-icon.indigo,
html[data-theme="dark"] .dashboard-stat-icon.indigo {
    background: rgba(79, 70, 229, .22);
}

html[data-theme="dark"] .admin-metric-icon.violet,
html[data-theme="dark"] .dashboard-stat-icon.purple,
html[data-theme="dark"] .dashboard-stat-icon.violet,
html[data-theme="dark"] .usage-stat-icon.violet {
    background: rgba(124, 58, 237, .22);
}

html[data-theme="dark"] .admin-metric-icon.amber,
html[data-theme="dark"] .admin-metric-icon.orange,
html[data-theme="dark"] .dashboard-stat-icon.amber,
html[data-theme="dark"] .usage-stat-icon.amber,
html[data-theme="dark"] .quick-action-icon.amber {
    background: rgba(217, 119, 6, .22);
}

html[data-theme="dark"] .admin-metric-icon.cyan,
html[data-theme="dark"] .quick-action-icon.sky {
    background: rgba(2, 132, 199, .22);
}

html[data-theme="dark"] .admin-metric-icon.rose,
html[data-theme="dark"] .dashboard-stat-icon.rose {
    background: rgba(225, 29, 72, .22);
}

html[data-theme="dark"] .platform-card.other,
html[data-theme="dark"] .recent-usage-row,
html[data-theme="dark"] .quick-action,
html[data-theme="dark"] .other-row {
    background: var(--surface-soft);
}

html[data-theme="dark"] .recent-usage-row:hover,
html[data-theme="dark"] .quick-action:hover,
html[data-theme="dark"] .clickable-row:hover,
html[data-theme="dark"] .clickable-row:hover td {
    background: var(--surface-hover);
}

html[data-theme="dark"] .quota-track,
html[data-theme="dark"] .range-badge,
html[data-theme="dark"] .usage-detail-table th {
    color: var(--muted) !important;
    background: var(--surface-muted);
    border-color: var(--line);
}

html[data-theme="dark"] .filter-label,
html[data-theme="dark"] .filter-caption,
html[data-theme="dark"] .usage-filter-field label,
html[data-theme="dark"] .system-log-filters label,
html[data-theme="dark"] .form-grid label {
    color: var(--muted);
}

html[data-theme="dark"] .settings-section,
html[data-theme="dark"] .form-grid .check-field,
html[data-theme="dark"] .error-detail-grid article,
html[data-theme="dark"] .error-payload,
html[data-theme="dark"] .correlated-errors,
html[data-theme="dark"] .alert-detail-summary,
html[data-theme="dark"] .alert-history > header,
html[data-theme="dark"] .ops-table th {
    color: var(--ink);
    background: var(--surface-soft);
    border-color: var(--line);
}

/* .settings-tabs 暗色规则已删（2026-10-21 页签统一为下划线式）：容器透明、active 走令牌主色，
   无需暗色特判；.ops-action 同批（模型监控页已无标记引用）。 */
html[data-theme="dark"] .latency-summary span,
html[data-theme="dark"] .ops-table code,
html[data-theme="dark"] .log-health-badges span {
    color: var(--muted);
    background: var(--surface-muted);
    border-color: var(--line);
}

html[data-theme="dark"] .level-badge {
    color: #93c5fd !important;
    background: rgba(37, 99, 235, .2);
    border-color: rgba(96, 165, 250, .35);
}

html[data-theme="dark"] .level-badge.success,
html[data-theme="dark"] .log-health-badges .success,
html[data-theme="dark"] .state-pill.success,
html[data-theme="dark"] .result-pill.success,
html[data-theme="dark"] .tag.green,
html[data-theme="dark"] .verified-badge,
html[data-theme="dark"] .agent-state.success {
    color: #6ee7b7 !important;
    background: rgba(4, 120, 87, .24);
}

html[data-theme="dark"] .level-badge.warning,
html[data-theme="dark"] .log-health-badges .warning,
html[data-theme="dark"] .status-code.warning,
html[data-theme="dark"] .tag.amber,
html[data-theme="dark"] .mini-badge.amber,
html[data-theme="dark"] .status-pill.warning {
    color: #fcd34d !important;
    background: rgba(180, 83, 9, .24);
}

html[data-theme="dark"] .level-badge.danger,
html[data-theme="dark"] .log-health-badges .danger,
html[data-theme="dark"] .status-code.danger,
html[data-theme="dark"] .tag.danger,
html[data-theme="dark"] .mini-badge.danger,
html[data-theme="dark"] .result-pill.danger,
html[data-theme="dark"] .status-pill.danger,
html[data-theme="dark"] .agent-state.danger {
    color: #fda4af !important;
    background: rgba(190, 24, 93, .22);
}

html[data-theme="dark"] .level-badge.muted,
html[data-theme="dark"] .log-health-badges span,
html[data-theme="dark"] .state-pill.neutral,
html[data-theme="dark"] .result-pill.neutral,
html[data-theme="dark"] .status-code.neutral,
html[data-theme="dark"] .tag.gray {
    color: #cbd5e1 !important;
    background: var(--surface-muted);
}

html[data-theme="dark"] .tag.blue,
html[data-theme="dark"] .tag.indigo {
    color: #93c5fd;
    background: rgba(37, 99, 235, .22);
}

html[data-theme="dark"] .tag.violet {
    color: #c4b5fd;
    background: rgba(109, 40, 217, .23);
}

html[data-theme="dark"] .tag.rose {
    color: #fda4af;
    background: rgba(190, 24, 93, .22);
}

html[data-theme="dark"] .overview-icon.green,
html[data-theme="dark"] .runtime-metrics article.green,
html[data-theme="dark"] .worker-metrics article.green { background: rgb(6 78 59 / 28%); }
html[data-theme="dark"] .overview-icon.blue,
html[data-theme="dark"] .runtime-metrics article.sky { background: rgb(12 74 110 / 30%); }
html[data-theme="dark"] .overview-icon.purple,
html[data-theme="dark"] .runtime-metrics article.purple { background: rgb(76 29 149 / 30%); }
html[data-theme="dark"] .overview-icon.amber,
html[data-theme="dark"] .runtime-metrics article.amber { background: rgb(120 53 15 / 30%); }
html[data-theme="dark"] .runtime-metrics article.red { background: rgb(127 29 29 / 30%); }
html[data-theme="dark"] .mode-options button.active { background: rgb(6 78 59 / 30%); border-color: #25805f; }
html[data-theme="dark"] .detail-content pre { background: #020617; }

html[data-theme="dark"] .page-tabs,
html[data-theme="dark"] .runtime-summary article,
html[data-theme="dark"] .guard-grid article,
html[data-theme="dark"] .limit-tags span,
html[data-theme="dark"] .policy-layout aside > div {
    background: color-mix(in srgb, var(--surface-muted) 75%, transparent);
}

html[data-theme="dark"] .pass-notice,
html[data-theme="dark"] .restart-note {
    color: #fde68a;
    background: rgb(120 53 15 / 30%);
    border-color: #92400e;
}

html[data-theme="dark"] .detail-tabs button.active { background: rgb(6 78 59 / 28%); }
html[data-theme="dark"] .delete-preview { background: rgb(127 29 29 / 22%); border-color: #7f1d1d; }

html[data-theme="dark"] .supported-model-chip,
html[data-theme="dark"] .channel-platform-badge {
    color: #c8d4d0;
    background: #172437;
    border-color: #304057;
}

html[data-theme="dark"] .supported-model-chip:hover,
html[data-theme="dark"] .supported-model-chip:focus-visible {
    background: #1c2d42;
    border-color: #486077;
}

html[data-theme="dark"] .available-group-badge {
    color: #b7ded0;
    background: #17382e;
}

html[data-theme="dark"] .group-rate { background: rgba(255, 255, 255, .1); }
html[data-theme="dark"] .peak-rate-badge { color: #e9c66f; background: rgba(169, 118, 23, .22); }

html[data-theme="dark"] .model-platform.anthropic { color: #fdba74; background: rgba(180, 83, 9, .2); }
html[data-theme="dark"] .model-platform.openai { color: #6ee7b7; background: rgba(4, 120, 87, .2); }
html[data-theme="dark"] .model-platform.gemini { color: #93c5fd; background: rgba(29, 78, 216, .2); }
html[data-theme="dark"] .model-platform.antigravity { color: #c4b5fd; background: rgba(109, 40, 217, .2); }
html[data-theme="dark"] .model-platform.grok { color: #cbd5e1; background: rgba(51, 65, 85, .4); }
html[data-theme="dark"] .model-platform.composite { color: #67e8f9; background: rgba(14, 116, 144, .22); }

html[data-theme="dark"] .redeem-result.success { color: #86efac; background: rgba(4, 120, 87, .22); border-color: rgba(74, 222, 128, .3); }
html[data-theme="dark"] .redeem-result.danger,
html[data-theme="dark"] .clear-warning { color: #fda4af; background: rgba(190, 24, 93, .2); border-color: rgba(251, 113, 133, .32); }
html[data-theme="dark"] .redeem-result .result-icon { background: rgba(255, 255, 255, .08); }

/* Theme-sensitive status surfaces that are emitted by isolated components.
   Mirror each isolated selector so the document theme wins without relying on
   component-level ancestor selectors, which Blazor scopes incorrectly. */
html[data-theme="dark"] .status-badge.success,
html[data-theme="dark"] .backup-status.success,
html[data-theme="dark"] .runtime-endpoints .success,
html[data-theme="dark"] .decision.success,
html[data-theme="dark"] .key-state.success,
html[data-theme="dark"] .audit-result header .success,
html[data-theme="dark"] .keyword-notice.success,
html[data-theme="dark"] .security-status-icon.success,
html[data-theme="dark"] .concurrency-badge.active,
html[data-theme="dark"] .history-icon.positive {
    color: #6ee7b7;
    background: rgba(4, 120, 87, .24);
    border-color: rgba(52, 211, 153, .32);
}

html[data-theme="dark"] .status-badge.warning,
html[data-theme="dark"] .decision.warning,
html[data-theme="dark"] .result-pill.warning,
html[data-theme="dark"] .key-state.warning,
html[data-theme="dark"] .keyword-notice.warning,
html[data-theme="dark"] .key-status-list p,
html[data-theme="dark"] .delete-preview p {
    color: #fcd34d;
    background: rgba(180, 83, 9, .24);
    border-color: rgba(245, 158, 11, .34);
}

html[data-theme="dark"] .status-badge.danger,
html[data-theme="dark"] .backup-status.danger,
html[data-theme="dark"] .runtime-endpoints .danger,
html[data-theme="dark"] .decision.danger,
html[data-theme="dark"] .key-state.danger,
html[data-theme="dark"] .audit-result header .danger,
html[data-theme="dark"] .detail-metrics article.keyword,
html[data-theme="dark"] .history-icon.negative {
    color: #fda4af;
    background: rgba(190, 24, 93, .22);
    border-color: rgba(251, 113, 133, .32);
}

html[data-theme="dark"] .status-badge.neutral,
html[data-theme="dark"] .key-state.neutral,
html[data-theme="dark"] .overview-icon,
html[data-theme="dark"] .panel-icon,
html[data-theme="dark"] .usage-window-track {
    color: #cbd5e1;
    background: var(--surface-muted);
    border-color: var(--line);
}

html[data-theme="dark"] .status-badge.info {
    color: #93c5fd;
    background: rgba(37, 99, 235, .22);
}

html[data-theme="dark"] .status-badge.violet {
    color: #c4b5fd;
    background: rgba(109, 40, 217, .23);
}

html[data-theme="dark"] .backup-status.running,
html[data-theme="dark"] .worker-slots .active,
html[data-theme="dark"] .keyword-notice.info,
html[data-theme="dark"] .detail-content header em,
html[data-theme="dark"] .page-number.active {
    color: #93c5fd;
    background: rgba(37, 99, 235, .22);
    border-color: rgba(96, 165, 250, .35);
}

html[data-theme="dark"] .worker-slots .idle,
html[data-theme="dark"] .key-origin {
    color: #6ee7b7;
    background: rgba(4, 120, 87, .24);
    border-color: rgba(52, 211, 153, .32);
}

html[data-theme="dark"] .result-pill.hit,
html[data-theme="dark"] .history-icon.purple {
    color: #c4b5fd;
    background: rgba(109, 40, 217, .23);
}

html[data-theme="dark"] .usage-window-label,
html[data-theme="dark"] .usage-window-label.short,
html[data-theme="dark"] .usage-window-label.long,
html[data-theme="dark"] .usage-window-label.sonnet,
html[data-theme="dark"] .provider-badge.openai,
html[data-theme="dark"] .provider-badge.claude,
html[data-theme="dark"] .metric-icon.green,
html[data-theme="dark"] .metric-icon.blue,
html[data-theme="dark"] .metric-icon.amber,
html[data-theme="dark"] .metric-icon.red,
html[data-theme="dark"] .error-state .state-icon,
html[data-theme="dark"] .oauth-result,
html[data-theme="dark"] .oauth-callback-band,
html[data-theme="dark"] .oauth-segments,
html[data-theme="dark"] .oauth-action-band,

html[data-theme="dark"] #blazor-error-ui {
    color: #fecaca;
    background: #3b1219;
    border-color: #7f1d2d;
}

html[data-theme="dark"] .announcement-summary-strip > article.unread > span {
    color: #93c5fd;
    background: rgba(37, 99, 235, .22);
}

html[data-theme="dark"] .overall-status {
    color: #fcd34d;
    background: rgba(180, 83, 9, .24);
}

html[data-theme="dark"] .overall-status.operational,
html[data-theme="dark"] .monitor-status.operational {
    color: #6ee7b7;
    background: rgba(4, 120, 87, .24);
}

html[data-theme="dark"] .monitor-status {
    color: #cbd5e1;
    background: var(--surface-muted);
}

html[data-theme="dark"] .monitor-status.degraded {
    color: #fcd34d;
    background: rgba(180, 83, 9, .24);
}

html[data-theme="dark"] .monitor-status.failed {
    color: #fda4af;
    background: rgba(190, 24, 93, .22);
}

html[data-theme="dark"] .provider-icon,
html[data-theme="dark"] .provider-icon.provider-grok {
    color: #cbd5e1;
    background: var(--surface-muted);
}

html[data-theme="dark"] .provider-icon.provider-openai { color: #6ee7b7; background: rgba(4, 120, 87, .24); }
html[data-theme="dark"] .provider-icon.provider-anthropic { color: #fdba74; background: rgba(180, 83, 9, .22); }
html[data-theme="dark"] .provider-icon.provider-gemini { color: #93c5fd; background: rgba(37, 99, 235, .22); }

html[data-theme="dark"] .monitor-v2-title > span,
html[data-theme="dark"] .coverage-badge {
    color: #93c5fd;
    background: rgba(37, 99, 235, .22);
}

html[data-theme="dark"] .coverage-badge.warning {
    color: #fcd34d;
    background: rgba(180, 83, 9, .24);
}

html[data-theme="dark"] .bootstrap-banner {
    color: #bfdbfe;
    background: rgba(30, 64, 175, .2);
    border-color: rgba(96, 165, 250, .3);
}

html[data-theme="dark"] .bootstrap-track { background: var(--surface-muted); }

html[data-theme="dark"] .work-distribution-page .collection-notice {
    color: #fde68a;
    background: #422006;
    border-color: #854d0e;
}

html[data-theme="dark"] .work-distribution-page .summary-icon.neutral { color: #cbd5e1; background: #334155; }
html[data-theme="dark"] .work-distribution-page .summary-icon.success { color: #6ee7b7; background: #064e3b; }
html[data-theme="dark"] .work-distribution-page .summary-icon.blue { color: #7dd3fc; background: #0c4a6e; }
html[data-theme="dark"] .work-distribution-page .summary-icon.amber { color: #fcd34d; background: #78350f; }

.work-page { display: grid; gap: 20px; min-width: 0; }
.work-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 14px 16px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.work-filters > label { display: grid; gap: 6px; min-width: 170px; flex: 1 1 170px; }
.work-filters > label > span { color: var(--text-muted); font-size: .82rem; font-weight: 600; }
.work-filters select, .work-filters input { width: 100%; min-height: 38px; padding: 7px 10px; color: var(--text); background: var(--surface-raised); border: 1px solid var(--line); border-radius: 6px; }
.work-actions { display: flex; align-items: end; gap: 10px; flex: 0 0 auto; min-height: 64px; }
.metric-switch { display: inline-flex; }
.metric-switch button { min-height: 38px; padding: 7px 12px; color: var(--text-muted); background: var(--surface-raised); border: 1px solid var(--line); }
.metric-switch button:first-child { border-radius: 6px 0 0 6px; }
.metric-switch button:last-child { margin-left: -1px; border-radius: 0 6px 6px 0; }
.metric-switch button.active { color: var(--text-on-primary); background: var(--primary); border-color: var(--primary); }
.work-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.work-kpis article, .work-panel { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.work-kpis article { display: grid; gap: 5px; }
.work-kpis small, .chart-label small, .work-panel header p { color: var(--text-muted); }
.work-kpis strong { font-size: 1.6rem; color: var(--text); }
.work-kpis span { color: var(--text-muted); font-size: .82rem; }
.work-panel { display: grid; gap: 16px; }
.work-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.work-panel h2 { margin: 0; font-size: 1.05rem; }
.work-panel header p { margin: 4px 0 0; font-size: .85rem; }
.chart-list { display: grid; gap: 12px; }
.chart-list article { display: grid; gap: 8px; padding: 10px 0; cursor: pointer; }
.chart-list article.is-selected { padding-inline: 10px; border-radius: 6px; background: var(--surface-muted); }
.chart-label { display: flex; justify-content: space-between; gap: 12px; min-width: 0; }
.chart-label strong, .chart-label small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stacked-chart { display: flex; overflow: hidden; height: 14px; border-radius: 4px; background: var(--surface-muted); }
.stacked-chart > span { min-width: 2px; }
.work-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--text-muted); font-size: .82rem; }
.work-legend span { display: inline-flex; align-items: center; gap: 6px; }
.work-legend i { width: 9px; height: 9px; border-radius: 2px; }
.wide-table { overflow-x: auto; }
.work-sample-content { max-width: 420px; max-height: 120px; margin: 0; overflow: auto; white-space: pre-wrap; word-break: break-word; color: var(--text-muted); font: inherit; font-size: .8rem; }
.work-sample-pagination { display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--text-muted); font-size: .85rem; }
@media (max-width: 900px) { .work-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .work-actions { width: 100%; justify-content: space-between; } }
@media (max-width: 560px) { .work-filters { padding: 14px; } .work-filters > label { flex-basis: 100%; } .work-kpis { grid-template-columns: 1fr; } .chart-label { display: grid; gap: 3px; } .work-sample-pagination { flex-wrap: wrap; } }

/* ---- 模型产品（SKU）共享样式：页签 + 产品表格 + 定价编辑 + 毛利对账 ---- */
.upstream-tabs { display: flex; margin-bottom: 12px; gap: 4px; border-bottom: 1px solid var(--line); }
.upstream-tab { min-height: 38px; padding: 7px 15px; color: var(--muted); background: transparent; border: 0; border-bottom: 2px solid transparent; font-size: .86rem; font-weight: 680; cursor: pointer; }
.upstream-tab:hover { color: var(--ink); background: var(--surface-muted); }
.upstream-tab.active { color: var(--primary-strong); border-bottom-color: var(--primary-strong); }
.model-sequence-panel { width: 100%; }
/* 工具栏 flex-wrap（2026-11-10 全站统一口径）：筛选下拉平铺的页面（用户管理/模型密钥/
   提示词审计）复用同款单行工具栏，窄视口自动换行而不是挤压控件。 */
.model-sequence-toolbar { display: flex; min-height: 64px; padding: 12px 14px; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 10px 10px 0 0; }
/* 工具栏搜索框（2026-11-10 用户定稿）：统一 DxTextBox 控件（无嵌套结构），宽度收窄到 240px。 */
.model-sequence-search { width: 240px; max-width: 100%; }
.model-sequence-search.dxbl-text-box { min-width: 0; }
/* 筛选下拉（label + DxComboBox 平铺段）：自上游模型序列页签的 scoped 配方提升为全局，
   供四个列表页共用（控件宽度由使用处 DxComboBox Width 控制）。 */
.model-sequence-vendor-filter { display: flex; min-height: 38px; align-items: center; gap: 7px; color: var(--muted); font-size: .78rem; }
.model-sequence-vendor-filter span { white-space: nowrap; }
/* 工具栏内嵌 DxDateTimeField（自定义组件渲染 .form-field 外壳）：固定宽度避免塌陷，外壳 label 行不再重复。 */
.model-sequence-vendor-filter > .form-field { flex: 0 0 190px; min-width: 0; }
.model-sequence-vendor-filter > .form-field > .field-label-row { display: none; }
.model-sequence-toolbar .account-result-count { margin-left: auto; padding: 4px 8px; color: var(--muted); background: var(--surface-muted); border-radius: 999px; font-size: .8rem; white-space: nowrap; }
.model-sequence-actions { display: flex; align-items: center; gap: 8px; }
/* 工具栏弹层菜单（更多筛选/列设置等 popover）：原 Users/ApiKeys scoped 各存一份，收敛为全局单一来源。 */
.menu-anchor { position: relative; }
.settings-menu { display: grid; position: absolute; z-index: 40; top: calc(100% + 5px); right: 0; min-width: 190px; max-height: 340px; padding: 5px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--popover-shadow); }
.settings-menu button { display: flex; min-height: 34px; padding: 7px 9px; align-items: center; justify-content: space-between; gap: 14px; color: var(--ink); background: none; border: 0; border-radius: 6px; text-align: left; font-size: .69rem; }
.settings-menu button:hover { background: var(--surface-muted); }
.settings-menu button svg { color: var(--primary); }
.settings-menu .menu-divider { height: 1px; margin: 5px 4px; background: var(--line); }
/* 工具栏内嵌表单段（更多筛选菜单里的输入框）：与全站表单控件同令牌。 */
.settings-menu .filter-field { display: grid; gap: 4px; padding: 4px 6px; color: var(--muted); font-size: .69rem; }
.settings-menu .filter-field input { min-width: 0; min-height: var(--form-control-height); padding: 6px 9px; color: var(--form-control-color); background: var(--form-control-bg); border: 1px solid var(--form-control-border); border-radius: var(--form-control-radius); font: inherit; font-size: .78rem; }
.settings-menu .filter-field input:focus { border-color: var(--form-control-focus); outline: 0; box-shadow: 0 0 0 3px var(--form-control-focus-ring); }
/* 弹层内时间范围行（DxDateTimeField 双列）与数字输入行共用节奏。 */
.settings-menu .more-filters-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 4px 6px; }
.model-sequence-table-shell { overflow: visible; background: var(--surface); border: 1px solid var(--line); border-top: 0; }
.model-sequence-table-shell .accounts-table-scroll { width: 100%; overflow-x: auto; overflow-y: visible; }
.model-sequence-table { width: 100%; min-width: 980px; border-collapse: collapse; color: var(--ink); font-size: .83rem; }
.model-sequence-table th, .model-sequence-table td { height: 48px; min-width: 110px; padding: 9px 11px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.model-sequence-table th { height: 43px; color: var(--muted); background: var(--surface-muted); font-size: .76rem; font-weight: 700; }
.model-sequence-table tbody tr:hover { background: color-mix(in srgb, var(--surface-muted) 60%, transparent); }
.model-sequence-table tbody tr:last-child td { border-bottom: 0; }
/* 成本价明列（文本/缓存/图片/音频/视频）：右对齐数字，窄列；未配置显示 -。 */
.model-sequence-table .cost-cell { min-width: 84px; text-align: right; font-variant-numeric: tabular-nums; }
.sequence-no { color: var(--muted); font-size: .72rem; }
.vendor-cell { display: grid; min-width: 150px; gap: 3px; }
.vendor-cell code { color: var(--muted); font-size: .72rem; }
.pricing-cell { display: grid; min-width: 200px; gap: 3px; }
.pricing-mode-badge { width: fit-content; padding: 2px 7px; color: var(--primary); background: var(--primary-soft); border-radius: 999px; font-size: .68rem; font-weight: 700; }
.model-product-picker { display: grid; min-width: 260px; gap: 5px; }
.model-product-picker label { color: var(--muted); font-size: .72rem; font-weight: 650; }
.model-product-picker select { min-width: 260px; min-height: 38px; padding: 7px 28px 7px 10px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font-size: .8rem; }
.capability-tags { display: flex; max-width: 220px; flex-wrap: wrap; gap: 4px; }
.capability-tag { padding: 2px 7px; color: var(--muted); background: var(--surface-muted); border-radius: 999px; font-size: .68rem; }
/* 产品编辑器「能力标签」DxTagBox 多选：占满表单行，标签字号与表单一致。 */
.capability-tagbox { width: 100%; }
.capability-tagbox .dxbl-tag { font-size: .78rem; }
/* DxSelectField 选项图标模板（编辑产品弹窗「厂商图标」下拉，选项值即 SVG 地址；空值 = 默认品牌标）。 */
.icon-option { display: flex; align-items: center; gap: 8px; min-height: 20px; }
.icon-option-img { display: block; flex: 0 0 18px; width: 18px; height: 18px; object-fit: contain; }
.icon-option-fallback { display: grid; place-items: center; flex: 0 0 18px; width: 18px; height: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-soft); }
.icon-option-fallback .brand-logo { width: 12px; height: 12px; }
.sku-pricing-editor { display: grid; min-width: 0; gap: 16px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-top: 0; }
.sku-pricing-editor .channel-pricing-toolbar, .sku-reconciliation .channel-pricing-toolbar { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.sku-pricing-editor .channel-pricing-toolbar strong, .sku-reconciliation .channel-pricing-toolbar strong { color: var(--ink); font-size: .78rem; font-weight: 700; }
.sku-pricing-editor .channel-pricing-toolbar small, .sku-reconciliation .channel-pricing-toolbar small { display: block; margin-top: 4px; color: var(--muted); font-size: .7rem; line-height: 1.45; }
.sku-editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sku-editor-grid > .full { grid-column: 1 / -1; }
.sku-editor-grid .price-section, .vendor-editor-stack .price-section { display: grid; min-width: 0; gap: 10px; padding: 12px; background: var(--surface-muted); border: 1px solid var(--line); border-radius: 8px; }
.sku-editor-grid .price-section > label, .vendor-editor-stack .price-section > label { color: var(--ink); font-size: .74rem; font-weight: 700; }
.sku-editor-grid .price-grid, .sku-editor-grid .interval-row, .vendor-editor-stack .price-grid { display: grid; min-width: 0; gap: 12px; align-items: end; }
.sku-editor-grid .price-grid.three, .vendor-editor-stack .price-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sku-editor-grid .price-grid.one, .vendor-editor-stack .price-grid.one { grid-template-columns: minmax(0, 1fr); }
.sku-editor-grid .price-grid.two, .vendor-editor-stack .price-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sku-editor-grid .price-grid.four, .vendor-editor-stack .price-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sku-editor-grid .price-grid.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sku-editor-grid .interval-row { grid-template-columns: repeat(6, minmax(0, 1fr)) auto; padding-top: 12px; border-top: 1px solid var(--line); }
.sku-editor-grid .interval-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sku-editor-grid .pricing-empty { padding: 14px; color: var(--muted); background: var(--surface-muted); border: 1px dashed var(--line); border-radius: 8px; font-size: .74rem; }
.sku-reconciliation { display: grid; margin-top: 16px; gap: 12px; }
.reconciliation-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.reconciliation-metric { display: grid; gap: 4px; min-width: 0; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.reconciliation-metric span, .reconciliation-metric small { color: var(--muted); font-size: .72rem; }
.reconciliation-metric strong { color: var(--ink); font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.reconciliation-metric.positive strong { color: #1a7f37; }
.reconciliation-metric.negative strong { color: #c0392b; }
.reconciliation-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.reconciliation-chart-card { min-width: 0; padding: 14px 16px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.reconciliation-chart-card header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.reconciliation-chart-card header strong { color: var(--ink); font-size: .78rem; }
.reconciliation-chart-card header span { color: var(--muted); font-size: .7rem; }
.sku-reconciliation-table td { font-variant-numeric: tabular-nums; }
.profit-positive { color: #1a7f37; font-weight: 700; }
.profit-negative { color: #c0392b; font-weight: 700; }
.vendor-toggle-col { min-width: 44px; width: 44px; padding: 4px 6px; text-align: center; }
.vendor-row.expanded > td { padding: 0 !important; background: color-mix(in srgb, var(--surface-muted) 45%, var(--surface)); }
.vendor-keys-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.vendor-keys-table th { height: 36px; padding: 6px 14px; color: var(--muted); background: transparent; font-size: .72rem; text-align: left; }
.vendor-keys-table td { height: 40px; padding: 6px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; text-align: left; }
.vendor-keys-table tr:last-child td { border-bottom: 0; }
.vendor-empty { padding: 14px; color: var(--muted); font-size: .8rem; }
.vendor-editor-keys { display: grid; gap: 10px; }
.form-grid.vendor-editor-stack { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.vendor-editor-stack > .modal-section { min-width: 0; margin: 0; }
.vendor-editor-stack .modal-section-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 14px 18px; }
.vendor-editor-stack .modal-section-body > :not(.form-field) { grid-column: 1 / -1; }
.vendor-editor-stack .form-hint { color: var(--muted); font-size: .75rem; line-height: 1.5; overflow-wrap: anywhere; }
/* 厂商编辑按「左标签、右控件」排列，字段说明只通过标签旁的问号展开。 */
.vendor-editor-stack .modal-section-body {
    grid-template-columns: minmax(118px, 150px) minmax(0, 1fr);
    gap: 12px;
}
.vendor-editor-stack .modal-section-body > .form-field {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(118px, 150px) minmax(0, 1fr);
    align-items: center;
    column-gap: 12px;
    margin: 0;
}
.vendor-editor-stack .modal-section-body > .form-field > .field-label-row,
.vendor-editor-stack .modal-section-body > .form-field > label:first-child {
    grid-column: 1;
    grid-row: 1;
    margin: 0;
}
.vendor-editor-stack .modal-section-body > .form-field > :not(.field-label-row):not(label):not(.validation-message) {
    grid-column: 2;
    min-width: 0;
}
.vendor-editor-stack .modal-section-body > .form-field > .validation-message,
.vendor-editor-stack .modal-section-body > .form-field > .form-hint {
    grid-column: 2;
}
.vendor-editor-stack .modal-section-body > .form-field > .menu-toggle-row {
    grid-column: 2;
}
/* 勾选行全局样式：厂商编辑、序列编辑（自定义弹窗）与表格内的复选行共用，避免裸 checkbox。 */
.menu-toggle-row { display: flex; min-height: 32px; align-items: center; gap: 8px; font-weight: 400; }
.menu-toggle-row input[type="checkbox"] { flex: 0 0 16px; width: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--primary); }
.checkbox-field { width: 100%; padding: 10px 12px; background: var(--surface-muted); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.checkbox-field span { display: grid; gap: 3px; }
.checkbox-field strong { font-size: .78rem; }
.checkbox-field small { color: var(--muted); font-size: .72rem; line-height: 1.45; }
.sequence-metric { font-variant-numeric: tabular-nums; }
.sequence-link-summary { display: grid; gap: 4px; margin-bottom: 14px; padding: 11px 12px; color: var(--muted); background: var(--surface-muted); border: 1px solid var(--line); border-radius: 7px; }
.sequence-link-summary strong { color: var(--ink); font-size: .86rem; }
.sequence-link-summary span { font-size: .74rem; }
.sequence-link-editor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sequence-link-editor-grid .menu-toggle-row { min-height: 36px; padding: 7px 9px; background: var(--surface-muted); border: 1px solid var(--line); border-radius: 6px; }
/* table-row-actions 已并入全局 .row-actions（2026-10-27 操作栏统一）。 */
@media (max-width: 560px) { .sequence-link-editor-grid { grid-template-columns: minmax(0, 1fr); } }

/* 列表分页：与「模型路由」（分组管理）同款，ListPagination 组件与账号表壳（accounts-table-shell）配合。 */
.table-pagination { display: flex; min-height: 54px; padding: 9px 14px; align-items: center; justify-content: space-between; gap: 14px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 12px 12px; font-size: .8rem; }
.table-pagination .page-controls { display: flex; align-items: center; gap: 5px; }
.table-pagination .page-controls label { display: inline-flex; margin-right: 7px; align-items: center; gap: 5px; }
.table-pagination .page-controls select { min-height: 31px; padding: 4px 22px 4px 7px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; }
.table-pagination .page-button { min-width: 31px; min-height: 31px; padding: 4px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 7px; }
.table-pagination .page-button:hover { color: var(--ink); background: var(--surface-muted); }
.table-pagination .page-button.active { color: white; background: var(--primary); }
@media (max-width: 620px) { .table-pagination { align-items: flex-start; flex-direction: column; } .table-pagination .page-controls { width: 100%; overflow-x: auto; } }
@media (max-width: 560px) {
    .vendor-editor-stack .modal-section-body { grid-template-columns: minmax(0, 1fr); }
    .vendor-editor-stack .modal-section-body > .form-field { grid-template-columns: minmax(0, 1fr); row-gap: 6px; }
    .vendor-editor-stack .modal-section-body > .form-field > .field-label-row,
    .vendor-editor-stack .modal-section-body > .form-field > label:first-child,
    .vendor-editor-stack .modal-section-body > .form-field > :not(.field-label-row):not(label):not(.validation-message),
    .vendor-editor-stack .modal-section-body > .form-field > .validation-message,
    .vendor-editor-stack .modal-section-body > .form-field > .form-hint { grid-column: 1; }
}
.vendor-editor-key-add { display: flex; align-items: center; gap: 8px; }
.vendor-editor-key-add select { min-width: 0; flex: 1 1 auto; min-height: 36px; padding: 6px 10px; color: var(--ink); background: var(--surface); border: 1px solid var(--form-control-border); border-radius: 6px; font-size: .8rem; }
.vendor-editor-key-list { display: grid; gap: 6px; }
.vendor-editor-key-head { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 0 10px 4px; color: var(--muted); font-size: .72rem; }
.vendor-editor-key-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; min-height: 46px; padding: 7px 9px; align-items: center; gap: 10px; background: var(--surface-muted); border: 1px solid var(--line); border-radius: 6px; }
.vendor-editor-key-row > span { display: grid; min-width: 0; gap: 2px; }
.vendor-editor-key-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vendor-editor-key-row small { color: var(--muted); font-size: .72rem; }
.vendor-editor-key-main { display: grid; min-width: 0; grid-template-columns: minmax(130px, 1.2fr) minmax(140px, 1fr) 70px minmax(110px, .8fr); align-items: center; gap: 10px; width: 100%; }
.vendor-editor-key-main > .status-badge { grid-column: 4; grid-row: 1; justify-self: start; }
.vendor-editor-key-main > small { grid-column: 2; grid-row: 1; }
.vendor-editor-key-main > .status-badge + small { grid-column: 3; }
.vendor-key-manage-modal { width: 92vw; height: 80vh; max-height: 80vh; }
/* 表单视图（2026-10-21）：列表视图恒定 80vh 承载网格；表单内容少，高度随内容收缩避免下半截空白。 */
.vendor-key-manage-modal.vendor-key-form-modal { height: auto; min-height: 340px; }
.vendor-key-manage-modal.vendor-key-form-modal .modal-body { overflow: auto; padding: 16px 18px; }
.vendor-key-manage-modal .modal-body { min-height: 0; padding: 4px 18px 0; display: flex; flex-direction: column; }
.vendor-key-manage-modal .vendor-editor-keys { display: flex; min-height: 0; flex: 1 1 auto; flex-direction: column; }
.vendor-key-manage-toolbar { display: flex; align-items: center; justify-content: flex-end; margin: 0 0 6px; }
.vendor-key-create-button,
.vendor-key-create-button.dxbl-btn,
.vendor-key-create-button.dxbl-btn-primary,
.vendor-key-create-button button { min-height: 42px !important; padding: 8px 22px !important; background-color: var(--primary-strong) !important; background-image: none !important; border-color: var(--primary-strong) !important; border-radius: 7px !important; color: #fff !important; font-size: .92rem !important; font-weight: 700 !important; }
.vendor-key-create-button:hover:not(:disabled),
.vendor-key-create-button.dxbl-btn:hover:not(:disabled) { background-color: var(--primary-hover) !important; border-color: var(--primary-hover) !important; color: #fff !important; }
.vendor-key-manage-modal .vendor-key-grid { min-height: 0; flex: 1 1 auto; }
.vendor-key-models { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; max-width: 100%; }
.vendor-key-models .model-catalog-empty { color: var(--muted); font-size: .74rem; }
.vendor-key-model-tag { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 1px 6px; color: #1682c5; background: #eaf6ff; border: 1px solid #a5dafa; border-radius: 4px; font-size: .74rem; }
.vendor-key-model-more { color: var(--muted); white-space: nowrap; font-size: .75rem; }
.vendor-editor-key-row > .row-actions { justify-self: end; }
.vendor-keys-expanded-row > td { padding: 0 !important; background: var(--surface-muted); }
.vendor-sequence-table .expand-column { width: 42px; min-width: 42px; padding: 4px !important; text-align: center; }
.vendor-sequence-table .expand-column .dxbl-btn { min-width: 30px; padding: 5px; }
.vendor-keys-expanded-panel { padding: 12px 16px 14px 34px; border-bottom: 1px solid var(--line); }
.vendor-keys-expanded-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.vendor-nested-key-grid { background: var(--surface); }
@media (max-width: 560px) { .vendor-editor-key-add { align-items: stretch; flex-direction: column; } .vendor-editor-key-add .button { width: 100%; } }

/* 厂商编辑弹窗内嵌 Key 表格：行内 启用/禁用 与 删除（窄表，弹窗宽度内展示）。 */
.vendor-key-table-scroll { overflow-x: auto; }
.vendor-key-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.vendor-key-table th, .vendor-key-table td { padding: 7px 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
.vendor-key-table th { color: var(--muted); background: var(--surface-muted); font-size: .72rem; font-weight: 700; }
.vendor-key-table tbody tr:last-child td { border-bottom: 0; }
.vendor-key-table .actions-column { text-align: right; }
.vendor-key-name { display: grid; gap: 1px; min-width: 0; }
.vendor-key-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vendor-key-name small { color: var(--muted); font-size: .7rem; }
@media (max-width: 820px) {
    .sku-editor-grid .price-grid.six, .sku-editor-grid .price-grid.four, .vendor-editor-stack .price-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sku-editor-grid .interval-row { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
    .model-product-picker, .model-product-picker select { width: 100%; min-width: 0; }
}
@media (max-width: 560px) {
    .sku-editor-grid, .sku-editor-grid .price-grid.two, .sku-editor-grid .price-grid.three, .sku-editor-grid .price-grid.four, .sku-editor-grid .price-grid.six, .sku-editor-grid .interval-row, .vendor-editor-stack .price-grid.two, .vendor-editor-stack .price-grid.three, .vendor-editor-stack .price-grid.four { grid-template-columns: 1fr; }
  .model-sequence-toolbar { display: grid; grid-template-columns: 1fr; }
  .model-sequence-toolbar .model-sequence-search, .model-sequence-toolbar .model-sequence-vendor-filter { width: 100%; min-width: 0; }
  .model-sequence-toolbar .model-sequence-vendor-filter { display: grid; grid-template-columns: 1fr; align-items: stretch; gap: 5px; }
    .reconciliation-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .reconciliation-summary { grid-template-columns: minmax(0, 1fr); }
  .reconciliation-charts { grid-template-columns: minmax(0, 1fr); }
  .reconciliation-chart-card header { align-items: flex-start; flex-direction: column; gap: 3px; }
}

/* 模型产品 · 上游关联编辑弹窗的产品摘要行 */
.sequence-link-summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}


/* DevExpress 下拉/日期统一迁移：显式 Width 参数以 width 属性落在自定义元素上，
   但 DX 基础样式 .dxbl-text-edit { width: 100% } 会在 Blazor 重渲染丢掉 JS 内联宽度后接管，
   导致工具条下拉被撑满整行。这里直接用 CSS 读取 width 属性还原显式宽度（不支持 attr() 的旧浏览器回落 100%）。 */
dxbl-combo-box[width],
dxbl-tag-box[width],
dxbl-date-edit[width] {
  width: 100%;
}

dxbl-combo-box[width],
dxbl-tag-box[width],
dxbl-date-edit[width] {
  width: attr(width type(<length-percentage>), 100%);
}

/* DevExpress 编辑器（下拉/日期/数字等）统一控件高度 36px，对齐全站原生 input 与
   .search-box 标准（DX 默认约 30px，与原生混排时高低不齐）。 */
.dxbl-text-edit {
  min-height: 36px;
  --dxbl-text-edit-padding-y: .5rem;
}

/* DX 主题（office-white）原生主色为橙 #fe7109：DX 内建 loading 指示（网格加载、下拉懒加载等）
   跟随平台主色（2026-10-20 用户反馈；默认蓝色 accent，绿色 accent 用户自动跟随绿色）。 */
.dxbl-wait-indicator {
  --dxbl-wait-indicator-color: var(--primary);
}

.dxbl-loading-panel {
  --dxbl-loading-panel-message-color: var(--primary);
}

/* 筛选区内的 DxSelectField/DxDateTimeField（封装根是 .form-field，表单口径：40px 输入、深色标签、
   15px 下边距，且 .form-field input 全局规则会给 DX 内层 input 叠出 40px + 双边框）回落为筛选口径：
   弱化标签（muted/.68rem/700，与 .filter-field label 同款）、内层输入交还 DX 根元素描边（根已统一 36px），
   与各页原生筛选字段对齐。新页面的筛选容器含 DX 封装字段时，把容器类名登记到下面三个选择器列表。 */
.system-log-filters .form-field,
.audit-filter-grid .form-field,
.admin-usage-filter-grid .form-field,
.filters .form-field,
.log-filters .form-field,
.compact-toolbar .form-field,
.event-filters .form-field,
.filter-grid .form-field,
.batch-filters .form-field,
.dashboard-date-time-range .form-field {
  gap: 6px;
  margin-bottom: 0;
}

.system-log-filters .form-field label,
.audit-filter-grid .form-field label,
.admin-usage-filter-grid .form-field label,
.filters .form-field label,
.log-filters .form-field label,
.compact-toolbar .form-field label,
.event-filters .form-field label,
.filter-grid .form-field label,
.batch-filters .form-field label,
.dashboard-date-time-range .form-field label {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
}

.system-log-filters .form-field .dxbl-text-edit-input,
.audit-filter-grid .form-field .dxbl-text-edit-input,
.admin-usage-filter-grid .form-field .dxbl-text-edit-input,
.filters .form-field .dxbl-text-edit-input,
.log-filters .form-field .dxbl-text-edit-input,
.compact-toolbar .form-field .dxbl-text-edit-input,
.event-filters .form-field .dxbl-text-edit-input,
.filter-grid .form-field .dxbl-text-edit-input,
.batch-filters .form-field .dxbl-text-edit-input,
.dashboard-date-time-range .form-field .dxbl-text-edit-input {
  height: auto;
  padding: 7px 10px;
  color: var(--ink);
  font-size: .75rem;
  background: transparent;
  border: 0;
}

/* 模型产品列表（2026-10-10 列拆分）：产品简介列单行截断，悬浮看全文。 */
.model-product-table .product-desc-cell { max-width: 240px; }
.model-product-table .product-desc-cell .vendor-cell { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }

/* ---- 模型密钥 · 使用密钥弹窗内的客户端工具卡（2026-10-12 重设计：快速开始向导并入弹窗） ---- */
.client-tool-card { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-card); }
.client-tool-card header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.client-tool-card p { margin: 0; font-size: 13px; color: var(--text-secondary); flex: 1; }
.tool-tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--bg-muted); color: var(--text-secondary); }
.client-tool-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tool-meta { color: var(--text-muted); font-size: 11px; }
.config-file-actions { display: flex; gap: 8px; }

/* ---- 模型监控：厂商健康卡 + 序列监控表 ---- */
/* 厂商健康卡片改表格（2026-10-18 用户裁决）：upstream-vendor-grid/card 样式退役，
   复用 ops-table 表格体系（.ops-vendor-table 仅作复用标记，无附加规则）。 */
/* 2026-10-15 需求 #7：去掉序列监控表 420px 内滚动，随页面一屏网格布局展示。 */

/* ==========================================================================
   字段说明 ? 悬浮提示（2026-10-14 用户定稿）：替代字段下方 form-hint 小字。
   纯 CSS hover/focus 出气泡，长文本自动换行，贴右输入框不至于遮挡。
   ========================================================================== */
.field-hint {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    color: var(--muted);
    cursor: help;
    vertical-align: middle;
}
.field-hint:hover, .field-hint:focus-visible { color: var(--primary); }
.field-hint-popover {
    display: none;
    position: absolute;
    left: 50%;
    bottom: calc(100% + 6px);
    transform: translateX(-14px);
    z-index: 60;
    width: max-content;
    max-width: 280px;
    padding: 7px 10px;
    font-size: .78rem;
    line-height: 1.5;
    font-weight: 400;
    text-align: left;
    white-space: normal;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 6px 18px rgb(15 23 42 / 14%);
}
.field-hint-popover::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 24px;
    margin-left: -5px;
    border: 5px solid transparent;
    border-top-color: var(--line);
}
.field-hint:hover .field-hint-popover,
.field-hint:focus-visible .field-hint-popover,
.field-hint:focus .field-hint-popover { display: block; }

/* ===== 使用密钥弹窗（2026-10-14 傻瓜式重做）：文档式说明与提示排版 ===== */
.use-key-doc-note {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-left: 3px solid var(--primary);
    background: var(--primary-soft, rgb(39 116 90 / 8%));
    border-radius: 6px;
    font-size: .84rem;
    line-height: 1.7;
}
.use-key-plain-note {
    display: flex; align-items: center; gap: 6px;
    margin: 10px 0 0;
    color: var(--muted);
    font-size: .78rem;
}
.use-key-plain-note svg { flex: 0 0 auto; }
/* 命令块更醒目：加粗左缘 + 等宽行距，复制即用的观感。 */
.config-file.command-block pre { font-size: .8rem; line-height: 1.8; }
.config-file.command-block code { word-break: break-all; }

/* ==========================================================================
   全局列表/筛选统一口径（2026-11-09 用户定稿，基准=上游厂商序列工具条）
   - .app-filter-bar：全站筛选栏唯一容器（label 左 / 控件右的行式栅格）
   - .app-data-grid：全站 DevExpress DxGrid 唯一视觉口径（表头/行高/描边/分页）
   - 仅使用 :root 设计令牌，不引入新颜色/字号/圆角
   ========================================================================== */

/* ---------- 统一筛选栏 ---------- */
.app-filter-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 10px 20px;
    width: 100%;
    padding: 14px 16px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-sizing: border-box;
}

.app-filter-bar > .form-field,
.app-filter-bar > label,
.app-filter-bar > .filter-input {
    display: grid;
    grid-template-columns: minmax(84px, 132px) minmax(0, 1fr);
    align-items: center;
    column-gap: 10px;
    row-gap: 0;
    min-width: 0;
    margin: 0;
}

.app-filter-bar .form-field > label:first-child,
.app-filter-bar .form-field > .field-label-row,
.app-filter-bar > label > span,
.app-filter-bar > .filter-input > span {
    grid-column: 1;
    grid-row: 1;
    margin: 0;
    color: var(--muted);
    font-size: .7rem;
    font-weight: 700;
    white-space: nowrap;
}

.app-filter-bar .form-field > :not(label):not(.field-label-row),
.app-filter-bar > .filter-input > input {
    grid-column: 2;
    min-width: 0;
}

.app-filter-bar > .quick-date-range {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 36px;
}

.app-filter-bar > .quick-date-range .quick-date-label {
    min-width: 84px;
    margin: 0;
    color: var(--muted);
    font-size: .7rem;
    font-weight: 700;
}

.app-filter-bar input:not([type="checkbox"]):not([type="radio"]),
.app-filter-bar select,
.app-filter-bar textarea {
    width: 100%;
    min-width: 0;
    height: 36px;
    padding: 7px 10px;
    color: var(--form-control-color);
    background: var(--form-control-bg);
    border: 1px solid var(--form-control-border);
    border-radius: var(--form-control-radius);
    font-size: .78rem;
    box-sizing: border-box;
}

.app-filter-bar textarea {
    height: auto;
    line-height: 1.5;
    resize: vertical;
}

.app-filter-bar input:not([type="checkbox"]):not([type="radio"]):focus,
.app-filter-bar select:focus,
.app-filter-bar textarea:focus {
    border-color: var(--form-control-focus);
    outline: 0;
    box-shadow: 0 0 0 3px var(--form-control-focus-ring);
}

/* DX 封装控件在筛选栏内统一 36px 高，内层输入交还 DX 根描边 */
.app-filter-bar .dxbl-text-edit,
.app-filter-bar .dxbl-combo-box,
.app-filter-bar .dxbl-date-edit,
.app-filter-bar dxbl-combo-box,
.app-filter-bar dxbl-date-edit,
.app-filter-bar .quick-date-select-wrap {
    min-height: 36px;
    min-width: 0;
}

.app-filter-bar .dxbl-text-edit-input {
    height: auto;
    padding: 7px 10px;
    color: var(--ink);
    font-size: .78rem;
    background: transparent;
    border: 0;
}

.app-filter-bar .search-box {
    width: 100%;
    height: 36px;
}

.app-filter-actions {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 2px;
}

/* 窄屏：单列堆叠，label 仍在左 */
@media (max-width: 960px) {
    .app-filter-bar { grid-template-columns: minmax(0, 1fr); }
    .app-filter-actions { justify-content: flex-start; }
}

/* ---------- 统一 DxGrid 视觉 ---------- */
.app-data-grid.dxbl-grid {
    --dxbl-grid-bg: var(--surface);
    --dxbl-grid-color: var(--ink);
    --dxbl-grid-border-color: var(--line);
    --dxbl-grid-outer-border-color: var(--line);
    --dxbl-grid-border-radius: 8px;
    --dxbl-grid-header-bg: var(--surface-muted);
    --dxbl-grid-header-color: var(--muted);
    --dxbl-grid-header-font-weight: 700;
    --dxbl-grid-font-size: var(--management-list-body-font);
    --dxbl-grid-text-cell-padding-x: 11px;
    --dxbl-grid-text-cell-padding-y: 9px;
    --dxbl-grid-editor-cell-padding-x: 8px;
    --dxbl-grid-editor-cell-padding-y: 5px;
    --dxbl-grid-hover-bg: var(--surface-hover);
    --dxbl-grid-hover-color: var(--ink);
    --dxbl-grid-selection-bg: var(--primary-soft);
    --dxbl-grid-selection-color: var(--primary);
    --dxbl-grid-focus-frame-color: var(--primary);
    --dxbl-grid-filter-panel-bg: var(--surface);
    --dxbl-grid-footer-bg: var(--surface-muted);
    --dxbl-grid-footer-color: var(--muted);
    --dxbl-grid-search-box-container-width: 260px;
    --dxbl-grid-line-height: 1.45;

    width: 100%;
    overflow: hidden;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(22, 34, 28, .06);
}

.app-data-grid .dxbl-grid-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.app-data-grid .dxbl-grid-table thead th,
.app-data-grid .dxbl-grid-header {
    height: 43px;
    padding: 9px 11px !important;
    color: var(--muted) !important;
    background-color: var(--surface-muted) !important;
    font-size: var(--management-list-header-font) !important;
    font-weight: 700 !important;
    letter-spacing: 0;
    text-align: left;
    border-bottom: 1px solid var(--line) !important;
}

.app-data-grid .dxbl-grid-header.dxbl-grid-header-sortable:hover {
    color: var(--primary) !important;
    cursor: pointer;
}

.app-data-grid .dxbl-grid-table tbody td {
    height: 48px;
    padding: 9px 11px !important;
    color: var(--ink);
    font-size: var(--management-list-body-font);
    vertical-align: middle;
    border-bottom: 1px solid var(--line) !important;
}

.app-data-grid .dxbl-grid-table tbody tr:last-child td {
    border-bottom: 0 !important;
}

.app-data-grid .dxbl-grid-table tbody tr:hover td {
    background: var(--surface-hover);
}

.app-data-grid .dxbl-grid-filter-row > td {
    padding: 5px 8px !important;
    background: var(--surface-soft);
    border-bottom: 1px solid var(--line) !important;
}

.app-data-grid .dxbl-grid-filter-row .dxbl-text-edit,
.app-data-grid .dxbl-grid-filter-row .dxbl-combo-box {
    min-height: 32px;
}

.app-data-grid .dxbl-grid-filter-row .dxbl-text-edit-input {
    padding: 5px 8px;
    font-size: .75rem;
}

.app-data-grid .dxbl-grid-search-box-container {
    padding: 8px 11px;
}

.app-data-grid .dxbl-pager {
    padding: 8px 11px;
    border-top: 1px solid var(--line);
    font-size: var(--management-list-pagination-font);
}

.app-data-grid .dxbl-grid-empty-data-area {
    padding: 28px 12px;
    color: var(--muted);
}

/* 暗色主题随令牌联动（变量已在 :root/data-theme 覆盖，显式规则兜底主题硬编码） */
html[data-theme="dark"] .app-data-grid.dxbl-grid {
    box-shadow: none;
}
