/* General Styles */
:root {
    --primary-color: #00aaff;
    --secondary-color: #ff5500;
    --bg-dark: #1a1a1a;
    --bg-card: #222;
    --bg-light: #333;
    --text-light: #fff;
    --text-muted: #aaa;
    --border-color: #444;
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    --radius: 8px;
    --transition: all 0.2s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: #3bc0ff;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-light);
}

.btn-primary:hover {
    background-color: #0095e0;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--bg-light);
    color: var(--text-light);
}

.btn-secondary:hover {
    background-color: #444;
    transform: translateY(-2px);
}

.btn-icon {
    width: 16px;
    height: 16px;
    margin-right: 8px;
}

/* Header */
header {
    background-color: var(--bg-card);
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: bold;
}

.logo-text {
    color: var(--text-light);
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.search-box {
    display: flex;
    align-items: center;
    background-color: var(--bg-light);
    border-radius: 20px;
    padding: 5px 15px;
    width: clamp(160px, 30vw, 320px);
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text-light);
    padding: 8px 0;
    width: 100%;
    outline: none;
}

.search-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

.main-nav {
    overflow-x: scroll;
    -webkit-overflow-scrolling: touch;
}
.main-nav::-webkit-scrollbar {
    height: 0;  /* 横向滚动条高度设为 0 */
}
.nav-categories {
    list-style: none;
    display: flex;
    gap: 10px;
    padding-bottom: 5px;
}

.nav-categories li a {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.nav-categories li a:hover, 
.nav-categories li a.active {
    color: var(--text-light);
    background-color: var(--bg-light);
}

.nav-icon {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Main Content */
main {
    padding: 30px 0;
}

/* Hero Section */
.hero {
    display: flex;
    align-items: center;
    margin-bottom: 40px;
    background-color: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
}

.hero-content {
    flex: 1;
    padding: 40px;
}

.hero h1 {
    font-size: clamp(2rem, 4.5vw, 3.6rem);
    margin-bottom: 15px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.2em;
    color: var(--text-muted);
    margin-bottom: 25px;
}

.hero-image {
    flex: 1;
    height: 300px;
    overflow: hidden;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Game Sections */
.game-section {
    margin-bottom: 40px;
}

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

.section-header h2 {
    font-size: 1.8em;
    position: relative;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.view-all {
    color: var(--primary-color);
    font-weight: 500;
}

/* Game Grid */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.game-card {
     background-color: var(--bg-card);
     border-radius: var(--radius);
     overflow: hidden;
     box-shadow: var(--shadow);
     transition: var(--transition);
     position: relative;
     border: 1px solid var(--border-color);
 }
 
 .game-card:hover {
     transform: translateY(-5px);
     box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
     border-color: #555;
 }

.game-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.game-card .game-info {
    padding: 15px;
}

.game-card .game-title {
    margin: 0 0 5px;
    font-size: 1.1em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-card .game-category {
    color: var(--text-muted);
    font-size: 0.9em;
}

/* Game Page */
.game-page {
    background-color: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    padding: 20px;
}

.breadcrumbs {
    margin-bottom: 15px;
    color: var(--text-muted);
    font-size: 0.9em;
}

.breadcrumbs a {
    color: var(--text-muted);
}

.breadcrumbs a:hover {
    color: var(--primary-color);
}

.game-title-section {
    margin-bottom: 20px;
}

.game-title-section h1 {
    font-size: 2.2em;
    margin-bottom: 10px;
}

.game-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-muted);
}

.game-category {
    background-color: var(--bg-light);
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.9em;
}

.game-rating {
    display: flex;
    align-items: center;
}

.star-icon {
    width: 16px;
    height: 16px;
    fill: #ffbb00;
    margin-right: 2px;
}

.game-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 10px;
    margin-bottom: 3px;
}

.game-container {
    width: 100%;
    background-color: #000;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}

.game-placeholder {
    position: flex;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.7);
}

.play-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.play-button svg {
    width: 80px;
    height: 80px;
    fill: var(--primary-color);
    margin-bottom: 10px;
}

.play-button span {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--text-light);
}

.game-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.game-description, 
.game-controls,
.game-source {
    background-color: var(--bg-light);
    padding: 20px;
    border-radius: var(--radius);
}

.game-description h2,
.game-controls h2,
.game-source h2 {
    margin-bottom: 15px;
    font-size: 1.3em;
}

.controls-list {
    list-style: none;
}

.controls-list li {
    display: flex;
    margin-bottom: 10px;
    align-items: center;
}

.key {
    background-color: var(--bg-dark);
    color: var(--text-light);
    padding: 5px 10px;
    border-radius: 4px;
    margin-right: 10px;
    min-width: 60px;
    text-align: center;
    font-family: monospace;
    font-weight: bold;
}

.action {
    color: var(--text-muted);
}

.game-actions {
    display: flex;
    gap: 10px;
}

/* Footer */
footer {
    background-color: var(--bg-card);
    padding: 40px 0 20px;
    border-top: 1px solid var(--border-color);
}

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

.footer-logo h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.footer-logo p {
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 40px;
}

.footer-column h4 {
    margin-bottom: 15px;
    font-size: 1.1em;
}

.footer-column ul {
    list-style: none;
}

.footer-column li {
    margin-bottom: 8px;
}

.footer-column a {
    color: var(--text-muted);
}

.footer-column a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9em;
}

/* Responsive */
@media (max-width: 768px) {
    .hero {
        flex-direction: column;
    }
    
    .hero-content {
        padding: 30px;
    }
    
    .game-content {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 30px;
    }
}

/* Footer */
footer {
    background-color: #222;
    padding: 20px 0;
    text-align: center;
    border-top: 1px solid #333;
    margin-top: 40px;
}

/* Responsive Design */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
    }

    nav ul {
        margin-top: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }

    nav li {
        margin: 5px 10px;
    }

    .hero h1 {
        font-size: 2em;
    }

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

    .game-info h1 {
        font-size: 2em;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.8em;
    }

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

    .game-info h1 {
        font-size: 1.8em;
    }
}

/* Mobile menu toggle button */
.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-light);
    color: var(--text-light);
    cursor: pointer;
}
.menu-toggle svg {
    width: 20px;
    height: 20px;
}

@media (max-width: 768px) {
    .header-top {
        flex-wrap: wrap;
        gap: 10px;
    }
    .menu-toggle {
        display: inline-flex;
    }
    .main-nav {
        display: none;
    }
    .main-nav.is-open {
        display: block;
    }
    .nav-categories {
        flex-direction: column;
        gap: 6px;
        padding: 8px 0 12px;
    }
    .nav-categories li a {
        padding: 10px 12px;
    }
    #category-games {
      display: none;
    }
}