/* ==========================================================================
   Dhgate 自动化 · 任务台
   设计系统（商业交付版）：配色 / 卡片 / 表格 / 徽标 / 表单 / 响应式
   ========================================================================== */

:root {
  /* 主色：商务蓝 */
  --main: #2563eb;
  --main-600: #1d4ed8;
  --main-700: #1e40af;
  --main-50: #eff6ff;
  --main-100: #dbeafe;

  /* 中性色 */
  --bg: #f1f5f9;
  --card: #ffffff;
  --line: #e2e8f0;
  --line-soft: #eef2f7;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #94a3b8;

  /* 语义色（背景 / 前景） */
  --green: #16a34a;  --green-bg: #dcfce7;  --green-bd: #bbf7d0;
  --red: #dc2626;    --red-bg: #fee2e2;    --red-bd: #fecaca;
  --amber: #b45309;  --amber-bg: #fef3c7;  --amber-bd: #fde68a;
  --sky: #0369a1;    --sky-bg: #e0f2fe;    --sky-bd: #bae6fd;
  --slate: #475569;  --slate-bg: #f1f5f9;  --slate-bd: #e2e8f0;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
  --shadow-lg: 0 8px 24px rgba(15, 23, 42, .08);
  --ring: 0 0 0 3px rgba(37, 99, 235, .14);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI",
        "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------------------------------------------------------------- 顶栏 */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  height: 60px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.brand-logo {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--main), var(--main-700));
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .5px;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 10px rgba(37, 99, 235, .3);
}

.brand-text { min-width: 0; line-height: 1.25; }
.brand-text h1 { margin: 0; font-size: 15px; font-weight: 700; }
.brand-sub { margin: 2px 0 0; font-size: 11px; color: var(--muted); }

#conn { margin-left: auto; }

/* ---------------------------------------------------------------- 布局 */
main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  display: grid;
  gap: 18px;
}

/* ---------------------------------------------------------------- 卡片 */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.card-head {
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.card-ico {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--main-50);
  color: var(--main);
  display: grid;
  place-items: center;
}
.card-ico svg { width: 16px; height: 16px; }

.card-title {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.card-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---------------------------------------------------------------- 运营概览 */
.overview { padding: 14px 16px; }

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.kpi {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fafbfc;
}

.kpi-ico {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--main-50);
  color: var(--main);
}
.kpi-ico svg { width: 20px; height: 20px; }

.kpi-num {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.kpi-sub { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 2px; }
.kpi-label { display: block; font-size: 12px; color: var(--text-2); margin-top: 3px; }

.kpi.green .kpi-ico { background: var(--green-bg); color: var(--green); }
.kpi.amber .kpi-ico { background: var(--amber-bg); color: var(--amber); }
.kpi.red .kpi-ico { background: var(--red-bg); color: var(--red); }

/* ---------------------------------------------------------------- 表单 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px 16px;
}

/* 刷访客模式：加购下单专属字段整块收起，只留"设备 / 买家账号 / 执行方式 + 商品清单"。
   在 #publishPanel 上切一个 .visit 类，表单字段和下面的批量导入面板一起跟着走，
   不用在 JS 里一个个显隐。 */
#publishPanel.visit .cart-only { display: none; }
#publishPanel:not(.visit) .visit-only { display: none; }
#publishPanel .full { grid-column: 1 / -1; }
#publishPanel .visit-only textarea {
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font: 12px/1.7 Consolas, "Courier New", monospace;
  color: var(--text);
  background: #fff;
  resize: vertical;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
#publishPanel .visit-only textarea:focus { border-color: var(--main); box-shadow: var(--ring); }
#publishPanel .visit-only .hint { margin: 0; }

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}
label > span.req::after { content: ' *'; color: var(--red); }

