/* === 全局增强：搜索框/主题切换/导航显隐 - 东莞市世炬科技有限公司 李培俊 === */
.ge-topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 48px; z-index: 9998;
  background: linear-gradient(135deg,#0f172a,#1e293b);
  border-bottom: 1px solid rgba(34,211,238,.3);
  display: flex; align-items: center; padding: 0 16px; gap: 12px;
  box-shadow: 0 2px 12px rgba(34,211,238,.15);
}
/* LOGO 与全域检索框平行（需求#13）：左侧品牌标识，中间检索框，右侧功能按钮 */
.ge-logo {
  display: flex; align-items: center; gap: 8px; flex: 0 0 auto;
  cursor: pointer; user-select: none; padding-right: 4px;
  border-right: 1px solid rgba(34,211,238,.2);
}
.ge-logo-ic {
  width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg,#22d3ee,#6366f1);
  box-shadow: 0 0 10px rgba(34,211,238,.5);
}
.ge-logo-txt { display: flex; flex-direction: column; line-height: 1.15; font-size: 14px; font-weight: 700; color: #e2e8f0; }
.ge-logo-txt small { font-size: 10px; font-weight: 400; color: #64748b; }
.ge-search-wrap { flex: 1; max-width: 600px; margin: 0 auto; position: relative; }
.ge-search-input {
  width: 100%; height: 34px; border-radius: 17px; border: 1px solid rgba(34,211,238,.4);
  background: rgba(15,23,42,.8); color: #22d3ee; padding: 0 40px 0 16px; font-size: 13px;
  outline: none; transition: all .2s;
}
.ge-search-input:focus { border-color: #22d3ee; box-shadow: 0 0 12px rgba(34,211,238,.4); }
.ge-search-input::placeholder { color: #64748b; }
.ge-search-mode {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  font-size: 11px; color: #22d3ee; background: rgba(34,211,238,.15);
  border: 1px solid rgba(34,211,238,.3); border-radius: 10px; padding: 2px 8px;
  cursor: pointer; user-select: none;
}
.ge-btns { display: flex; gap: 8px; }
.ge-btn {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid rgba(34,211,238,.3);
  background: rgba(34,211,238,.1); color: #22d3ee; cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center; transition: all .2s;
}
.ge-btn:hover { background: rgba(34,211,238,.25); box-shadow: 0 0 8px rgba(34,211,238,.4); }
.ge-results {
  position: fixed; top: 48px; left: 50%; transform: translateX(-50%);
  width: 90%; max-width: 700px; max-height: 70vh; overflow-y: auto;
  background: rgba(15,23,42,.97); border: 1px solid rgba(34,211,238,.4);
  border-radius: 12px; z-index: 9997; box-shadow: 0 8px 32px rgba(0,0,0,.5);
  display: none; padding: 12px;
}
.ge-results.show { display: block; }
.ge-cat { color: #22d3ee; font-size: 12px; font-weight: 600; margin: 10px 0 6px; text-transform: uppercase; }
.ge-item {
  padding: 8px 12px; border-radius: 6px; cursor: pointer; color: #e2e8f0; font-size: 13px;
  display: flex; justify-content: space-between; align-items: center;
}
.ge-item:hover { background: rgba(34,211,238,.12); }
.ge-item .type { color: #64748b; font-size: 11px; }
/* ===== 主题切换（2026-10-31 重做）=====
   原实现只改 .sidebar 背景，主区/卡片/表格纹丝不动 → 用户点色点"看不见变化"= 皮肤切换没生效。
   现三套主题均覆盖 侧边栏/顶栏/主区/卡片/统计卡/表格/表单/文字 全域配色。 */
/* 1) 赛博（默认）：深蓝科技侧栏 + 清爽主区 */
body.ge-theme-cyber {
  --sidebar-bg: linear-gradient(180deg,#0e1a2f 0%,#162d4d 100%);
  --bg-main:#f1f5f9; --card-bg:#ffffff;
  --text-main:#0f172a; --text-sub:#64748b; --border:#e2e8f0;
  --cyber:#22d3ee;
}
body.ge-theme-cyber .sidebar { background: linear-gradient(180deg,#0e1a2f 0%,#162d4d 100%) !important; }
/* 2) 暗黑：全域深色 */
body.ge-theme-dark {
  --sidebar-bg: linear-gradient(180deg,#080d17 0%,#111a2b 100%);
  --bg-main:#0b1220; --card-bg:#151d2e;
  --text-main:#e2e8f0; --text-sub:#94a3b8; --border:#263248;
  --cyber:#22d3ee;
}
/* 注意：card-layout.css 用 !important 把 .sidebar 背景写死为深蓝渐变，
   此处必须用「更高优先级选择器 + !important」才能覆盖，否则选了主题侧边栏也不变 */
body.ge-theme-dark .sidebar { background: linear-gradient(180deg,#080d17 0%,#111a2b 100%) !important; border-right-color:rgba(34,211,238,.15); }
body.ge-theme-dark .topbar { background:#151d2e; border-bottom-color:#263248; box-shadow:none; }
body.ge-theme-dark .topbar-title,
body.ge-theme-dark .topbar-user { color:#e2e8f0; }
body.ge-theme-dark .card,
body.ge-theme-dark .stat-card { background:var(--card-bg); border-color:var(--border); color:var(--text-main); }
body.ge-theme-dark .content { background:var(--bg-main); }
body.ge-theme-dark .tbl th { background:#101828; color:#94a3b8; border-color:#263248; }
body.ge-theme-dark .tbl td { border-color:#263248; color:#e2e8f0; }
body.ge-theme-dark .form-item input,
body.ge-theme-dark .form-item select,
body.ge-theme-dark .form-item textarea { background:#0b1220; color:#e2e8f0; border-color:#263248; }
body.ge-theme-dark .toolbar input,
body.ge-theme-dark .toolbar select { background:#0b1220; color:#e2e8f0; border-color:#263248; }
body.ge-theme-dark .modal-body { background:var(--card-bg); color:var(--text-main); }
body.ge-theme-dark .btn-outline { border-color:#334155; color:#cbd5e1; }
body.ge-theme-dark .muted { color:#94a3b8; }
body.ge-theme-dark .ge-topbar { background:linear-gradient(135deg,#070b14,#131a2a); }
/* 3) 明亮：全域浅色（侧边栏同步转白） */
body.ge-theme-light {
  --sidebar-bg: linear-gradient(180deg,#ffffff 0%,#f1f5f9 100%);
  --bg-main:#f8fafc; --card-bg:#ffffff;
  --text-main:#0f172a; --text-sub:#64748b; --border:#e2e8f0;
  --cyber:#0ea5e9;
}
body.ge-theme-light .sidebar { background: linear-gradient(180deg,#ffffff 0%,#f1f5f9 100%) !important; border-right-color:#e2e8f0; }
body.ge-theme-light .sidebar-brand { border-bottom-color:#e5e7eb; }
body.ge-theme-light .sidebar-brand-text,
body.ge-theme-light .sidebar-brand-text small { color:#334155; }
body.ge-theme-light .nav-item { color:#475569; }
body.ge-theme-light .nav-item:hover { background:#eef2f7; color:#0f172a; }
body.ge-theme-light .sidebar-foot { color:#94a3b8; border-top-color:#e5e7eb; }
body.ge-theme-light .ge-topbar { background:linear-gradient(135deg,#ffffff,#f1f5f9); border-bottom-color:#e2e8f0; }
body.ge-theme-light .ge-logo-txt { color:#0f172a; }
body.ge-theme-light .ge-logo-txt small { color:#64748b; }
/* 导航显隐设置面板 */
.ge-navpanel {
  position: fixed; top: 60px; right: 16px; width: 260px; max-height: 80vh; overflow-y: auto;
  background: rgba(15,23,42,.97); border: 1px solid rgba(34,211,238,.4); border-radius: 12px;
  z-index: 9997; padding: 16px; display: none; box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
.ge-navpanel.show { display: block; }
.ge-navpanel h4 { color: #22d3ee; margin: 0 0 12px; font-size: 14px; }
.ge-navitem { display: flex; align-items: center; gap: 8px; padding: 6px 0; color: #e2e8f0; font-size: 13px; }
.ge-navitem input { accent-color: #22d3ee; }
.ge-theme-opts { display: flex; gap: 8px; margin: 8px 0; }
.ge-theme-dot { width: 24px; height: 24px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; }
.ge-theme-dot.active { border-color: #22d3ee; box-shadow: 0 0 8px rgba(34,211,238,.6); }
/* body顶栏占位 */
body { padding-top: 48px; }
@media (max-width: 768px) {
  .ge-search-wrap { max-width: none; }
  body { padding-top: 48px; }
}

/* ============================================================
 * 全局固定视口布局 v1 (2026-10-30) — 顶部固定 + 内容区独立竖向滚动
 * 适用范围：所有界面（联络工作台/客户/合同/报表等），桌面与移动端一致。
 * 东莞市世炬科技有限公司 李培俊
 * ============================================================ */
.app { height: calc(100vh - 48px); min-height: 0; overflow: hidden; }
.main { height: 100%; min-height: 0; overflow: hidden; }
.topbar, .top-tabbar { flex-shrink: 0; }
.content { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.content::-webkit-scrollbar { width: 8px; }
.content::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* 联络工作台：页头固定 + 左右双栏各自竖向滚动 */
#view-root.wb-view { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.wb-wrap { display: flex; gap: 16px; flex: 1; min-height: 0; }
.wb-left { width: 220px; flex-shrink: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.wb-right { flex: 1; min-width: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.wb-left::-webkit-scrollbar, .wb-right::-webkit-scrollbar { width: 8px; }
.wb-left::-webkit-scrollbar-thumb, .wb-right::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
/* R6 修「客户名称随记录滚动」的真因：.wb-right 是 .card，带 22px 内边距。
   sticky 的表头/首列只能吸在 padding 内侧，滚动时数据行从那圈 22px 的缝里穿过去，
   看着就像表头没固定住、一直跟着记录跑。
   解法：滚动容器零内边距，留白改由表格首末列内边距承担 —— 缝隙消失，观感不变。 */
.wb-right { padding: 0; }
.wb-right > .toolbar { padding: 10px 14px 0; }
.wb-right > table.tbl > thead > tr > th:first-child,
.wb-right > table.tbl > tbody > tr > td:first-child { padding-left: 22px; }
.wb-right > table.tbl > thead > tr > th:last-child,
.wb-right > table.tbl > tbody > tr > td:last-child { padding-right: 22px; }
@media (max-width: 768px) {
  .wb-wrap { flex-direction: column; overflow: visible; }
  .wb-left { width: 100% !important; overflow: visible; }
  .wb-right { overflow: visible; }
}


/* ===== 字段穿透样式（2026-11-05 · 智脑0号移植） ===== */
.drill-link{color:#2563eb;text-decoration:none;border-bottom:1px dashed rgba(37,99,235,.45);cursor:pointer;transition:color .12s,border-color .12s;}
.drill-link:hover{color:#1d4ed8;border-bottom-color:#1d4ed8;}
.drill-banner{display:flex;align-items:center;gap:8px;padding:8px 14px;margin:0 0 10px;border-radius:8px;
  background:rgba(37,99,235,.07);border:1px solid rgba(37,99,235,.22);color:#1e40af;font-size:13px;}
.drill-banner b{font-weight:700;}
.drill-custbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:6px 0;}
.drill-custname{font-size:16px;}

/* ===== 双LOGO去重：隐藏侧边栏品牌区，保留顶栏LOGO（2026-11-06） ===== */
.sidebar-brand { display: none !important; }
.sidebar { padding-top: 48px !important; }
.sidebar-nav { padding-top: 8px !important; }

/* ===== 模块「界面功能区域」折叠控件（2026-11-07 · 主人需求：所有模块加折叠） =====
   #mid-zone 是各模块顶部操作区（新建/搜索/筛选/打印/导出/刷新/更多）。
   折叠时加 .collapsed：工具栏 display:none（toolbar-tools 的收纳算法在 clientWidth<120 会
   自动跳过，不会被误塞进「更多」），只留「展开功能区」按钮，腾出内容纵向空间。
   状态由 JS 存 localStorage 全局记忆。 */
.mid-collapse-btn { flex-shrink: 0; }
.mid-zone.collapsed { min-height: 38px; padding-top: 5px; padding-bottom: 5px; }
.mid-zone.collapsed .toolbar { display: none; }
.mid-zone.collapsed .mid-collapse-btn { margin-left: auto; }

/* ===== 左侧主导航栏折叠控件（2026-11-07 · 主人需求：更上的区域也加折叠） =====
   .sidebar 是比 #mid-zone 更高一层的全局导航。折叠时给 <body> 加 .sidebar-collapsed：
   - 侧栏收成 60px 图标条，.main 同步左移，拖拽条隐藏（折叠态不允拖宽，先展开再调）
   - 导航文字 / 品牌 / 页脚隐藏，nav-item 居中只留图标（与移动端 60px 视觉一致）
   - 不覆盖 --sidebar-w：展开后恢复用户原有宽度（sidebar-resize.js 维护）
   移动端侧栏是抽屉，折叠按钮无意义，隐藏。 */
.sidebar-toggle {
  margin: 10px 12px 4px;
  padding: 8px 0;
  text-align: center;
  color: #cbd5e1;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  user-select: none;
  transition: background-color .15s, color .15s;
}
.sidebar-toggle:hover { background: rgba(255,255,255,.14); color: #fff; }
body.sidebar-collapsed .sidebar { width: 60px !important; }
body.sidebar-collapsed .main { margin-left: 60px !important; }
body.sidebar-collapsed .sb-resizer { left: 60px !important; display: none !important; }
body.sidebar-collapsed .sidebar .nav-item span:not(.nav-ico) { display: none !important; }
body.sidebar-collapsed .sidebar .nav-item { justify-content: center !important; padding-left: 0 !important; padding-right: 0 !important; font-size: 0 !important; overflow: hidden !important; white-space: nowrap !important; }
body.sidebar-collapsed .sidebar .nav-item .nav-ico { font-size: 18px !important; }
body.sidebar-collapsed .sidebar-foot { display: none !important; }
body.sidebar-collapsed .sidebar-toggle { font-size: 16px !important; padding: 8px 0 !important; margin: 10px 10px 4px !important; }
@media (max-width: 768px) {
  .sidebar-toggle { display: none; }
}

/* ===== 顶部标签栏折叠控件（2026-11-07 · 主人需求：更上的区域加折叠） =====
   #top-tabbar 是 #mid-zone 功能区正上方的标签栏（组切换 + 快捷入口）。
   折叠时给 #top-tabbar 加 .collapsed 隐藏内部标签内容，控制按钮固定在 topbar 右侧常驻可见。
   状态由 JS 存 localStorage 全局记忆。 */
.top-tabbar-toggle { flex-shrink: 0; margin-left: 12px; margin-right: auto; padding: 4px 10px; font-size: 12px; color: #6b7280; background: #fff; border: 1px solid var(--border, #e5e7eb); border-radius: 10px; cursor: pointer; transition: background-color .15s, color .15s; }
.top-tabbar-toggle:hover { background: #f3f4f6; color: #1f2937; }
.top-tabbar.collapsed .tg-row,
.top-tabbar.collapsed .pg-grid { display: none !important; }
.top-tabbar.collapsed { padding-top: 4px; padding-bottom: 4px; }
