:root{
  --blue:#2563eb; --bg:#f1f5f9; --card:#fff;
  --text:#0f172a; --muted:#64748b; --border:#e2e8f0; --red:#dc2626;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"PingFang SC","Microsoft YaHei",sans-serif;background:var(--bg);color:var(--text);padding-bottom:env(safe-area-inset-bottom)}
.topbar{position:sticky;top:0;background:var(--blue);color:#fff;padding:14px 16px;display:flex;justify-content:space-between;align-items:center;z-index:10}
.topbar .title{font-size:18px;font-weight:600}
.topbar .link,.topbar .net{color:#fff;font-size:13px;text-decoration:none}
.net{padding:2px 8px;border:1px solid rgba(255,255,255,.6);border-radius:999px;font-size:12px}
.net.on{background:rgba(255,255,255,.18)}
.container{padding:14px;max-width:720px;margin:0 auto}
.card{background:var(--card);border:1px solid var(--border);border-radius:14px;padding:14px;margin-bottom:12px}
.field-label{font-size:13px;font-weight:600;color:var(--muted);display:block;margin-bottom:6px}
.input{width:100%;padding:11px 12px;border:1px solid var(--border);border-radius:10px;font-size:15px;background:#fff;color:var(--text)}
textarea.input{min-height:84px;resize:vertical}
select.input{appearance:none}
.hint{font-size:12px;color:var(--muted);margin:8px 0 0;line-height:1.5}
.form-row{margin-bottom:12px}
.form-row > label{font-size:14px;font-weight:600;display:block;margin-bottom:6px}
.req{color:var(--red);margin-left:2px}
.actions{display:flex;gap:10px;margin:6px 0 14px}
.btn{flex:1;padding:13px;border:none;border-radius:12px;font-size:15px;font-weight:600;background:#e2e8f0;color:var(--text);cursor:pointer;text-align:center;text-decoration:none}
.btn.primary{background:var(--blue);color:#fff}
.btn.small{flex:none;padding:9px 14px;font-size:13px;margin-top:8px}
.btn:active{transform:translateY(1px)}
.status{display:flex;justify-content:space-between;align-items:center;font-size:14px}
.preview{max-width:100%;border-radius:10px;margin-top:8px;border:1px solid var(--border)}
.tablewrap{overflow:auto;background:#fff;border:1px solid var(--border);border-radius:14px}
table{border-collapse:collapse;width:100%;font-size:13px}
th,td{border-bottom:1px solid var(--border);padding:8px 10px;text-align:left;white-space:nowrap;max-width:240px;overflow:hidden;text-overflow:ellipsis}
th{background:#f8fafc;position:sticky;top:0}
.stats{display:flex;justify-content:space-around;text-align:center;font-size:13px;color:var(--muted)}
.stats b{display:block;font-size:20px;color:var(--text);margin-top:2px}

/* 筛选 */
.filters{display:flex;flex-direction:column;gap:8px;margin-bottom:12px}
.filters .input{background:#fff}

/* 招聘卡片 */
.cards{display:flex;flex-direction:column;gap:10px}
.card-item{background:#fff;border:1px solid var(--border);border-left:4px solid var(--blue);border-radius:12px;padding:12px 14px}
.card-head{display:flex;justify-content:space-between;align-items:baseline;gap:8px;margin-bottom:4px}
.card-chat{font-weight:700;font-size:14px;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.card-time{font-size:12px;color:var(--muted);flex:none}
.card-sender{font-size:12px;color:#475569;margin-bottom:6px}
.card-body{font-size:14px;line-height:1.55;white-space:pre-wrap;word-break:break-word;max-height:240px;overflow:auto}
.copy-btn{margin-top:8px;padding:7px 12px;border:1px solid var(--border);border-radius:8px;background:#f8fafc;font-size:13px;color:var(--blue);cursor:pointer}
.copy-btn:active{transform:translateY(1px)}

.toast{position:fixed;left:50%;bottom:30px;transform:translateX(-50%) translateY(20px);background:rgba(15,23,42,.92);color:#fff;padding:10px 18px;border-radius:10px;font-size:14px;opacity:0;pointer-events:none;transition:.25s;z-index:99}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

/* ============ 登录 / 注册 ============ */
.login-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:20px;background:linear-gradient(160deg,#eff6ff,#f1f5f9 60%)}
.login-card{width:100%;max-width:400px;background:#fff;border:1px solid var(--border);border-radius:18px;padding:28px 24px;box-shadow:0 12px 40px rgba(15,23,42,.08);text-align:center}
.login-logo{font-size:40px;line-height:1}
.login-title{font-size:20px;margin:10px 0 4px}
.login-sub{font-size:13px;color:var(--muted);margin:0 0 18px}
.login-tabs{display:flex;background:#f1f5f9;border-radius:10px;padding:4px;margin-bottom:16px}
.login-tabs button{flex:1;padding:9px;border:none;border-radius:8px;background:transparent;font-size:14px;font-weight:600;color:var(--muted);cursor:pointer}
.login-tabs button.active{background:#fff;color:var(--blue);box-shadow:0 1px 4px rgba(15,23,42,.1)}
.login-input{width:100%;padding:12px 14px;border:1px solid var(--border);border-radius:10px;font-size:15px;margin-bottom:10px;font-family:inherit}
.login-input:focus{outline:none;border-color:var(--blue)}
.login-btn{width:100%;padding:13px;border:none;border-radius:10px;background:var(--blue);color:#fff;font-size:16px;font-weight:600;cursor:pointer;margin-top:4px}
.login-btn:disabled{background:#94a3b8;cursor:not-allowed}
.login-msg{min-height:20px;font-size:13px;color:var(--red);margin:12px 0 0}

/* ============ 顶栏：铃铛 / 用户 ============ */
.top-actions{display:flex;align-items:center;gap:12px}
.icon-btn{position:relative;background:transparent;border:none;color:#fff;font-size:19px;cursor:pointer;padding:4px 6px;border-radius:8px}
.icon-btn:active{background:rgba(255,255,255,.15)}
.badge{position:absolute;top:-4px;right:-6px;background:var(--red);color:#fff;font-size:11px;font-weight:700;min-width:17px;height:17px;line-height:17px;border-radius:999px;padding:0 4px;text-align:center}
.user-menu{display:flex;align-items:center;gap:8px}
.user-name{font-size:13px;max-width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.user-role{font-size:11px;padding:1px 7px;border-radius:999px;background:rgba(255,255,255,.18);color:#fff;white-space:nowrap}
.user-role.admin{background:#fbbf24;color:#7c2d12;font-weight:700}
.topbar .link{background:transparent;border:none;color:#fff;font-size:13px;cursor:pointer;padding:0;text-decoration:underline}

/* ============ 通知面板 ============ */
.notify-panel{position:fixed;top:56px;right:10px;left:10px;max-width:380px;margin-left:auto;background:#fff;border:1px solid var(--border);border-radius:14px;box-shadow:0 14px 44px rgba(15,23,42,.16);z-index:20;overflow:hidden}
.notify-head{display:flex;justify-content:space-between;align-items:center;padding:12px 14px;border-bottom:1px solid var(--border);font-size:14px}
.notify-head .link{background:transparent;border:none;color:var(--blue);font-size:13px;cursor:pointer;padding:0}
.notify-list{max-height:60vh;overflow:auto}
.notify-item{padding:11px 14px;border-bottom:1px solid #f1f5f9;cursor:pointer}
.notify-item:active{background:#f8fafc}
.notify-item.unread{background:#eff6ff}
.notify-title{font-size:14px;font-weight:600;line-height:1.4}
.notify-item.unread .notify-title::before{content:'';display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--red);margin-right:6px;vertical-align:2px}
.notify-body{font-size:13px;color:#475569;margin-top:3px;line-height:1.5;word-break:break-word}
.notify-time{font-size:12px;color:var(--muted);margin-top:4px}
.notify-empty{padding:28px 14px;text-align:center;font-size:13px;color:var(--muted)}

/* ============ 主导航（看板 / 协同数据）============ */
.view-nav{position:sticky;top:52px;display:flex;background:#fff;border-bottom:1px solid var(--border);z-index:9}
.view-nav button{flex:1;padding:12px;border:none;background:transparent;font-size:14px;font-weight:600;color:var(--muted);cursor:pointer}
.view-nav button.active{color:var(--blue);box-shadow:inset 0 -2px 0 var(--blue)}

/* ============ 协同数据 ============ */
.seg-tabs{display:flex;gap:8px;padding:14px 14px 0;max-width:720px;margin:0 auto}
.seg-tabs button{flex:1;padding:9px;border:1px solid var(--border);border-radius:10px;background:#fff;font-size:14px;font-weight:600;color:var(--muted);cursor:pointer}
.seg-tabs button.active{background:var(--blue);border-color:var(--blue);color:#fff}
/* v2.24.4：信息汇总 群/朋友圈 筛选按钮与「刷新」同尺寸 */
#srcTabs{padding:0;margin:10px 0 0}
#srcTabs button{padding:13px;border-radius:12px;font-size:15px}
.shared-toolbar{display:flex;gap:8px;align-items:center;margin:12px 0}
.shared-toolbar .input{flex:1}
.shared-btns{display:flex;gap:8px;flex:none}
.shared-fields{margin-top:6px}
.shared-field{font-size:13px;line-height:1.8;color:#334155}
.shared-k{color:var(--muted)}
.shared-v{word-break:break-all}
.shared-del{color:var(--red);border-color:#fecaca;background:#fef2f2}

/* ============ 弹层（添加表单）============ */
.modal-wrap{position:fixed;inset:0;background:rgba(15,23,42,.45);display:flex;align-items:flex-end;justify-content:center;z-index:50;padding:16px}
.modal-card{width:100%;max-width:440px;background:#fff;border-radius:16px;padding:18px;max-height:86vh;overflow:auto}
.modal-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;font-size:15px}
.modal-head .link{background:transparent;border:none;color:var(--muted);font-size:13px;cursor:pointer;padding:0}

/* ============ 消息提醒 ============ */
.msg-filters{display:flex;flex-direction:column;gap:8px;margin-bottom:12px}
.msg-filter-row{display:flex;gap:8px;align-items:center}
.msg-kg-sel{flex:1}
.msg-unread-label{display:flex;align-items:center;gap:5px;font-size:13px;color:var(--muted);white-space:nowrap}
.msg-item.unread{border-left-color:var(--red)}
.msg-head{display:flex;align-items:center;gap:6px;margin-bottom:4px;flex-wrap:wrap}
.msg-kg{font-size:12px;font-weight:600;padding:2px 8px;border-radius:6px}
.msg-sns{font-size:12px;color:#0b7285;background:#e6fcf5;padding:2px 8px;border-radius:6px}
.msg-bl{font-size:12px;color:#c2255c;background:#ffe9ec;padding:2px 8px;border-radius:6px}
.msg-read-dot{font-size:12px;color:var(--muted);margin-left:auto}
.msg-item.unread .msg-read-dot{color:var(--red);font-weight:600}
.msg-phone{display:flex;align-items:center;gap:8px;font-size:13px;color:#334155;margin-bottom:6px;flex-wrap:wrap}
.msg-copy-phone{padding:4px 10px;font-size:12px}
.msg-ops{display:flex;gap:8px;margin-top:8px;flex-wrap:wrap}
.msg-ops .copy-btn{margin-top:0}
.msg-bl-btn{color:var(--red);border-color:#fecaca;background:#fef2f2}
.nav-badge{display:inline-block;margin-left:4px;background:var(--red);color:#fff;font-size:11px;font-weight:700;min-width:16px;height:16px;line-height:16px;border-radius:999px;padding:0 4px;text-align:center;vertical-align:2px}

/* ============ 消息卡片（v2.18.5，与 exe 布局一致）============ */
.msg-card{padding:12px 14px}
.msg-card.unread{border-left-color:var(--red)}
.msg-r1{display:flex;justify-content:space-between;align-items:baseline;gap:8px;flex-wrap:wrap}
.msg-sender{font-weight:700;font-size:14px;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* v2.24.4：来源独占一行（与发布人分行，避免挤压） */
.msg-srcinfo{font-size:12px;color:var(--muted);flex:none;flex-basis:100%;text-align:left}
.msg-r2{display:flex;align-items:center;gap:6px;margin-top:4px;flex-wrap:wrap}
.msg-src-badge{font-size:12px;font-weight:600;padding:1px 7px;border-radius:6px;flex:none}
.msg-src-badge.sns{color:#0b7285;background:#e6fcf5}
.msg-src-badge.grp{color:#1f6feb;background:#e7f1ff}
.msg-chatname{font-size:13px;color:#334155;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:55%}
.msg-wxid{font-size:11px;color:#94a3b8;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* v2.24.6：名称后微信ID、3天发布数高亮与去重展开 */
.msg-wxid-inline{font-size:11px;color:#94a3b8;margin-left:4px;font-weight:400}
.msg-srcinfo.hot{color:#d6336c;font-weight:700;background:#fff0f6;padding:1px 6px;border-radius:8px}
.msg-srcinfo.expandable{cursor:pointer}
.msg-srcinfo.expandable:hover{text-decoration:underline}
.msg-expand{border-top:1px dashed #e5e7eb;margin-top:2px;padding:6px 4px 2px;background:#fafbfc}
.msg-sub{display:flex;flex-direction:column;gap:3px;padding:6px 8px;margin:4px 0;border:1px solid #eef0f3;border-radius:8px;background:#fff}
.msg-sub-meta{font-size:11px;color:#8c959f}
.msg-sub-text{font-size:13px;color:#2b2f36;white-space:pre-wrap;word-break:break-word;max-height:4.5em;overflow:hidden}
.msg-sub-ops{display:flex;gap:6px;flex-wrap:wrap}
.msg-sub-ops .msg-op{font-size:12px;padding:3px 8px}
.msg-sub-ops .msg-op.del{color:#b42318;background:#fff0f0}
.msg-sub-more{font-size:11px;color:#94a3b8;text-align:center;padding:4px 0;margin-top:2px}

/* v2.24.7：实时监测 - 检测 exe 在线结果 */
.admin-detect-result{display:flex;flex-direction:column;gap:4px}
.detect-row{font-size:13px;padding:4px 8px;border-radius:6px;border:1px solid #eef0f3}
.detect-row.online{color:#0b7285;background:#e6fcf5}
.detect-row.offline{color:#8c959f;background:#f1f3f5}
.msg-device{font-size:11px;color:#7c5cbf;background:#f3f0ff;padding:1px 7px;border-radius:6px;flex:none;max-width:40%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.msg-loc{font-size:11px;color:#2b7a2b;background:#eef7ee;padding:1px 7px;border-radius:6px;flex:none;max-width:45%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* ============ 后台管理（仅管理员） ============ */
.admin-hint{background:#eef4ff;border:1px solid #c7d7f5;border-radius:8px;padding:8px 12px;color:#3b5b9e}
.file-btn{display:inline-flex;align-items:center;justify-content:center;cursor:pointer;margin:0}
/* ============ 客户信息表格（exe 客户管理同款） ============ */
.crm-stats{font-size:13px;color:#334155;background:#f6f8fa;border-radius:8px;padding:8px 12px;margin-bottom:10px}
.crm-sel{max-width:150px}
.crm-table-wrap{overflow-x:auto;border:1px solid var(--line,#e2e8f0);border-radius:8px}
.crm-table{border-collapse:collapse;width:100%;min-width:1100px;font-size:12px}
.crm-table th,.crm-table td{padding:6px 8px;border-bottom:1px solid #eef1f5;text-align:left;vertical-align:top;white-space:nowrap}
.crm-table th{background:#f6f8fa;color:#57606a;font-weight:600;position:sticky;top:0}
.crm-table td.crm-text{white-space:normal;min-width:200px;max-width:320px}
.crm-table td.crm-center{text-align:center}
.crm-table td.crm-mono{font-family:Consolas,monospace}
.crm-table .crm-check{width:30px;text-align:center}
.crm-table .msg-op{margin-right:4px}
/* v2.24.10：客户信息手机端卡片式自适应布局 */
@media (max-width: 860px) {
  .crm-table-wrap{overflow:visible;border:none;background:transparent}
  .crm-table{min-width:0}
  .crm-table thead{display:none}
  .crm-table,.crm-table tbody,.crm-table tr,.crm-table td{display:block;width:100%}
  .crm-table tr{border:1px solid #e2e8f0;border-radius:12px;margin:12px 0;padding:4px 12px;background:#fff;box-shadow:0 1px 2px rgba(15,23,42,.05)}
  .crm-table td{display:flex;justify-content:space-between;gap:14px;padding:8px 2px;border-bottom:1px dashed #eef1f5;text-align:right;white-space:normal;word-break:break-word}
  .crm-table td:last-child{border-bottom:none}
  .crm-table td::before{content:attr(data-label);font-weight:600;color:#6b7280;text-align:left;flex:none;white-space:nowrap}
  .crm-table td.crm-check{justify-content:flex-start;padding-top:8px}
  .crm-table td.crm-check::before{content:""}
  .crm-table td.crm-text{white-space:normal}
  .crm-table .msg-op{margin:4px 6px 4px 0}
  .shared-toolbar{flex-wrap:wrap}
  .shared-toolbar .input{flex:1 1 150px;min-width:120px}
  .shared-btns{flex-wrap:wrap;width:100%}
  .shared-btns .btn{flex:1 1 auto}
  .seg-tabs{max-width:none;padding:12px 12px 0}
  .crm-stats{font-size:12px;line-height:1.6}
}
/* v2.24.1：好友信息表（3~4 列），不用客户表的 1100px 最小宽度，列紧凑排布 */
.fr-table{min-width:0;width:100%}
.fr-table th:nth-child(1),.fr-table td:nth-child(1){width:52px;text-align:center;color:#8c959f}
.fr-table td:nth-child(2){white-space:normal;word-break:break-all;max-width:60vw}
.fr-table td.crm-mono{color:#57606a}
/* 微信群成员：所在群多群多行显示（\n 分隔，pre-line 渲染换行） */
.fr-table td.fr-grp{white-space:pre-line;word-break:break-all;vertical-align:top;min-width:120px;max-width:42vw;line-height:1.5}
.crm-danger{color:#c2255c;border-color:#ffc9d4}
.crm-danger:hover{background:#ffe9ec}
.list-pane .admin-pane-desc{margin-bottom:8px}
.seg-tabs{margin-bottom:10px}
.admin-pane{background:#fff;border:1px solid var(--line,#e2e8f0);border-radius:10px;padding:12px;margin-bottom:12px}
.admin-pane-desc{font-size:12px;color:#8c959f;margin:0 0 10px}
.admin-pane .edit-label{display:flex;align-items:center;gap:8px;font-size:13px;color:#334155;margin:8px 0}
.admin-pane .edit-label input[type="number"],.admin-pane .edit-label .login-input{max-width:180px}
.admin-json{width:100%;box-sizing:border-box;font-family:Consolas,monospace;font-size:12px}
.admin-actions{display:flex;gap:10px;justify-content:flex-end;margin:6px 0 24px}
.kg-row{display:flex;align-items:center;gap:8px;margin-bottom:8px;flex-wrap:wrap}
.kg-row .kg-on{flex:none;width:18px;height:18px}
.kg-row .kg-name{width:130px;flex:none}
.kg-row .kg-words{flex:1;min-width:200px}
.kg-row .kg-del{flex:none;color:#c2255c}
.dev-row{border:1px solid var(--line,#e2e8f0);border-radius:8px;padding:8px 10px;margin-bottom:10px}
.dev-row .dev-id{font-size:12px;color:#334155;font-family:Consolas,monospace;word-break:break-all}
.dev-row .dev-stat{font-size:11px;flex-basis:100%}
.dev-row .dev-cfg{width:100%;box-sizing:border-box;font-family:Consolas,monospace;font-size:12px;margin-top:6px}
.bl-row .bl-wxid{font-size:13px;color:#1f1f1f;font-weight:600;word-break:break-all}
.user-row{border-left:3px solid #c7d7f5}
.user-row .login-input{padding:4px 8px;font-size:12px}
.user-row .btn.small{padding:3px 10px;font-size:12px}
.admin-pane .edit-label input[type="checkbox"]{width:16px;height:16px;margin-right:4px}
.msg-op.del{color:#c2255c}
.msg-op.del:not(:disabled):hover{background:#ffe9ec}
.msg-r3{display:flex;align-items:center;gap:10px;margin-top:6px;flex-wrap:wrap}
.msg-r3 .msg-time{font-size:12px;color:var(--muted)}
.msg-r3 .msg-phone{font-size:12px;color:#334155}
.msg-r3 .msg-kg{margin-left:auto}
.msg-body{margin-top:8px;font-size:14px;line-height:1.6;white-space:pre-wrap;word-break:break-word;max-height:200px;overflow:auto;cursor:pointer;border-radius:8px;padding:6px 8px;background:#f8fafc;border:1px dashed transparent}
.msg-body:hover{background:#eff6ff;border-color:#bfdbfe}
.msg-ops{display:flex;gap:6px;margin-top:10px;flex-wrap:wrap}
.msg-op{padding:6px 12px;border:1px solid var(--border);border-radius:8px;background:#fff;font-size:12px;color:var(--blue);cursor:pointer}
.msg-op:active{transform:translateY(1px)}
.msg-op:disabled{color:#94a3b8;background:#f1f5f9;cursor:not-allowed}
.msg-op.bl{color:var(--red);border-color:#fecaca;background:#fef2f2}
.msg-op.read{color:#15803d;border-color:#bbf7d0;background:#f0fdf4}

/* ============ 消息编辑弹窗 ============ */
.edit-label{display:block;font-size:13px;font-weight:600;color:var(--muted);margin:10px 0 4px}
.edit-textarea{min-height:120px;resize:vertical;line-height:1.6}

/* ============ 在线升级 ============ */
.upgrade-result{margin-top:12px;font-size:13px;line-height:1.8}
.up-ok{color:#15803d;font-weight:600;margin:0 0 4px}
.up-err{color:var(--red);font-weight:600;margin:6px 0 2px}
.up-list{margin:4px 0;padding-left:18px;color:#92400e;line-height:1.7;word-break:break-all}
.up-reload{margin-top:10px}
#upgradeFile{padding:8px 10px}

/* ============ 页面内确认弹窗（v2.24.11，替代原生 confirm） ============ */
.rc-confirm-mask{position:fixed;inset:0;background:rgba(15,23,42,.45);display:flex;align-items:center;justify-content:center;z-index:9999;padding:24px;animation:rcFadeIn .15s ease}
@keyframes rcFadeIn{from{opacity:0}to{opacity:1}}
.rc-confirm-box{background:#fff;border-radius:14px;max-width:320px;width:100%;box-shadow:0 12px 40px rgba(0,0,0,.22);overflow:hidden;animation:rcPop .15s ease}
@keyframes rcPop{from{transform:scale(.92);opacity:0}to{transform:scale(1);opacity:1}}
.rc-confirm-msg{padding:22px 20px 4px;font-size:14px;line-height:1.7;color:#1f2937;white-space:pre-wrap;word-break:break-word}
.rc-confirm-btns{display:flex;border-top:1px solid #e5e7eb;margin-top:14px}
.rc-confirm-btns button{flex:1;padding:13px 0;font-size:15px;border:0;background:#fff;color:#374151;cursor:pointer;font-family:inherit}
.rc-confirm-btns button:active{background:#f3f4f6}
.rc-btn-ok{color:#1d4ed8;font-weight:600;border-left:1px solid #e5e7eb}
