/* ========== 基础 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #1f2329;
  background: #f2f4f7;
  font-size: 14px;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ========== 通用组件 ========== */
.btn {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 16px;
  font-size: 14px;
  background: #fff;
  color: #1f2329;
  transition: all .15s;
}
.btn-primary { background: #1677ff; color: #fff; }
.btn-primary:hover { background: #3b8bff; }
.btn-default { border-color: #d5dae3; color: #394152; }
.btn-default:hover { border-color: #1677ff; color: #1677ff; }
.btn-ghost { border: none; background: none; color: #8a94a6; }
.btn-ghost:hover { color: #1677ff; }
.btn-danger-text { border: none; background: none; color: #f04438; }
.btn-danger-text:hover { color: #d92d20; text-decoration: underline; }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.select, .text-input, input[type="text"], input[type="password"], input[type="number"], input[type="date"], textarea {
  width: 100%;
  border: 1px solid #d5dae3;
  border-radius: 8px;
  padding: 8px 12px;
  background: #fff;
  color: #1f2329;
  outline: none;
}
.select:focus, input:focus, textarea:focus { border-color: #1677ff; box-shadow: 0 0 0 2px rgba(22,119,255,.12); }
textarea { resize: vertical; min-height: 72px; }

/* ========== 自绘下拉（替代原生 select 的弹出列表） ==========
 * 原生 select 的选项列表由浏览器绘制，在弹窗（position:fixed）或复杂布局里
 * 会错误地弹到页面顶部/左上角，CSS 无法修正。这里保留原生 select 存值，
 * 用 .cs 包一层按钮 + 自绘列表（fixed 定位挂到 body，不被容器裁剪）。 */
.cs { display: block; position: relative; }
select.cs-native {
  position: absolute !important; inset: 0 !important;
  width: 100% !important; height: 100% !important;
  margin: 0 !important; padding: 0 !important; border: 0 !important;
  opacity: 0; pointer-events: none;
  -webkit-appearance: none; appearance: none;
}
.cs-btn {
  width: 100%; text-align: left; position: relative; box-sizing: border-box;
  border: 1px solid #d5dae3; border-radius: 8px;
  padding: 8px 30px 8px 12px;
  background: #fff; color: #1f2329;
  font-size: inherit; font-family: inherit; line-height: 1.4;
  cursor: pointer;
}
.cs-btn:hover { border-color: #b9c3d3; }
.cs-btn:focus { outline: none; border-color: #1677ff; box-shadow: 0 0 0 2px rgba(22,119,255,.12); }
.cs-btn:disabled { background: #f5f7fa; color: #98a2b3; cursor: not-allowed; }
.cs-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-placeholder .cs-text { color: #98a2b3; }
.cs-caret {
  position: absolute; right: 11px; top: 50%; margin-top: -2px;
  width: 0; height: 0;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid #8a94a6;
}
.cs-menu {
  display: none; position: fixed; z-index: 10001;   /* 必须高于台账导入遮罩 .li-mask 的 9999 */
  box-sizing: border-box;
  background: #fff; border: 1px solid #e3e8f0; border-radius: 10px;
  box-shadow: 0 10px 30px rgba(20,30,60,.18);
  padding: 4px; max-height: 320px;
  flex-direction: column;
  font-size: 13px;
}
.cs-menu.open { display: flex; }
.cs-search { flex: none; padding: 2px 2px 6px; }
.cs-search-input {
  width: 100%; box-sizing: border-box;
  border: 1px solid #e3e8f0; border-radius: 6px;
  padding: 5px 8px; font-size: 12px; outline: none;
}
.cs-search-input:focus { border-color: #1677ff; }
.cs-list { overflow: auto; min-height: 0; outline: none; }
.cs-opt {
  padding: 7px 10px; border-radius: 6px; cursor: pointer;
  color: #1f2329; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cs-opt.active, .cs-opt:hover { background: #eef4ff; color: #1677ff; }
.cs-opt.active { font-weight: 600; }
.cs-opt.disabled { color: #c0c6cf; cursor: not-allowed; background: none; }
.cs-group { padding: 8px 10px 4px; font-size: 12px; color: #8a94a6; }
.cs-hide { display: none; }
/* 台账导入表格里的下拉：更紧凑 */
.cs-btn-li { min-width: 240px; font-size: 12px; padding: 5px 26px 5px 8px; border-radius: 7px; }

.seg { display: inline-flex; background: #eef1f6; border-radius: 8px; padding: 3px; gap: 2px; }
.seg-item {
  border: none; background: transparent; border-radius: 6px;
  padding: 5px 14px; font-size: 13px; color: #5a6474;
}
.seg-item.active { background: #1677ff; color: #fff; }

.toast {
  position: fixed; top: 72px; left: 50%; transform: translateX(-50%);
  background: rgba(20,24,33,.92); color: #fff;
  padding: 10px 22px; border-radius: 8px; font-size: 14px; z-index: 3000;
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
}

/* ========== 登录页 ========== */
.login-view {
  position: fixed; inset: 0; z-index: 1000;
  background: linear-gradient(135deg, #e8f0fe 0%, #f5f8ff 50%, #eef4ff 100%);
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  width: 400px; background: #fff; border-radius: 16px;
  box-shadow: 0 16px 48px rgba(22,60,120,.12);
  padding: 36px 36px 28px;
}
.login-logo { display: flex; gap: 14px; align-items: center; margin-bottom: 28px; }
.logo-badge {
  width: 46px; height: 46px; border-radius: 12px; background: #1677ff;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.logo-badge.sm { width: 32px; height: 32px; border-radius: 9px; }
.login-title { font-size: 22px; font-weight: 700; }
.login-sub { font-size: 13px; color: #8a94a6; margin-top: 2px; }
.login-form label { display: block; font-size: 13px; color: #5a6474; margin: 14px 0 6px; }
.login-error { color: #f04438; font-size: 13px; margin-top: 10px; }
.login-form .btn-block { margin-top: 22px; padding: 10px; font-size: 15px; }
.login-tip { margin-top: 14px; text-align: center; color: #a6aebc; font-size: 12px; }

/* ========== 主框架 ========== */
.app-shell { height: 100%; display: flex; flex-direction: column; }
.topbar {
  height: 56px; flex: none; background: #fff;
  display: flex; align-items: center; padding: 0 20px; gap: 28px;
  border-bottom: 1px solid #e6e9ef; position: relative; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-name { font-size: 17px; font-weight: 700; }
.tabs { display: flex; gap: 4px; height: 100%; }
.tab {
  display: flex; align-items: center; padding: 0 18px;
  color: #5a6474; text-decoration: none; font-size: 14px;
  border-bottom: 2px solid transparent; gap: 5px;
}
.tab.active { color: #1677ff; border-bottom-color: #1677ff; font-weight: 600; }
.user-area { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.user-name { font-size: 13px; color: #394152; }
.user-role {
  font-size: 12px; color: #1677ff; background: #e8f1ff;
  padding: 2px 8px; border-radius: 6px;
}

.page { flex: 1; min-height: 0; position: relative; }

/* ========== 企业地图页 ========== */
.page-map { display: flex; }
.side-panel {
  width: 304px; flex: none; background: #fff;
  border-right: 1px solid #e6e9ef;
  overflow-y: auto; padding: 16px;
}
.filter-block { margin-bottom: 16px; }
.filter-label { font-size: 13px; color: #8a94a6; margin-bottom: 8px; }
.check-grid { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.check-grid label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #394152; cursor: pointer; }
.check-grid input { accent-color: #1677ff; width: 15px; height: 15px; }

.list-head {
  display: flex; justify-content: space-between; align-items: center;
  margin: 18px 0 10px; padding-top: 14px; border-top: 1px solid #eef1f6;
  font-weight: 600; font-size: 14px;
}
.list-count { font-weight: 400; font-size: 12px; color: #a6aebc; }
.ent-list { display: flex; flex-direction: column; gap: 12px; padding-bottom: 20px; }
.ent-card {
  border: 1px solid #e6e9ef; border-radius: 12px; padding: 14px;
  cursor: pointer; transition: all .15s; background: #fff;
}
.ent-card:hover { border-color: #1677ff; box-shadow: 0 4px 14px rgba(22,119,255,.10); }
.ent-card.active { border-color: #1677ff; box-shadow: 0 4px 14px rgba(22,119,255,.14); }
.ent-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.ent-card-name { font-weight: 600; font-size: 14px; line-height: 1.4; }
.coop-tag {
  flex: none; font-size: 12px; padding: 1px 8px; border-radius: 6px;
  background: #f2f4f7; color: #8a94a6;
}
.coop-tag.yes { background: #e8f7ee; color: #12b76a; }
.ent-card-loc { margin-top: 6px; font-size: 12px; color: #8a94a6; display: flex; align-items: center; gap: 4px; }
.ent-card-tags { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.wt-tag {
  font-size: 12px; color: #1677ff; background: #eaf2ff;
  border-radius: 6px; padding: 1px 8px;
}
.ent-card-meta { margin-top: 8px; font-size: 12px; color: #8a94a6; line-height: 1.7; }

.map-wrap { flex: 1; min-width: 0; position: relative; }
.map-container { position: absolute; inset: 0; }

/* 图片瓦片兜底层：仅在运行环境的安全策略拦掉高德取瓦片时启用（见 app.js ensureFallbackTiles）。
 * z-index:1 恰好夹在白底 canvas(0) 与星标层 .amap-overlays(110) 之间；
 * pointer-events:none 保证鼠标事件穿透到地图，拖拽/缩放/点星标都不受影响。 */
.fb-tile-layer { position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: 1; pointer-events: none; }
.fb-tile-layer .fb-tile { position: absolute; display: block; border: 0; -webkit-user-drag: none; user-select: none; }
/* 环境限制提示：某些内置预览面板的 CSP 未放行高德域名时，SDK 能加载但瓦片请求被拦截 → 底图全白。
 * 给出明确原因，避免用户对着白屏猜"是不是地图被压小了"。 */
.map-alert {
  position: absolute; top: 64px; left: 50%; transform: translateX(-50%);
  max-width: 580px; z-index: 14; padding: 12px 16px;
  background: #fff7e6; border: 1px solid #ffd591; border-radius: 8px;
  color: #874d00; font-size: 13px; line-height: 1.75;
  box-shadow: 0 4px 16px rgba(20, 30, 60, .12);
}
.map-alert code { background: #fff1cc; padding: 1px 5px; border-radius: 4px; }
/* 自定义缩放控件（左下角，避开右侧详情抽屉） */
.map-zoom-ctrl {
  position: absolute; left: 12px; bottom: 46px; z-index: 12;
  display: flex; flex-direction: column;
  background: #fff; border-radius: 8px; overflow: hidden;
  box-shadow: 0 2px 10px rgba(20,30,60,.22);
}
.map-zoom-ctrl button {
  width: 34px; height: 34px; border: none; background: #fff;
  font-size: 17px; color: #1f2329; cursor: pointer; line-height: 1; padding: 0;
}
.map-zoom-ctrl button + button { border-top: 1px solid #eef0f3; }
.map-zoom-ctrl button:hover { background: #f2f6ff; color: #1677ff; }
.map-tip {
  position: absolute; z-index: 15; pointer-events: none;
  background: #fff; border-radius: 12px; padding: 14px 16px;
  box-shadow: 0 8px 28px rgba(20,30,60,.18);
  width: 264px; font-size: 13px;
}
.map-tip .tip-coop {
  display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 6px;
  background: #e8f7ee; color: #12b76a; margin-bottom: 6px;
}
.map-tip .tip-coop.no { background: #f2f4f7; color: #8a94a6; }
.map-tip .tip-name { font-weight: 700; margin-bottom: 8px; font-size: 14px; }
.map-tip .tip-row { color: #5a6474; line-height: 1.9; }
.map-tip .tip-row b { color: #1f2329; font-weight: 600; }

/* ========== 详情抽屉 ========== */
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: 400px; z-index: 18;
  background: #f7f8fa; border-left: 1px solid #e6e9ef;
  box-shadow: -8px 0 28px rgba(20,30,60,.10);
  display: flex; flex-direction: column;
}
.drawer-head {
  flex: none; display: flex; align-items: flex-start; gap: 10px;
  padding: 16px 18px 12px; background: #f7f8fa;
}
.drawer-title-wrap { flex: 1; min-width: 0; }
.drawer-title { font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-sub { font-size: 12px; color: #8a94a6; margin-top: 4px; }
.drawer-close {
  border: none; background: none; font-size: 16px; color: #8a94a6; padding: 4px;
}
.drawer-close:hover { color: #1f2329; }
.drawer-body { flex: 1; overflow-y: auto; padding: 4px 14px 14px; }
.drawer-foot {
  flex: none; padding: 12px; text-align: center; background: #f7f8fa;
  border-top: 1px solid #eef1f6;
}

.d-section { background: #fff; border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.d-section-head {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 15px; margin-bottom: 12px;
}
.d-section-head .sec-icon { color: #1677ff; display: inline-flex; }
.info-row { display: flex; padding: 7px 0; font-size: 13px; }
.info-row .k { width: 88px; flex: none; color: #8a94a6; }
.info-row .v { flex: 1; color: #1f2329; word-break: break-all; }

.job-card {
  background: #f7f8fa; border-radius: 10px; padding: 12px 14px; margin-bottom: 10px;
  position: relative;
}
.job-card-title { font-weight: 700; font-size: 14px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.job-tag { font-size: 11px; padding: 1px 7px; border-radius: 6px; font-weight: 500; }
.job-tag.skill { background: #dbe7ff; color: #1677ff; }
.job-tag.cert { background: #dcf5e6; color: #12b76a; }
.job-tag.exam { background: #fff0d9; color: #f79009; }
.job-card-actions { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; }
.icon-btn {
  border: none; background: none; color: #8a94a6; padding: 4px; border-radius: 6px;
}
.icon-btn:hover { color: #1677ff; background: #eaf2ff; }
.icon-btn.danger:hover { color: #f04438; background: #feecec; }
.job-card-meta { margin-top: 8px; font-size: 13px; color: #5a6474; line-height: 1.8; }
.job-card-meta b { color: #1f2329; }

.add-dashed {
  width: 100%; border: 1px dashed #cfd6e2; background: #fff; color: #5a6474;
  border-radius: 10px; padding: 10px; font-size: 13px;
}
.add-dashed:hover { border-color: #1677ff; color: #1677ff; }
.empty-tip { color: #a6aebc; font-size: 13px; text-align: center; padding: 18px 0 14px; }

.policy-card { background: #f7f8fa; border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; position: relative; }
.policy-title { font-weight: 600; font-size: 14px; }
.policy-desc { font-size: 13px; color: #8a94a6; margin-top: 4px; }

.stat-total { background: #eaf2ff; border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.stat-total-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; margin-bottom: 10px; }
.stat-total-head .badge {
  font-size: 12px; font-weight: 500; color: #1677ff; background: #fff;
  padding: 1px 10px; border-radius: 20px;
}
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 8px; }
.stat-cell .stat-k { font-size: 12px; color: #8a94a6; }
.stat-cell .stat-v { font-size: 18px; font-weight: 700; margin-top: 2px; }
.stat-amount {
  margin-top: 12px; background: #dce9ff; border-radius: 8px; padding: 10px 14px;
  display: flex; justify-content: space-between; align-items: center; font-size: 13px;
}
.stat-amount .amt { font-size: 18px; font-weight: 700; color: #1677ff; }
/* 客户卡片底部的比率行（通过率/回款率/回款额），比金额条轻一档 */
.stat-rates {
  margin-top: 10px; padding: 8px 12px; border-radius: 8px; background: #f5f7fb;
  font-size: 12px; color: #6b7789;
}
.stat-rates b { color: #1f2329; }
/* 回款率口径说明（分母截止日），让"怎么算的"在界面上写清楚 */
.stat-note {
  margin-top: 10px; font-size: 11px; line-height: 1.6; color: #6b7789;
  background: #fff; border-radius: 8px; padding: 7px 10px;
}
.stat-note b { color: #1677ff; }
.client-card { background: #fff; border: 1px solid #e6e9ef; border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.client-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.client-name { font-weight: 700; font-size: 14px; }
.order-tag { font-size: 11px; padding: 1px 7px; border-radius: 6px; background: #dbe7ff; color: #1677ff; }
.order-tag.first { background: #e8f7ee; color: #12b76a; }
.client-first { margin-left: auto; font-size: 12px; color: #a6aebc; }

/* ========== 地图总览 ========== */
.page-overview { display: flex; flex-direction: column; }
.ov-stats {
  flex: none; display: flex; gap: 14px; padding: 14px 18px;
  background: #f2f4f7; overflow-x: auto;
}
.ov-stat-card {
  background: #fff; border-radius: 12px; padding: 14px 20px; min-width: 150px;
  box-shadow: 0 2px 8px rgba(20,30,60,.05);
}
.ov-stat-k { font-size: 12px; color: #8a94a6; }
.ov-stat-v { font-size: 24px; font-weight: 700; margin-top: 4px; }
.ov-stat-v.blue { color: #1677ff; }
.ov-stat-v.green { color: #12b76a; }
.overview-map { position: relative; flex: 1; inset: auto; min-height: 0; }

/* ========== 系统管理 ========== */
.page-admin { overflow-y: auto; padding: 20px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(460px, 1fr)); gap: 16px; max-width: 1200px; }
.admin-card { background: #fff; border-radius: 12px; padding: 20px; }
.admin-card h3 { font-size: 15px; margin-bottom: 8px; }
.admin-desc { font-size: 13px; color: #8a94a6; line-height: 1.7; margin-bottom: 12px; }
.btn-row { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.btn-row.wrap { flex-wrap: wrap; }

/* 企业合并：两个下拉自适应宽度，箭头不换行 */
.merge-row { gap: 8px; }
.merge-row .cs { flex: 1 1 200px; min-width: 0; }
.merge-row .cs-btn-li { min-width: 0; width: 100%; }
.merge-arrow { font-size: 12px; color: #8a94a6; white-space: nowrap; }
.merge-stat { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 12px; font-size: 12px; color: #4e5969; border-bottom: 1px solid #f0f2f6; }
.merge-stat b { color: #1f2329; font-weight: 600; }
.merge-warn { padding: 8px 12px; font-size: 12px; color: #ad6800; background: #fffbe6; border-bottom: 1px solid #f0f2f6; line-height: 1.6; }
.file-name { font-size: 13px; color: #5a6474; }
.radio-row { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: #394152; margin-bottom: 6px; }
.radio-row input { accent-color: #1677ff; }
.import-result { margin-top: 12px; border: 1px solid #e6e9ef; border-radius: 10px; max-height: 260px; overflow: auto; }
.import-result table { width: 100%; border-collapse: collapse; font-size: 12px; }
.import-result th, .import-result td { padding: 6px 10px; text-align: left; border-bottom: 1px solid #f0f2f6; }
.import-result th { background: #f7f8fa; position: sticky; top: 0; }
.import-summary { padding: 10px 12px; font-size: 13px; background: #f7f8fa; border-bottom: 1px solid #e6e9ef; }
.tag-ok { color: #12b76a; } .tag-err { color: #f04438; } .tag-skip { color: #f79009; }
.admin-help { margin-top: 12px; font-size: 13px; color: #5a6474; }
.admin-help summary { cursor: pointer; color: #1677ff; }
.admin-help p { margin: 8px 0; line-height: 1.7; color: #8a94a6; }
.pwd-form { display: flex; flex-direction: column; gap: 10px; max-width: 320px; }
.pwd-msg { font-size: 13px; }

/* ========== 弹窗 ========== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,20,30,.45); z-index: 2000;
  display: flex; align-items: center; justify-content: center;
}
.modal-box {
  background: #fff; border-radius: 14px; width: 560px; max-width: 94vw;
  max-height: 88vh; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(10,20,50,.25);
}
.modal-box.wide { width: 760px; }
/* 地图选点层：必须叠在「新增/编辑企业」表单之上（同 z-index 时后插入者在上，这里显式提高更稳） */
#pick-layer { z-index: 2100; }
.modal-head {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px; font-size: 16px; font-weight: 700;
}
.modal-body { flex: 1; overflow-y: auto; padding: 4px 20px 16px; }
.modal-foot {
  flex: none; display: flex; justify-content: flex-end; gap: 10px;
  padding: 12px 20px 16px; border-top: 1px solid #f0f2f6;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-item label { display: block; font-size: 13px; color: #5a6474; margin-bottom: 6px; }
.form-item label .req { color: #f04438; }
.switch-row { display: flex; align-items: center; gap: 10px; height: 38px; }
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; background: #d5dae3; border-radius: 24px; transition: .2s;
}
.switch .slider::before {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px; transition: .2s;
}
.switch input:checked + .slider { background: #1677ff; }
.switch input:checked + .slider::before { transform: translateX(18px); }
.geo-status { font-size: 12px; color: #a6aebc; margin-top: 6px; }
.geo-status.ok { color: #12b76a; }
.geo-status.warn { color: #f79009; }
.map-pick-wrap { height: 320px; border-radius: 10px; overflow: hidden; position: relative; }
.map-pick-wrap .map-container { position: absolute; inset: 0; }
.map-pick-tip { font-size: 13px; color: #8a94a6; margin-bottom: 8px; }
.map-pick-tip b { color: #1f2733; font-weight: 600; }

/* 选点弹窗内的地点搜索：输入框 + 候选面板（浮在地图上，不压缩地图高度） */
.pick-search { display: flex; gap: 8px; margin-bottom: 8px; }
.pick-search input { flex: 1 1 auto; min-width: 0; }
.pick-search .btn { flex: 0 0 auto; white-space: nowrap; }
.pick-results {
  position: absolute; left: 8px; right: 8px; top: 8px; max-height: 62%;
  overflow-y: auto; background: #fff; border-radius: 10px;
  box-shadow: 0 6px 20px rgba(20, 30, 50, .18); z-index: 6; padding: 2px 0;
}
.pick-row { padding: 8px 12px; border-bottom: 1px solid #f0f2f6; cursor: pointer; }
.pick-row:last-child { border-bottom: 0; }
.pick-row:hover { background: #f5f9ff; }
.pick-row-name { font-size: 13px; font-weight: 600; color: #1f2733; }
.pick-row-addr { font-size: 12px; color: #8a94a6; margin-top: 2px; }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d5dae3; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #b8c0cf; }

/* ========== 高德地图企业星标 ========== */
/* 唯一定义：星标与名称同一 flex 基线（align-items:center → 垂直居中），gap 固定横向间隙 */
.ent-marker {
  display: flex; align-items: center; gap: 4px; cursor: pointer;
  white-space: nowrap; user-select: none; position: relative;
}
/* 资料待补企业：亮黄色星标（白色描边沿用基础样式）+ 琥珀名称药丸 + 右下角「!」角标。
 * 判定看「详细地址/企业类型/人员规模/班型/住宿环境」是否齐全（见 app.js incompleteFields），
 * 补齐后 refreshAll 重建星标即自动恢复蓝色，不需要额外状态。 */
.ent-marker--incomplete .ent-marker-star { color: #FFC400; }
.ent-marker--incomplete .ent-marker-label { background: #F59E0B; }
/* 角标绝对定位在 ★ 右下角；外层 position:relative，改颜色时务必保留这组定位值 */
.ent-marker-flag {
  position: absolute; left: 17px; top: 14px;
  width: 13px; height: 13px; line-height: 13px; text-align: center;
  border-radius: 50%; background: #F59E0B; color: #fff;
  font-size: 10px; font-weight: 700; font-style: normal;
  box-shadow: 0 0 0 1.5px #fff, 0 1px 3px rgba(20,30,60,.4);
}
.ent-marker-star {
  width: 26px; height: 26px; line-height: 26px; text-align: center; flex: none;
  font-size: 21px; font-weight: 700; color: #1677ff;
  text-shadow: -1.5px 0 #fff, 1.5px 0 #fff, 0 -1.5px #fff, 0 1.5px #fff,
               -1px -1px #fff, 1px -1px #fff, -1px 1px #fff, 1px 1px #fff;
  filter: drop-shadow(0 1px 2px rgba(20,30,60,.35));
}
/* 名称药丸：紧贴星标右侧（gap 决定间隙），无 transform / 无 margin-left 偏移 */
.ent-marker-label {
  margin-left: 0; background: #1677ff; color: #fff;
  font-size: 12px; font-weight: 600; line-height: 1.3;
  padding: 2px 9px; border-radius: 9px;
  box-shadow: 0 1px 4px rgba(20,30,60,.28);
  max-width: 110px; overflow: hidden; text-overflow: ellipsis;
}
/* 名称避让：企业密集时只隐藏相互重叠的名称，星标一律保留。
 * 鼠标移到该星标上时名称临时复现（信息卡同时弹出，两者内容一致，不产生歧义）。
 * 复现的名称必须压在其他星标/名称之上 —— 高德给每个 .amap-marker 写了内联
 * z-index（110~130，按纬度排序），DOM 里的 z-index 对 marker 内部无效，
 * 只能提升 marker 本身，所以用 :has() 反向选中父级。
 * 悬停任意星标都会提到最上层，不只是被隐藏名称的那些。 */
.ent-marker.label-hidden .ent-marker-label { display: none; }
.ent-marker.label-hidden:hover .ent-marker-label { display: block; }
.amap-marker:has(.ent-marker:hover) { z-index: 900 !important; }
/* 复现时加深阴影，让"临时显示"和"常显"更容易区分 */
.ent-marker.label-hidden:hover .ent-marker-label { box-shadow: 0 2px 10px rgba(20,30,60,.45); }
/* 高德信息窗内容字号与内边距微调 */
.amap-info-content { font-size: 13px; padding: 10px 14px; }
.amap-info-content .amap-info-close { right: 6px; top: 4px; }

/* ========== 侧栏企业搜索（原地图工具栏搜索框，已上移至左侧边栏顶部） ========== */
.side-search { margin-bottom: 16px; }
.side-search-input {
  width: 100%; border: 1px solid #d5dae3; border-radius: 8px;
  padding: 8px 12px; font-size: 13px; outline: none; background: #fff; color: #1f2329;
}
.side-search-input:focus { border-color: #1677ff; box-shadow: 0 0 0 2px rgba(22,119,255,.12); }

/* ========== 顶栏「新增企业」下拉菜单 ========== */
.add-ent-wrap { position: relative; flex: none; }
.add-ent-menu {
  position: absolute; top: calc(100% + 6px); left: 0;
  min-width: 168px; background: #fff; border: 1px solid #e6e9ef;
  border-radius: 10px; padding: 6px; z-index: 60;
  box-shadow: 0 10px 28px rgba(20,30,60,.16);
  display: flex; flex-direction: column;
}
.add-ent-item {
  display: block; width: 100%; text-align: left;
  border: none; background: none; color: #394152;
  font-size: 13px; padding: 9px 12px; border-radius: 7px;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.add-ent-item:hover { background: #eaf2ff; color: #1677ff; }

/* ========== 企业信息卡（悬停 / 单击星标 共用同一 DOM 卡片；不改变地图） ========== */
/* 位置由 JS 计算：默认挂在企业名称右侧、卡片顶边与名称顶边对齐；
 * 右侧放不下就翻到左侧（data-side="left"），小三角随之换边。 */
.ent-info-card {
  position: absolute; z-index: 30;
  min-width: 210px; max-width: 300px;
  background: #fff; border-radius: 12px; padding: 14px 16px 12px;
  box-shadow: 0 8px 28px rgba(20,30,60,.22);
  font-size: 13px; color: #1f2329;
}
.ent-info-card::after {
  content: ""; position: absolute;
  top: var(--arrow-top, 10px); left: -6px;
  width: 12px; height: 12px; background: #fff; transform: rotate(45deg);
}
.ent-info-card[data-side="left"]::after { left: auto; right: -6px; }
.ent-info-close {
  position: absolute; top: 6px; right: 8px; border: none; background: none;
  color: #8a94a6; font-size: 14px; padding: 2px 4px; line-height: 1;
}
.ent-info-close:hover { color: #1f2329; }
.ent-info-name { font-weight: 700; font-size: 14px; line-height: 1.4; margin-bottom: 8px; padding-right: 24px; overflow-wrap: break-word; word-break: break-word; }
.ent-info-name .v { font-weight: 700; font-size: 14px; }
.ent-info-row { display: flex; padding: 3px 0; }
.ent-info-row .k { width: 64px; flex: none; color: #8a94a6; }
.ent-info-row .v { flex: 1; color: #1f2329; word-break: break-all; }

/* ========== 版本号（肉眼确认拿到新版本） ========== */
.app-version { font-size: 11px; color: #a6aebc; margin-left: 2px; }
.login-version { margin-left: 6px; color: #c2c8d2; }


/* ========== 移动端适配（≤768px） ========== */
#mobile-list-btn { display: none; }

@media (max-width: 768px) {
  html, body { font-size: 14px; overflow-x: hidden; }
  .topbar { padding: 0 10px; }
  .brand-name { display: none; }
  .brand .brand-logo { display: none; }
  .user-role { display: none; }
  .user-name { display: none; }
  .tab { padding: 0 9px; font-size: 13px; white-space: nowrap; }

  /* 侧栏 → 左侧抽屉式面板 */
  .side-panel {
    position: absolute; left: 0; top: 0; bottom: 0; z-index: 30;
    width: 86vw; max-width: 340px;
    transform: translateX(-102%); transition: transform .25s ease;
    box-shadow: 8px 0 28px rgba(20,30,60,.18);
  }
  body.mobile-list-open .side-panel { transform: none; }
  body.mobile-list-open::after {
    content: ""; position: fixed; inset: 0; z-index: 29; background: rgba(15,20,30,.35);
  }

  #mobile-list-btn {
    display: block; position: fixed; z-index: 25;
    left: 50%; transform: translateX(-50%); bottom: 16px;
    border: none; border-radius: 22px; padding: 10px 18px;
    background: #1677ff; color: #fff; font-size: 14px; font-weight: 600;
    box-shadow: 0 4px 14px rgba(22,119,255,.35);
  }
  #mobile-list-btn:active { background: #0e5fd8; }

  .map-zoom-ctrl { left: 10px; bottom: 76px; }
  .map-zoom-ctrl button { width: 38px; height: 38px; font-size: 19px; }

  /* 详情抽屉 → 全屏覆盖（fixed 锚定视口，顶部让出 56px 顶栏；顶栏 z-index 更高保持可见） */
  .drawer { position: fixed; top: 56px; right: 0; bottom: 0; left: 0; width: auto; z-index: 19; }
  .drawer-title { font-size: 16px; }
  .drawer-head .btn, .drawer-head .drawer-close { flex: none; }

  /* 弹窗 → 近全屏 */
  .modal-box { width: 94vw; max-height: 92vh; border-radius: 12px; }
  .modal-box.wide { width: 94vw; }
  .form-grid { grid-template-columns: 1fr; }
  .map-pick-wrap { height: 46vh; }

  /* 总览页统计横向滑动保持；卡片略缩 */
  .ov-stats { gap: 10px; padding: 10px 12px; }
  .ov-stat-card { min-width: 128px; padding: 12px 16px; }
  .ov-stat-v { font-size: 20px; }

  /* 系统管理 */
  .page-admin { padding: 12px; }
  .admin-grid { grid-template-columns: 1fr; gap: 12px; }

  /* 登录页 */
  .login-card { width: 92vw; padding: 24px 20px; }
}

/* ========== 输送台账导入向导 ========== */
.li-mask {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .45);
  display: flex; align-items: center; justify-content: center; z-index: 9999; padding: 24px;
}
.li-modal {
  width: 980px; max-width: 100%; max-height: 88vh; background: #fff; border-radius: 14px;
  box-shadow: 0 20px 60px rgba(16,24,40,.28); display: flex; flex-direction: column; overflow: hidden;
}
.li-head {
  display: flex; align-items: baseline; gap: 10px; padding: 16px 20px; border-bottom: 1px solid #eef1f6;
}
.li-head b { font-size: 16px; color: #1f2329; }
.li-sub { font-size: 12px; color: #8a94a6; }
.li-x {
  margin-left: auto; border: 0; background: none; font-size: 22px; line-height: 1;
  color: #98a2b3; cursor: pointer; padding: 0 4px;
}
.li-x:hover { color: #1f2329; }
.li-body { padding: 18px 20px; overflow: auto; }
.li-foot {
  display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px;
  border-top: 1px solid #eef1f6; background: #fbfcfe;
}
.li-drop {
  border: 2px dashed #c8d4e8; border-radius: 12px; padding: 34px 20px; text-align: center;
  cursor: pointer; background: #f8faff; transition: .15s;
}
.li-drop:hover, .li-drop.over { border-color: #1677ff; background: #eef5ff; }
.li-drop-ico { font-size: 30px; color: #1677ff; line-height: 1; }
.li-drop-main { margin-top: 10px; font-size: 14px; font-weight: 600; color: #1f2329; }
.li-drop-sub { margin-top: 6px; font-size: 12px; color: #8a94a6; }
.li-tips { margin-top: 16px; font-size: 12px; color: #5a6474; line-height: 1.8; }
.li-tips ul { margin: 6px 0 0; padding-left: 18px; }
.li-warn {
  margin-top: 10px; background: #fff8e8; border: 1px solid #ffe1a8; color: #8a6412;
  border-radius: 8px; padding: 8px 12px; font-size: 12px;
}
.li-loading { padding: 40px 0; text-align: center; color: #5a6474; }
.li-error { padding: 16px; background: #fff2f0; border: 1px solid #ffcdc9; color: #c4320a; border-radius: 8px; margin-bottom: 12px; }
.li-sum {
  display: flex; flex-wrap: wrap; gap: 18px; font-size: 12px; color: #5a6474;
  background: #f6f8fc; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px;
}
.li-sum b { color: #1f2329; font-size: 13px; }
.li-need b { color: #d97706; }
.li-filter { display: flex; align-items: center; gap: 16px; font-size: 12px; color: #5a6474; margin-bottom: 8px; }
.li-legend { margin-left: auto; color: #98a2b3; }
.li-tablewrap { max-height: 46vh; overflow: auto; border: 1px solid #eef1f6; border-radius: 10px; }
.li-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.li-table th {
  position: sticky; top: 0; background: #f4f7fc; color: #5a6474; font-weight: 600;
  text-align: left; padding: 9px 10px; white-space: nowrap; z-index: 1;
}
.li-table td { padding: 8px 10px; border-top: 1px solid #f1f4f9; vertical-align: middle; }
.li-table td.n, .li-table th.n { text-align: right; white-space: nowrap; }
.li-table tr.ok td:first-child { border-left: 3px solid #12b76a; }
.li-table tr.warn td:first-child { border-left: 3px solid #f79009; }
.li-table tr.ign td { color: #98a2b3; }
.li-table tr.ign td:first-child { border-left: 3px solid #d0d5dd; }
.li-sel { width: 100%; min-width: 240px; border: 1px solid #d5dae3; border-radius: 7px; padding: 5px 8px; font-size: 12px; background: #fff; color: #1f2329; }
.li-newbox { display: flex; gap: 6px; margin-top: 6px; }
.li-newbox input { flex: 1; min-width: 90px; border: 1px solid #d5dae3; border-radius: 7px; padding: 5px 8px; font-size: 12px; }
.li-newbox.hidden { display: none; }
.li-src { color: #8a94a6; white-space: nowrap; }
.li-empty { text-align: center; color: #8a94a6; padding: 28px 10px; }
.li-done { text-align: center; padding: 20px 0 8px; }
.li-done-ico {
  width: 48px; height: 48px; line-height: 48px; border-radius: 50%; margin: 0 auto 12px;
  background: #e8f7ee; color: #12b76a; font-size: 24px; font-weight: 700;
}
.li-done h3 { margin: 0 0 16px; font-size: 16px; color: #1f2329; }
.li-done-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.li-done-grid > div { background: #f6f8fc; border-radius: 10px; padding: 12px; }
.li-done-grid span { display: block; font-size: 12px; color: #8a94a6; }
.li-done-grid b { font-size: 20px; color: #1677ff; }
.li-note { font-size: 12px; color: #5a6474; }

/* 新建企业提示横幅（匹配页） */
.li-newbanner {
  border: 1px solid #b9d4ff; background: #f2f7ff; color: #1d2939;
  border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; font-size: 12px; line-height: 1.6;
}
.li-newbanner.warn { border-color: #fcd19c; background: #fff8ef; }
.li-newbanner.hidden { display: none; }
.li-newbanner-h { font-size: 13px; }
.li-newbanner-h b, .li-newbanner-t b { color: #b54708; }
.li-newbanner-n { margin: 4px 0; color: #344054; word-break: break-all; }
.li-newbanner-n b { font-weight: 600; }
.li-newbanner-t { color: #667085; }

/* 结果页：本次新建企业清单 */
.li-newents { border: 1px solid #e4e9f2; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; background: #fbfcfe; }
.li-newents-h { font-size: 13px; color: #1d2939; margin-bottom: 6px; }
.li-newents-h b { color: #b54708; }
.li-newents ul { list-style: none; margin: 0; padding: 0; max-height: 168px; overflow: auto; }
.li-newents li {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 0; border-top: 1px dashed #eaeef5; font-size: 12px;
}
.li-newents li:first-child { border-top: 0; }
.li-newents li b { font-weight: 600; color: #1d2939; }
.li-newents li span { color: #8a94a6; flex: 1; }
.li-newents li .btn { flex: none; }

/* ========== 资料待补（需求：资料不全 → 星标变黄） ========== */
/* 企业列表里名称右侧的小角标，方便在长列表里快速找到待补企业；
 * 命名不与 .li-newents li span 的 flex:1 冲突（那条只在导入结果页生效） */
.ent-miss-tag {
  display: inline-block; margin-left: 6px; padding: 0 6px;
  font-size: 11px; font-weight: 600; line-height: 17px; vertical-align: 1px;
  color: #fff; background: #F59E0B; border-radius: 9px;
}
/* 编辑弹窗顶部的浅黄提示条：告诉用户具体缺哪几项，否则只知道"星标是黄的"却不知道补什么 */
.ent-miss-tip {
  font-size: 13px; line-height: 1.6; color: #b54708;
  background: #fffaeb; border: 1px solid #fedf89; border-radius: 8px;
  padding: 8px 12px;
}

/* ========== 按名称搜索：候选地点选择层 ========== */
/* 与 #pick-layer 同理：不能用 openModal()，否则会顶掉正在填写的企业表单。
 * z-index 需要同时高于 .modal-mask(2000)、#pick-layer(2100) 和台账导入遮罩 .li-mask(9999)，
 * 又要低于 #toast(10001)，否则从导入结果页打开时会被台账弹窗盖住。 */
#poi-layer { z-index: 10000; }
.poi-tip { font-size: 13px; color: #8a94a6; margin-bottom: 10px; }
.poi-list { max-height: 46vh; overflow-y: auto; }
.poi-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin-bottom: 8px;
  border: 1px solid #eef1f6; border-radius: 10px;
}
.poi-row:hover { border-color: #1677ff; background: #f7faff; }
.poi-main { flex: 1; min-width: 0; }
.poi-name { font-size: 14px; font-weight: 600; color: #1f2733; word-break: break-all; }
.poi-fuzzy {
  display: inline-block; margin-left: 8px; padding: 0 6px;
  font-size: 11px; font-weight: 600; line-height: 16px; vertical-align: 1px;
  color: #667085; background: #f2f4f7; border-radius: 8px;
}
.poi-addr { font-size: 12px; color: #8a94a6; margin-top: 2px; }

/* 台账导入结果页：新建企业的名称匹配状态 */
.li-newents li span.li-ne-st { flex: none; font-size: 12px; }
.li-newents li span.li-ne-st.ok { color: #12b76a; }
.li-newents li span.li-ne-st.warn { color: #b54708; }
.li-newents li .li-ne-act { flex: none; display: flex; align-items: center; gap: 6px; }

/* ========== 云端模式：提示条 / 同步状态 / 成员管理 ========== */
.mode-banner {
  position: sticky; top: 0; z-index: 1200;
  padding: 9px 16px; font-size: 13px; line-height: 1.6; text-align: center;
}
.mode-banner.warn { background: #fff7e6; color: #b45309; border-bottom: 1px solid #ffe0a3; }
.mode-banner.info { background: #eff6ff; color: #1d4ed8; border-bottom: 1px solid #cfe0ff; }
.mode-banner.ok   { background: #ecfdf3; color: #067647; border-bottom: 1px solid #b7ebc9; }

.sync-state {
  font-size: 12px; padding: 3px 8px; border-radius: 999px; margin-right: 8px;
  white-space: nowrap; cursor: default;
}
.sync-state.ok    { background: #ecfdf3; color: #067647; }
.sync-state.busy  { background: #eff6ff; color: #1d4ed8; }
.sync-state.warn  { background: #fef3f2; color: #b42318; }
.sync-state.local { background: #f2f4f7; color: #667085; }

.mu-input { width: 150px; }
.mu-sel { width: 150px; }
.member-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.member-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid #eaecf0; border-radius: 10px; background: #fff; flex-wrap: wrap;
}
.member-main { display: flex; align-items: center; gap: 8px; min-width: 220px; flex-wrap: wrap; }
.member-main b { font-size: 14px; color: #1f2733; }
.member-user { font-size: 12px; color: #8a94a6; }
.member-tag { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: #f2f4f7; color: #667085; }
.member-tag.on { background: #eff6ff; color: #1d4ed8; }
.member-tag.off { background: #fef3f2; color: #b42318; }
.member-tag.me { background: #ecfdf3; color: #067647; }
.member-meta { font-size: 12px; color: #8a94a6; margin-left: auto; }
.member-ops { display: flex; gap: 6px; flex-wrap: wrap; }
.member-empty { font-size: 13px; color: #8a94a6; padding: 10px 2px; }
