:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --line: #e3e7ee;
  --line-soft: #eef1f5;
  --text: #243040;
  --text-2: #5b6675;
  --text-3: #98a2b0;
  --nav: #3a5a7e;
  --nav-dark: #32506f;
  --primary: #2f6fae;
  --primary-dark: #27609a;
  --primary-soft: #eaf3fd;
  --danger: #d9534f;
  --warn: #b45309;
  --teal: #0f6e56;
  --radius: 4px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  --topbar-h: 56px;
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Helvetica Neue", Helvetica, "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: none; }

/* ================= 全局顶栏 ================= */

.g-top {
  height: var(--topbar-h);
  background: linear-gradient(90deg, #26415e 0%, #30577c 52%, #26415e 100%);
  color: #e8eff7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
  position: sticky;
  top: 0;
  z-index: 60;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.07), 0 2px 10px rgba(18, 34, 54, 0.1);
}

/* 左侧：LOGO + 公司名 + 后台首页（同一组，紧跟公司名） */
.g-left {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  min-width: 0;
  position: relative;
  z-index: 2;
}

.g-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: #fff;
}

.g-brand:hover { color: #fff; }

/* 顶栏 LOGO：透明底彩色图形，直接叠在深蓝条上 */
.g-brand .g-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(9, 20, 34, 0.3));
}

.g-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: #fff;
  white-space: nowrap;
}

/* 次级导航：细竖线分隔，视觉上弱于公司名 */
.g-home {
  margin-left: 14px;
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 12.5px;
  line-height: 1;
  color: rgba(228, 240, 253, 0.78);
  white-space: nowrap;
  transition: color 0.15s;
}

.g-home:hover { color: #fff; }

/* 中间标语：相对整条顶栏绝对居中，不受左右内容宽度影响 */
.g-slogan {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: -4px;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 4px;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
  pointer-events: none;
}

.g-slogan::before,
.g-slogan::after {
  content: "";
  width: 18px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.3));
}

.g-slogan::after { background: linear-gradient(90deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0)); }

