/* ==========================================================================
 * 02 工作台（左菜单 + 右功能网格）
 * --------------------------------------------------------------------------
 * 数值全部取自 docs/design-handoff/design-spec.md 第七节（工作台是规范里写得
 * 最细的一屏）：
 *   左菜单宽 112 · 菜单项高 32 / 纵向 gap 7 · 菜单图标 14 · 菜单文字 12.5
 *   选中态底 #E7F0FF 圆角 8 · 指示条 3×18 圆角 2 #0064E0
 *   右栏左右边距 14 · Pane 标题 15 · 计数徽章浅蓝底圆角 6 字号 10
 *   功能卡 109×72 圆角 14 白底 + #EDF0F3 描边 · 内边距 8 · 图标 20 · 文字 11
 *   网格间距 横向 10 / 纵向 10
 *
 * 字号关系是硬要求：菜单 12.5 **大于** 功能卡 11，不能颠倒。
 * ========================================================================== */

/* 头部（复用骨架的蓝渐变头，这一屏头部里多了搜索框） */
body.mobile .mk-head.mw-head { padding-bottom: 16px; }
body.mobile .mw-round {
  width: 38px; height: 38px; flex: none; padding: 0; border: none;
  border-radius: 50%; background: rgba(255, 255, 255, .16); color: var(--m-on-brand);
  display: flex; align-items: center; justify-content: center;
}
body.mobile .mw-round:active { background: rgba(255, 255, 255, .26); }

/* 搜索胶囊：白底、圆角 19、高 38。
   里面是一个真输入框（早先是纯 div，点了没反应），因此不再用 cursor:pointer。 */
body.mobile .mw-search {
  display: flex; align-items: center; gap: 8px;
  height: 38px; margin-top: 14px; padding: 0 12px;
  border-radius: 19px; background: var(--m-card);
  color: var(--m-t3); font-size: 12.5px;
}
body.mobile .mw-search .mk-ic { color: var(--m-t3); flex: none; }
body.mobile .mw-search input {
  flex: 1; min-width: 0; height: 100%;
  border: none; outline: none; background: none; padding: 0;
  font-family: var(--m-ff); font-size: 12.5px; color: var(--m-t1);
}
body.mobile .mw-search input::placeholder { color: var(--m-t3); }
body.mobile .mw-search .mw-clear {
  flex: none; display: flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; padding: 0; border: none; border-radius: 50%;
  background: #E7EBF0; color: var(--m-t2);
}
body.mobile .mw-search .mw-clear[hidden] { display: none; }

/* 区块标题右侧是纯文字（不是按钮），骨架里只定义了 a / button */
body.mobile .mk-sec > span { font-size: var(--m-fs-note); color: var(--m-t3); }

/* 这一屏的外层内容区不能带左右内边距：
   骨架的 .mk-body 有 20px，加上左菜单 112 + 右栏 14 之后，
   右栏只剩 210px —— 两张 109 的卡加 10 间距要 228px，放不下会变成一行一张。
   边距改由左菜单与右栏各自负责（与设计稿一致）。 */
body.mobile .mk-body.mw-wrap { padding: 0; }
body.mobile .mk-body.mw-wrap .mk-sec { padding-left: 20px; padding-right: 20px; }

body.mobile .mw-body {
  display: flex; align-items: flex-start; gap: 0;
  padding: 0;                 /* 左右边距由左菜单与右栏各自负责 */
}

/* ------------------------------ 左菜单 ------------------------------
   工作台整屏锁定（见下方 .mw-page）：页面本身不滚动，
   左菜单与右栏各自独立上下滑动。 */
body.mobile .mw-rail {
  /* 118：字号调到 13.5 后，「用工安全 / 法律检索」这类五项词要放得下才不被省略号截断 */
  width: 118px; flex: none;
  display: flex; flex-direction: column; gap: 8px;
  padding: 2px 0 8px;
  /* 16 个分类 × 36 + 间距 ≈ 700px，比可视区高，必须自己滚（整页已锁定不滚） */
  overflow-y: auto;
  overscroll-behavior: contain;   /* 滑到头不再带动整页 */
  scrollbar-width: none;          /* 118px 宽的栏里放不下滚动条，藏掉 */
}
body.mobile .mw-rail::-webkit-scrollbar { display: none; }

/* 整屏布局：高度 = 视口减去底部胶囊 Tab Bar 那一块。
   头部（蓝渐变 + 搜索框）占自然高度，剩余全部给内容区；
   内容区里的左右两栏各自滚动 —— 页面级滚动就此消失。 */
