:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --panel-2: #fafbfc;
  --border: #e3e6ea;
  --border-strong: #d0d5db;
  --text: #1b1f24;
  --text-2: #5a6472;
  --text-3: #8a93a0;
  --brand: #e6162d;
  --brand-soft: #fdeef0;
  --blue: #2b6ee8;
  --violet: #7c5cf0;
  --green: #12a150;
  --orange: #f08c00;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 13.5px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font-family: inherit; font-size: inherit; color: inherit; }

/* ============ 顶栏 ============ */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 10px 22px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: 15px; white-space: nowrap; }
.brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }
.brand small { font-weight: 400; color: var(--text-3); font-size: 12px; }

.badge {
  font-size: 11.5px; padding: 2px 9px; border-radius: 20px; font-weight: 600;
  border: 1px solid transparent; white-space: nowrap;
}
.badge.mock { background: #fff7e6; color: #a35b00; border-color: #ffe0a3; }
.badge.live { background: #e8f7ee; color: #0d7a3d; border-color: #b7e6c9; }

.spacer { flex: 1; }

.ctrl { display: flex; align-items: center; gap: 6px; }
.ctrl > label { color: var(--text-3); font-size: 12.5px; }

input[type=date], input[type=text], input[type=password], select {
  border: 1px solid var(--border-strong); background: #fff;
  border-radius: 7px; padding: 5px 9px; outline: none;
}
input:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.btn {
  border: 1px solid var(--border-strong); background: #fff; border-radius: 7px;
  padding: 6px 13px; cursor: pointer; font-weight: 550; transition: .12s;
  white-space: nowrap;
}
.btn:hover { background: var(--panel-2); border-color: #b9c0c8; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #c8121f; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: #eef0f3; }
.btn.sm { padding: 4px 9px; font-size: 12.5px; }

.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 7px; overflow: hidden; }
.seg button {
  border: 0; background: #fff; padding: 5px 11px; cursor: pointer;
  border-right: 1px solid var(--border); color: var(--text-2);
}
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }

/* ============ 账户选择器 ============ */
.acct-picker { position: relative; }
.acct-trigger {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--border-strong); background: #fff;
  border-radius: 7px; padding: 5px 11px; max-width: 340px;
}
.acct-trigger .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-trigger .caret { color: var(--text-3); font-size: 10px; }
.acct-panel {
  position: absolute; top: calc(100% + 6px); right: 0; width: 320px; max-height: 420px;
  background: #fff; border: 1px solid var(--border-strong); border-radius: 10px;
  box-shadow: 0 8px 28px rgba(16, 24, 40, .14); z-index: 100; display: none; overflow: hidden;
}
.acct-panel.open { display: block; }
.acct-panel .head { display: flex; gap: 6px; padding: 9px 11px; border-bottom: 1px solid var(--border); }
.acct-list { max-height: 330px; overflow: auto; padding: 5px 0; }
.acct-item { display: flex; align-items: center; gap: 9px; padding: 6px 12px; cursor: pointer; }
.acct-item:hover { background: var(--panel-2); }
.acct-item .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-item .tag { font-size: 11px; color: var(--text-3); }

/* ============ 主体 ============ */
.wrap { max-width: 1560px; margin: 0 auto; padding: 16px 22px 60px; }

.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs button {
  border: 0; background: none; padding: 9px 15px; cursor: pointer; color: var(--text-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 550;
}
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 650; }
.tabs .sp { flex: 1; }

/* ---------- 顶栏右侧：当前用户徽标 ---------- */
.user-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px; margin-left: 8px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--panel); font-size: 12.5px;
}
.user-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; }
.user-badge .role {
  font-size: 11px; padding: 1px 6px; border-radius: 4px;
  background: #eef2ff; color: #4338ca;
}
.user-badge .role.owner { background: #fef3c7; color: #92400e; }
.btn.xs { padding: 3px 8px; font-size: 11.5px; }

/* ---------- 登录弹窗 ---------- */
.login-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55);
  display: flex; align-items: center; justify-content: center; z-index: 9999;
}
.login-mask[hidden] { display: none; }
.login-card {
  background: var(--panel); border-radius: 12px; padding: 28px;
  width: 360px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}
.login-card h2 { margin: 0 0 8px; font-size: 16px; }
.login-card .hint { color: var(--text-3); font-size: 12.5px; margin-bottom: 14px; }
.login-card .hint.err { color: #b91c1c; }
.login-card .form-row { margin-bottom: 10px; }
.login-card .form-row label { display: block; margin-bottom: 4px; font-size: 12.5px; color: var(--text-2); }
.login-card input[type=text], .login-card input[type=password] {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 13.5px; outline: none;
}
.login-card input:focus { border-color: var(--brand); }

/* ---------- 权限管理：项目复选列表 ---------- */
.proj-check-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: 6px; padding: 8px;
  background: var(--panel-2); border-radius: 8px;
  border: 1px solid var(--border); max-height: 36vh; overflow: auto;
}
.proj-check {
  display: flex; align-items: center; gap: 9px; padding: 8px 11px;
  border: 1px solid var(--border); border-radius: 7px;
  background: var(--panel); font-size: 13px; cursor: pointer;
  transition: border-color .12s, background .12s, box-shadow .12s;
  min-width: 0;
}
.proj-check:hover { border-color: var(--brand); }
/* ⚠️ 特异性必须压过 .form-row input{width:100%}，否则复选框被拉满宽、文字被挤成竖排 */
.proj-check input, .proj-check input[type=checkbox] { margin: 0; width: auto; height: auto; flex: 0 0 auto; accent-color: var(--brand); }
/* ⚠️ 不要用 overflow-wrap:anywhere —— Chromium 会把 flex 子项 min-content 算成 0，文字变竖排 */
.proj-check span { flex: 1 1 auto; min-width: 0; word-break: break-word; }
.proj-check .hid-tag { font-style: normal; color: var(--text-3); font-size: 11.5px; margin-left: 6px; white-space: nowrap; }
.proj-check.on {
  border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, var(--panel));
  box-shadow: inset 0 0 0 1px var(--brand);
}
.proj-check.on span { font-weight: 600; }
.proj-check-bar {
  display: flex; align-items: center; gap: 12px; margin-bottom: 7px; font-size: 12px;
}
.proj-check-bar .sel-all { color: var(--blue); text-decoration: none; cursor: pointer; }
.proj-check-bar .sel-all:hover { text-decoration: underline; }

