
/*
 * Dark Grid 全宽自适应布局重构
 * Override styles
 */

/* ===== 全局宽屏布局 ===== */
html, body {
    width: 100%;
    min-height: 100%;
}

.container,
.site-container,
.site-container.container {
    width: 100%;
    max-width: none !important;
    padding-left: 16px;
    padding-right: 16px;
    margin-left: 0;
    margin-right: 0;
}

.site-content {
    width: 100%;
    max-width: none;
    border-radius: 0;
}

/* Bootstrap容器限制解除 */
.container,
.container-fluid {
    padding-left: 12px;
    padding-right: 12px;
}

/* ===== 顶部区域全宽 ===== */
.top-nav {
    width: 100%;
    border-radius: 0;
}

.top-nav > .container {
    max-width: none;
    width: 100%;
}

/* Logo与内容顶部对齐 */
.site-logo {
    max-height: 55px;
    width: auto;
}

/* ===== 游戏列表自适应 ===== */
.game-container,
.grid-wrapper {
    width: 100%;
}

.grid-layout {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
    grid-auto-rows: minmax(120px, auto);
}

.grid-layout .grid-item {
    min-width: 0;
}

.list-game {
    width: 100%;
    overflow: hidden;
}

img.small-thumb {
    width: 100%;
    height: auto;
    display: block;
}

/* ===== 缩小游戏卡间距 ===== */
.grid-wrapper {
    margin-bottom: 12px;
}

.game-container {
    margin: 12px 0;
}

.sidebar .list-game,
.footer .list-game {
    margin-bottom: 6px;
}

/* ===== 内容区域占满屏幕 ===== */
.main-content,
.site-main,
.content-area {
    width: 100%;
    max-width: none;
}

/* ===== 移动端优化 ===== */
@media (max-width: 768px) {
    .container,
    .site-container {
        padding-left: 8px;
        padding-right: 8px;
    }

    .grid-layout {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 6px;
    }
}

/* 超宽屏进一步利用空间 */
@media (min-width: 1600px) {
    .grid-layout {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    }
}

/* 为网格缩略图预留 1:1 比例空间，防止懒加载挤压布局 */
.grid-layout .grid-item,
.small-thumb {
    aspect-ratio: 1 / 1; /* 如果你的图片是横图，可以改为 16 / 9 或 4 / 3 */
    width: 100%;
    object-fit: cover;
}

/* 确保图片未加载出来前也有背景占位 */
.small-thumb {
    background-color: #2a2d3d; /* 使用与你主题相近的暗色背景占位 */
}
/* 开启密集填充算法，让后面较小的卡片自动填补空白 */
.grid-layout,
.grid-wrapper {
    grid-auto-flow: dense !important;
}