/* ============================================================
   mobile.css — 康普森牧场系统 手机端适配层
   生效范围: 仅 max-width:768px (手机/小平板)
   设计原则:
     1) 覆盖内联 style/第三方(layui)样式, 用 !important
     2) 独立文件, 只影响手机, 桌面端 0 影响, 可整体摘除回滚
     3) 聚焦: 表格横滚 / 表单字段全宽 / 触控目标 / 安全区 / 字体间距
   ============================================================ */

@media (max-width:768px) {

  /* ---------- 1. 安全区(刘海屏/底部手势条) ---------- */
  body { padding-bottom: env(safe-area-inset-bottom); }
  #mp { padding-left: calc(12px + env(safe-area-inset-left)) !important;
        padding-right: calc(12px + env(safe-area-inset-right)) !important; }
  #hamburger { top: calc(10px + env(safe-area-inset-top)) !important; }
  #backbtn { top: calc(10px + env(safe-area-inset-top)) !important; }
  #nav { padding-top: calc(10px + env(safe-area-inset-top)) !important; }
  #nav-overlay, #hamburger { margin-top:0; }

  /* ---------- 2. 表格容器横滚(根治 .tw 无样式导致溢出) ---------- */
  .tw, .overflow-x, .overflow-auto, .sl, .nv, table[style*="width"] { 
    overflow-x:auto; -webkit-overflow-scrolling:touch; }
  .tw table, .overflow-x table, .overflow-auto table { min-width:max-content; }

  /* ---------- 3. 触控目标 ≥44px (Apple iOS 建议最小可点区域) ---------- */
  .layui-btn, .btn, .qa, .va, .ni, .qa-icon, #hamburger, #backbtn {
    min-height:44px !important; }
  .layui-btn { line-height:44px !important; height:44px !important; padding:0 16px !important; }
  .qa { display:flex; flex-direction:column; align-items:center; justify-content:center; padding:10px 4px !important; box-sizing:border-box; }
  .qa-icon { font-size:22px !important; }
  input.layui-input, select.layui-input, textarea.layui-textarea,
  .layui-input[type=text], .layui-input[type=number], .layui-input[type=date] {
    min-height:44px !important; font-size:16px !important; box-sizing:border-box; }

  /* ---------- 4. 表单字段在手机强制全宽(覆盖内联 style width:Npx) ---------- */
  /* 仅非表格内表单: 用更精准选择器避免破坏 .tw 表格列布局 */
  .fi input, .fi select, .fb input, .fb select,
  .qc input, .qc select,
  .layui-form input, .layui-form select,
  .form-row input, .form-row select {
    width:100% !important; max-width:100% !important; box-sizing:border-box;
  }
  /* 弹窗内表单字段全宽(排除 .tw 表格内的, 保留表格列窄宽) */
  .ovb input, .ovb select, .ovb textarea {
    width:100% !important; box-sizing:border-box; max-width:100% !important;
  }
  .ovb .tw input, .ovb .tw select, .ovb .tw textarea {
    width:auto !important; max-width:none !important;
  }

  /* ---------- 5. 点击反馈 + 字体防缩放 ---------- */
  a, button, .qa, .va, .vc, .vet-card { -webkit-tap-highlight-color:transparent; }
  * { -webkit-text-size-adjust:100%; text-size-adjust:100%; }

  /* ---------- 6. 弹窗/卡片在竖屏全宽 ---------- */
  .ovb, .mb, .modal-box { width:96vw !important; max-width:96vw !important; padding:16px !important; box-sizing:border-box; }
  .ovb .layui-table, .ovb table, .mb table { font-size:12px !important; }

  /* ---------- 7. 顶部内容留白(汉堡/返回按钮遮挡) ---------- */
  #app #pg { padding-top:4px; }
  #mp.has-back #pg { margin-top:0; }
  #hamburger { display:flex !important; }

  /* ---------- 8. 诊疗工作台 手机微调 ---------- */
  .vet-cards { grid-template-columns:repeat(2,1fr) !important; gap:8px; }
  .vet-actions { grid-template-columns:repeat(2,1fr) !important; gap:8px; }
  .vc { padding:12px 4px !important; }
  .vc-num { font-size:22px !important; }
  .vet-head { align-items:flex-start; }

  /* ---------- 9. 登录页手机适配 ---------- */
  .lc { width:92vw !important; max-width:92vw !important; padding:28px 20px !important; box-sizing:border-box; }
  .lf, .lb { min-height:48px !important; font-size:16px !important; box-sizing:border-box; }

  /* ---------- 10. 看板网格手机 ---------- */
  .dash-grid { grid-template-columns:1fr 1fr !important; }
  .dash-card { padding:10px 4px !important; }
  .dg, .dr { grid-template-columns:1fr !important; }

  /* ---------- 11. 弹窗溢出根治: layui layer 手机适配 ----------
     系统大量弹窗用 showModal→layui layer.open(area=[520px,'80vh']),
     手机屏窄于520px时固定宽度溢出、内容不滚导致按钮出屏。 */
  .layui-layer, .layui-layer-page, .layui-layer-dialog {
    width:96vw !important;
    max-width:96vw !important;
  }
  .layui-layer-content {
    width:auto !important;
    max-height:calc(72vh) !important;
    overflow-y:auto !important;
    -webkit-overflow-scrolling:touch;
    box-sizing:border-box;
  }
  .layui-layer-content .mm { padding:12px 14px !important; }
  /* 弹窗内部 flex 行手机竖排(标签+输入不再横挤截断) */
  .layui-layer-content .fb { flex-direction:column !important; align-items:stretch !important; }
  .layui-layer-content .fb > span[style*="width"] { width:auto !important; }
  /* 弹窗内表格横向内滚 */
  .layui-layer-content .tw, .layui-layer-content .overflow-x {
    overflow-x:auto !important; -webkit-overflow-scrolling:touch;
  }
  .layui-layer-content .tw table, .layui-layer-content .overflow-x table {
    min-width:max-content;
  }
  /* 保证 layer 遮罩盖住背景 nav, 不透出底部快捷按钮 */
  .layui-layer-shade { z-index:19891013 !important; }
  .layui-layer { z-index:19891014 !important; }

  /* ---------- 13. 保健管理 手机卡片列表 ---------- */
  #hk_rows { display:flex; flex-direction:column; gap:10px; }
  .hk-card {
    background:var(--c,#fff); border:1px solid var(--bd,#e0e0e0); border-radius:10px;
    padding:12px 14px; box-shadow:0 1px 3px rgba(0,0,0,.06); box-sizing:border-box;
  }
  .hk-ch { font-size:15px; margin-bottom:6px; }
  .hk-cm { display:flex; flex-wrap:wrap; gap:4px 10px; font-size:12px; color:var(--t2,#666); margin-bottom:6px; }
  .hk-cd { font-size:13px; color:#333; padding:6px 8px; background:var(--bg,#f7f8fa); border-radius:6px; margin-bottom:8px; word-break:break-word; }
  .hk-ca { display:flex; flex-wrap:wrap; }

  /* ---------- 12. 圈舍信息/卡片表格 手机紧凑 ----------
     圈舍信息表格无 .tw 包裹直接 <table>, 手机窄屏溢出+行距松。
     方案: 整卡横滚 + 压缩行高/padding/输入框宽, 保核心列紧凑。 */
  .layui-card.layui-card-body { overflow-x:auto; -webkit-overflow-scrolling:touch; }
  .layui-card.layui-card-body table { min-width:max-content; }
  /* 圈舍表格(.shr)手机紧凑 */
  .shr td { padding:6px 5px !important; white-space:nowrap; }
  .shr .shnm, .shr .shf { width:60px !important; font-size:11px !important; }
  .shr .layui-btn { min-height:30px !important; height:30px !important; line-height:30px !important; padding:0 10px !important; font-size:12px !important; }
  /* 混群预警表格紧凑 */
  .msr td { padding:5px 6px !important; font-size:12px !important; }
  /* 一般 .layui-card 内白卡片表格收窄边距, 减“空荡感” */
  .layui-card table td, .layui-card table th { padding:6px 8px !important; }
  .layui-card { }

  /* ---------- 14. 通用工具行/按钮组 手机换行 ---------- */
  /* 顶部搜索/筛选/操作按钮排(NN个按钮)在手机上挤成一行溢出 → 允许换行, 留足点击空间 */
  .fb.mb-10, .dfx.gap-8, .dfx.gap-10, .mt-10.dfx,
  .layui-form .dfx, .filter-bar, .toolbar, .ops-row,
  .flex-1.dfx {
    flex-wrap:wrap !important; gap:8px !important;
  }
  .flex-1.dfx .layui-btn { flex:0 0 auto !important; }

  /* ---------- 15. 库存/物资 手机 ---------- */
  /* 固定宽输入(min 输入框)在手机收窄防出屏 */
  .inp-md.w-140, .inp-md.w-160, .inp-md.w-240,
  input[style*="width:14"] , input[style*="width:240"],
  input.inp-md {
    width:auto !important; min-width:90px !important; box-sizing:border-box;
  }
  /* 分类明细表(9列功效)手机横滚已由通用规则治, 这里压缩列间距 */
  #mi_tb th, #mi_tb td { padding:5px 6px !important; font-size:12px !important; white-space:nowrap; }

  /* ---------- 16. 饲喂 撒料计划 手机 ---------- */
  .fm_shed_cb { display:block !important; margin:4px 0; }
  .fm_shed_cb label { display:flex; align-items:center; padding:6px 0; font-size:14px; }

  /* ---------- 17. 处方录入行 手机(药名下拉+剂量+频次等列保窄可点) ---------- */
  .rx-row { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
  .rx-row .layui-input, .rx-row select, .rx-row .layui-select {
    min-height:38px !important; font-size:15px !important;
  }

  /* ---------- 18. 横滚表内按钮防被切断点不到 ---------- */
  .layui-layer-content .tw table td .layui-btn,
  .layui-card .tw table td .layui-btn { white-space:nowrap; }

  /* ---------- 19. 录入页手机全宽+单列 ----------
     处方录入(rx1)/事件录入(e1)/防疫登记(hp) 三个高频录入口:
     桌面 flex/grid 并排字段在手机窄屏挤压→改单列全宽, 触控达标 */
  /* e1 事件录入: 左右双栏改单列 */
  .ee-layout { grid-template-columns:1fr !important; }
  .ee-left input, .ee-left select, .ee-left textarea,
  .ee-right input, .ee-right select, .ee-right textarea {
    width:100% !important; max-width:100% !important; box-sizing:border-box;
  }
  /* rx1 处方录入: 基本信息区改单列, 4 字段全宽 */
  .mp-rxbase { flex-direction:column !important; align-items:stretch !important; }
  .mp-rxbase > div { width:100% !important; }
  .mp-rxbase input { width:100% !important; max-width:100% !important; box-sizing:border-box; }
  /* hp 防疫登记: 双卡改单列, 登记字段 grid 改单列全宽 */
  .mp-hvspl { grid-template-columns:1fr !important; }
  .mp-hvform { grid-template-columns:1fr !important; }
  .mp-hvform > div { grid-column:auto !important; width:100% !important; }
  .mp-hvform input, .mp-hvform select, .mp-hvform textarea {
    width:100% !important; max-width:100% !important; box-sizing:border-box;
  }

}

/* ============================================================
   金额列按权限遮蔽 — 全局生效(任何设备):
   员工角色(兽医保健/饲养员/库管/配种/只读, 无金额可见权限)时,
   JS 给表格/圆盘容器加 .hide-amt → 隐藏单价/金额列与金额汇总。
   管理层角色(平台管理/场长/总经理)不遮蔽。
   ============================================================ */
.hide-amt#mi_tbl th:nth-child(6),    .hide-amt#mi_tbl td:nth-child(6),    /* 库存:单价 */
.hide-amt#mi_tbl th:nth-child(8),    .hide-amt#mi_tbl td:nth-child(8),    /* 库存:金额 */
.hide-amt#mi_tbl_in th:nth-child(7), .hide-amt#mi_tbl_in td:nth-child(7), /* 入库:单价 */
.hide-amt#mi_tbl_in th:nth-child(10),.hide-amt#mi_tbl_in td:nth-child(10),/* 入库:金额 */
.hide-amt#mi_tbl_out th:nth-child(6),.hide-amt#mi_tbl_out td:nth-child(6),/* 出库:单价 */
.hide-amt#mi_tbl_out th:nth-child(8),.hide-amt#mi_tbl_out td:nth-child(8) { display:none !important; }
.hide-amt .mat-pie-wrap, .hide-amt #mat_pie_legend, .hide-amt #mat_pie_svg,
.hide-amt #mat_pie_total, .hide-amt .amt-sum-card { display:none !important; }

/* ============================================================
   手机端物料/入库/出库卡片样式(.kps-card/.kps-in-card/.kps-out-card/.kps-sum)
   与上方双态渲染配套, 只影响手机, 桌面端 0 影响
   ============================================================ */
.kps-card, .kps-in-card, .kps-out-card {
  margin-bottom:14px !important;
  overflow:hidden;
}
.kps-sum {
  margin-bottom:12px !important;
  background:linear-gradient(135deg,#f8fafc,#fff) !important;
  border:1px solid #eef2f6 !important;
}
/* 物料名: 强制单行省略, 不挤压 */
.kps-card .fs-16.fw-600, .kps-in-card .fs-15.fw-600, .kps-out-card .fs-15.fw-600 {
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:72% !important;
}
/* 数量+单位: 固定一行不换行 */
.kps-card > div:nth-child(3), .kps-in-card > div:nth-child(3), .kps-out-card > div:nth-child(3),
.kps-card .fs-22, .kps-in-card .fs-22, .kps-out-card .fs-22 {
  white-space:nowrap;
}
/* 副信息行: 统一小字, 行内不强制不换 */
.kps-card > div:nth-child(4), .kps-in-card > div:nth-child(4), .kps-out-card > div:nth-child(4) {
  line-height:1.6;
}
.kps-card .ellipsis, .kps-in-card .ellipsis, .kps-out-card .ellipsis {
  min-width:0;flex:1;
}
/* 保质期/到期 标签放大 */
.kps-card .e-bad, .kps-in-card .e-bad, .kps-out-card .e-bad {
  font-size:13px !important;font-weight:600;
}
/* 卡片内操作按钮: 触控≥44px, 醒目底色 */
.kps-card button.layui-btn, .kps-in-card button.layui-btn, .kps-out-card button.layui-btn {
  min-height:44px !important;font-size:14px !important;font-weight:600;
}

/* ===== 手机看板: 混群预警/待办不截断 + 快捷区2列 ===== (2026-08-05) */
@media (max-width:768px){
  .wi > div:nth-child(2){ flex:1 1 auto; min-width:0; word-break:break-all; }
  .wi-detail{ display:block; line-height:1.5; white-space:normal; word-break:break-all; overflow:visible; }
  .qs{ display:grid; grid-template-columns:repeat(2,1fr); gap:8px; }
  .qs .qa{ margin:0; width:auto; }
}

/* ============================================================
   移动端底部 Tab 栏 + 录入快捷面板 (2026-09-03)
   ============================================================ */
@media (max-width:768px){
  /* 底部 Tab 栏 */
  #m-tabbar {
    display:flex !important;
    position:fixed; bottom:0; left:0; right:0;
    height:calc(56px + env(safe-area-inset-bottom));
    padding-bottom:env(safe-area-inset-bottom);
    background:#fff;
    border-top:1px solid #e5e7eb;
    z-index:101;
    box-shadow:0 -2px 8px rgba(0,0,0,.06);
  }
  .m-tab {
    flex:1; display:flex; flex-direction:column;
    align-items:center; justify-content:center;
    gap:2px; cursor:pointer;
    color:#6b7280; font-size:10px;
    transition:color .15s;
  }
  .m-tab i { font-size:20px; }
  .m-tab:active { color:#1a73e8; background:#f3f4f6; }
  .m-tab.act { color:#1a73e8; }
  /* 主内容区底部留白，避免被 Tab 栏遮挡 */
  #mp { padding-bottom:calc(72px + env(safe-area-inset-bottom)) !important; }

  /* 录入快捷面板 */
  #m-quick-panel {
    position:fixed; bottom:calc(56px + env(safe-area-inset-bottom)); left:0; right:0;
    background:#fff; border-top:1px solid #e5e7eb;
    padding:12px; z-index:100;
    box-shadow:0 -4px 12px rgba(0,0,0,.1);
  }
  #m-quick-panel.dn { display:none !important; }
  .m-quick-grid {
    display:grid; grid-template-columns:repeat(4,1fr); gap:10px;
  }
  .m-quick-item {
    display:flex; flex-direction:column; align-items:center; gap:4px;
    padding:12px 4px; border-radius:10px;
    background:#f8f9fa; cursor:pointer;
    font-size:11px; color:#374151;
    transition:all .15s;
  }
  .m-quick-item i { font-size:22px; color:#1a73e8; }
  .m-quick-item:active { background:#e8f0fe; transform:scale(.96); }

  /* 扫码弹窗 */
  #scan-modal { display:none; }
  #scan-modal:not(.dn) { display:flex !important; }

  /* 提交栏吸底：表单内 .sticky-submit 固定底部 */
  .sticky-submit, form .layui-btn[type="submit"], form .btn-confirm {
    /* 由页面自行决定是否吸底 */
  }
  /* 录入页主操作按钮吸底 */
  .ee-left .btn-confirm,
  .mp-rxbase + div .btn-confirm,
  #rxe_body + div .btn-confirm {
    position:sticky; bottom:calc(60px + env(safe-area-inset-bottom));
    z-index:50;
  }

  /* 顶部操作栏折叠：移动端次要按钮收起 */
  .fb.mb-10 .btn-divider,
  .fb.mb-10 .layui-btn:nth-child(n+4) {
    /* 保留，由 JS 控制折叠 */
  }

  /* 饼图移动端缩小 */
  #in_pie_svg, #mi_pie_svg, #out_pie_svg {
    width:140px !important; height:140px !important;
  }
  #in_pie_svg + div, #mi_pie_svg + div, #out_pie_svg + div {
    width:74px !important; height:74px !important;
  }
}

/* 桌面端隐藏底部 Tab 栏和快捷面板 */
@media (min-width:769px){
  #m-tabbar, #m-quick-panel { display:none !important; }
}

/* ============================================================
   处方药品明细 移动端卡片化 (2026-09-03)
   表格行 → 纵向卡片，data-label 显示字段名
   ============================================================ */
@media (max-width:768px){
  #rxe_table thead { display:none; }
  #rxe_table, #rxe_table tbody, #rxe_table tr, #rxe_table td {
    display:block; width:100% !important; box-sizing:border-box;
  }
  #rxe_table .rxe-row {
    background:#fff; border:1px solid #e5e7eb; border-radius:10px;
    padding:12px; margin-bottom:10px; box-shadow:0 1px 3px rgba(0,0,0,.04);
  }
  #rxe_table td {
    display:flex; align-items:center; justify-content:space-between;
    padding:6px 0; border:none; font-size:14px;
  }
  #rxe_table td::before {
    content:attr(data-label);
    font-size:12px; color:#6b7280; font-weight:500;
    min-width:50px;
  }
  #rxe_table td input, #rxe_table td select {
    width:auto !important; min-width:120px; flex:1; max-width:60%;
    min-height:38px; font-size:14px;
  }
  #rxe_table td[data-label="药品"] {
    flex-direction:column; align-items:flex-start; gap:4px;
    border-bottom:1px solid #f3f4f6; padding-bottom:8px; margin-bottom:4px;
  }
  #rxe_table td[data-label="药品"]::before { display:none; }
  #rxe_table td[data-label="药品"] a { font-size:15px; font-weight:600; }
  #rxe_table td[data-label="操作"] { justify-content:center; padding-top:8px; }
  #rxe_table td[data-label="操作"] button {
    width:100%; min-height:40px; font-size:14px;
  }
}

