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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏 */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 3000;
    backdrop-filter: blur(10px);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
    text-decoration: none;
    transition: all 0.3s ease;
}

.logo:hover {
    color: #764ba2;
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    list-style: none;
}

.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    color: #667eea;
    transition: background 0.2s ease;
}

.menu-toggle:hover {
    background: rgba(102, 126, 234, 0.1);
}

.nav-links li {
    margin-left: 20px;
}

.nav-links a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #667eea;
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: #667eea;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Mobile nav overlay & drawer */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.6);
    display: none;
    z-index: 2500;
}

.mobile-drawer {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    max-width: 100%;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
    padding: 16px;
    display: none;
    z-index: 2600;
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.drawer-title {
    font-weight: 700;
    color: #374151;
}

.drawer-close {
    background: transparent;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
    color: #374151;
    padding: 6px 8px;
    border-radius: 8px;
}

.drawer-close:hover {
    background: rgba(0, 0, 0, 0.05);
}

.drawer-links {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 12px 16px;
    margin: 0;
    padding: 0;
}

.drawer-links a {
    display: block;
    text-align: center;
    padding: 12px 10px;
    border-radius: 10px;
    background: #f7f7fb;
    color: #374151;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
}

.drawer-links a:hover {
    background: #e5e7eb;
}

/* 首页游戏网格 */
.game-section {
    padding: 40px 0;
    flex: 1;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: white;
    margin-bottom: 40px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 30px;
}

.empty-state {
    grid-column: 1 / -1;
    background: #ffffff;
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    color: #666;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    font-size: 1.05rem;
}

.game-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.game-card img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.game-card:hover img {
    transform: scale(1.05);
}

.game-card h3 {
    padding: 20px;
    text-align: center;
    font-size: 1.2rem;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 筛选条 */
.filters {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.filters input[type="search"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filters input[type="search"]:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #374151;
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.category-chip:hover {
    background: #e5e7eb;
}

.category-chip.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-color: rgba(102, 126, 234, 0.4);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.clear-btn {
    justify-self: start;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    background: #f59e0b;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    opacity: 0.95;
}

.clear-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(245, 158, 11, 0.3);
    opacity: 1;
}

/* 游戏详情页 */
.game-detail {
    padding: 40px 0;
}

.back-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

.back-btn:hover {
    background: white;
    transform: translateX(-5px);
}

.game-info {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.game-image {
    flex: 1;
    min-width: 300px;
}

.game-image img {
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.game-content {
    flex: 2;
    min-width: 300px;
}

.game-content h1 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 20px;
}

.game-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 30px;
    color: #666;
}

.play-btn {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.play-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.6);
}

.related-games {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.related-games h2 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 30px;
    text-align: center;
}

/* 页脚 */
.footer {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px 0;
    margin-top: 60px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 30px;
}

.footer-info h3 {
    font-size: 1.5rem;
    color: #667eea;
    margin-bottom: 10px;
}

.footer-info p {
    color: #666;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #667eea;
}

.footer-bottom {
    border-top: 1px solid #eee;
    padding-top: 20px;
    text-align: center;
    color: #666;
}

/* 关于、联系、隐私、条款页面 */
.page-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin: 40px 0;
}

.page-content h1 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 30px;
    text-align: center;
}

.page-content h2 {
    font-size: 1.8rem;
    color: #667eea;
    margin: 30px 0 15px;
}

.page-content p {
    margin-bottom: 20px;
    line-height: 1.8;
    color: #666;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar .container {
        /* flex-direction: column; */
        padding: 10px 20px;
    }
    
    .menu-toggle {
        display: block;
        align-self: flex-end;
    }

    .nav-links {
        display: none;
        margin: 0;
        padding: 0;
    }

    body.nav-open {
        overflow: hidden;
    }

    body.nav-open .nav-overlay {
        display: block;
    }

    body.nav-open .mobile-drawer {
        display: block;
    }

    body.nav-open .nav-links {
        display: none !important;
    }

    body.nav-open .nav-links {
        display: grid;
        grid-template-columns: repeat(2, minmax(140px, 1fr));
        grid-auto-rows: minmax(44px, auto);
        position: fixed;
        inset: 0;
        background: rgba(255, 255, 255, 0.98);
        padding: 80px 24px 24px;
        gap: 12px 16px;
        z-index: 2000;
        align-content: start;
    }
    
    .filters {
        grid-template-columns: 1fr;
    }
    
    .nav-links li {
        margin: 0;
    }
    
    body.nav-open .nav-links a {
        display: block;
        text-align: center;
        border-radius: 10px;
        background: #f7f7fb;
    }
    
    .game-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .game-info {
        flex-direction: column;
    }
    
    .game-content h1 {
        font-size: 2rem;
    }
    .game-card img{
        height: 150px;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .page-content {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 2rem;
    }
    
    .game-card h3 {
        font-size: 1rem;
        padding: 15px;
    }
    .game-card img{
        height: 130px;
    }
    
    .game-content h1 {
        font-size: 1.8rem;
    }
    
    .play-btn {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
}
