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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
}

.logo-emoji {
    font-size: 2rem;
    margin-right: 0.5rem;
}

.search-container {
    flex: 1;
    max-width: 400px;
    margin: 0 2rem;
    position: relative;
    display: flex;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    background: rgba(255,255,255,0.9);
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
}

.header-actions {
    display: flex;
    align-items: center;
}

.notification-icon {
    position: relative;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    min-width: 1.2rem;
    text-align: center;
}

/* 主容器布局 */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 2rem;
    padding: 2rem;
}

/* 侧边栏样式 */
.sidebar {
    width: 250px;
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    height: fit-content;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 100px;
}

.categories {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.category-item:hover {
    background-color: #f0f8f0;
    transform: translateX(5px);
}

.category-item.active {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.category-icon {
    font-size: 1.2rem;
    margin-right: 0.75rem;
}

.category-name {
    flex: 1;
    font-weight: 500;
    color: #565656;
}

.category-count {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
}

.category-item.active .category-count {
    background: rgba(255,255,255,0.2);
    color: white;
}

.sidebar-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.footer-link {
    display: block;
    color: #666;
    text-decoration: none;
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

.footer-link:hover {
    color: #4CAF50;
}

/* 主内容区域 */
.content {
    flex: 1;
    min-width: 0;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: #333;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 50px;
    height: 3px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border-radius: 2px;
}

/* 轮播样式 */
.carousel-section {
    margin-bottom: 3rem;
}

.carousel-container {
    position: relative;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease;
}

.carousel-slide {
    min-width: 100%;
}

.game-featured {
    display: flex;
    height: 300px;
}

.featured-image {
    width: 60%;
    height: 100%;
    object-fit: cover;
}

.featured-info {
    width: 40%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-info h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #333;
}

.featured-info p {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.game-rating {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.stars {
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

.rating-text {
    color: #4CAF50;
    font-weight: bold;
}

.play-btn {
    background: linear-gradient(135deg, #ff6b35, #f39c12);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.4);
}

.carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background: white;
    transform: scale(1.2);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.carousel-btn:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn.prev {
    left: 20px;
}

.carousel-btn.next {
    right: 20px;
}

/* 流行游戏区域 */
.trending-section {
    margin-bottom: 3rem;
}

.trending-container {
    position: relative;
}

.trending-scroll {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 1rem 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.trending-scroll::-webkit-scrollbar {
    display: none;
}

.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(76, 175, 80, 0.9);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.scroll-btn:hover {
    background: #4CAF50;
    transform: translateY(-50%) scale(1.1);
}

.scroll-btn.left {
    left: -20px;
}

.scroll-btn.right {
    right: -20px;
}

/* 游戏卡片样式 */
.game-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-width: 280px;
    flex-shrink: 0;
}

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

.game-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.game-info {
    padding: 1.5rem;
}

.game-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.game-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.game-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.game-price {
    background: #4CAF50;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
}

.game-price.paid {
    background: #ff6b35;
}

.platform-icons {
    display: flex;
    gap: 0.5rem;
}

.platform-icon {
    font-size: 1.2rem;
}

.card-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.card-rating .stars {
    font-size: 1rem;
    margin-right: 0.5rem;
}

.card-play-btn {
    width: 100%;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.card-play-btn:hover {
    background: linear-gradient(135deg, #45a049, #4CAF50);
    transform: translateY(-2px);
}

/* 最受欢迎游戏网格 */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.games-grid .game-card {
    min-width: auto;
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    background: #4CAF50;
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1001;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
a {
    text-decoration: none; /* 去除下划线 */
}
/* 响应式设计 */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }

    .header-content {
        padding: 0 1rem;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .search-container {
        order: 3;
        flex-basis: 100%;
        margin: 0;
    }

    .sidebar {
        width: 95%;
        position: fixed;
        top: 0;
        left: -100%;
        height: 100vh;
        z-index: 1002;
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    .sidebar.active {
        left: 0;
    }

    .mobile-menu-btn {
        display: block;
    }

    .game-featured {
        flex-direction: column;
        height: auto;
    }

    .featured-image {
        width: 100%;
        height: 200px;
    }

    .featured-info {
        width: 100%;
    }

    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .carousel-btn.prev {
        left: 10px;
    }

    .carousel-btn.next {
        right: 10px;
    }

    .trending-scroll {
        gap: 1rem;
    }

    .game-card {
        min-width: 250px;
    }

    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }

    .scroll-btn {
        display: none;
    }
}

@media (max-width: 480px) {
    .header-content {
        flex-direction: column;
        align-items: stretch;
    }

    .logo {
        justify-content: center;
    }

    .header-actions {
        justify-content: center;
    }

    .game-card {
        min-width: 200px;
    }

    .games-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 1.5rem;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-card {
    animation: fadeIn 0.6s ease forwards;
}

/* 加载状态 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    font-size: 1.2rem;
    color: #666;
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #4CAF50;
    border-top: 2px solid transparent;
    border-radius: 50%;
    margin-left: 10px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}