/* ============================================================
   饲喂页 圈舍多选 移动端网格 (2026-09-03)
   ============================================================ */
@media (max-width:768px){
  .fm-shed-grid {
    display:grid !important;
    grid-template-columns:repeat(2,1fr) !important;
    gap:8px !important;
    max-width:100% !important;
  }
  .fm-shed-item {
    flex-direction:column !important;
    align-items:stretch !important;
    padding:10px !important;
    border-radius:8px !important;
    font-size:13px !important;
    position:relative;
  }
  .fm-shed-item:has(.fm_shed_cb:checked) {
    background:#e8f0fe !important;
    border-color:#1a73e8 !important;
    border-width:2px !important;
  }
  .fm-shed-item .fm_shed_cb {
    margin-right:4px;
  }
  .fm-shed-item .fm_shed_kg {
    width:100% !important;
    margin-top:6px;
    min-height:38px;
    font-size:14px;
  }
}

/* ============================================================
   处方管理列表 移动端卡片化 (2026-09-03)
   ============================================================ */
@media (max-width:768px){
  #rx_manage_table thead { display:none; }
  #rx_manage_table, #rx_manage_table tbody, #rx_manage_table tr, #rx_manage_table td {
    display:block; width:100% !important; box-sizing:border-box;
  }
  #rx_manage_table .rx-m-row {
    background:#fff; border:1px solid #e5e7eb; border-radius:10px;
    padding:12px; margin-bottom:10px; box-shadow:0 1px 3px rgba(0,0,0,.04);
  }
  #rx_manage_table td {
    display:flex; align-items:center; justify-content:space-between;
    padding:5px 0; border:none; font-size:13px;
  }
  #rx_manage_table td::before {
    content:attr(data-label);
    font-size:11px; color:#6b7280; font-weight:500;
    min-width:50px;
  }
  #rx_manage_table td[data-label="选择"] {
    justify-content:flex-start; padding:0;
  }
  #rx_manage_table td[data-label="选择"]::before { display:none; }
  #rx_manage_table td[data-label="牛号"] {
    font-size:15px; font-weight:600; color:#1a73e8;
  }
  #rx_manage_table td[data-label="金额"] {
    font-size:15px;
  }
  #rx_manage_table td[data-label="操作"] {
    justify-content:flex-start; gap:6px; padding-top:8px;
    border-top:1px solid #f3f4f6; margin-top:4px;
  }
  #rx_manage_table td[data-label="操作"]::before { display:none; }
  #rx_manage_table td[data-label="操作"] button {
    min-height:36px; padding:0 12px;
  }
}

