/* 统一玻璃表面：主卡、内嵌面板和浮层使用同一套材质层级。 */
.console-mode .app-header {
  background: rgb(25 30 36 / 0.68);
  border-bottom-color: rgb(255 255 255 / 0.1);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

.console-mode .section-block,
.console-mode .card:not(.console-card),
.console-mode .stat,
.console-mode .finance-kpi,
.console-mode #view-users > .context-bar span,
.console-mode .finance-settings,
.console-mode .user-detail,
.console-mode .table-wrap,
.console-mode .model-card,
.console-mode .chat-sessions,
.console-mode .chat-main,
.console-mode .model-by-model-nav,
.console-mode .model-by-model-detail,
.console-mode .model-source-list,
.console-mode .key-batch-group,
.console-mode .rule-card,
.console-mode .model-source-card,
.console-mode .media-file-card,
.console-mode .provider-nav,
.console-mode .provider-detail,
.console-mode .provider-detail-panel,
.console-mode .log-breakdown-card {
  border-color: rgb(255 255 255 / 0.12) !important;
  background:
    linear-gradient(145deg, rgb(255 255 255 / 0.045), transparent 42%),
    rgb(25 31 38 / 0.32);
  box-shadow:
    0 20px 46px -32px rgb(0 0 0 / 0.95),
    inset 0 1px 0 rgb(255 255 255 / 0.055);
  backdrop-filter: blur(6px) saturate(1.12);
  -webkit-backdrop-filter: blur(6px) saturate(1.12);
}

/* 用户摘要不再套一层横向空卡，三个指标直接组成等宽玻璃组。 */
body.console-mode #view-users > .context-bar {
  display: grid;
  flex: 0 0 auto;
  width: min(100%, 480px);
  max-width: 100%;
  padding: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-self: flex-start;
  gap: 8px;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.console-mode #view-users > .context-bar span {
  width: auto;
  min-width: 0;
  min-height: 48px;
  padding: 0 12px;
  justify-content: space-between;
  border-radius: var(--r-md);
}

@media (max-width: 520px) {
  body.console-mode #view-users > .context-bar {
    width: 100%;
  }

  body.console-mode #view-users > .context-bar span {
    padding: 8px;
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
  }
}

.console-mode .table-wrap {
  background: rgb(28 34 41 / 0.24);
}

.console-mode .filter-bar,
.console-mode .compact-filter-group,
.console-mode .model-filter-bar,
.console-mode .media-request-summary,
.console-mode .media-result-stage,
.console-mode .monitor-status,
.console-mode .cleanup-preview,
  .console-mode .notification-item,
  .console-mode .created,
  .console-mode .logs,
.console-mode .model-empty-state,
.console-mode #modelList > .muted {
  border-color: rgb(255 255 255 / 0.1) !important;
  background: rgb(28 34 41 / 0.24);
  box-shadow:
    0 14px 30px -26px rgb(0 0 0 / 0.9),
    inset 0 1px 0 rgb(255 255 255 / 0.04);
  backdrop-filter: blur(6px) saturate(1.08);
  -webkit-backdrop-filter: blur(6px) saturate(1.08);
}

.console-mode .key-create-advanced-panel,
.console-mode .scheduler-rule-editor,
.console-mode .provider-technical-summary,
.console-mode .model-draft-dialog,
.console-mode .modal-card,
.console-mode .user-modal-card,
.console-mode .notification-panel {
  border-color: rgb(255 255 255 / 0.14) !important;
  background:
    linear-gradient(145deg, rgb(255 255 255 / 0.065), transparent 42%),
    rgb(24 29 35 / 0.78);
  box-shadow:
    0 28px 64px -26px rgb(0 0 0 / 0.98),
    inset 0 1px 0 rgb(255 255 255 / 0.065);
  backdrop-filter: blur(24px) saturate(1.25);
  -webkit-backdrop-filter: blur(24px) saturate(1.25);
}

