* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', sans-serif;
    background-color: #0f1923;
    color: #fff;
    line-height: 1.6;
}

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

/* 头部样式 */
header {
    background: linear-gradient(90deg, #0c1622 0%, #1a2a40 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-size: 28px;
    font-weight: 700;
    color: #4ecca3;
    text-decoration: none;
}

.logo span {
    color: #fff;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 30px;
}

nav ul li a {
    color: #e0e0e0;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: color 0.3s;
    padding: 8px 12px;
    border-radius: 4px;
}

nav ul li a:hover, nav ul li a.active {
    color: #4ecca3;
    background-color: rgba(78, 204, 163, 0.1);
}

.search-box {
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-box input {
    padding: 10px 15px;
    border: none;
    border-radius: 30px 0 0 30px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 250px;
}

.search-box button {
    padding: 10px 20px;
    border: none;
    border-radius: 0 30px 30px 0;
    background: #4ecca3;
    color: #000;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.search-box button:hover {
    background: #3da58a;
}

/* 主要内容区域 */
main {
    padding: 40px 0;
}

.page-title {
    font-size: 32px;
    margin-bottom: 30px;
    text-align: center;
    color: #4ecca3;
}

/* 首页样式 */
.hero {
    background: linear-gradient(rgba(15, 25, 35, 0.8), rgba(15, 25, 35, 0.9)), url('https://picsum.photos/1200/600?random=1');
    background-size: cover;
    background-position: center;
    border-radius: 10px;
    padding: 80px 40px;
    text-align: center;
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 20px;
    color: #fff;
}

.hero p {
    font-size: 20px;
    max-width: 700px;
    margin: 0 auto 30px;
    color: #e0e0e0;
}

.btn {
    display: inline-block;
    padding: 14px 32px;
    background: #4ecca3;
    color: #000;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 700;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.btn:hover {
    background: #3da58a;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.section-title {
    font-size: 28px;
    margin: 40px 0 20px;
    color: #4ecca3;
    position: relative;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    height: 3px;
    background: #4ecca3;
}

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

.game-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

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

.game-info {
    padding: 20px;
}

.game-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    overflow: hidden;
    font-size: 18px;
    margin-bottom: 10px;
    color: #fff;
}

.game-category {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(78, 204, 163, 0.2);
    color: #4ecca3;
    border-radius: 20px;
    font-size: 12px;
    margin-bottom: 15px;
}

.game-rating {
    color: #f8b400;
    margin-bottom: 15px;
}

.game-actions {
    display: flex;
    justify-content: space-between;
}

.game-actions a {
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.btn-primary {
    background: #4ecca3;
    color: #000;
}

.btn-secondary {
    background: transparent;
    color: #4ecca3;
    border: 1px solid #4ecca3;
}

/* 详情页样式 */
.game-detail {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.page-link {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    text-decoration: none;
    color: #e0e0e0;
    transition: all 0.3s ease;
}

.page-link:hover,
.page-link.active {
    background: #4ecca3;
    color: #000;
    border-color: #4ecca3;
}

@media (max-width: 768px) {
    .game-detail {
        grid-template-columns: 1fr;
    }

    .header-container {
        flex-direction: column;
        gap: 20px;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }

    nav ul li {
        margin: 5px 10px;
    }

    .search-box {
        width: 100%;
        max-width: 400px;
    }

    .hero {
        padding: 60px 20px;
    }

    .hero h1 {
        font-size: 36px;
    }

    .hero p {
        font-size: 18px;
    }

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

@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: 1fr;
    }

    .search-box input {
        width: 180px;
    }
}

/* 游戏内嵌页样式 */
.game-iframe-container {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* 4:3 宽高比 */
    height: 0;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.game-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}
