/* ============================================================
   飞猪酒店广告投放智能分析系统 V2.0 - 设计系统
   深蓝侧边栏 + 白色主背景 + 蓝主按钮 + 盈绿亏红
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 13px;
  color: #1a2332;
  background: #f4f6fa;
  -webkit-font-smoothing: antialiased;
}

/* ========== 色彩变量 ========== */
:root {
  --primary: #1e3a5f;       /* 深蓝侧边栏 */
  --primary-light: #2d5a8e;
  --accent: #1890ff;         /* 蓝色主按钮 */
  --accent-light: #40a9ff;
  --accent-bg: #e6f4ff;      /* 浅蓝强调 */
  --success: #52c41a;        /* 盈利绿色 */
  --success-bg: #f6ffed;
  --danger: #f5222d;         /* 亏损/P0 红色 */
  --danger-bg: #fff1f0;
  --warning: #fa8c16;        /* P1 橙色 */
  --warning-bg: #fff7e6;
  --gray: #8c8c8c;
  --gray-bg: #fafafa;
  --bg: #f4f6fa;
  --card-bg: #ffffff;
  --border: #e8ecef;
  --text: #1a2332;
  --text-2: #5a6378;
  --text-3: #8c9aab;
}

/* ========== 整体布局 ========== */
.app {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

/* ========== 左侧导航栏 ========== */
.sidebar {
  width: 200px;
  background: var(--primary);
  color: #fff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.sidebar-logo {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo .logo-icon {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.sidebar-logo .logo-text {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}
.sidebar-logo .logo-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
}
.sidebar-nav {
  padding: 8px 0;
  flex: 1;
}
.nav-group {
  margin-bottom: 16px;
}
.nav-group-title {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  padding: 6px 20px;
  font-weight: 500;
  letter-spacing: 0.5px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  cursor: pointer;
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  transition: all .15s;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active {
  background: rgba(24,144,255,0.18);
  color: #fff;
  border-left-color: var(--accent);
}
.nav-item .badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
}
.nav-item .icon { width: 16px; text-align: center; opacity: 0.7; }
.nav-item.active .icon { opacity: 1; }

.sidebar-footer {
  padding: 12px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 11px;
  color: rgba(255,255,255,0.4);
}

/* ========== 主区域 ========== */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.topbar-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-2);
  font-size: 12px;
}
.topbar-meta .meta-item { display: flex; align-items: center; gap: 4px; }
.topbar-meta strong { color: var(--text); font-weight: 600; }

.content { padding: 20px 24px; flex: 1; overflow: auto; }

/* ========== 卡片 ========== */
.card {
  background: var(--card-bg);
  border-radius: 6px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
}
.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.card-title .subtitle {
  font-size: 12px;
  color: var(--text-3);
  font-weight: normal;
  margin-left: 8px;
}
.card-extra {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

/* ========== KPI 卡片 (顶部) ========== */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.kpi-card {
  background: #fff;
  border-radius: 6px;
  padding: 16px 18px;
  border: 1px solid var(--border);
}
.kpi-label {
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 6px;
}
.kpi-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.kpi-card.danger .kpi-value { color: var(--danger); }
.kpi-card.success .kpi-value { color: var(--success); }
.kpi-card.warning .kpi-value { color: var(--warning); }
.kpi-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
}
.kpi-sub .up { color: var(--danger); }
.kpi-sub .down { color: var(--success); }