input, select {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: var(--muted); }
input:hover, select:hover { border-color: #cbd5e1; }
input:focus, select:focus { border-color: var(--main); box-shadow: var(--ring); }

.actions {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------- 按钮 */
button {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text-2);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
button:hover { border-color: var(--main); color: var(--main); }
button:active { transform: translateY(.5px); }
button:disabled { opacity: .55; cursor: not-allowed; }

button.primary {
  background: var(--main);
  border-color: var(--main);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(37, 99, 235, .35);
}
button.primary:hover { background: var(--main-600); border-color: var(--main-600); color: #fff; }

button.link {
  border: none;
  background: none;
  color: var(--main);
  padding: 4px 6px;
  font-size: 12.5px;
  font-weight: 500;
  border-radius: 6px;
}
button.link:hover { background: var(--main-50); color: var(--main-600); }

button.tiny { padding: 4px 10px; font-size: 12px; border-radius: 7px; }

/* 操作按钮语义着色（按 data-* 属性，不新增 class，也不影响 JS） */
button[data-run], button[data-retry], button[data-fix], button[data-pay] {
  color: var(--main); border-color: var(--main-100); background: var(--main-50);
}
button[data-run]:hover, button[data-retry]:hover,
button[data-fix]:hover, button[data-pay]:hover {
  background: var(--main-100); color: var(--main-700); border-color: var(--main-100);
}
button[data-cancel] { color: var(--amber); border-color: var(--amber-bd); background: var(--amber-bg); }
button[data-cancel]:hover { background: #fde68a; color: #92400e; }
/* 改价：重试和补推是一类（都是"再跑一次"），启停 worker 算运维动作，用中性色 */
button[data-pfretry] {
  color: var(--main); border-color: var(--main-100); background: var(--main-50);
}
button[data-pfretry]:hover { background: var(--main-100); color: var(--main-700); }
button[data-pflogin] { color: var(--main); border-color: var(--main-100); }
button[data-pfworker="stop"] { color: var(--amber); border-color: var(--amber-bd); }
button[data-delacct], button[data-delcard] { color: var(--red); }
button[data-delacct]:hover, button[data-delcard]:hover { border-color: var(--red-bd); background: var(--red-bg); color: #b91c1c; }

/* ---------------------------------------------------------------- 提示 / 徽标 */
.hint { color: var(--muted); font-size: 12px; margin: 12px 0 0; line-height: 1.7; }
.hint b { color: var(--text-2); font-weight: 600; }
.hint code {
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 5px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 11.5px;
  word-break: break-all;
}

.msg { font-size: 13px; }
.msg.err { color: var(--red); font-weight: 500; }
.msg.ok { color: var(--green); font-weight: 500; }

/* AI 诊断 · 设置表单：一行"标签 + 控件"，控件宽度随内容，别把窄字段拉满 */
.airow { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.airow .ailabel { flex: 0 0 84px; color: var(--muted); font-size: 12.5px; text-align: right; }
.airow input[type="text"],
.airow input[type="password"],
.airow input[type="number"],
.airow select { flex: 0 1 360px; min-width: 0; }
.airow input[type="number"] { flex: 0 0 110px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-bd);
}
.badge::before {
  content: '';
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, .12);
}
.badge.st.failed {
  background: var(--red-bg); color: var(--red); border-color: var(--red-bd);
}
.badge.st.failed::before { box-shadow: 0 0 0 3px rgba(220, 38, 38, .12); }

/* 状态徽标：统一小圆点 + 柔和底色 */
.st {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.st::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.st.pending { background: var(--slate-bg); color: var(--slate); }
.st.running { background: var(--sky-bg); color: var(--sky); }
.st.done { background: var(--green-bg); color: var(--green); }
.st.failed { background: var(--red-bg); color: var(--red); }
.st.cancelled { background: var(--amber-bg); color: var(--amber); }
.st.manual { background: var(--sky-bg); color: var(--sky); }

/* 改价系统状态条：在线状态 + worker 计数 + 开关，挤在卡片标题下面一行 */
.pfbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 14px 0 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfcfe;
  font-size: 12.5px;
}
.pfbar .switchline { margin-left: auto; }   /* 计数靠左、操作靠右 */
.pfbar .switchline + button { margin-left: -4px; }
.switchline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: 12.5px;
  cursor: pointer;
  user-select: none;
}
.switchline input { width: 14px; height: 14px; accent-color: var(--main); cursor: pointer; }

/* ---------------------------------------------------------------- 列表筛选条 */
.filterbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0 10px;
}
.filterbar label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.filterbar select { padding: 6px 8px; font-size: 12px; }
.filterbar input[type=search] {
  flex: 1 1 220px;
  min-width: 150px;
  padding: 6px 10px;
  font-size: 12px;
}
.filterbar .count { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---------------------------------------------------------------- 表格 */
.tablewrap {
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: #fff;
  max-height: 62vh;
}

/* 分页条：贴在表格下面。只有一页时内容是空的，:empty 让它整条不占位 */
.pager {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 10px 0 0;
}
.pager:empty { display: none; }
.pager .pg-info { font-size: 12px; color: var(--muted); margin: 0 4px; }
.pager .pg-gap { font-size: 12px; color: var(--muted); padding: 0 2px; }
.pager button.pg { min-width: 30px; color: var(--text-2); }
.pager button.pg:hover:not(:disabled) { color: var(--main); border-color: var(--main-100); }
.pager button.pg.on {
  background: var(--main);
  border-color: var(--main);
  color: #fff;
  font-weight: 600;
}

/* ---------------------------------------------------------------- 批量选择 */
/* 行首勾选列：只放一个方格，别把它撑宽 */
th.selcol, td.selcol { width: 36px; padding-right: 0; text-align: center; }
.selcol input {
  width: 14px;
  height: 14px;
  accent-color: var(--main);
  cursor: pointer;
  vertical-align: middle;
}

/* 表格下方的批量操作条。勾了东西才出现（配 .hidden），浅主题色标出"这是选中态" */
.selbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 0;
  padding: 7px 12px;
  border: 1px solid var(--main-100);
  border-radius: var(--radius-sm);
  background: var(--main-50);
  font-size: 12.5px;
}
.selbar-info { color: var(--text-2); font-weight: 600; }
.selbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
button.link.danger { color: var(--red); }
button.link.danger:hover { background: var(--red-bg); color: #b91c1c; }

table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }

th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
  vertical-align: middle;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  color: var(--text-2);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .2px;
  border-bottom: 1px solid var(--line);
  box-shadow: inset 0 -1px 0 var(--line);
}

tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .1s; }
tbody tr:nth-child(even) { background: #fbfcfe; }
tbody tr:hover { background: var(--main-50); }

tbody td.empty { text-align: center; color: var(--muted); padding: 34px; }
tbody tr:hover td.empty { background: transparent; }

/* 订单号：等宽 + 可选中，方便复制去改价 */
.orderno { font-family: Consolas, "Courier New", monospace; user-select: text; color: var(--text-2); }

/* 父任务行：分组容器，加粗、左侧主题色条 */
tr.parent td { background: #f8fafc; font-weight: 600; }
tr.parent td:first-child { border-left: 3px solid var(--main); }

/* 子任务行：挂在父任务下，弱化 + 缩进 */
tr.sub td { color: var(--muted); font-size: 12px; }
/* 缩进落在第二格（第一格是批量勾选框，缩进它勾选框就跟父任务行错开了） */
tr.sub td:nth-child(2) { padding-left: 26px; }

/* 任务列表：单元格内主/副两行，把整张表压缩到单屏可读 */
.cell-main { font-weight: 500; }
.cell-sub { color: var(--muted); font-size: 11px; margin-top: 2px; font-weight: 400; }
tr.parent .cell-main { font-weight: 600; }

/* 任务提示信息：整行展示，超长自动换行 */
tr.task-msg-row td {
  padding: 2px 12px 10px;
  color: var(--red);
  font-size: 12px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-all;
  background: #fff7f7;
}

/* ---------------------------------------------------------------- 通用 */
.hidden { display: none; }
.muted { color: var(--muted); }
.quota { font-variant-numeric: tabular-nums; }
.quota.full { color: var(--red); font-weight: 600; }

/* ---------------------------------------------------------------- 设备状态 */
.devbar { display: flex; flex-wrap: wrap; gap: 10px; }

.devchip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: 13px;
  background: #fafafa;
  transition: border-color .15s, box-shadow .15s;
}
.devchip b { font-weight: 600; }
.devchip.busy { border-color: var(--main); background: var(--main-50); box-shadow: 0 0 0 3px rgba(37, 99, 235, .08); }

.dot { width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; flex: 0 0 auto; }
.dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(22, 163, 74, .14); }
.dot.off { background: var(--red); box-shadow: 0 0 0 3px rgba(220, 38, 38, .14); }

