/* ===========================================================
   wa-sync 控制台样式
   设计令牌 → 基础 → 控件 → 布局 → 各页组件 → 响应式
   =========================================================== */

:root{
  /* 品牌与语义 */
  --green:#0f7a6b; --green-d:#0b6154; --green-soft:#e6f4f1; --green-line:#bfe0da;
  --red:#b42318; --red-soft:#fdecea;
  --amber:#9a5b00; --amber-soft:#fdf2df;
  --blue:#1b5c94; --blue-soft:#e6f0fa;
  --purple:#5a2d9e; --purple-soft:#f0e9fc;

  /* 中性色 */
  --bg:#f4f6f7; --panel:#fff; --panel-2:#fafbfb;
  --line:#e4e7ea; --line-soft:#eff1f3;
  --ink:#132024; --ink-2:#3c4a51; --muted:#697d86; --muted-2:#93a4ac;

  /* 形状与阴影 */
  --r-xs:6px; --r-sm:8px; --r-md:10px; --r-lg:12px;
  --sh-1:0 1px 2px rgba(16,32,38,.05);
  --sh-2:0 1px 2px rgba(16,32,38,.05), 0 4px 14px rgba(16,32,38,.05);
  --sh-3:0 10px 32px rgba(16,32,38,.14);
  --ring:0 0 0 3px rgba(15,122,107,.14);
  --ctl-h:34px;
}

*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{
  background:var(--bg); color:var(--ink);
  font:14px/1.55 -apple-system,BlinkMacSystemFont,"PingFang SC","Noto Sans CJK SC","Segoe UI",system-ui,sans-serif;
  -webkit-font-smoothing:antialiased;
}
::selection{background:rgba(15,122,107,.16)}

