/* TPS 采集器 · Web 前端
 *
 * 2026-12-04 重做（用户反馈"前端做得不好"）：
 *   · 主线只有三步：传表 → 确认（并发/筛选/通道）→ 开始
 *   · 一屏一事：开始页只放"这一单"必须决定的事；历史/日志/设置收进顶栏与抽屉
 *   · 数字要大：用户真正关心的是"采到多少人"，不是二十个小指标
 *   · 说人话：错误先给结论和影响，技术细节折叠
 */

:root {
  --bg: #f5f7fa;
  --card: #ffffff;
  --ink: #0f172a;
  --ink2: #475569;
  --ink3: #94a3b8;
  --line: #e5e9f0;
  --brand: #2563eb;
  --blue: #2563eb;   /* 2026-12-06：.ov-hw-fill 引用过它但一直没定义 → 进度条透明 */
  --brand-d: #1d4ed8;
  --ok: #16a34a;
  --warn: #ea580c;
  --bad: #dc2626;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.grow { flex: 1; }
.muted { color: var(--ink2); }
.small { font-size: 13px; }
.empty { text-align: center; padding: 24px 0; }

/* ── 视图骨架 ─────────────────────────────────────────── */
.view { min-height: 100vh; }
.view.center { display: grid; place-items: center; padding: 24px; }

.bar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px;
  background: #0f172a; color: #fff;
}
.logo {
  border: 0; color: #fff;
  font-weight: 800; letter-spacing: .06em; font-size: 15px;
  padding: 5px 10px; border-radius: 8px; background: rgba(255, 255, 255, .12);
  transition: background .12s;
}
.logo:hover { background: rgba(255, 255, 255, .22); }
.topnav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.bar .txt.on { background: rgba(255, 255, 255, .18); color: #fff; font-weight: 600; }

/* ── 全局运行中迷你浮条 ─────────────────────────────────── */
.live-banner {
  position: sticky; top: 50px; z-index: 25;
  background: #eff6ff; border-bottom: 1px solid #bfdbfe;
  padding: 8px 20px;
}
.live-banner-inner {
  max-width: 1480px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: #1e3a8a;
}
.live-banner .lb-meta { color: #3b5998; font-size: 13px; }
.live-banner .lb-btn {
  border: 0; background: var(--brand); color: #fff;
  padding: 5px 12px; border-radius: 8px; font-size: 12.5px; font-weight: 600;
}
.live-banner .lb-btn:hover { background: var(--brand-d); }
.dot-live.sm { width: 8px; height: 8px; }
.dot-live.idle { background: #94a3b8; animation: none; box-shadow: none; }
.dot-live.done { background: var(--ok); animation: none; box-shadow: none; }
.dot-live.paused { background: var(--warn); animation: none; box-shadow: none; }
.dot-live.error { background: var(--bad); animation: none; box-shadow: none; }

.inline-links { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 6px; }

/* ── 历史任务行内操作 ───────────────────────────────────── */
.hrow-ops { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hrow-ops .ghost, .hrow-ops .primary { padding: 5px 10px; font-size: 12.5px; }

/* ── 抽屉遮罩 + Toast ───────────────────────────────────── */
.drawer-mask {
  position: fixed; inset: 0; z-index: 45;
  background: rgba(15, 23, 42, .35);
  animation: fade .15s ease;
}
.toasts {
  position: fixed; top: 62px; left: 50%; transform: translateX(-50%);
  z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 9px 16px; border-radius: 10px; font-size: 13.5px; color: #fff;
  background: #0f172a; box-shadow: 0 10px 28px -8px rgba(15, 23, 42, .45);
  max-width: min(560px, 90vw); animation: pop .15s ease;
}
.toast.ok { background: #15803d; }
.toast.err { background: #b91c1c; }
.toast.warn { background: #c2410c; }

button:disabled { opacity: .48; cursor: not-allowed; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ── 阶段二：复用最近数据集 / 工具栏 / 子 Tab / 分页 / 原因条形图 ── */
.inp-sm {
  padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 13px; background: #fff; color: var(--ink); min-width: 180px;
}
.inp-sm:focus, .inp-full:focus { outline: 2px solid #bfdbfe; border-color: var(--brand); }
.inp-full {
  width: 100%; max-width: 440px; padding: 8px 11px;
  border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; background: #fff; color: var(--ink);
}

.recent-ds {
  margin-top: 14px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.recent-ds-head {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; background: #f8fafc; border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.recent-ds-list { max-height: 240px; overflow-y: auto; }
.ds-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 16px; border: 0; border-bottom: 1px solid #f1f5f9;
  background: #fff; text-align: left; transition: background .1s;
}
.ds-item:last-child { border-bottom: 0; }
.ds-item:hover { background: #eff6ff; }
.ds-item .di-main { flex: 1; min-width: 0; }
.ds-item .di-name { font-weight: 600; font-size: 13.5px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-item .di-meta { font-size: 12px; color: var(--ink2); margin-top: 2px; }
.ds-item .di-cnt { font-weight: 700; font-size: 14px; color: var(--brand);
  font-variant-numeric: tabular-nums; white-space: nowrap; }

.hist-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 14px;
}

.subtabs {
  display: flex; gap: 6px; margin: 12px 0 4px;
  border-bottom: 1px solid var(--line); padding-bottom: 8px;
}
.subtabs button {
  border: 0; background: none; color: var(--ink2); font-size: 14px; font-weight: 500;
  padding: 7px 14px; border-radius: 9px; transition: all .12s;
}
.subtabs button:hover { background: #eef2f7; color: var(--ink); }
.subtabs button.on { background: #dbeafe; color: #1d4ed8; font-weight: 600; }
.tab-badge {
  display: inline-block; margin-left: 4px; font-size: 12px; font-weight: 600;
  opacity: .85; font-variant-numeric: tabular-nums;
}

.data-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px;
}
.pager {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 4px 4px;
}

.copyable {
  cursor: pointer; border-radius: 5px; padding: 1px 4px; margin: -1px -4px;
  transition: background .1s;
}
.copyable:hover { background: #dbeafe; color: var(--brand-d); }
.ptag {
  display: inline-block; margin-left: 5px; padding: 1px 6px; border-radius: 5px;
  font-size: 11px; background: #f1f5f9; color: var(--ink2); vertical-align: middle;
}
.ptag.wireless { background: #dcfce7; color: #166534; }
.ptag.landline { background: #fef3c7; color: #92400e; }
.ptag.voip { background: #ede9fe; color: #5b21b6; }
.cell-clip { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }

.audit-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.audit-card-h {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px; background: #f8fafc; border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.audit-bars { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.abar-row { display: flex; flex-direction: column; gap: 4px; }
.abar-top { display: flex; justify-content: space-between; font-size: 13px; }
.abar-top b { font-variant-numeric: tabular-nums; }
.abar-track { height: 7px; border-radius: 999px; background: #f1f5f9; overflow: hidden; }
.abar-fill { height: 100%; border-radius: 999px; background: var(--brand); }
.abar-fill.warn { background: var(--warn); }
@media (max-width: 820px) { .audit-cards { grid-template-columns: 1fr; } }

/* ── 阶段三：密码显隐 / 来源标签 / 全局批量保存 / 内部建号弹窗 ── */
.src-tag {
  display: block; margin-top: 4px; font-size: 11px; font-weight: 500;
  color: var(--ink3);
}
.src-tag.acct { color: var(--brand); }
.pwd-wrap {
  position: relative; display: flex; align-items: center;
  flex: 1; min-width: 240px;
}
.pwd-wrap input {
  width: 100%; min-width: 0; padding: 9px 38px 9px 12px;
  border: 1px solid var(--line); border-radius: 9px; font-size: 13px;
}
.pwd-wrap .eye-btn {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--ink3);
  padding: 3px 7px; border-radius: 5px; font-size: 12px; font-weight: 500; line-height: 1.2;
}
.pwd-wrap .eye-btn:hover { background: #f1f5f9; color: var(--ink); }
.pwd-wrap .eye-btn.on { color: var(--brand); }

.grow2 .ginfo { flex: 1; min-width: 200px; }
.grow2 .ginfo .gkey { width: auto; font-weight: 600; font-size: 13px; display: block; }
.grow2 .ginfo .gdesc { font-size: 11.5px; color: var(--ink2); display: block; margin-top: 2px; line-height: 1.4; }
.grow2 .gctrl { display: flex; align-items: center; gap: 6px; flex: none; }
.grow2 .gctrl input, .grow2 .gctrl select { width: 230px; min-width: 0; flex: none; }
.grow2.dirty { background: #eff6ff; }
.grow2.dirty input, .grow2.dirty select { border-color: var(--brand); background: #fff; }

.global-bar {
  position: sticky; bottom: 14px; z-index: 20;
  margin-top: 12px; padding: 11px 16px;
  background: #0f172a; color: #fff; border-radius: 12px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 12px 32px -10px rgba(15, 23, 42, .5);
}
.global-bar .ghost { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .2); }
.global-bar .ghost:hover { background: rgba(255, 255, 255, .18); }

.form-grid { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.form-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .form-row2 { grid-template-columns: 1fr; } }
.cred-box {
  margin-top: 12px; padding: 12px 14px; border-radius: 10px;
  background: #f0fdf4; border: 1px solid #bbf7d0; font-size: 13px; color: #166534;
}
.cred-box pre {
  margin: 8px 0 0; padding: 8px 10px; border-radius: 8px;
  background: #fff; border: 1px solid #dcfce7; color: var(--ink);
  font: 12.5px/1.6 ui-monospace, Menlo, monospace; white-space: pre-wrap;
}
.who { display: flex; align-items: center; gap: 8px; }
.who .av {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand); font-weight: 700; font-size: 13px;
}
.who .nm { display: flex; flex-direction: column; line-height: 1.15; }
.who .nm b { font-size: 13px; font-weight: 600; }
.who .nm small { font-size: 11px; color: #94a3b8; }
.conn { font-size: 10px; color: #64748b; }
.conn.live { color: #22c55e; }
.conn.down, .conn.off { color: #ef4444; }

/* ── 主容器 ───────────────────────────────────────────── */
.stage { padding: 28px 20px 64px; }
.wrap { max-width: 860px; margin: 0 auto; }
.wrap.wide { max-width: 1480px; }

.h1 { font-size: 30px; margin: 8px 0 6px; letter-spacing: -.02em; }
.lede { color: var(--ink2); margin: 0 0 22px; font-size: 15px; }

/* ── 上传区域（简洁工具风格）─────────────────────────── */
.drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 24px 20px; margin: 0;
  border: 1.5px dashed #cbd5e1; border-radius: var(--radius);
  background: var(--card); cursor: pointer; text-align: center;
  transition: border-color .12s, background .12s;
}
.drop:hover, .drop.over { border-color: var(--brand); background: #f8fbff; }
.drop-ico {
  width: 40px; height: 40px; border-radius: 10px;
  background: #f1f5f9; color: #475569;
  display: grid; place-items: center; margin-bottom: 2px;
}
.drop:hover .drop-ico { background: #dbeafe; color: var(--brand); }
.drop-main { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.drop-sub { color: var(--ink2); font-size: 12.5px; }
.drop-sub b { color: var(--ink); font-weight: 600; }
.drop.busy { opacity: .6; pointer-events: none; }

/* ── 上传结果 ─────────────────────────────────────────── */
.ds-card {
  margin-top: 16px; padding: 16px 18px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.ds-ok { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.tick {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: #dcfce7; color: var(--ok); font-weight: 700; font-size: 13px;
}
.ds-meta { color: var(--ink2); font-size: 13px; margin: 6px 0 0 30px; }
.ds-sample {
  margin: 8px 0 0 30px; font-size: 13px; color: var(--ink2);
  background: #f8fafc; border-radius: 8px; padding: 8px 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ds-card .link { margin-left: 30px; margin-top: 8px; }

/* ── 设置三行 ─────────────────────────────────────────── */
.setup {
  margin-top: 20px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.setrow { display: flex; gap: 20px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.setrow:last-child { border-bottom: 0; }
.setlabel { width: 180px; flex: none; }
.setlabel b { display: block; font-size: 14px; }
.setlabel small { color: var(--ink2); font-size: 12px; line-height: 1.45; display: block; margin-top: 3px; }
.setbody { flex: 1; min-width: 0; }
.hint { color: var(--ink3); font-size: 12px; display: block; margin-top: 6px; }

/* ── 并发数字输入（用户要求：输入制，默认 30）───────────── */
.numbox {
  display: inline-flex; align-items: stretch;
  border: 1px solid var(--line); border-radius: 11px; overflow: hidden;
  background: #fff;
}
.numbox input {
  width: 78px; border: 0; text-align: center;
  font: 600 16px/1 inherit; font-variant-numeric: tabular-nums;
  padding: 9px 4px; color: var(--ink); background: transparent;
  -moz-appearance: textfield;
}
.numbox input::-webkit-outer-spin-button,
.numbox input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.numbox input:focus { outline: none; background: #f8fafc; }
.numbox .step {
  border: 0; background: #f8fafc; color: var(--ink2);
  width: 36px; font-size: 16px; cursor: pointer;
}
.numbox .step:hover { background: #eef2f7; color: var(--ink); }
.numbox .step:active { background: #e2e8f0; }

/* ── 胶囊按钮 ─────────────────────────────────────────── */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills button {
  position: relative; padding: 7px 14px;
  border: 1px solid var(--line); background: #fff;
  border-radius: 999px; font-size: 13px; color: var(--ink);
  cursor: pointer; transition: all .12s;
}
.pills button:hover { border-color: #cbd5e1; background: #f8fafc; }
.pills button.on {
  border-color: var(--brand); background: var(--brand);
  color: #fff; font-weight: 600;
}

/* ── 状态灯 ───────────────────────────────────────────── */
.lights { display: flex; flex-wrap: wrap; gap: 8px; }
.light {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; font-size: 13px;
  background: #f1f5f9; color: var(--ink2);
}
.light::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink3); }
.light.ok { background: #dcfce7; color: #166534; }
.light.ok::before { background: var(--ok); }
.light.bad { background: #fee2e2; color: #991b1b; }
.light.bad::before { background: var(--bad); }
.light.wait::before { animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* ── 按钮 ─────────────────────────────────────────────── */
button { font: inherit; cursor: pointer; }
.cta {
  width: 100%; margin-top: 22px; padding: 15px;
  border: 0; border-radius: 12px;
  background: var(--brand); color: #fff;
  font-size: 16px; font-weight: 600;
  transition: background .15s, transform .1s;
}
.cta:hover:not(:disabled) { background: var(--brand-d); }
.cta:active:not(:disabled) { transform: translateY(1px); }
.cta:disabled { background: #cbd5e1; cursor: not-allowed; }
.cta.big { padding: 17px; font-size: 17px; }

.primary {
  padding: 9px 18px; border: 0; border-radius: 10px;
  background: var(--brand); color: #fff; font-weight: 600; font-size: 14px;
}
.primary:hover { background: var(--brand-d); }
.ghost {
  padding: 9px 16px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); font-size: 14px;
}
.ghost:hover { background: #f8fafc; border-color: #cbd5e1; }
.ghost.danger { color: var(--bad); border-color: #fecaca; }
.ghost.danger:hover { background: #fef2f2; }
.txt {
  border: 0; background: none; color: var(--ink2);
  font-size: 14px; padding: 6px 8px; border-radius: 8px;
}
.txt:hover { color: var(--ink); background: rgba(15, 23, 42, .05); }
.bar .txt { color: #cbd5e1; white-space: nowrap; }
.bar .txt:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.link {
  border: 0; background: none; color: var(--brand); font-size: 13px;
  padding: 4px 0; text-decoration: underline; text-underline-offset: 3px;
}

/* ── 运行看板 ─────────────────────────────────────────── */
.run-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 16px; margin-bottom: 14px; }
.dot-live {
  width: 9px; height: 9px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 0 rgba(22, 163, 74, .5); animation: live 1.6s infinite;
}
@keyframes live {
  70% { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}
.bar-progress { height: 10px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.bar-progress i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #3b82f6, #22c55e);
  transition: width .6s ease;
}
.run-sub { display: flex; align-items: center; margin-top: 8px; font-size: 13px; color: var(--ink2); }

.big3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 22px 0; }
.kpi {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px;
}
.kpi b {
  display: block; font-size: 34px; font-weight: 700; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.kpi small { color: var(--ink2); font-size: 13px; }
.kpi:nth-child(3) b { color: var(--warn); }

.run-actions { display: flex; align-items: center; gap: 10px; }

/* ── 问题提示 ─────────────────────────────────────────── */
.trouble {
  margin-top: 20px; border: 1px solid #fed7aa; background: #fffbeb;
  border-radius: var(--radius); padding: 14px 18px;
}
.trouble summary { cursor: pointer; font-weight: 600; color: #9a3412; font-size: 14px; }
.trouble-body { margin-top: 10px; font-size: 14px; color: var(--ink2); }
.trouble-body p { margin: 6px 0; }
.tech { margin-top: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chips .chip {
  font-size: 12px; padding: 3px 9px; border-radius: 999px;
  background: #f1f5f9; color: var(--ink2);
}
.chips .chip b { color: var(--ink); }

/* ── 实时流 ───────────────────────────────────────────── */
.feed {
  margin-top: 24px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.feed-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px; border-bottom: 1px solid var(--line); font-size: 14px;
}
.feed-list { list-style: none; margin: 0; padding: 0; max-height: 340px; overflow-y: auto; }
.feed-list li {
  display: flex; align-items: baseline; gap: 10px;
  padding: 10px 18px; border-bottom: 1px solid #f1f5f9; font-size: 14px;
  animation: slidein .25s ease;
}
@keyframes slidein { from { opacity: 0; transform: translateY(-3px); } }
.feed-list li:last-child { border-bottom: 0; }
.feed-list li .nm { font-weight: 600; }
.feed-list li .meta { color: var(--ink2); font-size: 13px; }
.feed-list li .time { margin-left: auto; color: var(--ink3); font-size: 12px; }
.feed-foot {
  padding: 10px 18px; border-top: 1px solid var(--line);
  display: flex; justify-content: center;
}

/* ── 历史任务 ─────────────────────────────────────────── */
.hist-list { display: flex; flex-direction: column; gap: 10px; }
.hrow {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 18px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer; transition: border-color .12s, box-shadow .12s;
}
.hrow:hover { border-color: #cbd5e1; box-shadow: var(--shadow); }
.hrow .hmain { flex: 1; min-width: 0; }
.hrow .hname { font-weight: 600; font-size: 15px; }
.hrow .hmeta { color: var(--ink2); font-size: 13px; margin-top: 2px; }
.hrow .hnum { text-align: right; }
.hrow .hnum b { font-size: 20px; font-variant-numeric: tabular-nums; }
.hrow .hnum small { display: block; color: var(--ink2); font-size: 12px; }
.pill-state {
  font-size: 12px; padding: 3px 10px; border-radius: 999px;
  background: #f1f5f9; color: var(--ink2); white-space: nowrap;
}
.pill-state.running { background: #dcfce7; color: #166534; }
.pill-state.paused { background: #fef3c7; color: #92400e; }
.pill-state.stopped { background: #f1f5f9; color: #475569; }
.pill-state.done { background: #dbeafe; color: #1e40af; }
.pill-state.error { background: #fee2e2; color: #991b1b; }

/* ── 表格 ─────────────────────────────────────────────── */
.table-wrap { overflow: auto; background: var(--card); border-radius: var(--radius); }
.table-wrap.tall { max-height: 62vh; border: 1px solid var(--line); }
.table-wrap.short { max-height: 300px; border: 1px solid var(--line); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td {
  padding: 10px 14px; text-align: left; border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
}
.tbl th {
  position: sticky; top: 0; background: #f8fafc; z-index: 1;
  font-weight: 600; font-size: 12px; color: var(--ink2);
}
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tbody tr:hover { background: #f8fafc; }

/* ── 全局设置：参数名 + 输入 + 保存，一行一个（说明放 hover）── */
.gsec { border-bottom: 1px solid var(--line); }
.gsec:last-child { border-bottom: 0; }
.gsec-h {
  padding: 9px 16px; background: #f8fafc;
  font-size: 12px; font-weight: 600; color: var(--ink2);
  letter-spacing: .02em; border-bottom: 1px solid var(--line);
}
.grow2 {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 16px; border-bottom: 1px solid #f6f8fb;
}
.grow2:last-child { border-bottom: 0; }
.grow2:hover { background: #fafbfd; }
.grow2 .gkey {
  width: 150px; flex: none;
  font-size: 13px; color: var(--ink);
}
.grow2 input, .grow2 select {
  flex: 1; min-width: 150px; max-width: 420px;
  padding: 5px 9px; border: 1px solid var(--line); border-radius: 7px;
  font-size: 12.5px; background: #fff;
}
.grow2 input[data-changed] { border-color: #bfdbfe; background: #f8fbff; }
.grow2 .ghost.sm { padding: 4px 12px; font-size: 12px; flex: none; }

/* ── 二次确认弹窗 ─────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(15, 23, 42, .45);
  display: grid; place-items: center; padding: 20px;
  overflow-y: auto;
  animation: fade .15s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal-card {
  width: min(440px, 100%); background: var(--card);
  border-radius: 18px; padding: 26px 26px 20px;
  max-height: calc(100vh - 40px); overflow-y: auto;
  box-shadow: 0 24px 64px -20px rgba(15, 23, 42, .5);
  animation: pop .18s ease;
}
@keyframes pop { from { transform: scale(.97); opacity: .6; } }
.modal-card h3 { margin: 0 0 8px; font-size: 19px; }
.modal-lede { margin: 0 0 16px; font-size: 15px; color: var(--ink); }
.modal-kv {
  background: #f8fafc; border-radius: 12px;
  padding: 12px 16px; margin-bottom: 14px;
}
.modal-kv div {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 5px 0; font-size: 14px;
}
.modal-kv span { color: var(--ink2); }
.modal-kv b { font-variant-numeric: tabular-nums; }
.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px;
}

/* ── 抽屉 ─────────────────────────────────────────────── */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(720px, 100vw); background: var(--bg);
  box-shadow: -8px 0 40px -12px rgba(15, 23, 42, .3);
  z-index: 50; display: flex; flex-direction: column;
  animation: slide .2s ease;
}
@keyframes slide { from { transform: translateX(24px); opacity: .6; } }
.drawer-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; background: #0f172a; color: #fff;
}
.drawer-head .txt { color: #cbd5e1; }
.drawer-head .txt:hover { color: #fff; background: rgba(255, 255, 255, .14); }
.dtabs { display: flex; gap: 4px; }
.dtabs button {
  border: 0; background: none; color: #94a3b8;
  padding: 7px 14px; border-radius: 8px; font-size: 14px;
}
.dtabs button.on { background: rgba(255, 255, 255, .14); color: #fff; font-weight: 600; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px; }
.dpane { display: flex; flex-direction: column; gap: 10px; }
.dbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sel {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; font-size: 13px; color: var(--ink);
}
.logbox {
  background: #0f172a; color: #cbd5e1; border-radius: 10px; padding: 12px 14px;
  font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
  max-height: 320px; overflow: auto; margin: 0; white-space: pre-wrap;
}

/* 设置分组（沿用后端返回的结构，只调外观） */
.sgroup { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.sgroup > h3 {
  margin: 0; padding: 12px 16px; font-size: 13px;
  background: #f8fafc; color: var(--ink2); border-bottom: 1px solid var(--line);
}
.srow { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid #f1f5f9; }
.srow:last-child { border-bottom: 0; }
.srow .sk { flex: 1; min-width: 0; }
.srow .sk b { font-size: 13px; display: block; font-family: ui-monospace, Menlo, monospace; }
.srow .sk small { color: var(--ink3); font-size: 11.5px; }
.srow input[type=text], .srow input[type=password], .srow input[type=number] {
  width: 220px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 9px; font-size: 13px;
}
.srow .save { padding: 7px 14px; border-radius: 9px; border: 0; background: var(--brand); color: #fff; font-size: 13px; }
.srow .reset { padding: 7px 12px; border-radius: 9px; border: 1px solid var(--line); background: #fff; font-size: 13px; }

/* ── 消息 / 版本条 ────────────────────────────────────── */
.msg { font-size: 13px; min-height: 18px; margin: 10px 0 0; color: var(--ink2); }
.msg.err { color: var(--bad); }
.msg.ok { color: var(--ok); }
.verbar {
  font-size: 12px; color: var(--ink2); background: #f8fafc;
  border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; margin: 10px 0;
}

/* ── 登录 ─────────────────────────────────────────────── */
.auth {
  width: min(400px, 100%); background: var(--card);
  border-radius: 18px; box-shadow: 0 20px 60px -24px rgba(15, 23, 42, .35);
  padding: 34px 30px;
}
.brand-lg { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.auth .sub { color: var(--ink2); margin: 6px 0 22px; font-size: 14px; }
.auth label { display: block; margin-bottom: 14px; font-size: 13px; color: var(--ink2); }
.auth input {
  width: 100%; margin-top: 6px; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: 10px; font-size: 14px;
}
.auth input:focus { outline: 2px solid #bfdbfe; border-color: var(--brand); }
.auth .cta { margin-top: 6px; }

/* ── 设置页（每个用户自己的 4 项）──────────────────────── */
.card-like {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.srow2 {
  display: flex; gap: 18px; align-items: flex-start;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.srow2:last-child { border-bottom: 0; }
.srow2 .slab { width: 110px; flex: none; font-size: 14px; font-weight: 600; padding-top: 9px; }
.srow2 .sbody { flex: 1; min-width: 0; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input {
  flex: 1; min-width: 260px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 9px; font-size: 13px;
}
.primary.sm { padding: 8px 14px; font-size: 13px; }
.ghost.sm { padding: 8px 14px; font-size: 13px; }

/* 管理总览的四个数字 */
.big4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.big4 > div {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px;
}
.big4 b { display: block; font-size: 24px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.big4 small { color: var(--ink2); font-size: 12px; }

/* 表格里的操作按钮排一行 */
.tbl td .ghost, .tbl td .primary { padding: 5px 11px; font-size: 12.5px; margin-right: 4px; }

/* 筛选条件弹窗 */
.grid6 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 18px; }
.fld { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--ink2); }
.fld input, .fld select { padding: 8px 10px; font-size: 13.5px; width: 100%;
  border: 1px solid var(--line); border-radius: 9px; }
.chk { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink2); }
.scope { margin: 14px 0 0; padding: 10px 14px; background: #f8fafc;
  border-radius: 10px; font-size: 13px; color: var(--ink2); }
@media (min-width: 720px) { .grid6 { grid-template-columns: repeat(4, 1fr); } }

/* ── 管理员全站总览 & 桌面版同款实时指标面板 ────────────── */
.ov-live-strip {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 10px 16px; margin-bottom: 14px;
  background: #0f172a; color: #cbd5e1; border-radius: 12px; font-size: 13px;
}
.ov-live-strip b { color: #fff; font-variant-numeric: tabular-nums; margin-left: 4px; }
.ov-live-strip b.ok { color: #4ade80; }
.ov-live-strip b.bad { color: #f87171; }

.ov-hw-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-bottom: 14px;
}
.ov-hw-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px;
  min-width: 0;
}
.ov-hw-top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
}
.ov-hw-lbl { font-size: 12px; color: var(--ink2); font-weight: 500; }
.ov-hw-val {
  font-size: 18px; font-weight: 700; color: var(--ink);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.ov-hw-val.sm { font-size: 14.5px; }
.ov-hw-val.warn { color: #b45309; }
.ov-hw-val.hot { color: #dc2626; }
.ov-hw-bar {
  height: 5px; background: #e2e8f0; border-radius: 99px;
  overflow: hidden; margin: 8px 0 6px;
}
.ov-hw-fill {
  height: 100%; background: var(--blue); border-radius: 99px;
  transition: width .35s ease;
}
.ov-hw-fill.warn { background: #d97706; }
.ov-hw-fill.hot { background: #dc2626; }
.ov-hw-sub {
  display: block; font-size: 11.5px; color: var(--ink3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.ov-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.ov-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px;
}
.ov-card.accent { border-color: #bfdbfe; background: #f8fbff; }
.ov-card b {
  display: block; font-size: 24px; line-height: 1.15;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
.ov-card small { display: block; margin-top: 4px; font-size: 12.5px; color: var(--ink2); }
.ov-card .ov-sub { display: block; margin-top: 2px; font-size: 11.5px; color: var(--ink3); }

.rt-panel {
  margin: 16px 0 18px; padding: 16px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.rt-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.rt-head b { font-size: 15px; }
.rt-row { display: grid; gap: 10px; margin-bottom: 10px; }
.rt-row:last-child { margin-bottom: 0; }
.rt-row-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.rt-row-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.rt-card {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px;
  background: #fbfcfe; min-width: 0;
}
.rt-card-accent { border-color: #bfdbfe; background: #eff6ff; }
.rt-card b {
  display: block; font-size: 20px; font-weight: 700; line-height: 1.2;
  color: var(--ink); font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rt-card .rt-diag-val { font-size: 14px; line-height: 1.4; white-space: normal; }
.rt-card small {
  display: block; margin-top: 5px; font-size: 12px; color: var(--ink2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

@media (max-width: 1020px) {
  .rt-row-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rt-row-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-grid, .ov-hw-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── 移动端 ───────────────────────────────────────────── */
@media (max-width: 720px) {
  .bar { gap: 4px; padding: 8px 10px; flex-wrap: wrap; }
  .bar .txt { padding: 5px 6px; font-size: 13px; }
  .topnav { margin-left: 2px; gap: 2px; }
  .logo { font-size: 13px; padding: 3px 7px; }
  .who .nm { display: none; }
  .live-banner { top: 46px; padding: 6px 12px; }
  .stage { padding: 16px 12px 48px; }
  .h1 { font-size: 24px; }
  .setrow { flex-direction: column; gap: 10px; }
  .setlabel { width: auto; }
  .big3 { gap: 8px; }
  .kpi { padding: 12px 10px; }
  .kpi b { font-size: 26px; }
  .kpi small { font-size: 11.5px; line-height: 1.25; display: block; }
  .run-actions { flex-wrap: wrap; }
  .run-actions .primary { width: 100%; }
  .feed-list li { flex-wrap: wrap; }
  .feed-list li .time { margin-left: auto; }
  .drawer { width: 100vw; }
  .hrow { flex-wrap: wrap; gap: 8px; }
  .srow2, .grow2 { flex-direction: column; align-items: stretch; gap: 8px; }
  .srow2 .slab, .grow2 .gkey { width: auto; padding-top: 0; }
  .inline-form input, .pwd-wrap, .grow2 input, .grow2 select { min-width: 0; width: 100%; max-width: 100%; }
  .big4 { grid-template-columns: repeat(2, 1fr); }
}

/* 开始页预检提示（未配代理 / 打码 KEY）—— 2026-12-05 */
.precheck { margin: 12px 0 0; padding: 10px 12px; border-radius: 8px;
  background: rgba(220, 38, 38, .08); border: 1px solid rgba(220, 38, 38, .35);
  color: #dc2626; font-size: 13px; line-height: 1.6; }
.precheck b { margin-right: 2px; }
.precheck .link { margin-left: 6px; }

/* ── 总览工作台：双 Tab / 筛选工具栏 / 粘性操作列 / 日期分组 / 可关浮条 ── */
.lb-close {
  border: 0; background: transparent; color: var(--ink2);
  font-size: 16px; line-height: 1; padding: 4px 7px; border-radius: 6px;
  cursor: pointer; margin-left: 4px;
}
.lb-close:hover { background: rgba(15, 23, 42, .08); color: var(--ink); }

.ov-live-strip .ov-jump {
  cursor: pointer; padding: 2px 6px; margin: -2px -6px; border-radius: 6px;
  transition: background .12s;
}
.ov-live-strip .ov-jump:hover { background: rgba(255, 255, 255, .16); color: #fff; }

.ov-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px; background: #fbfcfe; border-bottom: 1px solid var(--line);
}
.ov-toolbar-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; width: 100%;
}
.job-name-clip {
  display: inline-block; max-width: clamp(140px, 15vw, 220px); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom;
}
#ov-jobs-table th, #ov-jobs-table td,
#ov-acc-table th, #ov-acc-table td,
#acc-table th, #acc-table td,
#ac-table th, #ac-table td {
  padding: 8px 10px; font-size: 13px;
}
.tbl th.ops-col, .tbl td.ops-col {
  position: sticky; right: 0; background: #fff; z-index: 2;
  white-space: nowrap; border-left: 1px solid #f1f5f9;
  box-shadow: -6px 0 10px -8px rgba(15, 23, 42, .18);
}
.tbl thead th.ops-col { background: #f8fafc; z-index: 3; }
.tbl tbody tr:hover td.ops-col { background: #f8fafc; }
.tbl td.ops-col .ghost, .tbl td.ops-col .primary {
  padding: 4px 8px; font-size: 12px; margin-right: 0;
}
.tbl td.ops-col button + button { margin-left: 4px; }

.date-sep-row td {
  background: #f8fafc !important; font-weight: 600; font-size: 12px;
  color: var(--ink2); padding: 6px 14px !important; letter-spacing: .02em;
}
.rel-day {
  display: inline-block; padding: 1px 6px; border-radius: 5px;
  font-size: 11px; font-weight: 600; margin-right: 4px;
}
.rel-day.today { background: #dbeafe; color: #1d4ed8; }
.rel-day.yday { background: #f1f5f9; color: #475569; }
.ov-auto-btn.paused { color: #b45309; border-color: #fcd34d; background: #fffbeb; }

/* ── 通用行容器、警示横幅、错误摘要与上传模式栏 ─────────── */
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.danger, .tbl td.danger { color: var(--bad); }
.alert-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 14px; padding: 11px 14px; border-radius: 10px;
  background: #fef2f2; border: 1px solid #fecaca; color: #991b1b;
  font-size: 13.5px; line-height: 1.5;
}
.alert-banner.warn { background: #fffbeb; border-color: #fed7aa; color: #9a3412; }
.alert-banner .ab-text { flex: 1; min-width: 200px; }
.alert-banner .ab-ops { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.err-sub {
  display: block; margin-top: 2px; font-size: 11.5px; color: var(--bad);
  max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hrow .err-sub { max-width: 100%; white-space: normal; }
.upload-mode-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.batch-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 14px; background: #eff6ff; border-bottom: 1px solid #bfdbfe;
  color: #1e3a8a;
}
.acc-link {
  border: 0; background: none; padding: 0; color: var(--ink2);
  font-size: inherit; cursor: pointer; text-align: left;
}
.acc-link:hover { color: var(--brand); text-decoration: underline; }
.row-disabled td:not(.ops-col) { color: var(--ink3); }
.ac-ops-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 12px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  font-size: 13px;
}
.ac-ops-bar .ac-ops-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1; min-width: 220px; }
.ac-ops-bar .ac-ops-btns { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rc-row-sel td { background: #eff6ff !important; }
.rc-clip {
  display: inline-block; max-width: 260px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom;
}

/* ── 多邮箱标签输入组件（告警收件人配置） ──────────────────── */
.email-tags-wrap {
  display: flex; flex-direction: column; gap: 6px;
  flex: 1; min-width: 260px; max-width: 480px;
}
.email-chips {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.email-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 99px;
  background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8;
  font-size: 12.5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.email-chip button {
  border: 0; background: none; color: #64748b; cursor: pointer;
  padding: 0 2px; font-size: 14px; line-height: 1;
}
.email-chip button:hover { color: #dc2626; }
.email-count { font-size: 11.5px; color: var(--ink3); }
.email-add-row { display: flex; gap: 6px; align-items: center; }
.email-add-row input { flex: 1; min-width: 180px; }
