/* 自定义样式 - 让链接元素正确显示 */

/* 主横幅链接样式 */
a.game-wrapper_agbox {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

a.game-wrapper_agbox:hover {
    text-decoration: none;
}

/* 卡片链接样式 */
a.ag-card1 {
    display: flex;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

a.ag-card1:hover {
    text-decoration: none;
}

/* APP下载链接样式 */
a.game_item {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

a.game_item:hover {
    text-decoration: none;
}

/* 确保按钮在链接内正常显示 */
a button {
    pointer-events: none;
}

/* 主横幅渐变背景样式 */
.game-wrapper_agbg {
    position: relative;
    overflow: hidden;
}

/* 右侧装饰图片 */
.banner-side-image {
    position: absolute;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    height: 70%;
    max-height: 100%;
    width: auto;
    object-fit: contain;
    pointer-events: none;
    z-index: 1;
}

/* 确保内容在图片上方 */
.game-wrapper_ag-list,
.game-wrapper_ag-join,
.game-wrapper_ag button {
    position: relative;
    z-index: 2;
}

/* 自定义Logo图片样式 */
.ag-card-img[style*="background-image"] {
    background-color: rgba(255,255,255,.05) !important;
}

/* 图片预览样式 */
.image-preview {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f9f9f9;
    display: inline-block;
}

.image-preview img {
    display: block;
    border-radius: 4px;
}

/* APP下载模块渐变背景 */
a.game_item[style*="background"] {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

/* 确保APP下载模块内容在渐变背景上清晰可见 */
a.game_item .top_game_tit {
    position: relative;
    z-index: 2;
}

/* 图片靠右显示 */
a.game_item .img-right {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 80%;
    width: auto;
    max-height: 100%;
    z-index: 2;
    display: block !important;
}

/* APP下载模块容器 - 支持自动换行 */
.home_sports_game-content {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 16px !important;
}

/* APP下载模块宽度设置 */
.home_sports_game-content .game_item {
    flex: 1 1 calc(25% - 12px);
    min-width: 250px;
    max-width: calc(25% - 12px);
    transition: all 0.3s ease;
}

/* 鼠标悬停效果 - 放大模块 */
.home_sports_game-content .game_item_active {
    flex: 1.5 1 calc(25% - 12px) !important;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

/* 当屏幕较小时，每行显示3个 */
@media screen and (max-width: 1200px) {
    .home_sports_game-content .game_item {
        flex: 1 1 calc(33.333% - 11px);
        max-width: calc(33.333% - 11px);
    }
    
    .home_sports_game-content .game_item_active {
        flex: 1.5 1 calc(33.333% - 11px) !important;
    }
}

/* 当屏幕更小时，每行显示2个 */
@media screen and (max-width: 900px) {
    .home_sports_game-content .game_item {
        flex: 1 1 calc(50% - 8px);
        max-width: calc(50% - 8px);
    }
    
    .home_sports_game-content .game_item_active {
        flex: 1.5 1 calc(50% - 8px) !important;
    }
}

/* 响应式调整 - 移动端每行显示1个 */
@media screen and (max-width: 768px) {
    a.game_item .img-right {
        height: 70%;
    }
    
    .home_sports_game-content .game_item {
        flex: 1 1 100% !important;
        max-width: 100% !important;
    }
}

/* ========== 卡片模块布局优化 ========== */

/* 卡片模块圆角 */
.home-top-entry .game-wrapper .ag-card1 {
    border-radius: 16px;
}

/* 隐藏第3个及以后的卡片（桌面端最多显示2个） */
@media screen and (min-width: 961px) {
    .home-top-entry .game-wrapper .ag-card1:nth-of-type(n+4) {
        display: none !important;
    }
}