/* 模拟器配置：路径和 serial 都是长串，各占一行，别和按钮挤在一起 */
.devform {
  margin-top: 14px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
}

.devline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.devline .devlabel {
  flex: 0 0 112px;
  font-size: 13px;
  color: var(--text-2);
  text-align: right;
}
.devline input {
  flex: 1 1 auto;
  min-width: 0;
  font: 12.5px Consolas, "Courier New", monospace;
}
.devform .actions { margin-top: 14px; }

/* 检测结果：用的哪个 adb + 探到的设备；设备做成按钮，点一下填进「默认设备」 */
.devprobe {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
}
.devprobe .devpick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font: 12px Consolas, "Courier New", monospace;
}
.devprobe .devpick.on { color: var(--green); border-color: #86efac; background: #f0fdf4; }

/* ---------------------------------------------------------------- 单条表单（账号/卡片） */
.acctform {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
}
.acctform input { flex: 1 1 180px; }

/* ---------------------------------------------------------------- 批量导入面板 */
.batch {
  margin-top: 12px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: #fcfcfd;
}
.batch .fileline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
}
.batch .fileline input[type=file] {
  max-width: 280px;
  font-size: 12px;
  padding: 6px 8px;
  background: #fff;
}
.batch .fileline .hint { margin: 0; }
.batch textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font: 12px/1.7 Consolas, "Courier New", monospace;
  color: var(--text);
  background: #fff;
  resize: vertical;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.batch textarea:focus { border-color: var(--main); box-shadow: var(--ring); }
