/* ============ 客户跟进管理系统 - 全局样式 ============ */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --danger: #dc2626;
  --bg: #f5f7fa;
  --card: #ffffff;
  --border: #e5e9f0;
  --text: #1f2937;
  --text-secondary: #6b7280;
  --text-light: #9ca3af;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 20px 50px rgba(16, 24, 40, .18);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
}

/* ---------- 顶部栏 ---------- */
.header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  gap: 16px;
  flex-wrap: wrap;
}

.header-left { display: flex; align-items: center; gap: 14px; }

.logo {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700;
  box-shadow: 0 4px 10px rgba(37, 99, 235, .3);
  flex-shrink: 0;
}

.header-title { font-size: 20px; font-weight: 700; letter-spacing: .5px; }
.header-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }

.header-right { display: flex; align-items: center; gap: 22px; }

.header-stat { display: flex; align-items: baseline; gap: 5px; }
.header-stat-num { font-size: 16px; font-weight: 700; color: var(--primary); }
.header-stat-label { font-size: 13px; color: var(--text-secondary); }

/* ---------- 按钮 ---------- */
.btn {
  border: none; cursor: pointer; border-radius: 8px;
  font-size: 14px; font-family: inherit;
  padding: 9px 18px;
  transition: background .15s, opacity .15s;
  white-space: nowrap;
}
.btn:active { opacity: .85; }

.btn-primary { background: var(--primary); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--primary-hover); }

.btn-ghost {
  background: #fff; color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: #cbd5e1; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }

.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 6px; }

.btn-link {
  background: none; border: none; cursor: pointer;
  color: var(--primary); font-size: 13px; font-family: inherit;
  padding: 2px 4px;
}
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: var(--danger); }

/* ---------- 类型标签页 ---------- */
.type-tabs {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
}

.type-tab {
  padding: 12px 18px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  border: none; background: none;
  font-family: inherit;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color .15s;
}
.type-tab:hover { color: var(--text); }
.type-tab.active {
  color: var(--primary);
  font-weight: 600;
  border-bottom-color: var(--primary);
}

.type-tab-manage {
  margin-left: auto;
  padding: 12px 8px;
  font-size: 13px;
  color: var(--text-light);
  border: none; background: none; cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.type-tab-manage:hover { color: var(--primary); }

/* ---------- 主内容 ---------- */
.main { padding: 24px 32px; max-width: 1440px; margin: 0 auto; }

/* 统计卡片 */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  display: flex; flex-direction: column; gap: 8px;
  border: 1px solid var(--border);
}
.stat-num { font-size: 30px; font-weight: 700; color: var(--primary); line-height: 1; }
.stat-label { font-size: 13px; color: var(--text-secondary); }

/* 工具栏 */
.toolbar {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.export-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.search-box {
  flex: 1;
  min-width: 220px;
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon { position: absolute; left: 12px; font-size: 13px; opacity: .55; pointer-events: none; }
.search-box input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }

.filter-select {
  padding: 9px 32px 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  outline: none;
  appearance: auto;
}
.filter-select:focus { border-color: var(--primary); }

/* 表格 */
.table-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow-x: auto;
}

