/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff3f3;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

a {
    text-decoration: none;
    color: #3498db;
}

h1, h2 {
    margin-bottom: 15px;
    font-weight: 600;
}

/* 头部样式 */
header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    width: 40px;
    height: 40px;
    margin-right: 10px;
}

/* 主要内容样式 */
main {
    padding: 30px 0;
}

/* 特色游戏样式 */
.featured-games {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
    margin-top: 30px; /* 增加与头部的间隔 */
}

.game-card-link {
    display: block;
    width: 100%;
}

.game-card {
    background-color: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
    position: relative;
}

.game-card:hover {
    transform: translateY(-5px);
}

.game-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #ff4d4d;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.game-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.game-title {
    padding: 10px;
    font-size: 18px;
    color: #1e90ff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-rating {
    display: flex;
    align-items: center;
    padding: 0 10px 10px;
}

.game-rating .stars {
    color: #ffc107;
    margin-left: 5px;
}

.game-stats {
    display: flex;
    padding: 0 10px 10px;
}

.game-stats .likes, .game-stats .plays {
    display: flex;
    align-items: center;
    margin-right: 20px;
}

/* 热门游戏样式 */
.hot-games, .boy-games {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.more-link {
    color: #333;
    font-weight: bold;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* 站点描述样式 */
.site-description {
    text-align: center;
    margin: 40px 0;
}

.site-description h2 {
    font-size: 24px;
    margin-bottom: 15px;
}

.site-description p {
    font-size: 16px;
    color: #555;
    max-width: 800px;
    margin: 0 auto;
}

/* 侧边栏样式 */
.sidebar {
    position: fixed;
    right: 0;
    top: 0;
    width: 300px;
    height: 100%;
    background-color: white;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s;
    z-index: 1000;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.sidebar-header h2 {
    font-size: 18px;
}

.close-sidebar {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

.search-box {
    padding: 15px;
}

.search-box form {
    display: flex;
}

.search-box input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
}

.search-box button {
    padding: 8px 15px;
    background-color: #ff7f50;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.categories {
    padding: 15px;
}

.categories h3 {
    margin-bottom: 15px;
    font-size: 18px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.category-item {
    background-color: #ff7f50;
    color: white;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    transition: background-color 0.3s;
}

.category-item:hover {
    background-color: #ff6347;
}

.toggle-sidebar {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #ff7f50;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 1001;
}

/* 页脚样式 */
footer {
    background-color: #fff;
    padding: 30px 0;
    margin-top: 40px;
}

.footer-links {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.footer-links a {
    color: #333;
}

.copyright {
    text-align: center;
    color: #777;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .featured-games, .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .footer-links {
        flex-direction: column;
    }

    .footer-links a {
        margin-bottom: 10px;
    }
}