.g-brand .logo {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: linear-gradient(135deg, #5b90c8, #2f6fae);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}

.g-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #d5e2ef;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.g-user .who { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; margin-right: 2px; }
.g-user .who b { color: #fff; font-weight: 500; font-size: 12.5px; }
.g-user .who span { font-size: 11px; color: rgba(190, 210, 232, 0.8); }

.g-user a,
.g-user .linkbtn {
  color: rgba(228, 240, 253, 0.88);
  font-size: 12px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  padding: 4px 11px;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.4;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.g-user a:hover,
.g-user .linkbtn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.34);
  color: #fff;
  text-decoration: none;
}

/* 窄屏：标语收窄，再窄就隐藏，保证左侧信息不被挤压 */
@media (max-width: 1220px) {
  .g-slogan { font-size: 13px; letter-spacing: 3.5px; gap: 9px; }
  .g-slogan::before,
  .g-slogan::after { width: 16px; }
  .g-name { font-size: 14px; }
}

@media (max-width: 1080px) {
  .g-slogan { display: none; }
}

/* ================= 布局 ================= */

.app { display: flex; min-height: calc(100vh - var(--topbar-h)); align-items: stretch; }

/* ---------- 左侧分组菜单 ---------- */

.side {
  width: 200px;
  flex: 0 0 200px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 0 0 20px;
}

.nav-group { border-bottom: 1px solid var(--line-soft); }

.nav-group > summary {
  list-style: none;
  cursor: pointer;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #37455a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary:hover { background: #f7f9fc; }

.nav-group > summary::after {
  content: '+';
  color: #a4aebc;
  font-size: 15px;
  font-weight: 400;
  line-height: 1;
}

.nav-group[open] > summary::after { content: '\2212'; }

.nav-group .nav {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px 8px 24px;
  color: #4a586c;
  font-size: 13px;
  border-left: 2px solid transparent;
}

.nav-group .nav::before {
  content: '';
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  border-radius: 2px;
  background: #eef3f9;
  border: 1px solid #d9e3ee;
}

.nav-group .nav:hover { background: #f6f9fc; color: var(--primary); }
.nav-group .nav:hover::before { border-color: #b9cfe6; }

.nav-group .nav.on {
  background: var(--primary-soft);
  border-left-color: var(--primary);
  color: var(--primary-dark);
  font-weight: 500;
}

.nav-group .nav.on::before {
  background: var(--primary);
  border-color: var(--primary);
}

/* 独立菜单项（无分组） */
.navs > .nav { display: none; }

.side-note {
  margin: 18px 14px 0;
  padding: 10px;
  background: #f7f9fc;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--text-3);
  font-size: 11px;
  line-height: 1.7;
}

/* ---------- 主内容区 ---------- */

.main { flex: 1; padding: 14px 18px 10px; min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 9px 14px;
  margin-bottom: 12px;
}

.topbar h1 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  color: #33445c;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar h1::before {
  content: '';
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--primary);
}

.topacts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.g-foot {
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
  padding: 14px 0 10px;
}

.flash {
  padding: 9px 12px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  font-size: 13px;
  border: 1px solid transparent;
}

.flash.ok { background: #eef8f0; color: #2c7a3f; border-color: #cde8d3; }
.flash.err { background: #fdf0ef; color: #b94440; border-color: #f2cfcd; }

/* ================= 卡片与面板 ================= */

.kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
}

.kpi-label { color: var(--text-2); font-size: 12px; }
.kpi-value { font-size: 21px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi-sub { color: var(--text-3); font-size: 12px; }

.kpi.c-blue { border-top: 2px solid #3a7ab8; }
.kpi.c-teal { border-top: 2px solid #1d9e75; }
.kpi.c-amber { border-top: 2px solid #ef9f27; }
.kpi.c-red { border-top: 2px solid #e24b4a; }
.kpi.c-gray { border-top: 2px solid #b4b2a9; }

.row2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  overflow: hidden;
}

.card-h {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: #fafbfd;
  font-weight: 600;
  font-size: 13px;
  color: #37455a;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-h .more { font-weight: 400; font-size: 12px; color: var(--text-2); }
.card-b { padding: 14px; }
.card-b.no-pad { padding: 0; }

/* ================= 表格 ================= */

/* 表格横向滚动容器：窄屏也能左右滑动看全部列，不再被裁掉 */
.tw { overflow-x: auto; overflow-y: visible; }
.tw > table.table { margin: 0; }

.tw::-webkit-scrollbar { height: 10px; }
.tw::-webkit-scrollbar-track { background: #f1f4f8; border-radius: 5px; }
.tw::-webkit-scrollbar-thumb { background: #c3cdd9; border-radius: 5px; }
.tw::-webkit-scrollbar-thumb:hover { background: #a9b6c6; }

/* ===== 图片放大查看器（全局：点缩略图弹出大图，可左右切换，Esc 关闭） ===== */
.am-f, .m-f { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.am-thumb, .m-thumb { display: block; width: 64px; height: 64px; border: 1px solid #dde3ea; border-radius: 6px; overflow: hidden; background: #f1f5f9; flex: 0 0 auto; }
.am-thumb img, .m-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.am-thumb:hover, .m-thumb:hover { border-color: #2563eb; }
.am-bad, .m-bad { margin-top: 6px; font-size: 12px; color: #b45309; background: #fffbeb; border: 1px solid #fde68a; border-radius: 6px; padding: 4px 8px; display: inline-block; }
#imgViewer { position: fixed; inset: 0; z-index: 9999; background: rgba(15,23,42,.92); display: flex; align-items: center; justify-content: center; }
#imgViewer[hidden] { display: none !important; }
#imgViewer img { max-width: 92vw; max-height: 86vh; object-fit: contain; border-radius: 6px; box-shadow: 0 8px 30px rgba(0,0,0,.45); }
.iv-bar { position: fixed; left: 0; right: 0; bottom: 16px; display: flex; gap: 10px; align-items: center; justify-content: center; color: #e2e8f0; font-size: 13px; }
.iv-bar button { background: rgba(255,255,255,.16); color: #fff; border: none; border-radius: 6px; padding: 6px 14px; font-size: 15px; cursor: pointer; }
.iv-bar button:hover { background: rgba(255,255,255,.28); }
#ivClose { position: fixed; top: 14px; right: 18px; bottom: auto; left: auto; }

.card-b { overflow-x: auto; }
.card-b::-webkit-scrollbar { height: 10px; }
.card-b::-webkit-scrollbar-thumb { background: #c3cdd9; border-radius: 5px; }

.table { width: 100%; border-collapse: collapse; background: var(--panel); }

.table th,
.table td {
  padding: 8px 11px;
  text-align: left;
  border: 1px solid var(--line-soft);
  white-space: nowrap;
  font-size: 12.5px;
}

.table th {
  color: #45536a;
  font-weight: 600;
  background: #f4f6f9;
  font-size: 12px;
}

.table tbody tr:hover { background: #f8fafc; }
.table tbody tr:nth-child(even) { background: #fcfdfe; }
.table tbody tr:nth-child(even):hover { background: #f4f7fa; }

.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.warn { color: var(--danger); font-weight: 600; }
.table td.ops { white-space: nowrap; }
.table td.ops a, .table td.ops .linkbtn { margin-right: 10px; }
.table td.chk, .table th.chk { width: 30px; }
.table td form { display: inline; }

/* 长文本单元格（2026-10-28）：省略号截断，悬停 title 显示全文；点击可临时展开 */
.table td.clip {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: default;
}
.table td.clip:hover { background: #fffbe8; }

/* ================= 徽标 ================= */

.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 3px;
  font-size: 12px;
  border: 1px solid transparent;
  line-height: 1.7;
}

.b-gray { background: #f2f3f5; color: #6a7686; border-color: #e2e6ec; }
.b-blue { background: #e8f2fc; color: #2b6cab; border-color: #cfe4f7; }
.b-teal { background: #e4f6f0; color: #0f6e56; border-color: #c8eadd; }
.b-green { background: #ecf6e2; color: #4a7d13; border-color: #d8ecbf; }
.b-amber { background: #fdf3e2; color: #a06412; border-color: #f4e0bb; }
.b-red { background: #fdecec; color: #bf3b3b; border-color: #f6d3d3; }

/* ================= 按钮 ================= */

.btn {
  display: inline-block;
  padding: 5px 13px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  color: #44506a;
  font-size: 12.5px;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.6;
}

.btn:hover { background: #f6f8fa; color: var(--primary); border-color: #cdd8e4; }

.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn.primary:hover { background: var(--primary-dark); color: #fff; border-color: var(--primary-dark); }

.btn.danger { color: var(--danger); border-color: #ecc8c7; }
.btn.danger:hover { background: #fdf1f0; color: #b23430; }

.btn.small { padding: 2px 9px; font-size: 12px; }
.btn.block { width: 100%; text-align: center; margin-top: 4px; }

.linkbtn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--primary);
  font-size: 12.5px;
  font-family: inherit;
}

.linkbtn.danger { color: var(--danger); }
.linkbtn:hover { color: var(--primary-dark); text-decoration: underline; }

.inline { display: inline; }

/* 价格表：标记待移除的行 */
tr.row-removing th,
tr.row-removing td { opacity: 0.45; }
tr.row-removing th { text-decoration: line-through; }

/* ================= 表单 ================= */

.input {
  width: 100%;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}

.input:focus {
  outline: none;
  border-color: #7fb0e0;
  box-shadow: 0 0 0 2px rgba(47, 111, 174, 0.12);
}

select.input { padding: 5px 6px; }

.field { display: block; margin-bottom: 12px; font-size: 13px; }
.field > .lbl { display: block; }
.field .input { margin-top: 4px; }

/* 渠道列表行内编辑：整行平铺、字段流式换行，无需缩小浏览器即可完整编辑 */
.ch-edit {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: flex-end;
  padding: 12px 14px;
  margin: 4px 0;
  background: #f6f9fd;
  border: 1px solid #e3ecf7;
  border-radius: 8px;
}
.ch-edit .field { margin-bottom: 0; width: 200px; }
.ch-edit .field .input { width: 100%; }
.ch-edit .ch-edit-acts { display: flex; gap: 8px; padding-bottom: 2px; }
.req { color: var(--danger); }
.field-inline { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.field-inline .input { width: auto; }
.lbl { color: var(--text-2); font-size: 12px; }

.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }

.form { padding: 16px; }
.form-acts { display: flex; gap: 8px; margin-top: 6px; }

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 12px;
  margin-bottom: 12px;
}

.filters .input { width: auto; min-width: 120px; }
.filters .lbl { min-width: 32px; }

/* 报表页用的筛选条 */
.filter-bar {
  display: flex;
  gap: 10px 12px;
  align-items: center;
  flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 12px;
  margin-bottom: 12px;
}

.field.inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0;
  white-space: nowrap;
}

.field.inline > .lbl { display: inline; white-space: nowrap; }
.field.inline .input { margin-top: 0; min-width: 130px; }

.tick {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-2);
  font-size: 12px;
  white-space: nowrap;
}

.sumline {
  padding: 8px 12px;
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 12px;
  font-size: 13px;
}

.sumline b { font-weight: 600; }

/* 商家详情页业主联系方式：号码文本 + 拨打/复制操作按钮 */
.contact-num {
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-right: 4px;
}
dd .btn.small { margin-top: 2px; }

/* 列表右下方的「每页 N 条」选择器 */
.pagesize {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 13px;
}
.pagesize .input { width: auto; min-width: 96px; }

.batch {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: #fbfcfd;
}

.batch .input.small { width: auto; min-width: 110px; padding: 3px 6px; font-size: 12px; }

/* ================= 分页 ================= */

.pager {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  padding: 10px 14px;
  border-top: 1px solid var(--line-soft);
  background: #fbfcfd;
  flex-wrap: wrap;
}

.pg, .pg-dis {
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 12px;
  background: var(--panel);
  color: #4a586c;
}

a.pg:hover { background: var(--primary-soft); color: var(--primary); border-color: #b9cfe6; }
.pg-dis { color: var(--text-3); background: #f7f8fa; }
.pg-info { color: var(--text-2); font-size: 12px; }

/* ================= 图表/统计 ================= */

.bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }

.bar-key {
  width: 96px;
  flex: 0 0 96px;
  color: var(--text-2);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track { flex: 1; height: 9px; background: var(--line-soft); border-radius: 2px; overflow: hidden; }
.bar-fill { height: 100%; background: #6d9fd4; border-radius: 2px; }
.bar-val { width: 82px; text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; }

.cols { display: flex; align-items: flex-end; gap: 14px; height: 130px; padding: 6px 4px 0; }
.col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.col-val { font-size: 11px; color: var(--text-3); }
.col-bar { width: 100%; max-width: 46px; background: #6d9fd4; border-radius: 2px 2px 0 0; }
.col-key { font-size: 11px; color: var(--text-2); }

.dl { display: grid; grid-template-columns: 88px 1fr; gap: 4px 10px; margin: 0; }
.dl dt { color: var(--text-2); font-size: 12px; }
.dl dd { margin: 0; word-break: break-word; }

/* 时间线 */
.tl { position: relative; padding-left: 14px; }
.tl-item { position: relative; padding-bottom: 14px; border-left: 1px solid var(--line); padding-left: 14px; }
.tl-item:last-child { border-color: transparent; padding-bottom: 0; }

.tl-item::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6d9fd4;
}

.tl-time { color: var(--text-3); font-size: 12px; }
.tl-text { white-space: pre-wrap; }
.tl-meta { color: var(--text-3); font-size: 12px; }

/* 标签 */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f2f4f7;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px 6px 2px 10px;
  font-size: 12px;
}

.tag-x {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-3);
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}

.tag-x:hover { color: var(--danger); }

.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form .input { max-width: 260px; }

.bullet { margin: 0; padding-left: 18px; color: var(--text-2); }
.bullet li { margin-bottom: 4px; }
.bullet b, .bullet code { color: var(--text); }

code {
  background: var(--line-soft);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
}

.muted { color: var(--text-3); }
.small { font-size: 12px; }

/* ================= 登录页 ================= */

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(180deg, #26415e 0%, #30577c 140px, #eef1f5 140px, #eef1f5 100%);
}

.login-card {
  width: 384px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(20, 38, 60, 0.16);
  padding: 30px 32px 30px;
}

.login-head {
  text-align: center;
  margin: 0 0 16px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line-soft);
}

.login-head .login-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  display: block;
  margin: 0 auto 12px;
}

.login-card h1 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.4px;
  margin: 0;
  color: #23364d;
  text-align: center;
}

.login-slogan {
  margin: 7px 0 0;
  font-size: 11.5px;
  letter-spacing: 3px;
  color: #7488a0;
  text-align: center;
}

.login-card .muted { margin: 0 0 16px; font-size: 12px; text-align: center; color: var(--text-3); }
.login-card .btn.block { margin-top: 8px; padding: 7px 13px; font-size: 14px; }

/* 权限勾选与行内撤回表单 */
.chkbox {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 6px 0;
  max-width: 100%;
}

.chkline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}

.chkline input { margin: 0; }

details.revoke-box > summary { cursor: pointer; list-style: none; }
details.revoke-box > summary::-webkit-details-marker { display: none; }
details.revoke-box[open] > summary { margin-bottom: 4px; }

details.revoke-box > .form {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 12px 4px;
  background: #fafbfd;
}

details > summary.linkbtn { cursor: pointer; list-style: none; }
details > summary.linkbtn::-webkit-details-marker { display: none; }

/* ================= 可搜索下拉 ================= */

.srch-sel { position: relative; width: 100%; }
.field .srch-sel { margin-top: 4px; }
.srch-sel .input { width: 100%; padding-right: 26px; background-image: linear-gradient(45deg, transparent 50%, #8a93a3 50%), linear-gradient(135deg, #8a93a3 50%, transparent 50%); background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.srch-list { display: none; position: absolute; top: calc(100% + 3px); left: 0; right: 0; max-height: 240px; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; z-index: 80; box-shadow: 0 8px 24px rgba(15, 35, 70, 0.14); }
.srch-item { padding: 7px 12px; cursor: pointer; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srch-item:hover { background: var(--primary-soft); }
.srch-item.on { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.srch-item.srch-clear { color: var(--text-3); }
.srch-empty { padding: 10px 12px; color: var(--text-3); font-size: 12px; }

/* ================= 响应式 ================= */

@media (max-width: 960px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row2 { grid-template-columns: minmax(0, 1fr); }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .app { flex-direction: column; }

  .side {
    width: 100%;
    flex: none;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .main { padding: 12px 10px 6px; }
  .g-top-links { display: none; }
}

/* ================= 派单弹窗 ================= */

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 24, 40, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 200;
}

.modal-box {
  background: var(--panel);
  border-radius: 6px;
  box-shadow: 0 12px 40px rgba(16, 24, 40, 0.25);
  width: min(1180px, 100%);
  height: min(860px, 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--primary-soft);
}

.modal-head b { font-size: 14px; }
.modal-head .muted { flex: 1; }

.modal-box iframe {
  flex: 1;
  width: 100%;
  border: none;
}

/* 渠道/账号编辑弹窗：表单区可滚动，字段流式换行 */
.modal-body {
  flex: 1;
  overflow: auto;
  padding: 14px 16px;
}
.modal-body .ch-edit {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
}

/* 弹窗内的精简页面（无顶栏/侧边栏） */
body.bare-body { background: var(--panel); }
body.bare-body .bare-main { padding: 12px 14px 10px; }
body.bare-body .g-foot { display: none; }
body.bare-body .topbar { margin-bottom: 12px; }

/* ================= 表格列宽手动拖拽 ================= */

.table th { position: relative; }

.th-resizer {
  position: absolute;
  top: 0;
  right: -4px;
  width: 9px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  z-index: 5;
}

.th-resizer::after {
  content: '';
  position: absolute;
  top: 22%;
  bottom: 22%;
  left: 4px;
  width: 2px;
  border-radius: 2px;
  background: transparent;
}

.th-resizer:hover::after,
body.col-resizing .th-resizer::after { background: #9db4d6; }

body.col-resizing { cursor: col-resize; user-select: none; }
body.col-resizing iframe { pointer-events: none; }

/* 筛选栏内的可搜索下拉：宽度由 JS 按最长选项文本自适应（此处 160px 仅作 JS 失效时的兜底） */
.filters .srch-sel { width: 160px; flex: 0 0 auto; }
/* 筛选表单（inline-form：固定资产 / 城市接单等）里的可搜索下拉同理，
 * 否则 .srch-sel 默认 width:100% 会独占一行，把后面的筛选项挤下去 */
.inline-form .srch-sel { width: 160px; flex: 0 0 auto; }

/* 销售中心：跟进/报备附件缩略图 */
.fu-imgs { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.fu-imgs img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.fu-imgs a { line-height: 0; }
/* 筛选栏内联复选框（只看待回访等） */
.chk-inline { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted, #666); white-space: nowrap; }

/* 销售中心：提醒相关样式 */
.flash.warn { background: #fff7e8; color: #8a5a00; border-color: #f3dcae; }
.table tr.row-warn { background: #fffaf2; }
.table tr.row-warn:hover { background: #fff5e4; }
/* 侧边栏提醒角标（A/B 类待跟进、待审核报备数） */
.nav-badge {
  display: inline-block; min-width: 16px; padding: 0 4px; margin-left: 6px;
  border-radius: 8px; background: #e8eef5; color: #41556e;
  font-size: 11px; line-height: 16px; text-align: center; font-variant-numeric: tabular-nums;
}
.nav-badge.warn { background: #e24b4a; color: #fff; }
/* 销售看板 KPI 配色（k-* 与既有 c-* 对齐） */
.kpi.k-blue { border-top: 2px solid #3a7ab8; }
.kpi.k-teal { border-top: 2px solid #1d9e75; }
.kpi.k-green { border-top: 2px solid #2f9e44; }
.kpi.k-amber { border-top: 2px solid #ef9f27; }
.kpi.k-red { border-top: 2px solid #e24b4a; }
.kpi.k-purple { border-top: 2px solid #7b5ea7; }

/* 销售负责城市：城市多选框网格 + 选中行高亮 */
.chkgrid { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 4px 0; max-width: 100%; }
hr.hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.table tr.row-on { background: #eef4fb; }
.table tr.row-on:hover { background: #e6eef8; }

/* 首页待办事项：报备审核 / 无效单审核 / 订单协助处理，点击整块进入对应模块 */
.todo-b { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.todo-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; text-decoration: none; color: inherit;
}
.todo-item:hover { border-color: #3a7ab8; background: #f5f9ff; }
.todo-text { font-size: 13px; font-weight: 600; color: #37455a; }
.todo-num { font-size: 24px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; color: #98a2b3; }
.todo-go { font-size: 12px; color: var(--text-3, #7b8794); }
.todo-item.pending { border-color: #f2cfcd; background: #fff8f7; }
.todo-item.pending:hover { border-color: #e24b4a; background: #fff3f2; }
.todo-item.pending .todo-num { color: #e24b4a; }
.todo-item.pending .todo-go { color: #b94440; }
@media (max-width: 900px) { .todo-b { grid-template-columns: 1fr; } }

/* 商家分单明细的待办视图切换（全部分单 / 待查看 / 协助处理 / 无效单处理） */
.view-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.view-tabs a {
  padding: 5px 12px; border: 1px solid var(--line); border-radius: 16px;
  background: #fff; font-size: 13px; color: #41556e; text-decoration: none;
}
.view-tabs a:hover { border-color: #9db4d6; }
.view-tabs a.on { background: #3a7ab8; border-color: #3a7ab8; color: #fff; }

/* 字典维护：每项可直接改名（code 不变，历史数据按 code 翻译） */
.dict-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; border-bottom: 1px dashed #eef1f5;
}
.dict-item:last-child { border-bottom: 0; }
.dict-rename { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.dict-name { flex: 1; min-width: 90px; max-width: 240px; }
.dict-code { white-space: nowrap; }
/* 城市 / 订单来源等内容多的字典固定并排放最后一行（窄屏才收起为单列） */
.dict-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
@media (max-width: 700px) { .dict-pair { grid-template-columns: minmax(0, 1fr); } }

/* 数据查询中心：卡片入口 */
html[data-skin="tech"] .dc-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:12px; }
html[data-skin="tech"] .dc-card { display:block; padding:14px 16px; border:1px solid rgba(120,160,220,.18); border-radius:10px; background:linear-gradient(180deg,rgba(20,40,75,.6),rgba(12,24,48,.6)); text-decoration:none; color:#e6eefb; transition:border-color .15s,box-shadow .15s,transform .15s; }
html[data-skin="tech"] .dc-card:hover { border-color:#2ea8ff; box-shadow:0 6px 18px rgba(46,168,255,.18); transform:translateY(-2px); }
html[data-skin="tech"] .dc-t { font-weight:600; margin-bottom:4px; font-size:14px; }
html[data-skin="tech"] .dc-d { font-size:12px; color:#8aa0bd; }
/* 查询中心分组（2026-11-01 对全员开放后按业务分组） */
.dc-sec { margin-bottom:18px; }
.dc-sec:last-child { margin-bottom:0; }
.dc-sec-h { display:flex; align-items:baseline; gap:10px; flex-wrap:wrap; margin:0 0 10px; padding-bottom:7px; border-bottom:1px dashed rgba(120,160,210,.22); }
.dc-sec-h b { font-size:13.5px; letter-spacing:.4px; }
html[data-skin="tech"] .dc-sec-h b { color:#cfe2f7; }
.dc-sec-h span { font-size:11.5px; color:#8aa0bd; }

/* 销售城市配置：省 / 市县二级折叠树 */
.citytree { border:1px solid var(--color-border,#e3e8ef); border-radius:10px; overflow:hidden; }
html[data-skin="tech"] .citytree { border-color:rgba(120,160,220,.18); }
.citygrp { border-bottom:1px solid rgba(120,160,220,.12); }
.citygrp:last-child { border-bottom:none; }
.citygrp > summary { cursor:pointer; padding:10px 14px; font-weight:600; background:rgba(46,168,255,.06); user-select:none; }
.citygrp > summary:hover { background:rgba(46,168,255,.12); }
.citygrp .chkgrid { padding:10px 14px; }

/* ===== 文件选择预览（data-preview）：已选张数 + 缩略图（点击放大） ===== */
.file-prev { margin-top:8px; }
.file-prev-h { font-size:12px; color:#8aa0bb; margin-bottom:6px; }
.file-prev-h b { color:#2ea8ff; font-size:13px; }
.file-prev-other { margin-top:6px; font-size:12px; color:#8aa0bb; display:flex; flex-wrap:wrap; gap:8px; }
.file-prev-other span { padding:2px 8px; border-radius:6px; background:rgba(46,168,255,.08); }
.file-prev .thumb-grid { display:flex; flex-wrap:wrap; gap:8px; }
.file-prev .am-thumb { display:block; width:76px; height:76px; border-radius:8px; overflow:hidden; border:1px solid rgba(120,160,210,.35); }
.file-prev .am-thumb img { width:100%; height:100%; object-fit:cover; display:block; }

/* ===== 角色权限：按二级菜单分组勾选（2026-11-01） ===== */
.perm-groups { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:10px 16px; }
.perm-group { border:1px solid rgba(120,160,210,.22); border-radius:8px; padding:8px 10px; background:rgba(255,255,255,.02); }
.perm-group-h { font-size:12.5px; font-weight:700; color:#9fc0e2; margin-bottom:5px; padding-bottom:4px; border-bottom:1px dashed rgba(120,160,210,.22); }
.perm-group-b { display:flex; flex-direction:column; gap:2px; }
.perm-group-b .chkline { font-size:12.5px; line-height:1.55; }
/* 角色卡片：两列自适应，卡片很高但比单列窄条好读 */
.role-cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(560px,1fr)); gap:14px; align-items:start; margin-bottom:14px; }
@media (max-width:1180px) { .role-cards { grid-template-columns:1fr; } }

/* ===== 协助会话：微信式聊天气泡（自己一方靠右、对方靠左），颜色跟随皮肤变量 ===== */
.chat-panel { display:flex; flex-direction:column; gap:12px; padding:14px 12px; background:var(--panel); border:1px solid var(--line-soft); border-radius:10px; }
.chat-row { display:flex; align-items:flex-start; gap:9px; }
.chat-row.row-me { flex-direction:row-reverse; }
.chat-ava { flex:0 0 34px; width:34px; height:34px; border-radius:9px; display:flex; align-items:center; justify-content:center; font-size:14px; font-weight:700; user-select:none; }
.ava-mch { background:rgba(46,230,200,.16); border:1px solid rgba(46,230,200,.34); color:#5ff0d6; }
.ava-staff { background:rgba(46,168,255,.18); border:1px solid rgba(46,168,255,.4); color:#7fd0ff; }
.chat-col { max-width:min(640px,84%); display:flex; flex-direction:column; min-width:0; }
.row-me .chat-col { align-items:flex-end; }
.chat-meta { display:flex; align-items:center; gap:6px; margin-bottom:4px; font-size:11.5px; flex-wrap:wrap; }
.chat-name { font-weight:700; color:var(--text-2); }
.chat-tag { font-size:10px; font-weight:700; border-radius:4px; padding:0 5px; line-height:16px; }
.tag-mch { background:rgba(46,230,200,.14); color:#5ff0d6; }
.tag-staff { background:rgba(46,168,255,.16); color:#7fd0ff; }
.chat-time { font-size:10.5px; color:var(--text-3); font-variant-numeric:tabular-nums; }
.chat-bubble { position:relative; padding:8px 12px; border:1px solid var(--line); background:rgba(255,255,255,.05); border-radius:2px 12px 12px 12px; max-width:100%; box-sizing:border-box; }
.row-me .chat-bubble { background:var(--primary-soft); border-color:var(--primary); border-radius:12px 2px 12px 12px; }
.chat-text { font-size:13.5px; color:var(--text); line-height:1.75; white-space:pre-wrap; word-break:break-word; }
.chat-bubble .am-f, .chat-bubble .m-f { margin-top:4px; }
/* 浅色皮肤下头像/标签改用深色文字保证可读（当前锁 tech 深色，此为兜底） */
html:not([data-skin="tech"]):not([data-skin="aurora"]) .ava-mch,
html:not([data-skin="tech"]):not([data-skin="aurora"]) .tag-mch { background:rgba(15,125,106,.1); color:#0f7d6a; border-color:rgba(15,125,106,.35); }
html:not([data-skin="tech"]):not([data-skin="aurora"]) .ava-staff,
html:not([data-skin="tech"]):not([data-skin="aurora"]) .tag-staff { background:#eaf3fd; color:#27609a; border-color:#bcd9f2; }
html:not([data-skin="tech"]):not([data-skin="aurora"]) .chat-panel { background:#f8fafc; }
