/* Reset default styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* 轮播图容器 - 16:9比例，高度300px */
.carousel-container {
    width: 533px; /* 16:9比例，基于高度300px计算得出 */
    height: 300px;
    margin: 0 auto 30px;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.3s ease;
}

.carousel-container:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.carousel {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    display: none;
    width: 100%;
    height: 100%;
}

.carousel-slide.active {
    display: block;
}

.carousel-slide img {
    width: 533px;
    height: 300px;
    object-fit: cover;
}

/* 轮播图按钮 */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 18px;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 5px;
    z-index: 10;
}

.carousel-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}

/* 轮播图指示器 */
.carousel-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 20;
}

/* 有趣的指示器动画 */
.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator:hover {
    transform: scale(1.2);
    background-color: rgba(255, 255, 255, 0.8);
}

.indicator.active {
    background-color: white;
    transform: scale(1.2);
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
}

.indicator.active {
    background-color: white;
}

/* 主容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 轮播图与游戏对应关系说明 */
.banner-game-mapping {
    text-align: center;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #e9f7fe;
    border-radius: 5px;
    border-left: 4px solid #007bff;
}

.banner-game-mapping p {
    margin: 0;
    color: #007bff;
    font-weight: 500;
}

/* 游戏分类导航 */
.game-categories {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    padding: 10px 0;
}

.game-categories ul {
    display: flex;
    justify-content: center;
    list-style: none;
    flex-wrap: wrap;
}

.game-categories li {
    margin: 5px 10px;
}

.game-categories li.active a {
    background-color: #007bff;
    color: white;
}

.game-categories a {
    display: block;
    padding: 10px 20px;
    text-decoration: none;
    color: #333;
    border-radius: 20px;
    transition: all 0.3s ease;
    border: 1px solid #ddd;
}

.game-categories a:hover {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

/* 游戏区域标题 */
.game-section h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    text-align: center;
    font-size: 1.5rem;
}

/* 游戏网格布局 */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 40px;
}

