/* ==========================================================================
 * 07 通讯录（主页面：大标题 + 常驻搜索胶囊 + 分组芯片 + 联系人卡 + TabBar + 悬浮球）
 * --------------------------------------------------------------------------
 * 对照 07-通讯录.png 的三处与其它屏不同：
 *   1. 搜索是**常驻**的浅色胶囊（不是点按钮才展开）
 *   2. 分组芯片：选中 = 品牌蓝胶囊白字；未选中 = **纯文字**（无底色、无描边）
 *   3. 头像用**圆形**首字块（不是方形图标砖），每人一色，色相由姓名哈希决定
 * 其余沿用骨架：底色 #F1F4F7、白卡负 spread 阴影、胶囊 TabBar、悬浮球。
 * ========================================================================== */

/* ------------------------------ 顶部白底头区 ------------------------------
   设计稿实测（逐像素扫过）：页面顶部从 0 到 y=167 是**白底**，
   标题与搜索框都压在这块白底上；搜索框是 40px 高、填充 #F1F4F7 的浅灰框（114~153），
   即「白底头区 + 灰填充输入框」。做反成「灰底 + 白框」在观感上是两回事：
   白框在灰底上会显得比设计稿更"浮"，而设计稿的输入框是凹下去的。
   结构：状态栏 62 + 6 + 标题 32 + 14 + 输入框 40 + 14 = 168，与实测 167 对齐。 */
body.mobile .mct-top {
  background: var(--m-card);
  padding-top: max(var(--m-status-h, 62px), var(--m-safe-top));
  padding-bottom: 14px;
}

