/* ============================================================
   P2-B B3 移动端深度适配（低频管理页）
   纯前端：表格横滚统一 / 触屏尺寸 / 筛选折叠 / 小屏卡片化
   由 ft.admin.layout 全局引入；仅小屏生效。
   ============================================================ */

/* ---------- 1. 表格横滚容器（JS 自动包裹） ---------- */
.ft-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

/* ---------- 2. 触屏尺寸（≤768 按钮/输入 ≥44px，iOS 触控规范） ---------- */
@media (max-width: 768px) {
  .ft-btn,
  .btn,
  button.ft-input,
  .ft-input,
  .ft-input--select,
  select.ft-input,
  .ft-filter-card .ft-input,
  .ft-filter-card select,
  .ft-card .ft-input,
  .ft-card select,
  .ft-tab,
  .ft-pagination .pagination li a,
  .ft-pagination .pagination li span,
  .ft-check,
  .ft-radio,
  a.ft-tag {
    min-height: 44px;
  }
  .ft-btn,
  .btn {
    padding-top: 9px;
    padding-bottom: 9px;
  }
  .ft-check,
  .ft-radio {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  .ft-pagination .pagination {
    flex-wrap: wrap;
    gap: 6px;
  }
  .ft-table-scroll table {
    min-width: 640px; /* 低频表格内容宽，强制横滚不挤爆 */
  }
}

/* ---------- 3. 筛选折叠（小屏默认收起 + 展开按钮） ---------- */
@media (max-width: 768px) {
  .ft-filter-card .ft-mobile-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    background: #fff;
    color: #1677ff;
    font-size: 13px;
    cursor: pointer;
  }
  .ft-filter-card .ft-filter-form {
    display: none;
  }
  .ft-filter-card.is-filter-open .ft-filter-form {
    display: block;
  }
  .ft-filter-card .ft-filter-form {
    margin-top: 10px;
  }
}
@media (min-width: 769px) {
  .ft-mobile-filter-toggle {
    display: none;
  }
}

/* ---------- 4. 小屏卡片化（td data-label 由 JS 自动生成） ---------- */
@media (max-width: 640px) {
  .ft-table-scroll table.ft-mobile-card thead {
    display: none;
  }
  .ft-table-scroll table.ft-mobile-card,
  .ft-table-scroll table.ft-mobile-card tbody,
  .ft-table-scroll table.ft-mobile-card tr,
  .ft-table-scroll table.ft-mobile-card td {
    display: block;
    width: 100%;
  }
  .ft-table-scroll table.ft-mobile-card tr {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 12px;
    padding: 6px 10px;
    background: #fff;
  }
  .ft-table-scroll table.ft-mobile-card td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    border: none;
    padding: 6px 4px;
    font-size: 13px;
  }
  .ft-table-scroll table.ft-mobile-card td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    font-weight: 600;
    color: #64748b;
    margin-inline-end: 10px;
  }
}

/* ============================================================
   t25: H5 化阶段1 — 全局响应式骨架扩展（≤768px 统一断点）
   覆盖：页头操作区换行 / 表单单列动作行 / 相邻可点元素间距 / 回PC引导
   ============================================================ */

/* ---------- 5. 页头操作区：换行到标题下方，按钮整行拉伸 ---------- */
@media (max-width: 768px) {
  .ft-page-head-card {
    padding: 16px;
    gap: 12px;
  }
  .ft-page-head-card__right {
    flex: 1 1 100%;
    justify-content: flex-start;
  }
  .ft-page-head-card__right .ft-btn,
  .ft-page-head-card__right a.ft-btn {
    flex: 1 1 auto;
    justify-content: center;
  }
  .ft-intro__actions {
    flex: 1 1 100%;
  }
  .ft-intro__actions .ft-btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* ---------- 6. 表单单列动作行 + 必填星号对齐 ---------- */
@media (max-width: 768px) {
  .ft-form__actions,
  .ft-form-actions {
    flex-wrap: wrap;
  }
  .ft-form__actions .ft-btn,
  .ft-form-actions .ft-btn {
    flex: 1 1 auto;
  }
  .ft-label .ft-required,
  .ft-form-label .ft-required {
    margin-inline-start: 2px;
  }
  /* 相邻可点元素间距 ≥8px（防误触） */
  .ft-form__actions,
  .ft-form-actions,
  .ft-page-head-card__right,
  .ft-card__head,
  .ft-filter,
  .ft-tab-group,
  .ft-btn-group,
  .ft-pagination-wrap {
    gap: 8px;
  }
}

/* ---------- 7. 回 PC 引导（复杂配置页，仅 ≤768px 显示，纯提示不阻断） ---------- */
.ft-mobile-pc-tip {
  display: none;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: #fff7e6;
  border: 1px solid #ffd591;
  border-radius: 8px;
  color: #ad6800;
  font-size: 13px;
  line-height: 1.5;
}
@media (max-width: 768px) {
  .ft-mobile-pc-tip {
    display: flex;
  }
}

/* ============================================================
   t31: H5 化阶段2 — 高频页精做补充（≤768/≤640 统一断点）
   覆盖：卡片化 min-width 修复 / 关键字段加粗 / 底部固定操作栏
   ============================================================ */

/* ---------- 8.1 卡片化表格解除 640 最小宽（避免卡片被撑成 640px 需横滚） ---------- */
@media (max-width: 640px) {
  .ft-table-scroll table.ft-mobile-card,
  .ft-table-wrap table.ft-mobile-card {
    min-width: 0;
  }
  /* 卡片内前 3 个关键字段加粗（单号/状态/金额等） */
  .ft-table-scroll table.ft-mobile-card td:nth-child(-n+3),
  .ft-table-wrap table.ft-mobile-card td:nth-child(-n+3) {
    font-weight: 600;
  }
  /* 卡片化行内按钮间距（防误触） */
  .ft-table-scroll table.ft-mobile-card td form,
  .ft-table-wrap table.ft-mobile-card td form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
}

/* ---------- 8.2 底部固定操作栏（高频页主操作：回复/审批，仅 ≤768 显示） ---------- */
.ft-mobile-actionbar {
  position: static;
}
.ft-mobile-actionbar-spacer {
  display: none;
}
@media (max-width: 768px) {
  .ft-mobile-actionbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 160;
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.10);
  }
  .ft-mobile-actionbar .ft-card__title {
    display: none; /* 移动端隐藏卡标题，腾出空间 */
  }
  .ft-mobile-actionbar .ft-reply-form__hint {
    display: none; /* 移动端隐藏提示文案 */
  }
  .ft-mobile-actionbar textarea {
    min-height: 44px;
    max-height: 120px;
    resize: vertical;
  }
  .ft-mobile-actionbar .ft-reply-form__actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
  }
  .ft-mobile-actionbar .ft-reply-form__actions .ft-btn {
    flex: 1 1 auto;
    justify-content: center;
  }
  .ft-mobile-actionbar-spacer {
    display: block;
    height: 110px;
  }
}
