/* 游戏列表容器 */
.game-list-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 游戏分类标签 */
.game-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
    padding: 15px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    align-items: center;
}

.category-label {
    font-weight: 600;
    color: #333;
    margin-right: 5px;
    font-size: 14px;
}

.category-tag {
    padding: 10px 20px;
    background-color: #f0f0f0;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.category-tag:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
}

/* 点击动画效果 */
.category-tag.clicked {
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.category-tag.active {
    background-color: #ff6b6b;
    color: white;
}

/* 游戏分类标签颜色 */
.category-tag[data-filter="tegame"].active {
    background-color: #48dbfb;
}

.category-tag[data-filter="ffgame"].active {
    background-color: #1dd1a1;
}

.category-tag[data-filter="new"].active {
    background-color: #ee5a24;
}

/* 游戏网格布局 */
.game-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 大屏幕5列 */
    gap: 20px;
    margin-bottom: 30px;
}

/* 大屏幕5列3行，最多显示15个游戏 */
.game-grid > div:nth-child(n+16) {
    display: none;
}

/* 响应式设计 - 移动端3列 */
@media (max-width: 768px) {
    .game-grid {
        grid-template-columns: repeat(3, 1fr); /* 移动端3列 */
    }
    
    /* 移动端最多显示15个游戏 */
    .game-grid > div:nth-child(n+16) {
        display: none;
    }
}

/* 分页控件样式 */
.pagination {
    width: 100% !important;
    max-width: 800px;
    margin: 30px auto !important;
    text-align: center !important;
    clear: both !important;
    display: block !important;
    position: relative !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
}

/* 移动端分页响应式设计 */
@media (max-width: 768px) {
    /* 确保分页容器在移动端强制显示 */
    .pagination {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 999 !important;
        padding: 15px 10px;
        margin: 40px auto 120px auto !important; /* 增加底部外边距到100px，确保完全显示在底部导航栏上方 */
        clear: both !important;
        position: relative !important;
    }
    
    /* 确保分页控件在总页数为1时也清晰可见 */
    .pagination-info {
        display: block !important;
        visibility: visible !important;
        font-size: 12px !important;
        margin-bottom: 5px !important;
    }
    
    /* 确保分页按钮在移动端始终可见且支持横向滚动 */
    .pagination-buttons {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 5px !important;
        scrollbar-width: none !important; /* Firefox */
    }
    
    /* 隐藏滚动条但保留滚动功能 */
    .pagination-buttons::-webkit-scrollbar {
        display: none !important; /* Chrome, Safari, Edge */
    }
    
    /* 进一步减小分页按钮的内外边距，适应移动端窄屏 */
    .page-btn {
        padding: 3px 6px !important;
        margin: 0 1px !important;
        font-size: 12px !important;
        line-height: 18px !important;
    }
    
    /* 内联样式的分页按钮也需要响应式调整 */
    .pagination > div > div a, 
    .pagination > div > div span {
        padding: 3px 6px !important;
        margin: 0 1px !important;
        font-size: 12px !important;
        min-width: 24px !important;
        text-align: center !important;
    }
    
    /* 确保分页控件不会溢出视口且支持横向滚动 */
    .pagination > div > div {
        display: flex !important;
        flex-wrap: nowrap;
        justify-content: center;
        align-items: center;
        white-space: nowrap;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important; /* Firefox */
    }
    
    /* 隐藏滚动条但保留滚动功能 */
    .pagination > div > div::-webkit-scrollbar {
        display: none !important; /* Chrome, Safari, Edge */
    }
    
    /* 优化省略号显示 */
    .pagination-buttons span[style*="color: #666"] {
        font-weight: bold;
    }
    
    /* 当前页码高亮样式 */
    .pagination-buttons span[style*="background: #dc3545"] {
        font-weight: bold;
        transform: scale(1.1);
    }
}

