/* BAIGE_HALL_FINAL_LAYOUT_FIX
 *
 * 此文件必须在算法大厅其它 CSS 之后加载，
 * 统一解决多份旧 CSS 互相覆盖造成的1/2/3列混乱。
 */

.page-algorithm-hall #hallAllGrid.hall-view-card {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    align-items: stretch !important;
    gap: 12px !important;
}

.page-algorithm-hall #hallAllGrid.hall-view-card > .algo-card {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
}

.page-algorithm-hall #hallAllGrid.hall-view-table {
    display: block !important;
    grid-template-columns: none !important;
}

/* 中等桌面、平板横屏：两列，避免截图中三张卡片被压得过窄。 */
@media (min-width: 769px) and (max-width: 1199px) {
    .page-algorithm-hall #hallAllGrid.hall-view-card {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }
}

/* 手机和平板竖屏：一列，保证文字、环形图和按钮可读可点。 */
@media (max-width: 768px) {
    .page-algorithm-hall #hallAllGrid.hall-view-card {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 10px !important;
    }

    .page-algorithm-hall #hallAllGrid.hall-view-card > .algo-card {
        min-width: 0 !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .page-algorithm-hall .card-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .page-algorithm-hall .btn-view,
    .page-algorithm-hall .hall-load-more {
        min-height: 38px !important;
    }
}