.batch .actions { margin-top: 12px; }

.batchresult { font-size: 12px; margin-top: 12px; }
.batchresult .batchline { color: var(--text-2); }
.batchresult .batcherr {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--red-bg);
  border: 1px solid var(--red-bd);
  color: #b91c1c;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.6;
}

/* ---------------------------------------------------------------- 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #94a3b8; background-clip: content-box; }

/* ---------------------------------------------------------------- 标签页导航 */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, box-shadow .15s;
}
.tab:hover { background: var(--main-50); color: var(--main); }
.tab.active {
  background: var(--main);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(37, 99, 235, .4);
}

/* 标签上的计数徽标（未激活默认蓝，告警红） */
.tabbadge {
  display: none;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
  background: var(--main);
  color: #fff;
}
.tabbadge.warn { background: var(--red); }
.tab.active .tabbadge { background: rgba(255, 255, 255, .3); color: #fff; }
.tabbadge.show { display: inline-block; }

/* 面板：一次只显示一个，切换带淡入 */
.panel { display: none; }
.panel.active { display: block; animation: panelIn .18s ease; }
@keyframes panelIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- 交付运维：自检 / 数据 / 向导 */
.head-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.ghostbtn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px;
  background: #fff; color: var(--text-2);
  font: inherit; font-size: 12.5px; font-weight: 600;
  transition: border-color .15s, color .15s, box-shadow .15s;
}
.ghostbtn:hover { border-color: var(--main); color: var(--main-700); box-shadow: var(--ring); }

