:root{
  --primary:#1656b4;
  --primary-weak:#e8f0fb;
  --accent:#0f9e8f;
  --danger:#d5483b;
  --text:#1a1f28;
  --text-sub:#6b7280;
  --line:#e8eaee;
  --bg:#f5f6f8;
  --card:#ffffff;
  --radius:14px;
  --shadow:0 1px 2px rgba(16,24,40,.04),0 6px 18px rgba(16,24,40,.06);
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;padding:0;height:100%}
body{
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Helvetica Neue","Microsoft YaHei",sans-serif;
  color:var(--text);background:var(--bg);font-size:15px;line-height:1.5;
  overscroll-behavior-y:none;
}
[hidden]{display:none!important}
.hidden{display:none!important}
button{font-family:inherit}

/* ---------- 登录 ---------- */
.login-wrap{
  min-height:100%;display:flex;align-items:center;justify-content:center;padding:24px;
  background:linear-gradient(160deg,#1656b4 0%,#0d3f8a 55%,#0a2f68 100%);
}
.login-card{
  width:100%;max-width:380px;background:#fff;border-radius:20px;padding:28px 22px 20px;
  box-shadow:0 20px 50px rgba(0,0,0,.25);
}
.brand{display:flex;align-items:center;gap:12px;margin-bottom:22px}
.brand-logo{
  width:48px;height:48px;border-radius:12px;background:var(--primary);color:#fff;
  display:flex;align-items:center;justify-content:center;font-size:22px;font-weight:700;
}
.brand h1{margin:0;font-size:20px;letter-spacing:.5px}
.brand p{margin:2px 0 0;font-size:12px;color:var(--text-sub)}
.field{display:block;margin-bottom:14px}
.field span{display:block;font-size:12px;color:var(--text-sub);margin-bottom:6px}
.field input,.field select,.field textarea{
  width:100%;border:1px solid var(--line);background:#fafbfc;border-radius:10px;
  padding:12px 14px;font-size:15px;color:var(--text);outline:none;transition:.15s;
}
.field input:focus,.field select:focus,.field textarea:focus{
  border-color:var(--primary);background:#fff;box-shadow:0 0 0 3px var(--primary-weak);
}
.field textarea{min-height:80px;resize:vertical}
.btn{
  border:none;border-radius:10px;padding:12px 18px;font-size:15px;font-weight:600;
  background:#eef1f5;color:var(--text);cursor:pointer;transition:.15s;
}
.btn:active{transform:scale(.98)}
.btn.primary{background:var(--primary);color:#fff}
.btn.ghost{background:#fff;border:1px solid var(--line)}
.btn.danger{background:#fdecea;color:var(--danger)}
.btn.block{display:block;width:100%;margin-top:6px}
.login-tip{font-size:11px;color:#98a2b3;text-align:center;margin:14px 0 0;line-height:1.6}

/* ---------- 框架 ---------- */
.app{display:flex;flex-direction:column;height:100%;max-width:720px;margin:0 auto;background:var(--bg)}
.topbar{
  position:sticky;top:0;z-index:10;background:#fff;border-bottom:1px solid var(--line);
  padding-top:env(safe-area-inset-top);flex:0 0 auto;
}
.topbar-inner{height:50px;display:flex;align-items:center;gap:6px;padding:0 10px}
.topbar-title{flex:1;font-size:16px;font-weight:600;text-align:center;margin-left:-38px}
.topbar-title.has-back{margin-left:0;text-align:left}
.icon-btn{
  width:36px;height:36px;border:none;background:transparent;border-radius:8px;color:var(--text);
  display:flex;align-items:center;justify-content:center;cursor:pointer;
}
.icon-btn svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:2}
.icon-btn:active{background:#f2f4f7}
.top-actions{display:flex;gap:8px;align-items:center;flex:0 0 auto}
.top-act{
  border:1px solid #dbe3ee;background:#fff;color:#1f4e8c;border-radius:9px;
  height:32px;padding:0 12px;font-size:13px;font-weight:600;cursor:pointer;white-space:nowrap;
}
.top-act:hover{background:#f4f8ff;border-color:#bcd2f2}
.top-act:active{background:#e9f1ff}
.imp-note{font-size:13px;color:#475569;line-height:1.7;background:#f6f8fc;border:1px solid #e6ebf5;border-radius:10px;padding:10px 12px}
.imp-acts{display:flex;gap:8px;margin-top:12px}
.imp-errs{margin-top:10px;max-height:210px;overflow:auto;font-size:12.5px;color:#8a2c2c;background:#fff5f5;border:1px solid #f5dada;border-radius:8px;padding:8px 10px;line-height:1.7}
.view{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:14px 14px 24px}
.tabbar{
  flex:0 0 auto;display:flex;background:#fff;border-top:1px solid var(--line);
  padding-bottom:env(safe-area-inset-bottom);
}
.tab{
  flex:1;border:none;background:transparent;padding:7px 0 9px;display:flex;flex-direction:column;
  align-items:center;gap:3px;color:#8b95a5;font-size:11px;cursor:pointer;
}
.tab svg{width:22px;height:22px;stroke:currentColor;fill:none;stroke-width:1.7}
.tab.active{color:var(--primary);font-weight:600}

/* ---------- 通用卡片 ---------- */
.card{background:var(--card);border-radius:var(--radius);padding:14px;box-shadow:var(--shadow);margin-bottom:12px}
.card-h{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.card-h strong{font-size:15px}
.card-h button{border:none;background:transparent;color:var(--primary);font-size:13px;cursor:pointer}
.img-acts{display:flex;align-items:center;gap:4px}
.card-h .img-tool{padding:3px 8px;border-radius:8px;color:#64748b;border:1px solid #e5e9f0;background:#fff;font-size:12px}
.card-h .img-tool:hover{color:#2563eb;border-color:#c7d2fe;background:#f8faff}
.muted{color:var(--text-sub);font-size:12px}
.row{display:flex;align-items:center;gap:8px}
.spacer{flex:1}

/* ---------- 工作台 ---------- */
.hero{
  background:linear-gradient(135deg,#1656b4,#0f3f8c);color:#fff;border-radius:16px;
  padding:18px;margin-bottom:12px;box-shadow:0 8px 24px rgba(22,86,180,.25);
}
.hero .who{font-size:13px;opacity:.85}
.hero .title{font-size:20px;font-weight:700;margin:4px 0 14px}
.hero-grid{display:flex;gap:10px}
.hero-grid div{flex:1;background:rgba(255,255,255,.14);border-radius:10px;padding:10px;cursor:pointer;transition:background .15s}
.hero-grid div:hover{background:rgba(255,255,255,.26)}
.hero-grid div::after{content:'查看 ›';float:right;font-size:10px;opacity:.6}
.hero-grid b{display:block;font-size:19px;font-weight:700}
.hero-grid span{font-size:11px;opacity:.85}
.stat-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin-bottom:12px}
.stat{background:#fff;border-radius:12px;padding:13px;box-shadow:var(--shadow);cursor:pointer;transition:transform .15s,box-shadow .15s;position:relative}
.stat:hover{transform:translateY(-2px);box-shadow:0 8px 20px rgba(20,40,80,.12)}
.stat::after{content:'›';position:absolute;right:12px;top:10px;color:#b9c3d4;font-size:15px}
.stat b{display:block;font-size:22px;font-weight:700;color:var(--primary)}
.stat span{font-size:12px;color:var(--text-sub)}
.quick{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-bottom:12px}
.quick button{
  background:#fff;border:none;border-radius:12px;padding:12px 4px;box-shadow:var(--shadow);
  display:flex;flex-direction:column;align-items:center;gap:6px;font-size:12px;color:var(--text);cursor:pointer;
}
.quick .qi{
  width:34px;height:34px;border-radius:10px;background:var(--primary-weak);color:var(--primary);
  display:flex;align-items:center;justify-content:center;font-size:17px;
}

/* ---------- 列表 ---------- */
.list-item{
  background:#fff;border-radius:12px;padding:13px;margin-bottom:10px;box-shadow:var(--shadow);
  cursor:pointer;
}
.list-item:active{background:#fafbfc}
.li-top{display:flex;align-items:center;gap:8px;margin-bottom:5px}
.li-title{font-size:15px;font-weight:600;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.li-price{color:#d9532b;font-weight:700;font-size:15px;white-space:nowrap}
.li-meta{font-size:12px;color:var(--text-sub);margin-top:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tag{
  display:inline-block;font-size:11px;padding:2px 7px;border-radius:6px;background:#f1f3f6;color:#5b6472;
  margin-right:4px;white-space:nowrap;
}
.tag.blue{background:var(--primary-weak);color:var(--primary)}
.tag.green{background:#e6f6f2;color:#0b7a6d}
.tag.orange{background:#fdf1e7;color:#b46a1c}
.tag.red{background:#fdecea;color:var(--danger)}
.jump{color:var(--primary);cursor:pointer;font-weight:600}
.jump:hover{text-decoration:underline}
.pager{display:flex;align-items:center;justify-content:center;gap:12px;padding:12px 0;font-size:13px;color:var(--text-sub)}
.pager button{border:1px solid var(--line);background:#fff;border-radius:8px;padding:7px 14px;font-size:13px}
.empty{text-align:center;color:#9aa4b2;font-size:13px;padding:44px 0}

/* ---------- 搜索栏 ---------- */
.searchbar{display:flex;gap:8px;margin-bottom:12px}
.searchbar input{
  flex:1;border:1px solid var(--line);border-radius:10px;padding:10px 12px;font-size:14px;
  background:#fff;outline:none;
}
.searchbar input:focus{border-color:var(--primary)}
.filters{display:flex;gap:6px;margin-bottom:12px;overflow-x:auto;padding-bottom:2px;scrollbar-width:none}
/* 搜索框下方这一行：左边是筛选 chip，右边是「新增」按钮 */
.filter-row{display:flex;align-items:flex-start;gap:10px;margin-bottom:12px}
.filter-row .filters{flex:1;min-width:0;margin-bottom:0}
.filter-row .add-right{flex:none;align-self:center;padding:8px 16px;white-space:nowrap;font-size:13px;box-shadow:0 4px 12px rgba(37,99,235,.18)}
.filter-row + .filters{margin-top:-4px}
.filters + .filters{margin-top:-6px}
.store-row{ display:flex;align-items:center;gap:8px;margin:-4px 0 12px;flex-wrap:wrap }
.store-row select{ padding:6px 10px;border:1px solid #e2e8f0;border-radius:9px;background:#fff;font-size:13px;color:#334155;max-width:190px }
/* 客源第二行：等级筛选 + 门店下拉 + 权限说明压在同一行，减少头部高度 */
#cLevels{flex-wrap:wrap;overflow-x:auto;align-items:center}
.level-tail{display:flex;align-items:center;gap:8px;margin-left:auto;padding-left:8px;flex-wrap:wrap;min-width:0}
.level-tail select{padding:6px 10px;border:1px solid #e2e8f0;border-radius:9px;background:#fff;font-size:13px;color:#334155;max-width:190px}
.level-tail .muted{font-size:12px;color:#94a3b8;white-space:nowrap}
@media (max-width:640px){.level-tail{margin-left:0}}
.filters::-webkit-scrollbar{display:none}
.chip{
  border:1px solid var(--line);background:#fff;border-radius:20px;padding:6px 13px;font-size:12.5px;
  color:#5b6472;white-space:nowrap;cursor:pointer;
}
.chip.on{background:var(--primary);border-color:var(--primary);color:#fff}

/* ---------- 详情 ---------- */
.detail-hero{background:#fff;border-radius:var(--radius);padding:16px;box-shadow:var(--shadow);margin-bottom:12px}
.detail-title{font-size:19px;font-weight:700;margin-bottom:6px}
.detail-price{font-size:22px;font-weight:700;color:#d9532b;margin-bottom:8px}
.kv{display:grid;grid-template-columns:82px 1fr;gap:6px 10px;font-size:13.5px;margin-top:10px}
.kv dt{color:var(--text-sub)}
.kv dd{margin:0;color:var(--text)}
.action-row{display:flex;gap:8px;margin:12px 0;flex-wrap:wrap}
.action-row .btn{flex:1 1 92px;min-width:92px}

/* 电话脱敏 */
.phone-cell{display:inline-flex;align-items:center;gap:6px;flex-wrap:wrap}
.phone-txt{font-variant-numeric:tabular-nums;letter-spacing:.4px;color:#8a93a3}
.phone-txt.revealed{color:#111;letter-spacing:0}
.phone-eye{border:0;background:#eaf1fd;color:#1656b4;border-radius:6px;padding:3px 9px;font-size:12px;cursor:pointer}
.phone-eye:hover{background:#dbe8fc}
.phone-eye:disabled{opacity:.6;cursor:default}
.mini-eye{border:0;background:rgba(255,255,255,.22);color:#fff;border-radius:6px;padding:2px 8px;font-size:11px;cursor:pointer;margin-left:6px;vertical-align:middle}
.mini-eye:hover{background:rgba(255,255,255,.35)}
.com-cell{display:flex;align-items:center}
.phone-logged{font-size:11px;color:#94a0b3}

/* 成交表单里的关键字选取器 */
.pick-list{max-height:168px;overflow:auto;border:1px solid #e3e8f2;border-radius:10px;margin-top:6px;background:#fff}
.pick-list[hidden]{display:none}
.pick-item{padding:8px 10px;font-size:13px;cursor:pointer;border-bottom:1px solid #f3f5f9}
.pick-item:last-child{border-bottom:0}
.pick-item:hover{background:#f2f6ff}
.pick-item.on{background:#e6efff;color:#1656b4;font-weight:600}

/* ---------- 内部聊天 ---------- */
.chat-contacts{display:flex;flex-direction:column;gap:2px}
.chat-contact{display:flex;gap:10px;padding:10px 8px;border-radius:10px;cursor:pointer}
.chat-contact:hover{background:#f3f7ff}
.avatar{width:38px;height:38px;border-radius:50%;background:#1656b4;color:#fff;display:flex;align-items:center;justify-content:center;font-size:16px;flex:0 0 auto}
.avatar.group{background:linear-gradient(135deg,#1656b4,#3a86e0);font-size:18px}
.cc-tag{background:#eef3fb;color:#5a6b86;border-radius:6px;font-size:11px;padding:1px 6px}
.msg-from{font-size:11px;color:#8b95a5;margin:0 0 3px 4px}
.cc-main{flex:1;min-width:0}
.cc-top{display:flex;align-items:center;gap:8px}
.cc-name{font-size:15px;font-weight:600}
.cc-last{font-size:12px;color:#8b95a5;margin-top:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.badge{background:#e5484d;color:#fff;border-radius:10px;font-size:11px;padding:1px 6px;font-weight:600}
.nav-badge{position:absolute;background:#e5484d;color:#fff;border-radius:9px;
  font-size:10px;line-height:1;padding:3px 5px;font-style:normal;min-width:16px;text-align:center}
@media (min-width:960px){.nav-badge{left:44px;top:9px}}
@media (max-width:959px){.nav-badge{left:50%;top:3px;transform:translateX(6px)}}
.tab{position:relative}
.chat-head{display:flex;align-items:center;gap:10px;padding:10px 12px;background:#fff;border-radius:12px;
  box-shadow:var(--shadow);margin-bottom:10px}
.chat-body{display:flex;flex-direction:column;gap:10px;padding:2px 2px 12px;
  min-height:calc(100vh - 280px);justify-content:flex-start}
.msg{display:flex;flex-direction:column;max-width:80%}
.msg.mine{align-self:flex-end;align-items:flex-end}
.msg.theirs{align-self:flex-start;align-items:flex-start}
.bubble{background:#fff;border-radius:12px;padding:9px 12px;font-size:14px;box-shadow:var(--shadow);word-break:break-word;max-width:100%}
.msg.mine .bubble{background:#1656b4;color:#fff}
.msg-time{font-size:11px;color:#9aa3b2;margin-top:3px}
.chat-img{max-width:220px;max-height:220px;border-radius:8px;display:block;cursor:zoom-in;object-fit:cover}
.chat-file{display:inline-flex;align-items:center;gap:6px;color:inherit;text-decoration:none;font-size:13px;max-width:100%}
.chat-file span:nth-child(2){overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:160px}
.msg.mine .chat-file .muted{color:#d5e3fa}
.share-card{border:1px solid #e3e8f2;border-radius:10px;padding:8px 10px;background:#f8faff;color:#1f2430;
  font-size:13px;cursor:pointer;min-width:190px}
.msg.mine .share-card{background:#fff;color:#1f2430}
.sc-tag{display:inline-block;background:#e6efff;color:#1656b4;border-radius:6px;font-size:11px;padding:1px 6px;margin-right:6px}
.chat-input{display:flex;align-items:center;gap:6px;position:static;background:#fff;padding:8px;
  border-radius:12px;box-shadow:var(--shadow)}
.chat-input input[type=text]{flex:1;border:1px solid var(--line);border-radius:10px;padding:9px 11px;font-size:14px;min-width:0;outline:none}
.chat-input input[type=text]:focus{border-color:#9dbaf0}
.chat-tool{border:none;background:#f1f4fa;border-radius:9px;width:36px;height:36px;font-size:16px;cursor:pointer;flex:0 0 auto}
.chat-tool:hover{background:#e4ebf8}
.chat-tool.on{background:#e6efff;box-shadow:inset 0 0 0 1px #c7dbfa}

/* 输入区固定在窗口底部（吸底），保证任何滚动位置都能点到；表情面板在输入框上方展开 */
.chat-foot{position:fixed;left:0;right:0;bottom:0;z-index:60;padding:8px 14px 10px;
  background:linear-gradient(to top,#fff 78%,rgba(255,255,255,.92))}
.chat-foot-inner{max-width:1120px;margin:0 auto}
@media (min-width:960px){
  .chat-foot{left:236px}
  .chat-foot-inner{padding:0 24px}
}
@media (max-width:959px){
  .chat-foot{bottom:calc(52px + env(safe-area-inset-bottom))}
  .chat-foot-inner{max-width:720px}
}
.chat-body{padding-bottom:104px}
@media (max-width:959px){ .chat-body{padding-bottom:120px} }
.emoji-panel{background:#fff;border:1px solid #e3e8f2;border-radius:12px;box-shadow:0 8px 24px rgba(22,48,92,.10);
  padding:8px;margin-bottom:6px}
.emoji-panel[hidden]{display:none}
.emoji-tabs{display:flex;gap:6px;margin-bottom:6px}
.emoji-tab{border:0;background:#f1f4fa;color:#5a6b86;border-radius:8px;font-size:12px;padding:4px 10px;cursor:pointer}
.emoji-tab.on{background:#e6efff;color:#1656b4;font-weight:600}
.emoji-grid{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));gap:2px;max-height:180px;overflow:auto}
.emoji-btn{border:0;background:transparent;font-size:20px;line-height:1.15;padding:5px 0;border-radius:8px;cursor:pointer;
  font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif}
.emoji-btn:hover{background:#f1f4fa}
.emoji-del{font-size:16px;color:#6b7a90}
@media (max-width:640px){.emoji-grid{grid-template-columns:repeat(8,minmax(0,1fr))}}
.timeline{position:relative;padding-left:16px;margin-top:6px}
.timeline::before{content:"";position:absolute;left:4px;top:4px;bottom:4px;width:2px;background:var(--line)}
.tl-item{position:relative;padding:0 0 14px 8px}
.tl-item::before{
  content:"";position:absolute;left:-16px;top:4px;width:10px;height:10px;border-radius:50%;
  background:var(--primary);border:2px solid #fff;box-shadow:0 0 0 2px var(--primary-weak);
}
.tl-item .t{font-size:12px;color:var(--text-sub)}
.tl-item .c{font-size:13.5px;margin-top:2px}
/* 详情卡片：默认显示前 10 条，多的「查看全部」就地展开 */
.more-btn{padding:4px 10px;border-radius:8px;border:1px solid #e5e9f0;background:#fff;color:#2563eb;font-size:12px;line-height:1.4}
.more-btn:hover{background:#f5f8ff;border-color:#c7d2fe}
.card-h .more-btn{margin-left:auto}
.pg-i{display:block}
/* 系统操作记录（灰点 + 浅底）：跟手写的跟进区分开，删掉的照片带缩略图可点开 */
.tl-item.op::before{background:#9aa7b8;box-shadow:0 0 0 2px #eef1f6}
.tl-item.op{padding-bottom:12px}
.tl-item.op .t{color:#6b7a90}
.tl-item.op .c{color:#4b5563;font-size:13px;background:#f7f9fc;border:1px solid #eef1f6;border-radius:8px;padding:6px 9px;margin-top:4px;display:block;max-width:100%;word-break:break-all}
.op-ic{margin-right:3px}
.op-thumb{display:block;width:96px;margin-top:6px;border:1px solid var(--line);border-radius:8px;overflow:hidden;cursor:pointer;background:#fff;line-height:0;box-shadow:0 1px 2px rgba(16,24,40,.06)}
.op-thumb img{width:96px;height:72px;object-fit:cover;display:block}
.op-thumb:hover img{opacity:.85}
.op-thumb.is-video{width:96px;height:72px;display:flex;align-items:center;justify-content:center;background:#111827;color:#fff;font-size:13px;line-height:1}

/* ---------- Sheet ---------- */
.sheet-mask{
  position:fixed;inset:0;background:rgba(16,24,40,.45);z-index:460;display:flex;align-items:flex-end;
  justify-content:center;animation:fade .18s ease;
}
@keyframes fade{from{opacity:0}to{opacity:1}}
.sheet{
  width:100%;max-width:720px;max-height:88vh;background:#fff;border-radius:16px 16px 0 0;
  display:flex;flex-direction:column;animation:up .22s cubic-bezier(.2,.8,.2,1);
  box-shadow:0 -12px 40px rgba(16,32,64,.18);will-change:transform;
}
.sheet.dragging{box-shadow:0 22px 60px rgba(16,32,64,.32);transition:none!important}
@keyframes up{from{transform:translateY(40px);opacity:.6}to{transform:translateY(0);opacity:1}}
.sheet-head{
  display:flex;align-items:center;justify-content:space-between;padding:14px 16px;
  border-bottom:1px solid var(--line);flex:0 0 auto;
  cursor:move;user-select:none;touch-action:none;border-radius:16px 16px 0 0;
}
.sheet-head:hover{background:#f7faff}
.sheet-grip{color:#9aa6b8;font-size:11px;margin-right:6px;letter-spacing:1px;flex:0 0 auto}
.sheet-head strong{flex:1 1 auto}
.sheet-body{padding:16px;overflow-y:auto;padding-bottom:calc(16px + env(safe-area-inset-bottom))}
.two-col{display:grid;grid-template-columns:1fr 1fr;gap:10px}

/* ---------- toast ---------- */
.toast{
  position:fixed;left:50%;bottom:88px;transform:translateX(-50%);background:rgba(26,31,40,.92);
  color:#fff;font-size:13.5px;padding:9px 16px;border-radius:20px;z-index:520;max-width:80%;
  text-align:center;animation:fade .2s ease;
}

@media (min-width:640px){
  .app{border-left:1px solid var(--line);border-right:1px solid var(--line);min-height:100vh}
  .stat-grid{grid-template-columns:repeat(4,1fr)}
}

/* ---------- 房源图片 ---------- */
.img-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:10px;margin-top:6px}
.img-cell{position:relative;border-radius:12px;overflow:hidden;background:#f1f5f9;aspect-ratio:1/1;
  border:1px solid #eceff3;box-shadow:0 1px 3px rgba(15,23,42,.06);transition:box-shadow .18s,border-color .18s}
.img-cell:hover{box-shadow:0 8px 20px rgba(15,23,42,.12);border-color:#dbe3ec}
.img-cell img{width:100%;height:100%;object-fit:cover;display:block;cursor:zoom-in;transition:transform .25s}
.img-cell:hover img{transform:scale(1.04)}
.img-cell::after{content:"点击查看";position:absolute;left:0;right:0;bottom:0;padding:16px 8px 6px;
  font-size:11px;color:#fff;background:linear-gradient(transparent,rgba(15,23,42,.6));
  opacity:0;transition:opacity .2s;pointer-events:none}
.img-cell:hover::after{opacity:1}
.img-del{
  position:absolute;top:6px;right:6px;width:26px;height:26px;border:0;border-radius:50%;
  background:rgba(255,255,255,.92);color:#dc2626;font-size:17px;font-weight:600;
  line-height:25px;text-align:center;cursor:pointer;z-index:3;
  box-shadow:0 2px 8px rgba(15,23,42,.22);backdrop-filter:blur(4px);transition:.15s;
}
.img-del:hover{background:#dc2626;color:#fff}

/* ---------- 图片删除 / 排序弹窗 ---------- */
.pick-list{max-height:46vh;overflow:auto;border:1px solid #eef1f5;border-radius:10px;background:#fbfcfe}
.pick-row{display:flex;align-items:center;gap:10px;padding:8px 10px;border-bottom:1px solid #f1f4f8;cursor:pointer}
.pick-row:last-child{border-bottom:none}
.pick-row:hover{background:#f5f8ff}
.pick-row input[type=checkbox]{width:17px;height:17px;accent-color:#2563eb;flex:0 0 auto}
.pick-ph{width:44px;height:44px;border-radius:8px;overflow:hidden;background:#eef2f7;display:flex;align-items:center;justify-content:center;font-size:18px;flex:0 0 auto}
.pick-ph img{width:100%;height:100%;object-fit:cover;display:block}
.pick-name{flex:1;font-size:13px;color:#334155;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pick-kind{font-size:11px;color:#94a3b8;flex:0 0 auto}
.pick-no{width:18px;font-size:12px;color:#94a3b8;text-align:center;flex:0 0 auto}
.pick-mv{display:flex;gap:6px;flex:0 0 auto}
.pick-mv .mv{width:28px;height:28px;border-radius:8px;border:1px solid #e5e9f0;background:#fff;color:#475569;font-size:13px;cursor:pointer}
.pick-mv .mv:hover:not(:disabled){border-color:#c7d2fe;color:#2563eb}
.pick-mv .mv:disabled{opacity:.35;cursor:default}

/* ---------- 合同附件（合同照片 / PDF） ---------- */
.doc-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:10px;margin-top:4px}
.doc-cell{position:relative;border:1px solid #eef1f5;border-radius:10px;overflow:hidden;background:#f8fafc;cursor:zoom-in}
.doc-cell img{width:100%;height:130px;object-fit:cover;display:block}
.doc-cell.is-pdf{cursor:pointer;background:#fff}
.doc-pdf{height:130px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;
  font-size:26px;color:#64748b;background:#f1f5f9}
.doc-pdf span{font-size:12px;color:#64748b;max-width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.doc-name{font-size:12px;color:#64748b;padding:5px 7px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-top:1px solid #f1f5f9}
.lightbox{
  position:fixed;inset:0;z-index:120;background:rgba(0,0,0,.92);
  display:flex;align-items:center;justify-content:center;padding:16px;
}
.lightbox img{max-width:100%;max-height:100%;object-fit:contain;border-radius:10px;box-shadow:0 8px 30px rgba(0,0,0,.5)}
.lb-close{
  position:absolute;top:16px;right:16px;width:38px;height:38px;border:0;border-radius:50%;
  background:rgba(255,255,255,.18);color:#fff;font-size:20px;line-height:1;cursor:pointer;
}

/* ---------- 桌面 / 网页宽屏布局 ---------- */
.brand-logo-img{width:48px;height:48px;border-radius:12px;object-fit:cover;display:block}
.side-brand{display:none}

@media (min-width:960px){
  body{background:#eef1f6}
  .app{max-width:none;margin:0;padding-left:236px}
  .side-brand{
    display:flex;position:fixed;left:0;top:0;width:236px;height:78px;z-index:20;
    align-items:center;gap:10px;padding:0 18px;background:#fff;border-bottom:1px solid var(--line);
  }
  .side-brand img{width:34px;height:34px;border-radius:9px;display:block}
  .side-brand strong{display:block;font-size:17px;letter-spacing:.5px;line-height:1.25}
  .side-brand span{display:block;font-size:11px;color:var(--text-sub)}
  .tabbar{
    position:fixed;left:0;top:78px;bottom:0;width:236px;flex-direction:column;justify-content:flex-start;
    gap:2px;padding:12px 10px;background:#fff;border-top:none;border-right:1px solid var(--line);z-index:15;
  }
  .tab{
    flex:none;flex-direction:row;justify-content:flex-start;gap:12px;padding:12px 14px;
    border-radius:10px;font-size:14px;color:#4b5563;
  }
  .tab svg{width:19px;height:19px}
  .tab:hover{background:#f6f8fc}
  .tab.active{background:var(--primary-weak);color:var(--primary);font-weight:600}
  .topbar-inner{height:58px;padding:0 22px}
  .topbar-title{margin-left:0;text-align:left;font-size:18px}
  .view{padding:20px 24px 60px}
  .view > *{max-width:1120px;margin-left:auto;margin-right:auto}
  .login-card{max-width:400px;padding:34px 28px 24px}
}

@media (min-width:1280px){
  .view > *{max-width:1280px}
  .view .list-item{padding:16px 18px}
  .view .li-title{font-size:16px}
}

/* ---------- 公海客户池 ---------- */
.chip-num{display:inline-block;min-width:18px;padding:0 5px;margin-left:2px;border-radius:9px;background:#e11d48;color:#fff;font-size:11px;font-weight:600;line-height:16px;text-align:center;font-variant-numeric:tabular-nums}
.chip.on .chip-num{background:#fff;color:#e11d48}
.pool-item{border-left:3px solid #38bdf8}
.pool-row{display:flex;align-items:center;gap:10px;margin-top:8px;padding-top:8px;border-top:1px dashed #e2e8f0}
.sub-h{margin:14px 0 8px;font-size:13px;font-weight:600;color:#334155;padding-left:8px;border-left:3px solid #2563eb}

/* ---------- 宽屏：房源/客源统一「一列一条」列表，一屏多看几条，不做并排卡片 ---------- */
@media (min-width:1100px){
  #hList, #cList{display:block}
  #hList > .list-item, #cList > .list-item{margin-bottom:10px}
  .view .list-item{padding:12px 16px}
  .li-top{margin-bottom:2px}
}
.list-item{transition:transform .15s,box-shadow .15s}
@media (hover:hover){
  .list-item:hover{transform:translateY(-1px);box-shadow:0 9px 22px rgba(20,40,80,.10)}
}
.li-price,.stat b,.hero-grid b,.kv2 .vv{font-variant-numeric:tabular-nums}

@media (max-width:959px){
  .chat-body{min-height:calc(100vh - 320px)}
}

/* ---------- 房源详情：两排信息 + 分区卡片 ---------- */
.kv2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin-top:12px}
.kv2 .it{background:#f7f9fc;border:1px solid #eef1f6;border-radius:9px;padding:7px 10px;min-width:0}
.kv2 .lb{font-size:11.5px;color:var(--text-sub);margin-bottom:2px}
.kv2 .vv{font-size:13.5px;color:var(--text);word-break:break-all;line-height:1.45}
@media (min-width:700px){ .kv2{grid-template-columns:repeat(4,minmax(0,1fr))} }

.room-wrap{display:inline-flex;align-items:center;gap:6px;cursor:pointer;user-select:none}
.room-mask{letter-spacing:2px;color:#9aa4b2}
.mini-eye2{background:#eaf1fd;color:#1656b4;border-radius:6px;padding:1px 7px;font-size:12px;line-height:1.5}

.mini-cards{display:grid;grid-template-columns:1fr;gap:8px;margin-top:4px}
.mini-cards .mini-card.full{grid-column:1/-1}
@media (min-width:700px){ .mini-cards{grid-template-columns:repeat(2,minmax(0,1fr))} }
.mini-card{border:1px solid #eef1f6;background:#fbfcfe;border-radius:10px;padding:9px 12px;min-width:0}
.mini-card .lb{font-size:11.5px;color:var(--text-sub);margin-bottom:3px}
.mini-card .vv{font-size:13.5px;line-height:1.55;word-break:break-word;white-space:pre-wrap}

/* 视频缩略 */
.img-cell.is-video video{width:100%;height:100%;object-fit:cover;display:block;background:#000;cursor:zoom-in}
.play-badge{
  position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);
  width:34px;height:34px;border-radius:50%;background:rgba(0,0,0,.55);color:#fff;
  display:flex;align-items:center;justify-content:center;font-size:15px;pointer-events:none;
}

/* 画廊灯箱 */
.lb-stage{max-width:100%;max-height:100%;display:flex;align-items:center;justify-content:center}
.lb-stage video{max-width:100%;max-height:82vh;border-radius:10px;background:#000}
.lb-nav{
  position:absolute;top:50%;transform:translateY(-50%);width:42px;height:64px;border:0;border-radius:10px;
  background:rgba(255,255,255,.16);color:#fff;font-size:30px;line-height:1;cursor:pointer;
}
.lb-nav:hover{background:rgba(255,255,255,.3)}
.lb-nav.prev{left:10px}
.lb-nav.next{right:10px}
.lb-count{position:absolute;bottom:16px;left:50%;transform:translateX(-50%);color:#dfe3ea;font-size:12px}

/* ---------- 成交台账：每月成交情况 ---------- */
.m-title{display:flex;align-items:center;gap:8px;margin:12px 0 6px;font-size:13px;font-weight:600}
.m-title .muted{font-weight:400;font-size:11.5px}
.m-list{border:1px solid #eef1f6;border-radius:10px;overflow:hidden}
.m-row{display:flex;align-items:center;gap:10px;padding:8px 11px;font-size:13px;cursor:pointer;
  border-bottom:1px solid #f3f4f6;flex-wrap:wrap}
.m-row:last-child{border-bottom:0}
.m-row:hover{background:#f7faff}
.m-row.on{background:#eaf1fd}
.m-row b{min-width:88px}
.m-row .muted{margin-right:auto}
.m-row span:not(.muted){color:#5b6472;white-space:nowrap;font-variant-numeric:tabular-nums}

/* ---------- 合同模板 ---------- */
.contract-page{background:#fff;padding:30px 34px;border-radius:10px;box-shadow:0 1px 3px rgba(0,0,0,.06);
  color:#1f2430;line-height:1.95}
.contract-page h1{text-align:center;font-size:22px;letter-spacing:4px;margin:4px 0 16px}
.contract-page h2{font-size:14px;color:#1656b4;margin:16px 0 4px}
.contract-page p{font-size:14px;margin:5px 0}
.ct-no{text-align:right;color:#8a93a3;font-size:12px;margin-bottom:10px}
.ct-sign{display:flex;gap:16px;justify-content:space-between;margin-top:36px;font-size:13px;line-height:2.1}
@media print{
  .side-brand,.topbar,.tabbar,.no-print,.scroll-top,.float-avatar{display:none!important}
  .app{max-width:none;background:#fff}
  .view{padding:0;overflow:visible}
  .contract-page{box-shadow:none;border-radius:0;padding:0}
  body{background:#fff}
}

/* ---------- 房源浮窗（可拖动） ---------- */
.float-win {
  position: fixed;
  z-index: 80;
  height: min(74vh, 720px);
  max-width: calc(100vw - 24px);
  background: #fff;
  border: 1px solid #e4eaf4;
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(16, 32, 64, .22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.fw-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 12px;
  background: #f6f8fd;
  border-bottom: 1px solid #e8eef6;
  cursor: move;
  user-select: none;
  flex: 0 0 auto;
}
.fw-bar strong { font-size: 14px; color: #1b2735; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fw-acts { display: flex; gap: 6px; flex: 0 0 auto; }
.fw-acts button {
  border: 0; background: #eaf0fa; color: #33415c; border-radius: 8px;
  padding: 4px 10px; font-size: 12px; cursor: pointer;
}
.fw-acts button:hover { background: #dfe8f8; }
.fw-body { flex: 1 1 auto; overflow: auto; padding: 12px 14px 22px; }

/* ---------- 列表里的成交客户信息 ---------- */
.li-deals { margin-top: 9px; border-top: 1px dashed #e7ecf5; padding-top: 7px; display: grid; gap: 5px; }
.li-deal {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 12px; color: #4a5a72;
  background: #f7faff; border-radius: 8px; padding: 5px 8px;
}
.li-deal-name { font-weight: 600; color: #1b2735; }

/* ---------- 操作日志浮窗（可拖动、盖在最上层） ---------- */
.ops-win { z-index: 420; height: auto; max-height: min(70vh, 640px); }
.ops-win .fw-body { padding: 4px 14px 16px; }

@media (max-width: 700px) {
  .float-win { left: 8px !important; top: 56px !important; width: calc(100vw - 16px) !important; height: calc(100vh - 120px) !important; }
}

/* 房源搜索旁的区域筛选 */
.district-select{
  padding:0 10px;height:42px;border:1px solid #e5e7eb;border-radius:10px;
  background:#fff;color:#334155;font-size:14px;min-width:118px;cursor:pointer;
}
.district-select:focus{outline:none;border-color:#93c5fd;box-shadow:0 0 0 3px rgba(147,197,253,.25)}

/* ---------- 封盘房源 ---------- */
.list-item.sealed{background:#fffdf0;border-color:#f2d783;box-shadow:inset 4px 0 0 #f0b429}
.list-item.sealed:hover{background:#fff8e1}
.tag.sealed-tag{background:#fff3cd;color:#8a5b00;border-color:#f0c14b;font-weight:600}
.seal-banner{background:#fff8e1;border:1px solid #f0c14b;color:#8a5b00;border-radius:12px;padding:10px 14px;margin-bottom:10px;font-size:13.5px;line-height:1.8}
.seal-banner .sb-meta{display:block;color:#9a7a2a;font-size:12px}
.seal-neg{background:#f7faff;border:1px dashed #cfe0f7;border-radius:10px;padding:10px 12px;font-size:13px;line-height:2;margin-bottom:12px}
.seal-neg.warn{background:#fff8e1;border-color:#f0c14b;color:#8a5b00}

/* 操作日志 / 电话查看记录：固定显示 5 行，超出在框内上下滚动 */
.scroll-rows {
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-right: 4px;
  border: 1px solid #eef1f5;
  border-radius: 10px;
  background: #fcfdfe;
  padding-left: 8px;
  scrollbar-width: thin;
}
.scroll-rows::-webkit-scrollbar { width: 6px; }
.scroll-rows::-webkit-scrollbar-thumb { background: #d5dbe3; border-radius: 3px; }
.scroll-rows::-webkit-scrollbar-track { background: transparent; }

/* 跟进/操作时间线也做 5 行框内滚动：保留圆点、去掉固定竖线，加大左边距 */
.timeline.scroll-rows { padding-left: 22px; padding-bottom: 8px; }
.timeline.scroll-rows::before { display: none; }

/* 成交/带看记录：去掉内框，只保留框内滚动（条目自带分隔线） */
.list-scroll.scroll-rows { border: 0; background: transparent; padding: 0 2px 0 0; border-radius: 0; }

/* 房源页筛选说明小字 */
.hint-line { font-size: 12px; color: var(--text-sub); margin: 2px 0 10px; line-height: 1.6; }

/* 成交台账：月份列表里没业绩的月变淡 */
.m-row.m-zero { opacity: .55; }

/* 经纪人排行榜 */
.rank-list.scroll-rows { border: 0; background: transparent; padding: 0 2px 0 0; border-radius: 0; }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f3f4f6; }
.rank-row:last-child { border-bottom: 0; }
.rank-row .rk { width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%; background: #eef1f6;
  color: #6b7a90; font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.rank-row .rk1 { background: #fff1d6; color: #b26b00; }
.rank-row .rk2 { background: #eef2f7; color: #54657c; }
.rank-row .rk3 { background: #fdeee2; color: #a2541f; }
.rank-row .rk-name { flex: 1; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .rk-amt { font-size: 14px; font-weight: 600; color: #1656b4; }
.rank-row .rk-n { font-size: 12px; }

/* 每月成交情况：月份下拉筛选 */
.m-select { margin-left: auto; height: 26px; font-size: 12px; border: 1px solid #e5e9f0;
  border-radius: 8px; padding: 0 6px; background: #fff; color: #374151; max-width: 132px; }

/* 经纪人排行榜：日/月/季/年榜切换 */
.rank-tabs { display: flex; align-items: center; gap: 6px; margin: 2px 0 8px; flex-wrap: wrap; }
.rank-tab { padding: 4px 10px; border-radius: 999px; border: 1px solid #e5e9f0; background: #fff;
  color: #54657c; font-size: 12px; line-height: 1.5; cursor: pointer; }
.rank-tab:hover { border-color: #c7d2fe; color: #1656b4; }
.rank-tab.on { background: #1656b4; border-color: #1656b4; color: #fff; }
.rank-tabs .rk-scope { margin-left: auto; font-size: 11.5px; }

/* 成交台账：顶部年月筛选下拉 */
.mini-select { height: 34px; font-size: 13px; border: 1px solid #e5e9f0; border-radius: 10px;
  padding: 0 8px; background: #fff; color: #374151; }

/* ---------- 房源页：新房 / 二手房 板块（一级） ---------- */
.kind-switch{display:flex;gap:8px;margin-bottom:10px}
.kind-switch .kind-btn{
  flex:1;border:1px solid var(--line);background:#fff;border-radius:12px;padding:11px 0;
  font-size:15px;font-weight:600;color:#48505d;cursor:pointer;transition:all .15s;box-shadow:var(--shadow);
}
.kind-switch .kind-btn.on{background:var(--primary);border-color:var(--primary);color:#fff;box-shadow:0 6px 16px rgba(22,86,180,.22)}
.kind-switch .kind-btn.on::after{content:"";display:block;width:22px;height:2px;background:rgba(255,255,255,.85);margin:5px auto 0;border-radius:2px}

/* 整页模式（/?house=xx）：一个标签页只专注这一套房，隐藏左侧品牌栏与站点边线 */
.solo-mode .app{padding-left:0!important;max-width:none;border:0}
.solo-mode .side-brand{display:none!important}

/* ---------- 重点关注客户：整条卡片蓝色 ---------- */
.list-item.star{
  background:linear-gradient(180deg,#eef5ff,#e4eefc);
  border:1px solid #bcd2ef;
  box-shadow:inset 4px 0 0 var(--primary), 0 6px 16px rgba(22,86,180,.10);
}
.list-item.star:hover{background:linear-gradient(180deg,#e7f0fd,#dbe8fa)}
.list-item.star .li-title{color:#0f3f86}
.li-star{
  border:0;background:transparent;cursor:pointer;padding:0 1px;margin-right:2px;
  font-size:17px;line-height:1;color:#c3cad6;transition:transform .12s,color .12s;
}
.li-star:hover{transform:scale(1.15);color:#f0a020}
.li-star.on{color:#f0a020}
.tag.star-tag{background:var(--primary);color:#fff;font-weight:600}
.check-line{
  display:flex;align-items:center;gap:9px;margin:12px 0 2px;padding:10px 12px;
  background:var(--primary-weak);border:1px solid #cfe0f7;border-radius:10px;
  font-size:13.5px;color:#12386f;cursor:pointer;
}
.check-line input{width:18px;height:18px;accent-color:var(--primary);cursor:pointer}

/* ---------- 登录验证码 / 登录设备 ---------- */
.cap-row{display:flex;gap:10px;align-items:stretch}
.cap-row input{flex:1;min-width:0}
.cap-img{
  flex:0 0 auto;padding:0 4px;border:1px solid var(--line);border-radius:10px;
  background:#f4f7fb;cursor:pointer;display:flex;align-items:center;justify-content:center;
  overflow:hidden;transition:border-color .15s;
}
.cap-img:hover{border-color:#9db8dd}
.cap-img svg{display:block;height:42px;width:auto}
.sess-list{display:flex;flex-direction:column;gap:9px}
.sess-item{
  border:1px solid var(--line);border-radius:11px;padding:10px 12px;background:#fff;
}
.sess-item.cur{background:#f2f7ff;border-color:#c3d8fb}
.sess-top{display:flex;align-items:center;gap:7px;margin-bottom:4px;font-size:14px}
.sess-meta{font-size:12px;color:var(--text-sub);line-height:1.65}
.sess-kick{margin-top:7px;padding:4px 12px;font-size:12px}
