/* ============================================
   网销客户管理系统 — 现代视觉主题 v2
   ============================================ */

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

:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #eef2ff;
  --accent: #7c3aed;
  --grad-main: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --grad-sidebar: linear-gradient(180deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);

  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --info: #0ea5e9;

  --text-1: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --text-muted: #64748b;
  --text-sidebar: #94a3b8;

  --bg-page: #f1f5f9;
  --bg-card: #ffffff;
  --bg-2: #f8fafc;
  --bg-3: #f1f5f9;
  --border: #e2e8f0;
  --border-light: #f1f5f9;

  --radius: 8px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 6px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12), 0 4px 12px rgba(15, 23, 42, 0.06);

  --sidebar-w: 232px;
  --transition: 0.2s ease;
}

html, body { height: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg-page);
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============================================
   登录页
   ============================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 45%, #4c1d95 100%);
}
.login-page::before,
.login-page::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
}
.login-page::before {
  width: 420px; height: 420px;
  background: radial-gradient(circle, #818cf8 0%, transparent 70%);
  top: -120px; left: -100px;
}
.login-page::after {
  width: 480px; height: 480px;
  background: radial-gradient(circle, #c084fc 0%, transparent 70%);
  bottom: -160px; right: -120px;
}
.login-box {
  width: 400px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 44px 40px 36px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
  position: relative;
  z-index: 1;
  animation: fadeUp 0.5s ease-out;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.login-logo { text-align: center; margin-bottom: 30px; }
.logo-icon {
  width: 60px; height: 60px;
  background: var(--grad-main);
  color: #fff; font-size: 24px; font-weight: 800;
  border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.35);
  letter-spacing: -0.5px;
}
.logo-icon.sm { width: 38px; height: 38px; font-size: 17px; border-radius: 11px; box-shadow: none; }
.login-logo h2 { font-size: 22px; font-weight: 700; color: var(--text-1); margin-bottom: 5px; letter-spacing: 0.5px; }
.login-logo p { font-size: 13px; color: var(--text-3); }

.login-form .form-group { margin-bottom: 18px; }
.login-form label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 7px; font-weight: 500; }
.login-form input {
  width: 100%; height: 46px; padding: 0 14px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 14px; transition: all 0.2s;
  background: #f8fafc;
  color: var(--text-1);
}
.login-form input:focus {
  outline: none; border-color: var(--primary);
  background: #fff; box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.btn-login {
  width: 100%; height: 46px; border: none; border-radius: 10px;
  background: var(--grad-main);
  color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
  letter-spacing: 4px;
}
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(79, 70, 229, 0.4); }
.btn-login:active { transform: translateY(0); }
.login-hint { text-align: center; margin-top: 18px; font-size: 12px; color: var(--text-3); }
.server-toggle-link {
  display: block; text-align: center; margin-top: 14px;
  font-size: 12px; color: var(--text-3); cursor: pointer; text-decoration: none;
  transition: color 0.15s;
}
.server-toggle-link:active { color: var(--primary); }

/* 批量操作栏：自动换行 */
.batch-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 8px 12px; margin-bottom: 8px;
  background: #f1f5f9; border-radius: 10px;
}
.batch-bar .btn { white-space: nowrap; flex: 0 1 auto; min-width: 0; text-align: center; padding: 6px 12px; }

/* 手机端批量操作栏：已选计数单独一行，按钮2列 */
@media (max-width: 768px) {
  .batch-bar #custSelectedCount,
  .batch-bar #poolSelectedCount,
  .batch-bar #poolSelectedCountSales {
    flex: 1; margin-right: 0;
  }
  .batch-bar input[type="checkbox"] { flex-shrink: 0; }
}

/* ============================================
   主应用布局
   ============================================ */
.app-page { display: flex; min-height: 100vh; }

/* ---- 侧边栏（深色渐变） ---- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--grad-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100;
  box-shadow: 4px 0 20px rgba(15, 23, 42, 0.08);
  transition: width 0.25s ease;
}
.sidebar.collapsed { width: 64px; }
.sidebar-logo {
  height: 64px; display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 16px; font-weight: 600; color: #f8fafc;
  letter-spacing: 0.3px;
  position: relative;
}
.sidebar-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border-radius: 6px;
  background: rgba(255,255,255,0.08); border: none;
  color: #94a3b8; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: all 0.2s;
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.16); color: #e2e8f0; }

/* ---- 侧边栏收起状态 ---- */
.sidebar.collapsed .sidebar-logo span { display: none; }
.sidebar.collapsed .sidebar-toggle { right: 18px; }
.sidebar.collapsed .sidebar-toggle svg { transform: rotate(180deg); }
.sidebar.collapsed .nav-item { justify-content: center; padding: 11px 0; gap: 0; }
.sidebar.collapsed .nav-item span { display: none; }
.sidebar.collapsed .nav-item.active::before { display: none; }
.sidebar.collapsed .sidebar-footer { padding: 14px 8px; }
.sidebar.collapsed .user-info { display: none; }
.sidebar.collapsed .btn-logout { padding: 0; width: 36px; height: 36px; margin: 0 auto; font-size: 0; }
.sidebar.collapsed .btn-logout::before {
  content: '';
  display: inline-block;
  width: 16px; height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23cbd5e1' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpolyline points='16 17 21 12 16 7'/%3E%3Cline x1='21' y1='12' x2='9' y2='12'/%3E%3C/svg%3E") center/contain no-repeat;
}

.sidebar-nav { flex: 1; padding: 14px 12px; overflow-y: auto; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }
/* ---- 侧边栏分组标题（10-13 加：客户业务 / 营销工具 / 管理） ----
   原「产品库 / 自动提单 / 联通订单查询」独立在底部 sidebar-extra 里，
   现统一并入 nav 的「营销工具」组；整组菜单被授权隐藏时标题由
   syncNavGroupTitles() 一并隐藏。 */