body:not(.console-mode) .auth-card {
  border-color: rgb(255 255 255 / 0.14);
  background:
    linear-gradient(145deg, rgb(255 255 255 / 0.065), transparent 42%),
    rgb(24 29 35 / 0.54);
  box-shadow:
    0 28px 64px -28px rgb(0 0 0 / 0.95),
    inset 0 1px 0 rgb(255 255 255 / 0.06);
  backdrop-filter: blur(24px) saturate(1.25);
  -webkit-backdrop-filter: blur(24px) saturate(1.25);
}

.console-mode .stat-grid .stat:hover,
.console-mode .model-card:hover,
.console-mode .rule-card:hover {
  border-color: rgb(255 255 255 / 0.18) !important;
  background:
    linear-gradient(145deg, rgb(255 255 255 / 0.065), transparent 42%),
    rgb(29 35 42 / 0.44);
}

.console-mode .rule-card.is-editing,
.console-mode .notification-item.unread {
  border-color: rgb(var(--accent-rgb) / 0.34) !important;
  background: rgb(var(--accent-rgb) / 0.12);
}

.console-mode .control:not(:focus) {
  border-color: rgb(255 255 255 / 0.08);
  background: rgb(255 255 255 / 0.075);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
}

@media (min-width: 961px) {
  .console-mode .app-body {
    column-gap: 12px;
  }

  .console-mode .app-nav {
    align-self: start;
    margin: 12px 0 12px 12px;
    padding: 10px;
    max-height: calc(100% - 24px);
    border: var(--hair) solid rgb(255 255 255 / 0.12);
    border-radius: var(--r-lg);
    background: rgb(17 22 28 / 0.36);
    box-shadow:
      0 18px 42px -28px rgb(0 0 0 / 0.95),
      inset 0 1px 0 rgb(255 255 255 / 0.05);
    backdrop-filter: blur(10px) saturate(1.12);
    -webkit-backdrop-filter: blur(10px) saturate(1.12);
  }

  body.admin-console-mode .app-nav {
    padding: 8px;
  }

  body.admin-console-mode .nav-section {
    margin-bottom: 2px;
  }

  body.admin-console-mode .nav-section-title {
    padding: 9px 8px 3px;
  }

  body.admin-console-mode .nav-section:first-child .nav-section-title {
    padding-top: 4px;
  }

  body.admin-console-mode .nav-item {
    min-height: 36px;
    margin-bottom: 1px;
    padding: 6px 10px;
    font-size: 13px;
  }
}

@media (min-width: 961px) and (max-height: 700px) {
  body.admin-console-mode .app-nav {
    padding-block: 4px;
  }

  body.admin-console-mode .nav-section {
    margin-bottom: 1px;
  }

  body.admin-console-mode .nav-section-title {
    padding: 3px 8px 1px;
    font-size: 10px;
  }

  body.admin-console-mode .nav-section:first-child .nav-section-title {
    padding-top: 1px;
  }

  body.admin-console-mode .nav-item {
    min-height: 32px;
    margin-bottom: 0;
    padding-block: 4px;
    font-size: 12.5px;
  }
}

.console-mode .nav-item.active {
  border: var(--hair) solid rgb(var(--accent-rgb) / 0.24);
  box-shadow:
    inset 3px 0 0 var(--accent),
    0 10px 24px -20px rgb(var(--accent-rgb) / 0.9);
}

@media (max-width: 960px) {
  .console-mode .app-nav {
    top: 10px;
    bottom: 10px;
    left: 10px;
    width: min(280px, 82vw);
    margin: 0;
    padding: 10px;
    border: var(--hair) solid rgb(255 255 255 / 0.14);
    border-radius: var(--r-lg);
    background: rgb(17 22 28 / 0.72);
    box-shadow:
      0 22px 48px -22px rgb(0 0 0 / 0.95),
      inset 0 1px 0 rgb(255 255 255 / 0.05);
    backdrop-filter: blur(22px) saturate(1.2);
    -webkit-backdrop-filter: blur(22px) saturate(1.2);
  }
}

/* 监控表从平板宽度起使用固定布局，移动端由 mobile-card-table 转为卡片。 */
@media (min-width: 721px) {
  #monitorPanel .monitor-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  #monitorPanel .monitor-table th,
  #monitorPanel .monitor-table td {
    white-space: normal;
    overflow-wrap: anywhere;
  }

}

