:root {
  --blue: #1A4FA0;
  --blue-dark: #0D2B6A;
  --orange: #E8601C;
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2733;
  --muted: #7a8699;
  --border: #e5e9f2;
  --green: #1a9e5c;
  --red: #d9363e;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

/* 顶栏 */
.topbar {
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  color: #fff;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--orange); display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px; color: #fff;
}
.topbar h1 { font-size: 20px; font-weight: 700; }
.topbar .sub { font-size: 12px; opacity: .85; margin-top: 2px; }

/* 汉堡菜单按钮：默认隐藏，移动端显示 */
.menu-toggle {
  display: none; background: none; border: none; color: #fff;
  font-size: 24px; cursor: pointer; padding: 4px 8px; line-height: 1;
}

/* 布局 */
.layout { display: flex; min-height: calc(100vh - 76px); }
.sidebar {
  width: 200px; background: var(--card); border-right: 1px solid var(--border);
  padding: 16px 0; flex-shrink: 0;
}
.nav-item {
  padding: 13px 20px; cursor: pointer; font-size: 14px; color: var(--muted);
  border-left: 3px solid transparent; transition: all .15s;
}
.nav-item:hover { background: #f0f4fb; color: var(--text); }
.nav-item.active { color: var(--blue); font-weight: 600; border-left-color: var(--blue); background: #eef3fc; }

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

/* 卡片 */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.card-num { font-size: 30px; font-weight: 800; color: var(--blue); }
.card-label { color: var(--muted); font-size: 13px; margin-top: 4px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.panel {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 20px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.panel h3 { font-size: 16px; margin-bottom: 14px; color: var(--blue-dark); }
.panel .sub { color: var(--muted); font-size: 13px; margin-bottom: 14px; }

/* 按钮 */
.btn {
  display: inline-block; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; color: var(--text); cursor: pointer; font-size: 14px; transition: all .15s;
}
.btn:hover { border-color: var(--blue); color: var(--blue); }
.btn-primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-primary:hover { background: var(--blue-dark); color: #fff; }
.top-actions .btn-primary { background: var(--orange); border-color: var(--orange); }
.top-actions .btn-primary:hover { background: #d05218; }

/* 筛选栏 */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px;
}
.filter-bar input, .filter-bar select, .form-row input, .form-row select {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px;
}
.filter-bar input[type=number] { width: 100px; }
.chk { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; cursor: pointer; }
/* .form-row input 会把复选框也撑到 200px 宽，标签被推得老远——这里收回 */
.form-row input[type=checkbox], .form-row input[type=radio] {
  flex: 0 0 auto; min-width: 0; width: 16px; height: 16px;
  padding: 0; accent-color: var(--blue); cursor: pointer;
}

/* 线索池三档切换 */
.seg {
  display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 14px;
  background: #f2f4f8; border-radius: 10px;
}
.seg-btn {
  border: 0; background: transparent; padding: 8px 16px; border-radius: 8px;
  font-size: 14px; color: var(--muted); cursor: pointer; font-family: inherit;
  transition: background .15s, color .15s;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.seg-n { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 2px; }
.seg-btn.active .seg-n { color: var(--orange); }

/* 线索分类标签栏 */
.cat-tabs { margin-bottom: 14px; }
.cat-tab-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.cat-tab-label { color: var(--muted); font-size: 13px; font-weight: 600; }
.cat-tab-group { display: inline-flex; }
.cat-tab {
  border: 1px solid var(--border); background: #fff; padding: 5px 14px;
  font-size: 13px; color: var(--muted); cursor: pointer; font-family: inherit;
  border-radius: 999px; transition: all .15s;
}
.cat-tab:hover { color: var(--text); border-color: var(--orange); }
.cat-tab.active { background: var(--orange); border-color: var(--orange); color: #fff; font-weight: 600; }
.cat-tab-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cat-chip {
  border: 1px solid var(--border); background: #f7f9fc; padding: 5px 12px;
  font-size: 13px; color: var(--text); cursor: pointer; font-family: inherit;
  border-radius: 999px; transition: all .15s;
}
.cat-chip:hover { border-color: var(--orange); }
.cat-chip.active { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }


/* AI 适配列 */
.fit-cell { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.fit-badge {
  min-width: 34px; text-align: center; padding: 2px 7px; border-radius: 6px;
  font-size: 12px; font-weight: 700;
}
.fit-hi { background: #e8f8ef; color: #0e7a48; }
.fit-mid { background: #fff4e6; color: #b8791a; }
.fit-lo { background: #f2f2f2; color: #999; }
.fit-type { font-size: 12px; color: var(--text); }


/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
th { background: #f7f9fc; color: var(--muted); font-weight: 600; white-space: nowrap; }
tbody tr:hover { background: #fafbfe; }

/* 阶段徽章 */
.badge { padding: 3px 10px; border-radius: 20px; font-size: 12px; white-space: nowrap; }
.stage-新线索 { background: #eef3fc; color: var(--blue); }
.stage-已触达 { background: #fff3e8; color: var(--orange); }
.stage-体检中 { background: #fef3e2; color: #b8791a; }
.stage-已报价 { background: #e8f4fd; color: #0d6ea8; }
.stage-陪跑中 { background: #e8f8ef; color: var(--green); }
.stage-已续费 { background: #e2f7eb; color: #0e7a48; }
.stage-已流失 { background: #f5f5f5; color: #999; }

/* 意向分数条 */
.score-bar { width: 60px; height: 6px; background: #eef0f4; border-radius: 3px; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 6px; }
.score-bar > span { display: block; height: 100%; background: var(--orange); }

/* 报告输出 */
.report-out {
  background: #1e1e2e; color: #d4d4e0; border-radius: 10px; padding: 20px;
  margin-top: 16px; white-space: pre-wrap; font-size: 13px; line-height: 1.7;
  max-height: 520px; overflow: auto; font-family: "Consolas", "Courier New", monospace;
}

/* 表单行 */
.form-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.form-row input { flex: 1; min-width: 200px; }
.form-row input[type=number] { flex: 0 0 130px; }

/* 话术卡 */
.script-card {
  border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 12px;
  background: #fff; cursor: pointer; transition: all .15s;
}
.script-card:hover { border-color: var(--blue); box-shadow: 0 2px 8px rgba(26,79,160,.08); }
.script-card .tag { color: var(--orange); font-weight: 700; font-size: 13px; }
.script-card p { margin-top: 6px; color: var(--text); line-height: 1.6; }

/* 删除按钮 */
.btn-del {
  border: none; background: none; color: var(--muted); cursor: pointer;
  font-size: 13px; padding: 2px 6px; margin-left: 4px; border-radius: 4px;
}
.btn-del:hover { color: var(--red); background: #fdecec; }

/* 提示 */
.hint { color: var(--muted); font-size: 13px; margin-top: 12px; padding: 10px 14px; background: #f7f9fc; border-radius: 8px; }
.muted { color: var(--muted); font-size: 12px; }

/* 分布条 */
.dist-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.dist-label { width: 90px; color: var(--muted); font-size: 13px; text-align: right; }
.dist-bar { flex: 1; height: 18px; background: #eef0f4; border-radius: 9px; overflow: hidden; }
.dist-bar > span { display: block; height: 100%; background: var(--blue); border-radius: 9px; }
.dist-num { width: 40px; font-size: 13px; font-weight: 600; color: var(--text); }

.table-plain th { white-space: normal; }

/* AI 推荐结果卡 */
.rec-result { margin-top: 16px; }
.rec-card { border: 1px solid var(--border); border-radius: 12px; padding: 20px; background: #fff; }
.rec-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.rec-product { background: var(--blue); color: #fff; padding: 6px 16px; border-radius: 20px; font-weight: 700; font-size: 15px; }
.rec-price { color: var(--orange); font-weight: 700; font-size: 16px; }
.rec-reason { color: var(--text); font-size: 14px; line-height: 1.7; margin-bottom: 12px; }
.rec-roles { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.rec-roles .role-chip { background: #eef3fc; color: var(--blue); padding: 4px 12px; border-radius: 16px; font-size: 13px; }
.rec-script { background: #f7f9fc; border-left: 3px solid var(--blue); padding: 14px; border-radius: 8px; color: var(--text); font-size: 14px; line-height: 1.7; margin-bottom: 12px; }
.rec-next { color: var(--green); font-size: 14px; font-weight: 600; }

/* 陪跑作业 */
.pp-phase { margin-bottom: 20px; }
.pp-phase-title { font-size: 15px; font-weight: 700; color: var(--blue-dark); margin-bottom: 10px; padding: 8px 14px; background: #eef3fc; border-radius: 8px; display: flex; align-items: center; justify-content: space-between; }
.pp-phase-title .pp-count { font-size: 12px; color: var(--muted); font-weight: 400; }
.pp-task { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; background: #fff; cursor: pointer; transition: all .15s; }
.pp-task:hover { border-color: var(--blue); }
.pp-task.done { opacity: .65; }
.pp-task.done .pp-task-name { text-decoration: line-through; color: var(--muted); }
.pp-check { width: 20px; height: 20px; border: 2px solid var(--border); border-radius: 5px; flex-shrink: 0; margin-top: 1px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; }
.pp-task.done .pp-check { background: var(--green); border-color: var(--green); }
.pp-task-body { flex: 1; }
.pp-task-name { font-size: 14px; color: var(--text); font-weight: 500; }
.pp-task-deliverable { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* 演示案例模块 */
.demo-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 20px 22px; background: linear-gradient(135deg,#eef4ff 0%,#f7faff 55%,#fff 100%); border: 1px solid #dbe5f5; border-radius: 14px; }
.demo-hero-left { display: flex; align-items: center; gap: 16px; flex: 1; min-width: 300px; }
.demo-hero-phone { width: 58px; height: 58px; border-radius: 14px; background: var(--blue); color: #fff; font-size: 28px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 6px 16px rgba(26,79,160,0.28); }
.demo-hero-body h3 { margin-bottom: 6px; font-size: 17px; }
.demo-hero-body .sub { margin-bottom: 10px; }
.demo-hero-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.demo-hero-tags span { background: #fff; border: 1px solid #dbe5f5; color: var(--blue-dark); border-radius: 20px; padding: 3px 12px; font-size: 12px; font-weight: 600; }
.demo-hero-actions { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.btn-lg { padding: 10px 20px; font-size: 15px; border-radius: 8px; }

/* 客户演示沙盘折叠区 */
.demo-sandbox { padding: 0; overflow: hidden; }
.demo-sandbox > summary { list-style: none; cursor: pointer; }
.demo-sandbox > summary::-webkit-details-marker { display: none; }
.demo-sandbox-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; font-weight: 600; color: var(--blue-dark); }
.demo-sandbox-summary span:first-child { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.demo-sandbox-summary small { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.demo-sandbox-toggle { color: var(--muted); font-size: 12.5px; flex-shrink: 0; }
.demo-sandbox[open] .demo-sandbox-toggle { display: none; }
.demo-sandbox-body { padding: 0 18px 18px; }

.demo-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.demo-toolbar h3 { margin-bottom: 4px; }
.demo-toolbar .sub { color: var(--muted); font-size: 13px; }
.demo-actions { display: flex; gap: 8px; flex-shrink: 0; }
.demo-frame-wrap { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.04); }
.demo-frame { width: 100%; height: 76vh; border: none; display: block; }
.btn-sm { padding: 5px 12px; font-size: 13px; border-radius: 6px; }

/* 演示沙盘 */
.demo-lead-table { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 16px; }
.demo-lead-table th { background: #f7f9fc; color: var(--muted); font-weight: 600; }
.demo-lead-table td { color: var(--text); }
.demo-flow {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  background: #eef3fc; border-radius: 10px; padding: 12px 16px; margin-bottom: 16px;
  font-size: 13px; color: var(--blue-dark);
}
.demo-flow span { background: #fff; border: 1px solid #dbe5f5; border-radius: 16px; padding: 4px 14px; font-weight: 600; }
.demo-flow i { color: var(--muted); font-style: normal; }
.demo-flow em { margin-left: auto; color: var(--orange); font-style: normal; font-weight: 700; }
.demo-step { border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 14px; background: #fdfdff; }
.demo-step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.demo-step-no { width: 26px; height: 26px; border-radius: 8px; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.demo-step-title { flex: 1; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 200px; }
.demo-step-title b { font-size: 14px; color: var(--blue-dark); }
.demo-step-ops { display: flex; gap: 6px; }
.demo-step .report-out { margin-top: 0; background: #f7f9fc; color: var(--text); max-height: 340px; border: 1px solid var(--border); font-size: 13px; max-height: 420px; }

/* 演示面板里的 Markdown 正文（渲染后，不是源码） */
.md-body {
  white-space: normal; font-family: inherit; line-height: 1.75;
  padding: 14px 18px; font-size: 13.5px;
}
.md-body h4 { font-size: 14px; color: var(--blue-dark); margin: 12px 0 6px; }
.md-body h5 { font-size: 13.5px; color: var(--blue); margin: 10px 0 4px; font-weight: 700; }
.md-body h6 { font-size: 13px; color: var(--text); margin: 8px 0 4px; font-weight: 600; }
.md-body h4:first-child, .md-body h5:first-child { margin-top: 0; }
.md-body p { margin: 4px 0; }
.md-body ul, .md-body ol { margin: 4px 0 8px; padding-left: 20px; }
.md-body li { margin: 2px 0; }
.md-body li.md-sub { margin-left: 14px; color: #46536b; font-size: 12.5px; list-style: circle; }
.md-body hr { border: none; border-top: 1px dashed var(--border); margin: 10px 0; }
.md-body .md-table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 12.5px; }
.md-body .md-table th, .md-body .md-table td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.md-body .md-table th { background: #eef3fc; color: var(--blue-dark); width: 120px; }
.md-body strong { color: var(--blue-dark); }
.md-body em { color: var(--muted); font-style: normal; }
@media (max-width: 768px) {
  .demo-frame { height: 70vh; }
  .demo-toolbar { flex-direction: column; align-items: flex-start; }
  .demo-step-ops { width: 100%; justify-content: flex-end; }
}

/* ===== 侧栏分组（一级菜单）===== */
.nav-group {
  display: flex; align-items: center;
  margin-top: 12px; padding: 10px 16px;
  font-size: 14px; font-weight: 800; letter-spacing: .6px; color: #12316e;
  background: linear-gradient(90deg, #e8f0fd 0%, #f5f8fe 78%, #fff 100%);
  border-top: 1px solid var(--border);
  border-left: 4px solid #c3d5f5;
  transition: background .15s, border-color .15s, color .15s;
}
.nav-group.on {
  color: #fff; border-left-color: var(--orange);
  background: linear-gradient(90deg, #1b4fa8 0%, #2f6fd0 100%);
}
.nav-item { padding-top: 11px; padding-bottom: 11px; font-size: 13.5px; }
.nav-item:not([data-tab="dash"]) { padding-left: 32px; }

/* ===== 顶部流程条 ===== */
.flow-bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin: -24px -24px 16px; padding: 11px 24px;
  background: rgba(245,247,251,.94); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.flow-node {
  padding: 4px 12px; border-radius: 14px; font-size: 13px; color: var(--muted);
  border: 1px solid transparent; cursor: pointer; transition: all .15s;
}
.flow-node:hover { color: var(--blue); border-color: #cfdcf2; }
.flow-node.on { background: var(--blue); color: #fff; font-weight: 600; }
.flow-bar i { color: #c3ccda; font-style: normal; font-size: 12px; }
.flow-hint { margin-left: auto; font-size: 12px; color: var(--muted); }

/* ===== 闭环流水线 ===== */
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.auto-pill {
  background: #eef7f1; color: var(--green); border: 1px solid #cfe9da;
  border-radius: 20px; padding: 5px 14px; font-size: 12.5px; white-space: nowrap;
}
.pipeline { display: flex; align-items: stretch; margin: 16px 0 4px; }
.pipe-step {
  flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 12px 10px; background: #fff; cursor: pointer; transition: all .15s;
  position: relative;
}
.pipe-step:hover { border-color: var(--blue); box-shadow: 0 4px 14px rgba(26,79,160,.10); transform: translateY(-1px); }
.pipe-step.idle { background: #fafbfe; border-style: dashed; }
.pipe-no {
  width: 20px; height: 20px; border-radius: 6px; background: #eef3fc; color: var(--blue);
  font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.pipe-step.on .pipe-no { background: var(--blue); color: #fff; }
.pipe-name { font-size: 13px; font-weight: 700; color: var(--blue-dark); margin: 8px 0 2px; }
.pipe-num { font-size: 21px; font-weight: 800; color: var(--orange); line-height: 1.2; }
.pipe-num small { font-size: 11px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.pipe-ai { font-size: 11.5px; color: #46536b; line-height: 1.5; margin: 8px 0 6px; padding-top: 8px; border-top: 1px dashed var(--border); }
.pipe-meta { font-size: 11px; color: var(--muted); }
.pipe-arrow { display: flex; align-items: center; color: #c3ccda; padding: 0 5px; font-size: 16px; }
.auto-line {
  margin-top: 14px; background: #f7f9fc; border-radius: 10px; padding: 12px 16px;
  font-size: 12.5px; color: #46536b; line-height: 1.9;
}
.auto-line b { color: var(--blue-dark); margin-right: 8px; }
.kpi-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border);
}
.kpi { display: flex; flex-direction: column; gap: 2px; }
.kpi b { font-size: 22px; font-weight: 800; color: var(--blue); }
.kpi span { font-size: 12px; color: var(--muted); }
.h3-gap { margin-top: 22px; padding-top: 16px; border-top: 1px dashed var(--border); }
.feed-panel { align-self: start; }

/* ===== 执行日志 ===== */
.feed { max-height: 340px; overflow: auto; }
.feed-row {
  display: flex; align-items: baseline; gap: 8px; padding: 7px 0;
  border-bottom: 1px dashed var(--border); font-size: 12.5px;
}
.feed-row:last-child { border-bottom: none; }
.feed-who { font-size: 13px; flex-shrink: 0; }
.feed-ts { color: var(--muted); font-size: 11.5px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.feed-step {
  flex-shrink: 0; font-size: 11px; padding: 1px 7px; border-radius: 10px;
  background: #eef3fc; color: var(--blue);
}
.feed-text { color: var(--text); line-height: 1.5; }

@media (max-width: 1100px) {
  .pipeline { flex-wrap: wrap; gap: 10px; }
  .pipe-step { flex: 1 1 45%; }
  .pipe-arrow { display: none; }
  .kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .sidebar { width: 150px; }
  .nav-group { padding: 9px 12px; font-size: 12px; }
  .nav-item:not([data-tab="dash"]) { padding-left: 24px; }
  .flow-hint { display: none; }
}


/* ===== 赚钱驾驶舱：今日行动 + 钱流漏斗 ===== */
.money-banner {
  background: linear-gradient(120deg, #0D2B6A 0%, #1A4FA0 55%, #2E6BC4 100%);
  border-radius: 14px; padding: 18px 20px; color: #fff; margin-bottom: 16px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.money-banner .big { font-size: 26px; font-weight: 800; }
.money-banner .big small { font-size: 14px; font-weight: 600; opacity: .9; }
.money-banner .slogan { font-size: 13px; opacity: .92; margin-top: 4px; }

.today-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.action-card {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 14px 12px; cursor: pointer; transition: all .15s; position: relative;
}
.action-card:hover { border-color: var(--orange); box-shadow: 0 4px 14px rgba(232,96,28,.12); transform: translateY(-1px); }
.action-card .ac-no { font-size: 11px; font-weight: 700; color: var(--orange); letter-spacing: 1px; }
.action-card .ac-t { font-size: 15px; font-weight: 700; margin: 4px 0 2px; color: var(--text); }
.action-card .ac-s { font-size: 12px; color: var(--muted); line-height: 1.5; }
.action-card .ac-btn { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--blue); font-weight: 600; }
.action-card .ac-arrow { position: absolute; top: 12px; right: 12px; color: #c3ccda; }

.funnel-wrap { margin-bottom: 16px; }
.funnel-wrap h3 { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.funnel-wrap .sub { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.funnel { display: flex; flex-direction: column; gap: 6px; }
.funnel-row {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  border-radius: 8px; padding: 8px 12px; transition: background .15s;
}
.funnel-row:hover { background: #f4f7fc; }
.funnel-row .f-label { width: 74px; font-size: 13px; color: var(--text); font-weight: 600; flex-shrink: 0; }
.funnel-row .f-bar-wrap { flex: 1; height: 26px; background: #eef1f7; border-radius: 6px; overflow: hidden; position: relative; }
.funnel-row .f-bar { height: 100%; border-radius: 6px; transition: width .4s; }
.funnel-row .f-num { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.2); }
.funnel-row .f-money { width: 90px; text-align: right; font-size: 13px; font-weight: 700; color: var(--orange); flex-shrink: 0; }
.funnel-row .f-arrow { color: #c3ccda; }

@media (max-width: 768px) {
  .today-actions { grid-template-columns: 1fr; }
  .funnel-row .f-money { width: 70px; }
  .money-banner { padding: 14px 16px; }
}

/* ===== 线索详情弹窗（原文出处 + AI 诊断） ===== */
.btn-mini {
  border: 1px solid var(--border); background: #fff; border-radius: 6px;
  padding: 3px 7px; font-size: 13px; cursor: pointer; line-height: 1; color: var(--text);
}
.btn-mini:hover { background: #eef3fc; border-color: var(--blue); }
.modal-mask {
  position: fixed; inset: 0; background: rgba(13,43,106,0.45);
  display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px;
}
.modal-box {
  background: #fff; border-radius: 14px; width: 100%; max-width: 720px; max-height: 88vh;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.modal-head h3 { margin: 0; font-size: 16px; color: var(--blue-dark); }
.modal-close {
  border: none; background: #f2f5fa; color: var(--muted); border-radius: 8px;
  width: 30px; height: 30px; cursor: pointer; font-size: 15px; line-height: 1;
}
.modal-close:hover { background: #e4e9f2; color: var(--text); }
.modal-body { padding: 20px; overflow-y: auto; }
.lead-detail-table { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 16px; }
.lead-detail-table th {
  background: #f7f9fc; color: var(--muted); font-weight: 600; text-align: left;
  padding: 9px 14px; width: 130px; white-space: nowrap; vertical-align: top;
}
.lead-detail-table td { padding: 9px 14px; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.lead-src-link { margin-bottom: 14px; }
.lead-src-link a { color: var(--blue); font-weight: 600; }
.lead-detail-ops { display: flex; gap: 8px; flex-wrap: wrap; }
.lead-diag { max-height: none; }
.lead-ctx { margin-top: 14px; border: 1px solid var(--border); border-radius: 10px; }
.lead-ctx summary { cursor: pointer; padding: 10px 14px; color: var(--muted); font-size: 13px; font-weight: 600; }
.lead-ctx-pre {
  margin: 0; padding: 12px 14px; background: #f7f9fc; font-size: 12.5px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word; color: var(--text); border-top: 1px solid var(--border);
}

/* 线索池：原文直开链接 */
.lead-src { color: var(--blue-dark); font-weight: 600; text-decoration: none; }
.lead-src:hover { color: var(--blue); text-decoration: underline; }
.btn-src { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn-src:hover { background: #e6f0ff; border-color: var(--blue); }
.btn-src.disabled { opacity: 0.3; cursor: not-allowed; pointer-events: none; }

/* 陪跑作业中心 - 客户详情卡 */
.pp-lead-card {
  border: 1px solid #dbe5f5; border-radius: 12px; padding: 14px 16px;
  background: #f7faff; margin-top: 14px;
}
.pp-lead-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-bottom: 10px;
}
.pp-lead-head b { font-size: 14px; color: var(--blue-dark); }
.pp-lead-head .muted { font-size: 12px; }
.pp-lead-card .lead-detail-table { margin-bottom: 10px; }
.pp-lead-card .lead-detail-table th { background: #fff; }

/* ============================================================
   移动端侧栏遮罩
   ============================================================ */
.sidebar-mask {
  display: none; position: fixed; inset: 0; background: rgba(15,25,50,.45);
  z-index: 90;
}
.sidebar-mask.show { display: block; }

/* ============================================================
   移动端响应式（<= 768px）：侧栏抽屉化 + 内容单列 + 表格横滚
   ============================================================ */
@media (max-width: 768px) {
  /* 顶栏：显示汉堡，压缩标题 */
  .menu-toggle { display: inline-block; }
  .topbar { padding: 12px 14px; gap: 10px; flex-wrap: wrap; }
  .brand { gap: 10px; flex: 1; min-width: 0; }
  .logo { width: 36px; height: 36px; font-size: 15px; flex-shrink: 0; }
  .topbar h1 { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .sub { display: none; }
  .top-actions { flex-shrink: 0; }
  .top-actions #btnImport { font-size: 11px; padding: 7px 8px; white-space: nowrap; }

  /* 侧栏：固定抽屉，默认滑出屏幕 */
  .layout { display: block; min-height: auto; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 260px; z-index: 95;
    transform: translateX(-100%); transition: transform .25s ease;
    overflow-y: auto; box-shadow: 2px 0 16px rgba(0,0,0,.15);
  }
  .sidebar.open { transform: translateX(0); }

  /* 内容区：全宽、更小留白 */
  .content { padding: 14px; width: 100%; }
  .flow-bar { margin: -14px -14px 12px; padding: 9px 10px; overflow-x: auto; flex-wrap: nowrap; gap: 2px; }
  .flow-bar .flow-node { white-space: nowrap; font-size: 12px; padding: 3px 6px; }
  .flow-bar i { font-size: 9px; }
  .flow-hint { display: none; }

  /* 卡片/网格 → 单列或双列 */
  .cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .grid-2 { grid-template-columns: 1fr; }
  .today-actions { grid-template-columns: 1fr; }
  .kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .card { padding: 14px; }
  .panel { padding: 14px; }

  /* 表单行 → 纵向堆叠 */
  .form-row { flex-direction: column; align-items: stretch; }
  .form-row input, .form-row select { min-width: 0; width: 100%; }

  /* 表格容器横向滚动 */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 640px; }

  /* 赚钱驾驶舱 */
  .money-banner { padding: 14px; gap: 12px; }
  .money-banner .big { font-size: 20px; }

  /* 漏斗行适配窄屏 */
  .funnel-row .f-money { width: 56px; }

  /* 演示 hero 卡 */
  .demo-hero { flex-direction: column; align-items: flex-start; }
  .demo-hero-left { min-width: 0; }
  .demo-hero-actions { width: 100%; }
  .demo-hero-actions .btn { flex: 1; }

  /* 弹窗盒更适配窄屏 */
  .modal-box { width: calc(100% - 28px); max-height: 88vh; }
  .lead-detail-table { font-size: 12px; }
  .lead-detail-table th, .lead-detail-table td { padding: 7px 8px; }
}

/* ===== 自动运营 ===== */
.auto-switch-row {
  align-items: center; gap: 18px; background: #f7f9fc;
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
}
.switch-line { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); }
.switch-line input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--blue); }
.job-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.job-card {
  border: 1px solid var(--border); border-radius: 12px; padding: 14px;
  display: flex; flex-direction: column; gap: 8px; background: #fff;
}
.job-top { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.job-icon { font-size: 18px; }
.job-every {
  margin-left: auto; font-size: 12px; color: var(--muted);
  background: #eef2f9; border-radius: 20px; padding: 2px 8px; white-space: nowrap;
}
.job-meta { font-size: 12px; color: var(--muted); }
.job-res { font-size: 13px; color: var(--text); min-height: 34px; line-height: 1.5; }
.hr-line { height: 1px; background: var(--border); margin: 22px 0; }

.outreach-list { display: flex; flex-direction: column; gap: 14px; }
.out-card {
  border: 1px solid var(--border); border-left: 4px solid var(--blue);
  border-radius: 12px; padding: 14px 16px; background: #fff;
}
.out-head {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between;
  align-items: center; margin-bottom: 10px;
}
.out-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.out-meta { font-size: 13px; color: var(--muted); }
.out-draft {
  white-space: pre-wrap; word-break: break-word; font-family: inherit;
  font-size: 14px; line-height: 1.7; background: #f7f9fc; border-radius: 8px;
  padding: 12px 14px; margin: 0 0 12px; color: var(--text);
}
.out-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pill {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 12px; background: #eef2f9; color: #44506b; white-space: nowrap;
}

/* ===== 收益看板 ===== */
.rev-kpi { margin-bottom: 16px; }
.rev-bars { margin-top: 8px; }
.row-overdue td { background: #fff5f5; }

/* ===== 官网线索 ===== */
/* 6 张统计卡按内容自适应排一行，不再 4+2 留大洞 */
.cards.cards-6 { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.cards.cards-6 .card { padding: 14px 16px; }
.cards.cards-6 .card-num { font-size: 24px; }
.cards.cards-6 .card-label { font-size: 12.5px; }
#sites-table { table-layout: fixed; }
#sites-table th:nth-child(1) { width: 25%; }   /* 机构 */
#sites-table th:nth-child(2) { width: 8%; }    /* 城市 */
#sites-table th:nth-child(3) { width: 8%; }    /* 类型 */
#sites-table th:nth-child(4) { width: 16%; }   /* 官网 */
#sites-table th:nth-child(5) { width: 6%; }    /* AI分 */
#sites-table th:nth-child(6) { width: 16%; }   /* 电话/邮箱 */
#sites-table th:nth-child(7) { width: 8%; }    /* 状态 */
#sites-table th:nth-child(8) { width: 9%; }    /* 最近采集 */
#sites-table th:nth-child(9) { width: 76px; }  /* 操作：刚好放下按钮，不竖排折字 */
#sites-table td { vertical-align: top; word-break: break-word; }
#sites-table b { font-size: 13.5px; }
#sites-table td:nth-child(9) { white-space: nowrap; }

/* ===== 内容工厂：渠道能力卡 ===== */
.mk-ch { cursor: pointer; padding: 14px 16px; transition: border-color .15s, box-shadow .15s; }
.mk-ch:hover { border-color: var(--blue); box-shadow: 0 2px 10px rgba(37,99,235,.08); }
.mk-ch:has(input:checked) { border-color: var(--blue); background: #f7faff; }
.mk-ch-name { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 14px; color: var(--text); margin-bottom: 8px; }
.mk-ch-name input { accent-color: var(--blue); cursor: pointer; }
.mk-ch-note { color: var(--muted); font-size: 12px; line-height: 1.55; }
.mk-ch-note + .mk-ch-note { margin-top: 5px; }

/* ===== 内容工厂：成品卡 ===== */
.mk-item { margin-top: 16px; }
.mk-item .report-out { max-height: 320px; overflow: auto; }
.mk-media { margin-top: 12px; }
.mk-media img, .mk-media video {
  display: block; max-width: 260px; width: 100%; border-radius: 10px;
  border: 1px solid var(--border); margin-bottom: 8px; background: #000;
}
.mk-media .btn { font-size: 13px; padding: 6px 14px; }
#pub-table .btn, #sites-table .btn { font-size: 12.5px; padding: 5px 11px; }

@media (max-width: 768px) {
  .job-grid { grid-template-columns: 1fr; }
  .out-head { align-items: flex-start; }
  .out-actions .btn { flex: 1; }
  .mk-media img, .mk-media video { max-width: 100%; }
}