/* ========== 操作按钮 ========== */
.btn {
  border: 1px solid var(--border);
  background: #fff;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all .15s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-light); color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #73d13d; color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #ff4d4f; color: #fff; }
.btn-warning { background: var(--warning); border-color: var(--warning); color: #fff; }
.btn-sm { padding: 3px 10px; font-size: 11px; }
.btn-lg { padding: 9px 22px; font-size: 14px; }
.btn-link {
  background: none; border: none; color: var(--accent);
  cursor: pointer; padding: 0; font-size: 12px;
}
.btn-link:hover { color: var(--accent-light); text-decoration: underline; }
.btn-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* ========== 标签 ========== */
.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 3px;
  font-size: 11px;
  line-height: 18px;
  background: #f0f0f0;
  color: #595959;
  border: 1px solid transparent;
}
.tag-red { background: var(--danger-bg); color: var(--danger); border-color: #ffa39e; }
.tag-orange { background: var(--warning-bg); color: var(--warning); border-color: #ffd591; }
.tag-green { background: var(--success-bg); color: var(--success); border-color: #b7eb8f; }
.tag-blue { background: var(--accent-bg); color: var(--accent); border-color: #91d5ff; }
.tag-gray { background: #f0f0f0; color: #595959; border-color: #d9d9d9; }
.tag-purple { background: #f9f0ff; color: #722ed1; border-color: #d3adf7; }

/* ========== 表格 ========== */
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
table.data-table th {
  background: #fafbfc;
  color: var(--text-2);
  font-weight: 500;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f2f5;
  color: var(--text);
}
table.data-table tr:hover td { background: #fafbfc; }
table.data-table tr.danger-row td { background: var(--danger-bg); }
table.data-table tr.warning-row td { background: var(--warning-bg); }

.text-success { color: var(--success); font-weight: 600; }
.text-danger { color: var(--danger); font-weight: 600; }
.text-warning { color: var(--warning); font-weight: 600; }
.text-muted { color: var(--text-3); }

.num { text-align: right; font-variant-numeric: tabular-nums; }
/* 历史快照：表头与单元格统一水平 + 垂直居中对齐；覆盖 .table th/td 与 .num 的默认对齐 */
.table.snapshot-table th,
.table.snapshot-table td { text-align: center !important; vertical-align: middle !important; }
.table.snapshot-table td .tag { display: inline-block; }
/* 放量候选表格：表头与数值统一居中对齐（不影响其他已有表格） */
.table.scale-candidates-table th,
.table.scale-candidates-table td { text-align: center !important; vertical-align: middle !important; }
.table.scale-candidates-table td .tag { display: inline-block; }
/* 回撤总览：表头与数值统一左对齐（覆盖 .table th 默认与 .num 右对齐；不影响其他已有表格） */
.table.clawback-table th,
.table.clawback-table td { text-align: left !important; vertical-align: middle !important; }
.table.clawback-table td .tag { display: inline-block; }
/* 稳健利润：表头左对齐，文本列左对齐，数值列(.num)右对齐并等宽数字（不影响其他已有表格） */
.table.robust-table th { text-align: left !important; vertical-align: middle !important; }
.table.robust-table td { text-align: left !important; vertical-align: middle !important; }
.table.robust-table td.num { font-variant-numeric: tabular-nums; }
/* 表头排序：仅稳健利润表，不影响其他页面 */
.table.robust-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.table.robust-table th.sortable:hover { color: var(--primary); }
.table.robust-table th .sort-arrow { font-size: 9px; margin-left: 3px; color: var(--primary); vertical-align: middle; }
.table.robust-table th .sort-arrow.sort-idle { color: #c5ccd6; }
/* .table td 的 color:var(--text) 优先级高于单类 .text-xxx，须加 !important 才能着色（同 snapshot/roi 表做法）
   仅利润三列(实际利润/稳健利润/日均稳健)用红绿；未核销合计等其余列保持默认黑色 */
.table.robust-table td.text-success { color: var(--success) !important; }
.table.robust-table td.text-danger { color: var(--danger) !important; }
/* 稳健利润：薄利穿透分类标签（红/黄/绿牌） */
.rb-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.rb-red { background: #fff1f0; color: #cf1322; border: 1px solid #ffccc7; }
.rb-yellow { background: #fffbe6; color: #d48806; border: 1px solid #ffe58f; }
.rb-green { background: #f6ffed; color: #389e0d; border: 1px solid #b7eb8f; }
/* 历史快照底部固定总计行 */
.table.snapshot-table tfoot.snapshot-tfoot tr { position: sticky; bottom: 0; z-index: 3; }
.table.snapshot-table tfoot.snapshot-tfoot tr td,
.table.snapshot-table tfoot.snapshot-tfoot tr th { background: #f0f7ff; border-top: 2px solid var(--accent, #1890ff); font-weight: 600; color: var(--text); text-align: center !important; vertical-align: middle !important; }
.table.snapshot-table tfoot.snapshot-tfoot tr td.num { font-variant-numeric: tabular-nums; text-align: center !important; }
/* 提升颜色类优先级，覆盖 .table td 的默认颜色 */
.table.snapshot-table td.text-danger { color: var(--danger) !important; }
.table.snapshot-table td.text-success { color: var(--success) !important; }
/* 账户逐日明细：表头与单元格统一左对齐 */
.account-daily-table th,
.account-daily-table td {
  text-align: left;
}
/* 提升颜色类优先级，覆盖 .table td 的默认颜色 */
.account-daily-table td.text-danger,
.account-perf-table td.text-danger,
.table-compact td.text-danger { color: var(--danger) !important; }
.account-daily-table td.text-success,
.account-perf-table td.text-success,
.table-compact td.text-success { color: var(--success) !important; }

/* ========== 筛选栏 ========== */
.filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}
.filter-bar .filter-label {
  font-size: 12px;
  color: var(--text-2);
}
.filter-bar select,
.filter-bar input {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--text);
  outline: none;
}
.filter-bar select:focus,
.filter-bar input:focus {
  border-color: var(--accent);
}
.filter-divider {
  width: 1px;
  align-self: stretch;
  background: var(--border);
  margin: 0 4px;
}
.sort-dir-btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  line-height: 1.2;
}
.sort-dir-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ========== 分页 ========== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 12px 18px;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
}
.pagination button {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 3px;
  padding: 3px 9px;
  font-size: 12px;
  cursor: pointer;
}
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ========== 列表 (任务/风险) ========== */
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid #f0f2f5;
  cursor: pointer;
}
.list-row:hover { background: #fafbfc; }
.list-row:last-child { border-bottom: none; }
.list-row .num-rank {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.list-row .num-rank.orange { background: var(--warning); }
.list-row .num-rank.gray { background: var(--text-3); }
.list-row .list-title { font-weight: 500; color: var(--text); }
.list-row .list-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.list-row .list-actions { margin-left: auto; }

/* ========== Tab ========== */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
  padding: 0 18px;
}
.tab {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
  border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--accent); }
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 500;
}
.tab-btn {
  padding: 9px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--accent); }
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 500;
}

/* ========== 上传区域 ========== */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: 6px;
  padding: 36px 24px;
  text-align: center;
  background: #fafbfc;
  cursor: pointer;
  transition: all .15s;
}
.upload-area:hover { border-color: var(--accent); background: var(--accent-bg); }
.upload-area.dragover { border-color: var(--accent); background: var(--accent-bg); }
.upload-icon {
  font-size: 40px;
  color: var(--text-3);
  margin-bottom: 8px;
}

/* ========== 警示框 ========== */
.alert {
  padding: 10px 14px;
  border-radius: 4px;
  margin-bottom: 12px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-warning { background: var(--warning-bg); color: var(--warning); }
.alert-error { background: var(--danger-bg); color: var(--danger); }
.alert-danger { background: var(--danger-bg); color: var(--danger); }
.alert-info { background: var(--accent-bg); color: var(--accent); }

/* ========== 决策证据面板 (Section 十一: 8 板块常驻) ========== */
.evidence-panel { position: sticky; top: 12px; }
.evidence-panel .card-body { max-height: calc(100vh - 140px); overflow-y: auto; }
.ev-block { border-left: 3px solid var(--border); padding: 8px 0 8px 10px; margin-bottom: 10px; }
.ev-block .ev-title { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.ev-block .ev-body { font-size: 12px; color: var(--text-2); line-height: 1.7; word-break: break-all; }
.ev-block .ev-body .muted { color: var(--text-3); }
.ev-final { border-left-color: var(--accent); background: var(--accent-bg); border-radius: 0 4px 4px 0; }
.ev-final .ev-action { font-size: 15px; font-weight: 700; color: var(--accent); display: flex; align-items: center; gap: 6px; }

/* ========== 执行弹窗表单 ========== */
.form-grid { display: grid; grid-template-columns: 120px 1fr; gap: 10px 12px; align-items: center; }
.form-grid > label { font-size: 12px; color: var(--text-2); text-align: right; }
.form-grid textarea.input { resize: vertical; line-height: 1.6; padding: 6px 8px; }

/* ========== 工具类 ========== */
.row { display: flex; gap: 16px; align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; }
.row-spread { display: flex; gap: 16px; }
.col { flex: 1; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.text-center { text-align: center; }
.fw-600 { font-weight: 600; }
.fs-12 { font-size: 12px; }
.fs-14 { font-size: 14px; }
.fs-16 { font-size: 16px; }
.empty-state {
  padding: 48px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

/* ========== Loading ========== */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== 响应式 ========== */
@media (max-width: 1280px) {
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 980px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .sidebar { width: 64px; }
  .nav-item span:not(.badge) { display: none; }
  .nav-group-title { display: none; }
  .sidebar-logo .logo-text, .sidebar-logo .logo-sub { display: none; }
}

/* ========== 滚动条美化 ========== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d0d7de; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #b1bac4; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   预览图结构组件(2026-08-04 新增, 配套新 app.js)
   ============================================================ */

/* 顶部操作栏(Dashboard 主页) */
.top-action-bar { display: flex; gap: 12px; margin-bottom: 16px; }

/* 任务行(任务列表+仪表板今日必须处理) */
.task-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f0f2f5; }
.task-row:hover { background: #fafbfc; }
.task-row-left { display: flex; align-items: center; gap: 8px; min-width: 200px; }
.task-row-title { font-weight: 600; color: var(--text); font-size: 13px; }
.task-row-mid { flex: 1; }
.task-row-actions { display: flex; gap: 8px; }

/* 今日必须跟进：结构化分块卡片 */
.mh-item { border: 1px solid #eef1f6; border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; background: #fff; }
.mh-item:hover { box-shadow: 0 2px 8px rgba(20,40,80,0.06); }
.mh-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.mh-head-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mh-problem { font-size: 14px; color: var(--text); }
.mh-unit { white-space: nowrap; }
.mh-rule { white-space: nowrap; }
.mh-date { white-space: nowrap; }
.mh-blocks-top { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.mh-blocks-top .mh-block { flex: 1; min-width: 150px; }
.mh-block { background: #f7f9fc; border: 1px solid #eef1f6; border-radius: 6px; padding: 8px 10px; }
.mh-label { font-size: 12px; color: #8a94a6; font-weight: 600; margin-bottom: 4px; letter-spacing: .3px; }
.mh-val { font-size: 13px; color: #1f2733; line-height: 1.55; word-break: break-word; }
.mh-action, .mh-review { margin-top: 8px; border-radius: 6px; padding: 8px 10px; }
.mh-action { background: #fff7e6; border: 1px solid #ffd591; }
.mh-action .mh-label { color: #d46b08; }
.mh-action .mh-val { color: #ad4e00; font-weight: 600; }
.mh-review { background: #e6f4ff; border: 1px solid #91caff; }
.mh-review .mh-label { color: #1677ff; }
.mh-review .mh-val { color: #0958d9; font-weight: 600; }

/* 动作分布盒(Dashboard 今日系统建议) */
.action-boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.action-box { padding: 14px 16px; border-radius: 6px; display: flex; flex-direction: column; gap: 4px; }
.action-green { background: var(--success-bg); border-left: 3px solid var(--success); }
.action-blue { background: var(--accent-bg); border-left: 3px solid var(--accent); }
.action-orange { background: var(--warning-bg); border-left: 3px solid var(--warning); }
.action-red { background: var(--danger-bg); border-left: 3px solid var(--danger); }
.action-label { font-size: 12px; color: var(--text-2); }
.action-count { font-size: 22px; font-weight: 700; color: var(--text); }

/* 上传文件卡 */
.file-card { display: flex; align-items: flex-start; gap: 16px; padding: 14px; border: 1px solid var(--border); border-radius: 6px; background: #fafbfc; }
.file-icon { font-size: 32px; }
.file-info { flex: 1; min-width: 0; }
.file-status { min-width: 180px; }

/* KPI 列表(上传页右栏) */
.kpi-list { display: flex; flex-direction: column; gap: 8px; }
.kpi-list-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border: 1px solid var(--border); border-radius: 4px; background: #fff; }

/* 数据质量 */
.quality-list { display: flex; flex-direction: column; gap: 8px; padding: 8px 0; }
.quality-item { padding: 8px 12px; border-radius: 4px; font-size: 13px; }
.quality-pass { background: var(--success-bg); color: var(--success); }
.quality-warn { background: var(--warning-bg); color: var(--warning); }

/* 风险摘要搜索表单 */
.risk-summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* 表单段 */
.form-section { padding: 8px 0; }
.form-section-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }

/* 单元详情头部 */
.unit-header { display: flex; align-items: center; gap: 16px; padding: 12px 0; flex-wrap: wrap; margin-bottom: 12px; }
.unit-title-block { flex: 1; min-width: 240px; }
.unit-name { font-size: 18px; font-weight: 700; color: var(--text); }
.unit-desc { font-size: 12px; color: var(--text-2); margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.unit-budget-card { padding: 8px 14px; background: #fafbfc; border: 1px solid var(--border); border-radius: 4px; min-width: 200px; font-size: 12px; line-height: 1.6; }

/* 报告卡 */
.report-card { padding: 24px 18px; text-align: left; cursor: pointer; min-height: 380px; display: flex; flex-direction: column; }
.report-card-active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-bg); }
.report-card-icon { font-size: 40px; margin-bottom: 8px; }
.report-card-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.report-card-desc { font-size: 12px; color: var(--text-2); line-height: 1.6; min-height: 60px; }
.report-card-section { font-size: 12px; color: var(--text-2); margin: 12px 0 4px; font-weight: 500; }
.report-card ul { padding-left: 18px; font-size: 12px; color: var(--text-2); line-height: 1.8; }
.report-card-actions { margin-top: auto; display: flex; gap: 8px; justify-content: flex-start; padding-top: 12px; }

/* 操作前后对比卡 */
.comparison-grid { display: grid; grid-template-columns: 1fr auto 1fr 1fr; gap: 12px; align-items: start; padding: 12px 0; }
.comparison-col { padding: 12px; background: #fafbfc; border: 1px solid var(--border); border-radius: 6px; }
.comparison-arrow { display: flex; align-items: center; justify-content: center; font-size: 24px; color: var(--accent); }
.kpi-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.kpi-strip > div { padding: 6px; background: #fff; border-radius: 4px; border: 1px solid #f0f2f5; }
.kpi-strip > div > div:first-child { font-size: 11px; color: var(--text-3); margin-bottom: 2px; }
.kpi-strip > div > div:last-child { font-size: 14px; font-weight: 600; color: var(--text); }

/* 分页+批量按钮行 */
.pagination-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-top: 1px solid var(--border); }

/* 规则设置左导航 */
.rule-nav { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 8px 0; }
.rule-nav-item { padding: 10px 18px; cursor: pointer; font-size: 13px; color: var(--text-2); border-left: 3px solid transparent; }
.rule-nav-item:hover { background: #fafbfc; color: var(--text); }
.rule-nav-item.active { background: var(--accent-bg); color: var(--accent); border-left-color: var(--accent); font-weight: 500; }

/* 筛选标签(账户分析时间) */
.filter-tab { padding: 6px 12px; cursor: pointer; font-size: 13px; color: var(--text-2); border-radius: 4px; }
.filter-tab:hover { background: var(--accent-bg); color: var(--accent); }
.filter-tab.active { background: var(--accent); color: #fff; }

/* 页头行 + 通用间距类 */
.page-header-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0 12px; }
.ml-8 { margin-left: 8px; } .ml-16 { margin-left: 16px; } .ml-auto { margin-left: auto; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.fs-12 { font-size: 12px; } .fs-14 { font-size: 14px; } .fs-16 { font-size: 16px; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.block { display: block; width: 100%; }

/* ============================================================
   兼容层: 让现有 app.js 的旧类名也呈现新设计
   ============================================================ */
.app-layout { display: flex; height: 100vh; overflow: hidden; min-width: 1024px; background: var(--bg); }
.app-layout > .sider { width: 200px; min-width: 200px; background: var(--primary); color: #fff; flex-shrink: 0; display: flex; flex-direction: column; overflow-y: auto; }
.sider-logo { padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,0.08); font-size: 15px; font-weight: 600; }
.sider-menu { padding: 8px 0; flex: 1; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 12px 20px; cursor: pointer; font-size: 14.5px; color: rgba(255,255,255,0.85); border-left: 3px solid transparent; }
.menu-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.menu-item.active { background: rgba(24,144,255,0.18); color: #fff; border-left-color: var(--accent); }
.menu-icon { width: 18px; text-align: center; opacity: 0.7; }

/* 侧边栏可折叠分组（阶段2 增强：系统配置父菜单 + 子项缩进） */
.menu-group { }
.menu-parent { justify-content: flex-start; font-weight: 500; }
.menu-parent .menu-label { flex: 1; }
.menu-caret { margin-left: auto; width: 0; height: 0; border-left: 9px solid currentColor; border-top: 6.5px solid transparent; border-bottom: 6.5px solid transparent; transition: transform .15s ease; transform: rotate(90deg); }
.menu-caret.open { transform: rotate(-90deg); }
.menu-parent.active-parent { color: #fff; background: rgba(255,255,255,0.04); }
.menu-children { }
.menu-child { padding-left: 46px; font-size: 13.5px; opacity: 0.92; }
.menu-child .menu-icon { opacity: 0.55; }
.app-layout > .main { flex: 1; display: flex; flex-direction: column; min-width: 0; height: 100vh; overflow-y: auto; }
.header { background: #fff; border-bottom: 1px solid var(--border); padding: 14px 24px; display: flex; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 20; }
.header-title { font-size: 16px; font-weight: 600; color: var(--text); flex: none; white-space: nowrap; }
.header-meta { margin-left: auto; color: var(--text-2); font-size: 12px; display: flex; align-items: center; flex-wrap: nowrap; }
.header-meta-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-meta-right { margin-left: auto; display: flex; align-items: center; }
.top-bar { display: flex; align-items: center; gap: 10px; padding: 10px 0; flex-wrap: wrap; }
.top-bar-info { font-size: 12px; color: var(--text-2); }
.content { padding: 20px 24px; flex: 1; overflow: auto; }

/* KPI 卡片 */
.kpi-tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 20px; }
.kpi-tile { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 16px 18px; }
.kt-label { font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.kt-value { font-size: 24px; font-weight: 700; color: var(--text); line-height: 1.2; }
.kt-foot { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.kt-red .kt-value { color: var(--danger); }
.kt-green .kt-value { color: var(--success); }
.kt-blue .kt-value { color: var(--accent); }
.kt-orange .kt-value { color: var(--warning); }
.kt-purple .kt-value { color: #722ed1; }
.kt-gray .kt-value { color: var(--text-3); }
@media (max-width: 1280px) { .kpi-tiles { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 980px) { .kpi-tiles { grid-template-columns: repeat(2, 1fr); } }

/* 英雄区 */
.hero { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); color: #fff; padding: 18px 24px; border-radius: 6px; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.hero-title { font-size: 16px; font-weight: 600; }
.hero-sub { font-size: 12px; opacity: 0.85; margin-top: 4px; }
.hero-concl { background: rgba(255,255,255,0.12); padding: 8px 14px; border-radius: 4px; font-size: 12px; max-width: 600px; }

/* 任务卡 + 账户卡 */
.task-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.task-card { background: #fff; border: 1px solid var(--border); border-left: 3px solid var(--text-3); border-radius: 4px; padding: 12px 14px; }
.task-card.p0 { border-left-color: var(--danger); }
.task-card.p1 { border-left-color: var(--warning); }
.task-card.p2 { border-left-color: var(--accent); }
.task-card.p3 { border-left-color: var(--success); }
.tc-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.tc-name { font-weight: 600; color: var(--text); font-size: 13px; }
.tc-account { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.tc-body { font-size: 12px; line-height: 1.6; }
.tc-row { display: flex; gap: 8px; padding: 3px 0; }
.tc-key { color: var(--text-3); min-width: 56px; flex-shrink: 0; }
.tc-val { color: var(--text); flex: 1; word-break: break-word; }
.tc-problem { color: var(--danger); font-weight: 500; }
.tc-foot { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); display: flex; gap: 8px; justify-content: flex-end; }

.acct-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.acct-card { background: #fafbfc; border: 1px solid var(--border); border-radius: 4px; padding: 12px 14px; }
.ac-name { font-weight: 600; font-size: 13px; margin-bottom: 8px; color: var(--text); }
.ac-kpi { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ac-item { text-align: center; }
.ac-v { font-size: 13px; font-weight: 600; color: var(--text); }
.ac-l { font-size: 10px; color: var(--text-3); margin-top: 2px; }

/* 两列网格 */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }

/* 统计块 */
.stat-blocks { display: flex; gap: 16px; flex-wrap: wrap; }
.stat-block { background: #fafbfc; border-radius: 4px; padding: 10px 16px; min-width: 80px; text-align: center; }
.stat-value { font-size: 18px; font-weight: 600; color: var(--text); }
.stat-label { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; font-size: 12px; }
.table th { background: #fafbfc; color: var(--text-2); font-weight: 500; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid #f0f2f5; color: var(--text); }
.table tr:hover td { background: #fafbfc; }
.table-sm th, .table-sm td { padding: 8px 10px; font-size: 12px; }
/* 今日操作表: 列多, 需要紧凑排版 + 首列吸附 + 横向滚动 */
.table-compact th, .table-compact td { padding: 7px 8px; font-size: 12px; white-space: nowrap; }
.table-compact td.cell-wrap { white-space: normal; max-width: 220px; line-height: 1.45; color: var(--text-2); word-break: break-word; overflow-wrap: anywhere; }
/* 今日待办「判断依据」长文本列：min-width 防止被挤到一字一行竖排，max-width 控制单格阅读宽度 */
.table-compact td.cell-wrap.fs-12 { min-width: 200px; max-width: 360px; line-height: 1.55; vertical-align: top; }
/* 判断依据四段(问题量化/根因定位/具体动作/复查标准)各起一行，段名加粗 */
.table-compact td.cell-wrap .rec-seg { margin-bottom: 4px; line-height: 1.5; }
.table-compact td.cell-wrap .rec-seg:last-child { margin-bottom: 0; }
.table-compact td.cell-wrap .rec-label { font-weight: 600; color: var(--text); }
.table-compact td .cell-3lines {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: 204px;
  line-height: 1.45;
  color: var(--text-2);
  word-break: break-all;
}
.table-compact tbody tr.row-p0 td { background: #fff1f0; }
.table-compact tbody tr.row-p0:hover td { background: #ffe4e1; }
.table-compact tbody tr.row-p0 td:first-child { box-shadow: inset 3px 0 0 var(--danger, #f5222d); }
/* 推广单元页表格底部固定总计行: 不随分页变化, 始终吸附在可视区域底部 */
.table-compact tfoot tr.total-row { position: sticky; bottom: 0; z-index: 3; }
.table-compact tfoot tr.total-row td { background: #f0f7ff; border-top: 2px solid var(--accent, #1890ff); font-weight: 600; color: var(--text); }
.table-compact tfoot tr.total-row td.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); font-weight: 400; }

/* 卡片 */
.card { background: var(--card-bg); border-radius: 6px; border: 1px solid var(--border); margin-bottom: 16px; }
.card-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.card-header h3, .card-title { font-size: 14px; font-weight: 600; color: var(--text); margin: 0; }
.card-body { padding: 18px; }
.card-body.no-padding { padding: 0; }
.card-extra { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* 标签 */
.tag { display: inline-block; padding: 1px 8px; border-radius: 3px; font-size: 11px; line-height: 18px; background: #f0f0f0; color: #595959; border: 1px solid transparent; }
.tag-red { background: var(--danger-bg); color: var(--danger); border-color: #ffa39e; }
.tag-orange { background: var(--warning-bg); color: var(--warning); border-color: #ffd591; }
.tag-green { background: var(--success-bg); color: var(--success); border-color: #b7eb8f; }
.tag-blue { background: var(--accent-bg); color: var(--accent); border-color: #91d5ff; }
.tag-gray { background: #f0f0f0; color: #595959; border-color: #d9d9d9; }
.tag-purple { background: #f9f0ff; color: #722ed1; border-color: #d3adf7; }

/* 按钮 */
.btn { border: 1px solid var(--border); background: #fff; padding: 6px 14px; border-radius: 4px; cursor: pointer; font-size: 12px; color: var(--text); display: inline-flex; align-items: center; gap: 4px; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-light); color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); border-color: var(--warning); color: #fff; }
.btn-sm { padding: 3px 10px; font-size: 11px; }
.btn-lg { padding: 9px 22px; font-size: 14px; }
.btn-link { background: none; border: none; color: var(--accent); cursor: pointer; padding: 0; font-size: 12px; }
.btn-link:hover { color: var(--accent-light); }

/* 表单 */
.input, input[type=text], input[type=number], input[type=date], input[type=search] { border: 1px solid var(--border); background: #fff; border-radius: 4px; padding: 6px 10px; font-size: 12px; color: var(--text); outline: none; }
.input:focus, input:focus { border-color: var(--accent); }
select { border: 1px solid var(--border); background: #fff; border-radius: 4px; padding: 5px 10px; font-size: 12px; color: var(--text); }
.form-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.form-label { color: var(--text-2); font-size: 12px; min-width: 100px; }

/* 加载 + 空态 */
.spinner, .spinner-wrap { display: inline-block; width: 24px; height: 24px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.empty { padding: 32px; text-align: center; color: var(--text-3); font-size: 13px; }

/* 模态 */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.45); display: none; align-items: center; justify-content: center; z-index: 999; }
.modal-overlay.show { display: flex; }
.modal { background: #fff; border-radius: 6px; width: 90%; max-width: 820px; max-height: 90vh; display: flex; flex-direction: column; }
.modal-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-weight: 600; font-size: 14px; }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-3); }
.modal-body { padding: 18px; overflow: auto; flex: 1; }

/* 工具类 */
.flex { display: flex; gap: 12px; align-items: center; }
.flex-col { display: flex; flex-direction: column; gap: 12px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.ml-auto { margin-left: auto; }
.text-success { color: var(--success); font-weight: 600; }
.text-danger { color: var(--danger); font-weight: 600; }
.text-warning { color: var(--warning); font-weight: 600; }
.text-muted { color: var(--text-3); }
.font-bold { font-weight: 600; }
.text-center { text-align: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }

/* 时间线 */
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding: 8px 0 8px 0; }
.timeline-item::before { content: ''; position: absolute; left: -17px; top: 14px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--accent); }
.timeline-time { font-size: 11px; color: var(--text-3); }
.timeline-title { font-weight: 500; font-size: 12px; }
.timeline-desc { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* 上传区域 */
.upload-zone { border: 2px dashed var(--border); border-radius: 6px; padding: 36px 24px; text-align: center; background: #fafbfc; cursor: pointer; }
.upload-zone:hover { border-color: var(--accent); background: var(--accent-bg); }
.upload-zone .upload-icon { font-size: 40px; color: var(--text-3); margin-bottom: 8px; }

/* 状态机 stepper */
.stepper { display: flex; align-items: flex-start; background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 16px 20px; }
.step { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; }
.step-dot { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; background: var(--bg-2); color: var(--text-3); border: 2px solid var(--border); z-index: 2; }
.step-label { margin-top: 8px; font-size: 12px; color: var(--text-3); }
.step-bar { position: absolute; top: 13px; left: 50%; width: 100%; height: 2px; background: var(--border); z-index: 1; }
.step.current .step-dot { background: var(--accent); color: #fff; border-color: var(--accent); }
.step.current .step-label { color: var(--accent); font-weight: 600; }
.step.done .step-dot { background: var(--success); color: #fff; border-color: var(--success); }
.step.done .step-label { color: var(--text-2); }
.step.done .step-bar, .step.current .step-bar { background: var(--success); }
/* 报告预览（与导出同源） */
.row-flex { display: flex; align-items: center; }
.table-wrap { overflow-x: auto; }
.prev-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 12px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 6px; margin-bottom: 12px; }
.prev-sec { margin-bottom: 18px; }
.prev-sec-title { font-weight: 600; font-size: 13px; padding: 6px 10px; background: #f0f3f8; border-left: 3px solid var(--accent); border-radius: 3px; margin-bottom: 8px; }

/* 回本率统计专用样式 */
.roi-table-wrap { border-radius: 0 0 6px 6px; overflow-x: auto; }
.roi-table {
  table-layout: fixed;
  min-width: 1160px;
  width: 100%;
  border-collapse: collapse;
}
.roi-table th {
  background: #f6f8fb;
  font-weight: 600;
  color: var(--text-2);
  position: sticky;
  top: 0;
  z-index: 2;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 7px 6px;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.roi-table th:hover { background: #eef1f6; }
.roi-table td {
  vertical-align: middle;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 7px 6px;
  white-space: nowrap;
  border-bottom: 1px solid #f0f2f5;
}
.roi-th-center, .roi-td-center { text-align: center; }
.roi-th-right, .roi-td-right { text-align: right; }
.roi-th-left, .roi-td-left { text-align: left; }
/* 回本率表格所有列统一居中，表头与单元格使用一致的内边距，避免视觉偏移 */
.roi-table th,
.roi-table td {
  padding: 7px 6px;
}
/* 提升颜色类优先级，覆盖 .table td 的默认颜色 */
.roi-table td.text-danger { color: var(--danger) !important; }
.roi-table td.text-success { color: var(--success) !important; }
.roi-cell-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.roi-row { cursor: pointer; }
.roi-row:hover td { background: #f6f8fb; }
.roi-total-row td {
  background: #fafbfc;
  border-top: 2px solid var(--border);
  font-weight: 600;
  color: var(--text);
  position: sticky;
  bottom: 0;
}
.roi-total-row:hover td { background: #f0f2f5; }

/* ========== 操作记录筛选与多选下拉 ========== */
.op-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}
.op-filter-label {
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
}
.op-filter-date {
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
  color: var(--text);
  background: #fff;
}
.op-filter-sep {
  color: var(--text-3);
  font-size: 12px;
}
.op-filter-select {
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
  color: var(--text);
  background: #fff;
}
.ml-12 { margin-left: 12px; }
.multi-select {
  position: relative;
  display: inline-block;
}
.multi-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 100;
  min-width: 160px;
  max-height: 260px;
  overflow-y: auto;
  margin-top: 4px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.multi-select-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.multi-select-item:hover { background: var(--accent-bg); }
.multi-select-item input { margin: 0; }

/* ========== 单元详情：两栏布局固定与操作记录表格换行 ========== */
.unit-detail-grid {
  align-items: start;
}
.unit-detail-grid > div:first-child {
  min-width: 0;
  overflow: hidden;
}

/* 操作记录表格固定布局，防止 URL 超长撑破 */
.op-record-table {
  table-layout: fixed;
  width: 100%;
}
.op-record-table th,
.op-record-table td {
  vertical-align: top;
}
.op-record-table th { white-space: nowrap; }
/* 列宽：时间 110 / 维度 70 / 动作 70 / 类型 95 / 旧值 65 / 新值 65 / 详情 剩余 */
.op-record-table th:nth-child(1),
.op-record-table td:nth-child(1) { width: 110px; }
.op-record-table th:nth-child(2),
.op-record-table td:nth-child(2) { width: 70px; }
.op-record-table th:nth-child(3),
.op-record-table td:nth-child(3) { width: 70px; }
.op-record-table th:nth-child(4),
.op-record-table td:nth-child(4) { width: 95px; }
.op-record-table th:nth-child(5),
.op-record-table td:nth-child(5) { width: 65px; }
.op-record-table th:nth-child(6),
.op-record-table td:nth-child(6) { width: 65px; }
.op-record-table th:nth-child(7),
.op-record-table td:nth-child(7) { width: auto; }

.op-record-table td {
  word-break: break-word;
  overflow-wrap: break-word;
}
.op-record-table td.cell-detail {
  word-break: break-all;
  line-height: 1.5;
  color: var(--text-2);
  max-width: 100%;
}

/* ========== 通用链接样式（查看详情等） ========== */
.link {
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
}
.link:hover { text-decoration: underline; }

/* ========== 消息中心（铃铛） ========== */
.msg-bell-wrap { position: relative; display: inline-block; }
.msg-bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; cursor: pointer; font-size: 18px; line-height: 1; transition: background .15s; }
.msg-bell:hover { background: rgba(24,144,255,0.10); }
.msg-bell.has-unread { animation: bell-shake 1.6s ease-in-out infinite; }
@keyframes bell-shake { 0%,60%,100% { transform: rotate(0); } 65% { transform: rotate(12deg); } 75% { transform: rotate(-10deg); } 85% { transform: rotate(8deg); } 95% { transform: rotate(-6deg); } }
.msg-bell-badge { position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10px; line-height: 16px; text-align: center; box-shadow: 0 0 0 2px #fff; }
.msg-panel { position: absolute; right: 0; top: calc(100% + 8px); width: 380px; max-width: 92vw; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 28px rgba(20,40,80,0.18); z-index: 1000; overflow: hidden; }
.msg-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.msg-panel-title { font-size: 14px; font-weight: 600; color: var(--text); }
.msg-panel-tabs { display: flex; align-items: center; gap: 6px; }
.msg-tab { font-size: 12px; color: var(--text-2); padding: 2px 8px; border-radius: 4px; cursor: pointer; }
.msg-tab.active { background: var(--accent-bg); color: var(--accent); }
.msg-panel-body { max-height: 360px; overflow-y: auto; padding: 4px 0; }
.msg-item { padding: 10px 14px; border-bottom: 1px solid #f0f2f5; }
.msg-item.unread { background: #f6fbff; }
.msg-item.read { opacity: 0.62; }
.msg-item-top { display: flex; align-items: center; gap: 8px; }
.msg-item-title { font-weight: 600; font-size: 13px; color: var(--text); flex: 1; }
.msg-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); flex-shrink: 0; }
.msg-item-content { font-size: 12px; color: var(--text-2); line-height: 1.6; margin-top: 6px; }
.msg-item-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.msg-panel-foot { padding: 10px 14px; border-top: 1px solid var(--border); text-align: right; }

/* 首页轻弹窗（非阻断、居中偏上、当日仅弹一次） */
.holiday-popup { position: fixed; top: 84px; left: 50%; transform: translateX(-50%); z-index: 1100; }
.holiday-popup-card { width: 380px; max-width: 92vw; background: #fff; border: 1px solid var(--border); border-top: 3px solid var(--accent); border-radius: 8px; box-shadow: 0 10px 30px rgba(20,40,80,0.20); padding: 16px 18px; animation: pop-in .2s ease; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.holiday-popup-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.holiday-popup-badge { font-size: 12px; color: var(--accent); font-weight: 600; }
.holiday-popup-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.holiday-popup-content { font-size: 13px; color: var(--text-2); line-height: 1.7; margin-bottom: 14px; }
.holiday-popup-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* 今日必须跟进中的节假日条目 */
.mh-item.mh-holiday { border-left: 3px solid var(--accent); background: #f6fbff; }

/* ========== 节假日管理页 ========== */
.holiday-rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; padding: 16px; }
.rule-card { border: 1px solid var(--border); border-radius: 6px; padding: 14px; background: #fff; }
.rule-card-head { display: flex; align-items: center; justify-content: space-between; }
.rule-name { font-weight: 600; font-size: 13px; color: var(--text); }
.rule-card-sub { font-size: 11px; color: var(--text-3); margin: 2px 0 10px; font-family: monospace; }
.rule-card-foot { margin-top: 10px; text-align: right; }
.switch { position: relative; display: inline-block; width: 38px; height: 20px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track { position: absolute; left: 0; top: 0; right: 0; bottom: 0; background: #d9d9d9; border-radius: 20px; transition: .2s; cursor: pointer; }
.switch-track::before { content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::before { transform: translateX(18px); }

/* 节假日基础库操作列：编辑/删除按钮间距与分隔，扩大点击区避免误触 */
.holiday-op { display: inline-flex; align-items: center; gap: 8px; }
.holiday-op .btn-link { position: relative; padding: 4px 9px; border-radius: 4px; line-height: 1.4; }
.holiday-op .btn-link:hover { background: var(--accent-bg); text-decoration: none; }
.holiday-op .btn-link + .btn-link::before {
  content: ''; position: absolute; left: -5px; top: 50%; transform: translateY(-50%);
  width: 1px; height: 13px; background: var(--border);
}
.holiday-op .btn-danger-link { color: var(--danger); }
.holiday-op .btn-danger-link:hover { background: var(--danger-bg); }

/* 提醒规则配置卡片：内容模板文本域观感优化 */
.rule-card .form-row { align-items: flex-start; }
.rule-card .form-label { padding-top: 8px; }
.rule-card textarea.input,
.rule-textarea {
  width: 100%;
  min-height: 80px;
  padding: 8px 10px;
  line-height: 1.7;
  font-size: 12px;
  color: var(--text);
  resize: vertical;
  border-radius: 4px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
}

/* ===== 已完成上传任务列表(数据上传中心, 纯新增) ===== */
.batch-list {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  font-size: 12px;
}
.batch-head, .batch-row {
  display: grid;
  grid-template-columns: 64px 90px 88px 150px 1fr 1fr 130px;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
}
.batch-head {
  background: var(--bg-2, #f5f7fa);
  color: var(--text-muted, #8a93a6);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.batch-row {
  border-bottom: 1px solid var(--border);
}
.batch-row:last-child { border-bottom: none; }
.batch-row:hover { background: var(--bg-2, #f5f7fa); }
.batch-id { font-weight: 600; color: var(--text); }
.batch-list .badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  line-height: 18px;
  white-space: nowrap;
}
.badge-inc { background: #e6f7ff; color: #1890ff; }
.badge-full { background: #fff7e6; color: #fa8c16; }
.badge-done { background: #f6ffed; color: #52c41a; }
.badge-rolled { background: #f0f0f0; color: #8c8c8c; }
.badge-warn { background: #fff1f0; color: #ff4d4f; }

/* 经营总览第二排: 行动清单+系统建议 两列等高对齐, 行动清单内部固定高度+滚动显示, Tab 外置 */
.dashboard-second-row { align-items: stretch; }
.dashboard-half-card { display: flex; flex-direction: column; height: 620px; }
.dashboard-half-card > .card-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.dashboard-half-card .al-container { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.dashboard-half-card .al-tabs { flex: 0 0 auto; padding-bottom: 6px; }
.dashboard-half-card .al-scroll { flex: 1 1 auto; overflow-y: auto; min-height: 0; padding-right: 4px; }
/* 内滚滚动条加宽加显眼, 配合顶部"共X条"提示让用户知道可滚 */
.dashboard-half-card .al-scroll::-webkit-scrollbar { width: 6px; }
.dashboard-half-card .al-scroll::-webkit-scrollbar-thumb { background: #c1c9d2; border-radius: 3px; }
.dashboard-half-card .al-scroll::-webkit-scrollbar-track { background: transparent; }

/* 单元异动报警区块(今日行动清单卡片顶部, 独立于建议引擎, 仅提醒) */
.anomaly-banner { margin: 0 0 14px; border: 1px solid #ffd591; border-left: 4px solid #fa8c16; border-radius: 10px; background: #fffdf7; padding: 10px 14px; }
.anomaly-banner-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #d46b08; margin-bottom: 8px; }
.anomaly-banner-head .dot { width: 7px; height: 7px; border-radius: 50%; background: #fa8c16; display: inline-block; }
.anomaly-banner-head .more { margin-left: auto; font-size: 12px; font-weight: 400; color: #1890ff; cursor: pointer; }
.anomaly-rows { display: flex; flex-direction: column; gap: 6px; }
.anomaly-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; background: #fff7e6; }
.anomaly-row:hover { background: #fff1e0; }
.anomaly-badge { flex: 0 0 auto; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 10px; color: #fff; }
.anomaly-unit { flex: 0 0 auto; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: #333; }
.anomaly-type { flex: 0 0 auto; color: #666; }
.anomaly-content { flex: 1 1 auto; color: #555; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anomaly-jump { flex: 0 0 auto; font-size: 12px; color: #1890ff; cursor: pointer; }
.anomaly-more { font-size: 12px; color: #999; padding-top: 4px; }
.sev-P0 .anomaly-badge { background: #f5222d; }
.sev-P1 .anomaly-badge { background: #fa8c16; }
.sev-P2 .anomaly-badge { background: #1890ff; }


/* ===================== RangePicker 双月范围日历 ===================== */
.range-picker { position: relative; display: inline-block; vertical-align: middle; }
.rp-trigger { display: flex; align-items: center; min-width: 200px; cursor: pointer; user-select: none; box-sizing: border-box; }
.rp-trigger.is-open { border-color: var(--accent); }
.rp-value { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-placeholder { color: #bfbfbf; }
.rp-popup {
  position: absolute; z-index: 1200; top: calc(100% + 4px); left: 0;
  background: #fff; border: 1px solid var(--border); border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0,0,0,.12); padding: 8px 10px 10px;
}
.rp-header { display: flex; justify-content: space-between; margin-bottom: 4px; }
.rp-nav { width: 28px; height: 24px; border: 1px solid var(--border); background: #fff; border-radius: 4px; cursor: pointer; font-size: 14px; line-height: 1; color: var(--text); }
.rp-nav:hover { border-color: var(--accent); color: var(--accent); }
.rp-months { display: flex; gap: 14px; }
.rp-month { width: 210px; }
.rp-month-title { text-align: center; font-size: 13px; font-weight: 600; padding: 2px 0 6px; color: var(--text); }
.rp-weekdays, .rp-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.rp-weekdays { margin-bottom: 2px; }
.rp-wd { text-align: center; font-size: 11px; color: #8c8c8c; padding: 2px 0; }
.rp-cell { text-align: center; font-size: 12px; padding: 5px 0; cursor: pointer; border-radius: 4px; color: var(--text); }
.rp-cell.empty { cursor: default; }
.rp-cell:hover:not(.disabled):not(.empty) { background: #e6f0ff; }
.rp-cell.in-range { background: #eaf3ff; border-radius: 0; }
.rp-cell.in-range.preview { background: #f0f6ff; }
.rp-cell.start, .rp-cell.end { background: var(--accent); color: #fff; }
.rp-cell.start { border-radius: 4px 0 0 4px; }
.rp-cell.end { border-radius: 0 4px 4px 0; }
.rp-cell.start.end { border-radius: 4px; }
.rp-cell.disabled { color: #d0d0d0; cursor: not-allowed; }
.rp-footer { text-align: right; margin-top: 6px; padding-top: 6px; border-top: 1px solid #f0f0f0; }

/* ===================== 登录页 / 用户菜单（阶段2 纯新增） ===================== */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #eaf3ff 0%, #f4f6fa 100%); }
.login-card { width: 440px; background: #fff; border-radius: 14px; box-shadow: 0 8px 30px rgba(24, 144, 255, 0.12); padding: 48px 44px; text-align: center; }
.login-loading { color: var(--text-2); font-size: 14px; }
.login-logo { font-size: 26px; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.login-sub { font-size: 14px; color: var(--text-3); margin-bottom: 26px; }
.login-hint { font-size: 13px; color: var(--text-2); background: var(--accent-bg); border-radius: 6px; padding: 10px 12px; margin-bottom: 18px; }
.login-input { width: 100%; height: 46px; border: 1px solid var(--border); border-radius: 6px; padding: 0 14px; font-size: 15px; margin-bottom: 16px; outline: none; transition: border-color .15s; box-sizing: border-box; }
.login-input:focus { border-color: var(--accent); }
.login-err { color: #e53935; font-size: 14px; margin: -6px 0 14px; text-align: left; }
.login-btn { width: 100%; height: 48px; font-size: 16px; letter-spacing: 4px; }

/* 顶栏用户菜单 */
.user-menu { position: relative; display: inline-block; }
/* 账户头像（样式A：圆头像首字母，钉在顶栏最右，与铃铛同行） */
.user-chip { display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 4px 10px 4px 4px; border-radius: 18px; transition: background .15s; }
.user-chip:hover { background: var(--accent-bg); }
.user-avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, #3b82f6, #7c3aed); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex: none; }
.user-name { font-size: 13px; color: var(--text); }
.user-caret { font-size: 10px; color: var(--text-2); }
.user-menu-dropdown { position: absolute; right: 0; top: 40px; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12); min-width: 120px; z-index: 50; overflow: hidden; }
.user-menu-item { padding: 10px 16px; font-size: 13px; color: var(--text); cursor: pointer; white-space: nowrap; }
.user-menu-item:hover { background: var(--accent-bg); color: var(--accent); }

/* 修改密码表单行 */
.form-row { display: flex; align-items: center; margin-bottom: 14px; }
.form-row label { width: 130px; font-size: 13px; color: var(--text-2); text-align: right; padding-right: 12px; flex: none; }
.form-row .login-input { margin-bottom: 0; flex: 1; }

/* 密码框小眼睛切换（阶段2 增强：默认值隐藏 + 可查看） */
.login-pw-wrap { position: relative; width: 100%; margin-bottom: 16px; }
.form-row .login-pw-wrap { flex: 1; margin-bottom: 0; }
.login-pw-wrap .login-input { width: 100%; padding-right: 38px; margin-bottom: 0; }
.pw-eye { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); cursor: pointer; user-select: none; font-size: 16px; line-height: 1; color: var(--text-2); z-index: 2; }
.pw-eye:hover { color: var(--accent); }

/* 佣金回撤卡悬浮弹窗 */
.claw-card { overflow: visible; }
.claw-pop {
  position: absolute; top: 100%; left: 0; z-index: 999;
  width: 470px; max-width: 92vw;
  background: #ffffff; border: 1px solid #e3e3e8;
  border-radius: 10px; padding: 12px 14px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.18);
}
.claw-pop::before { content: ''; position: absolute; top: -12px; left: 0; right: 0; height: 12px; }
.claw-pop-title { font-size: 13px; font-weight: 500; color: var(--text-1); margin-bottom: 10px; }
.claw-pop-row { display: flex; align-items: baseline; gap: 8px; padding: 5px 0; border-top: 1px solid var(--border-3); font-size: 13px; }
.claw-pop-unit { flex: 0 0 auto; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-1); }
.claw-pop-amt { flex: 0 0 auto; color: #e63946; font-weight: 500; }
.claw-pop-empty { font-size: 13px; color: var(--text-3); padding: 6px 0; }
.claw-pop-head { display: grid; grid-template-columns: minmax(0,1fr) 92px 52px 152px; gap: 8px; padding: 4px 0 6px; font-size: 12px; color: var(--text-3); border-bottom: 1px solid var(--border-3); }
.claw-pop-head span { text-align: center; white-space: nowrap; }
.claw-pop-body { max-height: 580px; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.claw-pop-row { display: grid; grid-template-columns: minmax(0,1fr) 92px 52px 152px; gap: 8px; align-items: baseline; padding: 5px 0; border-bottom: 1px solid var(--border-3); font-size: 13px; }
.claw-pop-unit { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-1); text-align: center; }
.claw-pop-amt, .claw-pop-n, .claw-pop-date { text-align: center; }
.claw-pop-amt, .claw-pop-amt-inline { color: #e63946; font-weight: 500; }
.claw-pop-n { color: var(--text-2); }
.claw-pop-date { color: var(--text-2); }
.claw-pop-foot { margin-top: 10px; font-size: 12px; color: var(--text-3); }