body.mobile .mk-page.mw-page {
  box-sizing: border-box;
  height: calc(100vh - var(--m-tabbar-h) - var(--m-tabbar-bottom) - var(--m-safe-bottom));
  height: calc(100dvh - var(--m-tabbar-h) - var(--m-tabbar-bottom) - var(--m-safe-bottom));
  display: flex; flex-direction: column;
  padding-bottom: 0;              /* 顶掉 mk-page 预留的 76px：这页没有随页滚动的内容 */
  overflow: hidden;
}
body.mobile .mk-page.mw-page .mk-body.mw-wrap {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
}
body.mobile .mk-page.mw-page .mw-body {
  flex: 1; min-height: 0;
  align-items: stretch;           /* 两栏撑满内容区高度，各自的滚动区才有界 */
}
body.mobile .mk-page.mw-page .mw-rail { height: 100%; padding-bottom: 76px; }
body.mobile .mk-page.mw-page .mw-pane {
  height: 100%;
  /* 底部给悬浮球让位（球 58 + 与胶囊间距 12 + 余量）。
     工作台是整屏锁定的：内容滚到底就再也滚不动了，不留这段内边距，
     最后一排卡片会永久压在球下面 —— 表现就是「滑不动了」。
     左右各 14px 由基础规则给，这里只补底部。 */
  padding-bottom: 83px;
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: none;
}
body.mobile .mk-page.mw-page .mw-pane::-webkit-scrollbar { display: none; }
body.mobile .mw-rail-item {
  position: relative;
  display: flex; align-items: center; gap: 9px;
  /* 32 → 36、字号 12.5 → 13.5、图标 14 → 16：原来挤在一列里偏小，
     与右栏 15px 的分类标题不成比例 */
  height: 36px; padding: 0 8px 0 12px;
  border: none; background: none; cursor: pointer;
  border-radius: 8px; color: var(--m-t2);
  font-size: 13.5px; font-weight: 400; text-align: left;
  font-family: var(--m-ff);
  transition: background .16s var(--ease, ease), color .16s var(--ease, ease);
}
body.mobile .mw-rail-item .mk-ic { flex: none; }
body.mobile .mw-rail-item > span:last-child {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 选中态：浅蓝底 + 左侧 3×18 的指示条 */
body.mobile .mw-rail-item.on {
  background: var(--m-tint); color: var(--m-brand); font-weight: 600;
}
body.mobile .mw-rail-item.on::before {
  content: ''; position: absolute; left: 0; top: 50%; margin-top: -9px;
  width: 3px; height: 18px; border-radius: 2px; background: var(--m-brand);
}
body.mobile .mw-rail-item:active { background: var(--m-tint); }

/* ------------------------------ 右栏 ------------------------------ */
body.mobile .mw-pane { flex: 1; min-width: 0; padding: 0 14px; }
body.mobile .mw-pane-head {
  display: flex; align-items: center; gap: 8px; margin: 0 0 10px;
}
body.mobile .mw-pane-head b {
  font-size: 15px; font-weight: 600; color: var(--m-t1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
body.mobile .mw-pane-head span {
  flex: none; height: 18px; padding: 0 6px; border-radius: 6px;
  background: var(--m-tint); color: var(--m-tint-tx);
  font-size: 10px; font-weight: 500;
  display: inline-flex; align-items: center;
}
body.mobile .mw-grid { display: flex; flex-wrap: wrap; gap: 10px; }

/* 功能卡：109×72 固定尺寸（不拉伸 —— 设计稿右栏右侧留有空白） */
body.mobile .mw-card {
  width: 109px; height: 72px; flex: none;
  border-radius: 14px; background: var(--m-card);
  border: 1px solid var(--m-line); box-shadow: var(--m-sh-card);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 8px; box-sizing: border-box;
  cursor: pointer; font-family: var(--m-ff);
}
body.mobile .mw-card .mk-ic { color: var(--m-brand); flex: none; }
body.mobile .mw-card b {
  font-size: 11px; font-weight: 500; color: var(--m-t1);
  line-height: 1.25; text-align: center;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
body.mobile .mw-card:active { transform: scale(.97); }

/* 切换分类时右栏淡入，避免生硬跳变（规范里建议 150ms） */
@keyframes mwFade {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}
body.mobile .mw-pane .mw-anim { animation: mwFade .15s var(--ease-out, ease-out) both; }

/* 精准获客入口卡：与模块卡同一格，用描边强调它是「入口」而不是某项 AI 能力 */
body.mobile .mw-card-lead{border-color:var(--m-brand);background:linear-gradient(180deg,#fff,#F5F8FF)}
body.mobile .mw-card-lead .mk-ic{color:var(--m-brand)}


/* ==========================================================================
 * 工作台 2.0（按设计稿 1:1 复刻）
 * --------------------------------------------------------------------------
 * 结构：蓝渐变头（标题 + 头像 + 铃）→ 搜索胶囊 → 今日待办 / 智能助手
 *       → 法律检索 · 案件管理 · 合规风控 · 智能办公 → 全部办案能力
 * 命名统一用 wd- 前缀，与旧版 mw-* 互不干扰（旧样式保留，其他页面未使用）。
 * ========================================================================== */
body.mobile .wd-page {
  background: linear-gradient(180deg, #EAF2FF 0, #F5F9FF 300px, #F5F9FF 100%);
  min-height: 100vh;
}

/* ---------- 头部 ---------- */
body.mobile .wd-head {
  position: relative;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 18px 64px;
  background: linear-gradient(180deg, #1F6BFF 0%, #2F86FF 100%);
  border-radius: 0 0 26px 26px;
  color: #fff;
  box-shadow: 0 12px 26px rgba(31, 107, 255, .22);
}
body.mobile .wd-head-top { display: flex; align-items: center; justify-content: space-between; }
body.mobile .wd-head h1 {
  margin: 0; font-size: 25px; font-weight: 700; letter-spacing: .5px; color: #fff;
}
body.mobile .wd-acts { display: flex; align-items: center; gap: 10px; }
body.mobile .wd-ava {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .22); border: 1px solid rgba(255, 255, 255, .5);
  color: #fff; font-size: 15px; font-weight: 600; text-decoration: none;
}
body.mobile .wd-bell {
  width: 36px; height: 36px; padding: 0; border: none; border-radius: 50%;
  background: rgba(255, 255, 255, .16); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
body.mobile .wd-bell:active { background: rgba(255, 255, 255, .3); }

/* 搜索胶囊：白底 + 右侧蓝色圆钮（与设计稿一致） */
body.mobile .wd-search {
  display: flex; align-items: center; gap: 9px;
  height: 46px; margin-top: 16px; padding: 5px 5px 5px 15px;
  border-radius: 23px; background: #fff;
  box-shadow: 0 6px 18px rgba(16, 62, 145, .16);
  color: #9AA7BC;
}
body.mobile .wd-search input {
  flex: 1; min-width: 0; height: 100%; border: none; outline: none; background: none;
  padding: 0; font-family: var(--m-ff); font-size: 13.5px; color: #1B2740;
}
body.mobile .wd-search input::placeholder { color: #9AA7BC; }
body.mobile .wd-search-go {
  flex: none; width: 36px; height: 36px; padding: 0; border: none; border-radius: 50%;
  background: linear-gradient(135deg, #1F6BFF, #3B8BFF); color: #fff;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- 内容区（上移压住头部下缘） ---------- */
body.mobile .wd-body {
  position: relative; z-index: 2;
  margin-top: -48px; padding: 0 16px;
}

/* 待办 + 智能助手 */
body.mobile .wd-row2 { display: grid; grid-template-columns: 1.85fr 1fr; gap: 11px; }
body.mobile .wd-todo {
  border-radius: 18px; padding: 15px 16px 14px;
  background: linear-gradient(135deg, #2E7DFF 0%, #59A6FF 100%);
  color: #fff; box-shadow: 0 10px 22px rgba(31, 107, 255, .26);
}
body.mobile .wd-todo-t { font-size: 15px; font-weight: 700; margin-bottom: 11px; }
body.mobile .wd-todo-nums { display: flex; gap: 10px; }
body.mobile .wd-todo-nums > div { flex: 1; display: flex; flex-direction: column; gap: 3px; }
body.mobile .wd-todo-nums span { font-size: 11px; opacity: .9; }
body.mobile .wd-todo-nums b { font-size: 26px; line-height: 1; font-weight: 700; letter-spacing: .5px; }

body.mobile .wd-assist {
  border-radius: 18px; background: #fff; padding: 12px 8px 11px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  box-shadow: 0 8px 20px rgba(31, 72, 150, .1);
}
body.mobile .wd-assist-ic {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #EAF2FF; color: #2C7BFF;
}
body.mobile .wd-assist b { font-size: 12.5px; color: #1B2740; font-weight: 600; }
body.mobile .wd-assist-row { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: #7C8AA0; }
body.mobile .wd-switch {
  width: 32px; height: 19px; border-radius: 999px; background: #D9E2F0; position: relative;
  transition: background .18s ease;
}
body.mobile .wd-switch::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
  transition: transform .18s ease;
}
body.mobile .wd-switch.on { background: linear-gradient(90deg, #2C7BFF, #59A6FF); }
body.mobile .wd-switch.on::after { transform: translateX(13px); }

/* ---------- 四个区块 ---------- */
body.mobile .wd-sec {
  margin-top: 12px; border-radius: 18px; padding: 13px 12px 12px;
  background: linear-gradient(135deg, #2F86FF 0%, #57A9FF 100%);
  box-shadow: 0 10px 22px rgba(31, 107, 255, .18);
}
body.mobile .wd-sec.s2, body.mobile .wd-sec.s3 {
  background: linear-gradient(135deg, #3B8DFF 0%, #63B2FF 100%);
  padding: 12px 10px 10px;
}
body.mobile .wd-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
body.mobile .wd-sec-h { padding: 0 3px 10px; }
body.mobile .wd-sec-h b { font-size: 15.5px; font-weight: 700; color: #fff; }
body.mobile .wd-sec-h b::after {
  content: ''; display: block; width: 22px; height: 3px; margin-top: 5px;
  border-radius: 2px; background: rgba(255, 255, 255, .8);
}

body.mobile .wd-tiles { display: grid; gap: 8px; }
body.mobile .wd-tiles.three { grid-template-columns: repeat(3, 1fr); }
body.mobile .wd-tiles.two { grid-template-columns: repeat(2, 1fr); gap: 7px; }
body.mobile .wd-tile {
  border: none; background: #fff; border-radius: 14px;
  padding: 12px 6px 10px; display: flex; flex-direction: column;
  align-items: center; gap: 6px; min-height: 96px;
  box-shadow: 0 3px 10px rgba(20, 60, 140, .10);
}
body.mobile .wd-tile:active { transform: scale(.97); }
body.mobile .wd-tile-ic {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #EEF5FF, #E2EEFF); color: #2C7BFF;
}
body.mobile .wd-tile b {
  font-size: 12.5px; font-weight: 600; color: #1B2740; text-align: center; line-height: 1.35;
}
body.mobile .wd-tile i {
  font-style: normal; font-size: 10px; color: #3B7BE0;
  background: #ECF3FF; border-radius: 999px; padding: 2px 8px;
}
body.mobile .wd-sec.s2 .wd-tile, body.mobile .wd-sec.s3 .wd-tile { min-height: 92px; padding: 10px 4px 9px; }
body.mobile .wd-sec.s2 .wd-tile b, body.mobile .wd-sec.s3 .wd-tile b { font-size: 12px; }

/* 智能办公条 */
body.mobile .wd-sec.s4 { padding: 0; background: none; box-shadow: none; }
body.mobile .wd-wide {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-radius: 18px;
  background: linear-gradient(135deg, #3C8DFF 0%, #62B3FF 100%);
  color: #fff; box-shadow: 0 10px 22px rgba(31, 107, 255, .2);
}
body.mobile .wd-wide b { font-size: 15.5px; font-weight: 700; display: block; }
body.mobile .wd-wide span { font-size: 11px; opacity: .9; display: block; margin-top: 4px; }
body.mobile .wd-plus {
  width: 40px; height: 40px; flex: none; padding: 0; border: none; border-radius: 50%;
  background: #fff; color: #2C7BFF;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 14px rgba(10, 40, 100, .18);
}

/* ---------- 全部办案能力 ---------- */
body.mobile .wd-all {
  margin-top: 12px; background: #fff; border-radius: 18px;
  padding: 14px 12px 14px; box-shadow: 0 8px 20px rgba(31, 72, 150, .08);
}
body.mobile .wd-all-h { display: flex; align-items: baseline; justify-content: space-between; }
body.mobile .wd-all-h b { font-size: 15.5px; color: #1B2740; }
body.mobile .wd-all-h span { font-size: 11px; color: #8593A8; }
body.mobile .wd-chips {
  display: flex; gap: 8px; overflow-x: auto; padding: 11px 2px 12px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
body.mobile .wd-chips::-webkit-scrollbar { display: none; }
body.mobile .wd-chip {
  flex: none; height: 30px; padding: 0 12px; border: none; border-radius: 999px;
  background: #F0F4FB; color: #4B5B73; font-size: 12px; font-family: var(--m-ff);
}
body.mobile .wd-chip.on {
  background: linear-gradient(135deg, #2C7BFF, #4C9BFF); color: #fff;
  box-shadow: 0 4px 10px rgba(44, 123, 255, .28);
}
body.mobile .wd-chip-filter { border: 1px dashed #C9D8F2; background: #fff; }
body.mobile .wd-chip-filter.on {
  border: 1px solid transparent;
  background: linear-gradient(135deg, #2C7BFF, #4C9BFF); color: #fff;
}

body.mobile .wd-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
body.mobile .wd-card {
  border: 1px solid #E6EEFB; background: #F7FAFF; border-radius: 14px;
  padding: 12px 8px; min-height: 88px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
}
body.mobile .wd-card:active { transform: scale(.98); background: #EFF5FF; }
body.mobile .wd-card-ic {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #EAF2FF; color: #2C7BFF;
}
body.mobile .wd-card b {
  font-size: 12px; font-weight: 600; color: #1B2740;
  text-align: center; line-height: 1.4;
}

@media (max-width: 360px) {
  body.mobile .wd-row2 { grid-template-columns: 1.6fr 1fr; }
  body.mobile .wd-tile b { font-size: 11.5px; }
  body.mobile .wd-card b { font-size: 11.5px; }
}