/* 桌面工作区：把“配置/筛选”和“结果/列表”拆成有主次的空间，避免每个视图都变成
   从标题一路堆到表格的长列。1180px 以下回到单列，保留移动端的自然阅读顺序。 */
@media (min-width: 1180px) {
  #view-admin.active,
  #view-users.active,
  #view-invites.active,
  #view-notifications.active,
  #view-finance.active,
  #view-usage.active,
  #view-runtime.active,
  body.admin-console-mode #view-logs.active,
  body:not(.admin-console-mode) #view-logs.active,
  #view-monitor.active,
  body.admin-console-mode #view-models.active,
  body:not(.admin-console-mode) #view-models.active {
    align-content: start;
    align-items: start;
    column-gap: var(--gap-section);
    row-gap: var(--gap-section);
  }

  /* 生成 Key：创建配置作为左侧工作台，已发 Key 保持右侧随时可核对。 */
  #view-admin.active {
    display: grid;
    grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
    grid-template-areas:
      "head head"
      "form table";
  }

  #view-admin > .panel-head { grid-area: head; }
  #view-admin > .key-batch-shell {
    grid-area: form;
    min-width: 0;
  }
  #view-admin > .table-section {
    grid-area: table;
    min-width: 0;
  }

  #view-admin .key-batch-layout,
  #view-invites .key-batch-layout,
  #view-notifications .key-batch-layout {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  #view-admin .key-batch-shell,
  #view-invites .invite-batch-shell,
  #view-notifications .notification-compose-shell {
    gap: 8px;
  }

  #view-admin .key-batch-group-head,
  #view-invites .key-batch-group-head,
  #view-notifications .key-batch-group-head {
    margin-bottom: 8px;
  }

  #view-admin .key-batch-group-note,
  #view-admin .key-batch-fields .field-hint,
  #view-invites .key-batch-group-note,
  #view-invites .key-batch-fields .field-hint,
  #view-notifications .key-batch-group-note,
  #view-notifications .key-batch-fields .field-hint:not(.notice-body-count) {
    display: none;
  }

  #view-admin .key-batch-fields,
  #view-invites .key-batch-fields,
  #view-notifications .key-batch-fields {
    gap: 8px !important;
  }

  #view-admin .key-batch-fields > .field,
  #view-invites .key-batch-fields > .field,
  #view-notifications .key-batch-fields > .field {
    gap: 4px !important;
  }

  /* 用户：这是列表页，摘要和筛选放在表格上方，避免侧栏挤压表格。 */
  #view-users.active {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  #view-users > .context-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
  }

  #view-users > .context-bar span {
    width: auto;
    justify-content: initial;
  }

  #view-users > .filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin: 0;
  }

  #view-users > .filter-bar .filter-search,
  #view-users > .filter-bar .control-w-status,
  #view-users > .filter-bar .filter-actions {
    min-width: 0;
  }

  #view-users > .filter-bar .filter-actions {
    display: flex;
    margin-left: 0;
  }

  #view-users > .table-section {
    min-width: 0;
  }

  /* 邀请码复用生成 Key 的窄工作台；通知保留较宽的正文编辑区。 */
  #view-invites.active,
  #view-notifications.active {
    display: grid;
    grid-template-areas:
      "head head"
      "create table";
  }

  #view-invites.active {
    grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
  }

  #view-notifications.active {
    grid-template-columns: minmax(360px, 400px) minmax(0, 1fr);
  }

  #view-invites > .panel-head,
  #view-notifications > .panel-head { grid-area: head; }

  #view-invites > .invite-batch-shell,
  #view-notifications > .notification-compose-shell {
    grid-area: create;
    min-width: 0;
  }

  #view-invites > .table-section,
  #view-notifications > .table-section {
    grid-area: table;
    min-width: 0;
  }

  /* 财务：先看指标，再看经营参数；这里不需要把设置卡固定在右侧。 */
  #view-finance.active {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  #view-finance > .sync-line,
  #view-finance > .log-summary,
  #view-finance > .finance-settings,
  #view-finance > .finance-kpis {
    width: 100%;
  }

  #view-finance > .finance-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
  }

  #view-finance > .finance-settings {
    margin: 0;
  }

  #view-finance > .finance-settings .form-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  /* 用量：中等宽度保持单列，避免九列表格被侧栏压成不可读的窄条。 */
  #view-usage.active {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  #view-usage > .stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #view-usage > .section-block.card-flush,
  #view-usage > .section-block:not(.card-flush) {
    min-width: 0;
  }

  #view-usage > .section-block:not(.card-flush) .model-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  /* 日志：两端统一使用顶部筛选条与全宽明细；管理台额外保留日志类型分段。 */
  body.admin-console-mode #view-logs.active,
  body:not(.admin-console-mode) #view-logs.active {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  body.admin-console-mode #view-logs > .logging-tabs {
    display: inline-flex;
    align-self: flex-start;
    width: fit-content;
    margin: 0;
  }

  body.admin-console-mode #view-logs > .logging-tabs button {
    width: 132px;
    flex: 0 0 132px;
  }

  body.admin-console-mode #view-logs > .logging-panel {
    min-width: 0;
  }

  body:not(.admin-console-mode) #view-logs > .table-wrap {
    min-width: 0;
  }

  /* 模型可用性：视图切换固定在页头，目录区域不再因内容高度把控件推向下方。 */
  body.admin-console-mode #view-models.active {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  body.admin-console-mode #view-models > #modelList {
    min-width: 0;
  }

  /* 用户模型页是目录，不使用侧栏；摘要与模型卡片保持同一内容轴。 */
  body:not(.admin-console-mode) #view-models.active {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  body:not(.admin-console-mode) #view-models > .log-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
  }

  body:not(.admin-console-mode) #view-models > .log-summary .log-chip {
    width: auto;
    justify-content: initial;
  }

