/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #d066ea;
    --secondary-color: #a24b7c;
    --accent-color: #f093fb;
    --success-color: #10dc60;
    --warning-color: #ffce00;
    --error-color: #f04141;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --text-light: #ffffff;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-dark: #2c3e50;
    --border-color: #e9ecef;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.15);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #d066ea 0%, #a24b7c 100%);
    min-height: 100vh;
}

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

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo a {
    text-decoration: none;
    color: inherit;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    margin: 3px 0;
    transition: var(--transition);
    border-radius: 2px;
}

.back-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Main Content */
.main {
    flex: 1;
    padding: 2rem 0;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Categories Grid */
.categories {
    margin-bottom: 1rem;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 10px;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    /* background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); */
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: none;
    text-decoration: none;
    color: var(--text-primary);
    text-align: center;
}

.category-item:hover {
    transform: translateY(-5px);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.category-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f7ff9a, #9affcd);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.category-item:hover .category-circle {
    transform: scale(1.1);
    box-shadow: var(--shadow-hover);
}

.category-icon {
    font-size: 2rem;
    color: white;
    margin: 0;
}

.category-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    text-align: center;
    margin: 0;
    line-height: 1.2;
}

/* Games Grid */
/* .games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.game-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
} */

  .category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 每行3个 */
    gap: 10px; /* 宫格间距 */
  }

  .category-card {
    background: #f8f8f8;
    border-radius: 8px;
    text-align: center;
    padding: 10px;
    text-decoration: none;
    color: inherit;
    font-size: 14px;
  }


.game-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.game-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--bg-secondary);
    transition: var(--transition);
}



.game-content {
    padding: 1.5rem;
}

.game-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-align: center;
    color: #fff;
}

.game-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-category {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 1rem;
}

/* Game Detail Page */
.game-detail {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.game-hero {
    position: relative;
    height: 400px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.play-btn {
    background: linear-gradient(135deg, var(--success-color), #28a745);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow);
}

.play-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-hover);
}

.game-info {
    padding: 2rem;
}

.game-detail-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.game-detail-description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Category Header */
.category-header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.category-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.category-icon-large {
    font-size: 3rem;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    color: white;
    box-shadow: var(--shadow);
}

.category-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.category-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Section Titles */
.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Buttons */
.load-more {
    display: block;
    margin: 2rem auto;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-primary);
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.load-more:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Loading States */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: white;
    display: none;
}

.loading.show {
    display: flex;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

@keyframes loading {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Footer */
.footer {
    background: var(--bg-dark);
    color: var(--text-light);
    padding: 3rem 0 1rem;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

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

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
    opacity: 0.8;
}

.footer-section ul li a:hover {
    opacity: 1;
    color: var(--accent-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    text-align: center;
    opacity: 0.7;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-hover);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.close {
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.close:hover {
    color: var(--error-color);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(80vh - 100px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .categories-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.8rem;
        padding: 0 5px;
    }

    .category-circle {
        width: 50px;
        height: 50px;
    }

    .category-icon {
        font-size: 1.5rem;
    }

    .category-name {
        font-size: 0.7rem;
    }

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

    .game-content {
        padding: 1rem;
    }

    .category-info {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .category-title {
        font-size: 1.5rem;
    }

    .game-detail-title {
        font-size: 1.5rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .modal-content {
        width: 95%;
        margin: 20px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.5rem;
    }

    .category-circle {
        width: 45px;
        height: 45px;
    }

    .category-icon {
        font-size: 1.3rem;
    }

    .category-name {
        font-size: 0.65rem;
    }

    .games-grid {
        grid-template-columns: 1fr;
    }

    .game-hero {
        height: 300px;
    }

    .game-info {
        padding: 1.5rem;
    }

    .category-header {
        padding: 1.5rem;
    }
}