.customer-table { width: 100%; border-collapse: collapse; min-width: 1000px; }
.customer-table th {
  text-align: left;
  padding: 13px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: #fafbfc;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.customer-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f4f8;
  font-size: 14px;
  vertical-align: middle;
  white-space: nowrap; /* 客户列表信息一行展示，不换行 */
}
.customer-table tbody tr:hover { background: #f8fafd; }
.customer-table tbody tr:last-child td { border-bottom: none; }

.num-col { text-align: right; }
.customer-table th.num-col { text-align: right; }
.num-col + .num-col { text-align: right; }
td.num-col { text-align: right; font-variant-numeric: tabular-nums; }

.customer-name { font-weight: 600; color: var(--text); }

/* 登录遮罩与用户菜单 */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: linear-gradient(135deg, #eef2f7, #e6f0ee);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  width: 360px;
  max-width: 92vw;
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 36px 32px;
  text-align: center;
}
.login-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, #0d9488, #059669);
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-title { font-size: 20px; margin-bottom: 4px; }
.login-sub { color: var(--text-secondary); font-size: 13px; margin-bottom: 22px; }
.login-card .form-item { text-align: left; margin-bottom: 14px; }
.login-error { color: var(--danger); font-size: 13px; min-height: 18px; margin-bottom: 10px; text-align: left; }
.login-btn { width: 100%; padding: 11px; font-size: 15px; }
.user-menu { display: flex; align-items: center; gap: 10px; margin-left: 4px; padding-left: 14px; border-left: 1px solid var(--border); }
.user-name { font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.user-menu .btn-link { font-size: 13px; }

/* 分享管理 */
.share-create { border: 1px dashed var(--border); border-radius: 10px; padding: 14px; margin-bottom: 16px; background: #fafbfc; }
.share-modes { display: flex; gap: 18px; flex-wrap: wrap; }
.share-mode { display: flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.share-list { max-height: 320px; overflow-y: auto; }
.share-empty { color: var(--text-secondary); text-align: center; padding: 24px 0; }
.share-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; }
.share-item-title { font-weight: 600; margin-bottom: 4px; }
.share-item-meta { display: flex; gap: 12px; align-items: center; font-size: 12px; color: var(--text-secondary); flex-wrap: wrap; }
.share-tag { padding: 1px 8px; border-radius: 999px; background: #f0fdfa; color: #0d9488; font-size: 12px; }
.share-item-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* 列对齐规范：文本列左对齐、数字列右对齐、时间列居中、操作列居中 */
.customer-table .center-col { text-align: center; }
.customer-table td.center-col { text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.customer-table .op-col { text-align: center; }
.customer-table td:last-child .op-cell { justify-content: center; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.badge-status-qianzai { background: #f3f4f6; color: #6b7280; }
.badge-status-genjin { background: #eff6ff; color: #2563eb; }
.badge-status-qianyue { background: #ecfdf5; color: #059669; }
.badge-status-zanting { background: #fef2f2; color: #dc2626; }
.badge-status-fuwu { background: #f0fdfa; color: #0d9488; }
.badge-status-fangqi { background: #f9fafb; color: #4b5563; }
.badge-status-daixuyue { background: #fff7ed; color: #ea580c; }
.badge-type { background: #f5f3ff; color: #7c3aed; }

.op-cell { display: flex; gap: 2px; white-space: nowrap; }

/* 空状态 */
.empty-state {
  padding: 70px 20px;
  text-align: center;
  color: var(--text-light);
}
.empty-icon { font-size: 44px; margin-bottom: 14px; opacity: .7; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-desc { font-size: 13px; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .45);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalIn .18s ease;
}
.modal-wide { max-width: 760px; }
.modal-small { max-width: 460px; }

/* 弹窗层级：普通弹窗 100 < 复制弹窗 110 < 确认弹窗 120 */
#planCopyModal { z-index: 110; }
#confirmModal { z-index: 120; }

@keyframes modalIn {
  from { transform: translateY(14px) scale(.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 17px; font-weight: 700; }

.modal-close {
  background: none; border: none;
  font-size: 16px; color: var(--text-light);
  cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
.modal-close:hover { background: #f3f4f6; color: var(--text); }

.modal-body { padding: 20px 22px; overflow-y: auto; }

.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
}

/* 表单 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.form-item.full { grid-column: 1 / -1; }
.form-item label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.req { color: var(--danger); font-style: normal; }
.form-item input, .form-item select, .form-item textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.form-item textarea { resize: vertical; min-height: 60px; }
.form-item input:focus, .form-item select:focus, .form-item textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

/* 跟进弹窗 */
.followup-add {
  background: #f8fafd;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 18px;
}
.followup-add-actions { display: flex; justify-content: flex-end; margin-top: 12px; }

.followup-list { display: flex; flex-direction: column; gap: 10px; }

.followup-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
}
.followup-item-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 6px;
}
.followup-seq {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #059669;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.followup-method {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
}
.followup-result {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
}
.followup-result.result-genjin { background: #eff6ff; color: #2563eb; }
.followup-result.result-youyixiang { background: #f5f3ff; color: #7c3aed; }
.followup-result.result-qianyue { background: #ecfdf5; color: #059669; }
.followup-result.result-zanhuan { background: #f3f4f6; color: #6b7280; }
.followup-result.result-zanting { background: #fef2f2; color: #dc2626; }
.followup-time { font-size: 13px; color: var(--text-secondary); flex: 1; }
.followup-content { font-size: 14px; line-height: 1.6; color: var(--text); white-space: pre-wrap; }
.followup-detail {
  margin-top: 10px;
  padding: 10px 12px;
  background: #f8fafd;
  border-left: 3px solid #c7d7f5;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.7;
  color: #4b5563;
  white-space: pre-wrap;
  word-break: break-word;
}
.followup-empty { text-align: center; color: var(--text-light); padding: 26px 0; font-size: 13px; }

/* 类型管理 */
.type-add-row { display: flex; gap: 10px; margin-bottom: 16px; }
.type-add-row input {
  flex: 1; padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; font-family: inherit; outline: none;
}
.type-add-row input:focus { border-color: var(--primary); }

.type-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.type-list li {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}

.confirm-text { font-size: 14px; color: var(--text); line-height: 1.7; }

/* 提示条 */
.toast {
  position: fixed;
  top: 24px; left: 50%;
  transform: translateX(-50%);
  background: #111827;
  color: #fff;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 200;
  box-shadow: var(--shadow-lg);
  animation: toastIn .2s ease;
  max-width: 80vw;
}
.toast.success { background: #059669; }
.toast.error { background: var(--danger); }
@keyframes toastIn {
  from { transform: translate(-50%, -12px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* ---------- 跟进计划轴 ---------- */
.plan-axis {
  margin-top: 18px;
  padding: 16px;
  background: #fbfcfe;
  border: 1px solid #e5eaf2;
  border-radius: 10px;
}
.plan-axis-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.plan-axis-head-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.plan-axis-title {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.plan-axis-title::before {
  content: '';
  width: 4px;
  height: 15px;
  background: var(--primary);
  border-radius: 2px;
}
.plan-progress-text { font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.plan-copy-tip {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.6;
}
.plan-copy-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}
.plan-progress-bar {
  height: 8px;
  background: #e8edf5;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 14px;
}
.plan-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #22c55e);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.plan-add-form {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.plan-period-input { width: 130px; flex-shrink: 0; }
.plan-title-input { flex: 1; min-width: 180px; }
.plan-add-form input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
.plan-add-form input:focus { border-color: var(--primary); }
.plan-add-form .btn { padding: 8px 14px; font-size: 13px; white-space: nowrap; }

.plan-list { display: flex; flex-direction: column; }
.plan-item {
  display: flex;
  gap: 12px;
  position: relative;
  padding-bottom: 18px;
}
.plan-item::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 16px;
  bottom: 0;
  width: 2px;
  background: #dfe6f1;
}
.plan-item:last-child::before { display: none; }
.plan-item:last-child { padding-bottom: 0; }
.plan-item-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  flex-shrink: 0;
  margin-top: 4px;
  z-index: 1;
  background: #9ca3af;
  box-shadow: 0 0 0 2px #d1d5db;
}
.plan-item.plan-doing .plan-item-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 2px #fde68a;
  animation: planPulse 1.6s infinite;
}
.plan-item.plan-done .plan-item-dot {
  background: #22c55e;
  box-shadow: 0 0 0 2px #bbf7d0;
}
@keyframes planPulse {
  0%, 100% { box-shadow: 0 0 0 2px #fde68a; }
  50% { box-shadow: 0 0 0 5px #fef3c7; }
}
.plan-item-body {
  flex: 1;
  min-width: 0;
  background: #fff;
  border: 1px solid #eef1f7;
  border-radius: 10px;
  padding: 12px 14px;
}
.plan-item.plan-done .plan-item-body { background: #f7fdf9; border-color: #d9f2e2; }
.plan-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.plan-period {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: #eaf1fe;
  padding: 3px 10px;
  border-radius: 999px;
}
.plan-status {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
}
.plan-status-pending { background: #f3f4f6; color: #6b7280; }
.plan-status-doing { background: #fef3c7; color: #b45309; }
.plan-status-done { background: #dcfce7; color: #15803d; }
.plan-title { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.5; word-break: break-word; }
.plan-item.plan-done .plan-title { color: #6b7280; text-decoration: line-through; }

.plan-note-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.plan-note-input {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  outline: none;
}
.plan-note-input:focus { border-color: var(--primary); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.plan-item-actions {
  display: flex;
  gap: 14px;
  margin-top: 8px;
}

/* ---------- 客户详情弹窗 ---------- */
.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.detail-head-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-name { font-size: 20px; font-weight: 700; }
.detail-head-meta { font-size: 12px; color: var(--text-light); }

.detail-section {
  padding: 16px 0;
  border-bottom: 1px solid #f1f4f8;
}
.detail-section:last-child { border-bottom: none; }
.detail-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.detail-section-title::before {
  content: '';
  width: 4px;
  height: 14px;
  background: var(--primary);
  border-radius: 2px;
}

.detail-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 20px;
}
.detail-info-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: #f8fafd;
  border-radius: 8px;
  padding: 10px 12px;
}
.d-label { font-size: 12px; color: var(--text-light); }
.d-value { font-size: 14px; font-weight: 600; color: var(--text); word-break: break-all; }
.detail-note {
  margin-top: 12px;
  background: #f8fafd;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.detail-note-text { font-size: 14px; color: var(--text); line-height: 1.7; white-space: pre-wrap; word-break: break-word; }

.detail-stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.detail-stat {
  background: linear-gradient(135deg, #f0f6ff, #eaf2fe);
  border: 1px solid #dbe7fb;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.detail-stat-num { font-size: 18px; font-weight: 700; color: var(--primary); word-break: break-all; }
.detail-stat-label { font-size: 12px; color: var(--text-secondary); }

.detail-timeline-item {
  display: flex;
  gap: 12px;
  position: relative;
  padding-bottom: 16px;
}
.detail-timeline-item::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 14px;
  bottom: 0;
  width: 2px;
  background: #e5e9f0;
}
.detail-timeline-item:last-child::before { display: none; }
.detail-timeline-item:last-child { padding-bottom: 0; }
.detail-timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #c7d7f5;
  flex-shrink: 0;
  margin-top: 4px;
  z-index: 1;
}
.detail-timeline-body {
  flex: 1;
  min-width: 0;
}
.detail-timeline-body .followup-item-head { margin-bottom: 6px; }

/* ---------- 响应式 ---------- */
/* 平板 */
@media (max-width: 900px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .form-grid.cols-3 { grid-template-columns: 1fr 1fr; }
  .detail-info-grid { grid-template-columns: 1fr 1fr; }
  .detail-stat-row { grid-template-columns: 1fr; }
  .header { padding: 12px 16px; }
  .type-tabs, .main { padding-left: 16px; padding-right: 16px; }
}

/* 手机端 */
@media (max-width: 768px) {
  /* 顶部栏 */
  .header { padding: 10px 12px; gap: 6px; }
  .header-left { gap: 10px; }
  .logo { width: 38px; height: 38px; font-size: 17px; border-radius: 9px; }
  .header-title { font-size: 16px; }
  .header-subtitle { font-size: 11px; }
  .header-right { gap: 10px; flex-wrap: wrap; }
  .header-stat { gap: 3px; }
  .header-stat-num { font-size: 14px; }
  .header-stat-label { font-size: 11px; }
  .header .btn { padding: 8px 11px; font-size: 13px; }

  /* 类型标签页 */
  .type-tabs { padding: 0 4px; gap: 0; }
  .type-tab { padding: 11px 13px; font-size: 13px; }
  .type-tab-manage { margin-left: auto; padding: 11px 10px; font-size: 12px; }

  /* 主内容 */
  .main { padding: 14px 12px; }

  /* 统计卡片 */
  .stat-cards { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
  .stat-card { padding: 14px 16px; gap: 5px; }
  .stat-num { font-size: 24px; }
  .stat-label { font-size: 12px; }

  /* 工具栏 */
  .toolbar { padding: 10px 12px; gap: 8px; margin-bottom: 12px; }
  .search-box { flex-basis: 100%; min-width: 0; }
  .search-box input { font-size: 15px; padding: 10px 12px 10px 34px; }
  .filter-select { flex: 1; font-size: 13px; padding: 9px 8px; }
  .toolbar .btn { flex: 0 0 auto; padding: 9px 12px; font-size: 13px; }

  /* 表格 → 卡片 */
  .table-card { background: transparent; border: none; box-shadow: none; overflow: visible; }
  .customer-table { min-width: 0; display: block; }
  .customer-table thead { display: none; }
  .customer-table tbody { display: flex; flex-direction: column; gap: 12px; }
  .customer-table tbody tr {
    display: block;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px;
  }
  .customer-table tbody tr:hover { background: var(--card); }
  .customer-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px dashed #f1f4f8;
    font-size: 14px;
    text-align: right;
  }
  .customer-table td:last-child { border-bottom: none; }
  .customer-table td::before {
    content: attr(data-label);
    font-size: 12px;
    color: var(--text-light);
    flex-shrink: 0;
    text-align: left;
  }
  .customer-table td.customer-name {
    font-size: 16px;
    justify-content: flex-start;
    padding: 2px 0 10px;
    border-bottom: 1px solid var(--border);
  }
  .customer-table td.customer-name::before { display: none; }
  .customer-table td.num-col { text-align: right; }
  .customer-table td.center-col { text-align: right; }
  .op-cell { gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
  .customer-table td:last-child .op-cell { justify-content: flex-end; }
  .op-cell .btn-link { font-size: 14px; padding: 10px 4px; min-height: 40px; }

  /* 空状态 */
  .empty-state { padding: 50px 16px; }

  /* 弹窗 */
  .modal-mask { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100%;
    max-height: 94vh;
    border-radius: 16px 16px 0 0;
    width: 100%;
  }
  .modal-header { padding: 14px 16px; }
  .modal-header h2 { font-size: 16px; }
  .modal-body { padding: 14px 16px; }
  .modal-footer { padding: 12px 16px; }
  .modal-close { font-size: 18px; padding: 6px 10px; }

  /* 表单 */
  .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; gap: 12px; }
  .form-item input, .form-item select, .form-item textarea { font-size: 15px; padding: 10px 12px; }

  /* 跟进弹窗：新增表单三列改堆叠 */
  .followup-add .form-grid.cols-3 { grid-template-columns: 1fr; }

  /* 跟进记录列表：限制高度并内部滚动，避免编辑表单溢出覆盖计划轴 */
  .followup-list { max-height: 300px; overflow-y: auto; }

  /* 计划轴 */
  .plan-axis { padding: 12px; }
  .plan-add-form { flex-direction: column; }
  .plan-period-input { width: 100%; }
  .plan-title-input { min-width: 0; }
  .plan-add-form input { font-size: 15px; padding: 10px 12px; }
  .plan-add-form .btn { width: 100%; padding: 11px; font-size: 14px; }
  .plan-note-row { flex-direction: column; }
  .plan-note-input { font-size: 14px; }
  .plan-note-row .btn-sm { padding: 9px; font-size: 13px; }
  .plan-item-actions .btn-link { font-size: 14px; padding: 6px 2px; }

  /* 详情弹窗 */
  .detail-name { font-size: 17px; }
  .detail-head-meta { font-size: 11px; }
  .detail-info-grid { grid-template-columns: 1fr; gap: 8px; }
  .detail-info-item { padding: 9px 12px; }
  .detail-stat-row { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .detail-stat { padding: 10px 12px; }
  .detail-stat-num { font-size: 15px; }
  .detail-stat-label { font-size: 11px; }

  /* 确认弹窗 */
  .modal-small { max-width: 100%; }

  /* Toast */
  .toast { left: 12px; right: 12px; bottom: 14px; top: auto; transform: none; font-size: 14px; text-align: center; }
}

/* 超小屏 */
@media (max-width: 380px) {
  .stat-cards { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-num { font-size: 20px; }
  .header-title { font-size: 15px; }
  .header-subtitle { display: none; }
  .header-stat-label { font-size: 10px; }
  .detail-stat-row { grid-template-columns: 1fr; }
  .op-cell { gap: 12px; }
}