body:not(.admin-console-mode) #view-models > #modelList {
    min-width: 0;
  }
}

/* 宽屏用量工作区：明细是主任务，Key 分布作为同屏上下文，避免两个大卡片纵向
   把用户真正关心的内容推到首屏之外。 */
@media (min-width: 1440px) {
  #view-usage.active {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(360px, 0.75fr);
    grid-template-areas:
      "head head"
      "stats stats"
      "daily keys";
    align-items: start;
    align-content: start;
  }

  #view-usage > .panel-head {
    grid-area: head;
  }

  #view-usage > .stat-grid {
    grid-area: stats;
    margin: 0;
  }

  #view-usage > .section-block.card-flush {
    grid-area: daily;
  }

  #view-usage > .section-block:not(.card-flush) {
    grid-area: keys;
  }

  #view-usage > .section-block:not(.card-flush) .model-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

}

/* 模型主从布局的移动端最终覆盖，必须位于后置工作台样式之后。 */
@media (max-width: 720px) {
  .model-by-model-layout {
    grid-template-columns: 1fr;
  }

  .model-by-model-nav-list {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
  }

  .model-by-model-nav-item {
    width: 210px;
    flex: 0 0 210px;
  }

  .model-by-model-detail {
    min-height: 0;
  }

  .model-by-model-detail-head {
    flex-direction: column;
  }

  .model-by-model-detail-head .row-tags {
    justify-content: flex-start;
  }

  .model-source-list-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .model-source-list-head {
    display: none;
  }

  .model-source-list-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
  }

  .model-source-list-status {
    justify-content: flex-end;
  }

  .model-source-list-controls {
    grid-column: 1 / -1;
  }
}

/* 桌面工作区收口：保持主任务、表格和操作区的阅读顺序。 */
@media (min-width: 961px) {
  #view-user > .key-activation-section {
    align-self: stretch;
    min-height: 100%;
    justify-content: center;
  }

  .provider-account-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  .provider-account-table .account-actions-cell {
    min-width: 0;
    white-space: normal;
  }

  .provider-account-table .account-actions-cell .row-actions {
    width: 100%;
    max-width: none;
    flex-wrap: wrap;
    white-space: normal;
  }

  .provider-account-table .account-actions-cell .row-actions .btn {
    min-width: 0;
    flex: 1 1 74px;
    padding-inline: 7px;
  }
}

