/* ===== 变量：纸本工作台 ===== */
:root {
  --bg: #f9f6f0;
  --panel: #fffdf9;
  --panel-2: #f0eae0;
  --border: #e6dfd3;
  --border-strong: #d6ccbc;
  --text: #241f1c;
  --text-2: #4b433d;
  --muted: #857a6f;
  --muted-2: #a89e92;
  --primary: #a8492b;
  --primary-hover: #923d22;
  --primary-soft: #f6ece6;
  --success: #3d6b52;
  --success-soft: #eaf2ed;
  --danger: #a33226;
  --danger-soft: #fbebe8;
  --warn: #9a6c1a;
  --warn-soft: #faf1de;
  --radius: 6px;
  --radius-lg: 8px;
  --shadow-sm: 0 1px 0 rgba(36, 31, 28, 0.03);
  --shadow-md: 0 2px 8px rgba(36, 31, 28, 0.06);
  --serif: "Songti SC", "Source Han Serif SC", "Noto Serif SC", STSong, Georgia, serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100%;
  -webkit-font-smoothing: antialiased;
}
body { font-size: 14px; line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
.muted { color: var(--muted); }
.err { color: var(--danger); }

/* ===== 登录页：左墨右纸的分栏 ===== */
.login-body { height: 100vh; overflow: hidden; }
.login-split { display: grid; grid-template-columns: minmax(320px, 42%) 1fr; height: 100%; }

.login-mark {
  background: #1c1816; color: #e9e1d5;
  padding: 46px 42px 34px;
  display: flex; flex-direction: column; justify-content: space-between;
  background-image:
    repeating-linear-gradient(to bottom, transparent 0, transparent 23px,
                              rgba(233, 225, 213, 0.045) 23px, rgba(233, 225, 213, 0.045) 24px);
}
.login-logo {
  display: flex; align-items: center; gap: 10px;
  font: 500 14px/1 var(--mono); letter-spacing: 0.18em; color: #e9e1d5;
}
.login-logo i {
  width: 28px; height: 28px; border-radius: 50%;
  background: #e9e1d5; color: #1c1816;
  display: grid; place-items: center; font: 600 12px/1 var(--serif); font-style: normal;
  letter-spacing: 0;
}
.login-tagline { margin: 14px 0 0; font: 400 30px/1.35 var(--serif); letter-spacing: 0.02em; color: #f3ede3; }
.login-facts {
  margin: 40px 0 0; padding: 0;
  display: grid; gap: 12px 26px; grid-template-columns: repeat(2, minmax(0, 1fr));
}
.login-facts > div { border-top: 1px solid rgba(233, 225, 213, 0.16); padding-top: 8px; }
.login-facts dt {
  font-size: 10.5px; letter-spacing: 0.18em; color: #8d8478;
  text-transform: uppercase;
}
.login-facts dd { margin: 3px 0 0; font-size: 13px; color: #cfc5b7; }
.login-mark-foot {
  font: 400 11px/1 var(--mono); letter-spacing: 0.08em; color: #6f675d;
}

.login-form-panel { display: grid; place-items: center; padding: 32px; background: var(--bg); }
.login-card {
  width: 100%; max-width: 340px;
  background: transparent; border: 0; border-radius: 0; box-shadow: none; padding: 0;
}
.login-card h1 { margin: 0 0 4px; font: 500 28px/1.2 var(--serif); letter-spacing: 0.01em; }
.login-card form { display: flex; flex-direction: column; gap: 13px; margin-top: 24px; }
.login-card label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.login-card input {
  background: var(--panel); border: 1px solid var(--border);
  padding: 9px 11px; border-radius: var(--radius); color: var(--text);
}
.login-card input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(168, 73, 43, 0.1); }
.login-card button.primary { margin-top: 4px; padding: 9px 12px; font-size: 13.5px; }
.login-card #err:empty { display: none; }
.login-card #err { margin: 2px 0 0; font-size: 12px; }

@media (max-width: 860px) {
  .login-body { overflow: auto; }
  .login-split { grid-template-columns: 1fr; height: auto; min-height: 100%; }
  .login-mark { padding: 30px 24px 24px; }
  .login-mark .login-facts { margin-top: 22px; }
  .login-tagline { font-size: 24px; }
  .login-form-panel { padding: 34px 24px 56px; }
}

/* ===== 按钮 ===== */
button, .btn {
  background: var(--panel); border: 1px solid var(--border);
  color: var(--text-2); padding: 6px 12px; border-radius: var(--radius);
  cursor: pointer; font-size: 13px; font-family: inherit;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
button:hover { border-color: var(--border-strong); color: var(--text); }
button.primary, .btn.primary {
  background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 500;
}
button.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
button.danger { color: var(--danger); border-color: #ecc9c3; }
button.danger:hover { background: var(--danger-soft); border-color: #dfaea6; }
button.ghost { background: transparent; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== 输入框 ===== */
input, textarea, select {
  background: var(--panel); border: 1px solid var(--border);
  padding: 8px 11px; border-radius: var(--radius); color: var(--text);
  font-size: 13px; font-family: inherit;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(168, 73, 43, 0.08);
}
textarea { resize: vertical; min-height: 60px; }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }

/* ===== 工作台布局 ===== */
.layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- 顶栏 ---- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: 60px; flex-shrink: 0;
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
  background: rgba(249, 246, 240, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
.topbar .brand {
  display: flex; align-items: center; gap: 9px;
  font: 500 14px/1 var(--serif); letter-spacing: 0.02em;
  white-space: nowrap;
}
.topbar .brand i {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--text); color: var(--bg);
  display: grid; place-items: center;
  font: 600 11px/1 var(--serif); font-style: normal;
}

/* 三组导航：去掉胶囊外框，靠字重与发丝线分组 */
.topbar nav.nav-capsule {
  display: flex; align-items: center; gap: 0;
  background: transparent; border: 0; border-radius: 0;
  padding: 0; white-space: nowrap;
}
.topbar nav.nav-capsule + nav.nav-capsule {
  margin-left: 4px; padding-left: 4px;
  border-left: 1px solid var(--border);
}
.nav-capsule .cap-name {
  font-size: 9.5px; letter-spacing: 0.16em;
  color: var(--muted-2); font-weight: 600;
  padding: 0 8px 0 10px;
  user-select: none;
}
.nav-capsule a {
  position: relative;
  display: inline-block;
  padding: 6px 9px;
  color: var(--muted);
  font-size: 12.5px;
  transition: color 0.18s ease;
}
.nav-capsule a::after {
  content: '';
  position: absolute; left: 9px; right: 9px; bottom: 0;
  height: 2px; border-radius: 2px;
  background: var(--text);
  opacity: 0; transform: scaleX(0.4);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.nav-capsule a:hover { color: var(--text); }
.nav-capsule a:hover::after { opacity: 0.25; transform: scaleX(1); }
.nav-capsule a.active { color: var(--text); font-weight: 600; }
.nav-capsule a.active::after { opacity: 1; transform: scaleX(1); }
.nav-capsule a:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; border-radius: 4px; }

.topbar .user {
  margin-left: auto; display: flex; align-items: center; gap: 9px;
  font-size: 12.5px; color: var(--muted);
}
.topbar .user .avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center;
  font: 600 10px/1 var(--mono);
}
.topbar .user button { padding: 5px 10px; font-size: 12px; }

/* ---- 轻提示：落在顶栏下方，不遮挡导航 ---- */
.toast {
  position: fixed; top: 74px; right: 22px; z-index: 9999;
  max-width: 400px;
  padding: 10px 15px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--panel);
  color: var(--text);
  font-size: 13px; line-height: 1.5;
  box-shadow: 0 6px 22px rgba(36, 31, 28, 0.12);
  border-left-width: 3px;
  animation: fade-up 140ms ease-out both;
}
.toast.info { border-left-color: var(--primary); }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); color: var(--danger); }

/* ---- 页面转场：内容替换后轻微上浮 ---- */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
.main > * { animation: fade-up 120ms ease-out both; }
@media (prefers-reduced-motion: reduce) {
  .main > *, .toast { animation: none; }
}

/* ---- 主区 ---- */
.main {
  flex: 1;
  overflow-y: auto;
  padding: 34px 28px 72px;
}
/* 内容居中但不满宽铺开：1200px 以上才显得散 */
.main > * { max-width: 1120px; margin-left: auto; margin-right: auto; }
.main h2 {
  margin: 0; font: 500 26px/1.2 var(--serif); letter-spacing: 0.01em;
}
.main h3 { margin: 0; font-size: 14px; color: var(--text); font-weight: 600; }

/* ===== 页面头 + 体征带 ===== */
.page-head { margin-bottom: 22px; }
.page-head .lede { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; max-width: 66ch; text-wrap: pretty; }

.band {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 22px;
  /* 只写 margin-bottom：简写会把 .main > * 的左右 auto 一起清掉，体征带会左偏 */
  margin-bottom: 30px; padding: 14px 0;
  border-top: 1px solid var(--text);
  border-bottom: 1px solid var(--border);
}
.band-it { display: flex; align-items: baseline; gap: 8px; }
.band-k { font-size: 11.5px; color: var(--muted); }
.band-v { font: 500 22px/1 var(--serif); font-variant-numeric: tabular-nums; }
.band-v-sm { font: 500 13px/1 var(--mono); padding-top: 3px; }
.band-sep { color: var(--border-strong); font-size: 13px; }

/* ===== 分区（概览页不用卡片，用规线分节）===== */
.sect { margin-bottom: 28px; }
.sect-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding-bottom: 9px; margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.sect-head h3 { font: 600 15px/1.2 var(--serif); letter-spacing: 0.01em; }
.sect-head .sect-count {
  font: 500 11px/1 var(--mono); color: var(--muted);
  background: var(--panel-2); border-radius: 999px; padding: 2px 7px;
}
.sect-head .sect-hint { font-size: 11.5px; color: var(--muted-2); }
.sect-head .todo-filter { margin: 0; }

/* 概览页两栏 */
.dash-cols {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0 44px; align-items: start;
}
.dash-cols-wide { grid-template-columns: 1fr 1fr; }

/* ---- 查询记录列表（余额 / 业绩共用）---- */
.log-list { display: flex; flex-direction: column; }
.log-row {
  display: grid; grid-template-columns: 62px 6px minmax(0, 1fr) auto;
  gap: 0 12px; align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid var(--panel-2);
}
.log-row:last-child { border-bottom: 0; }
.log-time {
  font: 400 11px/1.9 var(--mono); color: var(--muted-2);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.log-dot {
  width: 5px; height: 5px; border-radius: 50%; margin-top: 7px;
  background: var(--muted-2);
}
.log-row.tone-ok .log-dot { background: var(--success); }
.log-row.tone-bad .log-dot { background: var(--danger); }
.log-main { min-width: 0; }
.log-title {
  font-size: 13px; color: var(--text); line-height: 1.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.log-sep { color: var(--muted-2); margin: 0 6px; }
.log-sub {
  font-size: 12px; color: var(--muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.log-amt {
  font: 400 12.5px/1.9 var(--mono); color: var(--text-2);
  text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.log-amt em {
  font-style: normal; font-size: 10px; color: var(--muted-2);
  margin-left: 3px; letter-spacing: 0.04em;
}
.log-amt.is-fail { color: var(--danger); }

/* ---- 余额汇总 ---- */
.bal-total { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.bal-amount {
  font: 500 30px/1 var(--serif); letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}
.bal-amount small { font: 400 11px/1 var(--mono); color: var(--muted); margin-left: 5px; letter-spacing: 0.06em; }
.bal-rows { margin-top: 14px; }
.bal-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 6px 0; font-size: 12.5px; color: var(--text-2);
  border-bottom: 1px dotted var(--border);
}
.bal-row:last-child { border-bottom: 0; }
.bal-row b { color: var(--text); font: 500 12.5px/1 var(--mono); font-variant-numeric: tabular-nums; }

/* ---- 判定分布 ---- */
.verdict-list { display: flex; flex-direction: column; gap: 7px; }
.verdict-row { display: flex; align-items: center; gap: 10px; }
.verdict-row .badge { width: 104px; flex-shrink: 0; text-align: center; }
.verdict-track { flex: 1; height: 3px; background: var(--panel-2); overflow: hidden; }
.verdict-fill { height: 100%; }
.verdict-fill.fill-ok { background: var(--success); }
.verdict-fill.fill-warn { background: #7c8f66; }
.verdict-fill.fill-fail { background: var(--danger); }
.verdict-fill.fill-low { background: var(--muted-2); }
.verdict-n {
  width: 24px; text-align: right; font: 500 11.5px/1 var(--mono);
  font-variant-numeric: tabular-nums; color: var(--muted);
}

@media (max-width: 980px) {
  .dash-cols, .dash-cols-wide { grid-template-columns: 1fr; gap: 0; }
}

/* ===== 通用分节：扁平纸面，靠规线与留白分区，不再悬浮 =====
   只有真正需要"浮起来"的块（嵌套的批量结果面板、报告正文）才加 .boxed。 */
.card {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  /* 只写 padding-top / margin-bottom：简写会连带清掉 .main > * 的水平 auto */
  padding: 14px 0 0;
  margin-bottom: 26px;
}
.card.boxed {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 14px;
}
.card-title { font: 600 15px/1.3 var(--serif); margin-bottom: 10px; letter-spacing: 0.01em; }
.card > .card-title:first-child,
.card > .flex:first-child .card-title { margin-top: 0; }

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > .field { flex: 1; min-width: 160px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--panel-2); text-align: left; }
th {
  color: var(--muted-2); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom-color: var(--border);
}
tbody tr:hover { background: #fbf8f2; }
tbody tr:last-child td { border-bottom: 0; }

/* 数值列：右对齐 + 等宽数字，扫列时小数点能对齐 */
th.num, td.num {
  text-align: right;
  font-family: var(--mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
th.num { font-size: 11px; }
td.num.nil { color: var(--muted-2); }
td.num b, td.num strong { font-weight: 600; }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 500;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--muted);
}
.badge.ok { color: var(--success); background: var(--success-soft); border-color: #cfe3d8; }.badge.fail { color: var(--danger); background: var(--danger-soft); border-color: #efd3cd; }
.badge.warn { color: var(--warn); background: var(--warn-soft); border-color: #ecd9b6; }
.badge.high { color: var(--danger); background: var(--danger-soft); border-color: #efd3cd; }
.badge.medium { color: var(--warn); background: var(--warn-soft); border-color: #ecd9b6; }
.badge.low { color: var(--muted); background: var(--panel-2); border-color: var(--border); }

/* ---- 状态点：ok / warn / bad / idle 四态，取代 emoji ---- */
.state {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-2); white-space: nowrap;
}
.dot {
  width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto;
  background: var(--muted-2); box-shadow: 0 0 0 3px rgba(36, 31, 28, 0.05);
}
.dot.ok { background: var(--success); box-shadow: 0 0 0 3px rgba(61, 107, 82, 0.12); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(154, 108, 26, 0.12); }
.dot.bad { background: var(--danger); box-shadow: 0 0 0 3px rgba(163, 50, 38, 0.12); }
.dot.idle { background: var(--muted-2); box-shadow: 0 0 0 3px rgba(168, 158, 146, 0.14); }

/* ===== 选项卡（子 tab）===== */
.tab-bar {
  display: flex; gap: 4px; margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.tab-btn {
  background: transparent; color: var(--muted);
  border: 1px solid transparent; border-bottom: none;
  padding: 8px 14px; border-radius: var(--radius) var(--radius) 0 0; cursor: pointer;
  font-size: 13px; transition: background 0.15s, color 0.15s;
}
.tab-btn:hover { background: var(--panel-2); color: var(--text); }
.tab-btn.active {
  background: var(--panel); color: var(--primary); font-weight: 600;
  border-color: var(--border);
  border-bottom-color: var(--panel);
  margin-bottom: -1px;
}

/* ===== 待办：改成规线行，不再是悬浮卡片 ===== */
.todo-list { display: flex; flex-direction: column; }
.todo-item {
  display: flex; align-items: flex-start; gap: 11px;
  background: transparent;
  border: 0; border-bottom: 1px solid var(--panel-2);
  border-left: 2px solid var(--border-strong);
  border-radius: 0;
  padding: 10px 6px 10px 13px;
  transition: background 0.15s;
}
.todo-item:hover { background: rgba(255, 253, 249, 0.7); }
.todo-item.priority-high { border-left-color: var(--danger); }
.todo-item.priority-medium { border-left-color: var(--warn); }
.todo-item.priority-low { border-left-color: var(--muted-2); }
.todo-item.done { opacity: 0.55; }
.todo-item.done .todo-title { text-decoration: line-through; color: var(--muted); }
.todo-checkbox {
  width: 16px; height: 16px; margin-top: 3px; cursor: pointer; flex-shrink: 0;
  accent-color: var(--primary);
}
.todo-body { flex: 1; min-width: 0; }
.todo-title { font-size: 13.5px; font-weight: 500; word-break: break-word; }
.todo-desc {
  color: var(--muted); font-size: 12px; margin-top: 3px;
  white-space: pre-wrap; word-break: break-word;
}
.todo-meta {
  display: flex; gap: 8px; align-items: center; margin-top: 5px;
  font-size: 11px; color: var(--muted); flex-wrap: wrap;
}
.todo-meta .overdue { color: var(--danger); }
.todo-actions { display: flex; gap: 4px; flex-shrink: 0; }
.todo-actions button { padding: 3px 8px; font-size: 12px; }
.todo-group-title {
  font: 600 10.5px/1 var(--mono); color: var(--muted-2);
  letter-spacing: 0.14em; text-transform: uppercase;
  margin: 18px 0 6px; display: flex; align-items: center; gap: 6px;
}
.todo-group-title:first-child { margin-top: 0; }
.todo-group-title .count {
  background: var(--panel-2); padding: 2px 6px; border-radius: 999px;
  font-size: 10.5px; letter-spacing: 0;
}
.todo-filter {
  display: flex; gap: 4px; flex-wrap: wrap;
}
.todo-filter button { padding: 3px 10px; font-size: 11.5px; border-radius: 999px; }
.todo-filter button.active {
  background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 500;
}

/* ===== 模态 ===== */
.modal-bg {
  position: fixed; inset: 0; background: rgba(36, 31, 28, 0.32);
  display: flex; align-items: center; justify-content: center; z-index: 99;
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px; min-width: 420px; max-width: 80vw; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 18px 50px rgba(36, 31, 28, 0.16);
}
.modal h3 { margin: 0 0 16px; font: 600 17px/1.3 var(--serif); }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

.empty { color: var(--muted); padding: 26px 22px; text-align: center; font-size: 13px; }
.empty-title { color: var(--text-2); font: 500 14px/1.4 var(--serif); }
.empty-hint { margin-top: 4px; color: var(--muted-2); font-size: 12px; }

.report-content {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; line-height: 1.65;
}
.report-content pre { background: #f7f3ea; padding: 12px; border-radius: var(--radius); overflow-x: auto; border: 1px solid var(--border); }
.report-content code { background: rgba(36, 31, 28, 0.05); padding: 2px 5px; border-radius: 4px; font-size: 12px; }
.report-content table { margin: 8px 0; }
.report-content h1, .report-content h2, .report-content h3 { color: var(--text); font-family: var(--serif); }
.report-content ul, .report-content ol { padding-left: 20px; }

.kbd {
  font-family: var(--mono);
  font-size: 11px; background: var(--panel-2); padding: 1px 6px; border-radius: 4px;
  border: 1px solid var(--border); color: var(--muted);
}

/* ---------- 探针检测：终端风格实时控制台（深色块，故意不跟随浅色主题） ---------- */
.console {
  background:
    repeating-linear-gradient(
      to bottom,
      #171412 0, #171412 19px,
      #191613 19px, #191613 20px
    );
  border: 1px solid #2e2823;
  border-radius: var(--radius);
  padding: 10px 0;
  margin-top: 10px;
  max-height: 320px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 20px;
  color: #cfc3b4;
}
.console:empty::before {
  content: '等待启动…（开始探针后此处实时打印每轮结果）';
  color: #6b6056;
  display: block;
  padding: 0 14px;
}
.console-line {
  display: flex; align-items: baseline; gap: 10px;
  padding: 0 12px 0 10px;
  border-left: 2px solid transparent;
  white-space: pre-wrap;
  word-break: break-all;
}
.console-ts {
  flex: 0 0 62px;
  color: #6b6056;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.console-msg { flex: 1; min-width: 0; }
.console-line.info { color: #9db8e8; border-left-color: #4d6c9c; }
.console-line.ok { color: #6cc79a; border-left-color: #2f6b4c; }
.console-line.warn { color: #e8b064; border-left-color: #8a5f1e; }
.console-line.danger { color: #f07b6a; font-weight: 600; border-left-color: #8b3129; }
.console-line:hover { background: rgba(255, 253, 249, 0.035); }

/* 控制台标题旁的状态点：灰=未连接，绿呼吸=运行中 */
.console-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #b8bfcc; margin: 0 6px; vertical-align: middle;
}
.console-dot.ok {
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(61, 107, 82, 0.6);
  animation: probe-pulse 1.6s infinite;
}
.console-dot.warn { background: var(--warn); }
@keyframes probe-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(61, 107, 82, 0.5); }
  70%  { box-shadow: 0 0 0 6px rgba(61, 107, 82, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 107, 82, 0); }
}

/* ---------- 探针检测：多渠道 ---------- */

/* 渠道配置卡片。一屏可能并排好几张，边框要能清楚划分归属。 */
.chan-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
  background: var(--panel-2);
}
.chan-card .row { margin-bottom: 6px; }
.chan-card .row:last-child { margin-bottom: 0; }
.chan-card input, .chan-card select { width: 100%; }

/* 结果表渠道列：名字长且重复，给个窄列并允许换行 */
#pb-table .chan-col {
  max-width: 140px;
  word-break: break-all;
  white-space: normal;
}

/* 每渠道每轮的汇总行：和明细行区分开，但别抢眼到盖过告警 */
#pb-table tr.summary-row > td {
  background: var(--primary-soft);
  border-top: 1px solid var(--border);
  font-style: italic;
}

/* ---- 多选列表（余额 / 业绩批量查询共用）---- */
.pick {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel-2); overflow: hidden;
}
.pick-tools {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 9px; border-bottom: 1px solid var(--border);
}
.pick-tools .pick-search {
  flex: 1; min-width: 0; padding: 5px 9px; font-size: 12.5px;
  background: var(--panel);
}
.pick-tools button { font-size: 12px; padding: 4px 10px; }
.pick-count {
  font: 500 11.5px/1 var(--mono); font-variant-numeric: tabular-nums;
  color: var(--muted); white-space: nowrap;
}
.pick-list { max-height: 208px; overflow: auto; }
.pick-row {
  display: flex; align-items: baseline; gap: 8px;
  padding: 6px 10px; font-size: 13px; cursor: pointer;
  border-bottom: 1px dotted var(--border);
}
.pick-row:last-child { border-bottom: 0; }
.pick-row:hover { background: #fbf8f2; }
.pick-row input[type="checkbox"] {
  flex: 0 0 auto; width: auto; margin: 0; padding: 0; border: 0;
  accent-color: var(--primary);
}
.pick-label { color: var(--text); }
.pick-hint {
  color: var(--muted); font-size: 11.5px; margin-left: auto;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%;
}

/* ---- 渠道页：右侧窄栏放标签云 ---- */
.ch-layout { display: grid; grid-template-columns: minmax(0, 1fr) 132px; gap: 0 22px; align-items: start; }
.ch-rail {
  position: sticky; top: 84px;
  border-left: 1px solid var(--border);
  padding: 2px 0 0 14px;
  min-width: 0;
}
.ch-rail-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 6px;
  margin-bottom: 8px;
}
.ch-rail-head span {
  font: 600 10px/1 var(--mono); letter-spacing: 0.14em;
  color: var(--muted-2); text-transform: uppercase;
}
.ch-rail-head button { padding: 2px 6px; font-size: 11px; border: 0; }
.ch-rail .tag-bar { flex-direction: column; align-items: stretch; gap: 5px; }
.ch-rail .tag-chip {
  justify-content: space-between; font-size: 11.5px; padding: 3px 8px;
  border-color: transparent; background: transparent;
}
.ch-rail .tag-chip:hover { background: var(--panel-2); border-color: var(--border); }
/* 右栏窄，激活态不用光环，改成整行浅色底 + 左侧色条 */
.ch-rail .tag-chip.active {
  box-shadow: none; font-weight: 600;
  background: var(--panel-2);
  border-color: var(--border);
  box-shadow: inset 2px 0 0 currentColor;
}
.ch-rail .muted { display: block; font-size: 11.5px; line-height: 1.6; }
@media (max-width: 980px) {
  .ch-layout { grid-template-columns: 1fr; }
  .ch-rail {
    position: static; border-left: 0; border-top: 1px solid var(--border);
    padding: 12px 0 0; margin-top: 4px;
  }
  .ch-rail .tag-bar { flex-direction: row; flex-wrap: wrap; }
}

/* 批量结果每行一条，失败也保留在表里 */
.batch-row td { vertical-align: top; }
.batch-row .err { font-size: 12px; }

/* ---- 行内操作：主动作 + ⋯ 折叠菜单 ---- */
.row-actions { display: inline-flex; align-items: center; gap: 4px; }
.row-actions > button { padding: 4px 10px; font-size: 12px; }
.row-menu { position: relative; display: inline-block; }
.row-menu > summary {
  list-style: none; cursor: pointer; user-select: none;
  width: 24px; height: 24px; line-height: 22px;
  text-align: center; border-radius: var(--radius);
  border: 1px solid transparent; color: var(--muted);
  font-size: 14px; letter-spacing: 0;
}
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu > summary:hover { border-color: var(--border); background: var(--panel-2); color: var(--text); }
.row-menu[open] > summary { border-color: var(--border-strong); background: var(--panel-2); color: var(--text); }
.row-menu-body {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 20;
  min-width: 108px; padding: 4px;
  background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  display: flex; flex-direction: column;
}
.row-menu-body button {
  border: 0; background: transparent; text-align: left;
  padding: 6px 10px; font-size: 12.5px; border-radius: 4px; color: var(--text-2);
}
.row-menu-body button:hover { background: var(--panel-2); color: var(--text); }
.row-menu-body button.danger { color: var(--danger); }
.row-menu-body button.danger:hover { background: var(--danger-soft); }

/* 渠道筛选按钮组 */
/* 区间示意：SVG 括号图，左「[」含、右「)」不含，中间一天一格 */
.range-hint {
  margin: 10px 0 2px;
  padding: 6px 10px 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-2);
}
.range-hint-bad {
  padding: 8px 10px;
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12px;
}
.range-svg { display: block; width: 100%; height: auto; }
.range-svg text {
  font-family: var(--mono);
  font-size: 12px;
}
.rg-label { fill: var(--text-2); }
.rg-day { fill: var(--text-2); font-size: 11px; }
.rg-tag { fill: var(--success); font-size: 12px; letter-spacing: 1px; }
.rg-tag-no { fill: var(--muted); }
.rg-count { fill: var(--muted); font-size: 12px; }
.rg-note { fill: var(--muted); font-size: 11px; }
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip {
  padding: 4px 12px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}
.chip:hover { border-color: var(--primary); }
.chip.active {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.flex { display: flex; gap: 8px; align-items: center; }
.gap-2 { gap: 8px; }
.mb-8 { margin-bottom: 8px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.spacer { flex: 1; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-right { text-align: right; }

/* ---- 渠道标签 ---- */
.tag-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.tag-chip:hover { filter: brightness(0.97); }
.tag-chip.active {
  box-shadow: 0 0 0 2px rgba(168, 73, 43, 0.22);
  font-weight: 600;
}
/* 标签云上的计数徽标 */
.tag-count {
  font-size: 11px;
  opacity: 0.8;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(36, 31, 28, 0.07);
}
/* 渠道表单里的标签选择器：未选中的弱化，选中后高亮 */
.tag-pick { opacity: 0.45; }
.tag-pick.active { opacity: 1; }

/* ===== 响应式：顶栏胶囊在窄屏换行 ===== */
@media (max-width: 1180px) {
  .topbar { height: auto; flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .topbar .user { margin-left: auto; }
  .nav-capsule { flex-wrap: wrap; border-radius: 14px; }
  .main { padding: 22px 18px 48px; }
}
@media (max-width: 720px) {
  .topbar .brand span { display: none; }
  .nav-capsule .cap-name { display: none; }
  .nav-capsule { padding: 3px; gap: 1px; }
  .nav-capsule a { padding: 6px 9px; font-size: 12px; }
  .modal { min-width: 0; width: 92vw; padding: 16px; }
  .log-row { grid-template-columns: 54px 6px minmax(0, 1fr); }
  .log-amt { grid-column: 3; text-align: left; padding-top: 1px; }
}