.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted); flex: none;
}
.dot.ok { background: var(--green); }
.dot.warn { background: #f59e0b; }
.dot.error { background: var(--red); }

.subhead {
  margin: 22px 0 8px; padding-top: 16px; border-top: 1px solid var(--line-soft);
  font-size: 13.5px; font-weight: 700; color: var(--text);
}
.subhead:first-of-type { margin-top: 12px; padding-top: 0; border-top: 0; }

.checklist { display: grid; gap: 6px; }
.chk {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: #fff;
}
.chk-ico {
  width: 18px; height: 18px; flex: none; margin-top: 1px;
  border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #fff; background: var(--muted);
}
.chk-main { min-width: 0; }
.chk-label { font-weight: 600; font-size: 13px; }
.chk-detail { color: var(--text-2); font-size: 12.5px; word-break: break-all; }
.chk-hint { color: var(--muted); font-size: 12px; margin-top: 1px; }
.chk.ok { border-color: var(--green-bd); background: #f6fef9; }
.chk.ok .chk-ico { background: var(--green); }
.chk.warn { border-color: var(--amber-bd); background: #fffcf3; }
.chk.warn .chk-ico { background: #d97706; }
.chk.error { border-color: var(--red-bd); background: #fff7f7; }
.chk.error .chk-ico { background: var(--red); }

.pkgline {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px;
}
.pkgline input[type="password"], .pkgline input[type="file"] {
  height: 34px; padding: 0 10px; font: inherit; font-size: 13px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff;
}
.pkgline input[type="password"] { min-width: 200px; }
.pkgline input[type="file"] { padding: 5px 10px; }

.overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(2px);
}
.overlay.hidden { display: none; }

.wizbox {
  width: min(680px, 100%); max-height: 88vh; overflow: auto;
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 22px 24px 18px;
  animation: panelIn .18s ease-out;
}
.wizhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wizhead h2 { margin: 0; font-size: 17px; }
.wizsteps { margin: 14px 0 10px; padding-left: 20px; color: var(--text-2); font-size: 13px; }
.wizsteps li { margin: 3px 0; }
.wizsteps li.done { color: var(--green); }
.wizfoot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft);
}

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 720px) {
  header { padding: 0 16px; height: 56px; }
  .brand-sub { display: none; }
  main { padding: 16px 12px 32px; gap: 14px; }
  .card { padding: 14px; }
  .grid { grid-template-columns: 1fr; }
  .card-tools { gap: 6px; }
  .card-tools .link { font-size: 11.5px; }
  .head-tools .ghostbtn { padding: 0 9px; font-size: 12px; }
  .pkgline input[type="password"] { min-width: 0; flex: 1 1 140px; }
}

/* ------------------------------------------------- 任务树展开 / 执行日志 */

/* 多订单任务（父任务）前面的展开三角 */
.caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 3px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--card);
  color: var(--text-2);
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
}
.caret:hover { border-color: var(--main); color: var(--main); background: var(--main-50); }

/* 操作条上的「选中全部 N 条（跨页）」：长得像链接，是按钮 */
button.link[data-selscope], button.link[data-selpage] {
  padding: 2px 6px;
  font-size: 12px;
  font-weight: 600;
}

/* 日志页工具条上的复选框：别继承输入框那身粗边框大内边距 */
.logbar input[type="checkbox"] {
  width: 14px;
  height: 14px;
  padding: 0;
  accent-color: var(--main);
}

/* 日志正文：深底等宽，一行一行往下滚 */
.logview {
  margin: 0;
  height: 58vh;
  min-height: 260px;
  overflow: auto;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #0f172a;
  color: #cbd5e1;
  font-family: Consolas, "Cascadia Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-all;
  tab-size: 4;
}
.logview .ln-err { color: #fca5a5; }
.logview .ln-warn { color: #fcd34d; }

/* ---------------------------------------------------------------- 店铺占用（多SKU用券单） */
/* 账号库下面折叠的一块：平时收起来只看汇总行，展开才看明细和"解除占用"。
   明细表跟主表一样宽，操作条常驻（里面还挂着"刷新"，不能跟着勾选清空收起来）。 */
details.claims {
  margin-top: 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 10px 12px;
}
details.claims > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-2);
  user-select: none;
}
details.claims > summary::marker { color: var(--muted); }
details.claims[open] > summary { margin-bottom: 4px; }
details.claims .hint { margin-top: 8px; }
details.claims .selbar { margin-top: 10px; }
/* 解除占用是个"会去掉记录"的动作，给个危险色；没勾东西时是灰的（disabled） */
#claimsRelease:not(:disabled) { color: var(--red); }
#claimsRelease:not(:disabled):hover { background: var(--red-bg); color: #b91c1c; }
#claimsRelease:disabled { color: var(--muted); cursor: default; }

.tenant-captcha{margin-bottom:20px;padding:14px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:10px}.tenant-captcha .grid{margin:14px 0} #deviceForm .devline,#devAuto,#deviceForm button[type="submit"],#pfWorkerBar button,#pfWorkerBar .switchline{display:none}