/* ===== 微拓CRM Web后台样式 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1f2937;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --green: #10b981;
  --orange: #f59e0b;
  --red: #ef4444;
  --gray: #9ca3af;
}

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

/* ===== 登录页 ===== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #3b82f6 100%);
}
.login-card {
  background: var(--card);
  border-radius: 16px;
  padding: 48px 40px;
  width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  text-align: center;
}
.login-logo { font-size: 48px; margin-bottom: 12px; }
.login-card h1 { font-size: 22px; margin-bottom: 6px; }
.login-sub { color: var(--text-light); margin-bottom: 32px; }
.login-tip { margin-top: 20px; color: var(--text-light); font-size: 12px; }

/* ===== 表单 ===== */
.form-group { text-align: left; margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; }
.form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border .2s;
}
.form-group input:focus { border-color: var(--primary); }

/* ===== 按钮 ===== */
.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-light { background: #eef2ff; color: var(--primary); }
.btn-light:hover { background: #e0e7ff; }
.btn-ghost { background: transparent; color: var(--text-light); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--gray); }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.btn-success { background: #ecfdf5; color: var(--green); }
.btn-success:hover { background: #d1fae5; }
.btn-danger { background: #fef2f2; color: var(--red); }
.btn-danger:hover { background: #fee2e2; }

/* ===== 布局 ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 132px;              /* 原 220px，压缩 40% */
  background: #111827;
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
}
.sidebar-logo {
  padding: 14px 10px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-nav { flex: 1; padding: 10px 8px; }
.nav-item {
  display: block;
  padding: 9px 10px;
  font-size: 13px;
  color: #9ca3af;
  border-radius: 8px;
  margin-bottom: 4px;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-item.active { background: var(--primary); color: #fff; }
.sidebar-user {
  padding: 10px 10px 0;
  font-size: 11px;
  color: #9ca3af;
  border-top: 1px solid rgba(255,255,255,.08);
  margin-top: 8px;
}
.sidebar-user strong { color: #fff; }
.sidebar-footer { padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.sidebar-footer .btn { padding: 7px 8px; font-size: 12px; }
.sidebar-footer .btn-ghost { color: #9ca3af; border-color: rgba(255,255,255,.15); }
.sidebar-footer .btn-ghost:hover { color: #fff; }

.main { flex: 1; margin-left: 132px; padding: 12px 16px; min-width: 0; }

/* ===== 全屏表格视图：顶部功能区 ≤25vh，表格占满剩余屏幕 ===== */
.fill-view {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 24px);
  min-height: 460px;
}
.page-top { flex: 0 0 auto; max-height: 25vh; overflow-y: auto; overflow-x: hidden; }
.fill-view .page-head { margin-bottom: 10px; }
.fill-view .page-head h2 { font-size: 17px; }
.fill-view .panel { padding: 12px 14px; margin-bottom: 10px; }
.fill-view .panel-title { font-size: 14px; margin-bottom: 8px; }
.fill-view .filter-bar { gap: 10px; }
.fill-view .filter-item { gap: 4px; }
.fill-view .filter-item input, .fill-view .filter-item select { padding: 6px 8px; font-size: 13px; }
.fill-view .btn { padding: 7px 14px; font-size: 13px; }
.fill-view .btn-sm { padding: 4px 10px; font-size: 12px; }
.panel-table {
  flex: 1 1 auto; display: flex; flex-direction: column;
  min-height: 0;
}
.fill-view .panel-table { margin-bottom: 0; }
.panel-table .table-wrap { flex: 1 1 auto; max-height: none; min-height: 140px; }
.panel-table .tip { margin: 6px 0 0; }
.panel-table .pager { padding: 8px 0 0; }

/* ===== 地图视角：地图占满剩余屏幕（与列表页同样的大占比布局） ===== */
.panel-map {
  flex: 1 1 auto; display: flex; flex-direction: column;
  min-height: 0; margin-bottom: 0;
}
.panel-map #custMap { flex: 1 1 auto; height: auto; min-height: 320px; }
.panel-map .map-nocoord { flex: 0 0 auto; }

/* 地图视角：顶部功能区硬性 ≤20vh（覆盖通用 25vh 规则，id 选择器优先级更高） */
#customerMapView .page-top { max-height: 20vh; }
#customerMapView .page-head { margin-bottom: 8px; }
#customerMapView .page-head h2 { font-size: 16px; }
#customerMapView .panel { padding: 8px 12px; margin-bottom: 0; }
#customerMapView .filter-bar { gap: 8px; align-items: center; }
#customerMapView .filter-item { gap: 3px; }
#customerMapView .filter-item label { font-size: 12px; }
#customerMapView .filter-item input,
#customerMapView .filter-item select { padding: 5px 7px; font-size: 12px; }
#customerMapView .btn { padding: 6px 12px; font-size: 12px; }
#customerMapView .map-legend { gap: 14px; margin: 0 0 0 6px; font-size: 12px; }

/* 地图视角：左侧客户清单 + 右侧地图 左右分栏 */
.map-split { flex: 1 1 auto; display: flex; gap: 10px; min-height: 0; }
.map-split-right { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.map-cust-list {
  flex: 0 0 262px; width: 262px; min-height: 0;
  display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; overflow: hidden;
}
.mcl-head {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  padding: 7px 10px; border-bottom: 1px solid var(--border);
  background: #f8fafc; font-size: 13px; font-weight: 600; color: var(--text);
}
.mcl-head .mcl-count { font-weight: 400; font-size: 12px; color: var(--text-light); }
.mcl-body { flex: 1 1 auto; overflow-y: auto; list-style: none; margin: 0; padding: 0; }
.mcl-empty { padding: 16px 12px; color: var(--text-light); font-size: 12px; line-height: 1.7; text-align: center; }
.mcl-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 7px 10px; border-bottom: 1px solid #f1f5f9; cursor: pointer;
  transition: background .12s;
}
.mcl-item:hover { background: #f1f7ff; }
.mcl-item.active { background: #e8f1fe; box-shadow: inset 3px 0 0 var(--primary); }
.mcl-no {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; font-weight: 700; line-height: 1;
  border: 2px solid #fff; box-shadow: 0 0 3px rgba(0,0,0,.3);
}
.mcl-main { min-width: 0; flex: 1 1 auto; }
.mcl-name {
  display: block; font-size: 13px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mcl-meta { display: block; font-size: 11px; color: var(--text-light); margin-top: 2px; }
.mcl-meta .mcl-flag { font-weight: 600; }

/* 地图上的数字标注（与左侧清单序号一一对应） */
.map-num-marker { background: none; border: none; }
.map-num-marker span {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  color: #fff; font-size: 11px; font-weight: 700; line-height: 1;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.45);
  box-sizing: border-box;
}
.map-num-marker.mnm-active span {
  width: 30px; height: 30px; font-size: 13px;
  border-width: 3px; box-shadow: 0 0 0 4px rgba(30,102,245,.28), 0 1px 6px rgba(0,0,0,.5);
}

/* ===== 页头 ===== */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.page-head h2 { font-size: 20px; }

/* ===== 统计卡片 ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.stat-num { font-size: 36px; font-weight: 700; color: var(--primary); }
.stat-a .stat-num { color: var(--red); }
.stat-b .stat-num { color: var(--orange); }
.stat-p .stat-num { color: var(--green); }
.stat-label { color: var(--text-light); margin-top: 4px; }

/* ===== 面板 ===== */
.panel {
  background: var(--card);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.panel-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }

/* ===== 县区分布 ===== */
.county-list { display: flex; flex-direction: column; gap: 12px; }
.county-row { display: flex; align-items: center; gap: 12px; }
.county-name { width: 70px; font-weight: 500; }
.county-bar-bg { flex: 1; height: 24px; background: #f3f4f6; border-radius: 12px; overflow: hidden; }
.county-bar { height: 100%; background: linear-gradient(90deg, #3b82f6, #2563eb); border-radius: 12px; transition: width .5s; }
.county-count { width: 60px; text-align: right; color: var(--text-light); }

/* ===== 表格 ===== */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.table th { font-weight: 600; color: var(--text-light); font-size: 13px; background: #f9fafb; }
.table tr:last-child td { border-bottom: none; }
.table .empty { text-align: center; color: var(--text-light); padding: 32px 0; }
.table .btn + .btn { margin-left: 6px; }

/* ===== 客户列表：冻结表头 + 双向滚动（表体上下左右拖动） ===== */
.table-wrap {
  overflow: auto;                                /* 上下左右滚动 */
  max-height: calc(100vh - 320px);               /* 自适应屏幕高度 */
  min-height: 200px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.table-wrap .table { min-width: 1080px; margin: 0; }   /* 列多时出现横向滚动条 */
.table-wrap-follow .table { min-width: 880px; }
.table-wrap .table th {
  position: sticky; top: 0; z-index: 5;          /* 冻结表头 */
  background: #f1f3f6;
  box-shadow: inset 0 -1px 0 var(--border);
}
.table-wrap .table td { white-space: nowrap; }
.table-wrap .table .empty { white-space: normal; }

/* ===== 智能表格：拖拽列宽 / 拖拽列顺序 / 表头悬停漏斗筛选 ===== */
/* width:max-content 让 colgroup 里设定的列宽精确生效；min-width:100% 保证窄表依然铺满面板 */
.smart-table { table-layout: fixed; width: max-content; min-width: 100%; }
.smart-table thead th {
  cursor: grab;
  user-select: none;
  padding-right: 32px;                 /* 给缩放条 + 漏斗按钮留位置 */
}
.smart-table thead th:active { cursor: grabbing; }
.smart-table th.dragging { opacity: .4; }
.smart-table th.drag-over { box-shadow: inset 3px 0 0 var(--primary), inset 0 -1px 0 var(--border); }
.smart-table th, .smart-table td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.smart-table td .tag, .smart-table td .btn { white-space: nowrap; }
.smart-table .col-resizer {
  position: absolute; top: 0; right: 0; width: 9px; height: 100%;
  cursor: col-resize; z-index: 7;
}
.smart-table .col-resizer:hover { background: linear-gradient(90deg, transparent, rgba(37,99,235,.4)); }
.smart-table .col-filter {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; padding: 0; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 4px; background: transparent;
  color: #9ca3af; cursor: pointer; opacity: 0; transition: opacity .15s; z-index: 8;
}
.smart-table thead th:hover .col-filter { opacity: 1; }     /* 鼠标移入表头显示 */
.smart-table .col-filter:hover { background: #e0e7ff; color: var(--primary); }
.smart-table .col-filter.active { opacity: 1; color: var(--primary); background: #dbeafe; }
.smart-table .col-filter svg { width: 11px; height: 11px; display: block; }
.smart-table tr.row-filtered { display: none; }

/* 表头筛选下拉面板 */
.th-filter-pop {
  position: fixed; z-index: 9999; width: 210px;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0,0,0,.16); padding: 10px; font-size: 13px;
}
.th-filter-pop .fp-title { font-weight: 600; font-size: 12px; margin-bottom: 6px; }
.th-filter-pop .fp-note { font-size: 11px; color: var(--text-light); margin-bottom: 6px; }
.th-filter-pop .fp-search {
  width: 100%; padding: 5px 8px; margin-bottom: 6px;
  border: 1px solid var(--border); border-radius: 6px; font-size: 12px; outline: none;
}
.th-filter-pop .fp-search:focus { border-color: var(--primary); }
.th-filter-pop .fp-list {
  max-height: 180px; overflow-y: auto; margin-bottom: 8px;
  border: 1px solid var(--border); border-radius: 6px; padding: 4px 6px;
}
.th-filter-pop .fp-list label { display: flex; align-items: center; gap: 6px; padding: 2px 0; cursor: pointer; font-size: 12px; }
.th-filter-pop .fp-list label span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-filter-pop .fp-list .fp-none { color: var(--text-light); padding: 6px; font-size: 12px; }
.th-filter-pop .fp-btns { display: flex; gap: 8px; }
.th-filter-pop .fp-btn {
  flex: 1; padding: 5px 0; font-size: 12px; font-family: inherit; cursor: pointer;
  border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--text);
}
.th-filter-pop .fp-btn:hover { background: #f3f4f6; }
.th-filter-pop .fp-btn.ok { background: var(--primary); border-color: var(--primary); color: #fff; }
.th-filter-pop .fp-btn.ok:hover { background: var(--primary-dark); }
/* 视图切换按钮 */
.view-toggle { display: inline-flex; border: 1px solid var(--primary); border-radius: 8px; overflow: hidden; }
.view-toggle .btn { border-radius: 0; border: none; }
.view-toggle .btn.active { background: var(--primary); color: #fff; }

/* ===== 客户地图视角 ===== */
.map-legend { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; margin: 10px 0 12px; font-size: 13px; color: var(--text); }
.map-legend .dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; border: 2px solid #fff; box-shadow: 0 0 3px rgba(0,0,0,.35); }
.dot-never { background: #1e66f5; }     /* 未拜访 · 蓝 */
.dot-visited { background: #2e9e4f; }   /* 已拜访 · 绿 */
.dot-revisit { background: #f2b01e; }   /* 待回访 · 黄 */
#custMap { width: 100%; height: 580px; border: 1px solid var(--border); border-radius: 8px; background: #eef2f5; }
.map-pop { font-size: 13px; line-height: 1.7; max-width: 260px; }
.map-pop .mp-name { font-size: 14px; font-weight: 700; }
.map-pop .mp-muted { color: #888; }
.map-nocoord { margin-top: 8px; color: var(--text-light); font-size: 12px; }

/* ===== 标签 ===== */
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.tag-boss { background: #ede9fe; color: #7c3aed; }
.tag-sales { background: #e0f2fe; color: #0284c7; }
.tag-ok { background: #ecfdf5; color: var(--green); }
.tag-wait { background: #fffbeb; color: var(--orange); }
.tag-off { background: #f3f4f6; color: var(--gray); }
.tag-reject { background: #fef2f2; color: var(--red); }

/* ===== 导入区 ===== */
.county-picker { display: flex; gap: 12px; }
.radio-card {
  flex: 1;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  font-weight: 500;
}
.radio-card input { display: none; }
.radio-card:has(input:checked) { border-color: var(--primary); background: #eff6ff; color: var(--primary); }

.tip { color: var(--text-light); font-size: 12px; margin-top: 8px; }

.upload-area {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
}
.upload-area:hover { border-color: var(--primary); background: #f8fafc; }
.upload-icon { font-size: 40px; margin-bottom: 8px; }

.file-preview {
  margin-top: 16px;
  padding: 16px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
}
.file-preview .fname { font-weight: 600; color: #166534; }
.file-preview .finfo { margin-top: 6px; color: var(--text-light); }

/* ===== 进度条 ===== */
.progress-wrap { margin-top: 16px; }
.progress-bar {
  height: 12px;
  background: #f3f4f6;
  border-radius: 6px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  border-radius: 6px;
  transition: width .3s;
}
#progressText { margin-top: 8px; color: var(--text-light); }

.import-result {
  margin-top: 16px;
  padding: 16px;
  border-radius: 8px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-size: 14px;
}
.import-result.error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* ===== 弹窗 ===== */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-card {
  background: #fff;
  border-radius: 12px;
  padding: 28px;
  width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.modal-title { font-size: 17px; font-weight: 600; margin-bottom: 20px; }
.modal-btns { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; }

/* ===== 客户详情编辑弹窗（宽版） ===== */
.modal-lg { width: 680px; max-width: 94vw; max-height: 88vh; overflow-y: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .form-group { min-width: 0; }
.form-grid textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; box-sizing: border-box; resize: vertical; font-family: inherit;
}
.form-grid textarea:focus { border-color: var(--primary); outline: none; }
.cd-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.cd-meta-item {
  font-size: 12px; color: var(--text-light); background: #f3f4f6;
  padding: 4px 10px; border-radius: 999px;
}
.customer-link { color: var(--primary); text-decoration: none; }
.customer-link:hover { text-decoration: underline; }
.table input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; accent-color: var(--primary); }

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #111827;
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
}

/* ===== 筛选栏 ===== */
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}
.filter-item { display: flex; flex-direction: column; gap: 6px; }
.filter-item label { font-size: 12px; color: var(--text-light); font-weight: 500; }
.filter-item input, .filter-item select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  font-family: inherit;
  background: #fff;
  min-width: 130px;
  transition: border .2s;
}
.filter-item input:focus, .filter-item select:focus { border-color: var(--primary); }

/* ===== 分页 ===== */
.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
}
.pager-info { color: var(--text-light); font-size: 13px; }

/* ===== 授权区域勾选 ===== */
.auth-checks { display: flex; gap: 12px; flex-wrap: wrap; }
.check-item {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  transition: all .2s;
  font-weight: 500;
  user-select: none;
}
.check-item:hover { border-color: var(--primary); }
.check-item input { accent-color: var(--primary); }
.check-item:has(input:checked) { border-color: var(--primary); background: #eff6ff; color: var(--primary); }

/* ===== 跟进类型标签 ===== */
.tag-visit { background: #eff6ff; color: #1d4ed8; }
.tag-call { background: #ecfdf5; color: #059669; }
.tag-status { background: #fef3c7; color: #b45309; }

/* ===== 数据看板概览 ===== */
.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.board-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.chip-group { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-group .check-item { padding: 6px 12px; font-size: 13px; border-width: 1.5px; }

/* ===== 导入失败明细 ===== */
.fail-list {
  margin-top: 12px;
  padding: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  max-height: 240px;
  overflow-y: auto;
  text-align: left;
}
.fail-title { font-weight: 600; color: #991b1b; margin-bottom: 6px; }
.fail-row {
  padding: 4px 0;
  color: #7f1d1d;
  font-size: 13px;
  border-bottom: 1px dashed #fecaca;
}
.fail-row:last-child { border-bottom: none; }

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .board-grid { grid-template-columns: repeat(2, 1fr); }
  .board-detail { grid-template-columns: 1fr; }
  .layout { flex-direction: column; }
  .sidebar { position: static; width: 100%; flex-direction: row; align-items: center; }
  .sidebar-nav { display: flex; padding: 8px; }
  .nav-item { margin-bottom: 0; margin-right: 4px; }
  .sidebar-footer { display: none; }
  .main { margin-left: 0; padding: 12px; }
  .fill-view { height: auto; min-height: 0; }
  .page-top { max-height: none; }
  .panel-table .table-wrap { max-height: 70vh; }
  .county-picker { flex-direction: column; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  /* 窄屏：客户清单改为地图上方的一条横条，避免挤压地图 */
  .map-split { flex-direction: column; }
  .map-cust-list { flex: 0 0 auto; width: auto; max-height: 190px; }
  #customerMapView .page-top { max-height: none; }
  #customerMapView .panel-map #custMap { min-height: 300px; }
}
