.pisell-pro-resource-picker {
  display: flex;
  flex-direction: column;
}

/**
 * PisellModal（pc）在本仓库的类名映射为 `pisell-lowcode-modal-*`。
 * 资源选择 / View All 共用：收紧 header/body/footer，与原先 antd Modal 内联 styles 一致。
 */
.pisell-lowcode-modal-root {
  .pisell-pc-modal.pisell-pro-resource-picker-modal {
    .pisell-lowcode-modal-header {
      padding: 6px;
      margin-bottom: 0;
      background: rgb(250, 250, 250);
    }

    .pisell-lowcode-modal-body {
      padding: 0;
    }

    .pisell-lowcode-modal-footer {
      justify-content: flex-end;
      gap: 4px;
      padding: 6px;
      margin-top: 0;
    }
  }
}

.pisell-pro-resource-picker {

  &-filter-bar {
    padding: 6px;
    background: rgb(250, 250, 250);
    border-bottom: 1px solid #eef0f2;
  }

  &-tabbar {
    /**
     * sticky / padding / 背景由 PisellTabbarTemplate1 内联 style 提供。
     * 这里不再叠加 border-bottom：外层 `.filter-bar` 已经有一条分隔线，
     * tabbar 自身再加一条会与 filter-bar 边框紧贴成「双线」。
     */
  }

  &-search-fallback {
    padding: 6px;
    background: rgb(250, 250, 250);
    border-bottom: 1px solid #eef0f2;
  }

  &-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px;
    border-bottom: 1px solid #f3f4f6;
    background: #fafafa;
  }

  &-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;

    /**
     * 「全选」复选框：放大文字 + 复选框本体，便于在工具栏点击。
     * antd 5 的类名经本仓库映射为 `pisell-lowcode-checkbox-*`。
     */
    .pisell-lowcode-checkbox-wrapper {
      font-size: 15px;
      line-height: 1.4;
    }

    .pisell-lowcode-checkbox-inner {
      width: 18px;
      height: 18px;

      &::after {
        // 勾选钩子按比例放大，避免在 18px 复选框里偏小
        width: 6px;
        height: 10px;
      }
    }
  }

  &-link {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    color: #7f56d9;
    font-size: 15px;
    line-height: 1.4;
    padding: 4px 10px;
    transition: background 0.15s ease, border-color 0.15s ease;

    &:hover:not(:disabled) {
      background: #faf7ff;
      border-color: #e9d8ff;
    }

    &:disabled {
      color: #9ca3af;
      cursor: not-allowed;
    }
  }

  &-hint {
    font-size: 13px;
    color: #6b7280;
  }

  &-count {
    font-size: 13px;
    color: #6b7280;
  }

  &-list {
    padding: 6px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;

    /**
     * Selector 响应式 grid 用 `1fr` 分列；grid item 默认 `min-width: auto`
     * 会被卡片标题（white-space: nowrap）的 min-content 撑大，从而出现横向滚动。
     * 这里强制 grid item `min-width: 0`，并让卡片自身占满列宽。
     */
    .pisell-pro-selector_layout-responsive {
      width: 100%;

      > * {
        min-width: 0;
      }
    }
  }

  &-empty {
    padding: 48px 0;
    text-align: center;
    color: #9ca3af;
  }

  /**
   * 卡片结构整体竖向排列、水平居中：image / title / subtitles / badges / actions。
   * - body 内默认渲染（无 renderCard 时）：image / title / subtitles / badges 自上而下、横向居中
   * - actions：资源选择 = Checkbox/Radio；View All = NumberSelector，统一落在卡片底部居中
   */
  &-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;

    &:hover:not(:disabled) {
      border-color: #b69cf8;
      background: #faf7ff;
    }

    &--selected {
      border-color: #7f56d9;
      background: #f4f0ff;
      box-shadow: 0 0 0 2px rgba(127, 86, 217, 0.12);
    }

    &--disabled {
      cursor: not-allowed;
      opacity: 0.55;
    }
  }

  &-card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1 1 0;
  }

  &-card-image {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;

    /** 内置 <img> 与业务侧 ReactNode 缩略图整体居中 */
    .pisell-floor-map-layout-toolbar-preview-cell {
      flex-shrink: 0;
      margin: 0;
    }
  }

  &-card-image-img {
    display: block;
    max-width: 48px;
    max-height: 48px;
    object-fit: contain;
    border-radius: 6px;
  }

  &-card-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
    flex: 1 1 0;
    text-align: center;
  }

  &-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  &-card-sub {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  &-card-badges {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  &-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #6b7280;
  }

  &-card-badge-icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    color: #6b7280;
  }

  &-card-actions {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
  }

  &-footer {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
  }
}
