.pisell-global-search-fp {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  // 整页正好占满一屏：高度锁定为视口高度且自身不滚动（外层路由通常不滚动）。
  // 搜索框以下的内容区（__body）吃掉剩余高度，表格 / 详情在内部滚动。
  height: 100%;
  overflow: hidden;
  background: #f5f6f8;

  // ============ 搜索 Panel（输入框 + 范围 Radio 同卡片） ============
  &__search-panel {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 12px;
  }

  &__search-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  &__mode-switch {
    flex: 0 0 auto;
    display: flex;
    align-items: center;

    .pisell-lowcode-segmented,
    .ant-segmented {
      height: 58px;
      min-height: 58px;
      padding: 4px !important;
      box-sizing: border-box !important;
      display: inline-flex !important;
      align-items: center;
    }

    .pisell-lowcode-segmented-group,
    .ant-segmented-group {
      flex: 1;
      min-height: 0;
      align-self: stretch;
      display: flex;
      align-items: center;
    }

    .pisell-lowcode-segmented-item,
    .ant-segmented-item {
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
      align-self: stretch;
      height: 100%;
      min-height: 0;
      box-sizing: border-box !important;
    }

    .pisell-lowcode-segmented-item-label,
    .ant-segmented-item-label {
      display: inline-flex !important;
      align-items: center !important;
      justify-content: center !important;
      height: 100%;
      line-height: normal !important;
      padding-block: 0 !important;
    }

    .pisell-lowcode-segmented-thumb,
    .ant-segmented-thumb {
      top: 4px !important;
      bottom: 4px !important;
      height: auto !important;
    }
  }

  // 搜索输入框（GlobalSearchFind / PisellFind 内联形态）：限制最大宽度，避免整页过长
  &__find {
    flex: 1 1 420px;
    width: min(100%, 720px);
    max-width: 720px;
    min-width: 280px;

    // PisellFind inline 外层容器与内部输入框均铺满
    .pisell-lookup-trigger-input,
    .pisell-lowcode-input-affix-wrapper {
      width: 100%;
    }

    // 输入框本体：内边距统一 6px
    .pisell-lowcode-input-affix-wrapper {
      padding: 6px;
    }
  }

  &--phone &__mode-switch {
    order: -1;
    width: 100%;

    .pisell-lowcode-segmented,
    .ant-segmented {
      width: 100%;
      height: 36px;
      min-height: 36px;
      padding: 4px !important;
    }

    .pisell-lowcode-segmented-group,
    .ant-segmented-group {
      width: 100%;
    }

    .pisell-lowcode-segmented-item,
    .ant-segmented-item {
      flex: 1;
    }
  }

  &--phone &__search-row {
    align-items: stretch;
    flex-direction: column;
  }

  &--phone &__find {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  // 注：搜索范围条的样式见 components/ScopeBar.less，FullPage 与 Modal 形态共享。

  // ============ 结果主体（桌面左结果 + 右详情两栏） ============
  // 吃掉搜索框以下的剩余高度（整页 100vh − 搜索 panel）；
  // min-height:0 让内部表格 / 详情可缩到内容以下并各自内部滚动。
  &__body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    gap: 4px;
  }

  // 结果容器：独立滚动 + 卡片样式
  &__main {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 12px;
    padding: 6px;
  }

  // 拖拽分隔条：左结果 / 右详情之间，可左右拖动改宽度。
  // 视觉上只是一个居中的小手柄（短竖条），不是贯穿整高的长条。
  &__resizer {
    flex: 0 0 10px;
    align-self: stretch;
    cursor: col-resize;
    display: flex;
    align-items: center;
    justify-content: center;

    // 居中的小手柄（短竖条 / 抓手），hover / 拖拽时加深
    &::after {
      content: '';
      width: 4px;
      height: 36px;
      border-radius: 3px;
      background: #e5e7eb;
      transition: background 0.15s, height 0.15s;
    }

    &:hover::after {
      background: #c4c4c4;
      height: 48px;
    }
  }

  // 拖拽中：禁用子项文本选中 + 手柄高亮
  &__body--resizing {
    user-select: none;

    .pisell-global-search-fp__resizer::after {
      background: #1677ff;
      height: 48px;
    }
  }

  // 详情侧栏（桌面）：原「搜索历史」位置，改放行点击后的订单详情。
  // 宽度由 useResizablePane 通过 inline style 控制（占比，缩放无关）。
  // 高度占满结果区剩余高度，内部详情（SaleDetail）随之撑满并内部滚动。
  &__detail {
    min-width: 0;
    height: 100%;
    overflow-y: auto;
    // 与业务订单卡片一致的卡片样式：整圈主题色边框 + 圆角（无阴影）
    padding: 6px;
    background: #fff;
    border: 1.5px solid
      var(--ant-color-primary, var(--color-primary, #5d3f9f));
    border-radius: 12px;
    display: flex;
    flex-direction: column;

    // 让内嵌的详情内容（SaleDetail / 占位）撑满侧栏高度
    > * {
      flex: 1 1 auto;
      min-height: 0;
    }
  }

  // 未选中时的占位提示
  &__detail-idle {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6px;
    color: #9ca3af;
    font-size: 13px;
  }
  // 手机端：结果主体单栏铺满（详情走抽屉，不占布局）
  &--phone &__body {
    gap: 0;
  }

  // provider.renderResults 自定义渲染（如订单表格）场景：
  // 去掉外层卡片的 border / padding / 圆角，避免与内部表格自带样式形成双层视觉边框。
  // 同时改为 flex 列：让内部的订单表格向下撑满 main 剩余高度、内部滚动。
  &__main--bare {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: hidden;
    display: flex;
    flex-direction: column;

    .pisell-global-search__single-custom {
      flex: 1 1 auto;
      min-height: 0;
      display: flex;
      flex-direction: column;
    }

    // 撑满剩余高度（覆盖默认 clamp），表格内部自行滚动
    .pisell-global-search-order-table {
      flex: 1 1 auto;
      min-height: 0;
      height: auto;
      margin-top: 0;
      display: flex;
      flex-direction: column;

      // 内部表格（PisellSalesGrid）/ 错误占位铺满
      > * {
        flex: 1 1 auto;
        min-height: 0;
      }
    }
  }

  &__empty {
    padding: 24px 0;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
  }
}

// 全局搜索内嵌的订单表格（整页形态）：与上方内容留 6px 上边距。
// 该类同时定义在 PisellGlobalSearch.less（弹窗形态），两处一致。
// 默认给「全部」分组用的有界高度（clamp）：父级 auto 时仍能内部滚动 + 触发触底翻页。
// 单 tab 自定义结果区里会被 &__main--bare 下的规则覆盖为 flex 撑满。
.pisell-global-search-order-table {
  width: 100%;
  height: clamp(360px, 60vh, 720px);
  margin-top: 6px;

  // 仅本页内：grid pro 工具栏四周 padding 统一 6px。
  // 用 !important 压过 recordBoardToolbar.less 里 `#body ...--grid` 的 id 级左右 16px
  // 与 GridPro 基础的 padding-bottom 16px。
  .pisell-grid-pro-toolbar.pisell-record-board-toolbar--grid {
    padding: 6px !important;
  }
}