@media (min-width: 721px) {
  #view-accounts .provider-direct-section > .account-section-title {
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 10px;
  }

  #view-accounts .provider-direct-section > .account-section-title > div:first-child {
    min-width: 0;
    flex: 1 1 auto;
  }

  #view-accounts .provider-direct-section > .account-section-title > .toolbar {
    flex: 0 0 auto;
    flex-wrap: nowrap;
  }
}

@media (min-width: 1180px) {
  /* 固定布局并允许辅助信息换行，金额列保留整值，时间和请求上下文自然换成两行。 */
  body:not(.admin-console-mode) #view-logs > .table-wrap .log-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  body:not(.admin-console-mode) #view-logs > .table-wrap .log-table th,
  body:not(.admin-console-mode) #view-logs > .table-wrap .log-table td {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  body:not(.admin-console-mode) #view-logs > .table-wrap .log-table th:nth-child(5),
  body:not(.admin-console-mode) #view-logs > .table-wrap .log-table td:nth-child(5),
  body:not(.admin-console-mode) #view-logs > .table-wrap .log-table th:nth-child(6),
  body:not(.admin-console-mode) #view-logs > .table-wrap .log-table td:nth-child(6) {
    white-space: nowrap;
  }

  body:not(.admin-console-mode) #view-logs > .table-wrap .log-table td:nth-child(7) .cell-sub {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:not(.admin-console-mode) #view-logs > .table-wrap .log-table .log-usage-json {
    width: 100%;
    max-width: 100%;
  }

  /* 宽屏监控的状态与活跃数保持单行。 */
  #monitorPanel .monitor-table th:nth-child(7),
  #monitorPanel .monitor-table td:nth-child(7),
  #monitorPanel .monitor-table th:nth-child(8),
  #monitorPanel .monitor-table td:nth-child(8) {
    white-space: nowrap;
  }
}

/* 窄桌面双栏中的运营表：信息优先在当前工作区内完成，不把阅读任务推给横向滚动。 */
@media (min-width: 721px) {
  #view-admin .admin-key-table,
  #view-invites .invite-table,
  #view-notifications .notification-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  #view-admin .admin-key-table th,
  #view-admin .admin-key-table td,
  #view-invites .invite-table th,
  #view-invites .invite-table td,
  #view-notifications .notification-table th,
  #view-notifications .notification-table td {
    padding: 11px 8px !important;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #view-admin .admin-key-table th:nth-child(1),
  #view-admin .admin-key-table td:nth-child(1),
  #view-admin .admin-key-table th:nth-child(5),
  #view-admin .admin-key-table td:nth-child(5),
  #view-admin .admin-key-table th:nth-child(6),
  #view-admin .admin-key-table td:nth-child(6),
  #view-invites .invite-table th:nth-child(1),
  #view-invites .invite-table td:nth-child(1),
  #view-invites .invite-table th:nth-child(5),
  #view-invites .invite-table td:nth-child(5),
  #view-notifications .notification-table th:nth-child(1),
  #view-notifications .notification-table td:nth-child(1) {
    white-space: nowrap;
  }

  #view-admin .admin-key-table .key-line {
    min-width: 0;
  }

  #view-admin .admin-key-table .key-line code {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #view-admin .admin-key-table td:last-child,
  #view-invites .invite-table td:last-child,
  #view-notifications .notification-table td:last-child {
    white-space: normal;
  }

  #view-admin .admin-key-table .row-actions,
  #view-invites .invite-table .row-actions {
    display: grid;
    width: 100%;
    max-width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    white-space: normal;
  }

  #view-admin .admin-key-table .row-actions .btn,
  #view-invites .invite-table .row-actions .btn {
    width: 100%;
    min-width: 0;
    padding-inline: 4px;
    font-size: 11px;
  }

  #view-invites .invite-table .row-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #view-invites .invite-table td:nth-child(2) code {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #view-notifications .notification-table .cell-main,
  #view-notifications .notification-table td:nth-child(4) {
    overflow-wrap: anywhere;
  }

  #view-notifications .notification-table td:last-child .btn {
    min-width: 0;
    padding-inline: 5px;
    font-size: 11px;
  }

  #view-admin .admin-key-table td:nth-child(3) > .pill {
    max-width: 100%;
    min-width: 0;
    padding-inline: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10.5px;
  }

  #monitorPanel .monitor-table td:nth-child(2) > .pill {
    max-width: 100%;
    min-width: 0;
    padding-inline: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 9.5px;
    letter-spacing: 0;
  }

  #monitorPanel .monitor-table td:nth-child(9) {
    overflow: hidden;
    overflow-wrap: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (min-width: 1180px) and (max-width: 1479px) {
  #monitorPanel .monitor-table th,
  #monitorPanel .monitor-table td {
    padding-inline: 8px !important;
    font-size: 11.5px;
  }

  #monitorPanel .monitor-table td:nth-child(3),
  #monitorPanel .monitor-table td:nth-child(4),
  #monitorPanel .monitor-table td:nth-child(5) {
    overflow: hidden;
    overflow-wrap: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* 721–1179px：主区可能已经被侧栏或监控摘要分走空间，表格也必须服从当前列宽。 */
