.pisell-global-search {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 280px;
  max-height: 70vh;

  // 搜索范围条外层：紧贴 PisellLookup 的搜索框下方（视觉上是搜索框的延伸）。
  // 真实样式在 components/ScopeBar.less 里（与 FullPage 共享）。
  // 这里只负责给条加 padding 和分隔线，让它与下方 body 视觉分组。
  &__scope-wrap {
    flex: 0 0 auto;
    padding: 6px;
    border-bottom: 1px solid #f0f0f0;
  }

  &__mode-segmented {
    // Segmented 自带圆角灰底；保持与全局 antd 主题一致即可
  }

  // 内容区：桌面左结果 + 右详情两栏（撑满剩余高度）
  &__content {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    gap: 4px;
  }

  &__body {
    flex: 1 1 auto;
    min-width: 0;
    overflow-y: auto;
    padding: 6px;
  }

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

    &::after {
      content: '';
      width: 4px;
      height: 36px;
      border-radius: 3px;
      background: #e5e7eb;
      transition: background 0.15s, height 0.15s;
    }

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

  &__content--resizing {
    user-select: none;

    .pisell-global-search__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;

    > * {
      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 &__content {
    gap: 0;
  }

  // 分组（All 模式）
  &__groups {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  &__group {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  &__group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: #6b7280;
  }

  &__group-title {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    color: #111827;
  }

  &__group-body {
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    background: #fff;
  }

  // Provider 自带 renderResults（如订单表格）时，去掉外层包围边框/圆角/底色，
  // 让表格自身样式贴边铺满，避免双层边框。
  &__group-body--bare {
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  &__group-list,
  &__single-list {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  &__group-item,
  &__single-item {
    padding: 6px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background-color 0.15s ease;

    &:last-child {
      border-bottom: none;
    }

    &:hover {
      background-color: #f9fafb;
    }
  }

  &__group-loading,
  &__single-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 0;
  }

  &__group-error,
  &__single-error {
    padding: 16px;
    color: #d4380d;
    background: #fff2e8;
    border-radius: 6px;
    cursor: pointer;
  }

  // 注：&__view-all 样式已上移到 components/ScopeBar.less（FullPage / Modal 共享）。

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

  // Provider 自带 renderResults 时，整组接管渲染：
  // 容器不加 border / padding，让业务自己的布局（如订单表格）贴边铺满。
  // 单 tab（如订单管理表格）：撑满 body 剩余高度，表格内部滚动。
  &__single-custom {
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;

    .pisell-global-search-order-table {
      flex: 1 1 auto;
      min-height: 0;
      height: auto; // 覆盖默认 clamp，改为 flex 撑满
      margin-top: 0;
      display: flex;
      flex-direction: column;

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

  // body 改为 flex 列：单 tab 自定义结果区才能向下撑满。
  // 分组（All）下 __groups 自身仍是 flex 列，布局不受影响。
  &__body {
    display: flex;
    flex-direction: column;
  }
}

// 全局搜索内嵌的订单表格：抹掉 PisellSalesManagement 外层默认 height: 0，
// 由高度容器（renderResults 内部）控制高度。
// 默认给「全部」分组用的有界高度（clamp）：父级 auto 时仍能内部滚动 + 触发触底翻页。
// 单 tab 自定义结果区里会被 &__single-custom 下的规则覆盖为 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;
  }
}