/* 游戏项目样式 */
.game-item {
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.game-item:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.game-item a {
    text-decoration: none;
    color: #333;
    display: block;
}

/* 游戏展示条 - "小杠杠" 样式 */
.game-bar {
    width: 100%;
    height: 120px; /* 实现4:3比例 - 宽度:高度 = 4:3 */
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    border-radius: 6px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: all 0.3s ease;
}

/* 游戏项目悬停时的缩放效果 */
.game-item:hover .game-bar {
    transform: scale(1.05);
}

/* 为游戏名称添加淡入动画 */
.game-item span {
    font-size: 14px;
    font-weight: 500;
    display: block;
    word-break: break-all;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.game-item:hover span {
    opacity: 1;
    transform: scale(1.05);
    color: #007bff;
    font-weight: 600;
}

/* 添加悬停时的光晕效果 */
.game-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255,255,255,0.4) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.game-item:hover::before {
    opacity: 1;
}

/* 波纹效果 */
.game-item {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* 根据data-banner-img属性设置不同的背景图片 */
.game-item[data-banner-img="1"] .game-bar {
    background: url('banner/1.png') !important;
    background-size: cover !important;
    background-position: center !important;
}

.game-item[data-banner-img="2"] .game-bar {
    background: url('banner/2.png') !important;
    background-size: cover !important;
    background-position: center !important;
}

.game-item[data-banner-img="3"] .game-bar {
    background: url('banner/3.png') !important;
    background-size: cover !important;
    background-position: center !important;
}

.game-item[data-banner-img="4"] .game-bar {
    background: url('banner/4.png') !important;
    background-size: cover !important;
    background-position: center !important;
}

.game-item[data-banner-img="5"] .game-bar {
    background: url('banner/5.png') !important;
    background-size: cover !important;
    background-position: center !important;
}

.game-item[data-banner-img="6"] .game-bar {
    background: url('banner/6.png') !important;
    background-size: cover !important;
    background-position: center !important;
}

.game-item[data-banner-img="7"] .game-bar {
    background: url('banner/7.png') !important;
    background-size: cover !important;
    background-position: center !important;
}

.game-item[data-banner-img="8"] .game-bar {
    background: url('banner/8.png') !important;
    background-size: cover !important;
    background-position: center !important;
}

.game-item[data-banner-img="9"] .game-bar {
    background: url('banner/9.png') !important;
    background-size: cover !important;
    background-position: center !important;
}

.game-item[data-banner-img="10"] .game-bar {
    background: url('banner/10.png') !important;
    background-size: cover !important;
    background-position: center !important;
}

.game-item[data-banner-img="11"] .game-bar {
    background: url('banner/11.png') !important;
    background-size: cover !important;
    background-position: center !important;
}

.game-item[data-banner-img="12"] .game-bar {
    background: url('banner/12.png') !important;
    background-size: cover !important;
    background-position: center !important;
}

.game-item[data-banner-img="13"] .game-bar {
    background: url('banner/13.png') !important;
    background-size: cover !important;
    background-position: center !important;
}

.game-item[data-banner-img="14"] .game-bar {
    background: url('banner/14.png') !important;
    background-size: cover !important;
    background-position: center !important;
}

.game-item[data-banner-img="15"] .game-bar {
    background: url('banner/15.png') !important;
    background-size: cover !important;
    background-position: center !important;
}

.game-item[data-banner-img="16"] .game-bar {
    background: url('banner/16.png') !important;
    background-size: cover !important;
    background-position: center !important;
}

.game-item[data-banner-img="17"] .game-bar {
    background: url('banner/17.png') !important;
    background-size: cover !important;
    background-position: center !important;
}

.game-item[data-banner-img="18"] .game-bar {
    background: url('banner/18.png') !important;
    background-size: cover !important;
    background-position: center !important;
}

.game-item[data-banner-img="19"] .game-bar {
    background: url('banner/19.png') !important;
    background-size: cover !important;
    background-position: center !important;
}

.game-item[data-banner-img="20"] .game-bar {
    background: url('banner/20.png') !important;
    background-size: cover !important;
    background-position: center !important;
}

.game-item[data-banner-img="21"] .game-bar {
    background: url('banner/21.png') !important;
    background-size: cover !important;
    background-position: center !important;
}

.game-item[data-banner-img="22"] .game-bar {
    background: url('banner/22.png') !important;
    background-size: cover !important;
    background-position: center !important;
}

.game-item[data-banner-img="23"] .game-bar {
    background: url('banner/23.png') !important;
    background-size: cover !important;
    background-position: center !important;
}

.game-item[data-banner-img="24"] .game-bar {
    background: url('banner/24.png') !important;
    background-size: cover !important;
    background-position: center !important;
}

/* 注释掉 ::before 伪元素以确保背景图片可见 */
/* .game-bar::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        transparent 33%,
        rgba(255, 255, 255, 0.1) 33%,
        rgba(255, 255, 255, 0.1) 66%,
        transparent 66%
    );
    background-size: 20px 20px;
} */

.game-item span {
    font-size: 14px;
    font-weight: 500;
    display: block;
    word-break: break-all;
}

/* AdSense Ad Container Styles */
.ad-container {
    background-color: #f8f9fa;
    border: 1px dashed #dee2e6;
    padding: 10px;
    border-radius: 8px;
    margin: 20px 0;
}

.ad-container.ad-top {
    margin-top: 20px;
}

.ad-container.ad-between {
    margin: 30px 0;
}

.ad-container.ad-bottom {
    margin-top: 30px;
    margin-bottom: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .game-categories ul {
        flex-direction: column;
        align-items: center;
    }
    
    .game-categories li {
        width: 100%;
        text-align: center;
        margin: 5px 0;
    }
    
    .container {
        padding: 10px;
    }
    
    .game-item {
        padding: 10px;
    }
    
    .game-bar {
        height: 100px;
    }
}

@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .carousel-container {
        aspect-ratio: 16 / 9;
    }
}