@media (min-width: 721px) and (max-width: 1179px) {
  #view-users .mobile-card-table,
  #view-user .mobile-card-table,
  #view-usage .usage-table,
  #view-logs .log-table,
  #view-logs .logging-panel .table-wrap table:not(.log-table),
  #view-accounts .provider-account-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  /* 中等桌面中详情区会被侧栏压窄，来源行改成“上游/状态 + 操作”两行，
     让操作区拥有完整宽度，避免三列最小宽度触发内部横向滚动。 */
  #view-models .model-source-list-head,
  #view-models .model-source-list-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  #view-models .model-source-list-head span:nth-child(2) {
    display: none;
  }

  #view-models .model-source-list-head span:nth-child(3) {
    grid-column: 2;
  }

  #view-models .model-source-list-row {
    align-items: start;
  }

  #view-models .model-source-list-controls {
    grid-column: 1 / -1;
  }

  #view-users .mobile-card-table th,
  #view-users .mobile-card-table td,
  #view-user .mobile-card-table th,
  #view-user .mobile-card-table td,
  #view-usage .usage-table th,
  #view-usage .usage-table td,
  #view-logs .log-table th,
  #view-logs .log-table td,
  #view-logs .logging-panel .table-wrap table th,
  #view-logs .logging-panel .table-wrap table td,
  #view-accounts .provider-account-table th,
  #view-accounts .provider-account-table td {
    padding: 10px 8px !important;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #monitorPanel .monitor-table th,
  #monitorPanel .monitor-table td {
    padding: 10px 8px !important;
  }

  #view-usage .usage-table th.num,
  #view-usage .usage-table td.num {
    white-space: nowrap;
  }

  #view-usage .usage-table th,
  #view-usage .usage-table td {
    padding: 10px 6px !important;
  }

  #view-usage .usage-table td:last-child {
    font-size: 11px;
  }

  #view-logs .log-table td:nth-child(5),
  #view-logs .log-table td:nth-child(6) {
    white-space: nowrap;
  }

  #view-accounts .provider-account-table .account-actions-cell {
    min-width: 0;
    white-space: normal;
  }

  #view-accounts .provider-account-table .row-actions {
    width: 100%;
    max-width: 100%;
    flex-wrap: wrap;
    white-space: normal;
  }

  #view-accounts .provider-account-table .row-actions .btn {
    min-width: 0;
    flex: 1 1 70px;
    padding-inline: 6px;
  }

  #view-accounts .provider-account-table .account-request-metrics {
    gap: 3px;
  }

  #view-accounts .provider-account-table .account-request-success,
  #view-accounts .provider-account-table .account-request-failure,
  #view-accounts .provider-account-table .account-sync-state {
    padding-inline: 5px;
    font-size: 10.5px;
  }
}