/* ============================================================
   事件列表 移动端卡片化 (2026-09-04)
   ============================================================ */
@media (max-width:768px){
  #et_tbl thead { display:none; }
  #et_tbl, #et_tbl tbody, #et_tbl tr, #et_tbl td {
    display:block; width:100% !important; box-sizing:border-box;
  }
  #et_tbl .et-row {
    background:#fff; border:1px solid #e5e7eb; border-radius:10px;
    padding:12px; margin-bottom:10px; box-shadow:0 1px 3px rgba(0,0,0,.04);
  }
  #et_tbl td {
    display:flex; align-items:center; justify-content:space-between;
    padding:5px 0; border:none; font-size:13px; text-align:left;
  }
  #et_tbl td::before {
    content:attr(data-label);
    font-size:11px; color:#6b7280; font-weight:500;
    flex:0 0 44px;
  }
  /* 主行：事件名 + 类型标签，作为卡片头部视觉重心 */
  #et_tbl td[data-label="事件"] {
    font-size:15px; font-weight:600; flex-direction:column;
    align-items:flex-start; gap:4px; padding-bottom:8px;
    border-bottom:1px solid #f3f4f6; margin-bottom:4px;
  }
  #et_tbl td[data-label="事件"]::before { display:none; }
  #et_tbl td[data-label="类型"] {
    justify-content:flex-start; padding-top:0; margin-top:-6px;
  }
  #et_tbl td[data-label="类型"]::before { display:none; }
  /* 备注放宽换行，不再截断 */
  #et_tbl td[data-label="备注"] {
    align-items:flex-start; white-space:normal !important;
    max-width:100% !important; overflow:visible; word-break:break-word;
  }
}