/* ------------------------------ 大标题行 ------------------------------ */
body.mobile .mct-head {
  display: flex; align-items: center; gap: 10px;
  padding: 6px var(--m-gutter-lg) 0;
}
body.mobile .mct-head h1 {
  margin: 0; flex: 1; min-width: 0;
  font-size: 26.5px; font-weight: 700; letter-spacing: -.02em; color: var(--m-t1);
  line-height: 1.2;
}
body.mobile .mct-round {
  width: 34px; height: 34px; flex: none; padding: 0; border: none;
  border-radius: 50%; background: var(--m-card); color: var(--m-t1);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--m-sh-card);
  /* 圆钮（40）比标题行（32）高，不抵消的话会把标题行整体撑高 8px，
     头区与搜索框一起下移（实测搜索框顶边 122，设计稿是 114）。
     用负外边距把「外层高度」压回 32：flex 居中不变，圆钮照旧上下溢出。 */
  margin-top: -4px; margin-bottom: -4px;
}
body.mobile .mct-round:active { background: #F1F4F7; }
/* 新建：实心品牌蓝，与扫码区分主次 */
body.mobile .mct-round.add {
  width: 40px; height: 40px;
  background: var(--m-grad-btn); color: #fff; box-shadow: var(--m-sh-btn);
}

/* ------------------------------ 常驻搜索胶囊 ------------------------------ */
body.mobile .mct-search { padding: 14px var(--m-gutter-lg) 0; }
body.mobile .mct-search-in {
  display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 13px; border-radius: 20px;
  /* 浅灰填充、无边框无阴影：设计稿里它是「凹」下去的输入区，
     在白底头区上靠明度差成立，不需要投影 */
  background: var(--m-bg);
}
body.mobile .mct-search-in .mk-ic { color: var(--m-t3); flex: none; }
body.mobile .mct-search-in input {
  flex: 1; min-width: 0; border: none; outline: none; background: none;
  font-size: 12.5px; font-family: var(--m-ff); color: var(--m-t1);
}
body.mobile .mct-search-in input::placeholder { color: var(--m-t4); }
body.mobile .mct-search-clear {
  flex: none; width: 18px; height: 18px; padding: 0; border: none;
  border-radius: 50%; background: #E3E8EE; color: var(--m-t3);
  display: flex; align-items: center; justify-content: center;
}
body.mobile .mct-search-clear[hidden] { display: none; }

/* ------------------------------ 分组芯片 ------------------------------ */
body.mobile .mct-tabs {
  display: flex; align-items: center; gap: 16px;
  overflow-x: auto; scrollbar-width: none;
  padding: 16px var(--m-gutter-lg) 0;
}
body.mobile .mct-tabs::-webkit-scrollbar { display: none; }
body.mobile .mct-tab {
  flex: none; height: 36px; padding: 0 15px; border-radius: 999px; border: none;
  background: none; color: var(--m-t1);
  font-size: 13.5px; font-weight: 500; font-family: var(--m-ff);
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  transition: background .16s cubic-bezier(.22, 1, .36, 1), color .16s;
}
body.mobile .mct-tab b { font-weight: 600; }
/* 未选中：纯文字，但左右要留出与选中态相同的内边距，切换时不会跳位 */
body.mobile .mct-tab:not(.on) { padding: 0 4px; }
body.mobile .mct-tab.on { background: var(--m-brand); color: #fff; box-shadow: var(--m-sh-btn); }
body.mobile .mct-tab:active { opacity: .82; }

/* ------------------------------ 分区标题 ------------------------------ */
body.mobile .mct-sec {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 20px var(--m-gutter-lg) 10px;
}
body.mobile .mct-sec b { font-size: var(--m-fs-section); font-weight: 600; color: var(--m-t1); }
body.mobile .mct-sec button {
  background: none; border: none; padding: 0; cursor: pointer;
  font-size: var(--m-fs-note); color: var(--m-t3); font-family: var(--m-ff);
}

/* ------------------------------ 联系人卡 ------------------------------ */
body.mobile .mct-list { padding: 0 var(--m-gutter-lg); }
body.mobile .mct-card {
  background: var(--m-card); border-radius: var(--m-r-card-lg);
  box-shadow: var(--m-sh-card); overflow: hidden;
}
body.mobile .mct-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; width: 100%; text-align: left;
  background: none; border: none; font-family: var(--m-ff); cursor: pointer;
}
body.mobile .mct-row:active { background: #FAFBFC; }

/* 头像：圆形 + 首字。色相由姓名哈希决定（同一个人每次进来颜色一致） */
body.mobile .mct-ava {
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 600;
}
body.mobile .mct-ava.t0 { background: #E7F0FF; color: #0A4FA8; }
body.mobile .mct-ava.t1 { background: #E6F8EE; color: #058C46; }
body.mobile .mct-ava.t2 { background: #FFF4E3; color: #B4690E; }
body.mobile .mct-ava.t3 { background: #F1EBFF; color: #5B3FD6; }
body.mobile .mct-ava.t4 { background: #E2F6F5; color: #0E7C74; }
body.mobile .mct-ava.t5 { background: #FFECEF; color: #C5203C; }
/* 有头像图片时用它，否则用首字块 */
body.mobile .mct-ava img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* 行内容两行：姓名 + 职务。行本身是 <button>，内部只能用 span，
   所以这里显式做成纵向 flex，别指望 span 的默认行内布局。 */
body.mobile .mct-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
body.mobile .mct-nm {
  display: flex; align-items: center; gap: 7px;
  font-size: var(--m-fs-title); font-weight: 600; color: var(--m-t1);
  line-height: 1.35;
}
body.mobile .mct-nm > span:first-child {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
body.mobile .mct-sub {
  margin-top: 4px; font-size: var(--m-fs-sub); color: var(--m-t3);
  line-height: 1.5;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
body.mobile .mct-act {
  flex: none; height: 28px; padding: 0 12px; border-radius: 14px;
  border: 1px solid #C9DDF7; background: var(--m-card); color: var(--m-brand);
  font-size: var(--m-fs-body); font-weight: 600; font-family: var(--m-ff);
  display: inline-flex; align-items: center;
}
body.mobile .mct-act:active { background: var(--m-tint); }
body.mobile .mct-hint { flex: none; font-size: var(--m-fs-note); color: var(--m-t3); }

body.mobile .mct-empty { padding: 8px 0 0; }

/* ------------------------------ 动作面板（拨号 / 复制 / 编辑） ------------------------------
   复用 mk-row 的行式外观，只补面板内部的间距与文案样式；
   手机号相关操作在同事行与通讯录行都会用到，样式必须只有一份。 */
body.mobile .mct-sheet{display:flex;flex-direction:column;gap:2px}
body.mobile .mct-sheet-row{
  display:flex;align-items:center;gap:12px;width:100%;
  padding:13px 4px;border:none;background:none;text-align:left;
  font-family:var(--m-ff);font-size:15px;color:var(--m-t1);
  border-bottom:1px solid var(--m-line);
}
body.mobile .mct-sheet-row:last-child{border-bottom:none}
body.mobile .mct-sheet-row:active{background:var(--m-line-2,#F2F5F9)}
body.mobile .mct-sheet-row .mk-ic{color:var(--m-brand)}
body.mobile .mct-sheet-lb{flex:1;min-width:0}


/* ==========================================================================
 * 通讯录头部（终版）
 * 本文件在 mobile-kit.css 之后加载，规则才能压过本文件上半部分的白底头。
 * 规格与案件页一致：标题 20 / 搜索 13 / 头像 34 居右。
 * ========================================================================== */
body.mobile .mct-top {
  background: linear-gradient(180deg, #1F6BFF 0%, #2F86FF 100%);
  border-radius: 0 0 24px 24px;
  box-shadow: 0 10px 24px rgba(31, 107, 255, .18);
  padding-bottom: 14px;
}
body.mobile .mct-head {
  background: none; box-shadow: none; border-radius: 0;
  padding: 0 18px; display: flex; align-items: center; gap: 10px;
}
body.mobile .mct-head h1 {
  margin: 0; flex: 1; min-width: 0;
  font-size: 20px; font-weight: 700; line-height: 1.25; letter-spacing: .2px; color: #fff;
}
body.mobile .mct-ava {
  width: 34px; height: 34px; flex: none;
  border-radius: 50%; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .22);
  border: 1px solid rgba(255, 255, 255, .55);
}
body.mobile .mct-search { padding: 12px 18px 0; }
body.mobile .mct-search-in {
  height: 40px; border-radius: 20px; padding: 0 15px; background: #fff;
}
body.mobile .mct-search-in input { font-size: 13px; }
body.mobile .mct-tabs { padding: 12px 18px 2px; }

/* 标签均分整行，避免右侧被截断 */
body.mobile .mct-tabs { display: flex; gap: 8px; padding: 12px 16px 2px; overflow: hidden; }
body.mobile .mct-tab { flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 0 6px; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }


/* ==========================================================================
 * 收口修复（第三轮）
 * --------------------------------------------------------------------------
 * ① 页面底色两段：`.mk-page` 只铺到内容高度，超出部分露出 body 底色，
 *    而两者色值不同 → 屏幕中段出现一条横线。这里把两者统一成同一个纯色，
 *    `.mk-page` 撑满视口，渐变只保留在头部（头部本来就是整块渐变）。
 * ② 工作台底部胶囊被 tabbar 压住：内容区补足底部空间。
 * ③ 待办卡与智能助手卡同为浅色、界限不清：待办卡改深蓝实底，白卡加描边。
 * ④ 通讯录标签等分后「对方当事人」被截断：改回自然宽度 + 横向滚动，
 *    右侧加渐隐，既完整又能看出可以滑。
 * ========================================================================== */
body.mobile { background: #F2F6FD !important; }
body.mobile .mk-page {
  min-height: 100vh;
  background: #F2F6FD;
}

/* 工作台底部留白：胶囊不再钻到 tabbar 下面 */
body.mobile .wd-page .mk-body,
body.mobile .wd-body { padding-bottom: 96px; }

/* 待办卡：深蓝实底，与右侧白卡形成明确轮廓 */
body.mobile .wd-todo {
  background: linear-gradient(135deg, #1B4FD8 0%, #2F7BFF 100%);
  box-shadow: 0 12px 24px rgba(20, 60, 160, .28);
}
body.mobile .wd-assist {
  border: 1px solid #E3EBF9;
  box-shadow: 0 8px 20px rgba(31, 72, 150, .08);
}

/* 通讯录标签：自然宽度 + 横向滚动，不再压缩文字 */
body.mobile .mct-tabs {
  display: flex; gap: 8px; padding: 12px 16px 2px;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(90deg, #000 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent 100%);
}
body.mobile .mct-tabs::-webkit-scrollbar { display: none; }
body.mobile .mct-tab {
  flex: 0 0 auto; min-width: auto;
  padding: 0 14px; font-size: 12px;
  white-space: nowrap; overflow: visible; text-overflow: clip;
}
/* ==========================================================================
 * 底部导航（胶囊）贴底
 * --------------------------------------------------------------------------
 * 按要求：胶囊直接贴到屏幕最下沿（不再留 22px / 10px 空隙），
 * 并去掉之前那层渐隐遮罩 —— 遮罩本来就是为了盖住缝隙里的内容，
 * 缝隙没了它也就不需要了。
 * 内容不再从缝隙露头：页面底部内边距同步补足（见 .mk-page 规则）。
 * ========================================================================== */
body.mobile { --m-tabbar-bottom: 0px; }
body.mobile .tabbar {
  bottom: 0;
  /* 屏幕底部小白条（安全区）由胶囊自身内边距吸收，外沿仍贴底 */
  padding-bottom: env(safe-area-inset-bottom, 0px);
  border-radius: var(--m-r-tab) var(--m-r-tab) 0 0;
}
body.mobile .mk-page {
  padding-bottom: calc(var(--m-tabbar-h) + var(--m-safe-bottom) + 84px);
}


/* ==========================================================================
 * 底部导航兜底：留出系统手势条高度
 * --------------------------------------------------------------------------
 * 上一版 bottom:0 贴到最底，结果被 Android 的手势导航条/系统栏压住一半 ——
 * `env(safe-area-inset-bottom)` 在多数安卓 WebView 里返回 0，等于没留。
 * 这里改为「安全区与 8px 取较大值」：iOS 有安全区就按安全区抬，
 * 安卓取 8px 最小抬升，既不悬空太高，也不会被系统条切掉。
 * ========================================================================== */
body.mobile .tabbar {
  bottom: max(var(--m-safe-bottom, 0px), env(safe-area-inset-bottom, 0px), 14px);
  padding-bottom: 0;
  border-radius: var(--m-r-tab);
}
body.mobile .mk-page {
  padding-bottom: calc(var(--m-tabbar-h) + var(--m-safe-bottom) + 84px);
}


/* ==========================================================================
 * 底部导航：回到经验证不遮挡的高度
 * --------------------------------------------------------------------------
 * 尝试过 bottom:0（被系统手势条切）、8px / 14px（仍差一点）。
 * 这套机型上系统栏实际占位比 env() 报的要大，因此恢复成原先 22px 的
 * 经验值：胶囊下沿与系统条之间留出干净间距，阴影也完整。
 * 页面底部内边距、悬浮球位置都基于 --m-tabbar-bottom，改这一个值即可整体跟随。
 * ========================================================================== */
body.mobile { --m-tabbar-bottom: 22px; }
body.mobile .tabbar {
  bottom: calc(var(--m-tabbar-bottom) + var(--m-safe-bottom));
}
body.mobile .mk-page {
  padding-bottom: calc(var(--m-tabbar-h) + var(--m-tabbar-bottom) + var(--m-safe-bottom) + 76px);
}


/* ==========================================================================
 * 底部挡板
 * --------------------------------------------------------------------------
 * 胶囊左右各留 21px、下沿距底 22px，页面内容滚到这一带会从缝隙里露出来
 * （截图里「只看可用 / 全部 / 法律检索…」那一排）。这里在胶囊背后铺一块
 * 与页面同色的实心挡板，完整盖住底部条带；它不吃点击（pointer-events:none），
 * 层级在页面内容之上、胶囊之下。
 * ========================================================================== */
body.mobile .tabbar::before {
  content: '';
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--m-tabbar-h) + var(--m-tabbar-bottom) + var(--m-safe-bottom) + 8px);
  background: #F2F6FD;
  z-index: -1;
  pointer-events: none;
}


/* ==========================================================================
 * 底部挡板（改用 body 上的独立层，不再依赖胶囊的伪元素）
 * --------------------------------------------------------------------------
 * 上一版挂在 `.tabbar::before` 上，胶囊自身是 fixed + z-index:10 的层叠上下文，
 * 伪元素的负层级在某些 WebView 里会落到页面背景之下 —— 于是挡板「存在但看不见」，
 * 胶囊下面那排文字照样露出来。
 * 这次改成 body 上的 fixed 元素，层级 9（低于胶囊的 10、高于内容），
 * 通栏铺满到底部条带，不参与点击。
 * ========================================================================== */
body.mobile::after {
  content: '';
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--m-tabbar-bottom) + var(--m-safe-bottom) + 10px);
  background: #F2F6FD;
  z-index: 9;
  pointer-events: none;
}
/* 旧写法保留但不再使用，避免负层级在某些机型上不生效 */
body.mobile .tabbar::before { content: none; }
