/* ============================================================
   一诺人力 · 移动端组件层 mobile.css（M-18 · B11）
   ------------------------------------------------------------
   定位：只在移动断点（max-width:767px）生效的组件类层。
   与 tokens.css 的分工：
     · tokens.css 两仓同字节（md5 b9afff257427119bbdd77fe8df70c5e3），
       本单**不改**（否则破坏「两仓同字节」既有约束）；
     · 移动层令牌统一放本文件 :root（00 工单 §二.1 明示允许）。
   门禁：本文件不含内联 style、无第三方依赖、无 CDN、无 @import。
   ============================================================ */

/* ---------- 一、移动令牌层（字号 / 间距 / 圆角 / 触达 / 安全区） ---------- */
:root {
  /* 字号阶梯：12 / 14 / 16 / 18 / 22 */
  --m-fs-12: 12px;
  --m-fs-14: 14px;
  --m-fs-16: 16px;
  --m-fs-18: 18px;
  --m-fs-22: 22px;

  /* 间距阶梯：4 的倍数 */
  --m-sp-1: 4px;
  --m-sp-2: 8px;
  --m-sp-3: 12px;
  --m-sp-4: 16px;
  --m-sp-5: 20px;
  --m-sp-6: 24px;
  --m-sp-7: 28px;
  --m-sp-8: 32px;

  /* 圆角：8 / 12 / 16 */
  --m-radius-8: 8px;
  --m-radius-12: 12px;
  --m-radius-16: 16px;

  /* 触达下限：44px（iOS HIG / Material 共同下限） */
  --m-touch: 44px;

  /* 底部 Tab 实测高（内容撑开 97px，不是 h-16 的 64px） */
  --m-tab-h: 97px;

  /* 底部安全区（iPhone 刘海机型 env 生效，Android 退回 0） */
  --m-safe-bottom: env(safe-area-inset-bottom);
}

