/* ============================================================
   h5.css - 助贷员工端H5 全局样式
   移动优先，375px 基准宽度
   ============================================================ */

/* ===== CSS 变量 ===== */
:root {
  --brand: #2563eb;
  --brand-light: #e3f2fd;
  --brand-dark: #1d4ed8;
  --bg: #f5f6fa;
  --card: #ffffff;
  --text: #1a1a2e;
  --text-2: #8e8e93;
  --text-3: #c0c0c4;
  --border: #e8e8ed;
  --green: #34c759;
  --green-bg: #e8f9ed;
  --orange: #ff9500;
  --orange-bg: #fff5e6;
  --red: #ff3b30;
  --red-bg: #ffeael;
  --gray: #8e8e93;
  --gray-bg: #f0f0f5;
  --shadow: 0 1px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --tab-h: 56px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ===== Reset ===== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
input, textarea, button { font-family: inherit; font-size: inherit; border: none; outline: none; }
a { color: var(--brand); text-decoration: none; }
ul, ol { list-style: none; }

/* ===== 安全水印 ===== */
.watermark-layer {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  overflow: hidden;
}
.watermark-layer .wm-item {
  position: absolute;
  font-size: 12px;
  color: rgba(0,0,0,0.04);
  white-space: nowrap;
  transform: rotate(-30deg);
  user-select: none;
}

/* ===== App Shell ===== */
#app { height: 100%; display: flex; flex-direction: column; position: relative; }

.page { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; display: none; }
.page.active { display: block; }
.page-padded { padding: 12px; }

/* ===== 底部 Tab ===== */
.tab-bar {
  /* 关键：height 固定 56px + 全局 border-box 时，padding-bottom 会挤压内容区（56-padding），
     图标(24px)+gap(2px)+文字(11px)≈37px 会把 36px 的内容区撑爆导致背景被裁。
     改为 height:auto + min-height 保底，让 padding 真正撑高盒子，内容区始终完整。 */
  height: auto;
  min-height: calc(var(--tab-h) + 20px + 6px);   /* 82px：底部 20 留白 + 顶部 6 留白 + 内容 56 */
  background: var(--card);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-around;
  /* 顶部留白：让 icon 离 tab-bar 上边缘（白色背景）有距离，与底部安全区对称。 */
  padding-top: 6px;
  /* 双声明 fallback：34px 兜底（iOS 微信内置 WebView 不识别 env，Home Indicator 横岗高 34px），
     支持 env 的浏览器（Safari）取环境安全值；PC 浏览器 env=0 时走 max(0,20)=20px，保持桌面观感不变。 */
  padding-bottom: 34px;
  padding-bottom: max(env(safe-area-inset-bottom), 20px);
  flex-shrink: 0;
  position: relative; z-index: 10;
}
.tab-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--text-2); font-size: 11px; cursor: pointer; flex: 1;
  transition: color 0.2s;
}
.tab-item.active { color: var(--brand); }
.tab-item .tab-icon { font-size: 22px; line-height: 1; }
/* 底部图标：图片版（两态切换） */
.tab-item .tab-icon img.ic { width: 24px; height: 24px; display: none; }
.tab-item .tab-icon img.ic-off { display: inline-block; opacity: 0.45; }
.tab-item.active .tab-icon img.ic-off { display: none; }
.tab-item.active .tab-icon img.ic-on { display: inline-block; filter: none; }

/* ===== 登录页 ===== */
.login-page {
  height: 100%;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 50%, #1e40af 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px;
}
.login-logo { font-size: 48px; margin-bottom: 8px; }
.login-logo img { width: 180px; max-width: 75%; max-height: 84px; object-fit: contain; display: block; margin: 0 auto; }
.login-title { color: #fff; font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.login-subtitle { color: rgba(255,255,255,0.7); font-size: 13px; margin-bottom: 32px; }
.login-card {
  width: 100%; max-width: 340px; background: #fff; border-radius: var(--radius-lg);
  padding: 24px 20px; box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.login-card .field-group { margin-bottom: 16px; }
.login-card .field-label { font-size: 13px; color: var(--text-2); margin-bottom: 6px; display: block; }
.login-card .field-input-wrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--gray-bg); border-radius: var(--radius-sm); padding: 0 12px;
}
.login-card .field-input-wrap input { flex: 1; background: transparent; padding: 12px 0; font-size: 15px; }
.login-card .verify-btn {
  white-space: nowrap; color: var(--brand); font-size: 13px; padding: 6px 10px;
  background: var(--brand-light); border-radius: 6px; cursor: pointer;
}
.login-card .verify-btn:disabled { color: var(--text-3); background: var(--gray-bg); }
.login-btn {
  width: 100%; padding: 14px; background: var(--brand); color: #fff;
  border-radius: var(--radius-sm); font-size: 16px; font-weight: 600;
  margin-top: 8px; cursor: pointer; transition: opacity 0.2s;
}
.login-btn:active { opacity: 0.85; }
.login-tabs { display: flex; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.login-tab { flex: 1; text-align: center; padding: 12px 0; font-size: 15px; color: var(--text-2); cursor: pointer; position: relative; }
.login-tab.active { color: var(--brand); font-weight: 600; }
.login-tab.active:after { content: ''; position: absolute; left: 50%; bottom: -1px; transform: translateX(-50%); width: 44px; height: 2px; background: var(--brand); border-radius: 1px; }
.login-agreement { text-align: center; font-size: 12px; color: var(--text-2); margin-top: 16px; }
.login-agreement a { font-size: 12px; }
.login-hint { text-align: center; font-size: 12px; color: var(--text-3); margin-top: 12px; }

/* 微信一键登录 */
.login-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0 12px; color: var(--text-3); font-size: 12px; }
.login-divider:before, .login-divider:after { content: ''; flex: 1; height: 1px; background: var(--border); }
.wx-login-btn {
  width: 100%; padding: 13px; background: #fff; color: #07c160; border: 1px solid #07c160;
  border-radius: var(--radius-sm); font-size: 15px; font-weight: 600;
  cursor: pointer; transition: opacity 0.2s;
}
.wx-login-btn:active { opacity: 0.8; }

/* 微信绑定引导（底部半屏 sheet） */
.wx-bind-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2000;
  background: var(--card); border-radius: 16px 16px 0 0;
  padding: 24px 20px calc(20px + var(--safe-bottom, 0px));
  box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
  animation: sheetUp 0.25s ease;
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.wx-bind-sheet .wbs-title { font-size: 17px; font-weight: 700; text-align: center; margin-bottom: 8px; }
.wx-bind-sheet .wbs-desc { font-size: 13px; color: var(--text-2); text-align: center; margin-bottom: 18px; }
.wx-bind-sheet .wbs-btn { width: 100%; }
.wx-bind-sheet .wbs-skip { width: 100%; margin-top: 10px; background: none; color: var(--text-2); font-size: 14px; cursor: pointer; padding: 6px; }
.wx-bind-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 1500; }

/* ===== 通用组件 ===== */
.section-title { font-size: 16px; font-weight: 700; padding: 16px 12px 8px; display: flex; align-items: center; justify-content: space-between; }
.section-title .more { font-size: 12px; color: var(--text-2); font-weight: 400; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; }

