/* ==========================================================================
   太乙堂连锁门店客户管理系统 — 样式表
   移动优先，兼容微信内置浏览器 / 360 / 搜狗
   ========================================================================== */

:root {
  --bg: #f2f4f1;
  --card: #ffffff;
  --ink: #17211f;
  --ink-2: #3d4a46;
  --sub: #6b7873;
  --faint: #98a29e;
  --line: #e4e8e4;
  --line-2: #eef1ee;

  --brand: #0f6b5c;
  --brand-2: #148a77;
  --brand-soft: #e6f2ee;
  --brand-ink: #0a4d42;

  --gold: #a8763c;
  --gold-soft: #f7efe2;

  --danger: #b4433a;
  --danger-soft: #fbecea;
  --warn: #a1741f;
  --warn-soft: #fbf3e0;
  --ok: #1c7a52;
  --ok-soft: #e8f4ed;
  --blue: #2f6690;
  --blue-soft: #eaf1f7;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(23, 33, 31, .04), 0 6px 18px -10px rgba(23, 33, 31, .18);
  --shadow-lg: 0 12px 40px -12px rgba(23, 33, 31, .28);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tabh: 58px;
  --topbar: 54px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body { overscroll-behavior-y: none; }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; }
a { color: var(--brand); text-decoration: none; }
img { max-width: 100%; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #d3d9d5; border-radius: 3px; }

/* ---------------------------------------------------------------- 登录 */

.login-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 24px calc(32px + var(--safe-b));
  background:
    radial-gradient(120% 70% at 100% 0%, #dcece5 0%, rgba(220, 236, 229, 0) 60%),
    radial-gradient(100% 60% at 0% 100%, #efe7d9 0%, rgba(239, 231, 217, 0) 55%),
    #f6f7f4;
}

.login-brand { margin-bottom: 30px; }
.login-seal {
  width: 54px; height: 54px; border-radius: 14px;
  background: linear-gradient(145deg, var(--brand-2), var(--brand-ink));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 600; letter-spacing: -1px;
  box-shadow: 0 8px 20px -8px rgba(15, 107, 92, .6);
  margin-bottom: 16px;
}
.login-title {
  font-size: 25px; font-weight: 600; letter-spacing: .5px;
  font-family: "Songti SC", "STSong", "SimSun", serif;
}
.login-sub { color: var(--sub); font-size: 13.5px; margin-top: 6px; letter-spacing: .3px; }

.login-card {
  background: var(--card);
  border-radius: 18px;
  padding: 22px 18px 18px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(228, 232, 228, .8);
}

.login-tip {
  margin-top: 18px;
  font-size: 12px;
  color: var(--sub);
  line-height: 1.9;
}
.login-tip b { color: var(--ink-2); font-weight: 500; }

.quick-accounts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.qa-chip {
  font-size: 12px; padding: 6px 10px; border-radius: 8px;
  background: #f4f6f3; color: var(--ink-2); border: 1px solid var(--line);
}

/* ---------------------------------------------------------------- 布局 */

.shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.content-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar);
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px;
  background: rgba(246, 247, 244, .92);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line-2);
}
.tb-title { font-size: 17px; font-weight: 600; letter-spacing: .3px; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-sub { font-size: 12px; color: var(--sub); font-weight: 400; margin-left: 8px; }
.tb-actions { display: flex; align-items: center; gap: 8px; }

.main {
  flex: 1;
  padding: 14px 14px calc(var(--tabh) + 26px + var(--safe-b));
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
}

.sidebar { display: none; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex;
  height: calc(var(--tabh) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 10.5px; color: var(--faint); position: relative; padding-top: 2px;
}
.tab.active { color: var(--brand); }
.tab.active::before {
  content: ''; position: absolute; top: -1px; left: 50%; transform: translateX(-50%);
  width: 22px; height: 2px; border-radius: 2px; background: var(--brand);
}
.tab-ico { display: flex; }

@media (min-width: 900px) {
  .shell { flex-direction: row; }
  .sidebar {
    display: flex; flex-direction: column;
    width: 218px; flex: 0 0 218px;
    background: #fbfcfa;
    border-right: 1px solid var(--line);
    position: sticky; top: 0; height: 100vh;
    padding: 18px 12px 14px;
  }
  .tabbar { display: none; }
  .topbar {
    position: sticky; height: 62px; padding: 0 26px;
    background: rgba(242, 244, 241, .94);
  }
  .tb-title { font-size: 19px; }
  .main { padding: 20px 26px 40px; max-width: 1060px; }
  .content-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
}

/* 桌面侧栏 */
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.sb-logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(145deg, var(--brand-2), var(--brand-ink));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 600;
}
.sb-name { font-size: 15px; font-weight: 600; letter-spacing: .3px; font-family: "Songti SC", "STSong", serif; }
.sb-sub { font-size: 10.5px; color: var(--faint); letter-spacing: .6px; }

.sb-nav { display: flex; flex-direction: column; gap: 2px; }
.sb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 9px; font-size: 13.5px; color: var(--ink-2);
}
.sb-item:hover { background: #f1f4f1; }
.sb-item.active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 500; }
.sb-item .badge { margin-left: auto; }

