/* ============================================================
   前沿获客引擎 · 设计系统
   浅色主题 / 卡片式 / 数据密集但不拥挤
   ============================================================ */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --border: #e6e8ec;
  --border-strong: #d5d9e0;

  --text: #1a1d23;
  --text-2: #5c6370;
  --text-3: #8b93a1;

  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef0fe;

  --success: #10b981;
  --success-soft: #e7f8f1;
  --warning: #f59e0b;
  --warning-soft: #fef5e3;
  --danger: #ef4444;
  --danger-soft: #fdeced;
  --info: #3b82f6;
  --info-soft: #eaf2fe;
  --purple: #8b5cf6;
  --purple-soft: #f2edfe;
  --teal: #0d9488;
  --teal-soft: #e5f6f4;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 2px 8px rgba(16, 24, 40, 0.07);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.14);

  --sidebar-w: 216px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ---------------- 登录 ---------------- */
.login-view {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.login-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 480px at 12% 8%, #e8ecfd 0%, transparent 62%),
    radial-gradient(760px 420px at 92% 92%, #e2f6f3 0%, transparent 60%),
    linear-gradient(180deg, #fafbfd 0%, #f2f4f8 100%);
}

.login-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(79, 70, 229, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(79, 70, 229, 0.055) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(680px 460px at 50% 42%, #000 20%, transparent 78%);
}

.login-card {
  position: relative;
  width: 396px;
  max-width: calc(100vw - 40px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 34px 34px 26px;
  box-shadow: 0 24px 64px rgba(16, 24, 40, 0.11), 0 2px 8px rgba(16, 24, 40, 0.04);
}

.login-title {
  font-size: 21px;
  margin: 24px 0 6px;
}

.login-desc {
  color: var(--text-3);
  font-size: 13px;
  margin-bottom: 24px;
}

.login-foot {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
}

.login-foot .dot { margin: 0 6px; }

/* ---------------- 品牌 ---------------- */
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(140deg, #6366f1 0%, #4f46e5 52%, #4338ca 100%);
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.32);
  flex-shrink: 0;
}

.brand-name { font-weight: 650; font-size: 14.5px; letter-spacing: -0.01em; }
.brand-sub { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }

.brand-sm .brand-mark { width: 30px; height: 30px; border-radius: 9px; font-size: 14px; }
.brand-sm .brand-name { font-size: 13.5px; }

/* ---------------- 表单元素 ---------------- */
.field {
  display: block;
  margin-bottom: 15px;
}

.field > span {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

input::placeholder, textarea::placeholder { color: var(--text-3); }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%238b93a1' stroke-width='1.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  cursor: pointer;
}

textarea { resize: vertical; min-height: 76px; line-height: 1.6; }

.form-error {
  background: var(--danger-soft);
  color: #b91c1c;
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  font-size: 12.5px;
  margin-bottom: 13px;
}

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 15px;
  font-size: 13.5px;
  font-family: inherit;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn:hover { background: var(--surface-2); border-color: #c3c9d2; }
.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.24), 0 4px 12px rgba(79, 70, 229, 0.16);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

.btn-danger { color: var(--danger); border-color: #f3c8ca; background: #fff; }
.btn-danger:hover { background: var(--danger-soft); }

.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: #eef0f4; color: var(--text); }

.btn-sm { padding: 5px 11px; font-size: 12.5px; }
.btn-block { width: 100%; padding: 10px; font-size: 14px; }

.icon-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-3);
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.icon-btn:hover { background: #eef0f4; color: var(--text); }
.icon-btn svg { width: 17px; height: 17px; }

/* ---------------- 应用骨架 ---------------- */
.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
}

.sidebar .brand { padding: 18px 18px 16px; }

.nav {
  flex: 1;
  padding: 6px 10px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  margin-bottom: 2px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.14s;
  position: relative;
}

.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: #f3f4f7; color: var(--text); }

.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.nav-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 9px;
  background: #eef0f4;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.nav-item.active .nav-badge { background: #dcdffb; color: var(--primary); }

.sidebar-foot {
  padding: 12px;
  border-top: 1px solid var(--border);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(140deg, #818cf8, #4f46e5);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-meta { min-width: 0; flex: 1; }
.user-name { font-size: 13px; font-weight: 550; }
.user-role { font-size: 11px; color: var(--text-3); }

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 28px 16px;
  background: rgba(245, 246, 248, 0.86);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(230, 232, 236, 0.7);
}

.page-title { font-size: 19px; }
.page-sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.content { padding: 22px 28px 44px; flex: 1; max-width: 1520px; width: 100%; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.card-title { font-size: 14px; font-weight: 600; }
.card-sub { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.card-body { padding: 18px; }

/* ---------------- KPI ---------------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

/* 宽屏才铺满一行，避免中等宽度下出现 4+2 的残缺排列 */
@media (min-width: 1560px) {
  .kpi-grid { grid-template-columns: repeat(6, 1fr); }
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 17px 14px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.kpi::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent, var(--primary));
  opacity: 0.85;
}

.kpi-label {
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 5px;
}

.kpi-value {
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 5px 0 2px;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.kpi-value .unit { font-size: 14px; font-weight: 500; color: var(--text-3); margin-left: 2px; }

.kpi-foot { font-size: 11.5px; color: var(--text-3); display: flex; align-items: center; gap: 5px; }

.trend-up { color: var(--success); font-weight: 600; }
.trend-flat { color: var(--text-3); font-weight: 600; }

/* ---------------- 网格 ---------------- */
.grid-2 {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.grid-2-even { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }

@media (max-width: 1024px) {
  .grid-2, .grid-2-even, .grid-3 { grid-template-columns: 1fr; }
}

/* ---------------- 漏斗 ---------------- */
.funnel { display: flex; flex-direction: column; gap: 9px; }

.funnel-row {
  display: grid;
  grid-template-columns: 76px 1fr 62px 52px;
  align-items: center;
  gap: 11px;
}

.funnel-name { font-size: 12.5px; color: var(--text-2); }
.funnel-bar-wrap { height: 26px; background: #f3f4f7; border-radius: 6px; overflow: hidden; }

.funnel-bar {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #6366f1, #4f46e5);
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  min-width: 3px;
}

.funnel-count { font-size: 13px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.funnel-rate { font-size: 11.5px; color: var(--text-3); text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------- 分布条 ---------------- */
.dist { display: flex; flex-direction: column; gap: 13px; }

.dist-row { display: grid; grid-template-columns: 84px 1fr 54px; align-items: center; gap: 11px; }
.dist-label { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dist-track { height: 8px; background: #f1f3f6; border-radius: 5px; overflow: hidden; }
.dist-fill { height: 100%; border-radius: 5px; transition: width 0.5s ease; }
.dist-value { font-size: 12.5px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------- 图表 ---------------- */
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-legend { display: flex; gap: 16px; margin-top: 10px; font-size: 11.5px; color: var(--text-3); }
.chart-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 5px; }

/* ---------------- 徽章 ---------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
  line-height: 1.6;
}

.badge-S { background: var(--purple-soft); color: #6d28d9; }
.badge-A { background: var(--info-soft); color: #1d4ed8; }
.badge-B { background: var(--teal-soft); color: #0f766e; }
.badge-C { background: #eef0f4; color: #6b7280; }

.badge-new { background: var(--info-soft); color: #1d4ed8; }
.badge-contacted { background: var(--warning-soft); color: #b45309; }
.badge-replied { background: var(--purple-soft); color: #6d28d9; }
.badge-qualified { background: var(--teal-soft); color: #0f766e; }
.badge-converted { background: var(--success-soft); color: #047857; }
.badge-invalid { background: #eef0f4; color: #6b7280; }

.badge-b2b { background: var(--info-soft); color: #1d4ed8; }
.badge-social { background: var(--purple-soft); color: #6d28d9; }
.badge-map { background: var(--teal-soft); color: #0f766e; }

.badge-done { background: var(--success-soft); color: #047857; }
.badge-running { background: var(--warning-soft); color: #b45309; }
.badge-pending { background: #eef0f4; color: #6b7280; }
.badge-failed { background: var(--danger-soft); color: #b91c1c; }
.badge-draft { background: #eef0f4; color: #6b7280; }
.badge-paused { background: var(--warning-soft); color: #b45309; }
.badge-sent { background: var(--info-soft); color: #1d4ed8; }

/* ---------------- 筛选栏 ---------------- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}

.search-box svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-3);
  pointer-events: none;
}

.search-box input { padding-left: 33px; }

.filter-bar select { width: auto; min-width: 116px; }

/* ---------------- 表格 ---------------- */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid #f1f3f6;
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr { cursor: pointer; transition: background 0.12s; }
tbody tr:hover { background: #fafbfe; }

.cell-main { font-weight: 550; color: var(--text); }
.cell-sub { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.cell-mono { font-variant-numeric: tabular-nums; color: var(--text-2); }

.score-cell { display: flex; align-items: center; gap: 7px; }
.score-num { font-weight: 650; font-size: 14px; font-variant-numeric: tabular-nums; min-width: 22px; }

/* 进度条式分数 */
.score-bar { width: 42px; height: 4px; background: #eef0f4; border-radius: 3px; overflow: hidden; }
.score-bar > i { display: block; height: 100%; border-radius: 3px; }

/* ---------------- 分页 ---------------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--text-3);
}

.page-btns { display: flex; align-items: center; gap: 6px; }

/* ---------------- 空态 / 加载 ---------------- */
.empty {
  padding: 52px 20px;
  text-align: center;
  color: var(--text-3);
}
.empty-icon {
  width: 46px;
  height: 46px;
  margin: 0 auto 12px;
  border-radius: 13px;
  background: #f1f3f7;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b0b7c3;
}
.empty-icon svg { width: 22px; height: 22px; }
.empty-title { font-size: 14px; font-weight: 550; color: var(--text-2); margin-bottom: 4px; }
.empty-desc { font-size: 12.5px; max-width: 340px; margin: 0 auto; line-height: 1.65; }

.loading { padding: 40px; text-align: center; color: var(--text-3); font-size: 13px; }

.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
.spinner-dark { border-color: #dfe3ea; border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- 抽屉 ---------------- */
.drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.28);
  z-index: 40;
  animation: fadeIn 0.18s ease;
  backdrop-filter: blur(1.5px);
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 620px;
  max-width: 96vw;
  background: var(--surface);
  z-index: 41;
  box-shadow: -16px 0 48px rgba(16, 24, 40, 0.14);
  display: flex;
  flex-direction: column;
  animation: slideIn 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes slideIn { from { transform: translateX(28px); opacity: 0.6; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.drawer-head h3 { font-size: 15px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px 30px; }

/* ---------------- 模态框 ---------------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.34);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.16s ease;
  backdrop-filter: blur(2px);
}

.modal {
  background: var(--surface);
  border-radius: 16px;
  width: 520px;
  max-width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: popIn 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes popIn { from { transform: scale(0.97) translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
}
.modal-head h3 { font-size: 15.5px; }
.modal-body { padding: 0 22px 6px; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 16px 22px 20px;
  /* 吸底：开户弹窗加了版本选择后内容变长，弹窗内部可滚动，
     按钮跟着滚出去的话用户会以为弹窗没有"确定" —— 卡在半截截图上 */
  position: sticky;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: 0 0 16px 16px;
}

/* ---------------- 详情区块 ---------------- */
.detail-hero {
  background: linear-gradient(135deg, #f7f8fe 0%, #f3f6fb 100%);
  border: 1px solid #e8eaf6;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.detail-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.detail-name { font-size: 16px; font-weight: 600; line-height: 1.35; }

.score-ring {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 3px solid;
  background: #fff;
}
.score-ring b { font-size: 19px; line-height: 1; font-variant-numeric: tabular-nums; }
.score-ring span { font-size: 9.5px; color: var(--text-3); margin-top: 2px; }

.section { margin-bottom: 20px; }
.section-title {
  font-size: 12px;
  font-weight: 650;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 18px; }
.kv { min-width: 0; }
.kv-label { font-size: 11.5px; color: var(--text-3); margin-bottom: 1px; }
.kv-value { font-size: 13px; word-break: break-all; }

.dim-row { margin-bottom: 11px; }
.dim-head { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 4px; }
.dim-name { color: var(--text-2); }
.dim-score { font-weight: 600; font-variant-numeric: tabular-nums; }
.dim-track { height: 5px; background: #eef0f4; border-radius: 3px; overflow: hidden; }
.dim-fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; }
.dim-note { font-size: 11.5px; color: var(--text-3); margin-top: 3px; line-height: 1.5; }

.reason-box {
  background: var(--primary-soft);
  border: 1px solid #e0e3fd;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.7;
  color: #3730a3;
}

.script-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  font-size: 13px;
  line-height: 1.78;
  white-space: pre-wrap;
  word-break: break-word;
  color: #2b3038;
  font-family: inherit;
}

.timeline { position: relative; padding-left: 18px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 5px;
  bottom: 5px;
  width: 1.5px;
  background: var(--border);
}
.tl-item { position: relative; padding-bottom: 13px; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--border-strong);
}
.tl-item:first-child::before { border-color: var(--primary); background: var(--primary); }
.tl-content { font-size: 12.5px; line-height: 1.5; }
.tl-meta { font-size: 11px; color: var(--text-3); margin-top: 1px; }

/* ---------------- Toast ---------------- */
.toast-wrap {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: 9px;
  background: #1f2430;
  color: #fff;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.24);
  animation: toastIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  max-width: 460px;
}
.toast.ok { background: #065f46; }
.toast.err { background: #991b1b; }
.toast-warn { background: #92400e; }

@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------------- 渠道卡片 ---------------- */
.channel-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }

@media (max-width: 1000px) { .channel-cards { grid-template-columns: 1fr; } }

.channel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all 0.16s;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.channel-card:hover { border-color: #c7cbf5; box-shadow: 0 4px 16px rgba(79, 70, 229, 0.1); transform: translateY(-1px); }
.channel-card.selected { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1); }

.channel-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 11px;
}
.channel-icon svg { width: 18px; height: 18px; }

.channel-name { font-size: 13.5px; font-weight: 600; margin-bottom: 3px; }
.channel-desc { font-size: 11.5px; color: var(--text-3); line-height: 1.55; min-height: 36px; }
.channel-stats {
  display: flex;
  gap: 14px;
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-3);
}
.channel-stats b { color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }

/* ---------------- 任务卡 ---------------- */
.task-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 16px;
  border-bottom: 1px solid #f1f3f6;
  font-size: 12.5px;
}
.task-row:last-child { border-bottom: none; }
.task-row:hover { background: #fafbfe; }

/* ---------------- 标签选择 ---------------- */
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.13s;
  user-select: none;
}
.chip:hover { border-color: #b9c0cb; }
.chip.on { background: var(--primary-soft); border-color: #c7cbf5; color: var(--primary); font-weight: 600; }

/* ---------------- 杂项 ---------------- */
.row { display: flex; align-items: center; gap: 9px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.mt-8 { margin-top: 8px; }
.mt-14 { margin-top: 14px; }
.mb-14 { margin-bottom: 14px; }
.nowrap { white-space: nowrap; }
.link { color: var(--primary); cursor: pointer; text-decoration: none; font-weight: 500; }
.link:hover { text-decoration: underline; }

.note-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 12.5px;
  line-height: 1.65;
  color: #92400e;
}

.info-box {
  background: var(--info-soft);
  border: 1px solid #d3e3fd;
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 12.5px;
  line-height: 1.65;
  color: #1e40af;
}

.avatar-lg {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  font-size: 16px;
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d8dde5; border-radius: 5px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #c2c9d4; background-clip: content-box; }

/* ============================================================
   评论区获客：任务对话 / 流水线 / 名单导入 / 通道配置
   ============================================================ */

.tiny { font-size: 11px; }
.nowrap { white-space: nowrap; }

/* ---------------- 首屏 Hero ---------------- */
.mission-hero {
  text-align: center;
  padding: 26px 16px 20px;
  margin-bottom: 16px;
  background:
    radial-gradient(760px 220px at 50% -30%, rgba(79, 70, 229, 0.10), transparent 70%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.hero-badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .2px;
}
.hero-title {
  margin: 12px 0 8px;
  font-size: 30px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -.4px;
  background: linear-gradient(96deg, #4f46e5 0%, #7c3aed 45%, #0d9488 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  margin: 0 auto;
  max-width: 560px;
  color: var(--text-2);
  font-size: 13.5px;
}

/* ---------------- 对话 ---------------- */
.chat-shell {
  max-width: 860px;
  margin: 0 auto;
}
.chat-log {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 18px 6px;
  min-height: 220px;
}
.msg-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  align-items: flex-start;
}
.msg-row.user {
  justify-content: flex-end;
}
.msg-avatar {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(140deg, #6366f1, #8b5cf6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}
.msg-bubble {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px 12px 12px 12px;
  padding: 12px 14px;
  max-width: 640px;
  font-size: 13.5px;
}
.msg-bubble p { margin: 0 0 8px; }
.msg-bubble p:last-child { margin-bottom: 0; }
.msg-bubble code {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 12px;
  color: var(--primary);
  white-space: nowrap; /* 示例句别在中间断行，避免「户。」孤字换行 */
}
.user-bubble {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  border-radius: 12px 4px 12px 12px;
}
.msg-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
  margin-bottom: 6px;
  font-size: 13px;
}
.online {
  font-weight: 500;
  font-size: 11px;
  color: var(--success);
  background: var(--success-soft);
  padding: 1px 7px;
  border-radius: 999px;
}

/* 输入中动画 */
.typing { display: inline-flex; gap: 3px; vertical-align: middle; margin-right: 6px; }
.typing i {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--text-3);
  animation: blink 1.2s infinite;
}
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

/* 输入区 */
.composer {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 8px 8px 8px 16px;
  box-shadow: var(--shadow-sm);
}
.composer input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--text);
  height: 36px;
}
.composer input::placeholder { color: var(--text-3); }
.quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 12.5px;
  cursor: pointer;
  transition: all .16s;
}
.chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

/* ---------------- 任务卡 ---------------- */
.task-card {
  margin-top: 10px;
  border: 1px solid #dcd9fb;
  border-radius: 12px;
  background: linear-gradient(180deg, #faf9ff, #fff);
  overflow: hidden;
}
.task-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--primary-soft);
  border-bottom: 1px solid #e4e1fb;
}
.task-label { font-weight: 700; color: var(--primary); font-size: 12.5px; }
.task-industry {
  font-size: 11.5px;
  color: var(--text-2);
  background: #fff;
  border: 1px solid #e4e1fb;
  border-radius: 999px;
  padding: 2px 9px;
}
.task-rows { padding: 6px 14px; }
.task-row {
  display: flex;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed #eeecfb;
  font-size: 13px;
}
.task-row:last-child { border-bottom: none; }
.task-key {
  flex: 0 0 68px;
  color: var(--text-3);
  font-size: 12.5px;
}
.task-val { flex: 1; color: var(--text); }
.chips-inline { display: flex; flex-wrap: wrap; gap: 5px; }
.kw-chip {
  background: var(--primary-soft);
  color: #4338ca;
  border-radius: 5px;
  padding: 1px 7px;
  font-size: 12px;
}
.task-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-top: 1px solid #eeecfb;
  background: #fbfaff;
}
.task-est { font-size: 12.5px; color: var(--text-2); }
.task-est b { font-size: 17px; color: var(--primary); margin-right: 2px; }

/* 历史任务 */
.history-block { margin-top: 22px; }
.history-title {
  font-size: 12px;
  font-weight: 650;
  color: var(--text-3);
  letter-spacing: .4px;
  margin-bottom: 8px;
}
.history-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.history-item {
  text-align: left;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  padding: 9px 12px;
  cursor: pointer;
  transition: all .16s;
}
.history-item:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.hi-title { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); }
.hi-meta { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

/* ---------------- 执行流水线 ---------------- */
.run-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.run-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.run-title { font-size: 16px; font-weight: 700; letter-spacing: -.2px; }
.run-meta { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.run-status {
  font-size: 11.5px;
  font-weight: 650;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--text-2);
}
.run-status.running { background: var(--primary-soft); color: var(--primary); }
.run-status.done { background: var(--success-soft); color: #047857; }
.run-status.failed { background: var(--danger-soft); color: #b91c1c; }

.stage-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.stage-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 12.5px;
  color: var(--text-3);
  transition: all .2s;
}
.stage-idx {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #e9ebf0;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.stage-chip.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 650;
}
.stage-chip.active .stage-idx { background: var(--primary); color: #fff; }
.stage-chip.done {
  border-color: #bbf0da;
  color: #047857;
  background: var(--success-soft);
}
.stage-chip.done .stage-idx { background: var(--success); color: #fff; }
.stage-arrow { color: var(--border-strong); font-size: 12px; }

.progress-track {
  height: 5px;
  border-radius: 999px;
  background: #eef0f4;
  overflow: hidden;
  margin-bottom: 14px;
}
.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  transition: width .5s ease;
}

.run-counters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.counter {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
}
.counter-num { font-size: 19px; font-weight: 750; letter-spacing: -.5px; }
.counter-label { font-size: 11.5px; color: var(--text-3); }

.run-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.run-col {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  padding: 10px;
  min-height: 200px;
}
.col-title {
  font-size: 11.5px;
  font-weight: 650;
  color: var(--text-3);
  margin-bottom: 8px;
  letter-spacing: .3px;
}

/* 视频卡 */
.video-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.video-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  opacity: .55;
  transition: all .3s;
}
.video-card.opened { opacity: 1; border-color: #d6d3f7; }
.vc-cover {
  position: relative;
  height: 46px;
  border-radius: 7px;
  background: linear-gradient(120deg, #1f2937, #374151);
  margin-bottom: 7px;
  display: flex;
  align-items: flex-end;
  padding: 5px;
}
.vc-platform {
  font-size: 10px;
  color: #fff;
  background: rgba(255,255,255,.18);
  border-radius: 4px;
  padding: 0 5px;
}
.vc-platform.douyin { background: #161823; }
.vc-platform.xhs { background: #ff2442; }
.vc-platform.channels { background: #07c160; }
.vc-dur {
  position: absolute;
  right: 5px; bottom: 5px;
  font-size: 10px;
  color: #fff;
  opacity: .8;
}
.vc-ok {
  position: absolute;
  right: 5px; top: 5px;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  font-size: 9px;
  display: flex; align-items: center; justify-content: center;
}
.vc-title {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 31px;
}
.vc-meta, .vc-stats { font-size: 10.5px; color: var(--text-3); margin-top: 2px; }

/* 评论流 */
.comment-stream { max-height: 268px; overflow-y: auto; }
.comment-item {
  display: flex;
  gap: 8px;
  padding: 8px;
  border-radius: 9px;
  background: #fff;
  border: 1px solid var(--border);
  margin-bottom: 6px;
}
.comment-item.is-lead { border-color: #fbd0da; background: #fffafb; }
.cm-avatar {
  flex: 0 0 24px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #e9ebf0;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.cm-main { flex: 1; min-width: 0; }
.cm-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cm-name { font-size: 11.5px; font-weight: 650; }
.cm-time { font-size: 10.5px; color: var(--text-3); }
.cm-text { font-size: 12.5px; margin-top: 2px; word-break: break-all; }
.kw {
  font-style: normal;
  color: #1d4ed8;
  background: #e8effe;
  border-radius: 3px;
  padding: 0 2px;
  font-weight: 600;
}

/* 意向标签 */
.intent-pill {
  font-size: 10.5px;
  font-weight: 650;
  border-radius: 999px;
  padding: 1px 7px;
  white-space: nowrap;
}
.intent-pill.high { background: #ffe4e9; color: #be123c; }
.intent-pill.medium { background: var(--warning-soft); color: #b45309; }
.intent-pill.low { background: #f1f3f7; color: #64748b; }
.intent-pill.none { background: #f4f5f7; color: #9aa1ae; }

.run-foot { margin-top: 14px; }
.pulse-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
  margin-right: 6px;
  animation: pulse 1.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16,185,129,.5); }
  70% { box-shadow: 0 0 0 7px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}
.done-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--success-soft);
  border: 1px solid #bbf0da;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 12.5px;
  color: #065f46;
}
.done-actions { display: flex; gap: 8px; }
.fail-box {
  background: var(--danger-soft);
  border: 1px solid #f7c8cb;
  border-radius: 10px;
  padding: 11px 14px;
  color: #b91c1c;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ---------------- 名单导入 ---------------- */
.drop-zone {
  border: 1.5px dashed var(--border-strong);
  border-radius: 12px;
  padding: 26px 18px;
  text-align: center;
  cursor: pointer;
  transition: all .18s;
  background: var(--surface-2);
}
.drop-zone:hover, .drop-zone.drag {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.dz-icon {
  width: 34px; height: 34px;
  margin: 0 auto 8px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 17px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.dz-title { font-size: 13.5px; font-weight: 600; }
.dz-desc { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }

.import-preview { margin-top: 14px; }
.preview-box {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: var(--surface-2);
}
.pv-head { font-size: 12.5px; margin-bottom: 8px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pv-warn { color: #b45309; background: var(--warning-soft); border-radius: 5px; padding: 1px 7px; font-size: 11.5px; }
.pv-ok { color: #047857; background: var(--success-soft); border-radius: 5px; padding: 1px 7px; font-size: 11.5px; }
.pv-map { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 9px; }
.map-chip {
  font-size: 11px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 7px;
  color: var(--text-2);
}
.mini-table { font-size: 11.5px; }
.mini-table th, .mini-table td { padding: 5px 8px; }
.pv-foot { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }

/* ---------------- 触达通道 ---------------- */
.channel-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 14px;
  margin-bottom: 10px;
  background: var(--surface-2);
}
.channel-card.on { border-color: #c7d2fe; background: #fbfbff; }
.ch-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ch-name { font-weight: 650; font-size: 13.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.usage-tag {
  font-size: 10.5px;
  font-weight: 600;
  border-radius: 999px;
  padding: 1px 8px;
}
.usage-tag.reach { background: var(--success-soft); color: #047857; }
.usage-tag.notify { background: #f1f3f7; color: #64748b; }
.ch-note { font-size: 11.5px; color: var(--text-3); margin: 5px 0 10px; }
.ch-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.field-sm { margin-bottom: 0; }
.field-sm > span { font-size: 11.5px; }
.field-sm input { height: 32px; font-size: 12.5px; }
.req { color: var(--danger); font-style: normal; margin-left: 3px; }
.ch-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  flex-wrap: wrap;
}
.ch-stat { font-size: 11.5px; color: var(--text-3); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
/* 日限额输入框：内联在「今日已发 / 日上限」后面，不抢视觉焦点 */
.ch-limit {
  width: 62px; padding: 2px 6px; font-size: 11.5px; text-align: center;
  border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--text);
}
.ch-limit:focus { border-color: var(--primary); outline: none; }
.ch-test { font-size: 11.5px; margin-top: 6px; }
.ch-test.ok { color: #047857; }
.ch-test.err { color: #b91c1c; }

/* 开关 */
.switch { position: relative; display: inline-block; width: 38px; height: 21px; flex: 0 0 38px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute;
  inset: 0;
  background: #d5d9e0;
  border-radius: 999px;
  transition: .2s;
  cursor: pointer;
}
.switch span::before {
  content: '';
  position: absolute;
  width: 15px; height: 15px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::before { transform: translateX(17px); }

/* 表格中的评论单元格 */
.cm-cell {
  font-size: 12.5px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.plat-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-3);
  margin-right: 5px;
  vertical-align: middle;
}
.plat-dot.douyin { background: #161823; }
.plat-dot.xhs { background: #ff2442; }
.plat-dot.channels { background: #07c160; }

@media (max-width: 1080px) {
  .run-body { grid-template-columns: 1fr; }
  .run-counters { grid-template-columns: repeat(2, 1fr); }
  .hero-title { font-size: 25px; }
  .video-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .msg-bubble { max-width: 100%; }
  .composer { padding-left: 12px; }
  .history-list { grid-template-columns: 1fr; }
}

/* 采集页引导条：把老通道和新流水线的关系说清楚，避免用户以为两者重复 */
.hint-line {
  font-size: 12px; line-height: 1.7; color: var(--text-2);
  background: #f5f3ff; border: 1px solid #ddd6fe; border-radius: 8px;
  padding: 9px 12px; margin-bottom: 14px;
}
.link-inline { color: var(--primary); text-decoration: none; font-weight: 600; }
.link-inline:hover { text-decoration: underline; }

/* 发送通道标签：与「线索渠道」区分开，避免两列同色混淆 */
.badge-target { background: #ecfdf5; color: #047857; }

/* ============================================================
   真浏览器采集面板
   ============================================================ */

.mode-line {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding-bottom: 14px; border-bottom: 1px dashed var(--border);
}
.mode-tag {
  font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  letter-spacing: 0.3px;
}
.mode-tag.demo { background: var(--warning-soft); color: #b45309; }
.mode-tag.real { background: var(--success-soft); color: #047857; }
.mode-text { font-size: 13px; color: var(--text-2); }
.mode-quota-rest { margin-left: auto; font-size: 12px; color: var(--text-3); }

.panel-sub {
  font-size: 12px; font-weight: 700; color: var(--text-2);
  margin: 18px 0 10px; letter-spacing: 0.3px;
}
.panel-sub:first-of-type { margin-top: 16px; }

/* ---- 登录状态 ---- */
.login-row {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); margin-bottom: 7px;
}
.login-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); flex: none;
}
.login-dot.on { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.login-name { font-size: 13px; font-weight: 600; color: var(--text); min-width: 52px; }
.login-state { font-size: 11.5px; padding: 1px 7px; border-radius: 999px; }
.login-state.ok { background: var(--success-soft); color: #047857; }
.login-state.off { background: var(--border); color: var(--text-3); }
.login-why { font-size: 11.5px; color: var(--text-3); flex: 1; }

/* ---- 配额进度 ---- */
.quota-row {
  display: grid; grid-template-columns: 76px 1fr 128px;
  align-items: center; gap: 10px; margin-bottom: 9px;
}
.quota-label { font-size: 12.5px; color: var(--text-2); }
.quota-bar {
  height: 7px; background: var(--border); border-radius: 999px; overflow: hidden;
}
.quota-bar > i {
  display: block; height: 100%; border-radius: 999px;
  background: var(--success); transition: width 0.4s ease;
}
.quota-bar > i.warn { background: var(--warning); }
.quota-bar > i.full { background: var(--danger); }
.quota-num {
  font-size: 12px; color: var(--text-3); text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---- 节奏展示 ---- */
.pacing-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px;
}
.pacing-item {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 11px;
  display: flex; flex-direction: column; gap: 2px;
}
.pacing-item b { font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; }
.pacing-item span { font-size: 11px; color: var(--text-3); }
.pacing-est {
  font-size: 12px; color: var(--text-2); margin-top: 9px;
  background: var(--primary-soft); border-radius: var(--radius-sm); padding: 8px 11px;
}
.pacing-est b { color: var(--primary); }

/* ---- 提示框 ---- */
.warn-box {
  font-size: 12px; line-height: 1.75; color: #92400e;
  background: var(--warning-soft); border: 1px solid #fcd9a1;
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.warn-box b { color: #78350f; }
.mt-12 { margin-top: 12px; }

@media (max-width: 720px) {
  .quota-row { grid-template-columns: 68px 1fr 92px; }
  .mode-quota-rest { margin-left: 0; width: 100%; }
  .login-why { display: none; }
}

/* ---- 接口自检结果 ---- */
.diag-box {
  margin-top: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 13px; background: var(--surface-2); font-size: 12px; line-height: 1.7;
  color: var(--text-2);
}
.diag-box.ok { border-color: #a7e8ce; background: var(--success-soft); }
.diag-box.warn { border-color: #fcd9a1; background: var(--warning-soft); }
.diag-box.err { border-color: #f8c4c7; background: var(--danger-soft); }

.diag-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 6px; }
.diag-verdict {
  font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--border); color: var(--text-2);
}
.diag-verdict.ok { background: #a7e8ce; color: #065f46; }
.diag-verdict.warn { background: #fcd9a1; color: #92400e; }
.diag-verdict.err { background: #f8c4c7; color: #991b1b; }
.diag-platform { color: var(--text-2); }
.diag-count { margin-left: auto; color: var(--text); font-weight: 600; }
.diag-advice { color: var(--text); margin-bottom: 6px; }

.diag-samples { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.diag-sample {
  background: var(--surface); border: 1px solid var(--border); border-radius: 5px;
  padding: 1px 7px; font-size: 11.5px; color: var(--text-2);
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.diag-page {
  font-size: 11.5px; color: var(--text-3); margin-bottom: 7px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.diag-eps { border-top: 1px dashed var(--border); padding-top: 7px; }
.diag-ep {
  display: grid; grid-template-columns: 42px 1fr 56px; gap: 8px;
  align-items: baseline; font-size: 11px; padding: 2px 0;
}
.diag-ep-status { font-weight: 700; font-variant-numeric: tabular-nums; }
.diag-ep-status.ok { color: #047857; }
.diag-ep-status.err { color: #b91c1c; }
.diag-ep-url { color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.diag-ep-n { text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ============================================================
   今日待跟进 —— 每天上班第一屏
   目标：一屏看清「先联系谁、说什么、发完标什么」
   ============================================================ */

.nav-badge.is-zero { opacity: .45; }

.todo-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.todo-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.todo-stat::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--border-strong);
}
.todo-stat.tone-blue::before { background: var(--info); }
.todo-stat.tone-orange::before { background: var(--warning); }
.todo-stat.tone-green::before { background: var(--success); }
.todo-stat.tone-purple::before { background: var(--purple); }
.todo-stat b {
  display: block;
  font-size: 24px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  letter-spacing: -.5px;
}
.todo-stat span { font-size: 12px; color: var(--text-3); }

.todo-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.todo-scope {
  display: inline-flex;
  background: #eef0f4;
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}
.todo-scope button {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  padding: 5px 14px;
  border-radius: 7px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.todo-scope button.on {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.todo-bar-tip {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-3);
  flex: 1;
  min-width: 240px;
}

.todo-group { margin-bottom: 26px; }
.todo-group-head { margin-bottom: 10px; }
.todo-group-head h3 {
  margin: 0 0 3px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.todo-group-head h3 em {
  font-style: normal;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 1px 7px;
  border-radius: 9px;
  font-variant-numeric: tabular-nums;
}
.todo-group-head p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-3);
}

.todo-list { display: grid; gap: 10px; }

.todo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, border-color .15s;
}
.todo-card:hover { box-shadow: var(--shadow); border-color: var(--border-strong); }

.todo-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 9px;
}
.todo-score {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 7px;
  font-variant-numeric: tabular-nums;
}
.todo-score.tone-high { background: var(--success-soft); color: #047857; }
.todo-score.tone-mid { background: var(--warning-soft); color: #b45309; }
.todo-score.tone-low { background: #eef0f4; color: var(--text-3); }

.todo-name { font-size: 14px; font-weight: 600; color: var(--text); }
.todo-plat {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--info-soft);
  color: #1d4ed8;
  font-weight: 500;
}
/* 属地：本地绿、外地灰。装修是本地生意，这一栏比意向分更能决定要不要打这个电话 */
.todo-ip {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 6px;
  font-weight: 500;
}
.todo-ip.local {
  background: #dcfce7;
  color: #15803d;
}
.todo-ip.far {
  background: #f1f5f9;
  color: #64748b;
}
.todo-type {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--purple-soft);
  color: #6d28d9;
  font-weight: 500;
}
.todo-time { margin-left: auto; font-size: 11.5px; color: var(--text-3); }

.todo-quote {
  margin: 0 0 8px;
  padding: 9px 12px;
  border-left: 3px solid var(--border-strong);
  background: var(--surface-2);
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-2);
}
.todo-nocxt {
  margin: 0 0 8px;
  font-size: 12.5px;
  color: var(--warning);
  background: var(--warning-soft);
  padding: 7px 11px;
  border-radius: 8px;
}
/* 有电话的线索不是「缺数据」，是另一种跟法：直接打 */
.todo-nocxt.todo-hasphone {
  color: #047857;
  background: #ECFDF5;
}
.todo-src {
  display: inline-block;
  font-size: 12px;
  color: var(--text-3);
  text-decoration: none;
  margin-bottom: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  white-space: nowrap;
}
.todo-src:hover { color: var(--primary); text-decoration: underline; }

.todo-script {
  background: var(--primary-soft);
  border-radius: 10px;
  padding: 11px 13px;
  margin-bottom: 10px;
}
.script-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.script-tabs button {
  border: 0;
  background: rgba(79, 70, 229, .1);
  color: var(--primary);
  font: inherit;
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.script-tabs button.on { background: var(--primary); color: #fff; }
.script-body {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
}
.script-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.script-rule {
  margin: 9px 0 0;
  font-size: 11.5px;
  color: #6d628f;
  line-height: 1.5;
}

.todo-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.todo-actions-label { font-size: 11.5px; color: var(--text-3); margin-right: 2px; }
.todo-actions button {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: 12px;
  padding: 4px 11px;
  border-radius: 7px;
  cursor: pointer;
  transition: all .14s;
}
.todo-actions button:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

@media (max-width: 860px) {
  .todo-stats { grid-template-columns: repeat(2, 1fr); }
  .todo-time { margin-left: 0; }
}

/* ============================================================
   效果报告
   客户续不续费就看这一页，所以排版优先级：
   先给钱（成交额最大）→ 再给过程（漏斗）→ 最后给明细
   ============================================================ */

.rep-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.rep-scope {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}
.rep-scope button {
  border: 0;
  background: transparent;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
}
.rep-scope button.on {
  background: var(--primary);
  color: #fff;
  font-weight: 500;
}

.rep-month {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
}
.rep-month input {
  font-family: inherit;
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}
.rep-demo-tag {
  font-size: 12px;
  color: var(--warning);
  background: var(--warning-soft);
  padding: 4px 10px;
  border-radius: 6px;
}

/* ---- 大数字 ---- */
.rep-hero {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.rep-hero-main {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.rep-hero-main.has-deal::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--success), var(--teal));
}
.rep-hero-label {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 8px;
}
.rep-hero-value {
  font-size: 40px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
}
.rep-hero-main.has-deal .rep-hero-value { color: var(--success); }
.rep-hero-sub {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-3);
}

.rep-hero-side {
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  gap: 8px;
}
.rep-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}
.rep-kpi-label { font-size: 12px; color: var(--text-2); }
.rep-kpi-value {
  font-size: 22px;
  font-weight: 620;
  color: var(--text);
  line-height: 1.25;
}
.rep-kpi-value.good { color: var(--primary); }
.rep-kpi-sub { font-size: 11px; color: var(--text-3); }

/* ---- 提醒 ---- */
.rep-warns {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.rep-warn {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 11px 15px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  border-left: 3px solid;
  flex-wrap: wrap;
}
.rep-warn strong { font-weight: 600; }
.rep-warn span { color: var(--text-2); }
.rep-warn.danger {
  background: var(--danger-soft);
  border-color: var(--danger);
}
.rep-warn.danger strong { color: var(--danger); }
.rep-warn.warn {
  background: var(--warning-soft);
  border-color: var(--warning);
}
.rep-warn.warn strong { color: #b45309; }
.rep-warn.info {
  background: var(--info-soft);
  border-color: var(--info);
}
.rep-warn.info strong { color: #1d4ed8; }

/* ---- 卡片通用 ---- */
.rep-card {
  padding: 18px 20px;
  margin-bottom: 14px;
}
.rep-card-head { margin-bottom: 16px; }
.rep-card-head h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.rep-card-head p {
  margin: 0;
  font-size: 12px;
  color: var(--text-3);
}

/* ---- 漏斗 ---- */
.rep-funnel-row {
  display: grid;
  grid-template-columns: 128px 1fr 92px;
  align-items: center;
  gap: 14px;
  padding: 9px 0;
}
.rep-funnel-row + .rep-funnel-row { border-top: 1px dashed var(--border); }

.rep-funnel-label strong {
  display: block;
  font-size: 13px;
  font-weight: 550;
  color: var(--text);
}
.rep-funnel-label span {
  display: block;
  font-size: 11px;
  color: var(--text-3);
  margin-top: 1px;
}

.rep-funnel-bar {
  height: 26px;
  background: var(--surface-2);
  border-radius: 6px;
  overflow: hidden;
}
.rep-funnel-bar i {
  display: block;
  height: 100%;
  border-radius: 6px;
  transition: width 0.4s ease;
}
.rep-funnel-bar i.lv0 { background: #c7d2fe; }
.rep-funnel-bar i.lv1 { background: #a5b4fc; }
.rep-funnel-bar i.lv2 { background: #818cf8; }
.rep-funnel-bar i.lv3 { background: #6366f1; }
.rep-funnel-bar i.lv4 { background: linear-gradient(90deg, #4f46e5, #10b981); }

.rep-funnel-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.rep-funnel-num strong {
  font-size: 16px;
  font-weight: 620;
  color: var(--text);
}
.rep-funnel-num span {
  display: block;
  font-size: 11px;
  color: var(--text-3);
}
.rep-funnel-num span.drop { color: var(--danger); font-weight: 600; }
.rep-funnel-num span.muted { color: var(--text-3); }

/* ---- 趋势 ---- */
.rep-trend {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  align-items: end;
}
.rep-trend-col { text-align: center; }
.rep-trend-bar-wrap {
  height: 110px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: var(--surface-2);
  border-radius: 6px 6px 0 0;
}
.rep-trend-bar-wrap i {
  display: block;
  width: 60%;
  background: linear-gradient(180deg, #818cf8, #4f46e5);
  border-radius: 4px 4px 0 0;
  min-height: 0;
  transition: height 0.4s ease;
}
.rep-trend-deal {
  font-size: 11px;
  color: var(--success);
  font-weight: 600;
  margin-top: 6px;
  min-height: 15px;
}
.rep-trend-month {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

/* ---- 成交明细 ---- */
.rep-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.rep-table th {
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  color: var(--text-3);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.rep-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: top;
}
.rep-table tr:last-child td { border-bottom: 0; }
.rep-table td strong { color: var(--text); font-weight: 550; }
.rep-table .rep-money {
  font-weight: 620;
  color: var(--success);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.rep-deal-say {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 3px;
  max-width: 340px;
}
.rep-table .muted { color: var(--text-3); font-weight: 400; }

@media (max-width: 900px) {
  .rep-hero { grid-template-columns: 1fr; }
  .rep-hero-side { grid-template-rows: none; grid-template-columns: repeat(3, 1fr); }
  .rep-funnel-row { grid-template-columns: 90px 1fr 70px; }
  .rep-hero-value { font-size: 32px; }
  .rep-trend { grid-template-columns: repeat(3, 1fr); }
}

/* 到店 / 成交：这两个动作用色区分开
   成交是正向结果，用绿；到店是中间里程碑，用青。
   别都做成一个灰按钮——销售会忘记点，报表就断了。 */
.todo-actions .todo-act-visit {
  border-color: #99e0d2;
  color: var(--teal);
  background: var(--teal-soft);
}
.todo-actions .todo-act-visit:hover {
  border-color: var(--teal);
  background: #d5f2ee;
  color: var(--teal);
}
.todo-actions .todo-act-deal {
  border-color: #86efac;
  color: #047857;
  background: var(--success-soft);
  font-weight: 550;
  margin-left: auto;
}
.todo-actions .todo-act-deal:hover {
  border-color: var(--success);
  background: #d3f5e6;
  color: #047857;
}

/* 无成交时主卡里的"下一步"按钮：
   长得像链接而不是按钮，因为它不是主操作，是一句提示。
   但必须可点——让客户看完空白报表能立刻做点事。 */
.rep-hero-value.zero {
  color: var(--text-3);
  font-size: 34px;
  font-weight: 500;
}
.rep-next {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-size: 13px;
  color: var(--primary);
  cursor: pointer;
  text-align: left;
}
.rep-next:hover { text-decoration: underline; }

/* 趋势柱压矮一点：6 个月里有 5 个月是 0 的时候，110px 的空白墙太压抑 */
.rep-trend-bar-wrap { height: 80px; }

/* ============================================================
   行业模板
   ============================================================ */
.ind-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.ind-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.ind-stat b {
  display: block;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}
.ind-stat span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-3);
}

.ind-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 12px;
}
.ind-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.ind-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.ind-card.is-archived { opacity: 0.6; }
.ind-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}
.ind-name { font-size: 14.5px; font-weight: 600; color: var(--text); }
.ind-key { font-family: ui-monospace, monospace; font-size: 11.5px; color: var(--text-3); }
.ind-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-2);
}
.ind-foot {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 11.5px;
  color: var(--text-3);
}

.ind-badge {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 5px;
  background: #eef0f4;
  color: var(--text-2);
  white-space: nowrap;
}
.ind-badge-custom { background: var(--primary-soft); color: #4338ca; }
.ind-badge-off { background: var(--warning-soft); color: #b45309; }

.ind-tip { margin-top: 16px; font-size: 12px; color: var(--text-3); }

/* ---- 详情抽屉 ---- */
.ind-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.ind-detail-name { font-size: 17px; font-weight: 600; color: var(--text); }
.ind-detail-key {
  margin-top: 3px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: var(--text-3);
}

.ind-warn {
  background: var(--warning-soft);
  border: 1px solid #f7dfb0;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
}
.ind-warn-title {
  font-size: 13px;
  font-weight: 600;
  color: #92400e;
  margin-bottom: 6px;
}
.ind-warn-item {
  position: relative;
  padding-left: 12px;
  font-size: 12.5px;
  line-height: 1.7;
  color: #92400e;
}
.ind-warn-item::before {
  content: '·';
  position: absolute;
  left: 2px;
}
.ind-ok {
  background: var(--success-soft);
  border: 1px solid #b7ebd5;
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  margin-bottom: 16px;
  font-size: 12.5px;
  color: #047857;
}

.ind-sec-title {
  margin: 18px 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
}

.ind-kv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ind-kv {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
}
.ind-kv span {
  display: block;
  margin-bottom: 2px;
  font-size: 11px;
  color: var(--text-3);
}
.ind-kv b {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
}

.ind-sum-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.ind-sum {
  text-align: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
}
.ind-sum b {
  display: block;
  font-size: 17px;
  font-weight: 600;
  color: var(--primary);
}
.ind-sum span { font-size: 11px; color: var(--text-3); }

.ind-label { margin: 14px 0 7px; font-size: 12px; color: var(--text-2); }
.ind-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ind-chip {
  padding: 3px 9px;
  border-radius: 6px;
  background: #eef0f4;
  color: var(--text-2);
  font-size: 11.5px;
}
.ind-chip-blue { background: var(--info-soft); color: #1d4ed8; }
.ind-chip-green { background: var(--success-soft); color: #047857; }
.ind-chip-purple { background: var(--purple-soft); color: #6d28d9; }
.ind-none { font-size: 12px; color: var(--text-3); }

.ind-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   客户账户（平台方）
   ============================================================ */
.tnt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.tnt-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.tnt-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
/* 客户名可能很长（「东莞市前沿网络信息技术有限公司」），
   不截断会把整张卡撑到三行，和旁边只占两行的卡对不齐 */
.tnt-name {
  font-size: 15px; font-weight: 600; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-word;
}
.tnt-badge {
  flex: none; font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: var(--border); color: var(--text-3);
}
.tnt-badge.is-on { background: var(--success-soft); color: var(--success); }
.tnt-badge.is-off { background: var(--danger-soft); color: var(--danger); }
.tnt-slug {
  margin-top: 4px; font-family: ui-monospace, monospace; font-size: 11.5px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tnt-meta { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--text-2); }
.tnt-foot {
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  font-size: 11.5px; color: var(--text-3);
}
.tnt-price { color: var(--text-2); font-weight: 600; }
/* 卡片底部两段（落地页数据 / 版本+到期日）挤不下时换行，不要压成一坨 */
.tnt-foot { flex-wrap: wrap; row-gap: 4px; }
.tnt-foot .tnt-price { margin-left: auto; white-space: nowrap; }

.tnt-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.tnt-form-hint {
  margin: 6px 0 12px; padding: 9px 12px; border-radius: var(--radius-sm);
  background: var(--info-soft); color: var(--info); font-size: 12.5px;
}
.tnt-cred-tip { margin: 0 0 12px; font-size: 12.5px; color: var(--text-2); }
.tnt-cred {
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.tnt-cred > div {
  display: flex; justify-content: space-between; gap: 14px; padding: 10px 14px;
  font-size: 13px; border-bottom: 1px solid var(--border);
}
.tnt-cred > div:last-child { border-bottom: 0; }
.tnt-cred span { color: var(--text-3); flex: none; }
.tnt-cred b { font-family: ui-monospace, monospace; word-break: break-all; text-align: right; }

.tnt-detail-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.tnt-detail-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.tnt-kv {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  padding: 12px; border-radius: var(--radius); background: var(--bg);
}
/* ⚠️ 必须限定到「格子的第一层 span」。
   写成 .tnt-kv span 会把格子里嵌的版本徽标也变成 block 整行宽，
   绿底胶囊被拉成一整条，看着像填错的输入框。 */
.tnt-kv > div > span { display: block; font-size: 11px; color: var(--text-3); }
.tnt-kv b { font-size: 13px; font-weight: 600; }
.tnt-sec { margin-top: 20px; }
.tnt-sec-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 8px; font-size: 13px; color: var(--text-2);
}
.tnt-line {
  display: flex; align-items: center; gap: 10px; padding: 9px 2px;
  border-bottom: 1px dashed var(--border); font-size: 12.5px;
}
.tnt-line:last-child { border-bottom: 0; }
.tnt-line b { font-weight: 600; }
.tnt-line em { margin-left: auto; font-style: normal; color: var(--text-3); font-size: 11.5px; }
.tnt-empty { padding: 14px 2px; font-size: 12.5px; color: var(--text-3); }

/* ============================================================
   落地页配置
   ============================================================ */
.lp-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); gap: 16px; align-items: start; }
.lp-side { display: grid; gap: 16px; }
.lp-form { padding: 18px 20px; }
.lp-block { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.lp-block:last-of-type { border-bottom: 0; margin-bottom: 0; }
.lp-block-title { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 10px; }
.lp-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.lp-actions { display: flex; gap: 10px; padding-top: 4px; }
.lp-qr { display: flex; gap: 14px; align-items: center; margin-top: 4px; }
.lp-qr-box {
  width: 92px; height: 92px; flex: none; border-radius: var(--radius-sm);
  border: 1px dashed var(--border-strong); background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; color: var(--text-3); overflow: hidden;
}
.lp-qr-box img { width: 100%; height: 100%; object-fit: cover; }
.lp-qr-tip b { display: block; font-size: 13px; }
.lp-qr-tip span { display: block; font-size: 12px; color: var(--text-3); margin: 2px 0 8px; }
.lp-file-btn { display: inline-block; cursor: pointer; }
.lp-preview { padding: 14px; }
.lp-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.lp-link {
  font-family: ui-monospace, monospace; font-size: 11.5px; color: var(--primary);
  cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%;
}
.lp-preview iframe { width: 100%; height: 540px; border: 1px solid var(--border); border-radius: var(--radius); background: #f5f7f9; }
.lp-stats { grid-template-columns: repeat(3, 1fr); margin-bottom: 14px; }
@media (max-width: 1080px) {
  .lp-grid { grid-template-columns: 1fr; }
  .tnt-form-grid { grid-template-columns: 1fr; }
  .tnt-kv { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   发内容（内容引擎）
   客户在这里做的是「挑一个、生成一条、复制出去发」，
   所以每一步都要短：五个题材并排、一个生成按钮、四段可复制内容。
   ============================================================ */

.ct-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.ct-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 16px;
}
.ct-stat b {
  display: block;
  font-size: 22px;
  line-height: 1.25;
  color: var(--text);
}
.ct-stat span { font-size: 12.5px; color: var(--text-3); }
.ct-stat.tone-blue b { color: var(--info); }
.ct-stat.tone-green b { color: var(--success); }
.ct-stat.tone-orange b { color: var(--warning); }
.ct-stat.tone-purple b { color: var(--purple); }

/* ---------- 生成区 ---------- */
.ct-gen { padding: 18px 20px 16px; }
.ct-gen-head h3 { margin: 0 0 4px; font-size: 15.5px; }
.ct-gen-head p { margin: 0 0 14px; font-size: 13px; color: var(--text-3); }

.ct-topics {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 9px;
}
.ct-topic {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
  font-family: inherit;
}
.ct-topic b {
  display: block;
  font-size: 13.5px;
  color: var(--text);
  margin-bottom: 3px;
}
.ct-topic span {
  display: block;
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.45;
}
.ct-topic:hover { border-color: var(--border-strong); }
.ct-topic.on {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .07);
}
.ct-topic.on b { color: var(--primary); }
.ct-topic:disabled { opacity: .4; cursor: not-allowed; }

.ct-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.ct-seg {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}
.ct-seg button {
  border: 0;
  background: transparent;
  padding: 7px 12px;
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
}
.ct-seg button.on {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}
.ct-field { display: flex; flex-direction: column; gap: 4px; }
.ct-field > span { font-size: 11.5px; color: var(--text-3); }
.ct-field input {
  width: 96px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
}
.ct-field.grow { flex: 1; min-width: 180px; }
.ct-field.grow input { width: 100%; }
.ct-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .08);
}
.ct-gen-note {
  margin: 11px 0 0;
  font-size: 12px;
  color: var(--text-3);
  background: var(--surface-2);
  border-left: 2px solid var(--border-strong);
  padding: 6px 10px;
  border-radius: 0 6px 6px 0;
}

/* ---------- 列表 ---------- */
.ct-list-title {
  font-size: 14.5px;
  margin: 26px 0 10px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.ct-list-title em {
  font-style: normal;
  font-size: 11.5px;
  color: var(--text-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1px 8px;
}
.ct-list { display: flex; flex-direction: column; gap: 10px; }

.ct-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color .15s;
}
.ct-card:hover { border-color: var(--border-strong); }
.ct-card.is-pub { border-left: 3px solid var(--success); }

.ct-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ct-badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 5px;
  font-weight: 600;
  flex: none;
}
.ct-badge.video { background: var(--info-soft); color: var(--info); }
.ct-badge.note { background: var(--purple-soft); color: var(--purple); }
.ct-title { font-size: 14px; color: var(--text); flex: 1; min-width: 200px; }
.ct-topic-tag { font-size: 11.5px; color: var(--text-3); }
.ct-flag {
  font-size: 11px;
  color: var(--success);
  background: var(--success-soft);
  padding: 2px 7px;
  border-radius: 5px;
}
.ct-time { font-size: 11.5px; color: var(--text-3); margin-left: auto; }

.ct-preview {
  margin: 8px 0 10px;
  font-size: 12.8px;
  color: var(--text-2);
  line-height: 1.6;
}

.ct-card-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.ct-metric { font-size: 12px; color: var(--text-3); }
.ct-metric b { color: var(--text); font-weight: 600; }
.ct-metric.hot b { color: var(--success); }
.ct-card-btns { margin-left: auto; display: flex; gap: 6px; }

/* ---------- 稿子弹窗 ---------- */
.modal:has(.ct-sheet) { width: 780px; }
.ct-sheet { max-height: 70vh; overflow-y: auto; }
.modal-head > div p {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--text-3);
}

.ct-sec {
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--surface);
}
.ct-sec-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
}
.ct-sec-head h4 {
  margin: 0;
  font-size: 13px;
  color: var(--text);
}
.ct-sec-hint {
  font-size: 11.5px;
  color: var(--text-3);
  flex: 1;
}
.ct-sec-head .btn { margin-left: auto; flex: none; }
.ct-sec-head .btn + .btn { margin-left: 0; }

.ct-pre {
  margin: 0;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 11px 12px;
  max-height: 260px;
  overflow-y: auto;
}

.ct-shots {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.3px;
}
.ct-shots th {
  text-align: left;
  font-weight: 600;
  color: var(--text-3);
  font-size: 11.5px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.ct-shots td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: top;
  line-height: 1.55;
}
.ct-shots tr:last-child td { border-bottom: 0; }
.ct-shots td.t { white-space: nowrap; color: var(--text-3); font-size: 11.5px; }

.ct-tags-text {
  margin: 0;
  font-size: 13px;
  color: var(--info);
  line-height: 1.8;
}
.ct-link {
  margin: 0 0 6px;
  font-size: 12.5px;
  color: var(--primary);
  word-break: break-all;
  background: var(--primary-soft);
  padding: 8px 10px;
  border-radius: 7px;
}
.ct-tip {
  margin: 0;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.65;
}

@media (max-width: 900px) {
  .ct-stats { grid-template-columns: repeat(2, 1fr); }
  .ct-topics { grid-template-columns: repeat(2, 1fr); }
  .modal:has(.ct-sheet) { width: calc(100vw - 24px); }
}
@media (max-width: 560px) {
  .ct-row { flex-direction: column; align-items: stretch; }
  .ct-field input, .ct-field.grow input { width: 100%; }
  .ct-card-btns { margin-left: 0; width: 100%; }
  .ct-card-btns .btn { flex: 1; }
}

/* ============================================================
   手机端布局（≤820px）
   客户的场景就是「在工地、在车上，掏出手机看一眼今天要发什么」。
   桌面那套固定侧边栏在手机上会把内容区挤成一条，等于没法用。
   改成底部一条横向滚动的导航：左侧滑动切页，右侧是账号和退出。
   ============================================================ */
@media (max-width: 820px) {
  .app { display: block; }

  .sidebar {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    border-right: 0;
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 14px rgba(16, 24, 40, 0.07);
    z-index: 60;
  }

  .sidebar .brand { display: none; }

  .nav {
    flex: 1;
    display: flex;
    flex-direction: row;
    gap: 2px;
    padding: 5px 6px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }

  .nav-item {
    flex: none;
    white-space: nowrap;
    gap: 5px;
    padding: 8px 10px;
    margin-bottom: 0;
    font-size: 12.5px;
    border-radius: 9px;
  }
  .nav-item svg { width: 15px; height: 15px; }
  .nav-item.active::before { display: none; }
  .nav-badge { margin-left: 3px; font-size: 10.5px; padding: 0 5px; }

  .sidebar-foot {
    flex: none;
    padding: 5px 8px;
    border-top: 0;
    border-left: 1px solid var(--border);
  }
  .sidebar-foot .user-meta { display: none; }
  .sidebar-foot .user-chip { padding: 4px; gap: 4px; }

  .main { margin-left: 0; padding-bottom: 70px; }
  .topbar { padding: 12px 14px 10px; flex-wrap: wrap; gap: 8px; }
  .page-title, .topbar h1 { font-size: 17px; }

  /* 底部导航在 z-index 60，弹窗必须压在上面 */
  .modal-mask { z-index: 80; }
  .drawer-mask { z-index: 78; }
  .drawer { z-index: 79; }

  .modal { width: calc(100vw - 20px) !important; max-height: 86vh; }
  .modal-body { padding: 0 14px 6px; }
  .modal-head { padding: 15px 14px 12px; }
  .modal-foot { padding: 12px 14px 16px; }
}

/* ---------- 报告页：内容带来的客户 ---------- */
.rep-content { margin-top: 14px; }
.rep-content-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.rep-content-head h3 { margin: 0; font-size: 14.5px; }
.rep-content-sum { font-size: 12.5px; color: var(--text-3); }
.rep-content-sum b { color: var(--success); font-size: 13.5px; }

.rep-content-list { display: flex; flex-direction: column; margin-top: 10px; }
.rep-content-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px dashed var(--border);
}
.rep-content-row:first-child { border-top: 0; }
.rc-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.rc-title {
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rc-code {
  flex: none;
  font-size: 11px;
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  font-variant-numeric: tabular-nums;
}
.rc-nums { flex: none; display: flex; gap: 14px; font-size: 12.5px; color: var(--text-3); }
.rc-nums .hot { color: var(--success); font-weight: 600; }
.rep-content-more { margin-top: 10px; }

/* 删客户：藏在抽屉最底部，红字提示不可恢复 */
/* 删客户：藏在抽屉最底部。做视觉隔离，防止手滑点进日常按钮里 */
.tnt-danger {
  margin-top: 22px;
  padding: 14px 16px 16px 15px;
  border: 1px solid #f3d0d2;
  border-left: 3px solid var(--danger);
  border-radius: 10px;
  background: #fdf6f6;
}
.tnt-danger .tnt-sec-head { margin-bottom: 6px; }
.tnt-danger .tnt-sec-head b { color: #b91c1c; font-size: 13.5px; }
.tnt-danger-tip {
  margin: 0 0 12px;
  font-size: 12.5px;
  color: #8a5a5c;
  line-height: 1.7;
}
.tnt-danger-tip em {
  font-style: normal;
  font-weight: 600;
  color: #b91c1c;
}
.tnt-danger .btn-danger {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
  font-weight: 500;
}
.tnt-danger .btn-danger:hover { background: #dc2626; border-color: #dc2626; }

/* ===== 内容润色（AI 改写）状态 =====
   两个信息要传达清楚：
   1. 这条是 AI 润过的，还是模板原样（卡片上的小标签）
   2. 润色失败时不是「坏了」，只是「读着硬一点」，而且能重试（弹窗里的提示条）
   用紫色区分 AI，用橙色区分「降级但仍可用」—— 橙色比红色合适，
   红色会让客户以为稿子不能用了。 */
.ct-polish {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 5px;
  white-space: nowrap;
  font-weight: 500;
}
.ct-polish.ok { color: var(--purple); background: var(--purple-soft); }
.ct-polish.warn { color: #b45309; background: var(--warning-soft); }

.ct-polish-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: 12.5px;
  line-height: 1.65;
}
.ct-polish-bar > div { flex: 1; min-width: 0; }
.ct-polish-bar b { display: block; font-size: 13px; margin-bottom: 2px; }
.ct-polish-bar span { display: block; color: var(--text-2); }
.ct-polish-bar.warn { background: var(--warning-soft); border-left: 3px solid var(--warning); }
.ct-polish-bar.warn b { color: #b45309; }
.ct-polish-bar.info { background: var(--surface-2); border-left: 3px solid var(--border-strong); }
.ct-polish-bar.info b { color: var(--text-2); }
.ct-polish-bar .btn { flex: none; }

/* 「看模板原稿」是次要操作，做成文字链接：和「复制全文」并排时不会抢视线，
   手机上也不会两个按钮互相挤到字都放不下。34px 高度保证手指点得到。 */
.ct-orig {
  color: var(--primary);
  background: transparent;
  border-color: transparent;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
  min-height: 34px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
}
.ct-orig:hover { background: var(--primary-soft); border-color: var(--primary-soft); }

@media (max-width: 820px) {
  /* 手机上横排会把提示文字挤成三行，按钮也没手指宽度，改成上下堆 */
  .ct-polish-bar { flex-direction: column; align-items: stretch; gap: 9px; }
  .ct-polish-bar .btn { width: 100%; }

  /* 稿子那节：标题 + 说明 + 「看原稿」挤第一行，主操作（复制全文）独占第二行。
     两个按钮并排会各剩 80px，字都放不下；一大一小又显得零碎。
     所以次要操作降到文字链接级别，主操作给足面积 —— 40px 是按手指点的尺寸。 */
  .ct-sec-head { flex-wrap: wrap; row-gap: 9px; }
  .ct-sec-head h4 { flex: 0 0 auto; }
  .ct-sec-hint { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ct-sec-head .btn:not(.ct-orig) {
    flex: 1 1 100%;
    min-height: 40px;
    margin-left: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .ct-orig { flex: 0 0 auto; margin-left: 0; }
}

/* ---------------- 代理商 / 配额（2026-11-04） ----------------
 * 配额条只在代理商登录后出现；平台方看代理名额是在详情抽屉里改。
 */
.ag-credit-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 14px; margin-bottom: 14px;
  border-radius: var(--radius);
  background: rgba(7, 193, 96, 0.08);
  border: 1px solid rgba(7, 193, 96, 0.22);
  font-size: 13px; color: var(--text-2);
}
.ag-credit-bar b { color: var(--text-1); font-weight: 600; }
.ag-credit-bar.is-full {
  background: var(--danger-soft);
  border-color: rgba(239, 68, 68, 0.28);
  color: #a8620a;
}

.ag-quota-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px; margin-bottom: 6px;
  border-radius: var(--radius); background: var(--bg);
  flex-wrap: wrap;
}
.ag-quota-label { font-size: 11px; color: var(--text-3); margin-bottom: 4px; }
.ag-quota-now { font-size: 14px; font-weight: 600; }
.ag-quota-edit { display: flex; align-items: center; gap: 8px; }
.ag-quota-edit input {
  width: 84px; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--text-1); font-size: 14px;
}

@media (max-width: 820px) {
  /* 手机上配额条会挤成两行，按钮要够手指点 */
  .ag-credit-bar { flex-direction: column; align-items: flex-start; gap: 6px; }
  .ag-quota-row { flex-direction: column; align-items: stretch; }
  .ag-quota-edit input { flex: 1; width: auto; }
  .ag-quota-edit .btn { height: 40px; }
}

/* ============================================================
   版本与额度（2026-11-04）
   ------------------------------------------------------------
   三块内容：版本徽标（卡片上）、额度条（代理顶部）、
   充值/流水/续费（弹窗与抽屉里）。
   颜色沿用设计系统：绿=正常、黄=临期、红=已到期或余额不足。
   ============================================================ */

/* ---- 版本徽标 ---- */
.plan-pill {
  flex: none; display: inline-block;
  font-size: 11px; font-weight: 600; line-height: 18px;
  padding: 1px 8px; border-radius: 999px; white-space: nowrap;
}
.plan-pill.is-ok { background: var(--success-soft); color: var(--success); }
.plan-pill.is-soon { background: var(--warning-soft); color: #b45309; }
.plan-pill.is-dead { background: var(--danger-soft); color: var(--danger); }
.plan-pill.is-free { background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border); }

.tnt-badges { display: flex; align-items: center; gap: 6px; flex: none; }
.tnt-price.is-bad { color: var(--danger); }

/* ---- 顶部到期提示条：客户每天第一眼看到的位置 ---- */
.plan-banner { padding: 0 28px 2px; }
.plan-banner.hidden { display: none; }
.plan-banner-inner {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 9px 14px; border-radius: var(--radius);
  font-size: 12.5px; line-height: 1.55;
}
.plan-banner-inner b { font-size: 13px; font-weight: 700; }
.plan-banner-inner em { font-style: normal; margin-left: auto; font-weight: 600; opacity: 0.85; }
.plan-banner-inner.is-dead { background: var(--danger-soft); color: #b42318; border: 1px solid rgba(239, 68, 68, 0.28); }
.plan-banner-inner.is-soon { background: var(--warning-soft); color: #b45309; border: 1px solid rgba(245, 158, 11, 0.3); }

/* ---- 代理额度条：左余额、右名额 ---- */
.ag-quota-money, .ag-quota-side { display: flex; flex-direction: column; gap: 3px; }
.ag-quota-side { align-items: flex-end; text-align: right; }
.ag-quota-bal { font-size: 13px; color: var(--text-2); }
.ag-quota-bal b { font-size: 17px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.ag-credit-bar.is-full .ag-quota-bal b { color: var(--danger); }
.ag-quota-sub { font-size: 11.5px; color: var(--text-3); }

/* ---- 开户/续费的版本选择卡 ---- */
.plan-pick { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 4px; }
.plan-opt {
  display: block; cursor: pointer;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  background: var(--surface); transition: border-color 0.15s, background 0.15s;
}
.plan-opt:hover { border-color: var(--border-strong); }
.plan-opt input { position: absolute; opacity: 0; pointer-events: none; }
.plan-opt-body { padding: 10px 13px; }
.plan-opt-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.plan-opt-top b { font-size: 13.5px; color: var(--text); }
.plan-opt-top em { font-style: normal; font-size: 11.5px; color: var(--text-3); }
.plan-opt-price {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 4px; font-size: 12px; color: var(--text-2);
}
.plan-opt-price i {
  font-style: normal; font-weight: 600; color: var(--primary);
  background: var(--primary-soft); border-radius: 999px; padding: 1px 8px;
}
/* 选中态：整卡高亮，不靠那个看不见的 radio */
.plan-opt:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.plan-opt:has(input:checked) .plan-opt-price i { background: var(--surface); }

/* ---- 续费预览：选完档位立刻算「续到哪天、扣多少」 ---- */
.renew-preview { margin: 10px 0 14px; }
.renew-line {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 13px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-2);
}
.renew-line b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.renew-line.is-bad { background: var(--danger-soft); border-color: rgba(239, 68, 68, 0.28); color: #b42318; }
.renew-warn { margin-top: 6px; font-size: 12px; color: var(--danger); font-weight: 600; }

/* ---- 代理额度卡片（抽屉顶部） ---- */
.credit-card {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 15px 16px; margin-bottom: 14px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary-soft), var(--surface));
  border: 1px solid rgba(79, 70, 229, 0.18);
}
.credit-main { display: flex; flex-direction: column; gap: 2px; }
.credit-label { font-size: 11.5px; color: var(--text-3); }
.credit-amount { font-size: 25px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.15; }
.credit-sub { font-size: 11.5px; color: var(--text-3); }

/* ---- 额度流水 ---- */
.ledger-line {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: baseline; gap: 6px 10px;
  padding: 9px 0; border-bottom: 1px dashed var(--border);
  font-size: 12.5px;
}
.ledger-line:last-child { border-bottom: none; }
.ledger-kind {
  font-size: 11px; text-align: center; border-radius: 999px; padding: 1px 0;
  background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border);
}
.ledger-kind.k-topup { background: var(--success-soft); color: var(--success); border-color: transparent; }
.ledger-kind.k-open, .ledger-kind.k-renew { background: var(--info-soft); color: var(--info); border-color: transparent; }
.ledger-name { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger-line b { font-variant-numeric: tabular-nums; }
.ledger-line b.is-in { color: var(--success); }
.ledger-line b.is-out { color: var(--danger); }
.ledger-line em {
  grid-column: 2 / 4; font-style: normal; font-size: 11px; color: var(--text-3);
}

/* ---- 充值弹窗的快捷金额 ---- */
.topup-quick { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--border-strong); background: var(--surface);
  border-radius: 999px; padding: 6px 14px; font-size: 12.5px; color: var(--text-2);
  cursor: pointer; font-variant-numeric: tabular-nums;
}
.chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

.tnt-plan-tip { font-size: 12px; color: var(--text-2); line-height: 1.6; margin: 0 0 10px; }

@media (max-width: 820px) {
  /* 手机：提示条左右挤不下，改成上下排；额度条同样竖排 */
  .plan-banner { padding: 0 14px 2px; }
  .plan-banner-inner { flex-direction: column; align-items: flex-start; gap: 4px; }
  .plan-banner-inner em { margin-left: 0; }
  .ag-quota-side { align-items: flex-start; text-align: left; }
  .credit-card { flex-direction: column; align-items: stretch; gap: 10px; }
  .credit-card .btn { height: 40px; }
  /* 版本卡在手机上要整块可点，触控高度不低于 44px */
  .plan-opt-body { padding: 12px 13px; }
  .plan-opt-price { flex-wrap: wrap; }
  .ledger-line { grid-template-columns: 52px 1fr auto; }
  /* 四列统计在 390px 下每格只剩 80 多 px，「我的客户」会被折成两行 */
  .ind-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* 额度条右下角的「明细 / 对账」入口（2026-11-04 晚补）
   代理自己查账用。放在额度条里而不是另开菜单：代理只有一页，
   多一个菜单项就等于告诉他"还有别的活要干"，实际只是查账。 */
.ag-quota-side .btn {
  margin-top: 6px;
  align-self: flex-end;
  height: 26px;
  padding: 0 10px;
  font-size: 11.5px;
}
@media (max-width: 820px) {
  .ag-quota-side .btn { align-self: flex-start; height: 32px; padding: 0 14px; font-size: 12.5px; }
}