.btn { padding: 12px 20px; border-radius: var(--radius-sm); font-size: 15px; font-weight: 600; cursor: pointer; text-align: center; transition: opacity 0.2s; }
.btn:active { opacity: 0.85; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-outline { border: 1px solid var(--border); color: var(--text); background: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: 13px; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; }
.tag-new { background: var(--gray-bg); color: var(--gray); }
.tag-following { background: var(--brand-light); color: var(--brand); }
.tag-matched { background: var(--green-bg); color: var(--green); }
.tag-approving { background: var(--orange-bg); color: var(--orange); }
.tag-rejected { background: var(--red-bg); color: var(--red); }
.tag-src { background: #eef2ff; color: #4f46e5; margin-left: 6px; }
.tag-incomplete { background: #fff7ed; color: #ea580c; border: 1px solid #fdba74; margin-left: 6px; }
.ds-filter { margin-left: 8px; font-size: 12px; padding: 2px 6px; border: 1px solid var(--border); border-radius: 4px; background: #fff; color: var(--text-2); }

/* ===== 首页 - 顶部员工信息 ===== */
.home-header {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  padding: 16px 16px 20px; color: #fff;
}
.home-header .greeting { font-size: 20px; font-weight: 700; }
.home-header .date-row { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.home-header .date-text { font-size: 13px; opacity: 0.85; }
.home-header .bell { position: relative; font-size: 22px; cursor: pointer; }
.home-header .bell .dot { position: absolute; top: -2px; right: -2px; width: 8px; height: 8px; background: var(--red); border-radius: 50%; border: 1px solid #fff; }

/* ===== 首页 - 指标卡片 ===== */
.kpi-row { display: flex; gap: 8px; margin: -12px 12px 0; position: relative; z-index: 2; }
.kpi-card {
  flex: 1; background: #fff; border-radius: var(--radius); padding: 14px 10px;
  text-align: center; box-shadow: var(--shadow); cursor: pointer;
}
.kpi-card .kpi-num { font-size: 24px; font-weight: 800; color: var(--text); }
.kpi-card .kpi-label { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.kpi-card:nth-child(1) .kpi-num { color: var(--brand); }
.kpi-card:nth-child(2) .kpi-num { color: var(--orange); }
.kpi-card:nth-child(3) .kpi-num { color: var(--green); }

/* ===== 首页 - 快捷筛选 ===== */
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; }
.quick-item {
  background: #fff; border-radius: var(--radius); padding: 16px 14px;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; box-shadow: var(--shadow); position: relative;
}
.quick-item .qi-text { font-size: 14px; font-weight: 500; }
.quick-item .qi-arrow { color: var(--text-3); font-size: 18px; }
.quick-item .qi-badge {
  position: absolute; top: 8px; right: 8px;
  background: var(--red); color: #fff; font-size: 10px;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; padding: 0 5px;
}

/* ===== 首页 - 新版工作台 ===== */
.new-home-header {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  padding: calc(22px + env(safe-area-inset-top)) 16px 34px; color: #fff; position: relative;
}
.new-home-title { font-size: 19px; font-weight: 700; }
.new-home-subtitle { font-size: 14px; opacity: 0.9; margin-top: 8px; }
/* 首页右上角消息入口 */
.new-home-bell {
  position: absolute; top: calc(18px + env(safe-area-inset-top)); right: 16px;
  font-size: 24px; cursor: pointer;
}
.new-home-bell .bell-badge {
  position: absolute; top: -5px; right: -7px;
  background: var(--red); color: #fff; font-size: 10px;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; border: 1.5px solid #fff;
}
/* 有未读消息时的呼吸提示 */
.new-home-bell.has-notif .bell-badge {
  animation: notifPulse 1.4s infinite;
}
@keyframes notifPulse {
  0%   { transform: scale(1);    box-shadow: 0 0 0 0 rgba(255,59,48,.55); }
  70%  { transform: scale(1.18); box-shadow: 0 0 0 7px rgba(255,59,48,0); }
  100% { transform: scale(1);    box-shadow: 0 0 0 0 rgba(255,59,48,0); }
}

.today-overview {
  background: #fff; border-radius: var(--radius-lg);
  margin: -16px 12px 12px; padding: 16px;
  box-shadow: var(--shadow); position: relative; z-index: 2;
}
.to-header { margin-bottom: 12px; }
.to-tag {
  display: inline-block; background: var(--green-bg); color: var(--green);
  font-size: 12px; padding: 2px 8px; border-radius: 4px;
}
.to-stats { display: flex; align-items: center; }
.to-stat {
  flex: 1; text-align: center; display: flex; flex-direction: column; align-items: center;
  cursor: pointer; border-radius: 10px; padding: 6px 4px; transition: background .15s;
}
.to-stat:active { background: var(--bg-2); }
.to-num { font-size: 32px; font-weight: 800; color: var(--text); line-height: 1; }
.to-unit { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.to-label { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.to-divider { width: 1px; height: 40px; background: var(--border); }
.to-task {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--border);
}
.to-task-label { font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.to-task-label .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.to-task-info { font-size: 14px; color: var(--text-2); }
.to-task-info strong { color: var(--red); font-size: 18px; margin-right: 2px; }
.to-task-btn {
  background: var(--red); color: #fff; font-size: 12px;
  padding: 6px 12px; border-radius: 16px; cursor: pointer;
}

.quick-entry-section { margin: 0 12px 12px; }
.quick-entry-scroll {
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.quick-entry-scroll::-webkit-scrollbar { display: none; }
.quick-entry-list {
  display: flex; gap: 14px; width: max-content; padding: 4px 0;
}
.quick-entry { width: 86px; text-align: center; cursor: pointer; }
.qe-icon {
  width: 68px; height: 68px; margin: 0 auto 8px;
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center; padding: 14px;
}
.qe-icon img { width: 100%; height: 100%; object-fit: contain; }
.qe-text { font-size: 12px; color: var(--text); }
.quick-entry-dots {
  display: flex; justify-content: center; gap: 6px; margin-top: 10px;
}
.quick-entry-dots .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--border);
}
.quick-entry-dots .dot.active { background: var(--brand); }

/* ===== 首页入口双卡片 ===== */
.home-entry-grid { display: flex; gap: 12px; margin: 0 12px 12px; }
.home-entry-card { flex: 1; min-width: 0; border-radius: var(--radius); padding: 16px 14px; display: flex; flex-direction: column; cursor: pointer; box-shadow: var(--shadow); }
.home-entry-ai { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%); color: #fff; }
.home-entry-prod { background: #fff; color: var(--text); border: 1.5px solid var(--brand); }
.hec-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; overflow: hidden; }
.home-entry-ai .hec-icon { background: rgba(255,255,255,0.18); }
.home-entry-prod .hec-icon { background: rgba(37,99,235,0.10); }
.hec-icon img { width: 24px; height: 24px; object-fit: contain; }
.hec-title { font-size: 15px; font-weight: 700; }
.hec-desc { font-size: 12px; margin-top: 4px; line-height: 1.4; flex: 1; }
.home-entry-ai .hec-desc { opacity: 0.92; }
.home-entry-prod .hec-desc { color: var(--text-2); }
.hec-btn { align-self: flex-start; margin-top: 12px; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.home-entry-ai .hec-btn { background: rgba(255,255,255,0.25); color: #fff; }
.home-entry-prod .hec-btn { background: var(--brand); color: #fff; }

/* ===== 金融产品库列表 ===== */
.product-body { flex: 1; overflow-y: auto; padding: 12px; background: var(--bg); }
.product-card { background: #fff; border-radius: var(--radius); padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow); }
.product-card .pc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.product-card .pc-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.product-card .pc-logo { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; font-weight: 700; line-height: 1; box-shadow: 0 2px 6px rgba(0,0,0,0.12); letter-spacing: 0; }
.product-card .pc-name { font-size: 16px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-card .pc-bank { font-size: 12px; color: var(--text-2); flex-shrink: 0; margin-left: 8px; }
.product-card .pc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.product-card .pc-tag { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: rgba(37,99,235,0.08); color: var(--brand); }
.product-card .pc-meta { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 10px; font-size: 13px; color: var(--text-2); }
.product-card .pc-meta b { color: var(--text); font-weight: 600; }
.product-card .pc-features { margin-top: 8px; font-size: 12px; color: var(--text-2); line-height: 1.6; }
.product-empty { text-align: center; color: var(--text-2); padding: 40px 0; font-size: 14px; }

/* 金融产品库筛选条 */
.product-filter { background: #fff; padding: 10px 12px 6px; border-bottom: 1px solid #eee; position: sticky; top: 0; z-index: 5; }
.product-search { width: 100%; box-sizing: border-box; border: 1px solid #e5e7eb; background: var(--bg); border-radius: 999px; padding: 8px 14px; font-size: 13px; outline: none; }
.product-search:focus { border-color: var(--brand); }
.product-chips { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
.product-chips::-webkit-scrollbar { display: none; }
.pc-chip { flex: 0 0 auto; font-size: 12px; padding: 5px 12px; border-radius: 999px; background: var(--bg); color: var(--text-2); border: 1px solid #e5e7eb; cursor: pointer; white-space: nowrap; }
.pc-chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* 产品卡片详情展开 */
.product-card { cursor: pointer; }
.product-card .pc-toggle { margin-top: 10px; font-size: 12px; color: var(--brand); text-align: right; }
.product-card .pc-detail { margin-top: 10px; border-top: 1px dashed #eee; padding-top: 10px; }
.product-card .pd-row { display: flex; gap: 10px; font-size: 12px; line-height: 1.6; }
.product-card .pd-row + .pd-row { margin-top: 8px; }
.product-card .pd-label { flex: 0 0 64px; color: var(--text-2); }
.product-card .pd-val { flex: 1; color: var(--text); }

.recent-match-section { padding: 0 12px 80px; }
.recent-match-list .rm-item {
  background: #fff; border-radius: var(--radius); padding: 14px 16px;
  margin-bottom: 10px; box-shadow: var(--shadow);
  display: flex; align-items: center; cursor: pointer;
}
.recent-match-list .rm-avatar {
  width: 44px; height: 44px; border-radius: 50%; background: var(--brand-light);
  color: var(--brand); display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; margin-right: 12px; flex-shrink: 0;
}
.recent-match-list .rm-main { flex: 1; min-width: 0; }
.recent-match-list .rm-title {
  font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px;
}
.recent-match-list .rm-tag {
  font-size: 10px; padding: 2px 6px; border-radius: 4px;
}
.recent-match-list .rm-tag.blue { background: var(--brand-light); color: var(--brand); }
.recent-match-list .rm-tag.orange { background: var(--orange-bg); color: var(--orange); }
.recent-match-list .rm-tag.green { background: var(--green-bg); color: var(--green); }
.recent-match-list .rm-desc {
  font-size: 12px; color: var(--text-2); margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.recent-match-list .rm-arrow { color: var(--text-3); font-size: 18px; margin-left: 8px; }

/* ===== 客户页（底部菜单“客户”） ===== */
.cust-page-header {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff; padding: calc(env(safe-area-inset-top) + 16px) 16px 18px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 5;
}
.cust-page-title { font-size: 18px; font-weight: 700; }
.cust-page-add {
  background: rgba(255,255,255,0.2); color: #fff;
  padding: 6px 12px; border-radius: 999px; font-size: 13px;
  cursor: pointer; border: 1px solid rgba(255,255,255,0.35);
}
.cust-search-section {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 12px 8px;
}
.cust-search-box {
  flex: 1; display: flex; align-items: center; gap: 8px;
  background: #fff; border-radius: var(--radius); padding: 10px 12px;
  box-shadow: var(--shadow);
}
.cust-search-box .cs-icon { font-size: 14px; color: var(--gray); }
.cust-search-box input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 14px; color: var(--text);
}
.cust-search-box input::placeholder { color: #aaa; }
.cust-search-actions {
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
}
.cs-source {
  border: none; background: transparent; color: var(--text); font-size: 13px;
  outline: none; direction: rtl; padding-right: 0;
}
.cs-filter {
  font-size: 13px; color: var(--brand); cursor: pointer;
}
.cust-filter-bar {
  display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; padding: 0 12px 12px;
}
.cust-filter-bar::-webkit-scrollbar { display: none; }
.cfb-item {
  flex: 0 0 auto; padding: 6px 14px; border-radius: 999px;
  background: #fff; color: var(--text); font-size: 13px;
  border: 1px solid var(--border); cursor: pointer; white-space: nowrap;
}
.cfb-item.active {
  background: var(--brand); color: #fff; border-color: var(--brand);
}

/* 客户页专用卡片（新设计稿） */
.cpc-card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 10px; padding: 14px 12px; position: relative;
  cursor: pointer;
}
.cpc-card:active { background: #f6f8ff; }
.cpc-top {
  display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px;
}
.cpc-name { font-size: 16px; font-weight: 700; color: var(--text); }
.cpc-tag {
  font-size: 12px; padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.cpc-tag.individual { background: #e6f7ed; color: #1f8d4e; }
.cpc-tag.enterprise { background: #fff2e6; color: #e67e22; }
.cpc-company { font-size: 13px; color: var(--gray); margin-bottom: 8px; }
.cpc-info { font-size: 13px; color: var(--text); margin-bottom: 4px; }
.cpc-info label { color: var(--gray); margin-right: 4px; }
.cpc-bottom {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid #f0f0f0;
}
.cpc-last { font-size: 12px; color: var(--gray); }
.cpc-view {
  font-size: 13px; color: var(--brand); cursor: pointer; font-weight: 500;
}

/* ===== 客户列表 ===== */
.customer-list { padding: 0 12px 80px; }
.customer-card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 10px; overflow: hidden; position: relative;
  transition: transform 0.2s;
}
.customer-card .cc-inner { padding: 14px 16px; }
.customer-card .cc-row1 { display: flex; align-items: center; justify-content: space-between; }
.customer-card .cc-name { font-size: 16px; font-weight: 700; }
.customer-card .cc-phone { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.customer-card .cc-row2 { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.customer-card .cc-amount { font-size: 20px; font-weight: 800; color: var(--brand); }
.customer-card .cc-amount-label { font-size: 11px; color: var(--text-2); }
.customer-card .cc-row3 { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.customer-card .cc-followup { font-size: 12px; color: var(--text-2); }
.customer-card .cc-followup.warn { color: var(--red); }

/* 卡片滑动操作区 */
.customer-card .cc-actions {
  position: absolute; right: 0; top: 0; bottom: 0;
  display: flex; align-items: stretch;
}
.customer-card .cc-action-btn {
  width: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 12px; color: #fff; cursor: pointer; gap: 4px;
}
.customer-card .cc-action-btn .act-icon { font-size: 20px; }
.customer-card .cc-action-call { background: var(--green); }
.customer-card .cc-action-note { background: var(--orange); }
.customer-card .cc-action-match { background: var(--brand); }

/* ===== 客户详情页 ===== */
.detail-page { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: none; flex-direction: column; }
.detail-page.active { display: flex; }
.detail-header {
  background: #fff; padding: 12px 16px; display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.detail-header .back-btn { font-size: 22px; cursor: pointer; }
.detail-header .dh-title { flex: 1; font-size: 17px; font-weight: 700; }
.detail-header .edit-btn { font-size: 14px; color: var(--brand); cursor: pointer; }
.detail-body { flex: 1; overflow-y: auto; padding: 12px; padding-bottom: 80px; }
.detail-section { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden; }
.detail-section .ds-title { font-size: 14px; font-weight: 700; padding: 12px 16px 6px; border-bottom: 1px solid var(--border); }
.detail-field { display: flex; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.detail-field:last-child { border-bottom: none; }
.detail-field .df-label { width: 90px; color: var(--text-2); font-size: 13px; flex-shrink: 0; }
.detail-field .df-value { flex: 1; font-size: 14px; font-weight: 500; }

/* 匹配记录 */
.match-record { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.match-record:last-child { border-bottom: none; }
.match-record .mr-time { font-size: 12px; color: var(--text-2); margin-bottom: 4px; }
.match-record .mr-banks { font-size: 14px; }

/* 底部操作栏 */
.detail-footer {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: #fff; border-top: 1px solid var(--border);
  display: flex; gap: 12px; padding: 12px 16px;
  padding-bottom: calc(12px + var(--safe-bottom));
}
.detail-footer .btn { flex: 1; }

/* ===== 新版客户详情页 ===== */
.detail-header-new {
  background: linear-gradient(180deg, var(--brand) 0%, #3b7afc 100%);
  color: #fff; flex-shrink: 0; padding-top: calc(var(--safe-top) + 12px); padding-bottom: 12px;
}
.detail-nav-bar {
  display: flex; align-items: center; padding: 0 12px; min-height: 44px;
}
.detail-nav-bar .back-btn {
  min-width: 76px; font-size: 14px; display: flex; align-items: center; cursor: pointer;
}
/* 返回箭头：用 CSS 绘制的对称 V 形（旋转 45° 后仍以几何中心居中），
   避免 ‹ 字形受字体基线/inline 行盒影响而与「返回」文字错位 */
.detail-nav-bar .back-arrow {
  display: inline-block; width: 9px; height: 9px; margin-right: 6px;
  border-left: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  font-size: 0; line-height: 0;  /* 隐藏 ‹ 字形本身，只保留 CSS 绘制的箭头 */
  flex: 0 0 auto;
}
.detail-nav-bar .dh-title { flex: 1; text-align: center; font-size: 17px; font-weight: 600; }
.detail-nav-right { min-width: 76px; }

.detail-body-new { padding: 0 12px 80px; }

.detail-customer-card {
  background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); margin-top: -12px;
  padding: 24px 16px 16px; position: relative; z-index: 2;
}
.dcc-main { display: flex; align-items: center; margin-bottom: 16px; }
.dcc-avatar { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; margin-right: 14px; flex-shrink: 0; background: var(--brand-light); }
.dcc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dcc-info { flex: 1; }
.dcc-name { font-size: 18px; font-weight: 700; color: var(--text); margin: 2px 0 8px; }
.dcc-phone { font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.dcc-tag { display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 20px; font-weight: 500; }
.dcc-tag.individual { background: var(--green-bg); color: var(--green); }
.dcc-tag.enterprise { background: var(--orange-bg); color: var(--orange); }

.dcc-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--border);
}
.dcc-stat {
  background: var(--bg); border-radius: var(--radius-sm);
  padding: 10px 11px; display: flex; flex-direction: column; gap: 6px;
  min-width: 0; border-left: 3px solid var(--brand-light);
}
.dcc-stat-label { font-size: 12px; color: var(--text-2); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dcc-stat-value {
  font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.3;
  word-break: break-word; overflow-wrap: anywhere;
}
.dcc-has-loan { color: var(--red); }

.detail-tabs {
  display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 4px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.detail-tabs::-webkit-scrollbar { display: none; }
.dt-tab {
  flex-shrink: 0; padding: 7px 14px; border-radius: 20px;
  background: #fff; border: 1px solid var(--border); color: var(--text-2);
  font-size: 13px; white-space: nowrap; cursor: pointer; transition: all 0.15s;
}
.dt-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.detail-info-section { background: #fff; border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; box-shadow: var(--shadow); }
.dis-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.dis-title { font-size: 15px; font-weight: 700; color: var(--text); }
.dis-edit { font-size: 13px; color: var(--brand); border: 1px solid var(--brand); padding: 2px 10px; border-radius: 12px; cursor: pointer; }
.dis-body { padding: 4px 16px; }

/* ===== 编辑页 ===== */
.edit-header { padding-top: calc(var(--safe-top) + 12px); padding-bottom: 12px; }
.edit-save-btn { background: rgba(255,255,255,0.2); color: #fff; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid rgba(255,255,255,0.35); min-width: auto; display: inline-flex; align-items: center; justify-content: center; }
.edit-body { flex: 1; overflow-y: auto; padding: 14px 12px 90px; background: var(--bg); }
.ef-section { background: #fff; border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; box-shadow: var(--shadow); }
.ef-section-title { font-size: 15px; font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.ef-row { display: flex; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--border); }
.ef-row:last-child { border-bottom: none; }
.ef-label { width: 92px; flex-shrink: 0; font-size: 14px; color: var(--text-2); }
.ef-input { flex: 1; border: none; outline: none; font-size: 14px; color: var(--text); background: transparent; text-align: right; }
.ef-input.ef-readonly { color: var(--text-2); background: var(--bg-2); border-radius: 6px; padding: 4px 8px; text-align: left; opacity: .85; }
select.ef-input { text-align: left; direction: ltr; -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' fill='none' stroke='%23999' stroke-width='1.5'/></svg>"); background-repeat: no-repeat; background-position: right 4px center; padding-right: 22px; }
select.ef-input option { direction: ltr; }
textarea.ef-input { text-align: left; min-height: 64px; line-height: 1.5; }
.ef-file-block { padding: 12px 16px; }
.ef-file-add { display: inline-flex; align-items: center; justify-content: center; padding: 8px 14px; border: 1px dashed var(--brand); color: var(--brand); border-radius: 8px; font-size: 13px; cursor: pointer; margin-top: 8px; }
.ef-file-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ef-file-item { position: relative; width: 62px; height: 62px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: var(--gray-bg); text-decoration: none; }
.ef-file-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ef-file-item .ef-file-name { position: absolute; left: 0; right: 0; bottom: 0; font-size: 10px; background: rgba(0,0,0,0.55); color: #fff; padding: 2px 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ef-file-item .ef-file-del { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; background: rgba(0,0,0,0.6); color: #fff; font-size: 13px; line-height: 18px; text-align: center; }
.ef-file-item .ef-file-ext { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--brand); }
.dir-row { display: flex; padding: 11px 0; border-bottom: 1px solid var(--border); }
.dir-row:last-child { border-bottom: none; }
.dir-label { width: 110px; color: var(--text-2); font-size: 14px; flex-shrink: 0; }
.dir-value { flex: 1; font-size: 14px; color: var(--text); font-weight: 500; text-align: right; word-break: break-all; }

/* ===== 快捷模块列表 / 详情 ===== */
.module-list { padding: 12px; }
.module-search { display: flex; gap: 8px; padding: 10px 12px; background: var(--gray-bg, #f5f6f8); }
.module-search .ms-input { flex: 1; min-width: 0; height: 36px; border: 1px solid var(--border, #e5e7eb); border-radius: 8px; background: #fff; font-size: 13px; color: var(--text); padding: 0 10px; outline: none; }
.module-search .ms-input::placeholder { color: #9aa0a6; }
.module-card { background: #fff; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow); cursor: pointer; }
.module-card:active { background: #f7f9fc; }
.mc-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.mc-title-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-status-wrap { display: flex; gap: 6px; flex-shrink: 0; align-items: center; }
.mc-status { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; line-height: 1.4; }
.mc-status.pending { background: #fff3e0; color: #e65100; }
.mc-status.success { background: #e8f5e9; color: #2e7d32; }
.mc-status.primary { background: #e3f2fd; color: #1565c0; }
.mc-sub { font-size: 13px; color: var(--text-2); line-height: 1.6; }
.mc-sub b { color: var(--brand); font-weight: 600; }
.mc-time { font-size: 12px; color: var(--text-3); margin-top: 8px; }
.module-detail { flex: 1; overflow-y: auto; padding: 12px; background: var(--bg); }
.module-detail-footer { display: flex; gap: 12px; padding: 12px; background: #fff; border-top: 1px solid var(--border); }
.module-detail-footer .btn { flex: 1; }
.btn-danger { background: #fff; color: #e23d3d; border: 1px solid #e23d3d; border-radius: 8px; padding: 11px 0; font-size: 15px; font-weight: 600; }
.btn-danger:active { background: #fdeaea; }
.md-grid { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.md-item { display: flex; padding: 11px 16px; border-bottom: 1px solid var(--border); }
.md-item:last-child { border-bottom: none; }
.md-k { width: 104px; flex-shrink: 0; font-size: 14px; color: var(--text-2); }
.md-v { flex: 1; font-size: 14px; color: var(--text); font-weight: 500; text-align: right; word-break: break-all; }
.md-v a { color: var(--brand); text-decoration: none; }
.md-submit-time { background: #f7f9fc; }
.md-submit-time .md-k, .md-submit-time .md-v { color: var(--text-3); font-weight: 400; font-size: 13px; }
.md-img-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.md-img-grid img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.md-file-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; align-items: center; }
.md-file-grid .md-file-img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; }
.md-file-pdf { display: inline-flex; align-items: center; padding: 8px 12px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; color: var(--brand); font-size: 13px; text-decoration: none; }

.detail-empty { text-align: center; padding: 48px 20px; color: var(--text-3); }
.de-icon { font-size: 40px; margin-bottom: 10px; }
.de-text { font-size: 14px; }

.detail-timeline { padding: 8px 0; }
.dtl-item { background: #fff; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 10px; box-shadow: var(--shadow); }
.dtl-time { font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.dtl-note { font-size: 14px; color: var(--text); line-height: 1.5; white-space: pre-wrap; }

.detail-loan-list { padding: 8px 0; }
.dll-item { background: #fff; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 10px; box-shadow: var(--shadow); }
.dll-title { font-size: 14px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.dll-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); padding: 4px 0; }
.dll-row span:last-child { color: var(--text); font-weight: 500; }

/* ===== 一键匹配半屏抽屉 ===== */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 200; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.overlay.active { opacity: 1; pointer-events: auto; }

.match-drawer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 201;
  background: var(--bg); border-radius: 20px 20px 0 0;
  max-height: 85vh; overflow-y: auto;
  transform: translateY(100%); transition: transform 0.3s ease;
  padding-bottom: var(--safe-bottom);
}
.match-drawer.active { transform: translateY(0); }
.drawer-header {
  position: sticky; top: 0; background: #fff;
  padding: 16px 16px 12px; border-radius: 20px 20px 0 0;
  border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between;
  z-index: 5;
}
.drawer-header .dh-name { font-size: 17px; font-weight: 700; }
.drawer-header .close-btn { font-size: 22px; color: var(--text-2); cursor: pointer; line-height: 1; }
.drawer-body { padding: 12px 16px 16px; }

/* 资质简评 */
.summary-box { background: #fff; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 12px; }
.summary-box .sb-title { font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.summary-box .sb-lines { display: flex; gap: 8px; flex-wrap: wrap; }
.summary-box .sb-line { font-size: 14px; font-weight: 500; padding: 4px 10px; background: var(--brand-light); border-radius: 6px; color: var(--brand); }

/* 策略色块 */
.strategy-block { border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; position: relative; overflow: hidden; }
.strategy-block .sb-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.strategy-block .sb-icon { font-size: 20px; }
.strategy-block .sb-label { font-size: 15px; font-weight: 700; }
.strategy-block .sb-sub { font-size: 11px; color: var(--text-2); margin-left: auto; }
.strategy-block .sb-info { display: flex; gap: 16px; margin-bottom: 8px; }
.strategy-block .sb-info-item .si-label { font-size: 11px; color: var(--text-2); }
.strategy-block .sb-info-item .si-value { font-size: 15px; font-weight: 700; }
.strategy-block .sb-note { font-size: 12px; color: var(--text-2); background: rgba(255,255,255,0.5); border-radius: 6px; padding: 8px 10px; margin-top: 6px; }
.strategy-block .sb-extra { font-size: 12px; color: var(--orange); margin-top: 6px; }
.strategy-block .sb-features { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.strategy-block .sb-features .feat { font-size: 11px; padding: 2px 6px; background: rgba(255,255,255,0.4); border-radius: 4px; }
.strategy-preferred { background: linear-gradient(135deg, #e8f9ed, #d4f5dd); border-left: 4px solid var(--green); }
.strategy-backup    { background: linear-gradient(135deg, #fff5e6, #ffe8cc); border-left: 4px solid var(--orange); }
.strategy-fallback  { background: linear-gradient(135deg, #ffeael, #ffd6d3); border-left: 4px solid var(--red); }

.drawer-footer { display: flex; gap: 10px; padding: 0 16px 16px; }
.drawer-footer .btn { flex: 1; }

/* ===== 我的助手 - 对话页 ===== */
.assistant-header {
  background: #fff; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.assistant-header .ah-title { font-size: 17px; font-weight: 700; }
.assistant-header .ah-actions { display: flex; gap: 16px; }
.assistant-header .ah-btn { font-size: 20px; cursor: pointer; }

/* ===== AI助手 - 入口选择页 ===== */
.assistant-entry-view { background: #f6f7f9; }
.assistant-entry-view .assistant-header { background: var(--brand); color: #fff; border-bottom: none; }
.ai-intro-card {
  background: #fff; border-radius: 16px; margin: 16px; padding: 18px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.ai-intro-title {
  font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.ai-intro-icon {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand-light); color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.ai-intro-icon img { width: 20px; height: 20px; object-fit: contain; display: block; }
.ai-intro-list { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 13px; line-height: 1.9; }
.ai-intro-list li::marker { color: var(--brand); }
.ai-entry-divider {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  color: var(--text-3); font-size: 13px; margin: 8px 16px 16px;
}
.ai-entry-divider::before,
.ai-entry-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.ai-entry-grid {
  display: flex; gap: 14px; margin: 0 16px 24px;
}
.ai-entry-card {
  flex: 1; background: #fff; border-radius: 16px; padding: 22px 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06); text-align: center; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.ai-entry-card:active { transform: scale(0.98); }
.ai-entry-icon {
  width: 52px; height: 52px; margin: 0 auto 0;
  background: #f6f8ff; border-radius: 50%; padding: 12px;
}
.ai-entry-icon img { width: 100%; height: 100%; object-fit: contain; }
.ai-entry-name { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.ai-entry-desc { font-size: 12px; color: var(--text-3); margin-bottom: 12px; }
.ai-entry-link { font-size: 13px; color: var(--brand); font-weight: 500; }

/* ===== AI助手 - 录入客户信息页 ===== */
.customer-form-view { background: #f6f7f9; }
.cf-header {
  background: var(--brand); color: #fff; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.cf-back { font-size: 15px; cursor: pointer; min-width: 60px; }
.cf-title { font-size: 17px; font-weight: 700; text-align: center; flex: 1; }
.cf-placeholder { min-width: 60px; }
.cf-body { flex: 1; overflow-y: auto; padding: 16px; }
.cf-section {
  background: #fff; border-radius: 16px; padding: 18px 16px; margin-bottom: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.cf-section-title {
  color: var(--brand); font-size: 15px; font-weight: 700; margin-bottom: 16px;
}
.cf-row { display: flex; align-items: center; margin-bottom: 14px; }
.cf-row:last-child { margin-bottom: 0; }
.cf-row label {
  width: 92px; font-size: 14px; color: var(--text); flex-shrink: 0;
}
.cf-row input,
.cf-row select,
.cf-row textarea {
  flex: 1; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font-size: 14px; color: var(--text); background: #fff;
  outline: none;
}
.cf-row input::placeholder,
.cf-row textarea::placeholder { color: var(--text-3); }
.cf-row input:focus,
.cf-row select:focus,
.cf-row textarea:focus { border-color: var(--brand); }
.cf-row textarea { resize: none; }
.cf-footer {
  display: flex; gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: #fff; border-top: 1px solid var(--border); flex-shrink: 0;
}
.cf-btn { flex: 1; padding: 12px 0; border-radius: 999px; font-size: 15px; font-weight: 500; border: none; cursor: pointer; }
.cf-btn-outline { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.cf-btn-primary { background: var(--brand); color: #fff; }
.cf-btn-sm { flex: 0 0 auto; padding: 7px 14px; font-size: 13px; border-radius: 999px; }
.cf-tip { font-size: 11px; font-weight: 400; color: var(--text-3); margin-left: 6px; }
.req { color: #ef4444; margin-left: 2px; font-weight: 700; }
.cf-more-toggle {
  width: 100%; padding: 12px; margin-bottom: 14px; border: 1px dashed var(--brand);
  border-radius: 12px; background: #fafbff; color: var(--brand); font-size: 14px;
  font-weight: 600; cursor: pointer;
}
.cf-company-wrap { flex: 1; display: flex; align-items: center; gap: 8px; }
.cf-company-wrap input { flex: 1; min-width: 0; }
.cf-ent-info {
  margin-top: 14px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: #fafbff;
}
.cf-ent-info-title { font-size: 14px; font-weight: 700; color: var(--brand); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.cf-ent-badge { font-size: 11px; font-weight: 400; color: var(--text-3); }
.cf-ent-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.cf-ent-item { width: calc(50% - 5px); display: flex; flex-direction: column; }
.cf-ent-item.cf-ent-full { width: 100%; }
.cf-ent-item label { font-size: 12px; color: var(--text-2); margin-bottom: 4px; }
.cf-ent-item input, .cf-ent-item textarea {
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 13px;
  color: var(--text); background: #fff; outline: none; width: 100%; box-sizing: border-box;
}
.cf-ent-item textarea { resize: none; }
.ent-search-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none;
  align-items: flex-end; justify-content: center; z-index: 1000;
}
.ent-search-panel {
  width: 100%; max-width: 560px; background: #fff; border-radius: 16px 16px 0 0;
  max-height: 78vh; display: flex; flex-direction: column; overflow: hidden;
  animation: entSlideUp .2s ease-out;
}
@keyframes entSlideUp { from { transform: translateY(40px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
.ent-search-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; font-size: 16px; font-weight: 700; border-bottom: 1px solid var(--border);
}
.ent-search-close { background: none; border: none; font-size: 22px; line-height: 1; color: var(--text-2); cursor: pointer; }
.ent-search-bar { display: flex; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.ent-search-bar input {
  flex: 1; min-width: 0; height: 40px; border: 1px solid var(--border); border-radius: 10px;
  padding: 0 12px; font-size: 14px; outline: none;
}
.ent-search-go { white-space: nowrap; border: none; background: var(--brand); color: #fff; border-radius: 10px; padding: 0 18px; font-size: 14px; cursor: pointer; }
.ent-search-results { flex: 1; overflow-y: auto; padding: 8px 16px 16px; }
.ent-search-hint { color: var(--text-2); font-size: 13px; text-align: center; padding: 24px 0; }
.ent-search-count { font-size: 12px; color: var(--text-3); padding: 8px 0; }
.ent-search-item { padding: 12px 12px; border: 1px solid var(--border); border-radius: 10px; margin-top: 10px; cursor: pointer; background: #fff; }
.ent-search-item:active { background: #f5f7ff; }
.esi-name { font-size: 15px; font-weight: 600; color: var(--text); }
.esi-meta { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.esi-sub { font-size: 11px; color: var(--text-3); margin-top: 3px; word-break: break-all; }
.ent-search-foot { font-size: 11px; color: var(--text-3); text-align: center; padding: 10px 16px; border-top: 1px solid var(--border); }
.ef-mini-btn {
  margin-left: auto; font-size: 12px; padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--brand); color: var(--brand); background: #fff; cursor: pointer; font-weight: 500;
}
.cf-loan-row { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.cf-loan-state { font-size: 13px; color: var(--green); font-weight: 600; }
.cf-link { background: none; border: none; color: var(--brand); font-size: 13px; cursor: pointer; padding: 0; }
.cf-link-danger { color: var(--red); margin-left: 12px; }
.cf-loan-list { width: 100%; margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.cf-loan-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--bg); border-radius: var(--radius-sm); padding: 8px 10px;
  border-left: 3px solid var(--brand-light);
}
.cf-loan-item-main { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.cf-loan-idx {
  flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.cf-loan-org { font-size: 14px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-loan-meta { font-size: 12px; color: var(--text-2); flex: 0 0 auto; }
.cf-loan-item-ops { flex: 0 0 auto; display: flex; align-items: center; }
.dcc-has-loan { color: var(--red); }

/* ===== AI助手 - 历史客户选择 ===== */
.ai-cust-search { margin-bottom: 12px; }
.ai-cust-search input {
  width: 100%; border: 1px solid var(--border); border-radius: 999px;
  padding: 10px 16px; font-size: 14px; outline: none;
}
.ai-cust-search input:focus { border-color: var(--brand); }
.ai-cust-list { display: flex; flex-direction: column; gap: 10px; }
.ai-cust-item {
  background: #fff; border-radius: 12px; padding: 14px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04); cursor: pointer;
}
.ai-cust-item:active { background: #f6f8ff; }
.ai-cust-name { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.ai-cust-info { font-size: 12px; color: var(--text-3); }
.ai-cust-check {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px;
}
.ai-cust-item.selected .ai-cust-check { background: var(--brand); border-color: var(--brand); }

.chat-area { flex: 1; overflow-y: auto; padding: 12px; padding-bottom: 70px; }
.chat-bubble { max-width: 80%; margin-bottom: 12px; }
.chat-bubble.user { margin-left: auto; }
.chat-bubble.assistant { margin-right: auto; }
.chat-bubble .cb-text { padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.6; }
.chat-bubble.user .cb-text { background: #e9e9eb; color: var(--text); border-bottom-right-radius: 4px; }
.chat-bubble.assistant .cb-text { background: var(--brand-light); color: var(--text); border-bottom-left-radius: 4px; }
.chat-bubble.assistant.thinking .cb-text { color: var(--text-2); }
.chat-bubble.assistant .typing { display: inline-flex; gap: 4px; vertical-align: middle; margin-right: 6px; }
.chat-bubble.assistant .typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); display: inline-block; animation: ai-typing 1.2s infinite ease-in-out; }
.chat-bubble.assistant .typing i:nth-child(2) { animation-delay: 0.2s; }
.chat-bubble.assistant .typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes ai-typing { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-4px); opacity: 1; } }

/* AI 回复 Markdown 渲染样式（marked.js 输出到 .cb-text 内） */
.chat-bubble.assistant .cb-text { word-break: break-word; }
.chat-bubble.assistant .cb-text p { margin: 0 0 8px; }
.chat-bubble.assistant .cb-text p:last-child { margin-bottom: 0; }
.chat-bubble.assistant .cb-text h1, .chat-bubble.assistant .cb-text h2,
.chat-bubble.assistant .cb-text h3, .chat-bubble.assistant .cb-text h4 { font-size: 15px; font-weight: 700; margin: 10px 0 6px; }
.chat-bubble.assistant .cb-text ul, .chat-bubble.assistant .cb-text ol { margin: 4px 0 8px; padding-left: 20px; }
.chat-bubble.assistant .cb-text li { margin: 2px 0; }
.chat-bubble.assistant .cb-text strong { font-weight: 700; }
.chat-bubble.assistant .cb-text em { font-style: italic; }
.chat-bubble.assistant .cb-text code { background: rgba(0,0,0,0.06); border-radius: 4px; padding: 1px 5px; font-size: 12px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.chat-bubble.assistant .cb-text pre { background: rgba(0,0,0,0.06); border-radius: 8px; padding: 10px; overflow-x: auto; margin: 6px 0 8px; }
.chat-bubble.assistant .cb-text pre code { background: none; padding: 0; font-size: 12px; }
.chat-bubble.assistant .cb-text table { border-collapse: collapse; margin: 6px 0 8px; max-width: 100%; font-size: 12px; }
.chat-bubble.assistant .cb-text th, .chat-bubble.assistant .cb-text td { border: 1px solid rgba(0,0,0,0.15); padding: 4px 8px; }
.chat-bubble.assistant .cb-text th { background: rgba(0,0,0,0.05); font-weight: 600; }
.chat-bubble.assistant .cb-text blockquote { border-left: 3px solid var(--brand); margin: 6px 0; padding: 2px 10px; color: var(--text-2); }
.chat-bubble.assistant .cb-text a { color: var(--brand); }
.chat-bubble.assistant .cb-text hr { border: none; border-top: 1px solid var(--border); margin: 8px 0; }

/* 结构化匹配消息 */
.chat-strategy { margin-top: 8px; }
.chat-strategy .cs-block { border-radius: 8px; padding: 10px 12px; margin-bottom: 6px; }
.chat-strategy .cs-block .csb-header { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.chat-strategy .cs-block .csb-icon { font-size: 15px; }
.chat-strategy .cs-block .csb-label { font-size: 13px; font-weight: 700; }
.chat-strategy .cs-block .csb-name { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.chat-strategy .cs-block .csb-info { font-size: 12px; margin-top: 4px; color: var(--text-2); }
.chat-strategy .cs-block .csb-note { font-size: 12px; color: var(--text-2); background: rgba(255,255,255,0.5); border-radius: 6px; padding: 6px 8px; margin-top: 6px; }
.chat-strategy .cs-block .csb-features { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.chat-strategy .cs-block .csb-features .feat { font-size: 11px; padding: 2px 6px; background: rgba(255,255,255,0.45); border-radius: 4px; }
.chat-strategy .cs-preferred { background: var(--green-bg); border-left: 3px solid var(--green); }
.chat-strategy .cs-backup { background: var(--orange-bg); border-left: 3px solid var(--orange); }
.chat-strategy .cs-fallback { background: var(--red-bg); border-left: 3px solid var(--red); }
.chat-disclaimer { font-size: 11px; color: var(--text-3); margin-top: 6px; text-align: center; }

/* 输入区 */
.chat-input-bar {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: #fff; border-top: 1px solid var(--border);
  display: flex; align-items: flex-end; gap: 8px; padding: 8px 12px;
  padding-bottom: calc(8px + var(--safe-bottom));
}
.chat-input-bar .voice-btn { font-size: 24px; cursor: pointer; color: var(--text-2); padding: 4px; }
.chat-input-bar input { flex: 1; background: var(--gray-bg); border-radius: 20px; padding: 10px 16px; font-size: 14px; max-height: 80px; }
.chat-input-bar .send-btn { background: var(--brand); color: #fff; padding: 8px 16px; border-radius: 20px; font-size: 14px; cursor: pointer; white-space: nowrap; }

/* 历史对话列表 */
.history-list { padding: 12px; }
.history-item { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 10px; cursor: pointer; }
.history-item .hi-title { font-size: 15px; font-weight: 600; }
.history-item .hi-meta { display: flex; justify-content: space-between; margin-top: 6px; }
.history-item .hi-time { font-size: 12px; color: var(--text-2); }
.history-item .hi-count { font-size: 12px; color: var(--brand); }

/* ===== 个人中心 ===== */
.profile-header { position: relative; background: linear-gradient(135deg, var(--brand), var(--brand-dark)); padding: 24px 16px; color: #fff; text-align: center; }
.profile-actions { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; align-items: center; }
.profile-edit-btn, .profile-cancel-btn { font-size: 13px; padding: 4px 12px; border-radius: 14px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.profile-edit-btn { background: rgba(255,255,255,0.22); color: #fff; border: 1px solid rgba(255,255,255,0.55); }
.profile-cancel-btn { background: rgba(0,0,0,0.20); color: #fff; border: 1px solid rgba(255,255,255,0.4); }
.profile-avatar { width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; font-size: 28px; margin: 0 auto 8px; border: 2px solid rgba(255,255,255,0.3); overflow: hidden; cursor: pointer; }
.profile-avatar.avatar-editable { box-shadow: 0 0 0 3px rgba(255,255,255,0.65); border-color: #fff; }
.profile-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.profile-avatar-hint { font-size: 12px; opacity: 0.75; margin-top: 2px; }
.profile-name { font-size: 18px; font-weight: 700; }
.profile-name-input { display: block; font-size: 18px; font-weight: 700; color: #fff; background: rgba(255,255,255,0.16); border: 1px solid rgba(255,255,255,0.6); border-radius: 8px; padding: 4px 10px; width: 60%; max-width: 220px; text-align: center; margin: 4px auto 0; outline: none; }
.profile-name-input::placeholder { color: rgba(255,255,255,0.7); }
.profile-dept { font-size: 13px; opacity: 0.8; margin-top: 2px; }

.profile-menu { margin: 12px; }
.menu-item { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 8px; }
.menu-item .mi-inner { display: flex; align-items: center; padding: 16px; cursor: pointer; }
.menu-item .mi-icon { font-size: 20px; margin-right: 12px; }
.menu-item .mi-text { flex: 1; font-size: 15px; }
.menu-item .mi-arrow { color: var(--text-3); font-size: 18px; }
.menu-item .mi-switch { position: relative; width: 44px; height: 24px; }
.menu-item .mi-switch input { opacity: 0; width: 0; height: 0; }
.menu-item .mi-slider { position: absolute; inset: 0; background: var(--text-3); border-radius: 12px; cursor: pointer; transition: 0.3s; }
.menu-item .mi-slider:before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: 0.3s; }
.menu-item .mi-switch input:checked + .mi-slider { background: var(--green); }
.menu-item .mi-switch input:checked + .mi-slider:before { transform: translateX(20px); }

/* ===== 通知列表 ===== */
.notif-list { padding: 12px; }
.notif-item { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 8px; }
.notif-item.unread { border-left: 3px solid var(--brand); }
.notif-item .ni-title { font-size: 15px; font-weight: 600; }
.notif-item .ni-content { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.notif-item .ni-time { font-size: 11px; color: var(--text-3); margin-top: 6px; }

/* ===== 跟进记录时间轴 ===== */
.timeline { padding: 0 16px 16px; }
.timeline-item { position: relative; padding-left: 24px; padding-bottom: 16px; }
.timeline-item:before { content: ''; position: absolute; left: 6px; top: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.timeline-item:after { content: ''; position: absolute; left: 9px; top: 14px; bottom: 0; width: 2px; background: var(--border); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item:last-child:after { display: none; }
.timeline-item .ti-time { font-size: 12px; color: var(--text-2); }
.timeline-item .ti-note { font-size: 14px; margin-top: 2px; }

/* ===== 工具类 ===== */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.text-sm { font-size: 13px; } .text-xs { font-size: 12px; } .text-gray { color: var(--text-2); }
.font-bold { font-weight: 700; }

/* 空状态 */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-3); }
.empty-state .es-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state .es-text { font-size: 14px; }

/* 数据加载中状态 */
.loading-state { text-align: center; padding: 60px 20px; color: var(--text-3); }
.loading-state .spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--brand-light, #e3ecff);
  border-top-color: var(--brand, #2055DF);
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: spin 0.8s linear infinite;
}
.loading-state .loading-text { font-size: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 加载更多 */
.load-more { text-align: center; padding: 16px; color: var(--text-3); font-size: 13px; }

/* 快捷指令提示 */
.quick-cmd-hint { padding: 8px 12px; background: var(--brand-light); font-size: 12px; color: var(--brand); border-radius: 8px; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }

/* ===== 老板经营总览 ===== */
.boss-header {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  padding: 16px 16px 20px; color: #fff;
}
.boss-header .boss-greeting { font-size: 20px; font-weight: 700; }

.boss-kpi-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px;
}
.boss-kpi-card {
  background: #fff; border-radius: var(--radius); padding: 14px 12px;
  box-shadow: var(--shadow); text-align: center;
}
.boss-kpi-card.boss-kpi-wide { grid-column: 1 / -1; }
.boss-kpi-card .bk-label { font-size: 12px; color: var(--text-2); }
.boss-kpi-card .bk-value { font-size: 24px; font-weight: 800; color: var(--text); margin-top: 6px; }
.boss-kpi-click { cursor: pointer; transition: transform .08s ease, box-shadow .08s ease; }
.boss-kpi-click:active { transform: scale(0.97); box-shadow: 0 1px 4px rgba(0,0,0,0.12); }
.boss-card-click { cursor: pointer; transition: transform .08s ease, box-shadow .08s ease; }
.boss-card-click:active { transform: scale(0.98); box-shadow: 0 1px 4px rgba(0,0,0,0.12); }
.module-filter-hint {
  margin: 0 12px 8px; padding: 7px 12px; font-size: 12px; color: var(--brand);
  background: rgba(22,119,255,0.08); border: 1px solid rgba(22,119,255,0.18);
  border-radius: 10px; text-align: center;
}

.boss-section-title {
  font-size: 16px; font-weight: 700; padding: 16px 4px 8px;
  display: flex; align-items: center; gap: 8px;
}

/* 周期切换分段控件（今日/本周/本月） */
.boss-period-tabs {
  margin-left: auto; display: flex; background: var(--bg, #f2f3f5);
  border-radius: 999px; padding: 2px; flex-shrink: 0;
}
.boss-period-tabs .bpt-item {
  font-size: 12px; padding: 4px 12px; border-radius: 999px;
  color: var(--text-2, #8e8e93); cursor: pointer; user-select: none; white-space: nowrap;
}
.boss-period-tabs .bpt-item.active {
  background: var(--brand, #2055DF); color: #fff; font-weight: 600;
}
.boss-section-title:before {
  content: ''; width: 4px; height: 16px; background: var(--brand); border-radius: 2px;
}

.boss-row { display: flex; gap: 10px; padding: 0 12px; }
.boss-card {
  background: #fff; border-radius: var(--radius); padding: 14px 12px;
  box-shadow: var(--shadow); margin: 0 12px 10px;
}
.boss-card.boss-card-half { flex: 1; margin: 0; min-width: 0; }
.boss-card .boss-card-title { font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.boss-card .boss-big-num { font-size: 36px; font-weight: 800; color: var(--text); text-align: center; padding: 16px 0; }

.boss-donut-wrap { display: flex; flex-direction: column; align-items: center; }
.boss-donut-wrap svg { width: 120px; height: 120px; }
.boss-status-legend { display: flex; gap: 12px; margin-top: 8px; font-size: 12px; color: var(--text-2); }
.boss-status-legend .legend-item { display: flex; align-items: center; gap: 4px; }
.boss-status-legend .dot { width: 8px; height: 8px; border-radius: 50%; }
.boss-donut-total { font-size: 22px; font-weight: 700; fill: var(--text-1); }
.boss-donut-label { font-size: 11px; fill: var(--text-2); }

.boss-line-wrap { width: 100%; overflow-x: auto; }
.boss-line-wrap svg { width: 100%; height: 180px; min-width: 300px; }
.boss-line-label { font-size: 11px; fill: var(--text-2); }
.boss-line-grid { stroke: var(--border); stroke-width: 1; }
.boss-line-axis { stroke: var(--border); stroke-width: 1; }
.boss-line-path { fill: none; stroke: var(--brand); stroke-width: 2.5; }
.boss-line-dot { fill: var(--brand); }
.boss-line-value { font-size: 11px; fill: var(--text); font-weight: 600; }

/* ===== 工作台切换（数据概览 / 业务员首页） ===== */
.nhh-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.bh-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wb-switch {
  display: inline-flex;
  margin-top: 12px;
  padding: 3px;
  gap: 2px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  width: fit-content;
}
.boss-header .wb-switch { margin-top: 10px; }
.wb-opt {
  font-size: 13px;
  line-height: 1.2;
  padding: 6px 16px;
  border-radius: 999px;
  color: #fff;
  opacity: 0.85;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: background 0.15s, color 0.15s, opacity 0.15s;
}
.wb-opt.active {
  background: #fff;
  color: var(--brand);
  font-weight: 600;
  opacity: 1;
}

/* ===== 图片/文件预览弹窗 ===== */
.media-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.85); display: none; align-items: center; justify-content: center; z-index: 2000; padding: 16px; box-sizing: border-box; }
.media-modal.show { display: flex; }
.media-modal-box { position: relative; max-width: 92vw; max-height: 88vh; display: flex; flex-direction: column; align-items: center; }
.media-modal-box img { max-width: 92vw; max-height: 80vh; object-fit: contain; border-radius: 8px; background: #fff; }
.media-modal-box iframe { width: 90vw; height: 80vh; border: 0; border-radius: 8px; background: #fff; }
.media-modal-close { position: absolute; top: -38px; right: 0; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.92); color: #333; font-size: 22px; line-height: 34px; text-align: center; cursor: pointer; }
.media-modal-name { color: #fff; font-size: 13px; margin-top: 10px; max-width: 90vw; word-break: break-all; text-align: center; }
/* 详情/表单内可点击预览的缩略图 */
.md-file-img, .ef-file-item img, .ef-file-item .ef-file-ext { cursor: pointer; }

/* ===== 详情页：征信快照 / 需求模块 ===== */
#detailModules { padding: 12px 16px 4px; display: flex; flex-direction: column; gap: 12px; }
.detail-module-card { background: #fff; border-radius: 14px; box-shadow: 0 2px 10px rgba(20,40,80,0.06); overflow: hidden; }
.dmc-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid #f0f2f5; }
.dmc-title { font-size: 15px; font-weight: 700; color: #1f2d3d; }
.dmc-actions { display: flex; gap: 8px; }
.dmc-btn { font-size: 12px; color: #2563eb; background: #eaf1ff; border-radius: 8px; padding: 5px 10px; cursor: pointer; }
.dmc-btn.ghost { color: #64748b; background: #f1f5f9; }
.dmc-body { padding: 12px 14px 14px; }
.dmc-line { font-size: 14px; color: #1f2d3d; margin-bottom: 6px; }
.dmc-desc { color: #64748b; font-size: 13px; line-height: 1.6; word-break: break-all; }
.dmc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.dmc-cell { background: #f8fafc; border-radius: 10px; padding: 8px 10px; }
.dmc-cl { font-size: 12px; color: #94a3b8; margin-bottom: 2px; }
.dmc-cv { font-size: 14px; color: #1f2d3d; font-weight: 600; word-break: break-all; }
.dmc-files { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.dmc-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid #eef2f7; }
.dmc-file { display: inline-block; max-width: 160px; font-size: 12px; color: #2563eb; background: #eaf1ff; border-radius: 8px; padding: 6px 10px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dmc-updated { font-size: 12px; color: #94a3b8; margin-top: 8px; }
.dmc-expired { margin-top: 8px; font-size: 13px; color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: 8px 10px; font-weight: 600; }

/* ===== 通用弹窗（征信/需求录入与历史） ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.5); display: none; align-items: center; justify-content: center; z-index: 3000; padding: 18px; box-sizing: border-box; }
.modal-overlay.active { display: flex; }
.modal-box { width: 100%; max-width: 460px; max-height: 86vh; background: #fff; border-radius: 16px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,0.18); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid #eef2f7; }
.cdm-title { font-size: 16px; font-weight: 700; color: #1f2d3d; }
.modal-close { font-size: 24px; color: #94a3b8; cursor: pointer; line-height: 1; padding: 0 4px; }
.cdm-body { padding: 14px 16px; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid #eef2f7; }

/* 录入表单 */
.cd-form { display: flex; flex-direction: column; gap: 12px; }
.cd-row { display: flex; flex-direction: column; gap: 5px; }
.cd-row > label { font-size: 13px; color: #64748b; }
.cd-input { border: 1px solid #d8dee9; border-radius: 10px; padding: 9px 11px; font-size: 14px; color: #1f2d3d; background: #fff; outline: none; box-sizing: border-box; width: 100%; }
.cd-input:focus { border-color: #2563eb; }
textarea.cd-input { min-height: 64px; resize: vertical; }
.cd-files { display: flex; flex-wrap: wrap; gap: 8px; }
.cd-file-add { font-size: 13px; color: #2563eb; background: #eaf1ff; border-radius: 8px; padding: 7px 12px; cursor: pointer; align-self: flex-start; }
.cd-file-item { position: relative; width: 56px; height: 56px; }
.cd-file-item img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid #eef2f7; }
.cd-file-ext { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; background: #eaf1ff; color: #2563eb; border-radius: 8px; font-size: 12px; }
.cd-file-name { display: none; }
.cd-file-del { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; background: #ef4444; color: #fff; font-size: 12px; line-height: 18px; text-align: center; cursor: pointer; }

/* 历史列表 */
.cd-list { display: flex; flex-direction: column; gap: 10px; }
.cd-empty { text-align: center; color: #94a3b8; padding: 24px 0; font-size: 14px; }
.cd-list-item { border: 1px solid #eef2f7; border-radius: 12px; padding: 12px; }
.cd-li-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cd-li-title { font-size: 14px; font-weight: 700; color: #1f2d3d; }
.cd-li-tag { font-size: 11px; color: #16a34a; background: #ecfdf5; border-radius: 6px; padding: 2px 7px; }
.cd-li-tag.expired { color: #b91c1c; background: #fef2f2; }
.cd-li-time { font-size: 12px; color: #94a3b8; margin-left: auto; }
.cd-li-desc { font-size: 13px; color: #64748b; margin: 6px 0; line-height: 1.6; word-break: break-all; }
.cd-li-files { display: flex; flex-direction: column; gap: 3px; margin-bottom: 6px; }
.cd-li-files a { font-size: 12px; color: #2563eb; text-decoration: none; }
.cd-li-actions { display: flex; gap: 16px; margin-top: 4px; }
.cd-li-actions span { font-size: 13px; color: #2563eb; cursor: pointer; }
.cd-li-actions span.danger { color: #ef4444; }

/* ===== 外出记录 ===== */
.outdoor-list { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.outdoor-card { background: #fff; border-radius: 12px; padding: 14px; box-shadow: var(--shadow); }
.oc-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.oc-meta { font-size: 13px; color: var(--text-2); display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.oc-meta span { display: flex; align-items: center; gap: 4px; }
.oc-remark { font-size: 13px; color: #64748b; line-height: 1.5; margin-top: 6px; word-break: break-all; }
.oc-images { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.oc-images img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.oc-empty { text-align: center; color: var(--text-2); padding: 40px 0; font-size: 14px; }
.outdoor-form-body { padding: 14px; background: var(--bg); min-height: 100%; }
.of-section { background: #fff; border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.of-field { display: flex; flex-direction: column; gap: 6px; }
.of-field.required > label::before { content: '*'; color: var(--red); margin-right: 3px; }
.of-field > label { font-size: 14px; font-weight: 700; color: var(--text); }
.of-field input, .of-field select, .of-field textarea {
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 14px; color: var(--text); background: #fff; outline: none; box-sizing: border-box; width: 100%;
}
.of-field input[readonly] { background: #f5f6fa; color: var(--text-2); }
.of-field input:focus, .of-field select:focus, .of-field textarea:focus { border-color: var(--brand); }
.of-field textarea { min-height: 90px; resize: vertical; }
.of-image-block { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.of-image-list { display: flex; flex-wrap: wrap; gap: 10px; }
.of-image-list img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.of-image-add { width: 72px; height: 72px; border: 1.5px dashed var(--brand); border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--brand); background: #f5f9ff; cursor: pointer; flex: 0 0 auto; }
.of-image-add:active { background: #eaf2ff; }
.of-add-ic { font-size: 26px; line-height: 1; font-weight: 300; }
.of-add-tx { font-size: 11px; font-weight: 600; }
.of-submit { margin-top: 8px; background: var(--brand); color: #fff; border: none; border-radius: 10px; padding: 12px; font-size: 15px; font-weight: 600; cursor: pointer; }
.of-submit:active { opacity: 0.9; }
.of-loc-row { display: flex; gap: 8px; align-items: stretch; }
.of-loc-row input { flex: 1; min-width: 0; }
.of-loc-btn { flex: 0 0 auto; border: none; border-radius: 8px; padding: 0 12px; background: var(--brand); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.of-loc-btn:active { opacity: 0.9; }
.of-loc-tip { font-size: 12px; color: var(--text-2); line-height: 1.4; }
.of-image-actions { display: flex; gap: 10px; }
