/* 最后加载的覆盖层：修正前面样式表（workflows/workspace/ledger）在手机端的布局冲突。
   必须在 index.html 中最后引入。 */

@media (max-width: 760px) {
  /* 工具栏：搜索 + 筛选必须同一行 */
  .workspace-section .toolbar,
  .toolbar {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 10px 12px !important;
  }
  .toolbar .search,
  .workspace-section .toolbar .search {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-basis: auto !important;
    width: auto !important;
    min-width: 0 !important;
    height: 40px !important;
    margin: 0 !important;
  }
  .toolbar .search input { width: 100% !important; min-width: 0 !important; }
  .toolbar #toggle-filter {
    flex: 0 0 auto !important;
    height: 40px !important;
    padding: 0 14px !important;
    white-space: nowrap !important;
    font-size: 13px !important;
  }

  /* 筛选面板在手机上不占位（走底部抽屉） */
  #filter-panel {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    border: 0 !important;
  }

  /* 状态标签横向滚动 */
  .workspace-section .tabs,
  .tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 2px !important;
    padding: 0 10px !important;
    margin: 0 !important;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs .tab {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    padding: 9px 8px !important;
    font-size: 13px !important;
  }

  /* 批量操作：标题一行，按钮一行横滑 */
  .order-selection {
    display: block !important;
    padding: 10px 12px !important;
  }
  .order-selection #selection-count {
    display: block !important;
    margin-bottom: 8px !important;
    font-size: 12px !important;
    color: var(--ink-3) !important;
  }
  .order-selection .row {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 8px !important;
    width: 100% !important;
  }
  .order-selection .row::-webkit-scrollbar { display: none; }
  .order-selection .row .btn {
    flex: 0 0 auto !important;
    height: 36px !important;
    line-height: 34px !important;
    padding: 0 12px !important;
    font-size: 12.5px !important;
    white-space: nowrap !important;
  }

  /* 卡片标题栏收紧 */
  .section-titlebar { padding: 12px 12px 6px !important; }
  .section-titlebar h2 { font-size: 16px !important; }
  .section-titlebar p { display: none !important; }
  .section-titlebar .stamp { font-size: 11.5px !important; }

  /* 抽屉：底部弹出 */
  .drawer {
    position: fixed !important;
    top: auto !important; bottom: 0 !important;
    left: 0 !important; right: 0 !important;
    width: 100% !important;
    height: auto !important;
    max-height: 82vh !important;
    border-radius: 16px 16px 0 0 !important;
    transform: none !important;
    box-shadow: 0 -12px 40px rgba(16, 32, 26, .18) !important;
  }
  .drawer-body { max-height: 56vh; overflow-y: auto; }
  .fd-field { margin-bottom: 18px; }
  .fd-lab { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; }
}

/* 状态标签不要被截断（"疑难""未查物流"要完整显示） */
.m-item .state,
.m-sub .state,
.m-item .stamp,
.state {
  white-space: nowrap !important;
  max-width: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
  flex-shrink: 0 !important;
}
.m-sub { flex-wrap: wrap; row-gap: 6px; }
/* 仓库卡片的操作按钮 */
.wh-acts { display: flex; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.wh-acts .btn { flex: 1; height: 36px; font-size: 13px; }
/* 商品编号 */
.pick-code {
  display: inline-block; min-width: 62px;
  font-size: 11.5px; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.prod-code {
  display: inline-block; margin-right: 8px;
  font-size: 11.5px; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  padding: 1px 5px; border-radius: 3px; background: var(--sunk);
}
/* 结算：收款人信息 + 收款二维码 */
.pay-recipient {
  display: flex; gap: 18px; align-items: flex-start;
  padding: 14px 16px; background: var(--sunk);
  border: 1px solid var(--line); border-radius: 8px; margin-bottom: 16px;
}
.pay-recipient-info {
  flex: 1; min-width: 0;
  display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; align-items: baseline;
}
.pay-lab { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.pay-name { font-size: 15px; }
.pay-amount { font-size: 18px; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.pay-qr { flex: 0 0 auto; width: 132px; text-align: center; }
.pay-qr img {
  width: 132px; height: 132px; object-fit: contain;
  background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 4px;
}
.pay-qr-hint { display: block; margin-top: 6px; font-size: 11.5px; color: var(--ink-3); }
.pay-qr-empty {
  width: 132px; height: 132px; display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px dashed var(--ctl); border-radius: 6px;
  font-size: 12px; color: var(--ink-3); text-align: center; padding: 8px;
}
@media (max-width: 760px) {
  .pay-recipient { flex-direction: column; align-items: center; }
  .pay-recipient-info { width: 100%; }
  .pay-qr { width: 160px; }
  .pay-qr img, .pay-qr-empty { width: 160px; height: 160px; }
}