/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏 */
.navbar {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 50%, #6c3483 100%);
    color: white;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(155, 89, 182, 0.3);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 24px;
    font-weight: bold;
}

.logo-icon {
    font-size: 28px;
}

.nav-search {
    flex: 1;
    display: flex;
    max-width: 500px;
    margin: 0 10px;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border-radius: 25px 0 0 25px;
    border: 2px solid rgba(255,255,255,0.5);
    outline: none;
    background: rgba(255,255,255,0.25);
    color: white;
    font-size: 15px;
    transition: all 0.3s;
}

.search-input:focus {
    background: rgba(255,255,255,0.35);
    border-color: rgba(255,255,255,0.8);
}

.search-input::placeholder {
    color: rgba(255,255,255,0.9);
}

.search-btn {
    background: rgba(255,255,255,0.3);
    border: 2px solid rgba(255,255,255,0.5);
    border-left: none;
    color: white;
    padding: 10px 20px;
    border-radius: 0 25px 25px 0;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
}

.search-btn:hover {
    background: rgba(255,255,255,0.5);
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-size: 15px;
    transition: color 0.3s;
}

.nav-link:hover,
.nav-link.active {
    color: white;
    font-weight: 500;
}

.scrolling-game-item:hover {
    color: white;
    transform: scale(1.05);
    font-weight: 500;
}

@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.search-input {
    flex: 1;
    padding: 8px 15px;
    border-radius: 20px 0 0 20px;
    border: none;
    outline: none;
    background: rgba(255,255,255,0.2);
    color: white;
    font-size: 14px;
}

.search-input::placeholder {
    color: rgba(255,255,255,0.7);
}

.search-btn {
    background: rgba(255,255,255,0.3);
    border: none;
    color: white;
    padding: 8px 15px;
    border-radius: 0 20px 20px 0;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

.search-btn:hover {
    background: rgba(255,255,255,0.5);
}

/* 轮播图 */
.carousel-section {
    background: white;
    padding: 20px 0;
}

.carousel {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 12px;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease;
}

.carousel-item {
    min-width: 100%;
    height: 400px;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.dot.active {
    background: white;
    width: 30px;
    border-radius: 5px;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.7);
    border: none;
    color: #333;
    font-size: 24px;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s;
}

.carousel-arrow:hover {
    background: white;
}

.carousel-arrow.prev {
    left: 20px;
}

.carousel-arrow.next {
    right: 20px;
}

/* 分类标签 */
.category-section {
    background: white;
    padding: 20px 0;
    margin-top: 10px;
}

.category-tabs {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.category-tab {
    padding: 10px 25px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.3s;
}

.category-tab:hover {
    border-color: #667eea;
    color: #667eea;
}

.category-tab.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: transparent;
}

/* 游戏区块 */
.games-section {
    padding: 40px 0;
}

.section-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.title-icon {
    font-size: 28px;
}

/* 游戏网格 */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.game-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s;
    cursor: pointer;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.game-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: #f0f0f0;
}

/* 懒加载图片样式 */
.game-img.lazy, .game-list-img.lazy {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.game-img.lazy.loaded, .game-list-img.lazy.loaded {
    opacity: 1;
}

.game-info {
    padding: 15px;
}

.game-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
}

.stars {
    color: #ffc107;
    font-size: 14px;
}

.rating-score {
    font-size: 13px;
    color: #666;
}

.game-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.tag {
    padding: 3px 8px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
}

.download-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: block;
    text-align: center;
    transition: all 0.3s;
}

.download-btn:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

/* 加载更多 */
.load-more {
    text-align: center;
    margin-top: 30px;
}

.btn-load-more {
    padding: 12px 40px;
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-load-more:hover {
    background: #667eea;
    color: white;
}

/* 加载更多评价 */
.load-more-reviews {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
}

/* 新上线游戏列表 */
.games-list {
    display: grid;
    gap: 15px;
}

.game-list-item {
    background: white;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    gap: 20px;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s;
}

.game-list-item:hover {
    transform: translateX(5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.game-list-img {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    object-fit: cover;
}

.game-list-info {
    flex: 1;
}

.game-list-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.game-list-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.game-list-meta {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #999;
}

/* 页脚 */
.footer {
    background: #2c3e50;
    color: white;
    padding: 40px 0 20px;
    margin-top: 40px;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-column h4 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #667eea;
}

.footer-column a {
    display: block;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    margin-bottom: 8px;
    font-size: 14px;
    transition: color 0.3s;
}

.footer-column a:hover {
    color: white;
}

.social-links {
    display: flex;
    gap: 10px;
}

.social-icon {
    padding: 8px 15px;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    font-size: 13px;
    transition: all 0.3s;
}

.social-icon:hover {
    background: #667eea;
}

.footer-copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 14px;
    color: rgba(255,255,255,0.6);
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    width: 100%;
    max-width: 400px;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #333;
}

.modal-content h2 {
    font-size: 24px;
    margin-bottom: 25px;
    text-align: center;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
}

.btn-submit {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-submit:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        flex-wrap: wrap;
        gap: 15px;
    }

    .nav-links {
        display: none;
    }

    .nav-search {
        order: 3;
        width: 100%;
        max-width: none;
    }

    .carousel-item {
        height: 200px;
    }

    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .game-list-item {
        flex-direction: column;
        text-align: center;
    }

    .game-list-meta {
        justify-content: center;
    }
    
    /* 移动端优化 */
    .container {
        padding: 0 15px;
    }
    
    .section-title {
        font-size: 20px;
    }
    
    .game-card {
        border-radius: 12px;
    }
    
    .game-img {
        height: 150px;
    }
    
    .download-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .btn-load-more {
        padding: 12px 30px;
        font-size: 15px;
    }
}

/* 平板设备 */
@media (max-width: 1024px) and (min-width: 769px) {
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 20px;
    }
}

/* 手机竖屏优化 */
@media (max-width: 480px) {
    .nav-container {
        gap: 10px;
    }
    
    .logo-text {
        font-size: 20px;
    }
    
    .logo-icon {
        font-size: 24px;
    }
    
    .carousel-item {
        height: 160px;
    }
    
    .carousel-title {
        font-size: 20px;
        padding: 0 15px;
    }
    
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .game-img {
        height: 130px;
    }
    
    .game-name {
        font-size: 13px;
    }
    
    .game-rating {
        font-size: 11px;
    }
    
    .tag {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    .category-tabs {
        gap: 8px;
        padding: 0 10px;
    }
    
    .category-tab {
        padding: 8px 15px;
        font-size: 13px;
    }
    
    .search-input {
        font-size: 14px;
    }
    
    .search-btn {
        font-size: 16px;
        padding: 8px 15px;
    }
}