.sb-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.sb-user { display: flex; align-items: center; gap: 9px; padding: 6px 6px; border-radius: 9px; }
.sb-user:hover { background: #f1f4f1; }
.sb-uname { font-size: 13px; font-weight: 500; line-height: 1.2; }
.sb-urole { font-size: 11px; color: var(--faint); }

/* ---------------------------------------------------------------- 通用组件 */

.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 14px;
}
.card + .card { margin-top: 12px; }
.card-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 10px; }
.card-title { font-size: 14px; font-weight: 600; letter-spacing: .2px; }
.card-sub { font-size: 12px; color: var(--sub); }

.section-title {
  font-size: 12.5px; color: var(--sub); font-weight: 500;
  margin: 18px 2px 8px; letter-spacing: .6px;
}
.section-title:first-child { margin-top: 4px; }

.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--sub); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.mono { font-variant-numeric: tabular-nums; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.center { text-align: center; }
.hidden { display: none !important; }
.mt6 { margin-top: 6px; } .mt10 { margin-top: 10px; } .mt14 { margin-top: 14px; }
.mb6 { margin-bottom: 6px; } .mb10 { margin-bottom: 10px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 42px; padding: 0 16px; border-radius: 11px;
  background: var(--brand); color: #fff;
  font-size: 14.5px; font-weight: 500; letter-spacing: .3px;
  transition: transform .12s ease, opacity .12s ease, background .12s;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn:active { transform: scale(.975); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-ghost { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:active { background: #f6f8f5; }
.btn-soft { background: var(--brand-soft); color: var(--brand-ink); }
.btn-danger { background: var(--danger); }
.btn-danger-soft { background: var(--danger-soft); color: var(--danger); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn-xs { height: 27px; padding: 0 9px; font-size: 12px; border-radius: 7px; font-weight: 400; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 10px; background: #fff; color: var(--ink-2); border: 1px solid var(--line); }
.btn-link { color: var(--brand); font-size: 13px; display: inline-flex; align-items: center; gap: 3px; }

.fab {
  position: fixed; right: 16px; z-index: 45;
  bottom: calc(var(--tabh) + 18px + var(--safe-b));
  height: 46px; padding: 0 18px 0 14px; border-radius: 23px;
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--brand); color: #fff; font-size: 14px; font-weight: 500;
  box-shadow: 0 10px 26px -8px rgba(15, 107, 92, .65);
}
.fab.off { background: #fff; color: var(--brand); border: 1.5px solid var(--brand); box-shadow: 0 8px 22px -10px rgba(23,33,31,.4); }
.fab:active { transform: scale(.96); }
@media (min-width: 900px) { .fab { bottom: 26px; right: 26px; } }

/* 状态标签 */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; line-height: 1; padding: 5px 8px; border-radius: 6px;
  background: #f2f4f2; color: var(--sub); white-space: nowrap;
}
.chip-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.st-pending { background: var(--warn-soft); color: var(--warn); }
.st-assigned { background: var(--blue-soft); color: var(--blue); }
.st-contacted { background: #eef0fb; color: #4a54a8; }
.st-wechat { background: var(--ok-soft); color: var(--ok); }
.st-deal { background: var(--brand-soft); color: var(--brand-ink); }
.st-invalid { background: #f1f2f2; color: var(--faint); }
.tag {
  display: inline-block; font-size: 11.5px; padding: 3px 7px; border-radius: 5px;
  background: #f5f6f4; color: var(--ink-2); border: 1px solid var(--line-2);
}
.tag-cat { background: var(--gold-soft); color: var(--gold); border-color: transparent; }

.badge {
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
}

/* 筛选条 */
.filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.chipbar { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
.chipbar::-webkit-scrollbar { display: none; }
.fchip {
  flex: 0 0 auto; height: 30px; padding: 0 12px; border-radius: 15px;
  background: #fff; border: 1px solid var(--line); color: var(--ink-2);
  font-size: 12.5px; display: inline-flex; align-items: center; gap: 5px;
}
.fchip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.fchip .n { opacity: .65; font-size: 11px; }

.search {
  display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 12px; border-radius: 10px;
  background: #fff; border: 1px solid var(--line); color: var(--faint);
}
.search input { flex: 1; border: none; outline: none; background: transparent; font-size: 13.5px; color: var(--ink); }
.search input::placeholder { color: var(--faint); }

/* 列表行 */
.list { display: flex; flex-direction: column; gap: 9px; }
.item {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 13px; display: flex; gap: 11px; align-items: flex-start;
  box-shadow: 0 1px 2px rgba(23,33,31,.03);
  transition: background .12s;
}
.item:active { background: #fafbf9; }
.avatar {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: var(--brand-ink);
  font-size: 15px; font-weight: 600;
}
.avatar.f { background: #f6eef0; color: #9c5560; }
.item-name { font-size: 14.5px; font-weight: 600; letter-spacing: .2px; }
.item-meta { font-size: 11.5px; color: var(--sub); margin-top: 2px; }
.item-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.item-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

/* 统计卡 */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 13px;
}
.stat-k { font-size: 11.5px; color: var(--sub); letter-spacing: .3px; }
.stat-v { font-size: 23px; font-weight: 600; letter-spacing: -.5px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat-v small { font-size: 12px; font-weight: 400; color: var(--sub); margin-left: 3px; letter-spacing: 0; }
.stat-d { font-size: 11px; color: var(--faint); margin-top: 1px; }
@media (min-width: 640px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }

/* 表单 */
.field { margin-bottom: 13px; }
.field:last-child { margin-bottom: 0; }
.label { font-size: 12.5px; color: var(--ink-2); font-weight: 500; margin-bottom: 6px; display: flex; align-items: center; gap: 5px; }
.label .req { color: var(--danger); font-size: 12px; }
.label .hint { font-size: 11px; color: var(--faint); font-weight: 400; margin-left: auto; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line); background: #fcfdfc;
  border-radius: 10px; padding: 10px 11px; font-size: 14.5px; outline: none;
  transition: border-color .15s, background .15s;
  -webkit-appearance: none; appearance: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand-2); background: #fff; }
.input::placeholder, .textarea::placeholder { color: #b3bbb7; }
.textarea { min-height: 78px; resize: vertical; line-height: 1.6; }
.select {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7873' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.seg { display: flex; background: #f2f4f2; border-radius: 10px; padding: 3px; gap: 3px; }
.seg button {
  flex: 1; height: 34px; border-radius: 8px; font-size: 13.5px; color: var(--sub);
}
.seg button.on { background: #fff; color: var(--ink); font-weight: 500; box-shadow: 0 1px 3px rgba(23,33,31,.1); }

.readonly-box {
  background: #f6f8f5; border: 1px dashed var(--line); border-radius: 10px;
  padding: 10px 11px; font-size: 13px; color: var(--ink-2);
  display: flex; flex-wrap: wrap; gap: 6px 14px;
}
.readonly-box span b { font-weight: 500; color: var(--ink); }

/* 项目多选 */
.pick-group { margin-bottom: 10px; }
.pick-group:last-child { margin-bottom: 0; }
.pick-hd { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--sub); margin-bottom: 6px; }
.pick-hd .line { flex: 1; height: 1px; background: var(--line-2); }
.picks { display: flex; flex-wrap: wrap; gap: 7px; }
.pick {
  padding: 7px 11px; border-radius: 8px; font-size: 13px;
  background: #f8f9f7; border: 1px solid var(--line); color: var(--ink-2);
  transition: all .13s;
}
.pick.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 上传 */
.uploader { display: flex; flex-wrap: wrap; gap: 8px; }
.up-thumb { width: 74px; height: 74px; border-radius: 9px; overflow: hidden; position: relative; border: 1px solid var(--line); background: #f6f7f5; }
.up-thumb img { width: 100%; height: 100%; object-fit: cover; }
.up-del {
  position: absolute; top: 3px; right: 3px; width: 19px; height: 19px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 12px; line-height: 1;
}
.up-add {
  width: 74px; height: 74px; border-radius: 9px; border: 1px dashed #c8d2cc;
  background: #fafbf9; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--faint); font-size: 11px;
}
.up-add input { display: none; }

/* 详情 */
.detail-hd { display: flex; gap: 12px; align-items: center; }
.detail-name { font-size: 19px; font-weight: 600; letter-spacing: .3px; }
.detail-meta { font-size: 12px; color: var(--sub); margin-top: 2px; }
.kv { display: flex; flex-wrap: wrap; gap: 4px 0; }
.kv-item { width: 50%; font-size: 12.5px; color: var(--sub); padding: 4px 0; }
.kv-item b { color: var(--ink); font-weight: 500; }
@media (max-width: 348px) { .kv-item { width: 100%; } }

.att-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.att { border-radius: 9px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 1; background: #f6f7f5; }
.att img { width: 100%; height: 100%; object-fit: cover; }

.status-switches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sw {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 8px; text-align: center;
  background: #fbfcfa; font-size: 12.5px; color: var(--sub); transition: all .15s;
}
.sw.on { background: var(--brand-soft); border-color: #bfe0d6; color: var(--brand-ink); font-weight: 500; }
.sw .sw-ico { display: flex; justify-content: center; margin-bottom: 3px; }

/* 时间轴 */
.timeline { position: relative; padding-left: 18px; }
.timeline::before {
  content: ''; position: absolute; left: 4px; top: 6px; bottom: 6px;
  width: 1.5px; background: linear-gradient(180deg, #cfe3da, #e9eeeb);
}
.tl-item { position: relative; padding-bottom: 15px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ''; position: absolute; left: -18px; top: 5px;
  width: 8px; height: 8px; border-radius: 50%; background: #fff;
  border: 2px solid var(--brand-2); box-shadow: 0 0 0 3px #f2f4f1;
}
.tl-item.deal::before { border-color: var(--gold); background: var(--gold); }
.tl-time { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.tl-body { font-size: 13.5px; color: var(--ink-2); margin-top: 2px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.tl-type { font-size: 11px; color: var(--brand); background: var(--brand-soft); padding: 1px 6px; border-radius: 4px; margin-right: 5px; }

/* 弹层 */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20, 30, 27, .42);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .18s ease;
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes up { from { transform: translateY(24px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }

.modal {
  background: #fff; width: 100%; max-height: 92vh; max-height: 92dvh;
  border-radius: 18px 18px 0 0; display: flex; flex-direction: column;
  animation: up .22s cubic-bezier(.2,.8,.3,1);
  overflow: hidden;
}
.modal-hd {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line-2); flex: 0 0 auto;
}
.modal-title { font-size: 16px; font-weight: 600; flex: 1; }
.modal-body { padding: 14px 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1; }
.modal-ft {
  padding: 11px 16px calc(11px + var(--safe-b)); border-top: 1px solid var(--line-2);
  display: flex; gap: 9px; background: #fff; flex: 0 0 auto;
}
.modal-ft .btn { flex: 1; }
.modal-x { width: 30px; height: 30px; border-radius: 50%; background: #f2f4f2; color: var(--sub); display: flex; align-items: center; justify-content: center; flex: 0 0 30px; }

@media (min-width: 760px) {
  .overlay { align-items: center; padding: 24px; }
  .modal { max-width: 620px; border-radius: 16px; max-height: 86vh; animation: none; }
  .modal.wide { max-width: 860px; }
  .modal.narrow { max-width: 440px; }
}

/* toast */
#toast-root { position: fixed; inset: 0; pointer-events: none; z-index: 200; display: flex; flex-direction: column; align-items: center; padding-top: 76px; gap: 8px; }
.toast {
  max-width: 84vw; padding: 10px 16px; border-radius: 10px;
  background: rgba(23, 33, 31, .9); color: #fff; font-size: 13.5px;
  box-shadow: var(--shadow-lg); animation: up .2s ease;
  display: flex; align-items: center; gap: 8px;
}
.toast.ok { background: rgba(15, 107, 92, .95); }
.toast.err { background: rgba(160, 51, 43, .95); }

/* 空状态 */
.empty { text-align: center; padding: 46px 20px; color: var(--faint); }
.empty-ico { width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 14px; background: #eff2ef; display: flex; align-items: center; justify-content: center; color: #b7c0bb; }
.empty-t { font-size: 13.5px; }
.empty-s { font-size: 12px; margin-top: 4px; color: #b7c0bb; }

/* 表格 */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -14px; padding: 0 14px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 560px; }
table.tbl th {
  text-align: left; font-weight: 500; color: var(--sub); font-size: 11.5px;
  padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap;
  background: #fafbf9; position: sticky; top: 0;
}
table.tbl td { padding: 9px 8px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* 图表 */
.chart { width: 100%; height: 132px; display: block; }
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: flex; align-items: center; gap: 9px; font-size: 12.5px; }
.bar-label { width: 84px; flex: 0 0 84px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { flex: 1; height: 8px; background: #eef1ee; border-radius: 4px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 4px; background: #158f7b; }
.bar-val { width: 76px; text-align: right; color: var(--sub); font-variant-numeric: tabular-nums; flex: 0 0 76px; }

/* 开关 */
.switch { position: relative; width: 44px; height: 26px; flex: 0 0 44px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; }
.switch i {
  position: absolute; inset: 0; border-radius: 13px; background: #d8ded9; transition: .18s;
  pointer-events: none;
}
.switch i::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  background: #fff; border-radius: 50%; transition: .18s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(18px); }

/* 客服卡片 */
.agent-card {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
}
.agent-card.paused { background: #fbfbfa; opacity: .85; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #c9d1cc; flex: 0 0 8px; }
.dot.on { background: #22a06b; box-shadow: 0 0 0 3px rgba(34,160,107,.15); }
.dot.pause { background: #d0a44a; }

.agent-card .meter { height: 4px; border-radius: 2px; background: #eef1ee; margin-top: 5px; overflow: hidden; }
.agent-card .meter i { display: block; height: 100%; background: var(--brand-2); }

/* 待分配条目 */
.pick-item { display: flex; gap: 10px; align-items: flex-start; }
.check {
  width: 21px; height: 21px; flex: 0 0 21px; border-radius: 6px; border: 1.5px solid #cfd8d3;
  display: flex; align-items: center; justify-content: center; margin-top: 2px; background: #fff;
}
.check.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 选择行（弹层内） */
.opt-row {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.opt-row.on { border-color: var(--brand); background: var(--brand-soft); }

/* 分段 tabs */
.tabs { display: flex; gap: 2px; background: #eef1ee; border-radius: 10px; padding: 3px; margin-bottom: 12px; }
.tabs button { flex: 1; height: 32px; border-radius: 8px; font-size: 13px; color: var(--sub); }
.tabs button.on { background: #fff; color: var(--ink); font-weight: 500; box-shadow: 0 1px 3px rgba(23,33,31,.08); }

/* 顶部提示条 */
.banner {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.6;
  background: var(--warn-soft); color: #7d5813;
}
.banner.info { background: var(--blue-soft); color: #2b5578; }
.banner.danger { background: var(--danger-soft); color: #8d3229; }

/* 桌面两栏 */
@media (min-width: 900px) {
  .cols { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
}

/* 移动端表格卡片化辅助 */
.only-mobile { display: block; }
.only-desktop { display: none; }
@media (min-width: 900px) {
  .only-mobile { display: none; }
  .only-desktop { display: block; }
}
