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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}
ul li {
    list-style: none;
}   

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏样式 */
.navbar {
    background-color: #4a6fa5;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 20px;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

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

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

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

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

/* 搜索框样式 */
.search-container {
    margin: 2rem 0;
    text-align: center;
}

.search-box {
    display: inline-flex;
    max-width: 500px;
    width: 100%;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 25px 0 0 25px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    border-color: #4a6fa5;
}

.search-button {
    background-color: #4a6fa5;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 0 25px 25px 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-button:hover {
    background-color: #3a5a85;
}

/* 游戏网格样式 */
.games-section {
    padding: 2rem 0;
}

.games-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #4a6fa5;
    font-size: 2rem;
}

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

/* 游戏卡片样式 */
.game-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

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

.game-card-image {
    height: 200px;
    overflow: hidden;
}

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

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

.game-card h3 {
    padding: 1rem;
    text-align: center;
    font-size: 1.2rem;
    color: #333;
}

/* 游戏详情页样式 */
.game-detail {
    padding: 3rem 0;
}

.back-button {
    background-color: #4a6fa5;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    margin-bottom: 2rem;
    transition: background-color 0.3s ease;
}

.back-button:hover {
    background-color: #3a5a85;
}

.game-content {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

.game-image {
    flex: 0 0 400px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.game-image img {
    width: 100%;
    height: auto;
}

.game-info {
    flex: 1;
}

.game-info h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: #4a6fa5;
}

.game-info .description {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    color: #555;
}

.play-button {
    display: inline-block;
    background-color: #ff6b6b;
    color: white;
    padding: 15px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(255, 107, 107, 0.3);
}

.play-button:hover {
    background-color: #ff5252;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(255, 107, 107, 0.4);
}

/* 相关游戏推荐 */
.related-games {
    padding: 3rem 0;
    background-color: #f0f4f8;
}

.related-games h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #4a6fa5;
    font-size: 1.8rem;
}

/* 页脚样式 */
.footer {
    background-color: #333;
    color: white;
    padding: 3rem 0 1rem;
}

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

.footer-logo {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

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

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

.footer-links a:hover {
    color: white;
}

.footer-contact p {
    margin-bottom: 0.5rem;
}

.footer-bottom {
    border-top: 1px solid #555;
    padding-top: 1rem;
    text-align: center;
    color: #ccc;
}

/* 关于我们、联系我们等页面样式 */
.page-content {
    padding: 3rem 0;
}

.page-content h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #4a6fa5;
}

.page-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: #555;
}

/* 移动端响应式设计 */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nav-links {
        margin-top: 1rem;
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
        display: none;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .menu-toggle {
        display: block;
        background: none;
        border: none;
        color: white;
        font-size: 1.5rem;
        cursor: pointer;
        position: absolute;
        right: 20px;
        top: 20px;
    }
    
    .game-content {
        flex-direction: column;
    }
    
    .game-image {
        flex: 0 0 auto;
        width: 100%;
    }
    
    .footer-content {
        flex-direction: column;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .game-card-image {
        height: 150px;
    }
    .game-info h1{
        word-break: break-all
    }
}

/* 加载动画 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4a6fa5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 过渡动画 */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