/* 细滚动条 */
*{scrollbar-width:thin;scrollbar-color:#c9d2d6 transparent}
*::-webkit-scrollbar{width:9px;height:9px}
*::-webkit-scrollbar-thumb{background:#ccd4d8;border-radius:6px;border:2px solid transparent;background-clip:content-box}
*::-webkit-scrollbar-thumb:hover{background:#b3bfc5;background-clip:content-box;border:2px solid transparent}
*::-webkit-scrollbar-track{background:transparent}

/* ---------------- 顶栏 ---------------- */
.top{
  display:flex;align-items:center;gap:14px;padding:10px 20px;
  background:rgba(255,255,255,.92); backdrop-filter:saturate(180%) blur(12px);
  border-bottom:1px solid var(--line); position:sticky;top:0;z-index:9;
}
.brand{display:flex;align-items:center;gap:9px;min-width:0}
/* 状态点：小圆点 + 白环 + 一圈柔光，克制不抢视线 */
.dot{
  width:9px;height:9px;border-radius:50%;flex:none;
  background:radial-gradient(circle at 35% 30%,#2fb7a0,#0d7060);
  box-shadow:0 0 0 2px #fff, 0 0 0 4px rgba(15,122,107,.14), 0 1px 2px rgba(11,97,84,.25);
  margin:0 3px 0 2px;
}
.brand h1{font-size:14px;margin:0;font-weight:650;letter-spacing:.1px;white-space:nowrap;
  max-width:34vw;overflow:hidden;text-overflow:ellipsis}
.badge{
  font-size:11.5px;color:var(--ink-2);background:var(--panel-2);
  border:1px solid var(--line);border-radius:999px;padding:2px 9px;white-space:nowrap;
  max-width:280px;overflow:hidden;text-overflow:ellipsis;
}
.badge::before{content:"";display:inline-block;width:5px;height:5px;border-radius:50%;
  background:var(--green);margin-right:6px;vertical-align:1.5px}

.tabs{
  display:flex;gap:2px;margin-left:auto;padding:3px;
  background:#f0f3f4;border:1px solid var(--line);border-radius:11px;
}
.tabs button{
  border:0;background:transparent;padding:6px 13px;border-radius:8px;height:auto;
  font-size:13px;font-weight:500;color:var(--muted);cursor:pointer;
  transition:background .16s,color .16s,box-shadow .16s;
}
.tabs button:hover{background:rgba(255,255,255,.75);color:var(--ink)}
.tabs button.on{background:var(--green-d);color:#fff;font-weight:650;box-shadow:0 1px 3px rgba(24,92,74,.28)}
.tabs button:focus-visible{outline:none;box-shadow:0 0 0 2px var(--green-line)}

main{padding:18px 20px 40px;max-width:1680px;margin:0 auto}
.tab{display:none}
.tab.on{display:block;animation:fadeUp .18s ease-out}
@keyframes fadeUp{from{opacity:0;transform:translateY(3px)}to{opacity:1;transform:none}}

/* ---------------- 指标卡 ---------------- */
.cards{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:16px}
.card{
  position:relative;background:var(--panel);border:1px solid var(--line);
  border-radius:var(--r-lg);padding:14px 16px 15px;box-shadow:var(--sh-1);
  overflow:hidden;transition:box-shadow .18s,transform .18s,border-color .18s;
}
.card::before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--green);opacity:.85}
.card:nth-child(2)::before{background:#2f7fd1}
.card:nth-child(3)::before{background:#a97b17}
.card:nth-child(4)::before{background:#6b5bd2}
.card:hover{box-shadow:var(--sh-2);transform:translateY(-1px);border-color:#d8dee2}
.card .k{font-size:11.5px;color:var(--muted);letter-spacing:.04em}
.card .v{font-size:26px;font-weight:700;margin-top:4px;letter-spacing:-.4px;font-variant-numeric:tabular-nums}
.card .v.small{font-size:14px;font-weight:600;letter-spacing:0;line-height:1.5;margin-top:6px}

/* ---------------- 面板 ---------------- */
.panel{
  background:var(--panel);border:1px solid var(--line);border-radius:var(--r-lg);
  margin-bottom:16px;overflow:hidden;box-shadow:var(--sh-1);
}
.panel-head{
  display:flex;align-items:center;gap:12px;padding:12px 16px;
  border-bottom:1px solid var(--line-soft);background:linear-gradient(#fff,#fcfdfd);
}
.panel-head h2{font-size:13.5px;margin:0;font-weight:650;letter-spacing:.01em}
.panel-head .hint,.hint{color:var(--muted);font-size:12px}
.panel-head .actions{margin-left:auto;display:flex;gap:8px}
.link{margin-left:auto;font-size:12.5px;color:var(--green);text-decoration:none;font-weight:550}
.link:hover{color:var(--green-d);text-decoration:underline;text-underline-offset:2px}

/* ---------------- 表格 ---------------- */
.tbl{width:100%;border-collapse:separate;border-spacing:0;font-size:13px}
.tbl th{
  text-align:left;font-weight:600;color:var(--muted);font-size:11.5px;letter-spacing:.04em;
  padding:9px 16px;border-bottom:1px solid var(--line);background:var(--panel-2);
}
.tbl td{padding:10px 16px;border-bottom:1px solid var(--line-soft);vertical-align:middle}
.tbl tr:last-child td{border-bottom:0}
.tbl tbody tr{transition:background .14s}
.tbl tbody tr:hover{background:#f7fbfa}
.tbl .num{text-align:right;font-variant-numeric:tabular-nums}
.tbl td.num{font-variant-numeric:tabular-nums}
.empty{padding:26px 16px;color:var(--muted);font-size:12.5px;text-align:center}
.mono{font-family:ui-monospace,"JetBrains Mono",SFMono-Regular,monospace;font-size:12px}

/* ---------------- 按钮 ---------------- */
button{
  cursor:pointer;font:inherit;font-size:12.5px;font-weight:550;line-height:1;
  border-radius:var(--r-sm);padding:0 12px;height:var(--ctl-h);
  border:1px solid #d8dee2;background:#fff;color:var(--ink-2);
  display:inline-flex;align-items:center;justify-content:center;gap:5px;
  transition:background .15s,border-color .15s,box-shadow .15s,color .15s,transform .08s;
}
button:hover{border-color:#c3ccd1;background:#fcfdfd;color:var(--ink)}
button:active{transform:translateY(.5px)}
button:focus-visible{outline:none;box-shadow:var(--ring);border-color:var(--green-line)}
button.primary{
  background:linear-gradient(180deg,#128a79,#0d7060);border-color:#0c6557;color:#fff;font-weight:600;
  box-shadow:0 1px 2px rgba(11,97,84,.28), inset 0 1px 0 rgba(255,255,255,.14);
}
button.primary:hover{background:linear-gradient(180deg,#0f7a6b,#0a5a4c);border-color:#0a5a4c;color:#fff}
button.primary:disabled{opacity:.5;cursor:default;box-shadow:none;transform:none}
button.ghost{background:#fff}
button.danger{border-color:#f0c6c1;color:var(--red);background:#fff}
button.danger:hover{background:var(--red-soft);border-color:#e3a9a2}
button.tiny{height:26px;padding:0 9px;font-size:11.5px;border-radius:var(--r-xs)}
.actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}

/* ---------------- 表单控件 ---------------- */
input,select,textarea{
  font:inherit;font-size:13px;color:var(--ink);background:#fff;
  border:1px solid #dbe1e4;border-radius:var(--r-sm);
  outline:none;transition:border-color .15s,box-shadow .15s,background .15s;
}
input,select{height:var(--ctl-h);padding:0 10px}
textarea{padding:8px 10px;line-height:1.6;resize:vertical}
input::placeholder,textarea::placeholder{color:var(--muted-2)}
input:hover,select:hover,textarea:hover{border-color:#c4cdd2}
input:focus,select:focus,textarea:focus{border-color:var(--green);box-shadow:var(--ring);background:#fff}
input:disabled,select:disabled{background:#f4f6f7;color:var(--muted);cursor:not-allowed}
select{
  appearance:none;-webkit-appearance:none;padding-right:28px;cursor:pointer;
  background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23697d86' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 9px center;
}
input[type=number]{font-variant-numeric:tabular-nums}
input[type=checkbox]{
  appearance:none;-webkit-appearance:none;width:16px;height:16px;padding:0;flex:0 0 auto;
  border:1.5px solid #c5cfd4;border-radius:5px;background:#fff;cursor:pointer;
  transition:background .15s,border-color .15s,box-shadow .15s;position:relative;
}
input[type=checkbox]:hover{border-color:#9fb1b8}
input[type=checkbox]:checked{background:var(--green);border-color:var(--green)}
input[type=checkbox]:checked::after{
  content:"";position:absolute;left:4.5px;top:1.5px;width:4px;height:8px;
  border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg);
}
input[type=checkbox]:focus-visible{box-shadow:var(--ring)}

/* ---------------- 控制台/日志 ---------------- */
.meta{padding:10px 16px;color:var(--muted);font-size:12.5px}
.progress{height:4px;background:#eef1f2;margin:0 16px;border-radius:99px;overflow:hidden}
.progress .bar{height:100%;width:0;background:linear-gradient(90deg,#18a08c,#0d7060);transition:width .25s;border-radius:99px}
.console{
  margin:10px 16px 16px;background:#0e1a20;color:#d7e3ea;border-radius:var(--r-md);
  padding:11px 13px;border:1px solid #1b2b33;
  font:12px/1.65 ui-monospace,"JetBrains Mono",SFMono-Regular,monospace;
  max-height:340px;overflow:auto;white-space:pre-wrap;box-shadow:inset 0 1px 0 rgba(255,255,255,.03);
}
.console.short{max-height:200px}
.console .muted{color:#7f929d}
.console .ok{color:#78e08f}
.console .warn{color:#ffca6b}
.console .err{color:#ff9186}
.console .dim{color:#8b9aa6}

/* ---------------- 记录页三栏 ---------------- */
.records{display:grid;grid-template-columns:224px 280px 1fr;gap:14px;align-items:stretch}
.side{
  background:var(--panel);border:1px solid var(--line);border-radius:var(--r-lg);
  overflow:hidden;display:flex;flex-direction:column;min-height:0;box-shadow:var(--sh-1);
}
.side-head{padding:11px;border-bottom:1px solid var(--line-soft);display:flex;flex-direction:column;gap:8px}
.side-head input{width:100%}
.side-title{font-size:12px;font-weight:650;color:var(--ink);display:flex;align-items:center;gap:6px}
.side-title .hint{font-weight:400}

/* 会话筛选：一行 chips，点一下切换，整行只占 24px（原来 5 个勾选框占了 ~130px）
   原生 checkbox 视觉隐藏但保留，:has(input:checked) 负责“已选”样式，JS 不用改 */
.fchips{
  display:flex;align-items:center;gap:3px;flex-wrap:nowrap;
  overflow-x:auto;overflow-y:hidden;scrollbar-width:none;-ms-overflow-style:none;
  margin:0 -1px;padding:1px;
}
.fchips::-webkit-scrollbar{display:none}
.fchip{
  position:relative;display:inline-flex;align-items:center;gap:4px;flex:0 0 auto;
  height:24px;padding:0 6px;border:1px solid var(--line);border-radius:999px;
  background:#fff;color:var(--muted);font-size:11px;font-weight:600;line-height:1;
  cursor:pointer;user-select:none;white-space:nowrap;
  transition:background .12s,border-color .12s,color .12s;
}
.fchip:hover{color:var(--ink-2);border-color:var(--green-line);background:#f7fbfa}
body .fchip input[type=checkbox]{
  position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer;
}
.fchip:has(input:checked){
  background:var(--green-soft);border-color:var(--green-line);color:#0b5c4f;
  box-shadow:inset 0 0 0 1px rgba(18,140,126,.14);
}
.fchip:has(input:checked)::before{
  content:"";width:5px;height:5px;border-radius:50%;background:var(--green);flex:none;
}
.fchip:focus-within{outline:2px solid var(--green-line);outline-offset:1px}
/* 筛选后没有结果时给一句交代 + 一键出口，别让列表一片空白 */
.chat-empty{
  display:flex;flex-direction:column;align-items:center;gap:10px;
  padding:26px 16px;color:var(--muted);font-size:12px;text-align:center;line-height:1.6;
}
/* 没有 :has 支持的旧内核：退回“选中态加粗+深色”，功能不受影响 */
@supports not selector(:has(*)){
  .fchip input:checked + span{color:#0b5c4f;font-weight:700}
}

.acc-list{flex:1;min-height:0;overflow:auto}
.acc{display:flex;gap:9px;padding:9px 11px;border-bottom:1px solid var(--line-soft);cursor:pointer;transition:background .14s}
.acc:hover{background:#f7fbfa}
.acc.on{background:var(--green-soft);box-shadow:inset 3px 0 0 var(--green)}
.acc-main{min-width:0;flex:1}
.acc-n{display:flex;align-items:center;gap:6px}
.acc-name{font-size:13px;font-weight:600;word-break:break-all;line-height:1.35}
.acc-name.plain{font-weight:500;font-family:ui-monospace,monospace;font-size:11.5px;color:var(--ink-2)}
.acc-j{font-size:10.5px;color:var(--muted);font-family:ui-monospace,monospace;word-break:break-all;margin-top:1px}
.acc-c{font-size:11.5px;color:var(--muted);margin-top:2px}
.acc-alias{font-size:11px;color:var(--muted);margin-top:1px}
.pen{margin-left:auto;border:0;background:transparent;padding:0 3px;height:20px;width:20px;font-size:12px;color:var(--muted);opacity:0;cursor:pointer}
.acc:hover .pen,.acc.on .pen{opacity:1}
.pen:hover{color:var(--green);background:transparent;border-color:transparent}
.acc-input{width:100%;padding:3px 6px;height:26px;font-size:12px;border:1px solid var(--green);border-radius:var(--r-xs);font-family:inherit}

/* 头像 */
.av{
  width:28px;height:28px;border-radius:50%;flex:none;display:flex;align-items:center;justify-content:center;
  font-size:10.5px;font-weight:700;letter-spacing:0;color:#fff;text-transform:uppercase;
  background:hsl(var(--h,168) 42% 42%);box-shadow:inset 0 0 0 1px rgba(255,255,255,.18);
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Noto Sans CJK SC",system-ui,sans-serif;
}

.chats{flex:1;min-height:0;overflow:auto}
.chat{display:flex;gap:9px;padding:9px 11px;border-bottom:1px solid var(--line-soft);cursor:pointer;transition:background .14s}
.chat:hover{background:#f7fbfa}
.chat.on{background:var(--green-soft);box-shadow:inset 3px 0 0 var(--green)}
.chat .cm{min-width:0;flex:1}
.chat .n{font-size:12.8px;font-weight:600;display:flex;gap:5px;align-items:center;line-height:1.35}
.chat .n .nm{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0}
.chat .n .nm-zh{font-size:11px;font-weight:500;color:var(--muted);flex:none;max-width:88px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat .j{font-size:10.5px;color:var(--muted-2);font-family:ui-monospace,monospace;word-break:break-all;margin-top:1px}
/* 号码是比 JID 更重要的信息：深色、加粗、等宽数字，一眼能看清；没有号码时才退回灰 JID */
.chat .j.ph{font-size:12.5px;color:var(--ink);font-weight:600;letter-spacing:.3px;font-variant-numeric:tabular-nums;word-break:normal;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px}
.chat .c{font-size:11px;color:var(--muted);margin-top:2px;display:flex;gap:5px;align-items:center;flex-wrap:wrap}
.chat-score{
  display:inline-block;min-width:26px;text-align:center;font-size:10.5px;font-weight:700;
  border-radius:6px;padding:1px 5px;background:#eef1f2;color:#8a8f94;flex:none;
  font-variant-numeric:tabular-nums;
}
.chat-score.hi{background:#d7f2e4;color:#0c6b41}
.chat-score.mid{background:var(--blue-soft);color:var(--blue)}
.chat-score.low{background:var(--amber-soft);color:var(--amber)}
.chat-score.bad{background:var(--red-soft);color:var(--red)}
.lang-tag{
  display:inline-block;font-size:10px;font-weight:600;line-height:1.6;border-radius:5px;
  padding:0 5px;background:#f0f3f4;color:var(--ink-2);border:1px solid #e3e8ea;flex:none;
}
.ctype{
  display:inline-block;font-size:10.5px;font-weight:700;line-height:1.6;border-radius:5px;
  padding:0 5px;letter-spacing:.3px;flex:none;
}
.ctype.b{background:var(--blue-soft);color:#124a78;border:1px solid #c3dbf1}
.ctype.c{background:var(--purple-soft);color:var(--purple);border:1px solid #dccbf6}
.ctype.n{background:#f0f3f4;color:var(--muted);border:1px solid #e3e8ea}
.type-cell{cursor:pointer}
.tag{background:#eef1f2;border-radius:5px;padding:0 5px;font-size:10px;color:#54656f;border:1px solid #e3e8ea;flex:none}

/* ---------------- 消息区 ---------------- */
.msgs{
  position:relative;
  background:var(--panel);border:1px solid var(--line);border-radius:var(--r-lg);
  display:flex;flex-direction:column;height:calc(100vh - 88px);min-height:520px;
  overflow:hidden;box-shadow:var(--sh-1);
}
.msgs-head{display:flex;align-items:center;gap:12px;padding:11px 16px;border-bottom:1px solid var(--line-soft);flex:none;background:linear-gradient(#fff,#fcfdfd)}
.chat-head{min-width:190px;flex:1 1 auto}
.chat-title{font-weight:650;font-size:13.5px;letter-spacing:.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-sub{font-size:11.5px;color:var(--muted);margin-top:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-sub .ph{color:var(--ink);font-weight:650;font-size:12.5px;letter-spacing:.3px;font-variant-numeric:tabular-nums}
.msgs-head input#searchMsgs{margin-left:auto;width:200px;flex:0 1 200px;min-width:120px}
/* 头部几个小按钮别被挤成两行（昵称区要腾出号码的宽度） */
.msgs-head > button,.msgs-head > .chk{flex:0 0 auto;white-space:nowrap}
.msgs-head .chk{margin-left:0}

/* 四个平级标签 */
.msgs-tabs{display:flex;flex:none;border-bottom:1px solid var(--line);background:var(--panel-2);gap:2px;padding:0 6px}
.mtab{
  flex:1;border:0;border-bottom:2px solid transparent;border-radius:0;background:transparent;
  color:var(--muted);padding:9px 6px;font-size:12.5px;font-weight:550;line-height:1.5;height:auto;
  display:flex;align-items:center;justify-content:center;gap:5px;white-space:nowrap;
  transition:color .15s,background .15s,border-color .15s;
}
.mtab:hover{background:transparent;color:var(--ink);border-color:transparent;box-shadow:none}
.mtab.on{color:var(--green-d);font-weight:700;border-bottom-color:var(--green);background:transparent;box-shadow:none}
.mtab .cnt{font-size:11px;font-weight:400;color:var(--muted)}
.mtab .dot{display:none;width:6px;height:6px;border-radius:50%;background:var(--green);box-shadow:0 0 0 3px var(--green-soft)}
.mtab.has .dot{display:inline-block}

.pane{flex:1;min-height:0;display:flex;flex-direction:column}
.pane[hidden]{display:none}
.pane-head{
  display:flex;align-items:center;gap:9px;padding:8px 16px;background:var(--panel-2);
  border-bottom:1px solid var(--line-soft);flex:none;flex-wrap:wrap;
}
.pane-head button{height:27px;padding:0 10px;font-size:12px}
.pane-head .spacer{flex:1}
.pane-body{flex:1;min-height:0;overflow:auto;padding:14px 18px 20px}
.fresh{font-size:11px;font-weight:650;border-radius:999px;padding:2px 9px;white-space:nowrap}
.fresh.ok{background:#d7f2e4;color:#0c6b41}
.fresh.stale{background:var(--amber-soft);color:var(--amber)}
.fresh.na{background:#f0f3f4;color:var(--muted);font-weight:600}
.gen-meta{font-size:11.5px;color:var(--muted)}

.chk{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--muted);margin-left:auto;white-space:nowrap;cursor:pointer;user-select:none}
.chk:hover{color:var(--ink-2)}
.chk-inline{margin-left:0;font-size:11.5px}
.side-head .chk-inline{margin-left:0}
.filters .chk,.filters label{flex:0 0 auto;white-space:nowrap}

.msgs-body{flex:1;overflow:auto;padding:14px 16px;background:linear-gradient(#f2f5f6,#eef2f3)}
/* hidden 属性必须真的隐藏：作者样式 button{display:flex} 会盖掉浏览器默认的 [hidden]{display:none} */
[hidden]{display:none !important}
/* 回执勾（我方消息右下角） */
.tk{font-size:11px;font-weight:700;flex:none;letter-spacing:-2px;font-variant-numeric:tabular-nums}
.tk.read{color:#53bdeb}
.tk.delivered{color:#8696a0}
.tk.sent{color:#8696a0;opacity:.75}
.tk.none{color:#c9d1d6;letter-spacing:0}
.mine-chip{flex:none;background:#fff4e5;color:#9a5b00;border:1px solid #ffe2bd;border-radius:9px;
  padding:0 6px;font-size:10.5px;font-weight:650;line-height:16px;white-space:nowrap}
/* 最近同步：触发来源标签 */
.sync-src{display:inline-block;padding:0 6px;border-radius:8px;font-size:10.5px;font-weight:650;line-height:16px;white-space:nowrap;border:1px solid transparent}
.sync-src.push{background:#e8f0fe;color:#1a56c4;border-color:#cfdffb}
.sync-src.watch{background:#e6f4f1;color:#0b6154;border-color:#bfe0da}
.sync-src.manual{background:#f1f3f4;color:#4b565c;border-color:#e0e4e6}
.sync-src.cron{background:#fff4e5;color:#9a5b00;border-color:#ffe2bd}
.sync-src.cli{background:#f6f6f7;color:#8a9499;border-color:#e8eaec}
/* 导航上的待办数量徽标 */
.nav-badge{display:inline-block;margin:0 0 0 5px;min-width:16px;height:16px;padding:0 4px;border-radius:8px;
  background:#b3261e;color:#fff;font-size:10px;line-height:16px;text-align:center;font-weight:700;font-variant-numeric:tabular-nums}
/* 工作台的新消息气泡：绿色，和待办的红色区分；来消息时脉冲两下 */
.nav-badge.nav-msg{background:#0b6154}
.tabs button.on .nav-badge{background:rgba(255,255,255,.24);color:#fff}
.nav-badge.pulse{animation:navPulse .85s ease-out 2}
@keyframes navPulse{
  0%{box-shadow:0 0 0 0 rgba(11,97,84,.45)}
  70%{box-shadow:0 0 0 7px rgba(11,97,84,0)}
  100%{box-shadow:0 0 0 0 rgba(11,97,84,0)}
}
.todo-title-cell{word-break:break-word;max-width:560px;line-height:1.5}
tr.clickable{cursor:pointer}
tr.clickable:hover{background:#f2faf8}
td.bad{color:#b3261e;font-weight:600}
td.warn{color:#9a5b00;font-weight:600}
/* 会话待办标志 / 已忽略标记 */
.todo-chip{flex:none;background:#eef2ff;color:#3730a3;border:1px solid #d7dcfb;border-radius:9px;
  padding:0 6px;font-size:10.5px;font-weight:650;line-height:16px;white-space:nowrap}
.todo-chip.overdue{background:#fdeceb;color:#b3261e;border-color:#f7c9c6}
.ignored-tag{flex:none;color:#8a9499;border:1px dashed #c9d1d6;border-radius:9px;padding:0 6px;
  font-size:10.5px;line-height:16px;white-space:nowrap}
/* 会话头部两个小按钮的选中态 */
button.ghost.on{background:#e6f4f1;border-color:var(--green-line);color:var(--green-d);font-weight:700}
/* 设置页里的多选组：一行排开，不占满屏 */
.panel .checks{display:flex;flex-wrap:wrap;gap:12px 18px;align-items:center;margin:10px 16px 0}
.panel .checks .chk{flex:0 0 auto;white-space:nowrap}
/* 「自动处理」锚点高亮 */
.panel.flash{box-shadow:0 0 0 2px var(--green-line), var(--sh-1)}
/* 技能勾选芯片（全局绑定 / 账号级 / 会话级共用） */
.chip-group{margin:10px 0 0}
.chip-group:first-of-type{margin-top:6px}
.cg-label{font-size:12px;font-weight:650;color:#3c4d55;margin-bottom:6px}
.cg-label .hint{font-weight:400}
.chips{display:flex;flex-wrap:wrap;gap:6px}
.chip{display:inline-flex;align-items:center;gap:5px;padding:5px 10px;border-radius:999px;
  border:1px solid var(--line);background:#fff;font-size:12.5px;color:#3c4d55;cursor:pointer;
  transition:background .12s,border-color .12s,color .12s;user-select:none}
.chip:hover{background:#f4f9f8;border-color:#c9dbd6}
.chip input{width:auto;height:auto;margin:0;accent-color:var(--green)}
.chip.on{background:#e7f6f2;border-color:var(--green-line);color:#0b5c4f;font-weight:650}
.chip.off{opacity:.5}
.chip.ro{background:#f4f6f7;color:#6b7b82;cursor:default}
.chip-kind{font-size:10px;color:#8fa0a7;font-weight:500}
.chip.on .chip-kind{color:#4e8b7f}
/* 技能列表：筛选 + 分组 + 行内操作 */
.skill-list-wrap{display:flex;flex-direction:column;gap:8px;min-width:0}
.sk-filters{display:flex;gap:6px}
.sk-filters input{flex:1;min-width:0;height:30px;font-size:12px}
.sk-filters select{height:30px;font-size:12px;padding:0 4px;max-width:110px}
.sk-group-title{display:flex;align-items:center;gap:6px;padding:6px 4px 2px;font-size:11px;font-weight:700;
  color:#7c8b92;letter-spacing:.04em}
.sk-line{display:flex;align-items:center;gap:6px;min-width:0}
.sk-line .spacer{flex:1}
.sk-dot{border:0;background:transparent;color:var(--green);font-size:11px;cursor:pointer;padding:0 2px;line-height:1}
.sk-item.off .sk-dot{color:#b9c4c9}
.sk-quick{display:flex;gap:4px;opacity:0;transition:opacity .12s}
.sk-item:hover .sk-quick,.sk-item.on .sk-quick{opacity:1}
.sk-quick .ghost{padding:0 6px;height:22px;font-size:10.5px}
.sk-quick .ghost.on{background:#e7f6f2;border-color:var(--green-line);color:#0b5c4f}
/* 账号卡片 */
.acc-skill-list{display:flex;flex-direction:column;gap:10px;margin:10px 16px 0}
.acc-card{border:1px solid var(--line);border-radius:10px;padding:10px 12px;background:#fbfdfd}
.acc-head{display:flex;align-items:center;gap:8px;margin-bottom:8px;font-size:13px}
.acc-head .spacer{flex:1}
.acc-head .acc-count{font-size:11.5px;color:#7c8b92}
.acc-copy{height:26px;font-size:11.5px;padding:0 6px;width:auto}
/* 技能库：子标签 + 列表/编辑 + 绑定 + 预览 */
/* 这几块面板的内容没有自己的外边距，统一补左右内边距 */
#sub-skill .panel > *:not(.panel-head){margin-left:16px;margin-right:16px}
#sub-skill .panel > *:last-child{margin-bottom:14px}
@media (max-width:1100px){.skill-layout{grid-template-columns:220px minmax(0,1fr)}}
/* 全局绑定 / 拼装预览里的字段行：并排，不叠成一列 */
#sub-skill .panel > .row2{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px 14px;align-items:end}
#sub-skill .panel > .row2 > div{min-width:0}
#sub-skill .panel > .row2 label{display:block;margin-bottom:4px;font-size:12px;font-weight:600;color:var(--muted)}
#sub-skill .panel > .panel-head{margin:0}
.subtabs{display:flex;gap:6px;margin:0 0 14px}
.subtab{padding:7px 16px;border-radius:999px;border:1px solid var(--line);background:#fff;
  font-size:13px;color:#3c4d55;cursor:pointer}
.subtab.on{background:var(--green);border-color:var(--green);color:#fff;font-weight:700}
.subpane[hidden]{display:none !important}
.skill-layout{display:grid;grid-template-columns:280px minmax(0,1fr);gap:16px;align-items:start}
.skill-list{display:flex;flex-direction:column;gap:6px;max-height:520px;overflow:auto;
  border:1px solid var(--line);border-radius:10px;padding:6px;background:#fbfdfd}
.sk-item{padding:8px 10px;border-radius:8px;cursor:pointer;border:1px solid transparent}
.sk-item:hover{background:#f2f8f7}
.sk-item.on{background:#e9f6f3;border-color:var(--green-line)}
.sk-item.off{opacity:.55}
.sk-name{font-size:13px;font-weight:700;color:#1d3b45;display:flex;gap:6px;align-items:center}
.sk-kind{font-size:10px;font-weight:700;border-radius:5px;padding:0 5px;line-height:15px;border:1px solid}
.sk-kind.k-knowledge{color:#0b6154;background:#e3f6f0;border-color:#bfe4da}
.sk-kind.k-lens{color:#5b4a8a;background:#efecfa;border-color:#d8d0f0}
.sk-kind.k-reply{color:#8a5a12;background:#fdf1de;border-color:#f0dcbc}
.sk-sub{font-size:11.5px;color:#6b7b82;margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sk-meta{font-size:10.5px;color:#94a3a9;margin-top:3px}
.sk-tags{display:flex;gap:4px;flex-wrap:wrap;margin-top:4px}
.skill-edit{display:flex;flex-direction:column;gap:6px;min-width:0}
.skill-edit .row2{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:10px 12px}
.skill-edit .row2 > div{min-width:0}
.skill-edit .row2 label{display:block;margin-bottom:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.skill-edit label{font-size:12px;color:var(--muted);font-weight:600}
.skill-edit textarea{font-family:inherit;font-size:13px;line-height:1.6;resize:vertical}
.bind-list{display:flex;flex-direction:column;gap:4px;margin-top:8px}
.bind-row{display:flex;align-items:center;gap:8px;padding:6px 10px;border:1px solid var(--line);
  border-radius:8px;background:#fbfdfd;font-size:12.5px}
.bind-skill{font-weight:600;color:#1d3b45}
.pv-box{margin:8px 0 0;padding:10px 12px;border:1px solid var(--line);border-radius:8px;
  background:#f7fafb;font-size:12px;line-height:1.6;white-space:pre-wrap;max-height:320px;overflow:auto}
.modal-box.narrow{max-width:560px}
/* 弹窗内边距：head 自己撑满，其余内容统一左右 20px + 底部留白 */
.modal-box.narrow{padding:0 0 18px}
.modal-box.narrow > *{margin-left:20px;margin-right:20px}
.modal-box.narrow > .modal-head{margin:0;padding:13px 20px}
.modal-box.narrow > p.hint{margin-top:12px;line-height:1.6}
.modal-box.narrow > input,.modal-box.narrow > textarea,.modal-box.narrow > select{width:calc(100% - 40px)}
.modal-box.narrow > label{margin-top:10px;font-size:12px;font-weight:600;color:var(--muted)}
.modal-box.narrow > .row2{display:grid;grid-template-columns:1fr 1fr;gap:10px 12px;margin-top:8px}
.modal-box.narrow > .row2 label{display:block;font-size:12px;font-weight:600;color:var(--muted);margin-bottom:5px}
.modal-box.narrow > .row2 select,.modal-box.narrow > .row2 input{width:100%}
.modal-box.narrow > .actions{margin-top:14px}
.modal-box.narrow input[type=file]{padding:6px 0;height:auto;border:0;background:transparent}
/* AI 任务进度：可同时显示多个 */
.ap-list{display:flex;flex-direction:column;gap:5px;width:100%}
.ap-row{display:flex;align-items:center;gap:8px;min-width:0}
.ap-row .ap-label{flex:0 0 auto;max-width:128px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  font-size:11px;font-weight:700;color:#284a5e}
.ap-row .bar{flex:1;min-width:60px;height:5px;background:#e2ecef;border-radius:99px;overflow:hidden}
.ap-row .ap-bar{display:block;height:100%;width:0;background:var(--green);border-radius:99px;transition:width .25s}
.ap-row .ap-bar.ok{background:#2fa37a}.ap-row .ap-bar.warn{background:#d99100}.ap-row .ap-bar.err{background:#d1594b}
.ap-row .ap-text{flex:0 0 auto;max-width:44%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px}
/* 推荐回复条：收起只占一行；展开是从底部浮出的层（absolute），不挤压会话区 */
.reply-bar{flex:none;position:relative;border-top:1px solid var(--line-soft);background:#f0fbf6}
.reply-bar.stale{background:#fffaf0;border-top-color:#ffe2bd}
.rb-head{display:flex;align-items:center;gap:8px;height:34px;padding:0 12px;cursor:pointer;user-select:none}
.rb-tag{flex:none;font-size:10.5px;font-weight:700;color:#0b6154;background:#d9f2ea;
  border:1px solid #bfe0da;border-radius:8px;padding:1px 7px;line-height:16px}
.reply-bar.stale .rb-tag{color:#8a5a00;background:#ffefd6;border-color:#f3d9ab}
.rb-line{flex:1;min-width:0;font-size:12.5px;color:#274c46;overflow:hidden;
  text-overflow:ellipsis;white-space:nowrap}
.rb-actions{flex:none;display:flex;gap:6px}
.rb-body{position:absolute;left:0;right:0;bottom:100%;z-index:24;max-height:45vh;overflow:auto;
  padding:10px 14px;background:#f4fcf9;border-top:1px solid var(--line-soft);
  box-shadow:0 -8px 22px rgba(15,47,42,.12);display:flex;flex-direction:column;gap:4px}
.rb-text{font-size:13px;line-height:1.55;white-space:pre-wrap;word-break:break-word;color:#0f2f2a}
/* 可编辑的成品：直接在这里改，改完按「发送」发出去的就是这段文字 */
textarea.rb-text{width:100%;box-sizing:border-box;resize:none;overflow:auto;min-height:40px;max-height:200px;
  font-family:inherit;border:1px solid #cfe4de;border-radius:6px;padding:6px 8px;background:#fff}
textarea.rb-text:focus{outline:2px solid #a9d8cc;outline-offset:0;border-color:#8fcfc0}
.rb-draft{display:flex;gap:6px;align-items:center;margin-top:6px;padding-top:7px;border-top:1px dashed #d6ebe4}
.rb-draft input{flex:1;min-width:0;font-size:12.5px;padding:5px 8px;border:1px solid #cfe4de;border-radius:6px;background:#fff}
.rb-draft input:focus{outline:2px solid #a9d8cc;outline-offset:0;border-color:#8fcfc0}
.rb-draft button{flex:none}
.rb-zh{font-size:12px;line-height:1.5;color:#5b6b72;white-space:pre-wrap;word-break:break-word}
.rb-note{font-size:11.5px;line-height:1.5;color:#8a6a2f;background:#fff8ea;border:1px solid #f2e3c4;
  border-radius:6px;padding:3px 7px;margin-top:2px;word-break:break-word}
.rb-flag{font-size:11.5px;line-height:1.5;color:#b45309;background:#fff1e6;border:1px solid #f8d0a8;
  border-radius:6px;padding:3px 7px;margin-top:2px;word-break:break-word}
/* 待办面板 */
.todo-pane{flex:none;border-top:1px solid var(--line-soft);background:#fbfcfc;padding:9px 14px;max-height:200px;overflow:auto}
.todo-add{display:flex;gap:8px;margin-bottom:6px}
.todo-add input{flex:1;min-width:0;height:30px;font-size:12.5px}
.todo-add input[type=datetime-local]{flex:0 0 188px}
.todo-item{display:flex;align-items:center;gap:8px;padding:5px 0;font-size:12.5px;border-bottom:1px dashed var(--line-soft)}
.todo-item:last-child{border-bottom:0}
.todo-item .todo-title{flex:1;min-width:0;word-break:break-word}
.todo-item.done .todo-title{text-decoration:line-through;color:var(--muted)}
.todo-item .todo-due{flex:none;font-size:11.5px;color:var(--muted);font-variant-numeric:tabular-nums}
.todo-item.overdue .todo-due{color:#b3261e;font-weight:650}
.todo-del{flex:none;border:0;background:transparent;color:#9aa5ab;font-size:15px;line-height:1;cursor:pointer}
.todo-del:hover{color:#b3261e}
/* 待跟进：我方已回、客户没动静 —— 用青色区分于"待回复"的橙色 */
.chip-follow{flex:none;background:#e6f5f8;color:#0b6b7c;border:1px solid #b6dde6;border-radius:9px;
  padding:0 6px;font-size:10.5px;font-weight:700;line-height:16px;white-space:nowrap}
.chat.has-follow::after{content:"";position:absolute;left:0;top:8px;bottom:8px;width:3px;border-radius:0 3px 3px 0;background:#1a9bb5}
.chat.has-follow .c .chip-follow{margin-left:auto}
/* 待回复：客户在等我们 —— 优先级最高，用橙色实心区分 */
.chip-reply{flex:none;background:#fff1e6;color:#b45309;border:1px solid #f8d0a8;border-radius:9px;
  padding:0 6px;font-size:10.5px;font-weight:700;line-height:16px;white-space:nowrap}
.chat.has-reply::after{content:"";position:absolute;left:0;top:8px;bottom:8px;width:3px;border-radius:0 3px 3px 0;background:#f59e0b}
.chat.has-reply .c .chip-reply{margin-left:auto}
/* 待跟进面板顶部三个计数：可点，点了只筛这一类 */
.chip-reply.clickable,.chip-noreply.clickable,.mine-chip.clickable{cursor:pointer;transition:box-shadow .12s,transform .12s}
.chip-reply.clickable:hover,.chip-noreply.clickable:hover,.mine-chip.clickable:hover{transform:translateY(-1px);box-shadow:0 2px 8px rgba(0,0,0,.12)}
.chip-reply.clickable.on,.chip-noreply.clickable.on,.mine-chip.clickable.on{box-shadow:0 0 0 2px rgba(0,0,0,.18) inset;font-weight:800}
/* 已读未回：客户看了却没回，最该跟的信号，用红系区分开 */
.chip-noreply{flex:none;background:#fdeceb;color:#b3261e;border:1px solid #f7c9c6;border-radius:9px;
  padding:0 6px;font-size:10.5px;font-weight:700;line-height:16px;white-space:nowrap}
.chat.has-noreply::after{content:"";position:absolute;left:0;top:8px;bottom:8px;width:3px;border-radius:0 3px 3px 0;background:#e0534d}
.chat.has-noreply .c .chip-noreply{margin-left:auto}
/* 未读气泡（账号列表 / 会话列表 / 概览账号表通用） */
.unread{flex:0 0 auto;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:#25d366;color:#fff;
  font-size:11px;font-weight:700;line-height:18px;text-align:center;font-variant-numeric:tabular-nums;
  box-shadow:0 1px 3px rgba(37,211,102,.45)}
.acc-n .unread{margin-left:2px}
.chat.has-unread .nm{font-weight:750;color:var(--ink)}
.chat.has-unread .c{color:var(--ink-2)}
.chat.has-unread::after{content:"";position:absolute;left:0;top:8px;bottom:8px;width:3px;border-radius:0 3px 3px 0;background:#25d366}
.chat{position:relative}
/* 「有新消息」提示：正在看历史时不打断，只给一个可点的条 */
.new-pill{position:absolute;left:50%;transform:translateX(-50%);bottom:46px;z-index:6;
  border:none;border-radius:999px;padding:7px 16px;background:#25d366;color:#fff;font-size:12.5px;font-weight:650;
  box-shadow:0 6px 18px rgba(37,211,102,.35);cursor:pointer;animation:pillIn .18s ease-out}
.new-pill:hover{background:#1fbe5b}
@keyframes pillIn{from{opacity:0;transform:translate(-50%,6px)}to{opacity:1;transform:translate(-50%,0)}}
.msg{
  max-width:76%;margin:7px 0;padding:8px 11px;border-radius:12px;background:#fff;
  box-shadow:0 1px 1px rgba(11,32,38,.07),0 0 0 1px rgba(11,32,38,.03);
}
.msg.me{margin-left:auto;background:#dcf8d3;box-shadow:0 1px 1px rgba(11,97,84,.09),0 0 0 1px rgba(11,97,84,.05)}
.msg .body{white-space:pre-wrap;word-break:break-word;font-size:13px;line-height:1.55}
.msg .meta2{font-size:10.5px;color:var(--muted);margin-top:4px;display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.msg .tag{background:rgba(11,32,38,.05);border:0}
.msgs-foot{display:flex;align-items:center;gap:10px;padding:9px 16px;border-top:1px solid var(--line-soft);background:#fff}
.msgs-foot .hint{margin:0 auto}
.muted{color:var(--muted)}

.msg .ai-t,.msg .ai-a{
  margin-top:6px;padding:6px 8px;border-radius:8px;font-size:12.5px;line-height:1.55;
  white-space:pre-wrap;word-break:break-word;
}
.msg .ai-t{background:#eef7f5;border-left:2px solid var(--green)}
.msg .ai-a{background:#fdf7ea;border-left:2px solid #c08a20}
.msg.me .ai-t{background:#e7f6ea;border-left-color:#3fa66a}
.msg.me .ai-a{background:#f8f2e2;border-left-color:#c79a3c}
.ai-tag{display:inline-block;min-width:15px;margin-right:5px;font-size:10px;font-weight:700;color:#fff;background:var(--green);border-radius:4px;padding:0 4px;vertical-align:1px;text-align:center}
.msg .ai-a .ai-tag{background:#b07a12}
.msg-chk{float:left;margin:2px 9px 0 -2px;cursor:pointer}
.msg.picked{box-shadow:0 0 0 2px var(--green),0 2px 8px rgba(15,122,107,.18)}

/* 消息日期分隔（今天 / 昨天 / 11 月 19 日） */
.day-sep{display:flex;justify-content:center;margin:12px 0 10px}
.day-sep span{
  font-size:11px;font-weight:600;color:var(--muted);background:rgba(255,255,255,.82);
  border:1px solid var(--line);border-radius:999px;padding:2px 10px;
  box-shadow:0 1px 1px rgba(16,32,38,.04);
}

/* 设置页里的行内控件（自动同步 / 定时同步）：别被 .form input{width:100%} 撑满 */
.row.sched{align-items:center;flex-wrap:wrap;gap:10px}
.row.sched select{width:190px;flex:none}
.row.sched input[type=number]{width:104px;flex:none}
.row.sched input[type=time]{width:132px;flex:none;font-variant-numeric:tabular-nums}
.row.sched .chk{flex:none;margin-left:0}
.row.sched .hint{flex:none;white-space:nowrap}
.row.sched button{flex:none;white-space:nowrap}
.sched-note{margin:4px 16px 6px;line-height:1.75}

/* ---------------- 表单页 ---------------- */
.form{padding-bottom:16px}
.form label{display:block;font-size:12px;font-weight:550;color:var(--muted);margin:14px 16px 6px}
.form input,.form textarea,.form select{width:100%}
/* 表单面板里直接放的输入框/说明，别贴面板边框 */
.form>textarea,.form>input,.form>select{width:calc(100% - 32px);margin:0 16px}
.form>input,.form>select{margin-top:6px}
.form>.hint{margin:6px 16px}
.form textarea{font-family:ui-monospace,monospace;font-size:12.5px}
.form .row{display:flex;gap:8px;margin:0 16px;align-items:center}
.form .row select{width:240px;flex:none}
.form .row2{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin:0 16px}
.form .row2 label{margin-left:0}
.form .actions{margin:18px 16px 0}
.form p.hint{margin:6px 16px}
.form .chk{margin-left:0}
.code{background:#0e1a20;color:#d7e3ea;border:1px solid #1b2b33;border-radius:var(--r-md);padding:11px 13px;margin:6px 16px 14px;font-size:12px;overflow:auto;max-height:240px}
#dbOut,#previewBox{max-height:240px}
pre.code{white-space:pre-wrap;font-family:ui-monospace,monospace}
.ok{color:var(--green)}
.bad{color:var(--red)}
.warnc{color:var(--amber)}

/* ---------------- AI 工具栏 ---------------- */
.ai-bar{display:flex;flex-wrap:wrap;gap:8px 12px;align-items:center;padding:9px 16px;border-bottom:1px solid var(--line-soft);background:var(--panel-2)}
.ai-group{display:flex;align-items:center;gap:6px}
.ai-group .chk{margin-left:0;font-size:11.5px}
.ai-group select{max-width:158px;height:29px;font-size:12.5px}
.ai-bar button{height:29px;padding:0 11px;font-size:12.5px}
.ai-bar button.tiny{height:24px;padding:0 8px;font-size:11.5px}
.ai-bar .hint{font-size:11.5px}
.ai-progress{display:flex;align-items:center;gap:9px;width:100%;padding:7px 16px;border-bottom:1px solid var(--line-soft);background:#f7fbfa}
.ai-progress[hidden]{display:none}
.ai-progress .ap-label{font-size:11px;font-weight:650;color:var(--green-d);letter-spacing:.06em}
.ai-progress .ap-text{font-size:11.5px;font-weight:600;color:var(--green-d);max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ai-progress .bar{flex:1;height:5px;background:#e6ecec;border-radius:99px;overflow:hidden}
.ai-progress .bar i{display:block;height:100%;width:0;background:linear-gradient(90deg,#18a08c,#0d7060);transition:width .25s}
.ai-progress .bar i.warn{background:linear-gradient(90deg,#e0a23a,#a8700c)}
.ai-progress .bar i.err{background:linear-gradient(90deg,#e06a5e,#a4231a)}
.ai-progress button{height:24px;padding:0 9px;font-size:11.5px}

/* 报告 / 画像正文 */
.report-empty{display:flex;flex-direction:column;gap:5px;padding:14px 2px;font-size:12.5px;color:var(--muted)}
/* 按钮进行中：转圈 + 半透明，宽度靠内容自然撑开 */
button.busy{cursor:progress;opacity:.9}
button.busy::after{content:"";display:inline-block;width:9px;height:9px;margin-left:6px;
  border:1.5px solid currentColor;border-right-color:transparent;border-radius:50%;
  animation:bspin .7s linear infinite}
@keyframes bspin{to{transform:rotate(360deg)}}

/* 客户可视化：筛选 + 环状图 / 正态曲线 / 纵向柱 */
.viz-filter{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:0 0 12px;padding:9px 12px;
  background:var(--panel);border:1px solid var(--line);border-radius:var(--r-lg)}
.viz-filter .chips{gap:6px}
/* 环状图：跟着卡片宽度放大，最多 210px，不再固定 132px 缩在左边 */
.vd-wrap{display:flex;align-items:center;justify-content:center;gap:20px;flex-wrap:nowrap}
.vd-ring{position:relative;flex:0 0 50%;max-width:240px;min-width:130px;aspect-ratio:1/1}
.vd-ring svg{width:100%;height:100%;transform:rotate(-90deg)}
.vd-center{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0}
.vd-center b{font-size:clamp(18px,2.4vw,26px);font-weight:750;font-variant-numeric:tabular-nums;line-height:1.1}
.vd-center span{font-size:10.5px;color:var(--muted)}
.vd-legend{display:flex;flex-direction:column;gap:5px;font-size:12px;flex:0 0 auto;min-width:132px;max-width:230px}
.vdl-i{display:flex;align-items:center;gap:7px}
.vdl-dot{width:9px;height:9px;border-radius:3px;flex:none}
.vdl-k{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:112px}
.vdl-v{color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap}
.viz-svg{width:100%;height:auto;display:block}
.vn-bar{fill:#bfe3d9}
.vn-curve{fill:none;stroke:#0d7060;stroke-width:2;stroke-linejoin:round}
.vn-tick{font-size:9px;fill:#8fa0a7}
.vn-meta{display:flex;gap:14px;flex-wrap:wrap;font-size:11.5px;color:var(--muted);margin-top:4px}
.vn-meta b{color:var(--green-d)}
.vc-wrap{display:flex;align-items:flex-end;gap:14px;height:150px;padding-top:6px;justify-content:flex-start}
.vc-col{flex:0 0 74px;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:4px;height:100%}
.vc-n{font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums}
.vc-bar{width:100%;max-width:46px;min-height:4px;background:linear-gradient(180deg,#2fb7a0,#0d7060);
  border-radius:5px 5px 2px 2px;transition:height .25s}
.vc-k{font-size:10.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}

/* 客户页：数据库可视化 */
.viz-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:16px 26px;padding:14px 16px 16px}
@media (max-width:1000px){.viz-grid{grid-template-columns:1fr}}
.viz-title{font-size:12px;font-weight:650;color:var(--green-d);margin-bottom:8px;letter-spacing:.03em}
.viz-bars{display:flex;flex-direction:column;gap:6px}
.viz-bar{display:flex;align-items:center;gap:9px;font-size:12px}
.vb-k{flex:0 0 96px;color:var(--ink-2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.vb-track{flex:1;height:9px;background:#eef2f2;border-radius:99px;overflow:hidden}
.vb-track i{display:block;height:100%;background:linear-gradient(90deg,#18a08c,#0d7060);border-radius:99px;transition:width .25s}
.vb-track i.dim{background:linear-gradient(90deg,#c9d4d2,#a8b6b3)}
.vb-n{flex:0 0 46px;text-align:right;color:var(--muted);font-variant-numeric:tabular-nums}

/* 登录 / 注册 */
.auth{position:fixed;inset:0;z-index:90;display:flex;align-items:center;justify-content:center;
  background:radial-gradient(1200px 600px at 50% -10%,#e8f5f1,#f5f8f8 60%);padding:24px}
.auth[hidden]{display:none}
.auth-box{width:100%;max-width:392px;background:var(--panel);border:1px solid var(--line);border-radius:16px;
  padding:26px 26px 22px;box-shadow:0 18px 50px rgba(11,60,50,.12)}
.auth-brand{font-size:15px;font-weight:700;letter-spacing:.01em;margin-bottom:2px}
.auth-brand span{display:block;font-size:12.5px;font-weight:500;color:var(--muted);margin-top:2px}
.auth-box .subnav{margin:16px 0 8px}
.auth-box label{display:block;font-size:12px;color:var(--muted);margin:12px 0 5px}
.auth-box input{width:100%}
.auth-box .primary{width:100%;height:38px;margin-top:16px}
.auth-hint{min-height:18px;margin-top:8px;font-size:12px;color:#b3261e}
.auth-box>p.hint{margin-top:12px;line-height:1.6}
.whoami{font-size:12px;color:var(--ink-2);background:var(--panel-2);border:1px solid var(--line);
  border-radius:999px;padding:2px 9px;white-space:nowrap;max-width:160px;overflow:hidden;text-overflow:ellipsis}

/* 用户管理 */
.usr-tbl td{vertical-align:middle}
.usr-acc{display:flex;flex-wrap:wrap;gap:4px;max-width:420px}
.usr-form{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;padding:12px 16px 16px}
.usr-form label{display:block;font-size:12px;color:var(--muted);margin:0 0 5px}
.usr-form .full{grid-column:1/-1}
@media (max-width:900px){.usr-form{grid-template-columns:1fr}}

/* 空状态（工作台没有数据时） */
.empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;
  min-height:430px;padding:36px;text-align:center;background:var(--panel);border:1px dashed #d5e2de;
  border-radius:var(--r-lg)}
.empty-state .es-icon{font-size:34px;line-height:1}
.empty-state h3{margin:0;font-size:16px;font-weight:650}
.empty-state .hint{max-width:470px;line-height:1.75;margin:0}
.empty-state .primary{margin-top:6px;height:34px}

/* 导入记录：行可展开看每个文件 */
.run-row{cursor:pointer}
.run-row.open{background:#f4fbf9 !important}
.run-row .chev{display:inline-block;color:var(--muted-2);margin-left:2px;transition:transform .15s}
.run-row.open .chev{transform:rotate(90deg);color:var(--green-d)}
.run-detail>td{padding:0 !important;background:#fafcfc}
.run-detail .inner{border-top:1px solid var(--line-soft)}
.run-detail .inner th{padding:7px 16px;background:#f3f7f6;font-size:11px}
.run-detail .inner td{padding:7px 16px;font-size:12px}

/* 导入页子标签 + 分页 + 折叠 */
.subnav.mini{gap:8px;margin-bottom:14px;border-bottom:0;padding:0}
.subnav.mini button{font-size:12px;padding:5px 10px;border-radius:7px}
.subnav.mini button.on{background:#e9f5f0}
.subnav.mini button.on::after{display:none}
.mwrap>.panel:first-child{margin-top:0}
/* 面板里直接放的说明文字要有左右内边距，不贴着边框 */
#isub-method .panel>p.hint{margin:0;padding:2px 16px 8px}
#isub-method .panel>.hint{padding-left:16px;padding-right:16px}
/* 概览里的分类卡片：可点，数字与说明分两层 */
.card.kind{cursor:pointer;padding:14px 16px 13px}
.card.kind .v{font-size:24px}
.card.kind .hint{font-size:11px;margin-top:2px;display:block}
/* 导入页子标签 + 分页 + 折叠 */
/* 二级标签：下划线式，和顶部一级导航（实心分段）明确区分 */
.subnav{display:flex;gap:20px;margin:0 0 16px;padding:0 2px;border-bottom:1px solid var(--line);flex-wrap:wrap}
.subnav button{position:relative;display:flex;align-items:center;gap:6px;height:auto;padding:0 2px 9px;
  border:0;border-radius:0;background:none;font-size:13px;font-weight:500;color:var(--muted);cursor:pointer;
  transition:color .14s}
.subnav button:hover{color:var(--ink)}
.subnav button.on{color:var(--green-d);font-weight:650}
.subnav button.on::after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:2px;
  background:var(--green);border-radius:2px}
.sn-hint{font-size:11px;color:var(--muted-2)}
.sn-count{min-width:18px;padding:0 5px;border-radius:9px;background:#eef2f2;font-size:11px;
  font-variant-numeric:tabular-nums;text-align:center;color:var(--muted)}
.subnav button.on .sn-count{background:#e3f4ee;color:var(--green-d)}
.subnav button .sn-count:empty{display:none}
.import-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
@media (max-width:1100px){.import-grid{grid-template-columns:1fr}}
.console.short{max-height:190px;min-height:132px}
.pager{display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:8px 2px 0;font-size:12px}
.fold{border-top:1px dashed var(--line-soft);margin-top:12px;padding-top:8px}
.fold summary{cursor:pointer;font-size:12.5px;font-weight:700;color:var(--green-d);padding:2px 0}
.fold table{margin-top:8px}
/* 导入页：上传区 + 小节标题 */
.upload-zone{display:flex;flex-direction:column;align-items:center;gap:6px;padding:18px 14px;
  border:1.5px dashed #cfe0dc;border-radius:10px;background:#fbfdfc;text-align:center;transition:background .15s,border-color .15s}
.upload-zone.drag{background:#eef9f4;border-color:#8ecfbb}
.uz-main{font-size:13px;color:var(--ink-2)}
.upload-list{margin-top:8px;display:flex;flex-direction:column;gap:4px;font-size:12.5px}
.upload-row{display:flex;gap:10px;align-items:center;padding:5px 8px;border:1px solid var(--line-soft);border-radius:8px;background:#fff}
.upload-row .uf{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.upload-row .us{flex:none;font-variant-numeric:tabular-nums}
.upload-row.ok .us{color:#2fa37a}
.upload-row.bad .us{color:#b3261e}
.sub-title{margin:14px 0 6px;font-size:12.5px;font-weight:700;color:var(--green-d);letter-spacing:.02em}
/* 评估前置提示：为什么没有结果 + 手动入口 */
.eval-notice{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:0 0 10px;padding:7px 10px;
  background:#fffaf0;border:1px solid #ffe9c9;border-radius:8px;font-size:12px}
.eval-notice .hint{flex:1;min-width:200px;color:#8a5a00}
.eval-notice .hint.bad{color:#b3261e}
/* 客户画像卡片（没有独立报告时用评分里算出的字段） */
.profile-card{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:6px 14px;
  padding:10px 12px;border:1px solid var(--line-soft);border-radius:8px;background:#fbfdfc;margin-bottom:8px}
.pf-row{display:flex;gap:8px;font-size:12.5px;line-height:1.6}
.pf-k{flex:0 0 64px;color:var(--muted)}
.pf-v{flex:1;min-width:0;word-break:break-word;color:var(--ink-2)}
.pane-body .md{font-size:13px;line-height:1.85;color:var(--ink-2);max-width:1000px}
.pane-body .md h3,.pane-body .md h4,.pane-body .md h5,.pane-body .md h6{
  margin:16px 0 6px;font-size:12.5px;color:var(--green-d);letter-spacing:.02em;
  padding-bottom:4px;border-bottom:1px solid var(--line-soft);
}
.pane-body .md h3:first-child,.pane-body .md h4:first-child,.pane-body .md h5:first-child{margin-top:0;border-bottom:0}
.pane-body .md p{margin:5px 0}
.pane-body .md ul{margin:5px 0;padding-left:18px}
.pane-body .md li{margin:3px 0}
.pane-body .md code{background:#f1f4f5;border-radius:4px;padding:1px 4px;font-size:11.5px;font-family:ui-monospace,monospace}
.pane-body .md b{font-weight:650;color:var(--ink)}

/* ---------------- 三视图版式（会话分析 / 客户画像 / 客户评分） ----------------
   报告与画像共用 .ai-card 卡片(16px) / .ai-head 头部 / .ai-meta 说明行 / .ai-sec 小节
        .ai-sec-h 小节标题 / .ai-kv 键值行 / .ai-table 表格。
   客户评分不走这套小节：它用下面一直保留的 .score-top / .score-big / .score-dims
        .dim-row / .score-text（大分数 + 六条维度条 + 评估/下一步）。 */
.pane-body .ai-card{
  max-width:1000px;padding:16px;border:1px solid var(--line-soft);border-radius:10px;background:#fff;
  font-size:13px;line-height:1.7;color:var(--ink-2);box-sizing:border-box;
}
.ai-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap;
  margin:0 0 14px;padding:0 0 10px;border-bottom:1px solid var(--line)}
.ai-head .spacer{flex:1}
.ai-head .fresh{flex:none}
.ai-meta{font-size:12px;line-height:1.6;color:var(--muted);font-variant-numeric:tabular-nums}
.ai-head-btn{flex:none}
.ai-sec{margin:0 0 16px}
.ai-sec:last-child{margin-bottom:0}
.ai-sec-h{margin:0 0 8px;padding:0 0 5px;font-size:13px;font-weight:650;line-height:1.5;
  color:var(--green-d);letter-spacing:.02em;border-bottom:1px solid var(--line-soft)}
.ai-kv{display:flex;flex-direction:column;gap:5px;font-size:13px;line-height:1.7}
.ai-kv-r{display:grid;grid-template-columns:104px minmax(0,1fr);gap:14px}
.ai-kv-k{font-weight:650;color:var(--ink);word-break:break-word}
.ai-kv-v{min-width:0;color:var(--ink-2);word-break:break-word;white-space:pre-wrap}
.ai-kv-wide{grid-column:1/-1}
.ai-p{margin:0;font-size:13px;line-height:1.7;color:var(--ink-2);white-space:pre-wrap}
.ai-total{font-size:16px;font-weight:650;color:var(--ink)}
.ai-table{width:100%;border-collapse:collapse;font-size:13px;line-height:1.7;margin-top:10px}
.ai-table th{text-align:left;font-size:12px;font-weight:650;color:var(--muted);letter-spacing:.02em;
  padding:0 10px 6px 0;border-bottom:1px solid var(--line)}
.ai-table td{padding:7px 10px 7px 0;border-bottom:1px solid var(--line-soft);vertical-align:top}
.ai-table tr:last-child td{border-bottom:0}
.ai-table .ai-num{width:56px;font-weight:650;font-variant-numeric:tabular-nums;color:var(--ink);white-space:nowrap}
.ai-dim-w{display:block;margin-top:2px;font-size:11.5px;color:var(--muted-2)}
.ai-empty{display:flex;flex-direction:column;gap:5px;font-size:12.5px;color:var(--muted)}
/* 报告正文：字号/行高与小节标题跟上面同一套声明，三处实测值一致 */
.pane-body .ai-card .md{font-size:13px;line-height:1.7;color:var(--ink-2);max-width:100%}
.pane-body .ai-card .md h3,.pane-body .ai-card .md h4,
.pane-body .ai-card .md h5,.pane-body .ai-card .md h6{
  margin:16px 0 8px;padding:0 0 5px;font-size:13px;font-weight:650;line-height:1.5;
  color:var(--green-d);letter-spacing:.02em;border-bottom:1px solid var(--line-soft)}
.pane-body .ai-card .md h3:first-child,.pane-body .ai-card .md h4:first-child,
.pane-body .ai-card .md h5:first-child{margin-top:0;border-bottom:0}
.pane-body .ai-card .md p{margin:5px 0;font-size:13px;line-height:1.7}
.pane-body .ai-card .md ul{margin:5px 0;padding-left:18px}
.pane-body .ai-card .md li{margin:3px 0;font-size:13px;line-height:1.7}

/* ---------------- 弹窗 ---------------- */
.modal{position:fixed;inset:0;background:rgba(13,26,31,.45);backdrop-filter:blur(2px);display:flex;align-items:center;justify-content:center;z-index:50;padding:22px}
.modal[hidden]{display:none}
.modal-box{
  background:#fff;border-radius:14px;width:min(920px,100%);max-height:86vh;
  display:flex;flex-direction:column;overflow:hidden;box-shadow:var(--sh-3);
  animation:pop .16s ease-out;
}
@keyframes pop{from{opacity:0;transform:scale(.985) translateY(4px)}to{opacity:1;transform:none}}
.modal-head{display:flex;align-items:center;gap:10px;padding:13px 18px;border-bottom:1px solid var(--line)}
.modal-head h3{margin:0;font-size:14px;font-weight:650}
.modal-head .spacer{flex:1}

.model-list{margin:8px 16px 0;border:1px solid var(--line);border-radius:var(--r-md);overflow:hidden}
.model-row{display:flex;align-items:flex-start;gap:10px;padding:10px 13px;border-bottom:1px solid var(--line-soft);background:#fff;transition:background .14s}
.model-row:last-child{border-bottom:0}
.model-row:hover{background:#fbfcfd}
.model-row.is-default{background:#f4fbf9}
.m-main{flex:1;min-width:0}
.m-name{font-size:13px;font-weight:600;display:flex;align-items:center;gap:6px}
.m-sub{font-size:11.5px;color:var(--muted);margin-top:2px;word-break:break-all}
.m-sub code{background:#f1f4f5;border-radius:4px;padding:1px 4px;font-size:11px;font-family:ui-monospace,monospace}
.m-hint{margin-top:4px;font-size:11.5px}
.m-actions{display:flex;gap:6px;flex:none;flex-wrap:wrap;justify-content:flex-end}
.m-actions button{height:26px;padding:0 9px;font-size:11.5px}
.mtag{font-size:10px;font-weight:700;border-radius:5px;padding:1px 5px;color:#fff;background:#8a8f94;letter-spacing:.02em}
.mtag.def{background:var(--green)}
.mtag.tr{background:#2f7fd1}
.mtag.an{background:#a8700c}
.model-edit{margin:10px 16px 0;padding:11px 13px 5px;border:1px dashed var(--green-line);border-radius:var(--r-md);background:#f9fdfc}
.model-edit .row2{margin:0}
.model-edit .row{margin:6px 0 0}
.model-roles{display:flex;align-items:flex-end;gap:12px;margin:14px 16px 0;flex-wrap:wrap}
.model-roles>div{display:flex;flex-direction:column;gap:5px}
.model-roles label{margin:0;font-size:12px;color:var(--muted)}
.model-roles select{min-width:200px;height:30px;font-size:12.5px}
.model-roles button{white-space:nowrap;height:30px;font-size:12.5px}
.model-roles .hint{align-self:center}

/* ---------------- Toast ---------------- */
.toast-box{position:fixed;right:20px;bottom:20px;display:flex;flex-direction:column;gap:9px;z-index:80;max-width:430px}
.toast{
  background:#14262c;color:#fff;border-radius:10px;padding:10px 14px;font-size:12.5px;line-height:1.5;
  box-shadow:0 10px 28px rgba(11,26,32,.28);opacity:1;transition:opacity .3s,transform .3s;
  border:1px solid rgba(255,255,255,.08);display:flex;gap:8px;align-items:flex-start;
}
.toast::before{content:"";width:6px;height:6px;border-radius:50%;background:#9fb3bc;flex:none;margin-top:6px}
.toast.ok{background:#0d5f52}
.toast.ok::before{background:#6ee7a8}
.toast.bad{background:#7f1d16}
.toast.bad::before{background:#ffb0a6}
.toast.out{opacity:0;transform:translateY(6px)}

/* ---------------- 客户总表 / 技巧 / 评分 ---------------- */
.filters{display:flex;flex-wrap:wrap;gap:9px;padding:11px 16px;border-bottom:1px solid var(--line-soft);background:var(--panel-2);align-items:center}
.filters select{height:32px;font-size:12.5px}
.filters input{flex:1;min-width:190px;height:32px;font-size:12.5px}
.tbl-wrap{overflow:auto}
.cust-tbl{min-width:1600px}
.cust-tbl td:nth-child(14),.cust-tbl th:nth-child(14){width:78px;text-align:center}
.cust-tbl td:nth-child(15),.cust-tbl th:nth-child(15){width:112px;font-size:12px}
.cust-tbl .active-cell{font-size:12px;color:var(--ink-2);font-variant-numeric:tabular-nums}
.cust-tbl th{white-space:nowrap;position:sticky;top:0;z-index:2}
.cust-tbl th,.cust-tbl td{padding:9px 14px}
.cust-tbl td:nth-child(3),.cust-tbl th:nth-child(3){width:88px}
.cust-tbl td:nth-child(4),.cust-tbl th:nth-child(4){width:116px}
.cust-tbl td:nth-child(5),.cust-tbl th:nth-child(5){width:132px}
.cust-tbl td:nth-child(6),.cust-tbl th:nth-child(6){width:64px}
.cust-tbl td:nth-child(7),.cust-tbl th:nth-child(7){width:112px}
.cust-tbl td:nth-child(8),.cust-tbl th:nth-child(8){width:88px}
.cust-tbl td:nth-child(9),.cust-tbl th:nth-child(9){white-space:nowrap;text-align:center;width:68px}
.cust-tbl td{vertical-align:top}
.cust-name{display:flex;gap:9px;min-width:0}
.cust-name .cav-wrap{min-width:0;flex:1}
.cust-name .cn{font-size:13px;font-weight:600;max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cust-name .cn-zh{font-size:11.5px;line-height:1.45;color:var(--muted);font-weight:500;margin-top:1px;border-radius:5px;cursor:text}
.cust-name .cn-zh:hover{background:#f2faf8;box-shadow:inset 0 0 0 1px var(--green-line)}
.cust-name .cn-zh.is-manual{background:#fffbe8}
.cust-name .cj{font-size:10.5px;color:var(--muted-2);font-family:ui-monospace,monospace;margin-top:1px}
.cust-name .cj.ph{font-size:12.5px;color:var(--ink);font-weight:600;letter-spacing:.3px;font-variant-numeric:tabular-nums}
.cust-name .ctags{margin-top:3px;display:flex;gap:4px;flex-wrap:wrap}
.cust-acc{font-size:11.5px;color:var(--muted);max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cust-tbl .ellip{max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}
.cust-tbl .wrap{font-size:12px;line-height:1.55;white-space:normal;word-break:break-word;min-width:180px;max-width:300px}
.cust-tbl .region-cell{min-width:104px;max-width:150px;font-size:12px;line-height:1.5;white-space:normal;word-break:break-word}
.cust-tbl .editable{cursor:text;border-radius:5px;transition:background .14s,box-shadow .14s}
.cust-tbl .editable:hover{background:#f2faf8;box-shadow:inset 0 0 0 1px var(--green-line)}
.cust-tbl .is-manual{background:#fffbe8}
.cust-tbl .is-manual:hover{background:#fff5d4;box-shadow:inset 0 0 0 1px #e8ce8a}
.cell-edit{width:100%;padding:3px 6px;height:26px;font-size:12px;border:1px solid var(--green);border-radius:5px;background:#fff}
.nowrap{white-space:nowrap}
.cust-act{white-space:nowrap}
.cust-act button{height:26px;padding:0 8px;font-size:11.5px;margin-right:4px}
.cust-foot{display:flex;justify-content:space-between;gap:12px;padding:9px 16px;border-top:1px solid var(--line-soft);flex-wrap:wrap;font-size:12px}
.score-pill{
  display:inline-block;min-width:42px;text-align:center;border-radius:999px;padding:1px 8px;
  font-weight:700;font-size:12px;background:#eef1f2;color:#54656f;font-variant-numeric:tabular-nums;
}
.score-pill.hi{background:#d7f2e4;color:#0c6b41}
.score-pill.mid{background:var(--blue-soft);color:var(--blue)}
.score-pill.low{background:var(--amber-soft);color:var(--amber)}
.score-pill.bad{background:var(--red-soft);color:var(--red)}
.score-pill.na{background:#f0f3f4;color:#7b8790;font-weight:600}

.score-chip{display:inline-block;margin-top:2px;font-size:11px;font-weight:700;border-radius:999px;padding:1px 8px;cursor:pointer;background:#eef1f2;color:#54656f}
.score-chip.hi{background:#d7f2e4;color:#0c6b41}
.score-chip.mid{background:var(--blue-soft);color:var(--blue)}
.score-chip.low{background:var(--amber-soft);color:var(--amber)}
.score-chip.bad{background:var(--red-soft);color:var(--red)}
.score-chip.na{background:#f0f3f4;color:#7b8790}

.score-top{display:flex;gap:18px;align-items:flex-start;padding:4px 0 12px;border-bottom:1px solid var(--line-soft);flex-wrap:wrap}
.score-big{font-size:42px;font-weight:800;line-height:1;color:var(--blue);min-width:92px;letter-spacing:-1px;font-variant-numeric:tabular-nums}
.score-big small{font-size:12px;font-weight:600;margin-left:6px;letter-spacing:0}
.score-big.hi{color:#0c6b41}.score-big.mid{color:var(--blue)}.score-big.low{color:var(--amber)}.score-big.bad{color:var(--red)}
.score-meta{flex:1;min-width:240px}
.score-line{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-bottom:4px}
.score-line b{font-size:13px;color:var(--ink)}
.score-line .chip,.score-tags .chip{background:#f0f3f4;border-radius:6px;padding:1px 7px;font-size:11px;color:var(--ink-2)}
.score-line .chip-grade{background:var(--blue-soft);color:var(--blue);font-weight:700}
.score-tags{display:flex;gap:4px;flex-wrap:wrap;margin-top:4px}
.score-tags .chip{border-radius:999px}
.score-deal{display:flex;flex-direction:column;gap:2px;text-align:right;min-width:110px}
.score-deal b{font-size:16px;font-variant-numeric:tabular-nums;color:var(--ink)}
.score-deal .muted{font-size:11px}
.score-dims{padding:12px 0;display:flex;flex-direction:column;gap:8px;border-bottom:1px solid var(--line-soft)}
.dim-row{display:grid;grid-template-columns:66px 1fr 34px 78px;align-items:center;gap:9px;font-size:12px}
.dim-name{color:var(--ink-2);font-weight:600}
.dim-bar{height:8px;background:#edf1f2;border-radius:99px;overflow:hidden}
.dim-bar i{display:block;height:100%;background:linear-gradient(90deg,#2fa08b,#0d7060);border-radius:99px;transition:width .3s}
.dim-bar i.risk{background:linear-gradient(90deg,#e0a23a,#a4231a)}
.dim-val{text-align:right;font-variant-numeric:tabular-nums;font-weight:650}
.dim-w{font-size:10.5px;white-space:nowrap;color:var(--muted)}
.score-text{padding:10px 0;border-bottom:1px solid var(--line-soft);font-size:12.5px}
.score-text:last-child{border-bottom:0}
.score-text>b{display:block;font-size:12.5px;font-weight:700;color:var(--ink);letter-spacing:.02em}
.score-text p{margin:4px 0 0;line-height:1.75;white-space:pre-wrap;color:var(--ink-2)}
.score-text .next{color:var(--green-d)}
@media (max-width:520px){
  .score-big{font-size:34px;min-width:72px}
  .dim-row{grid-template-columns:56px minmax(0,1fr) 30px;gap:7px}
  .dim-w{display:none}
}

.pb-layout{display:grid;grid-template-columns:1fr 272px;gap:0;min-height:360px}
.pb-main{min-width:0;padding:12px 16px}
.pb-filters{display:flex;gap:9px;align-items:center;margin-bottom:12px;flex-wrap:wrap}
.pb-filters select{height:32px;font-size:12.5px}
.pb-filters input{flex:1;min-width:170px;height:32px;font-size:12.5px}
.pb-filters .chk{margin-left:auto;font-size:11.5px}
.pb-list{display:flex;flex-direction:column;gap:9px}
.pb-item{
  border:1px solid var(--line);border-radius:var(--r-md);padding:11px 13px;background:#fff;
  border-left:3px solid var(--green);box-shadow:var(--sh-1);transition:box-shadow .16s,border-color .16s;
}
.pb-item:hover{box-shadow:var(--sh-2)}
.pb-item.negative{border-left-color:var(--red)}
.pb-item.mixed{border-left-color:#c08a20}
.pb-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.pb-head .spacer{flex:1}
.pb-cat{font-size:10.5px;background:var(--green-soft);color:var(--green-d);border-radius:5px;padding:1px 7px;font-weight:700}
.pb-title{font-size:13px;font-weight:600}
.pb-hits{font-size:11px;color:var(--muted);background:#f0f3f4;border-radius:99px;padding:0 7px}
.pb-head button{height:25px;padding:0 8px;font-size:11px}
.pb-body{font-size:12.5px;line-height:1.7;margin-top:6px;white-space:pre-wrap;color:var(--ink-2)}
.pb-why,.pb-evi{font-size:11.5px;color:var(--ink-2);margin-top:5px;line-height:1.65}
.pb-evi{color:var(--muted);font-style:italic}
.pb-side{border-left:1px solid var(--line);padding:12px 14px;background:var(--panel-2);overflow:auto;max-height:70vh}
.pb-side .side-title{margin-bottom:9px}
.ver-row{display:flex;gap:8px;align-items:flex-start;padding:7px 0;border-bottom:1px solid var(--line-soft);font-size:12px}
.ver-row>div{flex:1;min-width:0}
.ver-note{font-size:11px;color:var(--muted);margin-top:2px}
.ver-row button{height:24px;padding:0 8px;font-size:11px;flex:none}
.pb-edit{margin:0 16px 16px;padding:11px 13px 5px;border:1px dashed var(--green-line);border-radius:var(--r-md);background:#f9fdfc}
.pb-edit .row2{margin:0}
.pb-edit label{display:block;font-size:12px;font-weight:550;color:var(--muted);margin:9px 0 5px}
.pb-edit input,.pb-edit select,.pb-edit textarea{width:100%;font-size:12.5px}
.pb-edit textarea{resize:vertical;font-family:inherit}

/* 勾选框：任何容器里的 input 宽度规则都不许把它拉变形（body 前缀压过 .side-head input 等） */
body input[type=checkbox]{width:16px;height:16px;min-width:0;flex:0 0 auto;padding:0;border-radius:5px}
body .chk > input[type=checkbox]{margin:0}
.chk{flex-wrap:nowrap}

/* ---------------- 响应式 ---------------- */
@media (max-width:1180px){
  .cards{grid-template-columns:repeat(2,1fr)}
  .records{grid-template-columns:196px 250px 1fr}
  /* 会话栏变窄，筛选 chips 收一点，保证五个都在一行且不被截断 */
  .fchips{gap:2px}
  .fchip{font-size:10.5px;padding:0 5px;height:23px}
  .mtab{font-size:12px;padding:8px 4px}
}
@media (max-width:1000px){
  .records{grid-template-columns:200px 1fr}
  .msgs{height:auto;min-height:520px}
  .pane-body{padding:12px 14px 16px}
  .records .side:first-child{grid-column:1;max-height:220px}
  .records .side:nth-child(2){grid-column:2;grid-row:1}
  .records .msgs{grid-column:1 / -1}
}
@media (max-width:860px){
  .records{grid-template-columns:1fr}
  /* 窄屏单列堆叠：清掉 1000px 断点留下的显式列位 */
  .records .side:first-child,
  .records .side:nth-child(2),
  .records .msgs{grid-column:auto;grid-row:auto}
  .form .row2{grid-template-columns:1fr}
  .msgs-head{flex-wrap:wrap}
  .msgs-head input#searchMsgs{width:100%;margin-left:0}
  .top{flex-wrap:wrap;gap:10px}
  .tabs{margin-left:0;order:3;width:100%;overflow:auto}
}
@media (max-width:700px){
  .cards{grid-template-columns:1fr}
  main{padding:14px 12px 32px}
}
@media (prefers-reduced-motion:reduce){
  *{animation:none!important;transition:none!important}
}

/* ---------------- 运维面板 ---------------- */
#tab-ops .pad{padding:16px}
#opsCards{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
@media (max-width:900px){#opsCards{grid-template-columns:repeat(2,1fr)}}
#opsCards .viz-card{background:#fff;border:1px solid rgba(0,0,0,.08);border-radius:10px;padding:12px 14px}
#opsCards .viz-k{font-size:12px;color:#6b7280}
#opsCards .viz-v{font-size:20px;font-weight:600;margin-top:4px;line-height:1.2}
#tab-ops .card-head{display:flex;gap:10px;align-items:baseline;flex-wrap:wrap;padding-bottom:2px}
#tab-ops .card-head .hint{font-size:12px}
#tblOps th{white-space:nowrap;font-weight:600;font-size:12px;padding:8px 10px}
#tblOps td{padding:8px 10px;white-space:nowrap}
#tblOps .qin{padding:4px 6px;border:1px solid rgba(0,0,0,.14);border-radius:6px;font-size:13px}
#tab-ops .kv-row{display:flex;gap:10px;padding:6px 16px;font-size:13px;border-bottom:1px solid rgba(0,0,0,.04)}
#tab-ops .kv-row:last-child{border-bottom:0}
#tab-ops .kv-k{color:#6b7280;width:96px;flex:0 0 auto}

#tblOps{min-width:820px}
#tab-ops .tbl-wrap{overflow-x:auto}

/* 库内账号行内操作：查看 / 删除 */
.row-acts{white-space:nowrap}
.row-acts .link{margin-right:10px}
.row-acts button.danger{opacity:.75}
.row-acts button.danger:hover{opacity:1}

/* 插件在线状态徽标 */
.st{display:inline-flex;align-items:center;gap:5px;font-size:11px;color:var(--muted);white-space:nowrap}
.st-dot{width:6px;height:6px;border-radius:50%;display:inline-block;background:#94a3b8;flex:0 0 auto}
.st-dot.on{background:#12b76a;box-shadow:0 0 0 2px rgba(18,183,106,.16)}
.st-dot.idle{background:#f79009}
.st-dot.off{background:#cbd5e1}
.acc-n .st{margin-left:4px;font-size:10px;gap:4px}

/* 表头不折行（新增插件列后「会话/消息/含正文」被挤成竖排） */
.tbl th{white-space:nowrap}
.tbl th.num,.tbl td.num{white-space:nowrap}

/* 插件运行日志 */
.logs { display:flex; flex-direction:column; gap:2px; max-height:62vh; overflow:auto; font-size:12.5px; }
.logrow { display:flex; gap:10px; align-items:baseline; padding:6px 9px; border-radius:6px; background:#fff; }
.logrow.bad { background:#fff5f5; }
.logrow.warn { background:#fffaf1; }
.logrow .lt { color:#667781; white-space:nowrap; font-variant-numeric:tabular-nums; }
.logrow .lk { flex:0 0 104px; color:#128c7e; font-weight:600; }
.logrow.bad .lk { color:#c62828; }
.logrow.warn .lk { color:#b26a00; }
.logrow .lm { flex:1; min-width:0; word-break:break-word; }
.logrow .lid { color:#98a1a8; font-size:11px; white-space:nowrap; }

/* 消息里的「用哪条推荐发的」标记 */
.msg .ai-s { margin-top:5px; padding:5px 8px; border-left:3px solid #7c5cff; background:#f6f3ff; border-radius:4px; font-size:12px; color:#4a3b7a; display:flex; gap:6px; align-items:baseline; }
.msg .ai-s .ai-tag { background:#7c5cff; color:#fff; }
.msg .ai-s .ai-s-body { flex:1; min-width:0; word-break:break-word; }
.msg .ai-s .ai-mode { margin-left:auto; color:#6b4bd6; font-size:11px; white-space:nowrap; }

/* 账号列表里的设备信息（浏览器 · IP），小字、单行、过长省略 */
.acc-c { display:flex; gap:8px; align-items:baseline; justify-content:space-between; }
.acc-c .acc-dev, #tblAccounts .acc-dev { color:#98a1a8; font-size:11px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:58%; }

/* 浏览器徽标：一眼看出这个号挂在哪个浏览器上 */
.dev-badge { font-size:10.5px; line-height:1; padding:3px 7px; border-radius:999px; border:1px solid currentColor; margin-left:6px; white-space:nowrap; }
.dev-badge.ff { color:#d95f00; background:#fff4e8; }
.dev-badge.cr { color:#1a73e8; background:#eaf1fd; }
.dev-badge.edge { color:#0f6cbd; background:#e8f2fb; }
.dev-badge.sf { color:#5a5a5a; background:#f2f2f2; }
.dev-badge.os { color:#666; background:#f4f4f5; }

/* ===== 发送队列 / 发送台账 ===== */
.q-cards{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;margin-bottom:12px}
.q-card{background:var(--panel);border:1px solid var(--line);border-radius:var(--r-md);padding:12px 14px;box-shadow:var(--sh-1)}
.q-card .qv{font-size:22px;font-weight:700;line-height:1.15;font-variant-numeric:tabular-nums}
.q-card .qt{font-size:12px;color:var(--muted);margin-top:2px}
.q-card.wait .qv{color:var(--amber)}
.q-card.run .qv{color:var(--blue)}
.q-card.ok .qv{color:var(--green)}
.q-card.bad .qv{color:var(--red)}
.q-card.warn .qv{color:var(--amber)}
.q-accs{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:12px;padding:0 16px 16px}
.q-acc{border:1px solid var(--line);border-radius:var(--r-md);padding:10px 12px;background:var(--panel-2)}
.q-acc.off{opacity:.6}
.qa-top{display:flex;align-items:center;gap:8px;margin-bottom:4px}
.qa-top .dot{width:8px;height:8px;border-radius:50%;background:var(--muted-2);flex:0 0 auto}
.qa-top .dot.on{background:#1aa06f;box-shadow:0 0 0 3px rgba(26,160,111,.15)}
.qa-top .mono{font-size:11px;color:var(--muted)}
.qa-line{font-size:12px;color:var(--ink-2);line-height:1.65;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.q-tbl td{font-size:12.5px}
.q-tbl td.q-body{color:var(--ink-2);max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.q-chip{display:inline-block;font-size:11.5px;line-height:18px;padding:0 7px;border-radius:5px;border:1px solid transparent;white-space:nowrap}
.q-chip.ok{background:var(--green-soft);color:var(--green-d);border-color:var(--green-line)}
.q-chip.bad{background:var(--red-soft);color:var(--red)}
.q-chip.warn{background:var(--amber-soft);color:var(--amber)}
.q-chip.info{background:var(--blue-soft);color:var(--blue)}
.q-chip.mute{background:#f1f3f5;color:var(--muted)}
.q-chip.type-manual_reply{background:#eef2ff;color:#3b4f9e}
.q-chip.type-manual_followup{background:#f3ecff;color:#5a2d9e}
.q-chip.type-auto_reply{background:var(--green-soft);color:var(--green-d)}
.q-chip.type-auto_followup{background:var(--amber-soft);color:var(--amber)}
.q-err{color:var(--red)}
.q-note{color:var(--muted)}
@media(max-width:900px){.q-cards{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* ---------------- 消息里的媒体（图片/文件） ---------------- */
.msg-media{margin:0 0 6px;max-width:300px}
.msg-media img{
  display:block;width:auto;max-width:300px;max-height:300px;border-radius:9px;
  border:1px solid rgba(11,32,38,.08);background:#fff;cursor:zoom-in;
}
.msg.me .msg-media img{border-color:rgba(11,97,84,.12)}
.msg-media a.media-file{
  display:inline-flex;align-items:center;gap:7px;max-width:100%;
  padding:7px 10px;border:1px solid var(--line);border-radius:9px;background:var(--panel);
  font-size:12.5px;color:var(--ink-2);text-decoration:none;
}
.msg-media a.media-file:hover{border-color:var(--green-line);color:var(--green-d)}
.msg-media a.media-file .mf-ico{
  flex:0 0 auto;width:18px;height:18px;border-radius:5px;background:var(--green-soft);
  color:var(--green-d);font-size:11px;display:flex;align-items:center;justify-content:center;
}
.msg-media-miss{
  display:flex;align-items:center;gap:8px;width:fit-content;max-width:100%;
  padding:5px 8px;border:1px dashed var(--line);border-radius:9px;
  background:rgba(255,255,255,.55);font-size:11.5px;color:var(--muted);
}
.msg-media-miss button{height:24px;padding:0 8px;font-size:11.5px}
/* 点图放大的浮层 */
.media-viewer{
  position:fixed;inset:0;z-index:95;padding:26px;display:none;
  align-items:center;justify-content:center;background:rgba(9,18,22,.88);cursor:zoom-out;
}
.media-viewer.on{display:flex}
.media-viewer img{max-width:92vw;max-height:92vh;border-radius:8px;box-shadow:0 18px 60px rgba(0,0,0,.45)}
/* 有媒体的气泡按内容收窄，不要整块 76% 宽留一大片空白 */
.msg.has-media{width:fit-content}
.q-chip.type-media{background:#eef4f8;color:#2c5d7d}
.q-chip.type-media_send{background:#eaf3ec;color:#2c6b46}

/* ---------------- 常用文件库 ---------------- */
.lib-toolbar{display:flex;align-items:center;gap:10px;padding:14px 16px 12px}
.lib-toolbar input{flex:1 1 260px;max-width:360px}
.lib-toolbar .hint{margin-left:auto;white-space:nowrap}
.lib-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:12px;padding:0 16px 16px}
.lib-card{display:flex;align-items:stretch;gap:12px;padding:14px;
  border:1px solid var(--line);border-radius:var(--r-md);background:var(--panel-2)}
.lib-card:hover{border-color:var(--green-line);background:#fff}
.lib-thumb{flex:0 0 84px;width:84px;height:84px;align-self:flex-start;border-radius:8px;overflow:hidden;
  border:1px solid var(--line-soft);background:#fff;display:flex;align-items:center;justify-content:center}
.lib-thumb img{width:100%;height:100%;object-fit:contain;display:block}
.lib-ext{font:600 11px/1 ui-monospace,monospace;color:var(--muted);letter-spacing:.5px}
.lib-main{display:flex;flex-direction:column;min-width:0;flex:1}
.lib-title{font-size:13px;font-weight:650;color:var(--ink);line-height:1.45;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lib-sub{font-size:11.5px;color:var(--muted);margin-top:3px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lib-note{font-size:12px;color:var(--ink-2);margin-top:6px;line-height:1.55;overflow-wrap:anywhere;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.lib-acts{display:flex;gap:6px;margin-top:auto;padding-top:10px}
.lib-card .lib-acts button{height:24px;padding:0 8px;font-size:11.5px}

/* 发文件弹层 */
.file-pop{position:fixed;z-index:75;width:360px;max-height:430px;display:flex;flex-direction:column;
  background:var(--panel);border:1px solid var(--line);border-radius:var(--r-lg);box-shadow:var(--sh-3)}
.file-pop[hidden]{display:none}
.fp-head{display:flex;gap:8px;padding:10px 12px;border-bottom:1px solid var(--line-soft)}
.fp-head input{flex:1;min-width:0;height:30px}
.fp-head button{flex:0 0 auto;height:30px}
.fp-list{flex:1;overflow:auto;padding:6px}
.fp-list .empty{font-size:12px;line-height:1.7}
.fp-item{display:flex;gap:10px;align-items:center;padding:7px 8px;border-radius:8px;cursor:pointer}
.fp-item:hover{background:var(--green-soft)}
.fp-thumb{flex:0 0 36px;width:36px;height:36px;border-radius:6px;overflow:hidden;background:#eef2f3;display:flex;align-items:center;justify-content:center}
.fp-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.fp-main{min-width:0}
.fp-title{font-size:12.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fp-sub{font-size:11px;color:var(--muted);margin-top:1px}
.fp-foot{display:flex;align-items:center;gap:8px;padding:8px 12px;border-top:1px solid var(--line-soft)}
.fp-foot .hint{font-size:10.5px;margin-left:auto;text-align:right}