/* ---------- 项目指标自定义弹窗：三栏（分类导航 / 勾选区 / 已选列表） ---------- */
.kpi-tpl-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; margin-bottom: 8px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2);
}
.kpi-tpl-bar .kpi-tpl-label { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.kpi-tpl-bar select {
  flex: 1; min-width: 0; padding: 4px 6px; font-size: 12.5px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--panel); color: var(--text);
}
.kpi-tpl-bar .btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.danger { color: #b42318; border-color: #ffd0d5; }
.btn.danger:hover { background: #fff5f6; border-color: #f5a9af; }
.kpi-modal-grid {
  display: grid; grid-template-columns: 128px 1fr 210px;
  gap: 10px; height: 440px;
}
/* 左栏：分类导航 */
.kpi-cat-nav {
  display: flex; flex-direction: column; gap: 2px;
  border-right: 1px solid var(--border); padding-right: 8px;
  overflow-y: auto;
}
.kpi-cat-item {
  padding: 7px 9px; border-radius: 6px; cursor: pointer;
  font-size: 13px; color: var(--text-2); white-space: nowrap;
  user-select: none;
}
.kpi-cat-item:hover { background: var(--panel-2); color: var(--text-1); }
.kpi-cat-item.on { background: #e8f1ff; color: var(--brand); font-weight: 600; }
/* 中栏：勾选区 */
.kpi-pick-pane {
  overflow-y: auto; padding: 4px;
  background: #fafbfc; border: 1px solid var(--border); border-radius: 6px;
}
.kpi-pick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; }
.kpi-cat-block { margin-bottom: 10px; }
.kpi-cat-block:last-child { margin-bottom: 0; }
.kpi-cat-block-head {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 6px; margin-bottom: 4px;
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
  border-bottom: 1px dashed var(--border);
}
.kpi-group-count {
  background: var(--panel-2); color: var(--text-3);
  padding: 1px 7px; border-radius: 8px; font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.kpi-empty { color: #8a93a0; padding: 24px 0; text-align: center; font-size: 13px; }
/* 右栏：已选列表 */
.kpi-sel-pane { display: flex; flex-direction: column; min-height: 0; }
.kpi-sel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 6px 8px; font-size: 13px; font-weight: 600; color: var(--text-1);
}
.kpi-sel-list {
  flex: 1; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px;
  background: var(--panel-2); padding: 4px;
}
.kpi-sel-item {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 6px 8px; margin-bottom: 3px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 5px;
  font-size: 12.5px;
}
.kpi-sel-item .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-sel-item .grip {
  cursor: grab; color: #b6bdc7; font-size: 13px;
  user-select: none; padding: 0 2px; line-height: 1;
}
.kpi-sel-item .grip:hover { color: var(--brand); }
.kpi-sel-item.dragging { opacity: .45; border-style: dashed; }
.kpi-sel-item { cursor: grab; }
.kpi-sel-item .x {
  cursor: pointer; color: #8a93a0; padding: 0 4px; border-radius: 4px;
  font-size: 14px; line-height: 1;
}
.kpi-sel-item .x:hover { color: #b91c1c; background: #fee2e2; }
.proj-tag {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 11.5px; color: #fff; margin: 1px 2px;
}

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.panel-head h3 { margin: 0; font-size: 13.5px; font-weight: 650; }
.panel-head .sub { color: var(--text-3); font-size: 12px; }
.panel-body { padding: 14px 16px; }

.grid { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); }
.cols-2 { grid-template-columns: 1.6fr 1fr; }
.cols-2b { grid-template-columns: 1fr 1fr; }
/* 日报导航：左 1/4 固定、右 3/4；min-width:0 防止宽表格把栅格撑破，改为在面板内横向滚动 */
.cols-rep { grid-template-columns: 1fr 3fr; }
.cols-rep > .panel { min-width: 0; }
.cols-rep .panel-head { flex-wrap: wrap; row-gap: 6px; }
.cols-rep .panel-head h3 { white-space: nowrap; }
@media (max-width: 1080px) { .cols-2, .cols-2b, .cols-rep { grid-template-columns: 1fr; } }

.kpi {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 13px 15px; box-shadow: var(--shadow);
}
.kpi .k { color: var(--text-3); font-size: 12px; display: flex; align-items: center; gap: 5px; }
.kpi .v { font-size: 23px; font-weight: 680; margin-top: 5px; font-variant-numeric: tabular-nums; letter-spacing: -.4px; }
.kpi .d { font-size: 12px; margin-top: 3px; color: var(--text-3); }
.kpi .d.up { color: var(--brand); }
.kpi .d.down { color: var(--green); }
.kpi.accent .v { color: var(--brand); }

/* ============ 表格 ============ */
.tbl-wrap { overflow: auto; max-height: 640px; border-radius: 0 0 var(--radius) var(--radius); }
table { width: 100%; border-collapse: separate; border-spacing: 0; white-space: nowrap; }
th, td { padding: 8px 12px; text-align: center; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
td.nm { max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
thead th {
  position: sticky; top: 0; z-index: 2; background: var(--panel-2);
  color: var(--text-2); font-weight: 600; font-size: 12px; cursor: pointer; user-select: none;
  border-bottom: 1px solid var(--border-strong);
}
thead th:hover { background: #f0f2f5; }
thead th .arw { color: var(--brand); font-size: 10px; margin-left: 3px; }
tbody tr:hover { background: #fcfcfd; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--text-2); }

.bar-cell { display: flex; align-items: center; gap: 8px; min-width: 130px; }
.bar-cell .track { flex: 1; height: 6px; background: #eef0f3; border-radius: 3px; overflow: hidden; min-width: 40px; }
.bar-cell .fill { height: 100%; background: var(--brand); border-radius: 3px; }
.bar-cell .val { min-width: 62px; text-align: right; }

/* ============ 图表 ============ */
.chart { width: 100%; position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }
.tip {
  position: fixed; pointer-events: none; z-index: 999; background: #1b1f24; color: #fff;
  padding: 7px 10px; border-radius: 7px; font-size: 12px; line-height: 1.6;
  box-shadow: 0 6px 20px rgba(0,0,0,.22); display: none; white-space: nowrap;
}
.tip b { color: #fff; }

/* ============ 日报 ============ */
.summary { font-size: 14px; line-height: 2; white-space: pre-wrap; }
.summary .hd { font-weight: 700; font-size: 15px; }
.summary .warn { color: #b45309; }

/* ============ 受众 ============ */
.aud-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; }
.aud-row .nm { width: 78px; color: var(--text-2); flex-shrink: 0; }
.aud-row .track { flex: 1; height: 18px; background: #f1f3f6; border-radius: 4px; overflow: hidden; position: relative; }
.aud-row .fill { height: 100%; border-radius: 4px; transition: width .35s ease; }
.aud-row .val { width: 118px; text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; flex-shrink: 0; }

/* ============ 项目情况 ============ */
.proj-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1500px) { .proj-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .proj-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .proj-grid { grid-template-columns: minmax(0, 1fr); } }
.proj-card {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s;
}
.proj-card:hover { border-color: var(--brand); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(230,22,45,.08); }
.proj-card.on { border-color: var(--brand); background: #fff7f8; }
/* —— 排序模式 —— */
.proj-card.sorting { cursor: grab; border-style: dashed; }
.proj-card.sorting:hover { transform: none; box-shadow: none; }
.proj-card.sorting:active { cursor: grabbing; }
.proj-card.dragging { opacity: .45; }
.proj-card.drag-over { border-color: var(--brand); border-style: solid; background: #fff7f8; }
.proj-card .head .spacer { flex: 1; }
.proj-move {
  flex-shrink: 0; width: 22px; height: 20px; line-height: 1;
  border: 1px solid var(--border); background: #fff; color: var(--text-2);
  font-size: 10px; border-radius: 5px; cursor: pointer; padding: 0;
}
.proj-move:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); background: rgba(230,22,45,.06); }
.proj-move:disabled { opacity: .35; cursor: default; }
/* —— 0 消耗项目：通栏分隔条（点一下收纳/展开所有 0 消耗卡片） —— */
.proj-zero-bar {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; user-select: none;
  color: #8a93a0; font-size: 12.5px;
  padding: 3px 0; margin: 2px 0;
}
.proj-zero-bar .zb-line { flex: 1; height: 1px; background: var(--border); }
.proj-zero-bar .zb-label { white-space: nowrap; }
.proj-zero-bar:hover { color: var(--brand); }
.proj-zero-bar:hover .zb-line { background: rgba(230,22,45,.35); }
/* —— 0 消耗标记 —— */
.proj-card .head .zero-tag {
  flex-shrink: 0; font-size: 11px; color: #8a93a0; background: #f1f3f6;
  border-radius: 4px; padding: 1px 6px;
}
.proj-card .sum { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); margin-bottom: 10px; }
.proj-card .head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.proj-card .head .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); flex-shrink: 0; }
.proj-card .head .name { font-weight: 650; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-card .head .cnt { color: var(--text-3); font-size: 12px; flex-shrink: 0; }
.proj-card .head .kpi-gear {
  margin-left: auto; flex-shrink: 0;
  border: none; background: transparent; color: var(--text-3);
  font-size: 12px; cursor: pointer; padding: 2px 6px; border-radius: 6px;
}
.proj-card .head .kpi-gear:hover { color: var(--brand); background: rgba(230,22,45,.06); }
.proj-card .head .push-gear {
  flex-shrink: 0;
  border: none; background: transparent; color: var(--text-3);
  font-size: 12px; cursor: pointer; padding: 2px 6px; border-radius: 6px;
}
.proj-card .head .push-gear:hover { color: #07c160; background: rgba(7,193,96,.08); }
.proj-card .head .push-gear.on { color: #07c160; font-weight: 600; }
.proj-card .bar { height: 8px; background: #eef0f3; border-radius: 4px; overflow: hidden; margin: 6px 0 10px; }
.proj-card .bar .fill { height: 100%; background: linear-gradient(90deg, var(--brand) 0%, #ff7685 100%); border-radius: 4px; transition: width .4s ease; }
.proj-card .kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; font-size: 12.5px; }
.proj-card .kpis .row { display: flex; justify-content: space-between; }
.proj-card .kpis .row .k { color: var(--text-3); }
.proj-card .kpis .row .v { color: var(--text-1); font-variant-numeric: tabular-nums; font-weight: 600; }
.proj-card .kpis .row .v.good { color: #12a150; }
.proj-card .kpis .row .v.bad { color: #b42318; }
.proj-card .empty { color: var(--text-3); font-size: 13px; padding: 12px 0; text-align: center; }

/* ============ 设置 ============ */

/* ============ 通用弹窗 ============ */
#modalRoot { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
#modalRoot.open { pointer-events: auto; }
#modalRoot .modal-mask { position: absolute; inset: 0; background: rgba(15, 22, 36, 0.45); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade-in .15s ease; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
#modalRoot .modal-card { background: #fff; border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.18); width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; }
#modalRoot .modal-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
#modalRoot .modal-head h3 { margin: 0; font-size: 14.5px; font-weight: 650; flex: 1; }
#modalRoot .modal-head .close { cursor: pointer; padding: 4px 10px; font-size: 20px; color: #8a93a0; border-radius: 6px; }
#modalRoot .modal-head .close:hover { background: var(--panel-2); color: var(--text-1); }
#modalRoot .modal-body { padding: 16px 18px; }
#modalRoot .modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--panel-2); border-radius: 0 0 12px 12px; }
#modalRoot .field { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
#modalRoot .field label { color: var(--text-2); min-width: 92px; }
#modalRoot .field input,
#modalRoot .field select,
#modalRoot .field textarea { flex: 1; }
#modalRoot .color-row { display: flex; gap: 6px; flex-wrap: wrap; }
#modalRoot .color-row .swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
#modalRoot .color-row .swatch.on { border-color: #1b1f24; transform: scale(1.1); }
#modalRoot textarea { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; resize: vertical; }

/* ============ 项目管理卡片 ============ */
.proj-mgmt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.proj-mgmt-grid .empty { color: var(--text-3); padding: 14px 0; }

/* ============ 账户管理工具栏（搜索/分页） ============ */
.acct-toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 0 12px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.acct-toolbar input[type="text"] { flex: 1; min-width: 200px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); font-size: 13px; }
.acct-toolbar input[type="text"]:focus { outline: none; border-color: var(--accent); }
.acct-toolbar select { padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); font-size: 13px; cursor: pointer; }
.acct-toolbar .spacer { flex: 1; }
.acct-toolbar .acct-page-info { color: var(--text-3); font-size: 12px; padding: 0 6px; white-space: nowrap; }
.acct-toolbar .btn[disabled] { opacity: 0.35; cursor: not-allowed; }
.acct-toolbar select option.proj-hidden-opt { color: var(--text-3); }
.proj-mgmt-card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; transition: border-color .15s; }
.proj-mgmt-card.proj-hidden { opacity: 0.55; }
.proj-mgmt-card .head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.proj-mgmt-card .head .dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.proj-mgmt-card .head .name { font-weight: 650; font-size: 14px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-mgmt-card .head .badge { background: #f1f3f6; color: var(--text-3); font-size: 11px; padding: 2px 6px; border-radius: 10px; }
.proj-mgmt-card .desc { color: var(--text-3); font-size: 12.5px; margin: 4px 0 10px; min-height: 18px; }
.proj-mgmt-card .meta { display: flex; justify-content: space-between; color: var(--text-2); font-size: 12px; padding: 8px 0; border-top: 1px dashed var(--border); margin-top: 6px; }
.proj-mgmt-card .ops { display: flex; gap: 6px; margin-top: 10px; }
.proj-mgmt-card .ops .btn { flex: 1; }

/* ============ 账户管理表格 ============ */
#acctMgmtTable { table-layout: fixed; }
#acctMgmtTable th, #acctMgmtTable td { overflow: hidden; text-overflow: ellipsis; }
#acctMgmtTable select { font-size: 12px; padding: 4px 6px; }

.form-row { display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: center; padding: 8px 0; }
.form-row label { color: var(--text-2); }
.form-row .hint { color: var(--text-3); font-size: 12px; margin-top: 4px; }
.form-row input { width: 100%; }
.form-row input[type=radio], .form-row input[type=checkbox] { width: auto; flex: 0 0 auto; }
/* 角色选择卡片 */
.role-pick { display: flex; gap: 10px; }
.role-card {
  flex: 1; display: grid; grid-template-columns: auto 1fr; align-items: center;
  column-gap: 8px; padding: 9px 12px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 8px; background: var(--panel);
  transition: border-color .12s, background .12s, box-shadow .12s;
}
.role-card input[type=radio] { grid-row: span 2; accent-color: var(--brand); margin: 0; }
.role-card .rc-title { font-weight: 600; font-size: 13.5px; }
.role-card .rc-desc { grid-column: 2; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.role-card.on {
  border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, var(--panel));
  box-shadow: inset 0 0 0 1px var(--brand);
}
.role-card.on .rc-title { color: var(--brand); }

/* ============ 微信推送（多群配置卡） ============ */
.wecom-status {
  font-size: 11.5px; padding: 2px 9px; border-radius: 20px; font-weight: 600;
  border: 1px solid transparent; white-space: nowrap;
}
.wecom-status.ok { background: #e8f7ee; color: #0d7a3d; border-color: #b7e6c9; }
.wecom-status.no { background: var(--panel-2); color: var(--text-3); border-color: var(--border); }
.wecom-groups { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.wecom-group-row { display: flex; align-items: center; gap: 8px; }
.wecom-g-name { width: 148px; flex: 0 0 auto; }
.wecom-g-wh { flex: 1; min-width: 0; font-size: 12.5px; }
.wecom-g-del {
  border: none; background: transparent; color: var(--text-3); cursor: pointer;
  font-size: 14px; padding: 4px 8px; border-radius: 6px; flex: 0 0 auto; transition: .12s;
}
.wecom-g-del:hover { background: #fff5f6; color: #b42318; }
.wecom-actions { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.wecom-actions-gap { flex: 1; }
.wecom-hint {
  margin-top: 8px; display: flex; gap: 9px; align-items: flex-start;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 12px; color: var(--text-2); font-size: 12px; line-height: 1.8;
}
.wecom-hint b { color: var(--text); font-weight: 600; }
.wecom-hint-ico { flex-shrink: 0; font-size: 13px; line-height: 1.8; }

/* 推送设置弹窗里的选群胶囊 */
.pushm-groups { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.pushm-g {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border-strong); border-radius: 7px;
  padding: 4px 10px; cursor: pointer; font-size: 12.5px; color: var(--text-2);
  transition: border-color .12s, background .12s; user-select: none;
}
.pushm-g:hover { border-color: var(--brand); }
.pushm-g input { margin: 0; width: auto; height: auto; accent-color: var(--brand); flex: 0 0 auto; }
.pushm-g:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--text); font-weight: 600; }
.steps { counter-reset: s; padding-left: 0; list-style: none; margin: 0; }
.steps li { counter-increment: s; position: relative; padding-left: 32px; margin-bottom: 14px; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 22px; height: 22px;
  border-radius: 50%; background: var(--brand-soft); color: var(--brand);
  font-size: 12px; font-weight: 700; display: grid; place-items: center;
}
code {
  background: #f0f2f5; padding: 1px 6px; border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px;
}
pre {
  background: #f7f8fa; border: 1px solid var(--border); border-radius: 8px;
  padding: 11px 13px; overflow: auto; font-size: 12.5px; margin: 8px 0;
}
.hidden { display: none !important; }
.notice {
  padding: 10px 13px; border-radius: 8px; font-size: 12.8px; margin-bottom: 14px;
  border: 1px solid #ffe0a3; background: #fffbf0; color: #8a5200;
}
.notice.info { border-color: #cfe0ff; background: #f2f7ff; color: #1d4ed8; }
.notice.err { border-color: #ffd0d5; background: #fff5f6; color: #b42318; }
.notice.ok { border-color: #bbf0cc; background: #f0fdf4; color: #15803d; }
/* —— 消息箱（顶栏右上角铃铛 + 下拉面板） —— */
.msg-center { position: relative; }
.msg-bell {
  position: relative; border: 1px solid var(--border); background: #fff; border-radius: 8px;
  padding: 6px 10px; cursor: pointer; font-size: 15px; line-height: 1;
}
.msg-bell:hover { border-color: var(--brand); }
.msg-badge {
  position: absolute; top: -7px; right: -7px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.msg-panel {
  position: absolute; top: calc(100% + 8px); right: 0; width: 420px; max-width: 88vw;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 28px rgba(15,23,42,.12); z-index: 95; overflow: hidden;
}
.msg-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 600;
}
.msg-list { max-height: 380px; overflow: auto; }
.msg-empty { padding: 22px; text-align: center; color: #8a93a0; font-size: 12.5px; }
.msg-item { display: flex; gap: 8px; padding: 9px 12px; border-bottom: 1px solid #f1f3f6; align-items: flex-start; }
.msg-item:last-child { border-bottom: none; }
.msg-item:hover { background: #fafbfc; }
.msg-dot { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; }
.msg-dot.e { background: #d92d20; }
.msg-dot.o { background: #12b76a; }
.msg-dot.w { background: #f79009; }
.msg-dot.i { background: #2970ff; }
.msg-item-body { flex: 1; min-width: 0; font-size: 12.5px; }
.msg-item-time { color: #8a93a0; font-size: 11.5px; margin-top: 2px; }
.msg-item-del { flex-shrink: 0; border: none; background: none; color: #b6bdc7; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; }
.msg-item-del:hover { color: var(--brand); }
/* —— 顶部最新消息横幅 + 关闭 × —— */
.msg-banner { display: flex; align-items: flex-start; gap: 10px; }
.msg-banner-body { flex: 1; min-width: 0; }
.msg-close {
  flex-shrink: 0; border: none; background: none; cursor: pointer;
  font-size: 17px; line-height: 1.1; padding: 0 2px; opacity: .5; color: inherit;
}
.msg-close:hover { opacity: 1; }
.err-list { font-size: 12.5px; color: #b42318; }
.spinner {
  width: 14px; height: 14px; border: 2px solid #e3e6ea; border-top-color: var(--brand);
  border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- 智能监控预警 ---------------- */
.alert-banner { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
/* 折叠摘要条（按钮）：固定一行高度 */
.alert-toggle {
  display: flex; gap: 10px; align-items: center; padding: 9px 14px;
  border-radius: 10px; font-size: 13px; border: 1px solid; line-height: 1.5;
  text-align: left; cursor: pointer; width: 100%; font-family: inherit;
}
.alert-toggle .msg { flex: 1; }
.alert-toggle .chev { font-size: 12px; opacity: .7; flex-shrink: 0; }
.alert-toggle:hover { filter: brightness(.98); }
.alert-toggle.high { background: #fff1f0; border-color: #f2b8b5; color: #b42318; }
.alert-toggle.warn { background: #fffaeb; border-color: #f2d9a4; color: #b45309; }
.alert-item {
  display: flex; gap: 10px; align-items: baseline; padding: 10px 14px;
  border-radius: 10px; font-size: 13px; border: 1px solid; line-height: 1.5;
}
.alert-item.high { background: #fff1f0; border-color: #f2b8b5; color: #b42318; }
.alert-item.warn { background: #fffaeb; border-color: #f2d9a4; color: #b45309; }
.alert-item.ok   { background: #f0fdf4; border-color: #bbf0cc; color: #15803d; }
.alert-item .lv  { font-weight: 700; flex-shrink: 0; }
.alert-item .sc  { font-weight: 600; flex-shrink: 0; }
.alert-item .msg { flex: 1; }

/* ---------------- 历史日报 ---------------- */
.report-list { display: flex; flex-direction: column; gap: 6px; max-height: 520px; overflow: auto; }
.rep-item {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 10px 13px; border: 1px solid var(--border); border-radius: 9px;
  background: #fff; cursor: pointer; font-size: 13px; text-align: left;
}
.rep-item:hover { border-color: var(--brand); }
.rep-item.on { border-color: var(--brand); background: var(--brand-soft); }
.rep-item span { color: var(--text-3); font-size: 12px; }

/* ---------------- 项目分组编辑器 ---------------- */
.proj-row {
  display: grid; grid-template-columns: 170px 110px 1fr; gap: 10px;
  align-items: center; padding: 6px 0; border-bottom: 1px dashed #eef0f3;
}
.proj-row .nm { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-row input {
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; outline: none;
}
.proj-row input:focus { border-color: var(--brand); }

/* ---------------- 连接状态：状态点 ---------------- */
.conn-dot {
  width: 9px; height: 9px; border-radius: 50%; display: inline-block;
  margin-left: 10px; flex-shrink: 0; transition: background .2s, box-shadow .2s;
}
.conn-dot.ok    { background: #12a150; box-shadow: 0 0 0 3px rgba(18,161,80,.15); }
.conn-dot.warn  { background: #f5a623; box-shadow: 0 0 0 3px rgba(245,166,35,.18); }
.conn-dot.down  { background: #d92d20; box-shadow: 0 0 0 3px rgba(217,45,32,.18); animation: connBlink 1.1s ease-in-out infinite; }
@keyframes connBlink { 0%,100% { opacity: 1 } 50% { opacity: .25 } }

/* ---------------- 连接状态条 ---------------- */
.conn-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 18px; font-size: 13px; line-height: 1.5;
  background: #fff8e6; border-bottom: 1px solid #f2d9a4; color: #92400e;
}
.conn-bar.ok { background: #f0fdf4; border-bottom-color: #bbf0cc; color: #15803d; }
.conn-pulse {
  width: 9px; height: 9px; border-radius: 50%; background: #f5a623;
  flex-shrink: 0; animation: connBlink 1.1s ease-in-out infinite;
}
.conn-bar.ok .conn-pulse { background: #12a150; animation: none; }
.conn-msg { font-weight: 600; }
.conn-meta { color: #a16207; font-size: 12px; }
.conn-bar.ok .conn-meta { color: #15803d; }

/* 断线时页面内容降透明度，提示"这是旧数据" */
body.conn-offline .wrap { opacity: .62; filter: saturate(.75); transition: opacity .25s; }

/* ---------------- 启动遮罩 ---------------- */
.boot-overlay {
  position: fixed; inset: 0; z-index: 900;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.86); backdrop-filter: blur(3px);
}
.boot-card {
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 30px 38px; text-align: center; max-width: 430px;
  box-shadow: 0 12px 40px rgba(16,24,40,.10);
}
.boot-card h3 { margin: 16px 0 8px; font-size: 15px; color: var(--text-1, #1b1f24); }
.boot-card p  { margin: 0; font-size: 13px; color: var(--text-3, #8a93a0); line-height: 1.6; }
.boot-spin {
  width: 30px; height: 30px; margin: 0 auto; border-radius: 50%;
  border: 3px solid #e6e8ec; border-top-color: var(--brand, #5b5bd6);
  animation: bootSpin .85s linear infinite;
}
@keyframes bootSpin { to { transform: rotate(360deg) } }

/* ============================================================
 * 自动日报：分项目模版（导航树 / 表格视图 / 模版编辑弹窗）
 * 2026-09-23 新增
 * ========================================================== */

/* ---------- 左栏：日报导航树 ---------- */
.rep-group { margin-bottom: 8px; }
.rep-group-head {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 9px; border-radius: 8px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--border);
  font-size: 13px;
}
.rep-group-head:hover { border-color: var(--brand); }
.rep-group.cur > .rep-group-head { border-color: var(--brand); background: var(--brand-soft); }
.rep-group-head .caret { color: var(--text-3); width: 12px; font-size: 11px; }
.rep-group-head .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.rep-group-head b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-group-head .spacer { flex: 1; }
.rep-group-head .cnt { color: var(--text-3); font-size: 11.5px; }
.rep-group-head .tag {
  font-size: 10.5px; padding: 1px 6px; border-radius: 9px;
  background: #eef1f5; color: var(--text-3); white-space: nowrap;
}
.rep-group-head .tag.live { background: #e8f7ee; color: #0d7a3d; }
.rep-group-head .chip {
  font-size: 11px; padding: 2px 8px; border-radius: 20px; cursor: pointer;
  border: 1px solid var(--border-strong); background: #fff; color: var(--text-2);
  white-space: nowrap;
}
.rep-group-head .chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

.rep-date {
  display: flex; align-items: center; gap: 8px; width: calc(100% - 18px);
  margin: 4px 0 0 18px; padding: 6px 11px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
  cursor: pointer; font-size: 12.5px; text-align: left;
}
.rep-date:hover { border-color: var(--brand); }
.rep-date.on { border-color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.rep-date .d { font-variant-numeric: tabular-nums; }
.rep-date .tag.live { font-size: 10.5px; padding: 1px 6px; border-radius: 9px; background: #e8f7ee; color: #0d7a3d; }
.rep-none { color: var(--text-3); font-size: 12px; padding: 6px 0 6px 18px; }
.rep-warn {
  margin-top: 10px; padding: 8px 10px; border-radius: 8px;
  background: #fff8e6; border: 1px solid #ffe0a3; color: #8a5b00; font-size: 12.5px;
}
.rep-note {
  margin-top: 10px; padding: 8px 10px; border-radius: 8px;
  background: #eef4ff; border: 1px solid #cfdffa; color: #2b4a8b; font-size: 12.5px;
}

/* ---------- 右栏：表格视图 ---------- */
#repTable tfoot td {
  font-weight: 700; border-top: 2px solid var(--border-strong); background: var(--panel-2);
}
#repTableWrap { max-height: 620px; }

/* ---------- 模版编辑弹窗 ---------- */
#modalRoot .modal-card.wide { max-width: 960px; }
.rpt-editor { font-size: 13px; }
.rpt-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.rpt-bar label { color: var(--text-2); }
.rpt-bar select { max-width: 340px; }
.rpt-row { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.rpt-row label { color: var(--text-2); }
.rpt-inline { display: inline-flex; align-items: center; gap: 5px; }

/* 模版导入 / 导出面板 */
.rpt-io {
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: #fafbfc; padding: 10px 12px; margin: -4px 0 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.rpt-io-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rpt-io-row > b { font-size: 12px; color: var(--text-2); min-width: 92px; flex-shrink: 0; }
.rpt-io-row .hint { font-size: 12px; }
.rpt-io textarea {
  width: 100%; box-sizing: border-box;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; line-height: 1.5; resize: vertical;
}

.rpt-cols { display: grid; grid-template-columns: 260px 1fr; gap: 12px; min-height: 300px; }
@media (max-width: 720px) { .rpt-cols { grid-template-columns: 1fr; } }
.rpt-sel-head {
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border); margin-bottom: 6px;
  font-size: 12.5px; color: var(--text-2);
}
.rpt-sel-head .spacer { flex: 1; }
.rpt-sel-head span { color: var(--text-3); font-size: 11.5px; }
.rpt-sel-list {
  max-height: 340px; overflow: auto; display: flex; flex-direction: column; gap: 4px;
}
.rpt-sel-item {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 6px 4px 9px; border: 1px solid var(--border); border-radius: 7px; background: #fff;
  cursor: grab;
}
.rpt-sel-item:active { cursor: grabbing; }
.rpt-sel-item.dragging { opacity: .45; border-style: dashed; border-color: var(--brand); }
.rpt-sel-item .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.rpt-sel-item button.mini {
  border: 0; background: transparent; cursor: pointer; color: var(--text-3);
  font-size: 12px; padding: 1px 4px; border-radius: 4px; line-height: 1.2;
}
.rpt-sel-item button.mini:hover { background: var(--panel-2); color: var(--brand); }
.rpt-sel-item button.mini.x:hover { background: #fee2e2; color: #b42318; }
.rpt-sel-item button.mini:disabled { opacity: .3; cursor: default; }

.rpt-pane-main { display: flex; flex-direction: column; min-height: 0; }
.rpt-pane-main > input { margin-bottom: 8px; }
.rpt-cat { max-height: 340px; overflow: auto; border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; }
.rpt-cat-block { margin-bottom: 10px; }
.rpt-cat-head { font-size: 11.5px; color: var(--text-3); font-weight: 600; margin-bottom: 5px; }
.rpt-cat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 8px; }
@media (max-width: 720px) { .rpt-cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rpt-chk { display: flex; align-items: center; gap: 5px; font-size: 12.5px; padding: 2px 0; cursor: pointer; }
.rpt-chk span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rpt-text-grid { display: grid; grid-template-columns: 1fr 240px; gap: 12px; }
@media (max-width: 720px) { .rpt-text-grid { grid-template-columns: 1fr; } }
.rpt-text-grid textarea { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.rpt-ph .rpt-ph-list { max-height: 300px; overflow: auto; display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.rpt-ph-item {
  display: flex; align-items: center; gap: 8px; justify-content: space-between;
  padding: 5px 8px; border: 1px solid var(--border); border-radius: 7px; background: #fff;
  cursor: pointer; font-size: 12px; text-align: left;
}
.rpt-ph-item:hover { border-color: var(--brand); background: var(--brand-soft); }
.rpt-ph-item code { color: var(--text-3); font-size: 11px; }
.rpt-preview { margin-top: 12px; }
.rpt-prev-head { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.rpt-preview pre {
  margin: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--panel-2); font-size: 12.5px; white-space: pre-wrap; max-height: 240px; overflow: auto;
}

/* —— 日报模版编辑器：自定义分组 / 自定义列 / 表头改名 —— */
.rpt-groups-head { display: flex; align-items: center; gap: 8px; margin: 8px 0 6px; }
.rpt-groupbox {
  border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; margin-bottom: 8px; background: var(--panel-2);
}
.rpt-groupbox-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.rpt-groupbox-head .gname {
  font-size: 13px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 7px; width: 180px;
}
.rpt-groupbox-head .cnt { font-size: 12px; color: var(--text-3); }
.rpt-accs { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.rpt-sel-item i.rn {
  font-style: normal; font-size: 10px; color: #b45309; background: #fef3c7;
  border-radius: 4px; padding: 0 4px; margin-left: 4px; vertical-align: 1px;
}
.rpt-sel-item i.rn.fx { color: #1d4ed8; background: #dbeafe; }
.rpt-sel-item.cst .t { color: #1d4ed8; font-weight: 600; }

/* 日报首列（时间列）：可点击手填 */
#repTable td.rep-lead-cell { cursor: pointer; }
#repTable td.rep-lead-cell:hover { background: color-mix(in srgb, var(--brand) 6%, transparent); }
#repTable td.rep-lead-cell.edited { box-shadow: inset 2px 0 0 var(--brand); }
#repTable td.rep-lead-cell.edited::after { content: ' ✎'; color: var(--brand); font-size: 11px; }
.rep-lead-input {
  width: 100%; min-width: 90px; box-sizing: border-box; font: inherit; color: inherit;
  border: 1px solid var(--brand); border-radius: 4px; padding: 2px 6px; background: var(--panel);
}

/* 可编辑列（模版里「列名=自定义」）：格子可点击填文字 */
#repTable td.rep-cell-input { cursor: text; min-width: 72px; }
#repTable td.rep-cell-input:empty::before { content: '点击填写'; color: var(--text-3); font-size: 11px; }
#repTable td.rep-cell-input:hover { background: color-mix(in srgb, var(--brand) 6%, transparent); }
#repTable td.rep-cell-input.edited { box-shadow: inset 2px 0 0 var(--brand); }
.rep-cell-inp {
  width: 100%; min-width: 72px; box-sizing: border-box; font: inherit; color: inherit;
  border: 1px solid var(--brand); border-radius: 4px; padding: 2px 6px; background: var(--panel);
}

/* ==================== 微信推送设置弹窗 ==================== */
.pushm-status { padding: 9px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 4px; }
.pushm-status.ok { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.pushm-status.warn { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.pushm-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 13px 0; border-bottom: 1px solid var(--border);
}
.pushm-row:last-of-type { border-bottom: none; padding-bottom: 4px; }
.pushm-title { font-size: 14px; font-weight: 600; color: var(--text); }
.pushm-sub { font-size: 12.5px; color: var(--text-3); margin-top: 3px; line-height: 1.5; }
.pushm-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: none; }
.pushm-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.pushm-slider {
  position: absolute; inset: 0; background: #cfd4da; border-radius: 999px;
  transition: background .18s; cursor: pointer;
}
.pushm-slider::before {
  content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px; transition: transform .18s;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.pushm-switch input:checked + .pushm-slider { background: var(--green); }
.pushm-switch input:checked + .pushm-slider::before { transform: translateX(20px); }
.pushm-row input[type="time"] { width: 120px; flex: none; }
.pushm-time.off { opacity: .45; }
.pushm-time.off input[type="time"] { pointer-events: none; }
.pushm-row .btn { flex: none; min-width: 128px; }
.pushm-msg { font-size: 12.5px; min-height: 20px; margin-top: 8px; color: var(--text-3); }
.pushm-msg.ok { color: #15803d; }
.pushm-msg.err { color: #b91c1c; }
.pushm-times-col { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.pushm-times { display: flex; flex-direction: column; gap: 6px; }
.pushm-time-line { display: flex; align-items: center; gap: 6px; }
.pushm-time-line .pushm-time-input { width: 110px; }
.pushm-time-del {
  border: none; background: transparent; color: var(--text-3); cursor: pointer;
  font-size: 13px; padding: 2px 4px; border-radius: 4px; line-height: 1;
}
.pushm-time-del:hover { color: #b91c1c; background: #fef2f2; }
.pushm-times-col .btn { min-width: 0; }

/* ==================== 模版识别 OCR 弹窗 ==================== */
/* 弹窗加宽（默认 520px 放不下字段表） */

/* ==================== 目标统计 ==================== */
.goal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1400px) { .goal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px) { .goal-grid { grid-template-columns: minmax(0, 1fr); } }

.goal-card {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; transition: border-color .15s, box-shadow .15s;
}
.goal-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.goal-card .g-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.goal-card .g-head .g-name {
  font-weight: 650; font-size: 14.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.goal-card .g-head .spacer { flex: 1; }
.goal-card .g-tag {
  flex-shrink: 0; font-size: 11px; border-radius: 4px; padding: 1px 7px;
  background: #f1f3f6; color: #6b7480;
}
.goal-card .g-tag.ahead { background: #e8f6ee; color: var(--green); }
.goal-card .g-tag.ontrack { background: #eaf1fd; color: var(--blue); }
.goal-card .g-tag.behind { background: #fef3e6; color: var(--orange); }
.goal-card .g-tag.done { background: #e8f6ee; color: var(--green); }
.goal-card .g-tag.missed { background: #fdecec; color: #c0333c; }
.goal-card .g-period { font-size: 12px; color: var(--text-3); margin-bottom: 12px; }

.goal-card .g-bar {
  position: relative; height: 8px; background: #eef1f5;
  border-radius: 4px; overflow: hidden; margin-bottom: 10px;
}
.goal-card .g-bar .fill {
  height: 100%; border-radius: 4px; background: var(--brand);
  transition: width .35s ease;
}
.goal-card .g-bar .fill.ahead, .goal-card .g-bar .fill.done { background: var(--green); }
.goal-card .g-bar .fill.ontrack { background: var(--blue); }
.goal-card .g-bar .fill.behind { background: var(--orange); }
.goal-card .g-bar .fill.missed { background: #c0333c; }
/* 时间进度刻度：按天数「应该」打到哪儿，超过它就是超前 */
.goal-card .g-bar .exp {
  position: absolute; top: -3px; bottom: -3px; width: 2px;
  background: #8a93a0; opacity: .65;
}

.goal-card .g-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.goal-card .g-num .k { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.goal-card .g-num .v {
  font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.goal-card .g-num .v.need { color: var(--brand); }
.goal-card .g-num .v.done { color: var(--green); }

.goal-card .g-foot {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border);
}
.goal-card .g-foot .g-rate { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.goal-card .g-foot .spacer { flex: 1; }
.goal-card .g-act {
  border: none; background: transparent; color: var(--text-3);
  font-size: 12px; cursor: pointer; padding: 2px 6px; border-radius: 6px;
}
.goal-card .g-act:hover { color: var(--brand); background: rgba(230, 22, 45, .06); }
.goal-card .g-act.del:hover { color: #b91c1c; background: #fef2f2; }

.goal-empty { color: var(--text-3); font-size: 13px; padding: 26px 0; text-align: center; }
.goal-form-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.goal-form-row label { width: 84px; flex-shrink: 0; color: var(--text-2); font-size: 13px; }
.goal-form-row input { flex: 1; min-width: 0; }
.goal-form-hint { color: var(--text-3); font-size: 12px; margin-top: 2px; }

/* ==================== 素材统计 ==================== */
.mat-sum { display: flex; flex-wrap: wrap; gap: 8px; }
.mat-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--text-2);
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 12px;
  font-variant-numeric: tabular-nums;
}
.mat-chip b { font-weight: 650; color: var(--text-1); }
.mat-chip.video b { color: var(--blue); }
.mat-chip.image b { color: var(--green); }
.mat-chip.total { background: #faf1f1; border-color: #f0d3d5; }
.mat-chip.total b { color: var(--brand); }

.mat-alias {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  cursor: pointer; border-bottom: 1px dashed var(--border-strong); font-weight: 600;
}
.mat-alias:hover { color: var(--brand); }
.mat-id { color: var(--text-3); font-weight: 400; }
.mat-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 素材缩略图：视频取封面、图片取素材本体；加载失败自动移除，不留空框 */
.mat-thumb {
  width: 34px; height: 34px; flex: 0 0 34px; object-fit: cover;
  border-radius: 4px; border: 1px solid var(--border); background: var(--panel-2);
}

/* 表格长文本截断：配合 renderTable 的 c.w 固定列宽使用，悬停 title 看全名 */
.ellip {
  display: inline-block; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  vertical-align: bottom; line-height: 1.5;
}
/* 通栏表单行：标签在上、内容占满（用于项目多选等宽内容） */
.form-row.block { grid-template-columns: 1fr; align-items: start; }
.form-row.block > label { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.form-row.block > label .hint { margin-top: 0; }
