/* 获客系统后台样式 v1 */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: #f5f7fa;
  color: #333;
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Microsoft YaHei", "PingFang SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 208px; flex: 0 0 208px;
  background: linear-gradient(180deg, #143278 0%, #0e2358 100%);
  color: #fff; display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
}
.brand { padding: 20px 20px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand b { display: block; font-size: 16px; letter-spacing: .5px; }
.brand span { display: block; font-size: 12px; color: rgba(255,255,255,.55); margin-top: 4px; }
.nav { padding: 10px 0; flex: 1 0 auto; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px; color: rgba(255,255,255,.78);
  text-decoration: none; font-size: 14px; border-left: 3px solid transparent;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.on { background: rgba(30,111,235,.28); border-left-color: #1E6FEB; color: #fff; }
.nav a.mute { color: rgba(255,255,255,.35); pointer-events: none; }
.nav a i { font-style: normal; width: 18px; text-align: center; opacity: .9; }
.sidebar .foot { padding: 14px 20px; font-size: 12px; color: rgba(255,255,255,.4); border-top: 1px solid rgba(255,255,255,.08); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 58px; background: #fff; display: flex; align-items: center;
  padding: 0 24px; border-bottom: 1px solid #eceff3; gap: 14px;
}
.topbar h2 { margin: 0; font-size: 17px; color: #143278; font-weight: 600; }
.topbar .sp { flex: 1; }
.topbar .who { color: #666; font-size: 13px; }
.topbar a.quit { color: #1E6FEB; text-decoration: none; font-size: 13px; }
.page { padding: 22px 24px 40px; }

/* ---------- 通用组件 ---------- */
.card { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(20,50,120,.06); padding: 18px 20px; }
.card + .card { margin-top: 16px; }
.card h3 { margin: 0 0 14px; font-size: 15px; color: #143278; font-weight: 600; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.muted { color: #888; }
.tiny { font-size: 12px; }

input[type=text], input[type=password], input[type=date], select, textarea {
  height: 34px; padding: 0 10px; border: 1px solid #dcdfe6; border-radius: 4px;
  font-size: 14px; color: #333; background: #fff; outline: none;
}
textarea { height: auto; padding: 8px 10px; line-height: 1.7; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #1E6FEB; }
button, .btn {
  height: 34px; padding: 0 18px; border: 0; border-radius: 4px; cursor: pointer;
  background: #1E6FEB; color: #fff; font-size: 14px;
}
button:hover, .btn:hover { background: #1660d0; }
.btn.ghost { background: #fff; color: #1E6FEB; border: 1px solid #b9d2fb; }
.btn.ghost:hover { background: #f2f7ff; }
.btn.sm { height: 28px; padding: 0 12px; font-size: 13px; }

/* ---------- 指标卡 ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { background: #fff; border-radius: 8px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(20,50,120,.06); }
.stat .n { font-size: 26px; font-weight: 600; color: #143278; line-height: 1.2; }
.stat .l { color: #888; font-size: 13px; margin-top: 4px; }
.stat .d { color: #1E6FEB; font-size: 12px; margin-top: 6px; }

/* ---------- 表格 ---------- */
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 10px 12px; border-bottom: 1px solid #f0f2f5; text-align: left; }
th { background: #fafbfc; color: #666; font-weight: 500; font-size: 13px; white-space: nowrap; }
td { font-size: 13px; }
tr:hover td { background: #f9fbff; }
td.num, th.num { font-variant-numeric: tabular-nums; }
td.empty { text-align: center; color: #aaa; padding: 46px 0; }
a.link { color: #1E6FEB; text-decoration: none; }
a.link:hover { text-decoration: underline; }

/* ---------- 徽标 ---------- */
.tag { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 12px; line-height: 18px; }
.tag.S { background: #fff1e6; color: #d9600b; }
.tag.A { background: #eaf3ff; color: #1E6FEB; }
.tag.B { background: #f2f4f7; color: #666; }
.tag.C { background: #f7f7f7; color: #999; }
.tag.st1 { background: #eaf3ff; color: #1E6FEB; }
.tag.st2 { background: #edf7ee; color: #2a8c3f; }
.tag.st3 { background: #f0f6ff; color: #3a6fd8; }
.tag.st6 { background: #fff4e5; color: #c47b00; }
.tag.st10 { background: #fdeeee; color: #c33; }
.tag.st11 { background: #f5f5f5; color: #999; }

/* ---------- 分页 ---------- */
.pager { margin-top: 14px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pg {
  display: inline-block; min-width: 32px; height: 30px; line-height: 30px; text-align: center;
  border: 1px solid #dcdfe6; border-radius: 4px; color: #333; text-decoration: none; padding: 0 8px;
  background: #fff;
}
.pg.cur { background: #1E6FEB; color: #fff; border-color: #1E6FEB; }
.pager .sum { margin-left: auto; color: #888; font-size: 13px; }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #143278 0%, #1E6FEB 100%);
}
.login-card { width: 360px; background: #fff; border-radius: 10px; padding: 32px 30px 26px; box-shadow: 0 18px 50px rgba(0,0,0,.25); }
.login-card h1 { margin: 0 0 6px; font-size: 20px; color: #143278; }
.login-card p { margin: 0 0 22px; color: #999; font-size: 13px; }
.login-card label { display: block; font-size: 13px; color: #666; margin: 12px 0 6px; }
.login-card input { width: 100%; height: 40px; }
.login-card button { width: 100%; height: 40px; margin-top: 22px; font-size: 15px; }
.login-msg { min-height: 18px; color: #c33; font-size: 13px; margin-top: 10px; }

/* ---------- 详情页 ---------- */
.detail-head { display: flex; align-items: center; gap: 14px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: #eaf3ff; color: #1E6FEB; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 600; }
.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 24px; }
.kv div { color: #555; font-size: 13px; }
.kv b { color: #333; font-weight: 500; }

/* ---------- 待触达行 ---------- */
.qrow { align-items: flex-start; }
.qhead { width: 220px; flex: 0 0 220px; }
.qbody { flex: 1; min-width: 0; }
.qact { width: 160px; flex: 0 0 160px; display: flex; flex-direction: column; gap: 6px; }
.qact > button, .qact > .btn { width: 100%; height: 32px; padding: 0 10px; font-size: 13px; }
.dmLen { color: #aaa; }
.sent-row { padding: 9px 0; border-top: 1px solid #f0f2f5; }
.sent-row:first-of-type { border-top: 0; }

/* ---------- 待触达头部 / 分类页签 ---------- */
.qbar { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.qnum { display: flex; align-items: baseline; gap: 6px; color: #666; font-size: 13px; }
.qnum b { font-size: 20px; color: #143278; font-weight: 600; line-height: 1.1; }
.qtools { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.tabs { display: flex; gap: 2px; margin: 16px 0 10px; border-bottom: 1px solid #eceff3; overflow-x: auto; }
.tab {
  padding: 9px 16px; font-size: 14px; color: #666; text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tab:hover { color: #1E6FEB; }
.tab i { font-style: normal; font-size: 12px; background: #eef2f8; color: #5b6b85; border-radius: 9px; padding: 1px 7px; margin-left: 5px; }
.tab.on { color: #1E6FEB; border-bottom-color: #1E6FEB; font-weight: 600; }
.tab.on i { background: #e7f0ff; color: #1E6FEB; }
.qhint { margin-top: 2px; line-height: 1.7; }

/* ---------- 自适应（手机看线上大屏 / 平板） ---------- */
@media (max-width: 900px) {
  .layout { display: block; }
  .sidebar { width: auto; flex: none; position: sticky; top: 0; z-index: 30; }
  .brand { padding: 12px 14px 8px; display: flex; align-items: baseline; gap: 8px; }
  .brand b { font-size: 15px; }
  .brand span { margin-top: 0; }
  .nav { display: flex; overflow-x: auto; padding: 0 4px 8px; flex: none; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 8px 12px; border-left: 0; border-bottom: 2px solid transparent; white-space: nowrap; font-size: 13px; }
  .nav a.on { background: transparent; border-bottom-color: #1E6FEB; }
  .nav a i { display: none; }
  .sidebar .foot { display: none; }

  .topbar { height: auto; padding: 10px 14px; flex-wrap: wrap; gap: 8px; }
  .topbar h2 { font-size: 16px; }
  .page { padding: 14px 12px 36px; }

  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 14px 16px; }
  .stat .n { font-size: 22px; }
  .kv { grid-template-columns: 1fr; gap: 6px; }

  .card { padding: 14px; }
  .row { gap: 10px; }
  .detail-head { flex-wrap: wrap; }

  /* 表格横向滚动，不压缩变形 */
  .tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .card table { display: block; overflow-x: auto; white-space: nowrap; }

  /* 输入框撑满一行，避免固定宽度溢出 */
  input[type=text], input[type=password], input[type=date], select, textarea { max-width: 100%; }
  .card input[style*="width"], .card select[style*="width"] { width: 100% !important; }

  /* 待触达：三段竖排，按钮横排铺开 */
  .qrow { flex-direction: column; }
  .qhead, .qact { min-width: 0; width: 100%; }
  .qbody { width: 100%; }
  .qact { flex-direction: row; flex-wrap: wrap; }
  .qact > button, .qact > .btn { flex: 1 1 45%; }
  .qact > .btn { display: flex; align-items: center; justify-content: center; }
}

/* ── 主机 / 平台 选择条（侧栏顶部） ── */
.ctx { padding: 0 12px 10px; }
.ctxrow { display: flex; align-items: center; gap: 6px; }
.ctxlab { font-size: 11px; color: #8a94a6; letter-spacing: .5px; flex: none; }
.hostsel { flex: 1; min-width: 0; height: 30px; font-size: 12px; padding: 0 6px;
  border: 1px solid #dfe4ee; border-radius: 6px; background: #fff; color: #143278; }
.hostsel:focus { border-color: #1E6FEB; outline: none; }
.ctxlink { color: #8a94a6; font-size: 13px; text-decoration: none; flex: none; }
.ctxlink:hover { color: #1E6FEB; }
/* 平台：直接平铺列出，不折叠 */
.plats { display: flex; flex-direction: column; gap: 1px; margin-top: 5px; }
.plats a { display: flex; align-items: center; gap: 8px; height: 27px; padding: 0 8px 0 10px;
  border-radius: 6px; color: rgba(255,255,255,.72); font-size: 13px; text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plats a i { font-style: normal; width: 15px; flex: none; text-align: center;
  font-size: 12px; color: rgba(255,255,255,.5); }
.plats a:hover { background: rgba(255,255,255,.08); color: #fff; }
.plats a.on { background: rgba(30,111,235,.55); color: #fff; font-weight: 600; }
.plats a.on i { color: #fff; }
.ctxrow2 { margin-top: 10px; }
.ctxsp { flex: 1; }
/* 待触达：各平台小队列 */
.platstat { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 2px; }
.platstat .ps { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid #e6eaf2;
  border-radius: 8px; background: #fff; text-decoration: none; color: #5a6478; font-size: 12px; }
.platstat .ps b { color: #143278; font-size: 12.5px; }
.platstat .ps span { color: #6b7688; }
.platstat .ps i { font-style: normal; color: #1E6FEB; }
.platstat .ps em { font-style: normal; font-size: 11px; color: #b07d00; background: #FFF6DE; padding: 1px 6px; border-radius: 999px; }
.platstat .ps.on { border-color: #1E6FEB; background: #f2f7ff; box-shadow: 0 0 0 2px rgba(30,111,235,.08); }
.platstat .ps:hover { border-color: #b9d2fb; }
.plat-tag { background: #f2f6fd; color: #3f5b8a; }
/* 线索池内嵌的导入面板 */
.impbox { background: #f6faff; border: 1px solid #e2ecfb; border-radius: 8px; padding: 14px 16px; margin-bottom: 14px; }
.impbox .row { gap: 10px; margin-bottom: 0; }
.impbox input[type=text], .impbox select { height: 34px; }
.impok { background: #fff; border: 1px solid #dbe9fb; border-radius: 6px; padding: 8px 12px; font-size: 13px; color: #3f5b8a; }
.impok b { color: #1E6FEB; }
/* 本机任务 */
.srvrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.srv { font-size: 12.5px; padding: 5px 12px; border-radius: 999px; border: 1px solid #e6eaf2; background: #fff; color: #5a6478; }
.srv.ok { border-color: #cfe8d9; background: #f3fbf6; color: #1b7a4d; }
.srv.bad { border-color: #f3d4d4; background: #fdf5f5; color: #b83b3b; }
.srv.idle { border-color: #e6eaf2; background: #fafbfc; color: #7a8494; }
.jobargs { margin-top: 2px; word-break: break-all; max-width: 460px; }
.jobact { display: flex; gap: 6px; }
.oktxt { color: #1b7a4d; }
.badtxt { color: #b83b3b; }
.aqbox summary { cursor: pointer; font-weight: 600; color: #143278; font-size: 14px; }
.aqbox summary::-webkit-details-marker { color: #1E6FEB; }
/* 达人库 */
.dbtop { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.dbstat { display: flex; align-items: baseline; gap: 6px; }
.dbstat b { font-size: 20px; color: #143278; }
.dbstat span { font-size: 12.5px; color: #6b7688; }
.remarkbox { margin-top: 14px; border-top: 1px dashed #eef1f6; padding-top: 12px; }
.remarkbody { font-size: 13px; color: #3f4a5c; white-space: pre-line; background: #fafbfd; border: 1px solid #eef1f6; border-radius: 6px; padding: 8px 10px; }
.rmk { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumb { font-size: 12px; color: #6b7688; background: #f2f6fd; padding: 4px 10px; border-radius: 999px; margin-right: 10px; }

@media (max-width: 900px) {
  /* 顶栏横滑时，主机 + 平台也排成一行跟着滑 */
  .ctx { display: flex; align-items: center; gap: 10px; overflow-x: auto; padding: 0 4px 8px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .ctx::-webkit-scrollbar { display: none; }
  .ctxrow { flex: none; }
  .hostsel { width: 118px; }
  .ctxrow2 { margin-top: 0; }
  .ctxrow2 .ctxsp { display: none; }
  .plats { flex-direction: row; margin-top: 0; gap: 6px; flex: none; }
  .plats a { height: 26px; padding: 0 10px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; }
  .plats a.on { background: #1E6FEB; border-color: #1E6FEB; }
  .crumb { display: none; }
}

@media (max-width: 480px) {
  .stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat { padding: 12px 14px; }
  .stat .n { font-size: 20px; }
  .stat .l { font-size: 12px; }
  .stat .d { font-size: 11px; }
  .login-card { width: auto; margin: 0 16px; padding: 26px 22px; }
  .page { padding: 12px 10px 30px; }
  .nav a { padding: 7px 10px; font-size: 12px; }
}

/* ---- 抖音私信未读条（W27） ---- */
.msgbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;border:1px solid #e5e8ef;background:#f8fafc;border-radius:10px;padding:9px 12px;margin:12px 0 4px}
.msgbar.has{background:#FFF7E8;border-color:#FFD79A}
.mbmain{display:flex;align-items:center;gap:8px;white-space:nowrap}
.mbmain b{font-size:13px}
.mbnum{background:#FF8C00;color:#fff;border-radius:9px;padding:1px 8px;font-size:12px;font-weight:600}
.mbtags{display:flex;flex-wrap:wrap;gap:6px;flex:1 1 auto}
.mtag{font-size:12px;background:#fff;border:1px solid #d9e2f2;color:#1E6FEB;border-radius:12px;padding:2px 9px;text-decoration:none;line-height:17px}
.mtag.plain{color:#555;border-color:#e2e6ee;background:#fbfcfe}
.msgbar .btn{margin-left:auto}
