@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
:root {
    --color-bg-dark: #1a1a2e;
    --color-bg-light: #2c3251;
    --color-text-main: #e6e6f2;
    --color-text-secondary: #a8a29e;
    --color-accent: #ff6a6a;
    --color-glass-bg: rgba(255, 255, 255, 0.05);
    --color-glass-border: rgba(255, 255, 255, 0.1);
    --backdrop-blur: 15px;
    --shadow-subtle: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--color-bg-dark);
    color: var(--color-text-main);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.6;
    overflow-x: hidden;
    background: linear-gradient(135deg, #1a1a2e, #162447, #1f4068);
}

.main-wrapper {
    width: 100%;
    max-width: 1400px;
    padding: 2rem;
    box-sizing: border-box;
}

/* 玻璃拟态卡片样式 */
.glass-card {
    background: var(--color-glass-bg);
    border: 1px solid var(--color-glass-border);
    backdrop-filter: blur(var(--backdrop-blur));
    -webkit-backdrop-filter: blur(var(--backdrop-blur));
    border-radius: 20px;
    box-shadow: var(--shadow-subtle);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: transform 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
}

/* 导航栏 */
.site-header {
    display: flex;
    /* Update: Align items for better positioning with the search bar */
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    box-sizing: border-box;
    background: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background 0.3s ease;
}

.logo-link {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-accent);
    text-decoration: none;
    text-shadow: 0 0 5px rgba(255, 106, 106, 0.5);
    letter-spacing: -1px;
    flex-shrink: 0; /* Prevent logo from shrinking */
}

/* New: Search Form Styling */
.search-form {
    display: flex;
    flex-grow: 1; /* Allow it to take up space */
    max-width: 400px;
    margin: 0 2rem; /* Spacing between logo and nav links */
}

.search-input {
    flex-grow: 1;
    padding: 0.75rem 1.25rem;
    border: 1px solid var(--color-glass-border);
    background: var(--color-glass-bg);
    color: var(--color-text-main);
    border-radius: 50px 0 0 50px;
    outline: none;
    transition: border-color 0.3s ease, background 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.search-input::placeholder {
    color: var(--color-text-secondary);
    opacity: 0.7;
}

.search-input:focus {
    border-color: var(--color-accent);
    background: rgba(255, 255, 255, 0.1);
}

.search-button {
    padding: 0.75rem 1.5rem;
    background: var(--color-accent);
    color: var(--color-bg-dark);
    border: none;
    border-radius: 0 50px 50px 0;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.search-button:hover {
    background: #ff8b8b;
}


.nav-links {
    display: flex;
    gap: 2rem;
    flex-shrink: 0; /* Prevent nav links from shrinking */
}

.nav-link {
    color: var(--color-text-main);
    text-decoration: none;
    font-weight: 500;
    padding-bottom: 5px;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: var(--color-accent);
    transition: width 0.3s ease, left 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
    left: 0;
}

/* 英雄部分 */
.hero-section {
    padding-top: 10rem;
    padding-bottom: 4rem;
    text-align: center;
}

.hero-title {
    font-size: 4rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--color-text-secondary);
    margin-top: 1rem;
}

.cta-button {
    display: inline-block;
    margin-top: 2rem;
    padding: 0.8rem 2.5rem;
    background: var(--color-accent);
    color: var(--color-bg-dark);
    text-decoration: none;
    font-weight: 700;
    border-radius: 50px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 0 15px rgba(255, 106, 106, 0.5);
}

.cta-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(255, 106, 106, 0.8);
}

/* 游戏列表部分标题 */
.featured-games-section h2, .popular-games-section h2, .about-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
}

/* 可左右滑动列表样式 */
.games-scroller {
    display: flex;
    gap: 2rem;
    overflow-x: scroll;
    padding-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    cursor: grab;
}

.games-scroller::-webkit-scrollbar {
    display: none;
}

/* 新增的网格列表样式 */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.game-card-item {
    background: var(--color-glass-bg);
    border: 1px solid var(--color-glass-border);
    backdrop-filter: blur(var(--backdrop-blur));
    -webkit-backdrop-filter: blur(var(--backdrop-blur));
    border-radius: 15px;
    box-shadow: var(--shadow-subtle);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

/* 确保可滚动项的宽度以防止布局问题 */
.games-scroller .game-card-item {
    flex: 0 0 300px;
}

.game-card-item:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

.game-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.game-card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.game-card-content {
    padding: 1.5rem;
}

.game-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: var(--color-text-main);
}

.game-card-desc {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin: 0;
}

/* 关于我们部分 */
.about-section {
    text-align: center;
    margin: 20px auto;
}

.about-section p {
    color: var(--color-text-secondary);
}

/* 页脚 */
.site-footer {
    padding: 3rem;
    text-align: center;
    border-top: 1px solid var(--color-glass-border);
    margin-top: 4rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
}

.footer-link {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--color-accent);
}

.copyright-text {
    color: var(--color-text-secondary);
    font-size: 0.8rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .site-header {
        /* Changed to column layout for better mobile stacking */
        flex-direction: column;
        padding: 1rem;
        position: relative;
        background: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        gap: 1rem; /* Add some gap between elements */
    }

    .search-form {
        width: 100%; /* Full width on mobile */
        max-width: none;
        order: 3; /* Move search form to the bottom of the header */
        margin: 0;
    }

    .logo-link {
        order: 1; /* Keep logo at the top */
    }

    .nav-links {
        margin-top: 0;
        gap: 1rem;
        order: 2; /* Place nav links after the logo */
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-section {
        padding-top: 5rem;
    }

    .glass-card {
        padding: 1.5rem;
    }
}
a {
    text-decoration: none;
}