/* 生图监控看台（2026-10-17）
   视觉对标上架工作台的任务监控：浅色底 + 蓝色顶边 + 四联统计卡 + 密排表格。
   ⚠️ 全部选择器都限定在 .monitor-page / #detailDialog 下，不污染站点其它页面。 */

.monitor-page {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: #20242d;
  background: #f6f7fa;
  font-size: 14px;
  color-scheme: light;
}
.monitor-page * { box-sizing: border-box; }

/* ── 顶部 ─────────────────────────────────────────────────────────────── */
.monitor-header {
  background: #fff;
  border-bottom: 1px solid #dde2e8;
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.monitor-title h1 {
  font-size: 21px;
  margin: 0;
  font-weight: 650;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 8px;
}
.monitor-title h1 span {
  font-size: 13px;
  font-weight: 500;
  color: #666f7d;
  background: #eef1f5;
  padding: 3px 8px;
  border-radius: 4px;
}
.monitor-title p { margin: 6px 0 0; color: #6a7280; font-size: 13px; }
.monitor-nav { display: flex; gap: 12px; align-items: center; }
.monitor-nav a { color: #3568d3; text-decoration: none; font-size: 13px; }
.monitor-nav a:hover { text-decoration: underline; }

/* ── 按钮 / 表单（统一控件样式）─────────────────────────────────────────
   ⚠️ 只作用在【看台自己的容器】里，不要写成 .monitor-page button ——
      公告弹窗（notices.js 注入的）也在 body 下，会被一起改掉：
      那个「×」关闭按钮会变成白块（踩过一次，截图里一眼看见）。
   ─────────────────────────────────────────────────────────────────────── */
.monitor-header button,
.monitor-main button,
#detailDialog button {
  font: inherit;
  color: inherit;
  border: 1px solid #d5dbe5;
  border-radius: 5px;
  background: #fff;
  min-height: 33px;
  padding: 5px 12px;
  cursor: pointer;
  white-space: nowrap;
}
.monitor-header button:hover,
.monitor-main button:hover,
#detailDialog button:hover { background: #eef3fc; border-color: #819dcc; }
.monitor-header button:disabled,
.monitor-main button:disabled,
#detailDialog button:disabled { opacity: .45; cursor: default; }
.monitor-header button:focus-visible,
.monitor-main button:focus-visible,
#detailDialog button:focus-visible { outline: 2px solid #3568d3; outline-offset: 3px; }

/* ── 主体 ─────────────────────────────────────────────────────────────── */
.monitor-main { padding: 22px 28px; max-width: 1900px; margin: auto; }

/* 四联统计卡 */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: #fff;
  border-top: 2px solid #3568d3;
  border-bottom: 1px solid #dde2e8;
  margin-bottom: 22px;
}
.stat-card {
  padding: 17px 22px;
  border-right: 1px solid #e8ebf0;
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
}
.stat-card:last-child { border-right: 0; }
.stat-card span { color: #616b79; }
.stat-card strong { font-size: 26px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat-card.is-running strong { color: #158365; }
.stat-card.is-stopped strong { color: #a36b10; }
.stat-card.is-errors strong { color: #c44747; }

/* 筛选栏 */
.toolbar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: #606a79; }
.toolbar select,
.toolbar input[type="search"] {
  height: 36px;
  border: 1px solid #d5dbe5;
  background: #fff;
  border-radius: 5px;
  padding: 6px 9px;
  max-width: 100%;
  min-width: 130px;
  font: inherit;
  font-size: 13px;
  color: inherit;
}
#filterMode { max-width: 260px; }
.toolbar .search { flex: 1; min-width: 220px; }
.toolbar .auto { flex-direction: row; align-items: center; min-height: 36px; color: #334155; white-space: nowrap; }
.toolbar .auto input { accent-color: #3568d3; }

.message { min-height: 20px; font-size: 13px; overflow-wrap: anywhere; color: #6a7280; margin: 0 0 10px; }
.message.error { color: #b73333; }

/* ── 表格 ─────────────────────────────────────────────────────────────── */
.table-wrap {
  overflow: auto;
  background: #fff;
  border-top: 1px solid #dde2e8;
  border-bottom: 1px solid #dde2e8;
}
.monitor-page table,
#detailDialog table { border-collapse: collapse; width: 100%; min-width: 1060px; table-layout: fixed; text-align: left; }
.monitor-page th,
#detailDialog th { background: #f0f3f7; font-size: 12px; color: #697383; font-weight: 500; padding: 11px 12px; }
.monitor-page td,
#detailDialog td { border-top: 1px solid #e8ebf0; padding: 14px 12px; vertical-align: top; font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }

.monitor-page th:nth-child(1) { width: 150px; }
.monitor-page th:nth-child(2) { width: 210px; }
.monitor-page th:nth-child(3) { width: 120px; }
.monitor-page th:nth-child(4) { width: 210px; }
.monitor-page th:nth-child(5) { width: 190px; }
.monitor-page th:nth-child(6) { width: 165px; }
.monitor-page th:nth-child(7) { width: 70px; }

.cell-strong { font-weight: 600; }
.cell-muted { color: #7a8493; font-size: 12px; display: block; margin-top: 2px; }

/* 状态徽标 */
.badge { display: inline-block; font-size: 12px; padding: 2px 7px; border-radius: 4px; background: #eef1f5; color: #5c6573; }
.badge.running { color: #16775c; background: #e7f5ef; }
.badge.completed { color: #16775c; background: #e7f5ef; }
.badge.partial { color: #b03c3c; background: #fff0f0; }
.badge.stopped { color: #986513; background: #fff4df; }
.badge.unknown { color: #986513; background: #fff4df; }

/* 进度条 */
.monitor-page progress { width: 100%; height: 7px; appearance: none; border: 0; border-radius: 2px; background: #e9edf4; display: block; margin: 7px 0; }
.monitor-page progress::-webkit-progress-bar { background: #e9edf4; border-radius: 2px; }
.monitor-page progress::-webkit-progress-value { background: #527ed4; border-radius: 2px; }
.progress-numbers { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: #6a7280; }
.progress-numbers .good { color: #16835f; }
.progress-numbers .bad { color: #bf3b3b; }

.empty { text-align: center; padding: 55px; color: #7a8493; }

/* 底部分页 */
.monitor-footer { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; gap: 14px; color: #7a8493; font-size: 12px; flex-wrap: wrap; }
.pager { display: flex; gap: 12px; align-items: center; }

/* ── 详情弹窗 ─────────────────────────────────────────────────────────── */
#detailDialog {
  width: min(1080px, calc(100% - 32px));
  max-height: 85vh;
  border: 1px solid #d9dfe8;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 12px 60px #20242d30;
  color: #20242d;
  background: #fff;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}
#detailDialog::backdrop { background: #131b2b66; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dialog-head h2 { font-size: 18px; margin: 0; }
.detail-summary { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: #5f6a7a; margin: 12px 0; }
.detail-summary b { color: #20242d; font-variant-numeric: tabular-nums; }
.detail-filter { margin: 0 0 12px; }
.detail-filter label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: #606a79; width: 160px; }
.detail-filter select { height: 36px; border: 1px solid #d5dbe5; background: #fff; border-radius: 5px; padding: 6px 9px; font: inherit; font-size: 13px; }
.detail-table-wrap { max-height: 52vh; }
#detailDialog th:nth-child(1) { width: 240px; }
#detailDialog th:nth-child(2) { width: 110px; }
#detailDialog th:nth-child(3) { width: 280px; }
#detailDialog th:nth-child(4) { width: 165px; }
#detailDialog th:nth-child(5) { width: 70px; }

/* 浅色主题本来就是浅色，不需要额外覆盖；深色主题下也保持浅色（这是运营看台） */
html.theme-light .monitor-page { background: #f6f7fa; }

@media (max-width: 700px) {
  .monitor-header { padding: 16px; }
  .monitor-title h1 { font-size: 19px; }
  .monitor-main { padding: 16px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-card { padding: 13px 14px; border-bottom: 1px solid #e8ebf0; }
  .stat-card strong { font-size: 23px; }
  .toolbar > label:not(.auto) { flex: 1; min-width: calc(50% - 10px); }
  .toolbar .search { min-width: 100%; }
  #detailDialog { padding: 14px; }
}