/* ============================================================
   待办 + 处方列表 移动端卡片化 (2026-09-04)
   ============================================================ */
@media (max-width:768px){
  /* 待办列表 */
  #todo_tbl thead { display:none; }
  #todo_tbl, #todo_tbl tbody, #todo_tbl tr, #todo_tbl td {
    display:block; width:100% !important; box-sizing:border-box;
  }
  #todo_tbl .td-row {
    background:#fff; border:1px solid #e5e7eb; border-radius:10px;
    padding:12px; margin-bottom:10px; box-shadow:0 1px 3px rgba(0,0,0,.04);
  }
  #todo_tbl td {
    display:flex; align-items:center; justify-content:space-between;
    padding:5px 0; border:none; font-size:13px; text-align:left;
  }
  #todo_tbl td::before {
    content:attr(data-label);
    font-size:11px; color:#6b7280; font-weight:500;
    flex:0 0 44px;
  }
  #todo_tbl td[data-label="图标"] { display:none; }
  #todo_tbl td[data-label="待办"] {
    font-size:15px; font-weight:600; flex-direction:column;
    align-items:flex-start; gap:4px; padding-bottom:8px;
    border-bottom:1px solid #f3f4f6; margin-bottom:4px;
  }
  #todo_tbl td[data-label="待办"]::before { display:none; }
  #todo_tbl td[data-label="操作"] {
    justify-content:flex-start; gap:6px; padding-top:8px;
    border-top:1px solid #f3f4f6; margin-top:4px;
  }
  #todo_tbl td[data-label="操作"]::before { display:none; }
  #todo_tbl td[data-label="操作"] button { min-height:36px; }

  /* 处方列表（诊疗记录） */
  #rxl_tbl thead { display:none; }
  #rxl_tbl, #rxl_tbl tbody, #rxl_tbl tr, #rxl_tbl td {
    display:block; width:100% !important; box-sizing:border-box;
  }
  #rxl_tbl .rxl-row {
    background:#fff; border:1px solid #e5e7eb; border-radius:10px;
    padding:12px; margin-bottom:10px; box-shadow:0 1px 3px rgba(0,0,0,.04);
  }
  #rxl_tbl td {
    display:flex; align-items:center; justify-content:space-between;
    padding:5px 0; border:none; font-size:13px; text-align:left;
  }
  #rxl_tbl td::before {
    content:attr(data-label);
    font-size:11px; color:#6b7280; font-weight:500;
    flex:0 0 52px;
  }
  #rxl_tbl td[data-label="牛号"] {
    font-size:15px; font-weight:600; color:#1a73e8;
    border-bottom:1px solid #f3f4f6; padding-bottom:8px; margin-bottom:4px;
  }
  #rxl_tbl td[data-label="诊断"] {
    white-space:normal !important; max-width:100% !important;
    overflow:visible; word-break:break-word;
  }
  #rxl_tbl td[data-label="操作"] {
    justify-content:flex-start; gap:6px; padding-top:8px;
    border-top:1px solid #f3f4f6; margin-top:4px;
  }
  #rxl_tbl td[data-label="操作"]::before { display:none; }
  #rxl_tbl td[data-label="操作"] button { min-height:36px; }
}

/* ============================================================
   出入库顶部操作栏 移动端折叠 (2026-09-03)
   ============================================================ */
@media (max-width:768px){
  .m-fold-bar {
    position:relative;
  }
  /* 默认隐藏次要按钮 */
  .m-fold-bar .m-fold-item {
    display:none !important;
  }
  /* 展开状态显示次要按钮 */
  .m-fold-bar.m-expanded .m-fold-item {
    display:inline-flex !important;
  }
  /* 显示"更多"按钮 */
  .m-fold-bar .m-more-btn {
    display:inline-flex !important;
  }
  .m-fold-bar.m-expanded .m-more-btn {
    background:var(--p) !important;
    color:#fff !important;
  }
  /* 日期输入框自适应宽度 */
  .m-fold-bar input[type="date"] {
    width:calc(50% - 20px) !important;
    min-width:0;
  }
}