.nav-group-title {
  padding: 10px 14px 5px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.6px;
  color: rgba(203, 213, 225, 0.42);
  user-select: none;
}
.sidebar-nav > .nav-group-title:first-child { padding-top: 0; }
.sidebar.collapsed .nav-group-title { display: none; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  margin-bottom: 3px;
  color: var(--text-sidebar); font-size: 14px; cursor: pointer;
  transition: all var(--transition); text-decoration: none;
  border-radius: 10px;
  position: relative;
}
.nav-item svg { flex-shrink: 0; opacity: 0.8; transition: all var(--transition); }
.nav-item:hover { background: rgba(255, 255, 255, 0.08); color: #e2e8f0; transform: translateX(2px); }
.nav-item:hover svg { opacity: 1; }
.nav-item.active {
  background: var(--grad-main);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}
.nav-item.active svg { opacity: 1; }
.nav-item.active::before {
  content: '';
  position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 22px;
  background: #fff;
  border-radius: 0 4px 4px 0;
}
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.user-info {
  font-size: 13px; color: #cbd5e1;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
  overflow: hidden;
}
.user-info .role-tag {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 500;
  flex-shrink: 0;
}
.role-tag.admin { background: rgba(251, 191, 36, 0.18); color: #fbbf24; }
.role-tag.sales { background: rgba(129, 140, 248, 0.2); color: #a5b4fc; }
.btn-logout {
  width: 100%; height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  font-size: 13px; cursor: pointer; transition: all 0.18s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-logout:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
}

/* ---- 主内容区 ---- */
.main-content {
  flex: 1; margin-left: var(--sidebar-w);
  padding: 0;
  min-width: 0;
  background:
    radial-gradient(1200px 400px at 100% 0%, rgba(79, 70, 229, 0.04), transparent 60%);
  transition: margin-left 0.25s ease;
}
.main-content.collapsed { margin-left: 64px; }
.page-content { display: none; padding: 28px 32px; max-width: 1600px; margin: 0 auto; }
.page-content.active { display: block; animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px;
  flex-wrap: wrap; gap: 12px;
}
.page-header h1 {
  font-size: 22px; font-weight: 700;
  letter-spacing: 0.3px;
  display: flex; align-items: center; gap: 10px;
}
.page-header h1::before {
  content: '';
  width: 4px; height: 24px;
  background: var(--grad-main);
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(79, 70, 229, 0.3);
}
.header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ============================================
   按钮
   ============================================ */
.btn {
  height: 36px; padding: 0 16px;
  border: none; border-radius: 9px;
  font-size: 13px; font-weight: 500; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.18s;
  white-space: nowrap;
}
.btn-sm { height: 32px; padding: 0 13px; font-size: 12.5px; border-radius: 8px; }
.btn-primary { background: var(--grad-main); color: #fff; box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25); }
.btn-primary:hover { box-shadow: 0 6px 18px rgba(79, 70, 229, 0.4); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-success { background: linear-gradient(135deg, #10b981, #059669); color: #fff; box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25); }
.btn-success:hover { box-shadow: 0 6px 18px rgba(16, 185, 129, 0.38); transform: translateY(-1px); }
.btn-secondary { background: #f1f5f9; color: var(--text-1); border: 1px solid var(--border); }
.btn-secondary:hover { background: #e2e8f0; }
.btn-danger { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25); }
.btn-danger:hover { box-shadow: 0 6px 18px rgba(239, 68, 68, 0.38); transform: translateY(-1px); }
.btn-outline { background: #fff; border: 1px solid var(--border); color: var(--text-2); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-link { background: none; border: none; color: var(--primary); padding: 3px 4px; cursor: pointer; font-size: 12px; border-radius: 4px; font-weight: 500; }
.btn-link:hover { background: var(--primary-light); text-decoration: none; }
.btn-link.danger { color: var(--danger); }
.btn-link.danger:hover { background: var(--danger-light); }
.btn-link.warning { color: var(--warning); }
.btn-link.warning:hover { background: var(--warning-light); }
.btn-link:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-link:disabled:hover { background: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ============================================
   状态一键推进按钮 + 跟进话术模板
   ============================================ */
.btn-next-status {
  background: var(--primary-light);
  border: 0.5px solid var(--primary);
  color: var(--primary);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.btn-next-status:hover { background: var(--primary); color: #fff; }
.btn-next-status:disabled { opacity: 0.5; cursor: wait; }
.m-card-actions .btn-next-status { padding: 6px 10px; border-radius: 8px; }
.btn-next-status.loading { opacity: 0.7; cursor: wait; }
.follow-tpl-chip {
  background: #f1f5f9;
  border: 0.5px solid #e2e8f0;
  color: #475569;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.follow-tpl-chip:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }

/* ============================================
   数据看板
   ============================================ */
.dashboard-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
  width: fit-content;
}
.dash-tab {
  padding: 8px 22px;
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
  font-weight: 500;
}
.dash-tab:hover { color: var(--primary); }
.dash-tab.active {
  background: #fff;
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}
.dash-panel { display: none; }
.dash-panel.active { display: block; }

.trend-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.stat-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}
.stat-section { }
.stat-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  margin: 0 0 6px;
  letter-spacing: 0.4px;
}
.sales-detail-table {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.sales-detail-table .data-table { margin: 0; }
.sales-detail-table .data-table th { font-size: 12px; padding: 8px 6px; white-space: nowrap; }
.sales-detail-table .data-table td { padding: 8px 6px; text-align: center; white-space: nowrap; }
@media (max-width: 768px) {
  .sales-detail-table .data-table { font-size: 11px; min-width: 800px; }
  .sales-detail-table .data-table th { padding: 6px 4px; }
  .sales-detail-table .data-table td { padding: 6px 4px; }
}

/* 手机号复制 */
.phone-copy {
  cursor: pointer;
  color: var(--primary);
  font-weight: 500;
  border-bottom: 1px dashed var(--primary);
  user-select: all;
}
.phone-copy:hover { color: var(--primary-dark); }

/* 阶段明细弹窗：桌面端显示表格，手机端显示卡片 */
.stage-detail-mobile { display: none; }
.stage-detail-desktop { display: block; }

/* 手机端卡片样式 */
.stage-detail-card {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
}
.stage-detail-card:active { background: #f1f5f9; }
.stage-detail-card:last-child { border-bottom: none; }
.sdc-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.sdc-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
}
.sdc-status {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 500;
}
.sdc-phone {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}
.sdc-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-2);
}
.sdc-hint {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 11px;
  color: var(--text-3);
  display: none;
}

@media (max-width: 768px) {
  .stage-detail-desktop { display: none; }
  .stage-detail-mobile { display: block; }
  .sdc-hint { display: block; }
  .modal { padding: 0; }
  .modal-content {
    width: 100%;
    max-width: 100%;
    height: 85vh;
    max-height: 85vh;
    border-radius: 16px 16px 0 0;
    margin: 0;
    bottom: 0;
    top: auto;
    position: fixed;
    display: flex;
    flex-direction: column;
  }
  .modal-header {
    padding: 14px 16px;
    flex-shrink: 0;
  }
  .modal-header h3 { font-size: 15px; }
  .modal-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .modal-footer {
    flex-shrink: 0;
    padding: 10px 12px !important;
  }
}
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition);
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--sc, var(--primary));
  opacity: 0.5;
  transition: all 0.3s;
}
.stat-card::after {
  content: '';
  position: absolute; right: -18px; top: -18px;
  width: 68px; height: 68px;
  border-radius: 50%;
  opacity: 0.06;
  transition: all 0.3s;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.stat-card:hover::before { opacity: 1; width: 4px; }
.stat-card:hover::after { transform: scale(1.8); opacity: 0.1; }
.stat-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.1);
}
.stat-icon svg { width: 18px; height: 18px; }
.stat-info { min-width: 0; }
.stat-card .label { font-size: 12px; color: var(--text-2); margin-bottom: 2px; white-space: nowrap; }
.stat-card .value { font-size: 20px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.15; }

.stat-card.blue { --sc: #4f46e5; }
.stat-card.green { --sc: #10b981; }
.stat-card.yellow { --sc: #ca8a04; }
.stat-card.orange { --sc: #f59e0b; }
.stat-card.purple { --sc: #8b5cf6; }
.stat-card.red { --sc: #f43f5e; }
.stat-card .stat-icon { background: var(--sc); background: linear-gradient(135deg, var(--sc), color-mix(in srgb, var(--sc), #000 18%)); }
.stat-card .value { color: var(--sc); }
.stat-card::after { background: var(--sc); }

.chart-row { display: flex; gap: 16px; }
.chart-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  flex: 1;
  height: 420px;
  display: flex;
  flex-direction: column;
}
.chart-card h3 {
  font-size: 15px; font-weight: 600;
  margin-bottom: 18px;
  display: flex; align-items: center; gap: 8px;
}
.chart-card h3::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--grad-main);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}
.chart-left { flex: 1.1; }
.chart-right { flex: 1; }
.chart-container { min-height: 300px; flex: 1; overflow: hidden; }
/* 趋势图画布容器：必须固定高度，否则 Chart.js 会无限撑高画布 */
.chart-body { position: relative; height: 280px; }
.chart-body canvas { display: block; }

/* 漏斗 */
.funnel-bar { display: flex; align-items: center; margin-bottom: 12px; }
.funnel-bar .stage-name {
  width: 88px; font-size: 13px; color: var(--text-2); text-align: right; padding-right: 12px;
  white-space: nowrap;
}
.funnel-bar .bar-wrap {
  flex: 1;
  background: #f1f5f9;
  border-radius: 8px;
  height: 30px;
  overflow: hidden;
}
.funnel-bar .bar {
  height: 100%;
  border-radius: 8px;
  display: flex; align-items: center;
  padding: 0 12px;
  color: #fff; font-size: 12.5px; font-weight: 700;
  transition: width 0.5s ease;
  min-width: 34px;
  letter-spacing: 0.3px;
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.08);
}
.funnel-bar .bar-info {
  margin-left: 10px; font-size: 12.5px; color: var(--text-2); white-space: nowrap;
  min-width: 52px; font-variant-numeric: tabular-nums;
}

/* ============================================
   筛选标签栏
   ============================================ */
.filter-tabs {
  display: flex; gap: 6px; margin-bottom: 16px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
  width: fit-content;
}
.filter-tabs .tab {
  padding: 7px 16px; border: none; background: transparent;
  font-size: 13px; color: var(--text-2); cursor: pointer;
  border-radius: 8px; transition: all 0.18s;
  font-weight: 500;
}
.filter-tabs .tab:hover { color: var(--primary); }
.filter-tabs .tab.active {
  background: #fff; color: var(--primary); font-weight: 600;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
}
.filter-tabs .tab-warn.active {
  background: #fff; color: #f59e0b; font-weight: 600;
}
.filter-tabs .tab-badge {
  display: inline-block;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  padding: 0 5px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9px;
  text-align: center;
  margin-left: 4px;
}
.filter-tabs .tab-badge.tab-badge-warn {
  background: #f59e0b;
  animation: pulse-warn 2s ease-in-out infinite;
}
/* 快捷标签：彩色圆点 + 状态数量 */
.filter-tabs .tab-dot {
  display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  margin-right: 6px; vertical-align: 1px;
}
.filter-tabs .tab-count {
  display: inline-block;
  min-width: 18px;
  height: 18px; line-height: 18px;
  padding: 0 6px;
  margin-left: 5px;
  font-size: 11px; font-weight: 600;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.08);
  color: var(--text-2);
  text-align: center;
  vertical-align: 1px;
}
.filter-tabs .tab-count.tab-count-red { background: #fee2e2; color: #dc2626; }
.filter-tabs .tab-count.tab-count-amber { background: #fef3c7; color: #d97706; }
.filter-tabs .tab.active.tab-c-slate { color: #475569; }
.filter-tabs .tab.active.tab-c-amber { color: #f59e0b; }
.filter-tabs .tab.active.tab-c-sky { color: #0ea5e9; }
.filter-tabs .tab.active.tab-c-blue { color: #3b82f6; }
.filter-tabs .tab.active.tab-c-green { color: #22c55e; }
.filter-tabs .tab.active.tab-c-violet { color: #8b5cf6; }
.filter-tabs .tab.active.tab-c-fuchsia { color: #d946ef; }
.filter-tabs .tab.active.tab-c-orange { color: #f97316; }
.filter-tabs .tab.active.tab-c-red { color: #ef4444; }
.filter-tabs .tab.active.tab-c-teal { color: #14b8a6; }
@keyframes pulse-warn {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* 快捷统计卡片 */
.quick-stats-row {
  display: flex;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.quick-stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1.5px solid var(--border-light);
  border-radius: 12px;
  padding: 14px 20px;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 160px;
}
.quick-stat-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.12);
  transform: translateY(-1px);
}
.qs-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.qs-icon-primary { background: var(--primary-light); }
.qs-icon-warning { background: #fef3c7; }
.qs-info { display: flex; flex-direction: column; gap: 2px; }
.qs-num {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.2;
}
.qs-label {
  font-size: 13px;
  color: var(--text-2);
}
/* 今日待跟进卡片：未变化天数分层（竖排小胶囊，靠卡片右侧） */
.qs-sub {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-end;
}
.qs-bucket {
  display: inline-block;
  font-size: 10.5px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 999px;
  white-space: nowrap;
}
.qs-bucket b {
  font-weight: 600;
  margin-left: 2px;
}
.qs-bucket.b-ok  { background: #dcfce7; color: #15803d; }
.qs-bucket.b-mid { background: #fef3c7; color: #b45309; }
.qs-bucket.b-hot { background: #fee2e2; color: #b91c1c; }

/* ============================================
   筛选栏
   ============================================ */
.filter-bar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
}
.search-input {
  height: 36px; width: 200px; padding: 0 14px;
  border: 1.5px solid var(--border); border-radius: 9px; font-size: 13px;
  background: #fff; transition: all 0.18s;
  color: var(--text-1);
}
.search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1); }
.search-input::placeholder { color: var(--text-3); }

.search-input-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.search-input-wrap .search-input {
  padding-right: 32px;
}
.search-clear-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px; height: 22px;
  border: none;
  background: #e2e8f0;
  color: #64748b;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  padding: 0;
}
.search-clear-btn:hover {
  background: #cbd5e1;
  color: #334155;
}
.filter-select {
  height: 36px; padding: 0 10px;
  border: 1.5px solid var(--border); border-radius: 9px; font-size: 13px;
  background: #fff; cursor: pointer; transition: all 0.18s;
  color: var(--text-1);
  min-width: 95px; max-width: 140px;
}
.filter-select:focus { outline: none; border-color: var(--primary); }
/* 筛选栏内的可搜索下拉，宽度与 filter-select 一致 */
.filter-search-select { width: 110px; flex-shrink: 0; }
.filter-search-select .search-select-input { height: 36px; padding: 0 28px 0 10px; border-radius: 9px; font-size: 13px; }
.filter-search-select::after { right: 9px; }

/* 省市区筛选三联器：并排一行，更紧凑 */
.filter-region-row {
  display: flex;
  gap: 8px;
  width: 330px;
  flex-shrink: 0;
}
.filter-region-row .filter-search-select {
  flex: 1;
  min-width: 0;
  width: auto;
}
.date-input {
  height: 36px; padding: 0 10px;
  border: 1.5px solid var(--border); border-radius: 9px; font-size: 13px;
  background: #fff; transition: all 0.18s;
  color: var(--text-1);
}

/* 字段筛选栏已合并到 filter-bar */
.date-input:focus { outline: none; border-color: var(--primary); }

/* ============================================
   日期范围选择器
   ============================================ */
.date-range-picker { position: relative; }
.date-range-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 32px 0 12px;
  border: 1.5px solid var(--border); border-radius: 9px;
  background: #fff; color: var(--text-2); font-size: 13px;
  cursor: pointer; transition: all 0.18s;
  user-select: none;
}
.date-range-trigger:hover { border-color: var(--primary); color: var(--primary); }
.date-range-trigger.dr-active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }
.dr-icon { width: 16px; height: 16px; flex-shrink: 0; }
.dr-label { color: var(--text-3); }
.dr-sep { color: var(--text-3); margin: 0 2px; }
.dr-value { color: var(--primary); font-weight: 500; }
.dr-caret { width: 14px; height: 14px; color: var(--text-3); margin-left: 4px; transition: transform 0.2s; }
.dr-active .dr-caret { transform: rotate(180deg); }
.dr-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; border-radius: 50%;
  border: none; background: var(--text-3); color: #fff;
  cursor: pointer; font-size: 12px; line-height: 1;
  display: none; align-items: center; justify-content: center;
}
.dr-clear:hover { background: #ef4444; }

.date-range-panel {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 1000;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
  padding: 16px; width: auto; min-width: 560px;
}
@keyframes drFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.dr-shortcuts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.dr-shortcut {
  padding: 4px 12px; border: 1px solid var(--border); border-radius: 6px;
  background: #fff; color: var(--text-2); font-size: 12px;
  cursor: pointer; transition: all 0.15s;
}
.dr-shortcut:hover { border-color: var(--primary); color: var(--primary); background: rgba(79,70,229,0.05); }
.dr-shortcut.dr-active { background: var(--primary); color: #fff; border-color: var(--primary); }

.dr-calendar-row { display: flex; align-items: flex-start; gap: 12px; }
.dr-cal { flex: 1; min-width: 240px; }
.dr-cal-sep { color: var(--text-3); font-size: 14px; padding-top: 40px; text-align: center; }

.dr-cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dr-cal-title { font-size: 13px; font-weight: 600; color: var(--text-1); }
.dr-cal-nav {
  width: 26px; height: 26px; border: none; background: transparent;
  border-radius: 6px; cursor: pointer; color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.dr-cal-nav:hover { background: var(--bg-2, #f8fafc); color: var(--primary); }

.dr-cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 4px; }
.dr-cal-weekdays div { text-align: center; font-size: 11px; color: var(--text-3); padding: 4px 0; }

.dr-cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dr-cal-days div {
  text-align: center; padding: 6px 0; font-size: 12px;
  border-radius: 6px; cursor: pointer; transition: all 0.12s;
  color: var(--text-2);
}
.dr-cal-days div:hover { background: var(--bg-2, #f8fafc); }
.dr-cal-days.dr-empty { cursor: default; }
.dr-cal-days.dr-empty:hover { background: transparent; }
.dr-cal-days.dr-today { font-weight: 600; color: var(--primary); border: 1.5px solid var(--primary); }
.dr-cal-days.dr-today::after {
  content: ''; display: block; width: 3px; height: 3px;
  background: var(--primary); border-radius: 50%; margin: 1px auto 0;
}
.dr-cal-days.dr-selected {
  background: var(--primary);
  color: #fff !important;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(79,70,229,0.4);
  transform: scale(1.08);
}
.dr-cal-days.dr-selected::after { display: none; }
.dr-cal-days.dr-in-range {
  background: rgba(79,70,229,0.18);
  color: #4f46e5;
  border-radius: 0;
}
.dr-cal-days.dr-range-start {
  border-radius: 8px 0 0 8px;
  background: var(--primary);
  color: #fff !important;
  font-weight: 700;
  position: relative;
  box-shadow: 0 3px 8px rgba(79,70,229,0.5);
  transform: scale(1.05);
  z-index: 2;
}
.dr-cal-days.dr-range-start::before {
  content: '起';
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 700;
  background: #fff;
  color: var(--primary);
  padding: 1px 5px;
  border-radius: 6px;
  border: 1.5px solid var(--primary);
  line-height: 1.2;
  box-shadow: 0 2px 4px rgba(79,70,229,0.2);
}
.dr-cal-days.dr-range-end {
  border-radius: 0 8px 8px 0;
  background: var(--primary);
  color: #fff !important;
  font-weight: 600;
}
.dr-cal-days.dr-range-start.dr-range-end {
  border-radius: 8px;
}
.dr-cal-days.dr-range-start.dr-range-end {
  background: var(--primary);
  color: #fff !important;
}
.dr-cal-days.dr-disabled { color: var(--text-3); cursor: not-allowed; opacity: 0.4; }
.dr-cal-days.dr-disabled:hover { background: transparent; }

.dr-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
}
.dr-footer button { pointer-events: auto; cursor: pointer; }
.dr-range-info { font-size: 12px; color: var(--text-3); }
.dr-range-info.dr-ready { color: var(--primary); font-weight: 500; }

/* 响应式 */
@media (max-width: 720px) {
  .date-range-panel { min-width: auto; width: calc(100vw - 32px); right: -16px; left: 16px; }
  .dr-calendar-row { flex-direction: column; }
  .dr-cal-sep { padding: 8px 0; }
  .dr-cal { min-width: auto; }
}

/* ============================================
   表格
   ============================================ */
.table-wrap {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow-x: auto;
  overflow-y: visible !important;
}
.table-scroll { overflow-x: auto; }
.data-table {
  width: 100%; border-collapse: collapse; font-size: 12.5px;
  min-width: 720px;
}
/* 大屏优化：充分利用屏幕宽度，减少内边距 */
@media (min-width: 1201px) {
  .data-table { font-size: 12px; }
  .data-table th { padding: 8px 4px; }
  .data-table td { padding: 6px 4px; }
  .data-table .th-filter-row th { padding: 2px 3px; }
  .page-content { max-width: none; }
}
.data-table th {
  background: var(--bg-2);
  padding: 10px 6px; text-align: left;
  font-weight: 600; color: var(--text-2);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
  font-size: 12px;
  letter-spacing: 0;
}
/* 账号管理：可点击排序的表头 */
.th-sortable { cursor: pointer; user-select: none; }
.th-sortable:hover { color: #2563eb; }
.data-table td {
  padding: 8px 6px; border-bottom: 1px solid var(--border-light);
  color: var(--text-1); white-space: nowrap;
}
.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover td { background: var(--primary-light); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tr.row-overdue td { background: var(--danger-light) !important; }
.data-table tr.row-overdue td:first-child {
  box-shadow: inset 3px 0 0 var(--danger);
}
.data-table .text-center { text-align: center; }

/* 表头筛选行 */
.data-table .th-filter-row th {
  padding: 3px 4px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 400;
}
.th-filter {
  width: 100%;
  box-sizing: border-box;
  font-size: 10.5px;
  height: 22px;
  padding: 1px 3px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #fff;
  color: #475569;
  outline: none;
  transition: border-color 0.15s;
  position: relative;
  z-index: 10;
}
.th-filter:focus { border-color: var(--primary); }
.th-filter option { font-size: 12px; }

/* 行内快捷编辑 */
.inline-edit {
  cursor: pointer;
  border-bottom: 1px dashed #cbd5e1;
  padding: 1px 3px;
  border-radius: 3px;
  transition: all 0.15s;
  display: inline-block;
  min-width: 16px;
}
.inline-edit:hover {
  border-bottom-color: var(--primary);
  color: var(--primary);
  background: rgba(99,102,241,0.06);
}
.inline-select {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 11.5px;
  background: var(--bg-input, #fff);
  color: var(--text-1);
  cursor: pointer;
  max-width: 78px;
  min-width: 48px;
  height: 24px;
  line-height: 1.2;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  position: relative;
  z-index: 5;
}
.inline-select:hover {
  border-color: var(--primary);
}
.inline-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99,102,241,0.15);
}
.inline-select.region-select {
  max-width: 110px;
}
.inline-select.region-select[data-field="province"] {
  max-width: 70px;
  min-width: 60px;
}
.inline-select:empty {
  color: #94a3b8;
}
.phone-red,
.m-card-sub.phone-red,
.m-card-phone.phone-red {
  color: #ef4444 !important;
  font-weight: 600;
}
.copy-phone {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s;
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 13px;
  user-select: none;
}
.copy-phone:hover {
  background: rgba(79,70,229,0.1);
  color: var(--primary);
  text-decoration: underline;
}
.inline-edit-input {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid var(--primary);
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-1);
  background: #fff;
  box-sizing: border-box;
  outline: none;
}

/* 状态标签（胶囊） */
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 500;
  white-space: nowrap;
}
.status-badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}
.status-badge.s-pending { background: #e0f2fe; color: #0369a1; }
.status-badge.s-added { background: #dbeafe; color: #1d4ed8; }
.status-badge.s-wechat { background: #dcfce7; color: #15803d; }
.status-badge.s-following { background: #ede9fe; color: #6d28d9; }
.status-badge.s-workno { background: #fae8ff; color: #a21caf; }
.status-badge.s-order { background: #fee2e2; color: #b91c1c; }
.status-badge.s-card-sent { background: #ffedd5; color: #c2410c; }
.status-badge.s-activated { background: #ccfbf1; color: #0f766e; }
.status-badge.s-abandon { background: var(--danger-light); color: #b91c1c; }
.status-badge.s-invalid { background: #f3f4f6; color: #4b5563; text-decoration: line-through; }
.status-badge.s-card-opened { background: #d1fae5; color: #065f46; }
.status-badge.s-order-yes { background: #d1fae5; color: #065f46; font-weight: 600; }

/* 客户等级标签 */
.level-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 6px;
  vertical-align: middle;
}
.level-badge.level-card {
  position: static;
  margin: 0;
  flex-shrink: 0;
}
.level-vip { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }
.level-important { background: #fef3c7; color: #b45309; }
.level-normal { background: #f1f5f9; color: #64748b; }

/* 客户等级下拉选择器 */
.level-select {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex; align-items: center;
  padding: 3px 22px 3px 10px;
  border-radius: 20px;
  font-size: 12px; font-weight: 500;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 12px;
}
.level-select.level-vip { background-color: #fef3c7; color: #b45309; font-weight: 600; }
.level-select.level-important { background-color: #fef3c7; color: #b45309; }
.level-select.level-normal { background-color: #f1f5f9; color: #64748b; }

/* 公海退回来源标签 */
.pool-return-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  line-height: 16px;
}
.pool-return-auto { background-color: #fef2f2; color: #dc2626; }
.pool-return-manual { background-color: #eff6ff; color: #2563eb; }
.pool-return-batch { background-color: #fff7ed; color: #ea580c; }
.pool-return-delete { background-color: #f1f5f9; color: #64748b; }

/* 地区筛选：省/市/区横向三选等宽 */
.region-filter-row { display: flex; gap: 2px; }
.region-filter-row select { flex: 1; width: 100%; min-width: 0; }

/* 快捷状态选择器 */
.quick-status-select {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex; align-items: center;
  padding: 3px 22px 3px 10px;
  border-radius: 20px;
  font-size: 12px; font-weight: 500;
  white-space: nowrap;
  border: 1px solid transparent;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2364748b' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.quick-status-select:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.quick-status-select.s-pending   { background-color: #e0f2fe; color: #0369a1; border-color: #7dd3fc; }
.quick-status-select.s-added     { background-color: #dbeafe; color: #1d4ed8; border-color: #93c5fd; }
.quick-status-select.s-wechat    { background-color: #dcfce7; color: #15803d; border-color: #86efac; }
.quick-status-select.s-following { background-color: #ede9fe; color: #6d28d9; border-color: #c4b5fd; }
.quick-status-select.s-workno    { background-color: #fae8ff; color: #a21caf; border-color: #f0abfc; }
.quick-status-select.s-order    { background-color: #fee2e2; color: #b91c1c; border-color: #fca5a5; }
.quick-status-select.s-card-sent { background-color: #ffedd5; color: #c2410c; border-color: #fdba74; }
.quick-status-select.s-activated { background-color: #ccfbf1; color: #0f766e; border-color: #5eead4; }
.quick-status-select.s-abandon   { background-color: var(--danger-light); color: #b91c1c; border-color: #fca5a5; }
.quick-status-select.s-invalid   { background-color: #f3f4f6; color: #4b5563; border-color: #d1d5db; }
.quick-status-select.s-card-opened { background-color: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.quick-status-select.s-order-yes { background-color: #d1fae5; color: #065f46; border-color: #6ee7b7; font-weight: 600; }

/* 出单切换按钮（列表中横向点击切换） */
.order-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
  color: #64748b;
  transition: all 0.15s ease;
}
.order-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.order-toggle.active {
  background: #d1fae5;
  color: #065f46;
  border-color: #6ee7b7;
  font-weight: 600;
}
.order-toggle.locked {
  cursor: not-allowed;
  opacity: 0.75;
  pointer-events: none;
}

/* ============================================
   分页
   ============================================ */
.pagination {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 6px; margin-top: 16px;
}
.pagination button {
  min-width: 34px; height: 34px; border: 1px solid var(--border);
  background: var(--bg-card); border-radius: 8px; cursor: pointer;
  font-size: 13px; color: var(--text-2);
  transition: all var(--transition);
}
.pagination button:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.pagination button.active { background: var(--grad-main); color: #fff; border-color: transparent; box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination .page-info { font-size: 13px; color: var(--text-2); margin: 0 8px; font-variant-numeric: tabular-nums; }

/* ============================================
   空状态
   ============================================ */
.empty-state {
  text-align: center; padding: 48px 20px; color: var(--text-3);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1.5px dashed var(--border);
  position: relative;
  overflow: hidden;
}
.empty-state::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}
.empty-state .empty-icon {
  font-size: 48px; margin-bottom: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), #f5f3ff);
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.08), inset 0 0 0 1px rgba(79, 70, 229, 0.06);
  animation: emptyPulse 2.5s ease-in-out infinite;
}
@keyframes emptyPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 8px 24px rgba(79, 70, 229, 0.08), inset 0 0 0 1px rgba(79, 70, 229, 0.06); }
  50% { transform: scale(1.04); box-shadow: 0 12px 32px rgba(79, 70, 229, 0.14), inset 0 0 0 1px rgba(79, 70, 229, 0.1); }
}
.empty-state p { font-size: 14px; font-weight: 500; color: var(--text-2); }
.empty-state p + p { font-size: 12px; font-weight: 400; color: var(--text-3); margin-top: 4px; }

/* ============================================
   公海提示
   ============================================ */
.pool-notice {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 18px; font-size: 13px; color: #92400e;
  line-height: 1.7;
  display: flex; align-items: flex-start; gap: 10px;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.08);
}
.pool-notice::before {
  content: 'ℹ';
  flex-shrink: 0;
  width: 20px; height: 20px;
  background: #f59e0b;
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.pool-notice-body { flex: 1; min-width: 0; }

/* 公海省份统计按钮 */
.pool-stat-btn {
  padding: 4px 10px; font-size: 12px; border-radius: 8px;
  background: #f1f5f9; color: #475569; border: 1px solid var(--border);
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.pool-stat-btn:hover { background: #e2e8f0; }
.pool-stat-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pool-stat-btn b { font-weight: 600; }

/* ============================================
   弹窗
   ============================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(3px);
  z-index: 1080;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease-out;
}
.modal-box {
  background: #fff;
  border-radius: 16px;
  width: 540px; max-width: 92vw;
  max-height: 86vh; overflow-y: auto;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.25);
  z-index: 1081;
  animation: modalIn 0.25s ease-out;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-box.large { width: 700px; }
.modal-box.xlarge { width: 1140px; }

/* ===== 待补录产品（产品库页右上角入口 + 补录弹窗） ===== */
.unk-badge {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 600;
  line-height: 17px; text-align: center; border-radius: 9px; vertical-align: 1px;
}
#unkProdBtn.has-items { border-color: #fca5a5; color: #b91c1c; background: var(--danger-light); }
.unk-hint {
  font-size: 13px; color: var(--text-2); line-height: 1.6;
  background: #f8fafc; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; margin-bottom: 12px;
}
.unk-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.unk-pick label { font-size: 13px; font-weight: 600; color: var(--text-1); white-space: nowrap; }
.unk-pick select { max-width: 560px; }
.unk-pick-tip { font-size: 12px; color: var(--text-3); }
.unk-summary { font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.unk-table-wrap { overflow: auto; max-height: 46vh; border: 1px solid var(--border); border-radius: 10px; }
.unk-table-wrap thead th { position: sticky; top: 0; z-index: 2; white-space: nowrap; }
.unk-table-wrap thead tr:nth-child(2) th { top: 38px; }
.unk-empty { color: var(--text-3); font-size: 13px; padding: 12px 0; }
.unk-foot-left { margin-right: auto; display: flex; align-items: center; gap: 12px; }
.unk-all-label { font-size: 13px; color: var(--text-1); display: flex; align-items: center; gap: 5px; cursor: pointer; }
.unk-sel-count { font-size: 12px; color: var(--text-3); }

/* ===== 联通登录内嵌实时画面 ===== */
.ul-live-wrap {
  position: relative;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ul-live-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  line-height: 2;
  padding: 0 20px;
}
.ul-live-img {
  display: block;
  width: 100%;
  cursor: crosshair;
  background: #fff;
}
.ul-key-box { flex: 1; min-width: 200px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border-radius: 16px 16px 0 0;
}
.modal-header h3 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.modal-header h3::before {
  content: '';
  width: 6px; height: 16px;
  background: var(--grad-main);
  border-radius: 4px;
}
.modal-close {
  width: 30px; height: 30px; border: none; background: transparent;
  font-size: 20px; color: var(--text-3); cursor: pointer; border-radius: 8px;
  transition: all 0.15s;
  line-height: 1;
}
.modal-close:hover { background: #e2e8f0; color: var(--text-1); }
.modal-body { padding: 22px 24px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  background: #f8fafc;
  border-radius: 0 0 16px 16px;
}

/* ---- 表单 ---- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.form-group label .required { color: var(--danger); }
.pwd-wrap { position: relative; }
.pwd-wrap input { width: 100%; padding-right: 40px !important; }
.pwd-eye {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px; height: 28px;
  border: none;
  background: transparent;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.pwd-eye:hover { opacity: 1; }
.pwd-eye.showing { opacity: 1; }

/* ===== 骨架屏 ===== */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 6px;
}
@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-row {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  gap: 12px;
}
.skeleton-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  flex-shrink: 0;
}
.skeleton-line { height: 12px; border-radius: 4px; }
.skeleton-line.short { width: 60px; }
.skeleton-line.medium { width: 120px; }
.skeleton-line.long { width: 200px; }
.skeleton-content { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.skeleton-content-row { display: flex; gap: 12px; align-items: center; }

.form-group input, .form-group select, .form-group textarea {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1.5px solid var(--border); border-radius: 9px;
  font-size: 13px; background: #fff;
  transition: all 0.18s;
  color: var(--text-1);
}
.form-group textarea { height: auto; padding: 9px 12px; resize: vertical; min-height: 74px; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.form-group select { cursor: pointer; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ---- 系统设置：状态跟进天数分组 ---- */
.settings-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  margin: 20px 0 12px;
  padding-top: 14px;
  border-top: 1px dashed var(--border, #e2e8f0);
}
.settings-follow-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 14px;
}
.settings-follow-grid .form-group { margin-bottom: 0; }
.settings-follow-grid .form-group input { padding: 7px 10px; }
@media (max-width: 640px) {
  .settings-follow-grid { grid-template-columns: 1fr 1fr; }
}

/* ---- 可搜索下拉选择器 ---- */
.search-select { position: relative; width: 100%; }
.search-select-input {
  width: 100%; height: 40px; padding: 0 30px 0 12px;
  border: 1.5px solid var(--border); border-radius: 9px;
  font-size: 14px; background: #fff; color: var(--text-1);
  transition: all 0.2s;
}
.search-select-input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.search-select-input:disabled {
  background: var(--bg-2, #f1f5f9);
  color: var(--text-3, #94a3b8);
  cursor: not-allowed;
  opacity: 0.7;
}
.search-select::after {
  content: ''; position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 10px; height: 10px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='none' stroke='%2394a3b8' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") center/contain no-repeat;
  pointer-events: none;
}
.search-select-dropdown {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  max-height: 220px; overflow-y: auto;
  background: #fff; border: 1px solid var(--border); border-radius: 9px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  z-index: 200;
}
.search-select-option {
  padding: 9px 12px; font-size: 13px; color: var(--text-1);
  cursor: pointer; transition: background 0.15s;
}
.search-select-option:hover,
.search-select-option.selected,
.search-select-option.highlight {
  background: var(--primary-light); color: var(--primary);
}
.search-select-empty {
  padding: 12px; font-size: 13px; color: var(--text-3); text-align: center;
}

/* 行内编辑：省市区联动下拉 */
.inline-region-select .search-select-input {
  height: 30px;
  padding: 0 22px 0 6px;
  border-radius: 4px;
  font-size: 13px;
  border-width: 1px;
}
.inline-region-select::after {
  right: 6px;
  width: 9px; height: 9px;
}
.inline-region-select .search-select-dropdown {
  max-height: 180px;
  top: calc(100% + 2px);
  border-radius: 6px;
  z-index: 300;
}
.inline-region-select .search-select-option {
  padding: 7px 10px;
  font-size: 12px;
}

/* ============================================
   我的（个人中心）
   ============================================ */
.profile-card {
  background: var(--bg-card); border-radius: var(--radius-md);
  padding: 28px; box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 24px;
  display: flex; align-items: center; gap: 22px;
  position: relative;
  overflow: hidden;
}
.profile-card::after {
  content: '';
  position: absolute; right: -60px; top: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.08), transparent 70%);
}
.profile-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--grad-main);
  color: #fff; font-size: 28px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.3);
  flex-shrink: 0;
}
.profile-info { position: relative; z-index: 1; }
.profile-info h2 { font-size: 19px; margin-bottom: 5px; font-weight: 700; }
.profile-info p { font-size: 13px; color: var(--text-2); }
.profile-section {
  background: var(--bg-card); border-radius: var(--radius-md);
  padding: 28px; box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.profile-section h3 {
  font-size: 16px; margin-bottom: 22px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.profile-section h3::before {
  content: '';
  width: 6px; height: 15px;
  background: var(--grad-main);
  border-radius: 4px;
}
.profile-form { max-width: 420px; }

/* 「我的」页可折叠区块（如「修改密码」）：默认收起，点标题展开 */
.profile-section h3.collapsible-h3 {
  cursor: pointer; user-select: none;
  margin-bottom: 0;
}
.profile-section h3.collapsible-h3 .collapse-chevron {
  margin-left: auto; font-size: 12px; line-height: 1;
  color: var(--text-3, #94a3b8);
  transform: rotate(-90deg);          /* 收起时箭头指右 */
  transition: transform .18s ease;
}
.profile-section h3.collapsible-h3.open .collapse-chevron {
  transform: rotate(0);               /* 展开时箭头指下 */
}
.profile-section[data-collapsible] .collapse-body { margin-top: 22px; }

/* ============================================
   Toast
   ============================================ */
.toast-container {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%); z-index: 2000;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  min-width: 280px; max-width: 440px;
  padding: 14px 20px; border-radius: 12px;
  font-size: 14px; font-weight: 600;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex; align-items: center; gap: 10px;
  border: 1px solid transparent;
  text-align: left;
}
.toast.success { background: #fff; border-color: #a7f3d0; color: #047857; }
.toast.success::before { content: '✓'; width: 20px; height: 20px; border-radius: 50%; background: #10b981; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.toast.error { background: #fff; border-color: #fecaca; color: #b91c1c; }
.toast.error::before { content: '✕'; width: 20px; height: 20px; border-radius: 50%; background: #ef4444; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.toast.info { background: #fff; border-color: #bfdbfe; color: #1e40af; }
.toast.info::before { content: 'ℹ'; width: 20px; height: 20px; border-radius: 50%; background: #3b82f6; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
@keyframes toastIn { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ============================================
   跟进记录时间线
   ============================================ */
.follow-timeline {
  max-height: 320px; overflow-y: auto; padding: 8px 4px;
}

/* 详情弹窗标签页 */
.detail-tab {
  padding: 10px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1.5px;
  transition: all 0.15s;
  user-select: none;
}
.detail-tab:hover { color: var(--text-2); }
.detail-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.detail-tab-panel { animation: fadeIn 0.2s; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 合并时间线 */
.timeline-container {
  max-height: 360px;
  overflow-y: auto;
  padding: 4px 0 4px 4px;
}
.tl-item {
  position: relative;
  padding: 10px 0 10px 28px;
  border-bottom: 1px solid var(--border-light);
}
.tl-item:last-child { border-bottom: none; }
.tl-dot {
  position: absolute;
  left: 6px;
  top: 14px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--border);
}
.tl-follow .tl-dot { background: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.tl-operation .tl-dot { background: #f59e0b; box-shadow: 0 0 0 1px #f59e0b; }

.tl-content { font-size: 13px; }
.tl-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.tl-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  line-height: 1.6;
}
.tl-badge-follow { background: var(--primary-light); color: var(--primary); }
.tl-badge-op { background: #fef3c7; color: #d97706; }

.tl-person {
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
}
.tl-action {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
}
.tl-time {
  font-size: 12px;
  color: var(--text-3);
  margin-left: auto;
}
.tl-body {
  color: var(--text-1);
  line-height: 1.6;
  margin-bottom: 4px;
}
.tl-result {
  font-size: 12px;
  color: var(--success);
  background: var(--success-light);
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 2px;
}
.tl-next {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
}
.follow-timeline-item {
  position: relative; padding: 0 0 20px 26px;
  border-left: 2px solid #e2e8f0;
}
.follow-timeline-item:last-child { border-left: 2px solid transparent; }
.follow-timeline-item::before {
  content: ''; position: absolute; left: -6px; top: 5px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--grad-main);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}
.follow-timeline-item .time { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.follow-timeline-item .follower { font-size: 12px; color: var(--primary); font-weight: 600; }
.follow-timeline-item .content { font-size: 13px; color: var(--text-1); margin: 5px 0; line-height: 1.6; }
.follow-timeline-item .result {
  font-size: 12px; color: var(--text-2);
  background: #f1f5f9; padding: 5px 10px; border-radius: 8px;
  display: inline-block;
}

/* ============================================
   响应式 / 移动端适配
   ============================================ */
/* ---- 桌面端默认：隐藏移动端专属元素 ---- */
.mobile-topbar { display: none; }
.card-list { display: none; }
.filter-toggle-btn { display: none; }
.filter-panel { display: contents; } /* 桌面端筛选面板融入筛选栏一行 */

.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1040;
}

/* ---- 移动端卡片列表 ---- */
.m-card {
  background: var(--bg-card);
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 16px 14px 12px;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.06), 0 3px 8px rgba(15, 23, 42, 0.08);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  /* ★10-02 滚动性能：视口外的卡片跳过渲染（WebView 长列表顿挫优化） */
  content-visibility: auto;
  contain-intrinsic-size: auto 200px;
}
.m-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--primary);
  opacity: 0.5;
  transition: opacity 0.2s;
}
.m-card:active { transform: scale(0.99); border-color: #94a3b8; }
.m-card:active::before { opacity: 0.8; }
.m-card-warn { border-color: #fca5a5; background: #fffafa; }
.m-card-warn::before { background: var(--danger); opacity: 0.6; }
.m-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 10px; min-width: 0; overflow: hidden;
}
.m-card-title { font-size: 15px; font-weight: 600; color: var(--text-1); display: flex; align-items: center; flex-wrap: wrap; min-width: 0; gap: 4px; overflow: hidden; }
.m-card-phone { margin-left: 4px; font-size: 15px; font-weight: 600; color: var(--text-1); cursor: pointer; -webkit-tap-highlight-color: rgba(59,130,246,.18); transition: color 0.15s; }
.m-card-phone:active { color: #3b82f6; }
.m-card-sub { margin-left: 8px; font-size: 13px; font-weight: 400; color: var(--text-3); cursor: pointer; -webkit-tap-highlight-color: rgba(59,130,246,.18); transition: color 0.15s; }
.m-card-sub:active { color: #3b82f6; }
.m-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.m-tag {
  font-size: 12px; color: #475569;
  background: #f1f5f9; padding: 3px 9px; border-radius: 6px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: background 0.15s;
}
.m-tag:active { background: #e2e8f0; }
.m-tag-store { font-size: 11px; color: var(--text-3); background: transparent; padding: 2px 0; max-width: 60%; }
.m-tag-danger { background: #fee2e2; color: #b91c1c; }
.m-tag-ok { background: #dcfce7; color: #15803d; }
.m-follow-last {
  font-size: 13px; color: var(--text-2); line-height: 1.5; margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.m-card-foot {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12.5px; color: var(--text-3);
  padding-top: 10px; border-top: 1px solid #e2e8f0;
}
.m-days { color: #64748b; }
.m-days.hot { color: #ef4444; font-weight: 600; }
.m-card-order { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.m-card-actions { display: flex; gap: 8px; margin-top: 12px; }
.m-card-actions .btn { flex: 1; min-width: 0; padding: 8px 4px; }
.m-empty {
  text-align: center; color: var(--text-3); font-size: 14px;
  padding: 48px 20px;
  background: var(--bg-card);
  border-radius: 14px;
  border: 1.5px dashed var(--border);
}
.m-empty::before {
  content: '○';
  display: block;
  font-size: 32px;
  color: var(--text-3);
  opacity: 0.25;
  margin-bottom: 12px;
}

@media (max-width: 1400px) {
  .stat-cards { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1200px) {
  .chart-row { flex-direction: column; }
}

/* ============================================
   "更多功能"菜单（个人中心页）
   ============================================ */
.more-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.more-menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 8px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: rgba(99, 102, 241, 0.08);
}
.more-menu-item:active {
  background: #e0e7ff;
  border-color: var(--primary);
  color: var(--primary);
}

/* ============================================
   底部导航栏（仅移动端显示）
   ============================================ */
.bottom-nav {
  display: none;
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1;
  min-height: 56px;
  font-size: 11px;
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.15s;
  -webkit-tap-highlight-color: rgba(99, 102, 241, 0.12);
  position: relative;
}
.bottom-nav-item svg { opacity: 0.7; transition: all 0.2s; }
.bottom-nav-item.active {
  color: var(--primary);
}
.bottom-nav-item.active svg { opacity: 1; transform: scale(1.05); }
.bottom-nav-item.active::before {
  content: '';
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 24px; height: 3px; border-radius: 0 0 4px 4px;
  background: var(--primary);
}

/* ============================================
   移动端（≤768px）：顶部栏 + 抽屉侧边栏 + 卡片列表
   ============================================ */
@media (max-width: 768px) {
  /* 防止任何元素导致横向滚动 */
  html, body { overflow-x: hidden; overflow-x: clip; }   /* clip 不建滚动容器，避免破坏合成滚动 */
  .app-page { overflow-x: hidden; overflow-x: clip; }

  /* 顶部栏 */
  .mobile-topbar {
    display: flex;
    align-items: center;
    position: fixed; top: 0; left: 0; right: 0;
    height: 52px;
    padding: 0 12px;
    padding-top: env(safe-area-inset-top);
    background: #ffffff;   /* ★10-02 去 backdrop-filter:blur(16px)：WebView 滚动顿挫主因之一，改为不透明底色 */
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    z-index: 1060;
    box-shadow: 0 1px 8px rgba(15, 23, 42, 0.04);
  }
  .topbar-btn {
    width: 40px; height: 40px;
    border: none; background: transparent; color: var(--text-1);
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px; cursor: pointer; flex-shrink: 0;
  }
  .topbar-btn:active { background: var(--primary-light); }
  .topbar-title {
    flex: 1; text-align: center;
    font-size: 16px; font-weight: 600; color: var(--text-1);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .topbar-user { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

  /* 底部导航栏 */
  .bottom-nav {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0;
    background: #ffffff;   /* ★10-02 去 backdrop-filter:blur(16px)：WebView 滚动顿挫主因之一 */
    border-top: 1px solid rgba(226, 232, 240, 0.8);
    z-index: 1060;
    box-shadow: 0 -1px 8px rgba(15, 23, 42, 0.06);
    padding-bottom: env(safe-area-inset-bottom);
  }

  /* 主内容留出顶部栏+底部导航空间 */
  .page-content { padding: 64px 12px calc(76px + env(safe-area-inset-bottom)); }

  /* 触控优化：按钮最小44px */
  .btn { min-height: 44px; }
  .m-card-actions .btn { min-height: 40px; }
  .nav-item { min-height: 44px; }

  /* 页面切换动画 */
  .page-content {
    animation: pageSlideIn 0.25s ease-out;
  }
  @keyframes pageSlideIn {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: translateX(0); }
  }

  /* 侧边栏抽屉 */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 1070;
    width: 240px;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.18);
    padding-top: env(safe-area-inset-top);
    padding-bottom: calc(56px + env(safe-area-inset-bottom));
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar.collapsed { width: 240px; }
  .sidebar.collapsed .sidebar-logo span,
  .sidebar.collapsed .nav-item span { display: inline; }
  .sidebar.collapsed .nav-item { justify-content: flex-start; padding: 11px 18px; gap: 12px; }
  .sidebar.collapsed .user-info { display: block; }
  .sidebar.collapsed .btn-logout { padding: 8px; width: auto; height: auto; margin: 0; font-size: 13px; }
  .sidebar.collapsed .btn-logout::before { content: ''; }
  .main-content, .main-content.collapsed { margin-left: 0; }

  /* 表格 ↔ 卡片切换：移动端隐藏表格、显示卡片（!important 覆盖 JS 内联样式） */
  .table-wrap.has-cards { display: none !important; }
  .card-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 4px;
  }

  /* 页头 */
  .page-header { flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
  .page-header h1 { font-size: 18px; }
  .header-actions { flex-wrap: wrap; gap: 8px; width: 100%; }
  .header-actions .date-input { flex: 1; min-width: 130px; }
  .header-actions .btn { flex: 1; }

  /* 状态选项卡：移动端换行全部展示（不再横向滑动隐藏） */
  .filter-tabs {
    flex-wrap: wrap;
    width: 100%;
    overflow-x: visible;
    row-gap: 4px;
  }
  .filter-tabs .tab { flex-shrink: 0; padding: 6px 10px; font-size: 12px; }

  /* 筛选栏：搜索+按钮一行，下拉收进折叠面板 */
  .filter-bar { flex-wrap: wrap; gap: 8px; }
  .filter-bar .search-input { flex: 1; min-width: 0; width: auto; }
  .filter-bar .btn { width: auto; flex-shrink: 0; }
  #custSortBtn { font-size: 12px; padding: 0 10px; white-space: nowrap; }
  .filter-toggle-btn { display: inline-flex; }
  .filter-toggle-btn.active { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
  .filter-panel {
    display: none;
    width: 100%;
    margin-top: 8px;
  }
  .filter-panel.open {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    animation: panelDown 0.18s ease;
  }
  .filter-panel .filter-select { width: 100%; min-width: 0; max-width: 100%; }
  .filter-panel .filter-search-select { width: 100%; min-width: 0; max-width: 100%; }
  .filter-panel .filter-region-row {
    grid-column: span 2;
    width: 100%;
    gap: 8px;
  }
  .filter-panel .filter-region-row .filter-search-select { flex: 1; }
  .filter-panel .btn { width: 100%; grid-column: span 2; }

  /* 公海说明 */
  .pool-notice { font-size: 12.5px; padding: 10px 12px; }

  /* 移动端表单/输入（16px 防 iOS 聚焦缩放） */
  .filter-bar input, .filter-bar select,
  .filter-panel input, .filter-panel select,
  .modal-box input, .modal-box select, .modal-box textarea,
  .quick-status-select {
    font-size: 16px;
  }
  .quick-status-select { min-height: 34px; padding: 5px 22px 5px 10px; }
  .order-toggle { min-height: 32px; padding: 5px 14px; font-size: 14px; }
  /* 出单控件紧凑版（移动端卡片第二行右侧） */
  .order-toggle.order-toggle-mini { min-height: 0; padding: 2px 7px; font-size: 11px; border-radius: 12px; }
  .status-badge.status-badge-mini { padding: 2px 7px; font-size: 11px; gap: 3px; border-radius: 12px; }
  .status-badge.status-badge-mini::before { width: 4px; height: 4px; }
  .inline-edit { padding: 3px 4px; }

  /* Toast 提示居中显示 */
  .toast-container { top: 50%; transform: translate(-50%, -50%); }
  .toast { min-width: 200px; max-width: 88vw; font-size: 13px; padding: 12px 16px; }

  /* 弹窗屏幕居中 */
  .modal-overlay { align-items: center; justify-content: center; padding: 16px; }
  #modalContainer { width: 100%; max-width: calc(100vw - 32px); }
  .modal-box {
    width: 100%; max-width: 100%;
    max-height: 82vh;
    border-radius: 16px;
    animation: modalIn 0.25s ease-out;
  }
  .modal-header { padding: 14px 16px; }
  .modal-body { padding: 14px 16px; -webkit-overflow-scrolling: touch; }
  .modal-footer { padding: 12px 16px; }
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }

  /* 看板 */
  .stat-cards { gap: 10px; }
  .stat-row { grid-template-columns: repeat(2, 1fr) !important; gap: 8px; }
  .stat-card { padding: 10px 12px; gap: 8px; }
  .stat-card::after { display: none; }
  .stat-icon { width: 32px; height: 32px; border-radius: 8px; }
  .stat-icon svg { width: 16px; height: 16px; }
  .stat-card .label { font-size: 11.5px; }
  .stat-card .value { font-size: 18px; }
  .chart-card { padding: 14px; }
  .chart-container { min-height: 240px; }
  .chart-body { height: 220px; }

  /* 登录页 */
  .login-box { width: 92vw; padding: 34px 24px 28px; }
  .login-box input { font-size: 16px; }

  /* 表格兜底（未做卡片的页面） */
  .data-table { font-size: 12.5px; }
  .pagination { flex-wrap: wrap; justify-content: center; gap: 6px; }
  .pagination button { min-width: 36px; min-height: 34px; }

  /* 个人中心页面优化 */
  .profile-card { padding: 18px 16px; gap: 14px; margin-bottom: 16px; }
  .profile-avatar { width: 56px; height: 56px; font-size: 22px; }
  .profile-info h2 { font-size: 17px; }
  .profile-section { padding: 18px 16px; }
  .profile-section h3 { font-size: 15px; margin-bottom: 16px; }
  .profile-form { max-width: 100%; }
  .profile-form .form-group { margin-bottom: 14px; }
  .profile-form input { font-size: 16px; }

  /* 操作记录统计卡片优化 */
  .stat-section { margin-bottom: 8px; }
  .stat-section-title { font-size: 11px; }
  .stat-row[style*="repeat(2,1fr)"] { gap: 8px; }
}

@media (max-width: 480px) {
  .stat-row { grid-template-columns: repeat(2, 1fr) !important; }
  .stat-card { padding: 9px 10px; }
  .stat-icon { width: 28px; height: 28px; }
  .stat-icon svg { width: 14px; height: 14px; }
  .stat-card .value { font-size: 17px; }
  .page-header h1 { font-size: 16px; }
  .m-card-actions .btn { font-size: 13px; }
  .m-card { padding: 12px 12px 10px; }
  .m-card-title { font-size: 14px; }
  .m-card-phone { font-size: 14px; }
  .m-tag { font-size: 11px; padding: 2px 7px; }
  .m-tag-store { font-size: 10px; }
  .m-card-actions .btn { padding: 7px 4px; }
  .profile-avatar { width: 48px; height: 48px; font-size: 19px; }
  .login-box { padding: 28px 18px 22px; }
  .modal-box { max-height: 78vh; }
}

/* ===== 客户分析 ===== */
.analysis-chart-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.analysis-chart-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 12px;
}
.analysis-chart-wrap {
  height: 320px;
  position: relative;
}
.analysis-month-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}
.analysis-month-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.analysis-month-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.analysis-month-title .export-btn {
  font-size: 12px;
  font-weight: 500;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: 6px;
  padding: 4px 12px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.analysis-month-title .export-btn:hover {
  background: var(--primary);
  color: #fff;
}
.analysis-month-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}
.analysis-month-summary .summary-item {
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 4px;
}
.analysis-month-summary .summary-item em {
  font-style: normal;
  font-weight: 700;
  font-size: 14px;
}
.c-green { color: #10b981; }
.c-orange { color: #f59e0b; }
.c-blue { color: #0ea5e9; }
.c-purple { color: #7c3aed; }
.c-red { color: #ef4444; }
.c-gray { color: #64748b; }
.c-teal { color: #14b8a6; }
.c-indigo { color: #6366f1; }

.analysis-table-wrap {
  overflow-x: auto;
}
.analysis-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.analysis-table th {
  background: #f8fafc;
  padding: 10px 14px;
  text-align: center;
  font-weight: 600;
  color: var(--text-2);
  font-size: 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.analysis-table td {
  padding: 9px 14px;
  text-align: center;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-2);
}
.analysis-table .td-date {
  font-weight: 600;
  color: var(--text-1);
  text-align: left;
  white-space: nowrap;
}
.analysis-table tbody tr:hover {
  background: #f8fafc;
}
.num-badge {
  display: inline-block;
  min-width: 32px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}
.num-badge.green { background: #ecfdf5; color: #059669; }
.num-badge.orange { background: #fffbeb; color: #d97706; }
.num-badge.blue { background: #f0f9ff; color: #0284c7; }
.num-badge.purple { background: #f5f3ff; color: #7c3aed; }
.num-badge.red { background: #fef2f2; color: #dc2626; }
.num-badge.gray { background: #f1f5f9; color: #475569; }
.num-badge.teal { background: #f0fdfa; color: #0d9488; }
.num-badge.indigo { background: #eef2ff; color: #4f46e5; }

/* 客户分析移动端 */
@media (max-width: 768px) {
  .analysis-chart-card { padding: 14px; }
  .analysis-chart-wrap { height: 260px; }
  .analysis-month-header { padding: 14px 14px 10px; }
  .analysis-month-summary { gap: 8px 12px; }
  .analysis-month-summary .summary-item { font-size: 11px; }
  .analysis-month-summary .summary-item em { font-size: 13px; }
  .analysis-table th { padding: 8px 10px; font-size: 11px; }
  .analysis-table td { padding: 7px 10px; font-size: 12px; }
  .num-badge { min-width: 28px; padding: 2px 6px; font-size: 11px; }
}

@keyframes panelDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
@keyframes sheetUp {
  from { transform: translateY(48px); opacity: 0.5; }
  to { transform: none; opacity: 1; }
}

/* ============================================
   产品库
   ============================================ */
.product-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.prod-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--text-2);
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}
.prod-chip[onclick] { cursor: pointer; }
.prod-chip[onclick]:hover { border-color: var(--primary); color: var(--primary); }
.prod-chip b { font-weight: 600; color: var(--text-1); }

.prod-carrier {
  display: inline-block; font-size: 12px; padding: 1px 6px; border-radius: 4px;
  color: #185fa5; background: #e6f1fb; margin-right: 4px; white-space: nowrap;
}
.prod-carrier-cell { display: inline-flex; align-items: center; vertical-align: middle; }
.prod-carrier-only .prod-carrier-img { margin-right: 0; }
.prod-carrier-only .prod-carrier { margin-right: 0; }
.prod-carrier-img {
  width: 18px; height: 18px; object-fit: contain; margin-right: 6px;
  flex: 0 0 auto; vertical-align: middle; -webkit-user-drag: none;
}
.prod-carrier-strong {
  font-size: 15px; font-weight: 700; padding: 2px 10px;
  color: #c81e1e; background: #fdecec;
}
.prod-scope {
  display: inline-block; font-size: 12px; padding: 1px 6px; border-radius: 4px;
  color: #3b6d11; background: #eaf3de;
}
.prod-scope-prov { color: #185fa5; background: #e6f1fb; }
.prod-scope-city { color: #854f0b; background: #faeeda; }
.prod-hot {
  display: inline-block; font-size: 11px; padding: 1px 5px; border-radius: 4px;
  color: #a32d2d; background: #fcebeb; margin-right: 4px; vertical-align: middle;
}
.prod-status {
  display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.prod-st-sale { color: #3b6d11; background: #eaf3de; }
.prod-st-pause { color: #854f0b; background: #faeeda; }
.prod-st-off { color: #5f5e5a; background: #f1efe8; text-decoration: line-through; }
/* 资料组已建、但还没挂资费档：中性虚框，区别于「已下架」 */
.prod-st-empty { color: #1f5f8b; background: #e8f1f8; border: 1px dashed #9dc2da; }
.prod-name {
  color: var(--primary); cursor: pointer; font-size: 13px;
}
.prod-name:hover { text-decoration: underline; }
/* ★10-12 状态为「暂停 / 已下架」的套餐：套餐名加删除线并置灰（各视图通用，含详情弹窗标题） */
.prod-name-off { text-decoration: line-through !important; color: #94a3b8 !important; }
.prod-name-off:hover { text-decoration: line-through !important; }
.prod-card-name {
  font-size: 14px; font-weight: 500; color: var(--text-1);
  margin: 6px 0; cursor: pointer; line-height: 1.5;
}
.prod-detail-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 14px; }
.prod-detail-table { width: 100%; font-size: 13px; border-collapse: collapse; }
.prod-detail-table th {
  width: 92px; text-align: left; font-weight: 400; color: var(--text-2);
  padding: 4px 8px 4px 0; vertical-align: top; white-space: nowrap;
}
.prod-detail-table td { padding: 4px 0; color: var(--text-1); }
.prod-field { margin-top: 14px; }
.prod-field-label { font-size: 12px; color: var(--text-2); margin-bottom: 4px; }
.prod-field-val {
  font-size: 13px; color: var(--text-1); background: var(--bg-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 10px; line-height: 1.7;
}
.prod-field-val.pre { white-space: pre-wrap; word-break: break-word; }
.form-group label .req { color: var(--danger); }
.product-detail { max-height: 62vh; overflow-y: auto; }

/* ---- 产品库：视图切换 ---- */
.prod-view-switch {
  display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--bg-2);
}
.prod-view-switch button {
  border: 0; background: transparent; cursor: pointer;
  font-size: 12px; color: var(--text-2); padding: 6px 12px; white-space: nowrap;
}
.prod-view-switch button + button { border-left: 1px solid var(--border); }
.prod-view-switch button.active { background: var(--primary); color: #fff; }
.prod-view-hint { font-size: 12px; color: var(--text-3); margin-bottom: 8px; }
.prod-view-hint b { color: var(--text-1); }

/* ---- 产品库：资料组（一层） ---- */
.prod-caret {
  display: inline-block; color: var(--text-2); font-size: 18px; line-height: 1;
  font-weight: 700; transition: transform .15s ease, color .15s ease;
  cursor: pointer; user-select: none; padding: 0 2px;
}
.prod-caret:hover { color: var(--primary); }
.prod-caret.open { transform: rotate(90deg); }
.prod-group-row { cursor: pointer; }
.prod-th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.prod-th-sort:hover { color: var(--primary); }
.prod-th-sort.active { color: var(--primary); font-weight: 700; }
.prod-group-row > td { border-top: 2px solid var(--border); background: var(--bg-card); }
#productGroupTable tbody tr.prod-group-row:first-child > td { border-top: none; }
.prod-group-row:hover > td { background: var(--bg-2); }
/* 同运营商+同省 分块展示：块首粗分隔、块内虚线，运营商列纵向贯通 */
#productGroupTable tbody tr.prod-run-start > td { border-top: 2px solid #94a3b8; }
#productGroupTable tbody tr:first-child.prod-run-start > td { border-top: none; }
#productGroupTable tbody tr.prod-run-mid > td { border-top: 1px dashed var(--border); }
#productGroupTable tbody tr.prod-run-mid > td.prod-run-carrier { border-top: none; }
#productGroupTable tbody tr.prod-run-start > td.prod-run-carrier { vertical-align: middle; }
.prod-group-name { color: var(--primary); cursor: pointer; font-size: 13px; font-weight: 500; }
.prod-group-name:hover { text-decoration: underline; }
.prod-group-brief { font-size: 11px; color: var(--text-3); margin-top: 2px; line-height: 1.5; }
.prod-count-badge {
  display: inline-block; min-width: 20px; text-align: center;
  font-size: 12px; font-weight: 600; color: var(--primary);
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 999px; padding: 1px 7px;
}
.prod-need-gh {
  display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 4px;
  color: #854f0b; background: #faeeda; white-space: nowrap;
}
.prod-group-link { color: var(--primary); cursor: pointer; }
.prod-group-link:hover { text-decoration: underline; }
.m-tag-group { cursor: pointer; color: var(--primary); }
.prod-group-sub > td { padding: 0 !important; background: var(--bg-2); border-bottom: 2px solid var(--border); }
#productGroupTable tbody tr.prod-group-sub:last-child > td { border-bottom: 2px solid var(--border); }
.prod-group-sub .prod-sub-wrap { position: relative; padding-left: 34px; }

/* 组内资费档拖拽换组 */
#productGroupTable tr[draggable], .prod-sub-card[draggable] { cursor: grab; }
#productGroupTable tr[draggable]:active, .prod-sub-card[draggable]:active { cursor: grabbing; }
.prod-dragging { opacity: .45; }
.prod-drag-over > td,
.prod-drag-over.prod-group-row > td,
.m-card.prod-drag-over { background: #e8f1fd !important; box-shadow: inset 0 0 0 2px var(--primary); }
.prod-group-sub .prod-sub-wrap::before {
  content: ''; position: absolute; left: 18px; top: 14px; bottom: 16px;
  width: 2px; border-radius: 2px; background: var(--border);
}
.prod-sub-wrap { padding: 10px 14px 12px; }
.prod-sub-wrap.in-modal { padding: 0; }
.prod-sub-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.prod-sub-title { font-size: 12px; color: var(--text-2); font-weight: 500; }
.prod-sub-actions { display: inline-flex; gap: 12px; }
.prod-sub-table { width: 100%; border-collapse: collapse; font-size: 12px; background: var(--bg-card); }
.prod-sub-table th {
  text-align: left; font-weight: 500; color: var(--text-2);
  background: var(--bg-2); padding: 6px 8px; border: 1px solid var(--border); white-space: nowrap;
}
.prod-sub-table td { padding: 6px 8px; border: 1px solid var(--border); color: var(--text-1); vertical-align: top; }
.prod-sub-desc { font-size: 11px; color: var(--text-2); line-height: 1.5; }
.prod-sub-commission { color: #b45309; white-space: nowrap; }
.prod-sub-empty { text-align: center; color: var(--text-3); padding: 14px 8px !important; }
/* 组内资费档：移动端卡片（PC 隐藏，≤768px 替代表格，避免横向滚动看不全） */
.prod-sub-cards { display: none; }
.prod-sub-card {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 11px; margin-bottom: 8px; cursor: pointer;
}
.prod-sub-card:active { background: var(--bg-1); }
.prod-sub-card-top { display: flex; align-items: flex-start; gap: 8px; }
.prod-sub-card-top .prod-name { flex: 1; min-width: 0; font-size: 13px; line-height: 1.4; word-break: break-all; }
.prod-sub-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.prod-sub-card-tags .m-tag { font-size: 11px; }
.prod-sub-card-desc {
  font-size: 11px; color: var(--text-2); line-height: 1.5; margin-top: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.prod-sub-cards .prod-sub-empty { border: 1px dashed var(--border); border-radius: var(--radius-sm); display: block; }
.prod-sub-card-acts {
  display: flex; justify-content: flex-end; gap: 12px;
  margin-top: 8px; padding-top: 7px; border-top: 1px dashed var(--border);
}
.prod-sub-card-acts .btn-link { font-size: 12px; }

/* ---- 产品库：详情弹窗内的资料组条 ---- */
.prod-group-banner {
  font-size: 12px; color: var(--text-2); line-height: 1.6;
  background: var(--bg-2); border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm); padding: 8px 10px; margin-bottom: 12px;
}
.prod-group-banner b { color: var(--text-1); }
.prod-group-banner:not(.static) { cursor: pointer; }
.prod-group-banner-tip { display: block; font-size: 11px; color: var(--text-3); margin-top: 2px; }
.prod-block-title {
  font-size: 13px; font-weight: 600; color: var(--text-1);
  margin: 18px 0 8px; padding-left: 8px; border-left: 3px solid var(--primary);
}
.prod-form-tip {
  font-size: 12px; color: var(--text-2); line-height: 1.6;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 10px; margin-bottom: 12px;
}

@media (max-width: 1024px) {
  /* 窄窗口/移动端：组内资费档用卡片替代表格（≥1025px 才显示表格），
     避免子表横向截断只看到套餐名称一列 */
  .prod-sub-wrap .prod-sub-table { display: none; }
  .prod-sub-cards { display: block; }
}

@media (max-width: 768px) {
  .product-stats { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .prod-chip { flex: 0 0 auto; }
  .prod-detail-table th { width: 76px; font-size: 12px; }
  .prod-view-switch button { padding: 6px 9px; font-size: 11px; }
  .prod-sub-wrap { padding: 8px 10px 10px; }
  .prod-group-banner { font-size: 11px; }
  .prod-block-title { font-size: 12px; margin-top: 14px; }
}

/* ============================================
   套餐订单量/首充量（上月/本月/当天）
   ============================================ */
.prod-stat-line {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-2, #475569);
  margin-top: 6px;
}
.prod-stat-cell {
  font-size: 12.5px;
  color: var(--text-2, #475569);
  line-height: 1.75;
  white-space: nowrap;
  transition: transform 0.12s ease, color 0.12s ease;
  cursor: default;
}
.prod-stat-cell:hover {
  transform: scale(1.25);
  transform-origin: left center;
  color: var(--text, #334155);
  position: relative;
  z-index: 2;
}
.prod-stat-sum {
  font-size: 12px;
  color: var(--text, #334155);
  background: var(--bg-hover, #f1f5f9);
  border: 1px dashed var(--border, #e2e8f0);
  border-radius: 6px;
  padding: 6px 12px;
  margin: 4px 0 8px;
  /* 10-12：去掉 nowrap/横向滚动 → 手机上「合计/订单/首充达标」三行完整展示 */
  white-space: normal;
}
.prod-stat-sum-cell {
  font-size: 12px;
  color: var(--text, #334155);
}
/* 合计框三行版：「合计」标题行 + 订单行 + 首充达标行（手机完整可见） */
.prod-stat-sum .prod-sum-title { line-height: 1.6; }
.prod-stat-sum .prod-sum-title b { color: var(--primary, #4f46e5); font-weight: 700; }
.prod-stat-sum .prod-sum-line { line-height: 1.7; }
.prod-stat-sum .prod-sum-line + .prod-sum-line { margin-top: 2px; }
.prod-stat-sum-cell b {
  color: var(--primary, #4f46e5);
  font-weight: 600;
}
/* 产品库顶部「全部产品合计」（仅超级管理员可见） */
.prod-total-sum {
  font-size: 13px;
  padding: 8px 14px;
  margin: 0 0 10px;
  border-style: solid;
}
.prod-total-sum b {
  color: var(--primary, #4f46e5);
  font-weight: 700;
}
.prod-stat-cell b {
  color: var(--text, #334155);
  font-weight: 700;
}

/* 待补录弹窗：资料组可搜索选择器 */
.unk-combo { position: relative; flex: 1; max-width: 460px; }
.unk-combo input { width: 100%; }
.unk-combo.selected input { border-color: var(--primary, #4f46e5); box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12); }
.unk-combo-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 264px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  z-index: 30;
}
.unk-combo-item { padding: 8px 12px; cursor: pointer; line-height: 1.5; }
.unk-combo-item:hover, .unk-combo-item.active { background: #eef2ff; }
.unk-combo-name { display: block; font-size: 13px; font-weight: 600; color: var(--text, #334155); }
.unk-combo-item.active .unk-combo-name { color: var(--primary, #4f46e5); }
.unk-combo-dims { display: block; font-size: 12px; color: var(--text-2, #475569); }
.unk-combo-empty { padding: 14px 12px; font-size: 13px; color: var(--text-2, #475569); text-align: center; }

/* ============================================
   无障碍：减少动画
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   联通订单查询（IBOS 页面池中转）
   ============================================ */
.uc-session-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f5a623;
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.15);
}
.uc-session-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin-bottom: 12px;
  border: 1px solid #fde68a;
  background: #fffbeb;
  border-radius: 10px;
  font-size: 13px;
  color: #92400e;
}
.uc-bar-warn { flex: 1; min-width: 200px; }
.uc-filter-bar { flex-wrap: wrap; }
.uc-kind-tag { font-size: 12px; font-weight: 600; white-space: nowrap; align-self: center; }
.uc-kind-tag.ok { color: #16803c; }
.uc-kind-tag.bad { color: #c2373c; }
/* 订单详情轨迹/备注里的上门人员姓名、联系方式高亮 */
.uc-hl { color: #e5484d; font-weight: 700; }
.uc-input { max-width: 230px; }
.uc-year { max-width: 110px; }
.uc-mono { font-family: Consolas, Menlo, monospace; font-size: 12px; letter-spacing: 0.2px; }
.uc-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-state {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.uc-st-doing { background: #e0ecff; color: #1d4ed8; }
.uc-st-ok { background: #dcfce7; color: #15803d; }
.uc-st-bad { background: #fee2e2; color: #b91c1c; }
.uc-row { cursor: pointer; }
.uc-row:hover td { background: #f1f5f9; }

.uc-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
}
.uc-card:active { background: #f1f5f9; }
.uc-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.uc-card-goods {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1, #1e293b);
  margin-top: 4px;
}
.uc-card-meta {
  font-size: 11px;
  color: var(--text-light, #94a3b8);
  margin-top: 4px;
  line-height: 1.7;
}

.uc-detail { display: flex; flex-direction: column; }
/* 顶部关键信息摘要卡 */
.uc-key-card {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 20px;
  background: rgba(79, 70, 229, 0.04);
  border: 1px solid rgba(79, 70, 229, 0.18);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 8px;
}
.uc-key-item { min-width: 0; }
.uc-key-label { font-size: 11px; color: var(--text-light, #94a3b8); margin-bottom: 1px; }
.uc-key-val { font-size: 13px; font-weight: 600; color: var(--text-1, #1e293b); word-break: break-all; line-height: 1.45; }
@media (max-width: 640px) { .uc-key-card { grid-template-columns: 1fr; } }
/* 证件号打码（点击切换） */
.uc-pspt { cursor: pointer; border-bottom: 1px dashed #94a3b8; }
/* 折叠区（其他字段等杂项） */
.uc-fold { margin: 10px 0 2px; }
.uc-fold summary {
  font-size: 12px; font-weight: 600; color: var(--text-2, #64748b);
  cursor: pointer; padding: 4px 10px; border-radius: 4px;
  background: rgba(100, 116, 139, 0.07); user-select: none;
}
.uc-fold summary:hover { color: var(--primary); }
.uc-fold[open] summary { margin-bottom: 2px; }
.uc-detail-sec {
  font-size: 12px; font-weight: 600; color: var(--primary);
  background: rgba(79, 70, 229, 0.06); border-left: 3px solid var(--primary);
  padding: 4px 10px; margin: 10px 0 2px; border-radius: 4px;
}
.uc-detail-sec:first-child { margin-top: 0; }
.uc-traj-step { display: flex; gap: 10px; padding: 5px 0; }
.uc-traj-dot {
  width: 14px; height: 14px; border-radius: 50%; background: #22a06b;
  flex: 0 0 14px; margin-top: 2px; position: relative;
}
.uc-traj-step:not(:last-child) .uc-traj-dot::after {
  content: ''; position: absolute; left: 6px; top: 15px;
  width: 2px; height: calc(100% + 10px); background: #d5d9e0;
}
.uc-detail-row {
  display: flex;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed #e2e8f0;
  font-size: 13px;
}
.uc-detail-row:last-child { border-bottom: 0; }
.uc-detail-label {
  flex: 0 0 96px;
  color: var(--text-light, #94a3b8);
}
.uc-detail-val {
  flex: 1;
  color: var(--text-1, #1e293b);
  word-break: break-all;
}
.uc-banner {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}
.uc-traj-op {
  margin-left: 8px;
  font-size: 11px;
  color: var(--text-light, #94a3b8);
}
.uc-traj-time {
  font-size: 11px;
  color: var(--text-2, #64748b);
  margin-top: 1px;
}
.uc-traj-note {
  font-size: 12px;
  color: var(--text-2, #64748b);
  margin-top: 2px;
  line-height: 1.5;
}
.uc-remark {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
  margin: 6px 0;
}
.uc-remark-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-2, #64748b);
}
.uc-remark-head b { color: var(--text-1, #1e293b); }
.uc-remark-body {
  font-size: 12px;
  color: var(--text-1, #1e293b);
  margin-top: 4px;
  line-height: 1.6;
  word-break: break-all;
}

@media (max-width: 768px) {
  .uc-input, .uc-year { max-width: none; }
  .uc-detail-label { flex-basis: 84px; }
}

/* ===== 订单地域日报（我的页，仅超级管理员）===== */
.geo-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.geo-tab {
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text-muted);
  border-radius: 999px; padding: 5px 12px; font-size: 12px; cursor: pointer; line-height: 1.4;
}
.geo-tab.active { background: #6366f1; border-color: #6366f1; color: #fff; font-weight: 600; }
.geo-scroll { overflow: auto; border: 1px solid var(--border-light); border-radius: 10px; }
.geo-table { border-collapse: separate; border-spacing: 0; font-size: 12px; width: auto; }
.geo-table th, .geo-table td {
  padding: 5px 8px; border-bottom: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light); text-align: right; white-space: nowrap;
}
.geo-table thead th {
  position: sticky; top: 0; z-index: 2; background: var(--bg-body, #f8fafc);
  font-weight: 600; color: var(--text-muted);
}
.geo-table .geo-name { position: sticky; left: 0; z-index: 1; background: var(--bg-card); text-align: left; font-weight: 500; }
.geo-table thead .geo-name { z-index: 3; }
.geo-table .geo-total { font-weight: 700; color: var(--text); background: var(--border-light); }
.geo-table .geo-zero { color: var(--border); }
/* ★10-02 归属省份页签：行内含「按产品库省份推断」的标记 */
.geo-infer-mark { display: inline-block; margin-left: 3px; color: #d97706; font-weight: 700; font-size: 11px; cursor: help; }
.geo-table tr.geo-sum td { font-weight: 700; border-top: 2px solid var(--border); background: var(--bg-body, #f8fafc); }
.geo-table tr.geo-sum .geo-total { background: var(--bg-body, #f8fafc); }
/* 业务员归属行整行标黄（地域日报） */
.geo-table tr.geo-sales td { background: #fef9c3; }
.geo-table tr.geo-sales .geo-name { background: #fef9c3; }
.geo-table tr.geo-sales .geo-total { background: #fde68a; }
.geo-table tr.geo-sales:hover td { background: #fef08a; }
/* 「我的业务员合计」行（在“合计”上方，仅统计有归属业务员的地市） */
.geo-table tr.geo-sales-sum td { font-weight: 700; color: #92400e; background: #fde68a; border-top: 2px solid #f59e0b; }
.geo-table tr.geo-sales-sum .geo-name { background: #fde68a; }
.geo-table tr.geo-sales-sum .geo-total { background: #fbbf24; color: #7c2d12; }
/* ★10-09 无归属地市分组：表格保持扁平，「分组小计」以表底汇总行呈现
   （位置：我的业务员合计 之下、合计 之上）——每组一行 + 末尾一行「未分组 小计」。 */
.geo-table tr.geo-grp-sum td { font-weight: 700; color: #0369a1; background: #f0f9ff; border-top: 1px dashed #7dd3fc; }
.geo-table tr.geo-grp-sum .geo-name { background: #f0f9ff; }
.geo-table tr.geo-grp-sum .geo-total { background: #bae6fd; color: #075985; }
/* 「未分组 小计」行：灰调，区别于正式分组，提示这部分还没分配 */
.geo-table tr.geo-grp-rest-sum td { color: #64748b; background: #f1f5f9; border-top: 1px dashed #cbd5e1; }
.geo-table tr.geo-grp-rest-sum .geo-name { background: #f1f5f9; }
.geo-table tr.geo-grp-rest-sum .geo-total { background: #e2e8f0; color: #334155; }

/* ===== 产品宣传图（10-12）：编辑弹窗上传预览 + 详情展示 ===== */
.promo-upload-preview { margin: 6px 0; }
.promo-upload-preview img { max-width: 100%; max-height: 220px; border-radius: 8px; border: 1px solid var(--border); cursor: zoom-in; display: block; }
.promo-upload-empty { font-size: 12px; color: #94a3b8; }
.promo-upload-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ===== 连接状态条（10-12 保活加固）：断线/恢复提示，静默不打断 ===== */
.net-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 99999;
  display: none; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 14px; font-size: 13px; font-weight: 500; color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
}
.net-bar.show { display: flex; }
.net-bar.down { background: #dc2626; }
.net-bar.up { background: #16a34a; }
.net-bar .net-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #fff;
  animation: netPulse 1.1s ease-in-out infinite;
}
.net-bar.up .net-dot { animation: none; }
@keyframes netPulse { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
.prod-promo-img img { max-width: 100%; max-height: 420px; border-radius: 10px; border: 1px solid var(--border); cursor: zoom-in; display: block; margin: 4px 0 8px; }