/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

/* 隐藏滚动条但保留滚动功能 */
::-webkit-scrollbar {
    display: none;
}

body {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* 游戏列表容器 */
.game-list-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 游戏分类标签 */
.game-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px 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: 8px 14px;
    background-color: #f0f0f0;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    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-category="all"].active,
.category-tag[data-letter="all"].active {
    background-color: #ff6b6b;
}

.category-tag[data-category="gm"].active {
    background-color: #ff6b6b;
}

.category-tag[data-category="0.1"].active {
    background-color: #ff9f43;
}

.category-tag[data-category="zhuanfu"].active {
    background-color: #48dbfb;
}

.category-tag[data-category="maishou"].active {
    background-color: #1dd1a1;
}

.category-tag[data-category="remen"].active {
    background-color: #5f27cd;
}

.category-tag[data-category="xianxia"].active {
    background-color: #ee5a24;
}

.category-tag[data-category="bt"].active {
    background-color: #ff6b6b;
}

.category-tag[data-category="0.05"].active {
    background-color: #ff9f43;
}

.category-tag[data-category="kaixiang"].active {
    background-color: #48dbfb;
}

.category-tag[data-category="qipai"].active {
    background-color: #1dd1a1;
}

.category-tag[data-category="changgui"].active {
    background-color: #5f27cd;
}

.category-tag[data-category="chuanqi"].active {
    background-color: #ee5a24;
}

.category-tag[data-category="caozha"].active {
    background-color: #ff6b6b;
}

.category-tag[data-category="huihe"].active {
    background-color: #ff9f43;
}

.category-tag[data-category="wuxia"].active {
    background-color: #48dbfb;
}

.category-tag[data-category="jingying"].active {
    background-color: #1dd1a1;
}

.category-tag[data-category="sanguo"].active {
    background-color: #5f27cd;
}

.category-tag[data-category="fangzhi"].active {
    background-color: #ee5a24;
}

.category-tag[data-category="dongman"].active {
    background-color: #ff6b6b;
}

.category-tag[data-category="erciyuan"].active {
    background-color: #ff9f43;
}

.category-tag[data-category="gedou"].active {
    background-color: #48dbfb;
}

.category-tag[data-category="mohuan"].active {
    background-color: #1dd1a1;
}

.category-tag[data-category="celue"].active {
    background-color: #5f27cd;
}

.category-tag[data-category="xiyou"].active {
    background-color: #ee5a24;
}

.category-tag[data-category="qban"].active {
    background-color: #ff6b6b;
}

.category-tag[data-category="mmo"].active {
    background-color: #ff9f43;
}

.category-tag[data-category="guaji"].active {
    background-color: #48dbfb;
}

.category-tag[data-category="lvse"].active {
    background-color: #1dd1a1;
}

.category-tag[data-category="tafang"].active {
    background-color: #5f27cd;
}

.category-tag[data-category="dongzuo"].active {
    background-color: #ee5a24;
}

.category-tag[data-category="h5"].active {
    background-color: #ff6b6b;
}

/* 字母筛选标签颜色 */
.category-tag[data-letter].active {
    background-color: #48dbfb;
}

/* 游戏列表网格 */
.game-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

/* 游戏卡片 */
.game-card {
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
    height: auto;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* 游戏图片容器 */
.game-image-container {
    position: relative;
    padding-top: 100%; /* 调整宽高比为1:1 */
    overflow: hidden;
    flex-shrink: 0; /* 防止在flex容器中被压缩 */
}

.game-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    will-change: transform;
}

.game-card:hover .game-image {
    transform: scale(1.08);
}

/* 游戏后缀标签 */
.game-suffix {
    display: inline-block;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: 500;
    color: #3366cc;
    background-color: #fff;
    border: 1px solid #3366cc;
    border-radius: 16px;
    white-space: nowrap;
    margin-left: 6px;
    flex-shrink: 0;
}

/* 游戏信息区域 */
.game-info {
    padding: 16px;
    background-color: #fff;
}

.game-title-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.game-name {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 游戏标签 */
.game-tags {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: hidden;
    white-space: nowrap;
    padding-bottom: 4px;
}

.game-tag {
    display: inline-block;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: 500;
    color: #ff4444;
    background-color: #fff;
    border: 1px solid #ff4444;
    border-radius: 16px;
    white-space: nowrap;
    margin-left: 6px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.game-tag:hover {
    background-color: #e0e0e0;
}

/* 游戏链接覆盖整个卡片 */
.game-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

/* 无数据提示 */
.no-data {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 16px;
}

/* 加载状态 */
.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

/* 错误提示 */
.error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #ff6b6b;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .game-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .game-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .game-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .game-categories {
        padding: 8px;
    }
    
    .category-tag {
        padding: 6px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .game-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .game-list-container {
        padding: 10px;
    }
    
    .game-info {
        padding: 10px;
    }
    
    .game-name {
        font-size: 16px;
    }
}

/* 小屏幕设备的游戏卡片布局调整 */
@media (max-width: 480px) {
    .game-card {
        display: flex;
        flex-direction: row;
    }
    
    .game-image-container {
        width: 100px;
        height: 100px;
        padding-top: 0;
    }
    
    .game-info {
        flex: 1;
        padding: 10px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    .game-title-container {
        margin-bottom: 5px;
    }
}

/* 骨架屏样式 */
.skeleton-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: pulse 1.5s infinite ease-in-out;
}

.skeleton-image {
    height: 0;
    padding-top: 100%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite ease-in-out;
}

.skeleton-info {
    padding: 12px;
}

.skeleton-title {
    height: 16px;
    background-color: #f0f0f0;
    border-radius: 4px;
    margin-bottom: 8px;
    width: 70%;
}

.skeleton-tag {
    height: 14px;
    background-color: #f0f0f0;
    border-radius: 7px;
    width: 40%;
}

/* 骨架屏动画 */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 0.8; }
    100% { opacity: 0.6; }
}

/* 小屏幕骨架屏调整 */
@media (max-width: 480px) {
    .skeleton-card {
        display: flex;
        flex-direction: row;
    }
    
    .skeleton-image {
        width: 100px;
        height: 100px;
        padding-top: 0;
    }
    
    .skeleton-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
}

/* 分页组件样式 */
.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;
}

.page-btn.dots {
    border: none;
    background: none;
    cursor: default;
    color: #999;
    margin: 0 6px;
    padding: 0;
}

/* 加载提示样式 */
.loading-text {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

/* 骨架屏样式 */
.skeleton-card {
    width: 100%;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 10px;
    animation: skeleton-loading 1.5s infinite alternate;
}

@keyframes skeleton-loading {
    0% {
        background-color: hsl(200, 20%, 80%);
    }
    100% {
        background-color: hsl(200, 20%, 95%);
    }
}

.skeleton-image {
    width: 100%;
    height: 150px;
    background-color: #e0e0e0;
    border-radius: 4px;
    margin-bottom: 10px;
}

.skeleton-content {
    padding: 0 5px;
}

.skeleton-title {
    height: 18px;
    background-color: #e0e0e0;
    border-radius: 4px;
    margin-bottom: 8px;
    width: 80%;
}

.skeleton-info {
    height: 14px;
    background-color: #e0e0e0;
    border-radius: 4px;
    margin-bottom: 10px;
    width: 60%;
}

.skeleton-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.skeleton-btn {
    height: 24px;
    background-color: #e0e0e0;
    border-radius: 12px;
    width: 70px;
}

.skeleton-tags {
    display: flex;
    gap: 5px;
}

.skeleton-tag {
    height: 18px;
    background-color: #e0e0e0;
    border-radius: 9px;
    width: 50px;
}