/* 在移动端显示分页信息，在桌面端隐藏 */
@media (min-width: 769px) {
    .pagination-info {
        display: none !important;
    }
}

/* 在移动端强制显示分页信息 */
@media (max-width: 768px) {
    .pagination-info {
        display: block !important;
        visibility: visible !important;
    }
}

.pagination-controls {
    display: inline-block !important;
    text-align: center !important;
    margin: 0 auto !important;
    float: none !important;
    clear: both !important;
}

.page-btn {
    padding: 5px 12px;
    margin: 0 2px;
    background-color: #fff;
    border: 1px solid #ddd;
    color: #007bff;
    border-radius: 0;
    cursor: pointer;
    text-decoration: none;
    line-height: 24px;
    font-size: 14px;
}

.page-btn:hover:not(.disabled) {
    color: #0056b3;
    background-color: #f8f9fa;
    border-color: #0056b3;
}

.page-btn.active {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

.page-btn.active:hover {
    background-color: #c82333;
    border-color: #bd2130;
    color: #fff;
}

.page-btn.ellipsis {
    background: none;
    border: none;
    cursor: default;
    color: #6c757d;
}

.page-btn.ellipsis:hover {
    background: none;
    border: none;
    color: #6c757d;
}

.page-btn.disabled {
        opacity: 0.5;
        cursor: not-allowed;
        pointer-events: none;
    }

@media (max-width: 768px) {
    .game-grid {
        grid-template-columns: repeat(3, 1fr); /* 移动端3列 */
    }
}

@media (max-width: 480px) {
    .game-grid {
        grid-template-columns: repeat(3, 1fr); /* 小屏移动端3列 */
    }
}

/* 游戏项目卡片 */
.game-item-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s ease;
}

.game-item {
    position: relative;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
    padding: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 200px;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
}

@media (max-width: 768px) {
    .game-item {
        width: 100%;
        height: 150px; /* 调整高度适应3列布局 */
    }
    .game-grid {
        gap: 15px; /* 调整间距适应3列布局 */
    }
}

@media (max-width: 480px) {
    .game-item {
        width: 100%;
        height: 130px; /* 调整高度适应3列布局 */
    }
    .game-grid {
        gap: 12px; /* 调整间距适应3列布局 */
    }
}

.game-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* 免费/价格标签 */
.free-tag {
    position: absolute;
    top: 4px;
    right: 4px;
    background-color: #27ae60;
    color: white;
    font-weight: bold;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 11px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    z-index: 10;
    white-space: nowrap;
}

/* 置顶标签 */
.top-tag {
    position: absolute;
    top: 4px;
    left: 4px;
    background-color: #ff4d4f;
    color: white;
    font-weight: bold;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 11px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    z-index: 10;
    white-space: nowrap;
}

.price-tag {
    position: absolute;
    top: 4px;
    right: 4px;
    background-color: #ff4757;
    color: white;
    font-weight: bold;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 11px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    z-index: 10;
    white-space: nowrap;
}

/* 游戏图标 */
.game-icon {
    position: relative;
    width: 100%;
    flex: 1;
    overflow: hidden;
    margin: 0;
}

.game-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
    border: none;
    border-radius: 0;
}

.game-item:hover .game-icon img {
    transform: scale(1.03);
}

/* 游戏信息 */
.game-info {
    padding: 4px 6px;
    display: flex;
    flex-direction: column;
    text-align: left;
    justify-content: flex-end;
    min-height: 50px;
}

.game-name {
    font-size: 13px;
    font-weight: normal;
    color: #333;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
    padding: 0;
}

/* 游戏标签 */
.game-tags {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 2px;
    margin-top: 2px;
    padding-top: 2px;
    border-top: 1px solid #f0f0f0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    /* 隐藏滚动条但保留滚动功能 */
    -ms-overflow-style: none;
    scrollbar-width: none;
    margin-bottom: 0;
}