/* ---------- 二、组件层（仅移动断点生效） ---------- */
@media (max-width: 767px) {

  /* --- m-card：列表项（标题 / 副文案 / 右侧状态 / 整行可点） --- */
  .m-card {
    display: flex;
    align-items: center;
    gap: var(--m-sp-3);
    width: 100%;
    min-height: 64px;
    padding: var(--m-sp-4);
    background: var(--surface, #FFFFFF);
    border: 1px solid var(--border, #E5E7EB);
    border-radius: var(--m-radius-12);
    font-size: var(--m-fs-14);
    color: var(--text-body, #374151);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }
  .m-card + .m-card { margin-top: var(--m-sp-2); }
  .m-card:active { background: var(--surface-soft, #F9FAFB); }
  .m-card-main { flex: 1 1 auto; min-width: 0; }
  .m-card-title {
    display: block;
    font-size: var(--m-fs-16);
    font-weight: 600;
    color: var(--text-strong, #111827);
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .m-card-sub {
    display: block;
    margin-top: var(--m-sp-1);
    font-size: var(--m-fs-12);
    color: var(--text-muted, #6B7280);
    line-height: 1.4;
  }
  .m-card-status {
    flex: 0 0 auto;
    font-size: var(--m-fs-14);
    color: var(--text-muted, #6B7280);
    white-space: nowrap;
  }

  /* --- m-field：label + input + 错误行 --- */
  .m-field {
    display: block;
    width: 100%;
    margin-bottom: var(--m-sp-4);
    min-height: var(--m-touch);
  }
  .m-field-label {
    display: block;
    margin-bottom: var(--m-sp-2);
    font-size: var(--m-fs-14);
    font-weight: 600;
    color: var(--text-body, #374151);
  }
  .m-field-input {
    display: block;
    width: 100%;
    min-height: var(--m-touch);
    padding: var(--m-sp-2) var(--m-sp-3);
    font-size: var(--m-fs-16);
    color: var(--text-strong, #111827);
    background: var(--surface, #FFFFFF);
    border: 1px solid var(--border-strong, #D1D5DB);
    border-radius: var(--m-radius-8);
    -webkit-appearance: none;
  }
  .m-field-input:focus {
    outline: 0;
    border-color: var(--brand, #2F5BEA);
    box-shadow: 0 0 0 3px var(--brand-ring, rgba(47, 91, 234, .16));
  }
  .m-field-err {
    display: block;
    margin-top: var(--m-sp-1);
    font-size: var(--m-fs-12);
    color: #DC2626;
    line-height: 1.4;
  }

  /* --- m-btn：主 / 次 / 危险 / 块级，触达 44px --- */
  .m-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--m-sp-2);
    min-height: var(--m-touch);
    padding: 0 var(--m-sp-4);
    font-size: var(--m-fs-16);
    font-weight: 600;
    line-height: 1.2;
    border: 1px solid transparent;
    border-radius: var(--m-radius-8);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .m-btn-primary { background: var(--brand, #2F5BEA); color: #FFFFFF; }
  .m-btn-primary:active { background: var(--brand-hover, #2748C4); }
  .m-btn-soft {
    background: var(--brand-weak, #EEF2FF);
    color: var(--brand, #2F5BEA);
    border-color: var(--brand-weak, #EEF2FF);
  }
  .m-btn-ghost {
    background: var(--surface, #FFFFFF);
    color: var(--text-body, #374151);
    border-color: var(--border-strong, #D1D5DB);
  }
  .m-btn-danger { background: #DC2626; color: #FFFFFF; }
  .m-btn-block { display: flex; width: 100%; }
  .m-btn[disabled], .m-btn:disabled { opacity: .5; cursor: not-allowed; }

  /* --- m-empty：空态 --- */
  .m-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: var(--m-touch);
    padding: var(--m-sp-8) var(--m-sp-4);
    font-size: var(--m-fs-14);
    color: var(--text-faint, #9CA3AF);
    text-align: center;
    line-height: 1.6;
  }
  .m-empty-title {
    font-size: var(--m-fs-16);
    color: var(--text-muted, #6B7280);
    margin-bottom: var(--m-sp-1);
  }

  /* --- m-skeleton：骨架屏（加载态占位） --- */
  .m-skeleton {
    display: block;
    min-height: var(--m-touch);
    background:
      linear-gradient(90deg, #F1F2F4 25%, #E7E9ED 37%, #F1F2F4 63%);
    background-size: 400% 100%;
    border: 0;
    border-radius: var(--m-radius-8);
    animation: m-skeleton-shimmer 1.4s ease infinite;
  }
  .m-skeleton-line {
    display: block;
    height: var(--m-fs-14);
    min-height: var(--m-fs-14);
    margin-bottom: var(--m-sp-2);
    border-radius: var(--m-radius-8);
    background: #F1F2F4;
  }

  /* --- m-toast：轻提示（默认内联常驻；--fixed 走底部浮层） --- */
  .m-toast {
    display: block;
    min-height: var(--m-touch);
    padding: var(--m-sp-3) var(--m-sp-4);
    font-size: var(--m-fs-14);
    line-height: 1.5;
    color: var(--text-body, #374151);
    background: var(--surface-soft, #F9FAFB);
    border: 1px solid var(--border, #E5E7EB);
    border-radius: var(--m-radius-8);
  }
  .m-toast--fixed {
    position: fixed;
    left: var(--m-sp-4);
    right: var(--m-sp-4);
    bottom: calc(var(--m-sp-5) + var(--m-safe-bottom));
    z-index: 30;
    box-shadow: 0 6px 20px rgba(17, 24, 39, .12);
  }

  /* --- m-actionbar：底部固定操作条（含安全区） --- */
  .m-actionbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: var(--m-sp-2);
    min-height: 56px;
    padding: var(--m-sp-2) var(--m-sp-4);
    padding-bottom: calc(var(--m-sp-2) + var(--m-safe-bottom));
    background: var(--surface, #FFFFFF);
    border-top: 1px solid var(--border, #E5E7EB);
  }
  .m-actionbar > .m-btn { flex: 1 1 0; }
}

/* 骨架屏动画只在移动断点声明，避免桌面端空跑 */
@media (max-width: 767px) {
  @keyframes m-skeleton-shimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
  }
}

/* ---------- 三、页面骨架层（M-19 · 5 个独立 H5 共用） ----------
   口径：本层不受 767 断点限制——5 个独立 H5 是手机专用页，
   桌面端打开也要有正确底色/字号/内边距（组件层仍只在移动断点生效）。
   设计依据：docs/移动端设计规范.md §四「页面骨架模板（三段式）」
   ------------------------------------------------------------ */

/* --- m-page：页面根（body 挂载）--- */
.m-page {
  margin: 0;
  padding: 0;
  background: var(--bg-page, #F7F8FA);
  color: var(--text-body, #374151);
  font-family: var(--font-sans, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif);
  font-size: var(--m-fs-14);
  line-height: 1.5;
}

/* 独立 H5 不挂 base.html，没有 Tailwind preflight；
   把 border-box 收进 .m-page 作用域（不影响管理端，也不改 tokens.css）。 */
.m-page,
.m-page *,
.m-page *::before,
.m-page *::after { box-sizing: border-box; }

/* --- m-head：顶栏（sticky 44，左返回／中标题／右动作）--- */
.m-head {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: var(--m-sp-2);
  min-height: var(--m-touch);
  padding: var(--m-sp-2) var(--m-sp-4);
  background: var(--surface, #FFFFFF);
  border-bottom: 1px solid var(--border, #E5E7EB);
}
.m-head--brand {
  background: var(--brand, #2F5BEA);
  border-bottom-color: var(--brand-hover, #2748C4);
}
.m-head--brand .m-head-title,
.m-head--brand .m-head-sub,
.m-head--brand .m-head-link { color: #FFFFFF; }
.m-head-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: var(--m-fs-18);
  font-weight: 700;
  color: var(--text-strong, #111827);
  line-height: 1.3;
}
.m-head-sub {
  display: block;
  margin-top: var(--m-sp-1);
  font-size: var(--m-fs-12);
  font-weight: 400;
  color: var(--text-muted, #6B7280);
}
.m-head-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--m-touch);
  min-height: var(--m-touch);
  padding: 0 var(--m-sp-2);
  font-size: var(--m-fs-14);
  color: var(--text-muted, #6B7280);
  text-decoration: none;
  background: none;
  border: 0;
}

/* --- m-page-body：内容区（16 内边距；有底部操作条时留出滚动余量，避免遮挡最后一行）--- */
.m-page-body { padding: var(--m-sp-4); }
.m-page-body--actionbar { padding-bottom: calc(56px + var(--m-sp-4) + var(--m-safe-bottom)); }

/* --- m-section：区块 --- */
.m-section { margin-bottom: var(--m-sp-4); }
.m-section-title {
  display: block;
  margin-bottom: var(--m-sp-3);
  font-size: var(--m-fs-16);
  font-weight: 700;
  color: var(--text-strong, #111827);
}
.m-section-sub {
  display: block;
  margin-bottom: var(--m-sp-2);
  font-size: var(--m-fs-12);
  color: var(--text-muted, #6B7280);
}
.m-section-text {
  display: block;
  margin: var(--m-sp-2) 0 0;
  font-size: var(--m-fs-14);
  color: var(--text-body, #374151);
  line-height: 1.7;
}

/* --- m-list：列表容器（内放 m-card，竖向排列）--- */
.m-list { display: block; margin: 0; padding: 0; }

/* --- m-hint：注脚 --- */
.m-hint {
  display: block;
  margin-top: var(--m-sp-3);
  font-size: var(--m-fs-12);
  color: var(--text-faint, #9CA3AF);
  line-height: 1.6;
}
.m-hint--ok { color: #047857; }

/* --- m-row：两端对齐行（姓名＋月份）--- */
.m-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--m-sp-2);
}
.m-row-title { font-size: var(--m-fs-18); font-weight: 700; color: var(--text-strong, #111827); }
.m-row-meta { font-size: var(--m-fs-14); color: var(--text-muted, #6B7280); }

/* --- m-tag：行内小标签（绩效）--- */
.m-tag {
  display: inline-block;
  margin-left: var(--m-sp-2);
  padding: 0 var(--m-sp-2);
  font-size: var(--m-fs-12);
  line-height: 1.8;
  color: var(--brand, #2F5BEA);
  background: var(--brand-weak, #EEF2FF);
  border-radius: 999px;
}

/* --- m-clock：打卡大字时间（首屏焦点数字走 22 号）--- */
.m-clock {
  display: block;
  margin: var(--m-sp-3) 0 var(--m-sp-2);
  font-size: var(--m-fs-22);
  font-weight: 700;
  color: var(--brand, #2F5BEA);
  font-variant-numeric: tabular-nums;
}

/* --- m-center / m-tick：居中与成功对勾 --- */
.m-center { text-align: center; }
.m-tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto var(--m-sp-3);
  font-size: var(--m-fs-22);
  font-weight: 700;
  color: #FFFFFF;
  background: var(--success, #10B981);
  border-radius: 50%;
}

/* --- m-poster：专属报名码页 --- */
.m-poster { text-align: center; }
.m-poster-qr { width: 220px; height: 220px; max-width: 100%; }
.m-poster-code {
  margin: var(--m-sp-3) 0 var(--m-sp-1);
  font-size: var(--m-fs-16);
  font-weight: 600;
  color: var(--text-strong, #111827);
}
.m-poster-url { margin: 0; font-size: var(--m-fs-12); color: var(--text-muted, #6B7280); word-break: break-all; }

/* --- m-hidden：初始隐藏（JS 用 inline display 覆盖，故此处不加 !important）--- */
.m-hidden { display: none; }

/* --- m-table：明细表（金额明细专用；列表一律 m-card，不在此列）--- */
.m-page .m-table { width: 100%; border-collapse: collapse; font-size: var(--m-fs-14); }
.m-page .m-table th,
.m-page .m-table td {
  padding: var(--m-sp-3) var(--m-sp-1);
  border-bottom: 1px solid var(--border, #E5E7EB);
  text-align: left;
}
.m-page .m-table th { font-size: var(--m-fs-12); font-weight: 500; color: var(--text-muted, #6B7280); }
.m-page .m-table .amt { text-align: right; font-variant-numeric: tabular-nums; }
.m-page .m-table .total td {
  font-weight: 700;
  border-top: 2px solid var(--brand, #2F5BEA);
  border-bottom: 0;
}
.m-page .m-table .total .amt { font-size: var(--m-fs-22); color: var(--brand, #2F5BEA); }

/* --- m-toast 语义变体（组件本体见 §二；变体只改语义色）--- */
.m-toast--err { color: #991B1B; background: var(--danger-bg, #FEF2F2); border-color: var(--danger-border, #FECACA); }
.m-toast--warn { color: #92400E; background: #FFFBEB; border-color: #FDE68A; }

/* --- JS 兼容类（M-19 口径；只作用于 .m-page 页面，不污染管理端与登录页）---
   打卡页/签到页的既有 JS 会整体重写 #msg 的 className（"msg" / "msg ok" / "msg err"），
   或切换 #queue、#err 的 display；为「不改 JS 逻辑」同时不让样式掉，
   这类元素用不带 m- 前缀的兼容类承载与 m-toast 同色同尺寸的视觉。 */
.m-page .msg {
  display: block;
  min-height: var(--m-touch);
  padding: var(--m-sp-3) var(--m-sp-4);
  font-size: var(--m-fs-14);
  line-height: 1.5;
  color: var(--text-body, #374151);
  background: var(--surface-soft, #F9FAFB);
  border: 1px solid var(--border, #E5E7EB);
  border-radius: var(--m-radius-8);
  word-break: break-all;
}
.m-page .msg:empty { display: none; }
.m-page .msg.ok { color: #047857; background: #ECFDF5; border-color: #A7F3D0; }
.m-page .msg.err { color: #991B1B; background: var(--danger-bg, #FEF2F2); border-color: var(--danger-border, #FECACA); }
.m-page .queue {
  display: none;
  margin-top: var(--m-sp-2);
  padding: var(--m-sp-2) var(--m-sp-3);
  font-size: var(--m-fs-12);
  line-height: 1.5;
  color: #92400E;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: var(--m-radius-8);
}
.m-page .err {
  display: none;
  margin-top: var(--m-sp-3);
  padding: var(--m-sp-3) var(--m-sp-4);
  font-size: var(--m-fs-14);
  line-height: 1.6;
  color: #991B1B;
  background: var(--danger-bg, #FEF2F2);
  border: 1px solid var(--danger-border, #FECACA);
  border-radius: var(--m-radius-8);
}

/* ---------- 四、管理端核心页卡片流断点开关（M-20 · /my、/project-employees、/candidates） ----------
   口径：<768px 用卡片流（宽表隐藏）；≥768px 一律维持既有外观
   （768–1023 仍走 app-components.css 的「表格堆叠」旧层，≥1024 原表格原样）。
   做法：**两套 DOM**，由同一次请求的同一份模板渲染（同一 records 循环），
   只靠下面这对开关切换，不产生第二次数据请求（派单 §三.6 二选一取「两套 DOM」）。
   ------------------------------------------------------------ */

/* 默认（≥768px）：卡片流隐藏；<768px 反过来，宽表隐藏。 */
.m-mobile-only { display: none; }

@media (max-width: 767px) {
  .m-mobile-only { display: block; }
  .m-desktop-only { display: none; }
  /* 双保险：容器隐藏之外，表格元素本身也判 display:none（判据 1 字面口径） */
  .m-desktop-only table { display: none; }
  /* 卡片右侧主操作：不被副信息挤压（窄屏长文案时「详情」不许折成两行） */
  .m-card .m-btn { flex: 0 0 auto; white-space: nowrap; }
  /* 状态/保险标签不参与折行：375 下「待补保」「未投保·逾期」被拆成两行（实拍抓到） */
  .m-tag { white-space: nowrap; }
}

/* --- 五、M-32 老板／HR 首页 /dashboard 移动端（<768 生效；≥768 零影响）--- */
@media (max-width: 767px) {
  .m-hero { padding: 12px 14px; }
  .m-hero-title { font-size: 17px; line-height: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .m-hero-sub { margin-top: 4px; font-size: 12px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .m-hero-bar { margin-top: 8px; }
  .m-hero-track { height: 3px; }
  .m-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .m-kpi-grid > .card { padding: 12px !important; }
  .m-kpi-grid .text-3xl { font-size: 20px; line-height: 26px; }
  .m-kpi-grid .text-sm { font-size: 12px; line-height: 16px; }
  .m-kpi-grid .w-10 { width: 28px; height: 28px; flex: 0 0 28px; }
  main .m-kpi-grid .flex.justify-between { flex-wrap: nowrap; }
  .m-alert { padding: 8px 12px; }
  .m-alert .text-sm { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; line-height: 18px; }
  .m-alert > a { display: inline-flex; align-items: center; min-height: 44px !important; }
}

/* 360/374 极窄：KPI 数值与标签单行，避免 2 列下 2026-11 折成两行、同排不等高 */
@media (max-width: 374px) {
  .m-kpi-grid .text-3xl { font-size: 18px; line-height: 24px; white-space: nowrap; }
  .m-kpi-grid .text-sm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* ============================================================
   M-38 移动端美学基准 · 组件契约补层（B13 首件，2026-11-12）
   ------------------------------------------------------------
   只增不改：新增 m-group / m-stat 两类，m-row 增 --kv/--action
   变体（原「姓名＋月份」语义不动），补 m-summary / m-stat-grid /
   m-skeleton-card，m-toast 补 --ok。
   全部收在 max-width:767px 内 ⇒ ≥768 桌面零影响。
   命名冻结：M-33 渲染器只许调用本层与既有 m-* 类。
   ============================================================ */
@media (max-width: 767px) {

  /* --- m-group：分组头（标题左、说明/链接右，触达 44px） --- */
  .m-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--m-sp-2);
    min-height: var(--m-touch);
    margin: var(--m-sp-4) 0 var(--m-sp-2);
    padding: 0 var(--m-sp-1);
  }
  .m-group:first-child { margin-top: 0; }
  .m-group-title {
    font-size: var(--m-fs-14);
    font-weight: 600;
    color: var(--text-body, #374151);
    letter-spacing: .02em;
  }
  .m-group-meta {
    flex: 0 0 auto;
    font-size: var(--m-fs-12);
    color: var(--text-muted, #6B7280);
  }
  .m-group-link {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-height: var(--m-touch);
    font-size: var(--m-fs-14);
    color: var(--brand, #2F5BEA);
    text-decoration: none;
  }

  /* --- m-row--kv：详情/表单行（label 左、值右、整行 44px） --- */
  .m-row--kv {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--m-touch);
    padding: var(--m-sp-3) var(--m-sp-4);
    border-bottom: 1px solid var(--border, #E5E7EB);
    font-size: var(--m-fs-14);
    line-height: 1.5;
  }
  .m-row--kv:last-child { border-bottom: 0; }
  .m-row--kv .m-row-key {
    flex: 0 0 auto;
    color: var(--text-muted, #6B7280);
  }
  .m-row--kv .m-row-val {
    flex: 1 1 auto;
    min-width: 0;
    text-align: right;
    font-size: var(--m-fs-16);
    color: var(--text-strong, #111827);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* --- m-row--action：整行可点（带右箭头，按压态） --- */
  .m-row--action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    padding: var(--m-sp-3) var(--m-sp-4);
    font-size: var(--m-fs-16);
    color: var(--text-strong, #111827);
    text-decoration: none;
    border-bottom: 1px solid var(--border, #E5E7EB);
    -webkit-tap-highlight-color: transparent;
  }
  .m-row--action:last-child { border-bottom: 0; }
  .m-row--action:active { background: var(--surface-soft, #F9FAFB); }
  .m-row--action::after {
    content: "";
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    margin-left: var(--m-sp-2);
    border-top: 2px solid var(--text-faint, #9CA3AF);
    border-right: 2px solid var(--text-faint, #9CA3AF);
    transform: rotate(45deg);
  }

  /* --- m-stat：统计卡（标签 12 / 数值 22 / 单位 12，长值省略） --- */
  .m-stat {
    display: block;
    min-width: 0;
    padding: var(--m-sp-4);
    background: var(--surface, #FFFFFF);
    border: 1px solid var(--border, #E5E7EB);
    border-radius: var(--m-radius-12);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }
  .m-stat:active { background: var(--surface-soft, #F9FAFB); }
  .m-stat-label {
    display: block;
    font-size: var(--m-fs-12);
    color: var(--text-muted, #6B7280);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .m-stat-value {
    display: block;
    margin-top: var(--m-sp-1);
    min-width: 0;
    font-size: var(--m-fs-22);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-strong, #111827);
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .m-stat-unit {
    margin-left: 2px;
    font-size: var(--m-fs-12);
    font-weight: 500;
    color: var(--text-muted, #6B7280);
  }
  .m-stat-delta {
    display: block;
    margin-top: var(--m-sp-1);
    font-size: var(--m-fs-12);
    line-height: 1.4;
    color: var(--text-muted, #6B7280);
  }

  /* --- m-stat-grid：统计卡两列网格（调用方不写内联样式） --- */
  .m-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--m-sp-2);
  }
  .m-stat-grid > .m-stat { padding: var(--m-sp-3); }
  @media (max-width: 374px) {
    .m-stat-grid > .m-stat .m-stat-value { font-size: var(--m-fs-18); }
  }

  /* --- m-summary：可折叠明细行（配合 <details>/<summary>） --- */
  .m-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--m-touch);
    padding: var(--m-sp-3) var(--m-sp-4);
    font-size: var(--m-fs-14);
    font-weight: 600;
    color: var(--text-body, #374151);
    cursor: pointer;
    list-style: none;
    border-bottom: 1px solid var(--border, #E5E7EB);
  }
  .m-summary::-webkit-details-marker { display: none; }
  .m-summary::after {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text-faint, #9CA3AF);
    border-bottom: 2px solid var(--text-faint, #9CA3AF);
    transform: rotate(45deg);
  }
  details[open] > .m-summary::after { transform: rotate(-135deg); }

  /* --- m-skeleton-card：块级骨架（整卡占位，加载态） --- */
  .m-skeleton-card {
    display: block;
    padding: var(--m-sp-4);
    background: var(--surface, #FFFFFF);
    border: 1px solid var(--border, #E5E7EB);
    border-radius: var(--m-radius-12);
  }
  .m-skeleton-card > .m-skeleton-line + .m-skeleton-line { margin-top: var(--m-sp-2); }

  /* --- m-toast--ok：成功语义变体（与既有 --err/--warn 同尺寸） --- */
  .m-toast--ok {
    color: #047857;
    background: #ECFDF5;
    border-color: #A7F3D0;
  }
}

/* ============================================================
   M-38 · 壳与样板页辅助层（B13 首件，2026-11-12）
   ------------------------------------------------------------
   ① 移动壳吃 env(safe-area-inset-*)（顶栏 56px、底部 Tab 64px）
   ② 列表行右箭头（.m-card--link）
   ③ 详情页头竖排（.m-detail-head）
   全部 ≤767 生效；≥768 零影响。无内联样式、无新 JS。
   ============================================================ */
@media (max-width: 767px) {

  /* --- ① 壳：安全区 --- */
  .mobile-topbar {
    height: calc(56px + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
  }
  .mobile-bottom-nav {
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mobile-bottom-nav .grid { height: 64px; }

  /* 内容区让位：顶栏 56 + 间距 + 刘海，底部 Tab 64 + 安全区 + 呼吸 */
  main {
    padding-top: calc(70px + env(safe-area-inset-top)) !important;
    padding-bottom: calc(120px + env(safe-area-inset-bottom)) !important;
  }

  /* --- ② 列表行：整行可点 + 右箭头 --- */
  .m-card--link::after {
    content: "";
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    margin-left: var(--m-sp-1);
    border-top: 2px solid var(--text-faint, #9CA3AF);
    border-right: 2px solid var(--text-faint, #9CA3AF);
    transform: rotate(45deg);
  }

  /* --- ③ 详情页头：窄屏竖排，避免标题与时间线挤在一行 --- */
  .m-detail-head {
    flex-direction: column;
    align-items: stretch;
    gap: var(--m-sp-3);
  }
  .m-detail-head > .flex { flex-wrap: wrap; }

  /* --- 结果页：金额块与折叠明细 --- */
  .m-amount {
    display: block;
    margin: var(--m-sp-4) 0 var(--m-sp-2);
    font-size: 32px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-strong, #111827);
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .m-amount small {
    margin-left: var(--m-sp-1);
    font-size: var(--m-fs-14);
    font-weight: 500;
    color: var(--text-muted, #6B7280);
  }
}

/* --- M-38 列表页：筛选表单紧凑化（仅移动；桌面原样） --- */
@media (max-width: 767px) {
  .m-filter {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--m-sp-2);
    padding: var(--m-sp-3) !important;
    border-radius: var(--m-radius-12);
  }
  .m-filter > div { min-width: 0; }
  .m-filter label { font-size: var(--m-fs-12); margin-bottom: 2px; }
  .m-filter input,
  .m-filter select {
    width: 100%;
    min-height: var(--m-touch);
    padding: var(--m-sp-2) var(--m-sp-3);
    font-size: var(--m-fs-14);
    border-radius: var(--m-radius-8);
  }
  .m-filter > button {
    grid-column: 1 / -1;
    min-height: var(--m-touch);
    border-radius: var(--m-radius-8);
  }
}

/* --- M-38 详情页：底部操作栏避让 Tab 栏 --- */
@media (max-width: 767px) {
  /* 底部 Tab 实测高 97px（.mobile-bottom-nav 内容高，非 h-16 的 64px） */
  .m-form-actions {
    position: fixed;
    left: var(--m-sp-4);
    right: var(--m-sp-4);
    bottom: calc(var(--m-tab-h) + env(safe-area-inset-bottom) + var(--m-sp-2));
    z-index: 20;
  }

  /* 提交吸底：按钮自身 fixed 到 Tab 之上（模板只加类，不改结构） */
  .m-form-submit {
    position: fixed;
    left: var(--m-sp-4);
    right: var(--m-sp-4);
    bottom: calc(var(--m-tab-h) + env(safe-area-inset-bottom) + var(--m-sp-2));
    z-index: 20;
    width: auto;
    min-height: var(--m-touch);
    border-radius: var(--m-radius-8);
    font-size: var(--m-fs-16);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
  }

  /* 表单底部留出吸底按钮与 Tab 的高度，避免最后一个字段被压住 */
  .m-form {
    padding-bottom: calc(var(--m-tab-h) + var(--m-touch) + var(--m-sp-6));
  }

  .m-form > .m-form-tail {
    padding-bottom: calc(var(--m-tab-h) + var(--m-touch) + var(--m-sp-4));
  }

  .m-actionbar--above-nav {
    bottom: calc(var(--m-tab-h) + env(safe-area-inset-bottom));
  }
}

/* --- M-38 表单页：控件统一（仅移动；桌面原样） --- */
@media (max-width: 767px) {
  .m-form {
    padding: var(--m-sp-3) !important;
    border-radius: var(--m-radius-12);
  }
  .m-form label {
    display: block;
    margin-bottom: var(--m-sp-1);
    font-size: var(--m-fs-12);
    color: var(--text-muted, #6B7280);
  }
  .m-form input,
  .m-form select,
  .m-form textarea {
    width: 100%;
    min-height: var(--m-touch);
    padding: var(--m-sp-2) var(--m-sp-3);
    font-size: var(--m-fs-16);
    border: 1px solid var(--border-strong, #D1D5DB);
    border-radius: var(--m-radius-8);
    background: var(--surface, #FFFFFF);
    -webkit-appearance: none;
  }
  .m-form textarea { min-height: 88px; padding-top: var(--m-sp-2); }
  .m-form input:focus,
  .m-form select:focus,
  .m-form textarea:focus {
    outline: 0;
    border-color: var(--brand, #2F5BEA);
    box-shadow: 0 0 0 3px var(--brand-ring, rgba(47, 91, 234, .16));
  }
  .m-form button[type="submit"] {
    min-height: var(--m-touch);
    border-radius: var(--m-radius-8);
    font-size: var(--m-fs-16);
  }
}
/* ================================================================
   M-33 表格→卡片渲染器样式（仅 ≤767 生效，对齐 M-38 基准）
   组件类只复用 M-38 冻结的 m-*（m-card / m-row--kv / m-row-key / m-row-val）
   ================================================================ */
@media (max-width: 767px) {

  /* 转换后原表/原行隐藏（标记由 JS 加，revert 时移除） */
  [data-mcards-hidden] { display: none !important; }

  .m-cards {
    display: flex;
    flex-direction: column;
    gap: var(--m-sp-2);
    margin: var(--m-sp-2) 0 var(--m-sp-4);
  }

  /* 表头操作控件（全选等）搬上来的顶栏 */
  .m-cards-bar {
    display: flex;
    align-items: center;
    gap: var(--m-sp-3);
    min-height: var(--m-touch);
    padding: 0 var(--m-sp-3);
    background: var(--surface-muted, #F8FAFC);
    border: 1px solid var(--border, #E5E7EB);
    border-radius: var(--m-radius-12);
    font-size: var(--m-fs-14);
  }

  .m-cards-bar-slot {
    display: flex;
    align-items: center;
    gap: var(--m-sp-2);
    min-width: 0;
    font-size: var(--m-fs-14);
  }

  /* 表格行渲染出的卡片：圆角 12、内距 16，与 m-card 同基准 */
  .m-card--table {
    display: block;
    padding: var(--m-sp-4);
    background: var(--surface, #FFFFFF);
    border: 1px solid var(--border, #E5E7EB);
    border-radius: var(--m-radius-12);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  }

  .m-card--table .m-card-main {
    display: flex;
    align-items: center;
    gap: var(--m-sp-2);
    min-height: 32px;
    padding-bottom: var(--m-sp-2);
    border-bottom: 1px solid var(--border, #E5E7EB);
    margin-bottom: var(--m-sp-2);
  }

  .m-card--table .m-card-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--m-fs-16);
    font-weight: 600;
    color: var(--text-strong, #111827);
  }

  /* label: value 行：56–72px 行高、长值 ellipsis */
  .m-card--table .m-row--kv {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--m-sp-3);
    min-height: 56px;
    padding: var(--m-sp-2) 0;
    border-bottom: 1px solid var(--border-subtle, #F1F5F9);
    font-size: var(--m-fs-14);
  }

  .m-card--table .m-row--kv:last-child {
    border-bottom: none;
  }

  .m-card--table .m-row-key {
    flex: 0 0 auto;
    max-width: 40%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--m-fs-12);
    color: var(--text-muted, #6B7280);
  }

  .m-card--table .m-row-val {
    min-width: 0;
    flex: 1 1 auto;
    margin: 0;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--m-fs-14);
    color: var(--text-body, #374151);
  }

  /* 行内的操作链接/按钮：保持 44 触达，允许换到下一行不挤压 */
  .m-card--table .m-row-val a,
  .m-card--table .m-row-val button {
    display: inline-flex;
    align-items: center;
    min-height: var(--m-touch);
    padding: 0 var(--m-sp-2);
    font-size: var(--m-fs-14);
  }

  /* 回退到横滑的表格：明确标记，交给既有 mo-scroll
     注意：部分页面的自身脚本会在移动端把 table 写成 inline display:none，
     回退必须用 !important 把它拉回可见，否则回退=白屏（实测 /salary、/interviews） */
  table[data-mcards-fallback] {
    display: table !important;
    min-width: 640px !important;
  }

  /* 回退表要真横滑：救回被 1023 断点压成 block 的 thead/tbody/tfoot/tr/td，否则仍是旧堆叠。
     只还原 tr/td 不够：tbody 仍是 block 时 tr 会被 blockify 回 block（实测 computed=block）。 */
  table[data-mcards-fallback] > thead,
  table[data-mcards-fallback] > tbody,
  table[data-mcards-fallback] > tfoot {
    display: table-row-group !important;
  }

  table[data-mcards-fallback] > thead {
    display: table-header-group !important;
  }

  table[data-mcards-fallback] > tfoot {
    display: table-footer-group !important;
  }

  table[data-mcards-fallback] tr {
    display: table-row !important;
  }

  table[data-mcards-fallback] th,
  table[data-mcards-fallback] td {
    display: table-cell !important;
    white-space: nowrap;   /* 列宽按内容展开，避免 54px 列宽把中文逐字换行 */
  }

  table[data-mcards-fallback]::-webkit-scrollbar {
    height: 6px;
  }

  /* --- M-34 触控统一：全站可点元素 ≥44px（仅 ≤767，桌面零差） --- */
  button,
  [role="button"],
  input[type="submit"],
  input[type="button"],
  input[type="reset"],
  select,
  .btn,
  .btn-sm,
  .pagination a,
  .table-actions a,
  .table-actions button,
  .sidebar-item,
  .sidebar-group-title,
  .mobile-bottom-nav a,
  a.border.rounded {
    min-height: var(--m-touch) !important;
    min-width: var(--m-touch) !important;
  }
  a.border.rounded {          /* 分页「上一页/下一页」是无类名组件的裸锚点，按按钮对待 */
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  /* 正文内联链接不强制尺寸，只给表格操作区与导航 */
  .table-actions a,
  .table-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* --- M-34 宽表兜底：767 内未被渲染器接管的原生表，容器一律可横滑 --- */
  .table-wrap,
  .mo-scroll,
  main:has(> table) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* --- M-35 非表格页三类规范化（≤767，桌面 ≥768 完全不受影响） ---
   ① m-form-page  表单页：控件 100% 宽、label 上置、双列折单列、主按钮块级
   ② m-detail-page 详情页：键值块化（label 上、值下）、长文本折行
   ③ m-dash-page  看板页：KPI 网格固定 2 列、图表容器自适应
   选择器只用属性前缀匹配 tailwind 工具类，不改任何 DOM。 */
@media (max-width: 767px) {
  /* ① 表单 */
  .m-form-page input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]),
  .m-form-page select,
  .m-form-page textarea {
    width: 100% !important;
    box-sizing: border-box;
  }
  .m-form-page label {
    display: block;
    margin-bottom: 4px;
    line-height: 1.4;
  }
  /* 复选框/单选框行：显式类承担 flex + 44px，不依赖 :has()（微信老内核不支持）。
     选择器只认类名、不绑定页面祖先：表单/详情/看板页与移动卡片模板（base.html JS 里的全选行）都能命中，不会产生死类。 */
  .m-check-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: var(--m-touch);
    min-width: var(--m-touch);
  }
  .m-check-row input[type=checkbox],
  .m-check-row input[type=radio] {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
  }
  .m-form-page [class*="grid-cols-2"],
  .m-form-page [class*="grid-cols-3"],
  .m-form-page [class*="grid-cols-4"],
  .m-form-page [class*="grid-cols-6"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .m-form-page .help-text,
  .m-form-page .text-red-500,
  .m-form-page .text-red-600,
  .m-form-page .error,
  .m-form-page .field-error {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    line-height: 1.4;
  }
  .m-form-page button[type=submit],
  .m-form-page input[type=submit],
  .m-form-page .btn-primary,
  .m-form-page .btn-submit {
    display: block;
    width: 100%;
    min-height: var(--m-touch) !important;
    margin-top: 12px;
  }

  /* ② 详情 */
  .m-detail-page [class*="grid-cols-3"],
  .m-detail-page [class*="grid-cols-4"],
  .m-detail-page [class*="grid-cols-5"],
  .m-detail-page [class*="grid-cols-6"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .m-detail-page [class*="grid-cols-2"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .m-detail-page span.text-slate-500,
  .m-detail-page span.text-gray-500,
  .m-detail-page span.text-slate-400,
  .m-detail-page dt {
    display: block;
    margin-bottom: 2px;
    line-height: 1.35;
  }
  .m-detail-page dd,
  .m-detail-page .kv-value {
    margin: 0 0 8px;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  .m-detail-page {
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  /* ③ 看板 */
  .m-dash-page [class*="grid-cols-3"],
  .m-dash-page [class*="grid-cols-4"],
  .m-dash-page [class*="grid-cols-5"],
  .m-dash-page [class*="grid-cols-6"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .m-dash-page .card,
  .m-dash-page canvas,
  .m-dash-page .chart-container {
    max-width: 100%;
    min-width: 0;
  }

  /* ④ m-list-page 列表页：批量检索 + 表格/卡片列表（M-39 R1 语义纠正，≤767 段）
     语义边界：列表页＝批量检索＋表格/卡片列表；表单页＝录入控件；详情页＝键值展示；看板页＝KPI 网格。
     ① 未被 M-33/M-34 接管的回退宽表：容器横向滚动兜底；
     ② 列表卡片行保留 ≥44 触控行高，勾选行沿用既有 .m-check-row 口径；
     ③ 筛选条允许折行，避免单行把主体撑出视口。 */
  .m-list-page :is(.mo-scroll, .table-wrap),
  .m-list-page div:has(> table) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  .m-list-page .m-card,
  .m-list-page .m-cards > div {
    min-height: var(--m-touch, 44px);
    box-sizing: border-box;
  }
  .m-list-page form[method="get"] {
    flex-wrap: wrap;
  }
}

/* --- M-37 第 1 批：逐页打磨 ＋ M-29 例外修补（2026-11-13） ---
   ① ≤420 顶部对外入口条：单行不折（360/374 实测「对口」「端」逐字折行，
      形似方块字），放不下时条内横滑；桌面 ≥421 零变化。
   ② 768–1023 平板档：管理端可点元素补到 44（桌面 ≥1024 零变化）。
   ③ 768–1023 独立 H5（body.m-page）：空态卡片化、明细行距字号回正
      （M-29① ipadmini 768 工资条左对齐+字号极小）。 */

@media (max-width: 420px) {
  #external-entry-bar > div {
    flex-wrap: nowrap;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  #external-entry-bar > div > * { flex: 0 0 auto; }
  #external-entry-bar a,
  #external-entry-bar span { white-space: nowrap; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  /* 触控收窄（M-37 第 2 批，承接复审非阻断 2）：删掉 `main a[class]` 全量兜底，
     只命中「显式按钮类／按钮形锚点」；正文锚点、单元格姓名跳转不再被拉高。
     只动盒模型（min-height/min-width），不加 display，避免行内链接变块导致错位。 */
  main button,
  main select,
  main input[type=submit],
  main input[type=button],
  main input[type=reset],
  main .btn,
  main .input-white {
    min-height: var(--m-touch, 44px) !important;
    min-width: var(--m-touch, 44px) !important;
  }
  /* 按钮形锚点：`<a>` 默认 inline，min-height 对行内元素不生效，
     故这几个按钮类锚点改行内 flex 才能撑到 44；正文/卡片里的纯文本锚点不在列。 */
  main a[class*="rounded"],
  main a[class*="btn-"] {
    display: inline-flex;
    align-items: center;
    min-height: var(--m-touch, 44px) !important;
    min-width: var(--m-touch, 44px) !important;
  }

  /* M-37 第 4 批（768 收口）：
     ①`.btn`／`a.btn-*` 的 `min-height:36px !important` 来自 app-components.css，其中 `a.btn-primary|secondary|danger`
       是「元素+类」(0,1,1)，会压过 `.m-tap`(0,1,0) 的 44 —— 故这几类按钮形锚点用 `a.btn-*.m-tap`(0,2,1) 同级覆盖，
       只改 min-height，不用 height（`height:auto` 在此处是空转，无实际作用）。
     ②独立页/登录页（无 `<main>`）的按钮与文字链靠语义类命中；
     ③段落内文字链用 `.m-tap-text`：只 inline-block＋最小盒，不加 flex（避免把所在行抬高，复审第 3 批非阻断 2）。 */
  body .m-tap-text {
    display: inline-block;
    min-height: var(--m-touch, 44px) !important;
    min-width: var(--m-touch, 44px) !important;
    text-align: left;
  }

  /* 「返回列表／返回 XX」类导航与卡片标题/操作：模板侧挂显式语义类
     （m-link-nav / m-link-card），CSS 不再依赖类名顺序拼接。 */
  .m-link-nav,
  .m-link-card {
    display: inline-flex;
    align-items: center;
    min-height: var(--m-touch, 44px) !important;
  }
  .m-link-card {
    min-width: var(--m-touch, 44px) !important;
  }
  /* 通用点按目标（页面无 <main> 的独立页也能命中）：只加盒模型，不做居中。 */
  body .m-tap,
  a.btn-primary.m-tap,
  a.btn-secondary.m-tap,
  a.btn-danger.m-tap {
    display: inline-flex;
    align-items: center;
    min-height: var(--m-touch, 44px) !important;
    min-width: var(--m-touch, 44px) !important;
  }
  .m-tap-select {
    min-height: var(--m-touch, 44px) !important;
  }

  /* A 类溢出真修（第 2 批）：`.d-page-shell` 自带 margin:-24px（app-components.css:1093），
     main 在 768 档内边距只有 16px，两侧各多出 8px → supplier/tags、supplier/levels 溢出 8px。
     按 main 的实际内边距收口，不掩盖、不动表格版式。 */
  main > .d-page-shell {
    margin-left: -16px;
    margin-right: -16px;
  }

  .m-page .m-page-body {
    max-width: 720px;
    margin: 0 auto;
    padding: 16px 24px;
  }
  .m-page .m-empty {
    margin: 20px 0;
    padding: 28px 20px;
    border-radius: 12px;
    background: var(--surface, #FFFFFF);
    text-align: center;
    font-size: 14px;
    line-height: 1.6;
  }
  .m-page .m-empty-title {
    margin-bottom: 6px;
    font-size: 16px;
    font-weight: 600;
  }
  .m-page .m-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
  }
  .m-page .m-table th,
  .m-page .m-table td { padding: 10px 12px; }

  /* M-29 缺陷①：768–1023 平板档「结构在、样式不在」定向补齐。
     只作用于独立 H5 骨架（`.m-page` 作用域），不动管理端与 768 既有兜底；
     数值与 ≤767 组件层同源（.m-card/.m-amount），保证两档观感一致。 */
  .m-page .m-list { display: block; }
  .m-page .m-card {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 64px;
    padding: 16px;
    background: var(--surface, #FFFFFF);
    border: 1px solid var(--border, #E5E7EB);
    border-radius: 12px;
    font-size: 14px;
    color: var(--text-body, #374151);
    text-decoration: none;
  }
  .m-page .m-card + .m-card { margin-top: 8px; }
  .m-page .m-card-main { flex: 1 1 auto; min-width: 0; }
  .m-page .m-card-title {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-strong, #111827);
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .m-page .m-card-sub {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-muted, #6B7280);
  }
  .m-page .m-card-status {
    flex: 0 0 auto;
    font-size: 14px;
    color: var(--text-muted, #6B7280);
    white-space: nowrap;
  }
  .m-page .m-amount {
    display: block;
    margin: 16px 0 8px;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-strong, #111827);
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .m-page .m-amount small {
    margin-left: 4px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted, #6B7280);
  }
}

/* --- M-37 第 5 批（手机档例外页收口，2026-11-14）---
   ① 段落内文字链（`.m-tap-text`，全站 7 处：下载导入模板／导出现有数据／← 返回台账／返回我的报销／
     两个登录页的返回链）→ inline-block＋44 最小盒，不加 flex，避免行高抬升错位（复审第 3 批非阻断 2 的落地）。
   ② 按钮形锚点只作用于 4 个例外页（错误页／微信扫码页／两个登录页），靠页级类收窄，其余页零变化；
     这 4 页 390/360 原本 B 红（文字链 14–16 高、按钮 36 高）。
   ③ 覆盖 app-components 的 min-height:36!important（0,2,1／0,3,1 > 0,1,1）。
   ④ 不改字号、不改配色，只改可点盒尺寸。 */
@media (max-width: 767px) {
  /* A3 遗留（M-37 第 5 批）：`.m-tap-text` 从 `body` 收窄到「页面主体 main」，
     并改用 padding＋等量负 margin 撑触控盒——盒高 44、段落行距不涨（实测前后段落高差 ≤2px）。 */
  main .m-tap-text,
  .m-form-page .m-tap-text,
  .m-detail-page .m-tap-text {
    display: inline-block;
    text-align: left;
    min-height: var(--m-touch, 44px) !important;
    min-width: var(--m-touch, 44px) !important;
    padding: 14px 6px;
    margin: -14px -6px;
    vertical-align: middle;
  }
  /* 表单页尾部独立一行的返回链（如报销表单「返回我的报销」）：基线需下移，否则会让所在行矮 12px。
     实测 vertical-align:-12px 时段落高 610→610（差 0）。 */
  .m-form-page .back.m-tap-text { vertical-align: -12px; }
  /* A 类溢出真修：权限中心顶栏的 flex 子项未设 min-width，nowrap 副标题把整条撑到 524px。
     只让 flex 子项可收缩（副标题自带 ellipsis），不改文案不改字号。 */
  .perm-topbar > div { min-width: 0; }
  /* 供应商人员名单页头行：标题＋搜索框＋导出按钮挤在一行（429px > 视口），≤767 折行。 */
  .m-head-row { flex-wrap: wrap; gap: 8px; }
  .m-head-row > * { min-width: 0; }
  .m-head-row > :last-child { flex-wrap: wrap; }
  /* 折行后页头操作（搜索/导出/代录报名）不能掉到 36 高，统一补 44 触控盒。 */
  .m-head-row a {
    display: inline-flex;
    align-items: center;
    min-height: var(--m-touch, 44px) !important;
    min-width: var(--m-touch, 44px) !important;
  }
  .err-page .m-tap,
  .err-page a.btn-primary.m-tap,
  .err-page a.btn-secondary.m-tap,
  .err-page a.btn-danger.m-tap {
    display: inline-flex;
    align-items: center;
    min-height: var(--m-touch, 44px) !important;
    min-width: var(--m-touch, 44px) !important;
  }
}

/* --- M-39 第 3 批：全站触控 ≥44（≤767 段，2026-11-14）---
   口径（ROOT_派单_M39_第3批 §一）：
   ① 只作用于真可点控件（a/button/input/select/.btn），不碰 td/tr/div，不写进 href/action/onclick；
   ② 段落内文字链只扩「可点盒」（padding＋等量负 margin），不改 display、不改字号、行距不涨；
   ③ 按钮型锚点只加 min-height，不动宽度/配色；已有 44 的 .m-tap-text 不叠加。 */
@media (max-width: 767px) {
  main a.btn,
  main a.btn-primary,
  main a.btn-secondary,
  main a.btn-danger,
  main a.btn-brand-grad,
  main a.input-white,
  main a.input-white-500,
  main a.px-2, main a.px-3, main a.px-4,
  main a.flex-1, main a.inline-flex, main a.block, main a.inline-block {
    min-height: var(--m-touch, 44px) !important;
    min-width: var(--m-touch, 44px) !important;
  }
  main a.text-brand,
  main a.font-bold,
  main a.text-sm,
  main a.m-tap {
    padding: 14px 9px;
    margin: -14px -9px;
  }
  /* 无 <main> 的独立页（我的报销／忘记密码等）：同一口径按控件类收窄，不碰 body 全局 */
  a.m-tap {
    padding: 14px 9px;
    margin: -14px -9px;
  }
}

/* A 类真修（结算台账筛选条，≤767）：`form.flex.gap-2` 子项不折行把 main 撑到 362（视口 360）。
   只让筛选条折行，不动表格（表在 mo-scroll 内，本身不参与 main 宽度）。 */
@media (max-width: 767px) {
  main form.flex.gap-2 { flex-wrap: wrap; }
}

@media (max-width: 767px) {
  /* M-39 R2：管理端登录页输入框 16px / 高 ≥44（避免 iOS 聚焦自动放大）。
     注：未登录渲染走 base.html 的 login_content 块、不经过带 m-detail-page 的 <main>，
     故以该页唯一顶层 .login-shell 为锚；.login-field 全仓库仅此页使用。 */
  .login-shell .login-field input { height: 44px; font-size: 16px; }
}

/* --- M-39 R3：横排小表单（筛选条 / 行内编辑）≤767 统一兜底 ---
   命中背景：M-35 让 .m-form-page 的提交按钮 width:100%，在“输入框+按钮同一行”的窄表单里
   按钮会吃掉整行，把控件压成竖条（/supplier/orgs 新增项目实测 18px）；这些表单的控件本身
   也常在 30–34 高。模板侧只挂类 m-inline-form，样式在这里统一兜一次，不逐页写内联。 */
@media (max-width: 767px) {
  main .m-inline-form {
    flex-wrap: wrap;
  }
  main .m-inline-form > div {
    flex: 1 1 100%;
    min-width: 0;
  }
  main .m-inline-form button[type=submit],
  main .m-inline-form input[type=submit],
  main .m-inline-form .btn-primary,
  main .m-inline-form .btn-submit {
    flex: 0 0 auto;
    width: 96px;
    min-width: 96px;
    margin-top: 8px;
  }
  main .m-inline-form input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=file]),
  main .m-inline-form select,
  main .m-inline-form textarea {
    flex: 1 1 120px;
    min-width: 120px;
    min-height: 44px;
  }
}

/* --- M-29 缺陷②：`/project-employees` 顶部 4 入口在 360 档重叠 ---
   根因：M-39 第 3 批给正文链 `a.text-sm` 加的「padding 14/9 ＋ 等量负 margin -14/-9」
   在按钮形锚点（`px-4 py-2 text-sm`）上同样命中，-9px 左右负 margin 把 4 个入口互相压住；
   外层 `flex justify-between` 折行、内层 `.flex gap-2` 仍 nowrap，挤压进一步放大。
   修法：仅对本页工具条挂语义类（`.m-roster-bar/.m-roster-actions`），内层折行 ＋ 复位负 margin，
   不动全站文字链规则（那一批的既有验收仍成立）。 */
@media (max-width: 767px) {
  .m-roster-bar { flex-wrap: wrap; }
  .m-roster-actions {
    flex-wrap: wrap;
    max-width: 100%;
  }
  main .m-roster-actions a {
    margin-left: 0 !important;
    margin-right: 0 !important;
    min-height: var(--m-touch, 44px);
  }
}

/* M-53 奖励文案样式迁入（m19 零内联样式红线）；text-align:center 仅扫码表单沿用 */
.m-reward-text{font-weight:600;color:#e60012;}
.m-hint.m-reward-text{text-align:center;}
