/* ==========================================================================
 * 金蝶式列表页查询条件（手机端 ≤767px）
 * --------------------------------------------------------------------------
 * 对照金蝶手机端销售单列表：
 *   折叠态：一行搜索框（单号、客户、商品、备注）+ 一行「筛选 / 排序 / ⋯」
 *   展开态：点「筛选」从顶栏下滑下条件面板，每个条件一行「标签 …… 值 ›」，
 *           底部「清空条件 | 确定」，列表被压暗。
 *
 * 结构由 appshell-mobile.js::jdlCollapse 生成：原控件**搬家不换件**，
 * 因此这里只负责版式；取值、搜索触发、日期区间口径仍走 listView 原有链路。
 * 桌面 ≥1200px 与 iPad 768–1199 完全不进本文件。
 * ========================================================================== */

@media (max-width: 767px) {
  /* ---------- 折叠态 ---------- */
  /* 条件已经搬进面板，原容器留空 → 收掉，避免留一条空白 */
  #content #tb.mq-on > .mq-fields,
  #content #tb.mq-on > .mq-tools { display: none !important; }
  #content #tb .jdl-hide { display: none !important; }

  /* 搜索行：金蝶是浅灰圆角输入框，放大镜在左 */
  #content #tb .jdl-top {
    display: flex; align-items: center; gap: 8px;
    height: 42px; padding: 0 10px;
    background: #f4f6f8; border-radius: 10px;
  }
  #content #tb .jdl-ico { flex: 0 0 auto; width: 18px; height: 18px; display: block; }
  #content #tb .jdl-ico svg { width: 18px; height: 18px; display: block; fill: none;
    stroke: #98a3b0; stroke-width: 2; stroke-linecap: round; }
  #content #tb #kw.jdl-kw {
    flex: 1 1 auto; min-width: 0; width: auto; height: 40px;
    border: 0; background: transparent; padding: 0;
    font-size: 16px; color: #1f2d3d; outline: none;
  }
  #content #tb #kw.jdl-kw::placeholder { color: #a8b3c0; }

  /* 功能行：筛选 / 排序 / 更多 */
  #content #tb .jdl-bar {
    display: flex; align-items: center; gap: 4px;
    margin-top: 6px;
  }
  #content #tb .jdl-b {
    display: inline-flex; align-items: center; gap: 5px;
    height: 38px; padding: 0 8px; border: 0; background: transparent;
    font-size: 14.5px; color: #2c3e50; line-height: 1;
  }
  #content #tb .jdl-b:active { opacity: .55; }
  #content #tb .jdl-b svg { width: 15px; height: 15px; display: block; flex: 0 0 auto; }
  #content #tb .jdl-b[data-jdl="filter"] svg { fill: #5b6a79; stroke: none; }
  #content #tb .jdl-b[data-jdl="sort"] svg { fill: none; stroke: #5b6a79;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  #content #tb .jdl-arrow {
    width: 0; height: 0; margin-left: 1px;
    border-left: 4px solid transparent; border-right: 4px solid transparent;
    border-top: 5px solid #9aa6b4;
  }
  #content #tb .jdl-more-b { margin-left: auto; font-size: 18px; letter-spacing: 1px; color: #8b97a5; }

  /* 批量操作仍保留一行横滑（审核 / 删除这些是门店高频批量动作，不藏二级） */
  #content #tb .jdl-bar + .mq-acts { padding-top: 4px; }


  /* 分页条：手机上原来 flex-wrap 会折成三行（共N条 / 页码 / 共M页 / 每页条数 ≈ 130px），
     压成一行横滑，首屏多出两条单据的位置 */
  #content .pager {
    flex-wrap: nowrap; justify-content: flex-start;
    overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 8px 10px; gap: 5px;
  }
  #content .pager::-webkit-scrollbar { display: none; }
  #content .pager > * { flex: 0 0 auto; }
  #content .pager > span { font-size: 12.5px; color: #7b8794; white-space: nowrap; }
  #content .pager .pg { min-width: 34px; height: 34px; font-size: 13.5px; }
  #content .pager .sel { height: 34px; min-width: 92px; font-size: 13px; }

  /* ---------- 展开态：筛选面板 ---------- */
  .jdl-mask {
    position: fixed; left: 0; right: 0; bottom: 0; top: 0;
    background: rgba(0, 0, 0, .35);
    opacity: 0; pointer-events: none;
    transition: opacity .18s ease;
    z-index: 900;
  }
  .jdl-mask.on { opacity: 1; pointer-events: auto; }

  .jdl-sheet {
    /* 高度随条件数量自适应（最多到屏幕底部）：条件少的页面不会留一大片空白，
       条件多的页面由中间那段滚动、底部按钮始终在面板底部。 */
    position: fixed; left: 0; right: 0; top: 0; bottom: auto; max-height: 100vh;
    display: flex; flex-direction: column;
    background: #fff; z-index: 901;
    transform: translateY(-100%);
    visibility: hidden;
    transition: transform .22s cubic-bezier(.32, .72, .3, 1), visibility 0s linear .22s;
  }
  .jdl-sheet.on { transform: translateY(0); visibility: visible; transition-delay: 0s; }

  .jdl-shd {
    flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
    height: 46px; padding: 0 8px 0 14px;
    border-bottom: 1px solid #f2f4f7;
  }
  .jdl-shd b { font-size: 16px; font-weight: 600; color: #1f2d3d; }
  .jdl-x {
    width: 40px; height: 40px; border: 0; background: transparent;
    font-size: 24px; line-height: 1; color: #97a3b1;
  }

  .jdl-sbd { flex: 0 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; }

  /* 一行一个条件：标签左、值右（无框）、右侧箭头 */
  #content .jdl-row {
    display: flex; align-items: center; gap: 10px;
    min-height: 52px; padding: 0 14px;
    background: #fff; border-bottom: 1px solid #f2f4f7;
    box-sizing: border-box;
  }
  #content .jdl-row .jdl-lb,
  #content .jdl-row .mq-lb {
    flex: 0 0 auto; display: block; min-width: 72px; max-width: 40%;
    padding: 0; margin: 0;
    font-size: 15px; line-height: 1.3; color: #1f2d3d;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  #content .jdl-row .jdl-inp,
  #content .jdl-row .inp,
  #content .jdl-row .sel {
    flex: 1 1 auto; min-width: 0; width: auto; height: 50px;
    padding: 0 !important; margin: 0;
    border: 0 !important; border-radius: 0; box-shadow: none !important;
    background: transparent !important;
    font-size: 15px; color: #1f2d3d;
    text-align: right; text-align-last: right;
    -webkit-appearance: none; appearance: none;
    outline: none;
  }
  #content .jdl-row .inp::placeholder { color: #a8b3c0; text-align: right; }
  #content .jdl-row .sel { padding-right: 0 !important; }
  #content .jdl-row.vacant .inp,
  #content .jdl-row.vacant .sel { color: #a8b3c0; }
  /* 日期控件：空值显示系统占位（灰），有值右对齐显示年月日 */
  #content .jdl-row input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0; position: absolute; right: 0; width: 100%; height: 100%;
  }
  #content .jdl-row input[type="date"] { position: relative; }
  #content .jdl-row input[type="checkbox"] { width: 20px; height: 20px; flex: 0 0 auto; }
  #content .jdl-row .jdl-arw {
    flex: 0 0 auto; margin-left: 2px;
    font-size: 19px; line-height: 1; color: #c8d0da; font-style: normal;
  }


  /* 日期：原生控件透明铺满当点击层，显示交给盖层（空=灰「请选择开始时间」） */
  #content .jdl-row .jdl-dtbox {
    position: relative; flex: 1 1 auto; min-width: 0; height: 50px;
    display: flex; align-items: center; justify-content: flex-end;
  }
  #content .jdl-row .jdl-dtbox > input[type="date"] {
    position: absolute; left: 0; top: 0; right: 0; bottom: 0;
    width: 100%; height: 100%; margin: 0; padding: 0;
    opacity: 0; border: 0; background: transparent;
    -webkit-appearance: none; appearance: none;
  }
  #content .jdl-row .jdl-dv {
    font-size: 15px; color: #1f2d3d; line-height: 1.2;
    font-variant-numeric: tabular-nums; pointer-events: none;
  }
  #content .jdl-row .jdl-dv.vacant { color: #a8b3c0; }

  /* 底部：清空条件 | 确定 */
  .jdl-sft {
    flex: 0 0 auto; display: flex; align-items: stretch;
    border-top: 1px solid #eef1f5;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .jdl-sft button {
    flex: 1 1 50%; height: 50px; border: 0; border-radius: 0;
    background: #fff; font-size: 16px; color: #2e8fff;
  }
  .jdl-sft .jdl-ok { background: #2e8fff; color: #fff; }
  .jdl-sft button:active { opacity: .85; }

  /* ---------- 底部小面板（排序 / 更多） ---------- */
  .jdl-more-pop { display: none; }
  .jdl-more-pop.on { display: block; }
  .jdl-pmask {
    position: fixed; left: 0; right: 0; top: 0; bottom: 0;
    background: rgba(0, 0, 0, .35); z-index: 950; display: none;
  }
  .jdl-pmask.on { display: block; }
  .jdl-ppanel {
    position: fixed; left: 0; right: 0; bottom: 0;
    display: none; flex-direction: column; max-height: 72vh;
    background: #fff; border-radius: 14px 14px 0 0; z-index: 951;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .jdl-ppanel.on { display: flex; animation: jdl-up .2s ease; }
  .jdl-more-pop.on .jdl-pmask { display: block; }
  .jdl-more-pop.on .jdl-ppanel { display: flex; animation: jdl-up .2s ease; }
  @keyframes jdl-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
  .jdl-phd {
    flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
    height: 46px; padding: 0 8px 0 16px; border-bottom: 1px solid #f2f4f7;
  }
  .jdl-phd b { font-size: 15.5px; color: #1f2d3d; }
  .jdl-px { width: 40px; height: 40px; border: 0; background: transparent;
    font-size: 22px; color: #97a3b1; }
  .jdl-pbd { flex: 1 1 auto; overflow-y: auto; }

  .jdl-pitem {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; height: 50px; padding: 0 16px;
    border: 0; border-bottom: 1px solid #f5f6f8; background: #fff;
    font-size: 15px; color: #1f2d3d; text-align: left;
  }
  .jdl-pitem.on { color: #2e8fff; }
  .jdl-pck { font-style: normal; font-size: 15px; color: #2e8fff; opacity: 0; }
  .jdl-pitem.on .jdl-pck { opacity: 1; }

  .jdl-prow { padding: 6px 12px; border-bottom: 1px solid #f5f6f8; }
  .jdl-prow:last-child { border-bottom: 0; }
  .jdl-prow .btn { width: 100%; height: 44px; justify-content: center; font-size: 15px; }
  .jdl-prow .pop-wrap { width: 100%; }
  .jdl-prow .pop-wrap > .btn { width: 100%; }
}