/* Webkit浏览器隐藏滚动条 */
.game-tags::-webkit-scrollbar {
    display: none;
}

.tag {
    display: inline-block;
    background: #f8f9fa;
    color: #666;
    padding: 1px 4px;
    border-radius: 2px;
    font-size: 10px;
    line-height: 1.2;
    white-space: nowrap;
    max-width: 50px;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

/* 无数据提示 */
.no-data {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    font-size: 18px;
    color: #999;
    background-color: #f8f9fa;
    border-radius: 10px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-grid {
        gap: 15px;
    }
    
    .game-item {
        padding: 0;
        border-radius: 4px;
        width: 100%;
        min-width: 0;
    }
    
    .game-icon {
        margin-bottom: 0;
        height: 100px;
    }
    
    .game-icon img {
        width: 100%;
        height: 100%;
        border-radius: 0;
        border-width: 0;
    }
    
    .game-name {
        font-size: 12px;
        margin-bottom: 0;
        line-height: 1.2;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: block;
        -webkit-box-orient: horizontal;
    }
    
    .game-tags {
        gap: 2px;
        margin-bottom: 0;
        padding-top: 3px;
    }
    
    .tag {
        padding: 1px 3px;
        font-size: 9px;
    }
    
    .price-tag {
        padding: 2px 4px;
        font-size: 10px;
        border-radius: 3px;
    }
    
    .top-tag {
        padding: 2px 4px;
        font-size: 10px;
        border-radius: 3px;
    }
    
    .free-tag {
        padding: 2px 4px;
        font-size: 10px;
        border-radius: 3px;
    }
    
    .game-item {
        box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    }
    
    .game-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 2px 4px rgba(0,0,0,0.12);
    }
    

}

/* 响应式设计 - 768px到1024px */
@media (min-width: 769px) and (max-width: 1024px) {
    .game-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    

}

/* 响应式设计 - 1025px及以上 */
@media (min-width: 1025px) {

}

/* 响应式设计 - 480px及以下 */
@media (max-width: 480px) {
    .game-list-container {
        padding: 10px;
    }
    
    .game-categories {
        padding: 10px;
        gap: 8px;
    }
    
    .category-label {
        font-size: 13px;
    }
    
    .category-tag {
        padding: 8px 15px;
        font-size: 13px;
    }
    
    .game-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .game-item {
        height: 160px;
    }
    
    .game-icon {
        height: 110px;
    }
    
    .game-name {
        font-size: 12px;
    }
    

}

/* 响应式设计 - 960px及以下 */
@media (max-width: 960px) {
    .game-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* 调整分页控件 */
    .pagination-controls {
        font-size: 14px;
    }
    
    .page-btn {
        padding: 8px 12px;
    }
}

/* 分页控件样式 */
.pagination {
    width: 100% !important;
    max-width: 800px;
    margin: 30px auto !important;
    text-align: center !important;
    clear: both !important;
    display: block !important;
    position: relative !important;
}

.pagination-info {
    display: none !important;
}

.pagination-controls {
    display: inline-block !important;
    text-align: center !important;
    margin: 0 auto !important;
    float: none !important;
    clear: both !important;
}

.page-btn {
    padding: 5px 12px;
    margin: 0 2px;
    background-color: #fff;
    border: 1px solid #ddd;
    color: #007bff;
    border-radius: 0;
    cursor: pointer;
    text-decoration: none;
    line-height: 24px;
    font-size: 14px;
}

.page-btn:hover:not(.disabled) {
    color: #0056b3;
    background-color: #f8f9fa;
    border-color: #0056b3;
}

.page-btn.active {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

.page-btn.active:hover {
    background-color: #c82333;
    border-color: #bd2130;
    color: #fff;
}

.page-btn.ellipsis {
    background: none;
    border: none;
    cursor: default;
    color: #6c757d;
}

.page-btn.ellipsis:hover {
    background: none;
    border: none;
    color: #6c757d;
}

.page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}