/* =====================================================================
   抖来客 · 移动端样式层
   三块内容：
     一、全站响应式（≤900 抽屉侧栏 / 表格卡片化 / 底部 Tab）
     二、微信 H5 落地页（客户从公众号消息点开看到的那几页）
     三、手机工作台（#/m/*，客服在外面用手机接单跟进）
   桌面端不受影响：所有规则都在 max-width 断点内，或挂在 .h5-/.m- 专有类上。
   ===================================================================== */

/* ===================== 一、全站响应式 ===================== */

/* 移动端专属元素：桌面上全部隐藏 */
.m-burger, .m-more, .m-menu, .m-scrim, .m-tabbar, .m-only { display: none; }

@media (max-width: 900px) {
  html, body { font-size: 15px; }
  body { -webkit-text-size-adjust: 100%; }

  .app-layout { display: block; }

  /* --- 侧栏变抽屉 --- */
  .app-sidebar {
    display: flex !important;
    position: fixed; left: 0; top: 0; bottom: 0;
    width: 268px; height: 100%;
    z-index: 120;
    transform: translateX(-100%);
    transition: transform .26s cubic-bezier(.4, 0, .2, 1);
    box-shadow: none;
    border-right: 0;
  }
  .app-layout.m-nav-open .app-sidebar {
    transform: none;
    box-shadow: 0 20px 60px -12px rgba(15, 23, 42, .45);
  }
  .m-scrim { display: block; position: fixed; inset: 0; z-index: 110; background: rgba(15, 23, 42, .45); }
  .nav-item, .nav-sub-item { padding: 12px; font-size: 15px; }
  .nav-sub-item { padding: 10px 12px; font-size: 14px; }

  /* --- 顶栏 --- */
  .app-topbar {
    height: 54px; padding: 0 8px 0 4px; gap: 2px;
    background: rgba(255, 255, 255, .96);
  }
  .app-topbar h1 { font-size: 17px; margin: 0; }
  .app-topbar p { display: none; }
  .tb-title { flex: 1; min-width: 0; overflow: hidden; }
  .tb-title h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar-user { display: none; }
  .m-burger, .m-more {
    display: flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border: 0; background: transparent;
    font-size: 20px; color: var(--ink-2); border-radius: 10px; cursor: pointer;
    flex: none;
  }
  .m-burger:active, .m-more:active { background: #f1f5f9; }
  .m-menu {
    display: block;
    position: absolute; right: 8px; top: 52px; z-index: 130;
    min-width: 158px; background: #fff; border: 1px solid var(--line);
    border-radius: 12px; box-shadow: 0 18px 40px -12px rgba(15, 23, 42, .3);
    overflow: hidden; padding: 6px;
  }
  .m-menu div {
    padding: 12px 14px; font-size: 15px; border-radius: 8px; color: var(--ink-2);
    cursor: pointer;
  }
  .m-menu div:active { background: #f1f5f9; }

  .app-content { padding: 12px 12px 84px; }

  /* --- 卡片 --- */
  .card { border-radius: 14px; }
  .card-pad { padding: 14px 14px; }
  .card-head { padding: 13px 14px; flex-wrap: wrap; gap: 8px; }
  .card-head h3 { font-size: 15.5px; }
  .card-head p { font-size: 12.5px; }
  .card-body { padding: 14px; }

  /* --- 栅格全部单列 --- */
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
  .row-split, .row-split-2, .setup-steps, .form-2,
  .feat-grid, .plan-grid, .plan-grid-4 { grid-template-columns: 1fr !important; }
  .stat-card { padding: 13px 14px !important; }
  .stat-card .num, .stat-card b { font-size: 22px !important; }

  /* --- 筛选栏 / 工具条：自动换行 --- */
  .bar {
    flex-wrap: wrap; gap: 8px !important;
    padding: 10px 0 !important;
  }
  .bar .inp { flex: 1 1 100% !important; min-width: 0 !important; width: auto !important; }
  .bar .sel { flex: 1 1 calc(50% - 5px) !important; min-width: 0 !important; width: auto !important; }
  .bar .grow { display: none; }
  .bar .btn { flex: 0 0 auto; }

  /* --- 表单控件放大到能点中 --- */
  .inp, .sel, textarea.inp {
    font-size: 16px !important;   /* iOS 小于 16px 会在聚焦时自动放大页面 */
    height: 44px !important;
    padding: 0 12px !important;
    border-radius: 10px !important;
  }
  textarea.inp { height: auto !important; padding: 10px 12px !important; line-height: 1.6; }
  .btn { height: 40px; padding: 0 16px; font-size: 14.5px; border-radius: 10px; }
  .btn-sm { height: 34px; padding: 0 12px; font-size: 13.5px; }
  .chip { padding: 8px 13px; font-size: 13.5px; border-radius: 9px; }
  .m-sec-h .lnk, .small.lnk { padding: 8px 0 8px 10px; display: inline-block; }
  .btn-block { width: 100%; height: 46px; font-size: 16px; }
  .fld-grid { gap: 12px 10px !important; }
  .fld-k { font-size: 12px; }
  .fld-v { font-size: 14.5px; }

  /* --- 分段标签横向滚动，不换行挤成两排 --- */
  .tabs {
    display: flex !important; overflow-x: auto; white-space: nowrap;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
    gap: 0 !important;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs .tab { flex: 0 0 auto; padding: 10px 14px; font-size: 14.5px; }

  /* --- 分页 --- */
  .pager { justify-content: center; flex-wrap: wrap; gap: 6px; }
  .pg { min-width: 36px; height: 36px; }

  /* --- 抽屉 / 弹窗：手机全屏或底部弹出 --- */
  .dw-mask { align-items: flex-end; justify-content: center; }
  .dw {
    width: 100% !important; max-width: 100% !important;
    height: 100%; max-height: 100%; border-radius: 0;
  }
  .dw-head { height: 54px; padding: 0 14px; }
  .dw-head h3 { font-size: 16px; }
  .dw-body { padding: 14px; }
  .dw-foot {
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  }
  .md {
    width: 100% !important; max-width: 100% !important;
    margin: 0 !important;
    border-radius: 18px 18px 0 0; max-height: 88vh;
    animation: sheetUp .22s cubic-bezier(.22, 1, .36, 1);
  }
  @keyframes sheetUp { from { transform: translateY(24px); opacity: .6 } to { transform: none; opacity: 1 } }
  .md-body { padding: 16px 14px; }
  .md-foot { padding: 10px 14px calc(12px + env(safe-area-inset-bottom)); }

  /* --- 提示条挪到顶部，避免被键盘和底部 Tab 挡住 --- */
  .toast-box {
    left: 12px !important; right: 12px !important; bottom: auto !important;
    top: 12px !important; align-items: center !important;
    transform: none !important;
  }
  .toast { max-width: 100%; border-radius: 12px; font-size: 14px; padding: 10px 18px; }

  /* --- 代码块横滑 --- */
  .code, .code-block, pre { overflow-x: auto; }

  /* ============ 表格 → 卡片 ============ */
  .tbl-wrap { overflow: visible !important; }

  .tbl-wrap:not(.tbl-wrap-scroll) .tbl { border: 0; background: transparent; }
  .tbl-wrap:not(.tbl-wrap-scroll) .tbl thead { display: none; }
  .tbl-wrap:not(.tbl-wrap-scroll) .tbl,
  .tbl-wrap:not(.tbl-wrap-scroll) .tbl tbody,
  .tbl-wrap:not(.tbl-wrap-scroll) .tbl tr,
  .tbl-wrap:not(.tbl-wrap-scroll) .tbl td { display: block; width: 100% !important; }

  .tbl-wrap:not(.tbl-wrap-scroll) .tbl tr {
    background: #fff; border: 1px solid var(--line);
    border-radius: 14px; margin-bottom: 10px;
    padding: 8px 0 10px; box-shadow: var(--shadow-sm);
  }
  .tbl-wrap:not(.tbl-wrap-scroll) .tbl tr:active { background: #fafbfc; }

  .tbl-wrap:not(.tbl-wrap-scroll) .tbl td {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 12px; border: 0; padding: 6px 14px !important;
    text-align: right !important; font-size: 14.5px; line-height: 1.5;
    word-break: break-word;
  }
  .tbl-wrap:not(.tbl-wrap-scroll) .tbl td::before {
    content: attr(data-l);
    flex: none; width: 74px; text-align: left;
    color: var(--muted); font-size: 13.5px; font-weight: 400;
    padding-top: 1px;
  }
  .tbl-wrap:not(.tbl-wrap-scroll) .tbl td[data-l=""]::before { display: none; }
  .tbl-wrap:not(.tbl-wrap-scroll) .tbl td > span {
    flex: 1; min-width: 0; text-align: right;
  }
  /* 卡片标题行：第一列（若有勾选框则是第二列）去掉字段名，加大加粗 */
  .tbl-wrap:not(.tbl-wrap-scroll) .tbl tr { position: relative; }
  .tbl-wrap:not(.tbl-wrap-scroll) .tbl tr.has-ck { padding-left: 30px; }
  .tbl-wrap:not(.tbl-wrap-scroll) .tbl tr:not(.has-ck) td:first-child,
  .tbl-wrap:not(.tbl-wrap-scroll) .tbl tr.has-ck td:nth-child(2) {
    font-size: 16px; font-weight: 600; color: var(--ink);
    padding: 4px 14px 6px !important;
    border-bottom: 1px solid var(--line-soft); margin-bottom: 4px;
    justify-content: flex-start;
  }
  .tbl-wrap:not(.tbl-wrap-scroll) .tbl tr:not(.has-ck) td:first-child > span,
  .tbl-wrap:not(.tbl-wrap-scroll) .tbl tr.has-ck td:nth-child(2) > span { text-align: left; }
  .tbl-wrap:not(.tbl-wrap-scroll) .tbl tr:not(.has-ck) td:first-child::before,
  .tbl-wrap:not(.tbl-wrap-scroll) .tbl tr.has-ck td:nth-child(2)::before { display: none; }

  /* 标题行里的副信息（手机号之类）跟在名字后面，别换行占两行 */
  .tbl-wrap:not(.tbl-wrap-scroll) .tbl tr:not(.has-ck) td:first-child > span > div,
  .tbl-wrap:not(.tbl-wrap-scroll) .tbl tr.has-ck td:nth-child(2) > span > div {
    display: inline-block; margin-left: 8px; font-weight: 400; vertical-align: baseline;
  }

  /* 勾选框列：绝对定位到卡片左上角，不再单独占一行 */
  .tbl-wrap:not(.tbl-wrap-scroll) .tbl td.td-ck {
    position: absolute !important; left: 8px; top: 12px;
    width: 24px !important; padding: 0 !important;
    display: block; justify-content: flex-start;
  }
  .tbl-wrap:not(.tbl-wrap-scroll) .tbl td.td-ck::before { display: none !important; }
  .tbl-wrap:not(.tbl-wrap-scroll) .tbl td.td-ck > span { display: block; text-align: left; }
  .tbl-wrap:not(.tbl-wrap-scroll) .tbl td.td-ck input {
    width: 18px; height: 18px; accent-color: var(--primary);
  }

  /* 操作列：按钮排一行靠右 */
  .tbl-wrap:not(.tbl-wrap-scroll) .tbl td:last-child:not(:first-child) {
    justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding-top: 10px !important;
  }
  .tbl-wrap:not(.tbl-wrap-scroll) .tbl td:last-child:not(:first-child)::before { display: none; }
  .tbl-wrap:not(.tbl-wrap-scroll) .tbl td:last-child:not(:first-child) > span { flex: none; text-align: right; }
  .tbl-wrap:not(.tbl-wrap-scroll) .tbl .tbl-empty { padding: 40px 0; }

  /* 明确要求横滑的表格 */
  .tbl-wrap-scroll { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
  .tbl-wrap-scroll .tbl { min-width: 660px; }

  /* --- 平台接入页头部：按钮掉到第二行 --- */
  .phead { flex-wrap: wrap; padding: 14px !important; gap: 10px !important; }
  .phead > div:last-child { flex: 1 1 100% !important; }
  .phead > div:last-child .btn { flex: 1; white-space: nowrap; }
  .phead .pname { flex-wrap: wrap; font-size: 15px; }

  /* --- 兜底：页面里用内联 style 写的横向 flex 行，一律允许换行 --- */
  [style*="display: flex"], [style*="display:flex"] { flex-wrap: wrap; }
  /* 固定宽度的输入框别把行撑破 */
  .inp[style*="width"], .sel[style*="width"] { max-width: 100% !important; }
  .inp-sm { height: 36px !important; }

  /* --- 公开页 --- */
  .pub-top { height: 56px; padding: 0 14px; }
  .pub-brand .brand-sub { display: none; }
  .pub-top-right { gap: 8px; }
  .pub-main { padding: 16px 14px 32px; }
  .pub-head h1 { font-size: 19px; }
  .hero { padding: 34px 18px 26px; }
  .hero h1 { font-size: 25px; }
  .hero-btns { flex-direction: column; }
  .pub-sec { padding: 22px 14px; }
  .pub-foot { flex-direction: column; gap: 4px; padding: 16px; font-size: 12px; }

  /* --- 登录 / 注册 --- */
  .auth-wrap { flex-direction: column; }
  .auth-side { display: none; }
  .auth-card { width: 100%; padding: 22px 18px; }
}

/* --- 运营管理后台：深色侧栏改抽屉 --- */
@media (max-width: 900px) {
  .admin-shell { display: block !important; }
  .admin-side {
    position: fixed !important; left: 0; top: 0; bottom: 0;
    width: 250px !important; flex: 0 0 250px !important;
    height: 100% !important; z-index: 120;
    transform: translateX(-100%); transition: transform .26s cubic-bezier(.4, 0, .2, 1);
  }
  .admin-shell.m-open .admin-side {
    transform: none;
    box-shadow: 0 20px 60px -12px rgba(0, 0, 0, .55);
  }
  .admin-top {
    height: 54px !important; padding: 0 8px 0 4px !important; gap: 6px !important;
  }
  .admin-top .tag, .admin-top .small { display: none; }
  .admin-top .m-burger { color: var(--ink-2); }
  .admin-main { padding: 12px !important; }
}

@media (max-width: 360px) {
  .stat-grid { gap: 8px !important; }
  .bar .sel { flex: 1 1 100% !important; }
  .tbl-wrap:not(.tbl-wrap-scroll) .tbl td::before { width: 64px; }
}


/* ===================== 二、微信 H5 落地页 ===================== */
/* 客户在公众号 / 企微消息里点开的那几页。观感按微信原生 H5 做：白底、大字号、吸底按钮。 */

.h5-page {
  min-height: 100vh; background: #f2f3f5;
  padding-bottom: calc(78px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}
.h5-page.no-bar { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }

/* 顶部导航：模仿微信内嵌 H5 的 44px 白条 */
.h5-nav {
  position: sticky; top: 0; z-index: 40;
  height: 48px; display: flex; align-items: center; gap: 6px;
  padding: 0 8px; background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px); border-bottom: 1px solid #ededed;
}
.h5-nav-t { flex: 1; text-align: center; font-size: 16.5px; font-weight: 600; color: #111; }
.h5-nav-btn {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border: 0; background: transparent; font-size: 19px; color: #333; border-radius: 10px;
  text-decoration: none;
}
.h5-nav-btn:active { background: #f2f2f2; }
.h5-nav-r { width: 40px; }

/* 客户主卡：蓝底渐变，最重要的一屏信息 */
.h5-hero {
  padding: 20px 18px 22px; color: #fff;
  background: linear-gradient(135deg, #f68a32 0%, #f2761d 45%, #a8430b 100%);
}
.h5-hero-top { display: flex; align-items: center; gap: 12px; }
.h5-avatar {
  width: 50px; height: 50px; border-radius: 14px; flex: none;
  background: rgba(255, 255, 255, .22); border: 1px solid rgba(255, 255, 255, .3);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 700;
}
.h5-name { font-size: 21px; font-weight: 700; letter-spacing: .3px; line-height: 1.25; }
.h5-sub { font-size: 13.5px; opacity: .85; margin-top: 3px; }
.h5-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.h5-tag {
  font-size: 12px; padding: 3px 9px; border-radius: 20px;
  background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .26);
}
.h5-tag.solid { background: #fff; color: #cf5a0c; border-color: #fff; font-weight: 600; }

/* 三个圆形操作 */
.h5-actions { display: flex; gap: 8px; margin-top: 16px; }
.h5-act {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 10px 4px; border-radius: 12px; background: rgba(255, 255, 255, .16);
  color: #fff; text-decoration: none; font-size: 12.5px; border: 1px solid rgba(255, 255, 255, .2);
}
.h5-act:active { background: rgba(255, 255, 255, .3); }
.h5-act i, .h5-act svg { font-style: normal; font-size: 18px; line-height: 1; display: block; }
.h5-act span { font-size: 12.5px; }

/* 空状态垂直居中，避免大屏一片白 */
.h5-center {
  min-height: calc(100vh - 48px - 90px);
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 14px calc(30px + env(safe-area-inset-bottom));
}

/* 内容卡片 */
.h5-body { padding: 12px 12px 0; }
.h5-card {
  background: #fff; border-radius: 14px; padding: 4px 0;
  margin-bottom: 10px; box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
}
.h5-card-h {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 8px; font-size: 15.5px; font-weight: 600; color: #111;
}
.h5-card-h .more { font-size: 13px; color: #576b95; font-weight: 400; }
.h5-kv { display: flex; gap: 12px; padding: 9px 16px; font-size: 15px; line-height: 1.5; }
.h5-kv .k { flex: none; width: 74px; color: #888; font-size: 14px; }
.h5-kv .v { flex: 1; color: #111; word-break: break-all; }
.h5-kv .v.mono { font-variant-numeric: tabular-nums; letter-spacing: .2px; }
.h5-note {
  margin: 4px 12px 12px; padding: 10px 12px; border-radius: 10px;
  background: #fffbeb; color: #92400e; font-size: 13px; line-height: 1.65;
}
.h5-note.blue { background: #fff5ec; color: #a8430b; }

/* 时间线 */
.tl { position: relative; padding: 4px 16px 4px 34px; }
.tl::before {
  content: ''; position: absolute; left: 21px; top: 12px; bottom: 14px;
  width: 1.5px; background: #e8e8e8;
}
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item::before {
  content: ''; position: absolute; left: -17px; top: 6px;
  width: 8px; height: 8px; border-radius: 50%; background: #f2761d;
  box-shadow: 0 0 0 3px #ffe9d8;
}
.tl-item.sys::before { background: #94a3b8; box-shadow: 0 0 0 3px #f1f5f9; }
.tl-t { display: flex; align-items: baseline; gap: 8px; }
.tl-who { font-size: 14.5px; font-weight: 600; color: #111; }
.tl-time { font-size: 12px; color: #999; margin-left: auto; }
.tl-c { font-size: 14.5px; color: #333; line-height: 1.65; margin-top: 3px; }
.tl-tag {
  display: inline-block; font-size: 11.5px; color: #f2761d; background: #fff5ec;
  border-radius: 5px; padding: 1px 6px; margin-top: 5px;
}

/* 吸底操作条 */
.h5-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: flex; gap: 10px; align-items: center;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .97); backdrop-filter: blur(10px);
  border-top: 1px solid #e9e9e9;
}
.h5-bar .btn { height: 46px; border-radius: 12px; font-size: 16px; }
.h5-bar .btn-primary { flex: 1; box-shadow: 0 8px 18px -8px rgba(249, 115, 22, .8); }

/* 大按钮（认领 / 提交） */
.h5-big {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 52px; border-radius: 14px; border: 0;
  font-size: 17px; font-weight: 600; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, #f68a32, #f2761d);
  box-shadow: 0 10px 24px -10px rgba(249, 115, 22, .85);
}
.h5-big:disabled { background: #cbd5e1; box-shadow: none; color: #fff; }
.h5-big.gray { background: #f1f5f9; color: #475569; box-shadow: none; }

/* 微信授权卡 */
.h5-auth {
  background: #fff; border-radius: 14px; margin: 12px; padding: 22px 18px; text-align: center;
}
.h5-auth .ico {
  width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 12px;
  background: linear-gradient(140deg, #86efac, #22c55e); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 26px;
}
.h5-auth h2 { font-size: 18px; margin: 0 0 6px; }
.h5-auth p { font-size: 14px; color: #888; line-height: 1.7; margin: 0; }
.h5-auth-list { margin: 16px 0; text-align: left; }
.h5-auth-list div {
  display: flex; align-items: center; gap: 10px; padding: 12px 0;
  border-bottom: 1px solid #f1f1f1; font-size: 15px;
}
.h5-auth-list div:last-child { border-bottom: 0; }
.h5-auth-list .dot {
  width: 20px; height: 20px; border-radius: 50%; background: #ecfdf5; color: #059669;
  display: flex; align-items: center; justify-content: center; font-size: 12px; flex: none;
}

/* 空状态 / 结果页 */
.h5-result { text-align: center; padding: min(24vh, 170px) 24px 26px; }
.h5-result .ico {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center; font-size: 30px;
}
.h5-result .ico.ok { background: #ecfdf5; color: #059669; }
.h5-result .ico.err { background: #fef2f2; color: #ef4444; }
.h5-result h2 { font-size: 19px; margin: 0 0 8px; }
.h5-result p { font-size: 14.5px; color: #888; line-height: 1.75; margin: 0 0 6px; }

/* 倒计时条 */
.h5-countdown {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  padding: 10px 14px; margin: 12px; border-radius: 12px;
  background: #fff5ec; color: #a8430b; font-size: 14px;
}

@media (max-width: 360px) {
  .h5-kv .k { width: 64px; }
  .h5-name { font-size: 19px; }
}


/* ===================== 三、手机工作台 #/m/* ===================== */

.m-app {
  min-height: 100vh; background: #f2f3f5;
  padding-bottom: calc(62px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}
.m-app.no-tab { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }

.m-top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px 12px; color: #fff;
  background: linear-gradient(135deg, #f68a32, #f2761d 60%, #a8430b);
}
.m-top.plain { background: #fff; color: #111; border-bottom: 1px solid #ededed; }
.m-top h1 { margin: 0; font-size: 17px; font-weight: 600; }
.m-top .sub { font-size: 12px; opacity: .82; margin-top: 2px; }
.m-top .sp { flex: 1; }
.m-top .ico-btn {
  width: 38px; height: 38px; border-radius: 11px; border: 0; flex: none;
  background: rgba(255, 255, 255, .18); color: inherit; font-size: 17px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.m-top.plain .ico-btn { background: #f1f5f9; }

/* 今日数据四宫格 */
.m-kpi { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 12px; }
.m-kpi-1 {
  background: #fff; border-radius: 14px; padding: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
}
.m-kpi-1 .n { font-size: 26px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.m-kpi-1 .l { font-size: 12.5px; color: #8a8f99; margin-top: 4px; }
.m-kpi-1.warn .n { color: #ef4444; }
.m-kpi-1.ok .n { color: #059669; }
.m-kpi-1.blue .n { color: #f2761d; }

/* 快捷入口 */
.m-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px 8px 12px; }
.m-quick a {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 4px; color: #333; text-decoration: none; font-size: 12.5px; border-radius: 12px;
}
.m-quick a:active { background: #eef2f7; }
.m-quick .qb {
  width: 42px; height: 42px; border-radius: 13px; display: flex;
  align-items: center; justify-content: center; font-size: 19px;
  background: #fff5ec; color: #f2761d;
}
.m-quick a:nth-child(2) .qb { background: #ecfdf5; color: #059669; }
.m-quick a:nth-child(3) .qb { background: #fff8e6; color: #d97706; }
.m-quick a:nth-child(4) .qb { background: #fff1f4; color: #e11d48; }

/* 区块标题 */
.m-sec-h {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 16px 8px; font-size: 13.5px; color: #8a8f99;
}
.m-sec-h b { color: #111; font-size: 15px; font-weight: 600; }
.m-sec-h .lnk { color: #f2761d; font-size: 13px; text-decoration: none; }

/* 线索卡 */
.m-list { padding: 0 12px; }
.m-lead {
  display: block; background: #fff; border-radius: 14px; padding: 14px;
  margin-bottom: 10px; box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
  text-decoration: none; color: inherit; position: relative;
}
.m-lead:active { background: #fafbfc; }
.m-lead-t { display: flex; align-items: center; gap: 8px; }
.m-lead-n { font-size: 16.5px; font-weight: 600; color: #111; }
.m-lead-ph { font-size: 14px; color: #555; font-variant-numeric: tabular-nums; }
.m-lead-r { margin-left: auto; }
.m-lead-m { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.m-lead-m span {
  font-size: 12px; color: #64748b; background: #f5f7fa;
  border-radius: 6px; padding: 3px 8px;
}
.m-lead-b { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.m-lead-b .time { font-size: 12px; color: #a0a6b0; margin-left: auto; }
.m-lead-b .go {
  font-size: 13px; color: #f2761d; background: #fff5ec;
  padding: 5px 12px; border-radius: 20px; text-decoration: none;
}
.m-lead-b .go.solid { background: #f2761d; color: #fff; }

/* 小圆角标签 */
.pill {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11.5px; padding: 2px 8px; border-radius: 20px;
  background: #f1f5f9; color: #475569; white-space: nowrap;
}
.pill.blue { background: #fff5ec; color: #cf5a0c; }
.pill.green { background: #ecfdf5; color: #047857; }
.pill.amber { background: #fffbeb; color: #b45309; }
.pill.red { background: #fef2f2; color: #dc2626; }
.pill.gray { background: #f5f7fa; color: #64748b; }

/* 分段控件 */
.m-seg {
  display: flex; gap: 6px; padding: 10px 12px; overflow-x: auto;
  scrollbar-width: none; background: #f2f3f5;
  position: sticky; top: 58px; z-index: 30;
}
.m-seg::-webkit-scrollbar { display: none; }
.m-seg button {
  flex: 0 0 auto; border: 0; background: #fff; color: #555;
  font-size: 13.5px; padding: 8px 14px; border-radius: 20px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .03); cursor: pointer;
}
.m-seg button.on { background: #f2761d; color: #fff; font-weight: 600; }
.m-seg button .b {
  display: inline-block; margin-left: 4px; font-size: 11px;
  background: rgba(0, 0, 0, .06); border-radius: 10px; padding: 0 5px;
}
.m-seg button.on .b { background: rgba(255, 255, 255, .25); }

/* 搜索框 */
.m-search { padding: 10px 12px 0; }
.m-search input {
  width: 100%; height: 40px; border: 0; border-radius: 20px;
  background: #fff; padding: 0 16px; font-size: 15px; color: #111;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .03); outline: none;
}

/* 底部 Tab：桌面默认不显示，手机上显示；工作台内部任何宽度都显示 */
.m-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(12px); border-top: 1px solid #e9e9e9;
  padding-bottom: env(safe-area-inset-bottom);
}
.m-app .m-tabbar { display: flex !important; }
@media (max-width: 900px) {
  .m-tabbar { display: flex; }
}
.m-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; height: 56px; font-size: 10.5px; color: #8a8f99;
  text-decoration: none; position: relative;
}
.m-tab.on { color: #f2761d; }
.m-tab i { font-style: normal; font-size: 19px; line-height: 1; }
.m-tab .dot-badge {
  position: absolute; top: 6px; right: 50%; margin-right: -18px;
  min-width: 16px; height: 16px; border-radius: 9px; background: #ef4444; color: #fff;
  font-size: 10px; line-height: 16px; text-align: center; padding: 0 4px;
}

/* 工作台线索详情：底部操作条 */
.m-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
  display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .97); backdrop-filter: blur(12px);
  border-top: 1px solid #e9e9e9;
}
.m-bar .btn { flex: 1; height: 46px; border-radius: 12px; font-size: 15.5px; }
.m-bar .btn.icon-only { flex: 0 0 52px; font-size: 19px; }

/* 工作台详情页字段 */
.m-detail { padding: 12px; }
.m-detail .card { border-radius: 14px; margin-bottom: 10px; }
.m-detail .card-head { padding: 12px 14px; }
.m-detail .card-body { padding: 12px 14px; }

/* 抢单大厅卡片 */
.m-pool { padding: 0 12px; }
.m-pool-card {
  background: #fff; border-radius: 14px; padding: 14px; margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .03); border: 1px solid #fff;
}
.m-pool-card.urgent { border-color: #fde8e8; }
.m-pool-card.urgent .wait { color: #dc2626; font-weight: 600; }
.m-pool-card .top { display: flex; align-items: center; gap: 8px; }
.m-pool-card .nm { font-size: 16.5px; font-weight: 600; }
.m-pool-card .ph { font-size: 14px; color: #555; }
.m-pool-card .wait { margin-left: auto; font-size: 12px; color: #b45309; }

/* 我的页 */
.m-me-h { padding: 24px 18px 20px; color: #fff; background: linear-gradient(135deg, #f68a32, #a8430b); }
.m-me-h .av {
  width: 58px; height: 58px; border-radius: 18px; background: rgba(255, 255, 255, .2);
  display: flex; align-items: center; justify-content: center; font-size: 21px; font-weight: 700;
  margin-bottom: 10px; border: 1px solid rgba(255, 255, 255, .28);
}
.m-me-h .nm { font-size: 20px; font-weight: 700; }
.m-me-h .rl { font-size: 13px; opacity: .82; margin-top: 3px; }
.m-cells { background: #fff; border-radius: 14px; margin: 12px; overflow: hidden; }
.m-cell {
  display: flex; align-items: center; gap: 10px; padding: 15px 16px;
  font-size: 15.5px; color: #111; border-bottom: 1px solid #f1f1f1;
  text-decoration: none; cursor: pointer;
}
.m-cell:last-child { border-bottom: 0; }
.m-cell:active { background: #fafafa; }
.m-cell .r { margin-left: auto; color: #a0a6b0; font-size: 14px; }
.m-cell .ci { width: 22px; text-align: center; font-size: 17px; }

/* 业绩进度条 */
.m-prog { height: 8px; border-radius: 6px; background: #eef2f7; overflow: hidden; }
.m-prog i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #ffc39a, #f2761d); }

/* 只在手机上出现的提示：桌面上看到这个手机端入口 */
.m-entry-hint {
  display: none;
}
@media (max-width: 900px) {
  .m-entry-hint { display: block; }
}


/* =====================================================================
   宽屏（电脑微信里点开 / 直接浏览器打开）时，把 H5 和手机工作台收成
   一个居中的手机宽度，看起来像手机预览，而不是被拉成一张大白纸。
   ===================================================================== */
@media (min-width: 640px) {
  .h5-page,
  .m-app {
    max-width: 468px; margin: 0 auto;
    box-shadow: 0 0 0 1px #dde3ec, 0 30px 80px -30px rgba(15, 23, 42, .38);
    position: relative;
  }
  .h5-bar,
  .m-app .m-tabbar,
  .m-app .m-bar {
    left: 50%; right: auto; transform: translateX(-50%);
    width: 100%; max-width: 468px;
  }
  /* 移动工作台里的顶部栏也收一下圆角 */
  .m-app .m-top { border-radius: 0; }
}

/* 自定义菜单：窄屏收成单列，右边预览放到底部 */
@media (max-width: 1000px) {
  .mp-menu-grid { grid-template-columns: 1fr !important; }
  .mp-menu-grid .cfg-row { flex-wrap: wrap !important; }
  .mp-menu-grid .cfg-row .inp,
  .mp-menu-grid .cfg-row .sel { width: 100% !important; flex: 1 1 100% !important; }
}

/* 表单类栅格：手机上统一单列，别把下拉框挤成半截 */
@media (max-width: 720px) {
  .grid-2, .grid-3, .grid-6 { grid-template-columns: 1fr !important; }
  .stat-grid.stat-3 { grid-template-columns: 1fr !important; }
  .phead { flex-wrap: wrap; gap: 10px; }
  .phead > div:last-child { width: 100%; }
  .phead .btn { flex: 1 1 auto; }
}

/* 三列统计卡（排行榜前三名）在桌面保持三列 */
.stat-grid.stat-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* 自定义内容 / 公开详情：卡片态里让标签正常横排，不被压成竖字 */
@media (max-width: 900px) {
  .tbl-wrap .tbl td .chip-row { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap;
    gap: 6px; justify-content: flex-end; }
  .tbl-wrap .tbl td .chip-row .chip { flex: none; max-width: 100%; }
  .tbl-wrap .tbl td > div { flex: 1 1 auto; min-width: 0; text-align: right; }
  .tbl-wrap .tbl td > div > div { text-align: right; }
}

@media (max-width: 900px) {
  .tbl-wrap .tbl td .chip-row { display: none !important; }
  .tbl-wrap .tbl td .chip-row-txt { display: block !important; flex: 1 1 auto; min-width: 0;
    text-align: right; }
}

/* 卡片态里的状态标签不要被拉满整行 */
@media (max-width: 900px) {
  .tbl-wrap .tbl td > span.tag { flex: none; align-self: center; }
}
