:root {
    --bg-body: #022c22;
    --bg-surface: #064e3b;
    --bg-elevated: #065f46;
    --bg-subtle: #047857;
    --text-heading: #ecfdf5;
    --text-body: #d1fae5;
    --text-meta: #a7f3d0;
    --text-disabled: #6ee7b7;
    --brand-primary: #34d399;
    --brand-secondary: #10b981;
    --brand-accent: #6ee7b7;
    --border-default: #065f46;
    --border-light: #047857;
    --elevation-1: 0 3px 8px rgba(52, 211, 153, 0.25);
    --elevation-2: 0 6px 16px rgba(52, 211, 153, 0.3);
    --elevation-3: 0 12px 32px rgba(52, 211, 153, 0.35);
}

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

body {
    font-family: 'Poppins', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-body);
    color: var(--text-body);
    line-height: 1.7;
}

a {
    text-decoration: none !important;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.navbar {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-default);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--elevation-1);
}

.navbar-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-heading);
    text-decoration: none !important;
}

.brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    justify-content: center;
}

.nav-link {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    color: var(--text-meta);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    text-decoration: none !important;
}

.nav-link:hover {
    background: var(--bg-subtle);
    color: var(--text-heading);
}

.nav-link.current {
    background: var(--bg-subtle);
    color: var(--brand-primary);
    font-weight: 600;
}

.search-wrapper {
    position: relative;
    width: 280px;
}

.search-input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    border: 1px solid var(--border-default);
    border-radius: 6px;
    font-size: 0.9rem;
    background: var(--bg-subtle);
    color: var(--text-body);
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--brand-primary);
    background: var(--bg-surface);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-disabled);
    font-size: 0.85rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.page-title-area {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-heading);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--text-meta);
    font-size: 0.95rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 1rem;
    margin-top: 2.5rem;
}

.section-title:first-of-type {
    margin-top: 0;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.75rem;
    margin-bottom: 3rem;
}

@media (max-width: 1400px) {
    .game-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .game-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

.game-tile {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.25s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    box-shadow: var(--elevation-1);
    text-decoration: none !important;
}

.game-tile:hover {
    transform: translateY(-3px);
    box-shadow: var(--elevation-3);
    border-color: var(--brand-primary);
}

.game-image {
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--bg-subtle);
    position: relative;
    overflow: hidden;
}

.game-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.game-tile:hover .game-image img {
    transform: scale(1.06);
}

.favorite-btn {
    position: absolute;
    top: 0.625rem;
    right: 0.625rem;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-disabled);
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.favorite-btn:hover {
    background: white;
    color: var(--brand-primary);
    transform: scale(1.1);
}

.favorite-btn.active {
    background: var(--brand-primary);
    color: white;
}

.game-info {
    padding: 0.875rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.game-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 0.625rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    text-decoration: none !important;
}

.game-meta {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-top: auto;
    font-size: 0.8rem;
}

.star-rating {
    color: var(--brand-accent);
    font-size: 0.75rem;
    letter-spacing: 1px;
}

.rating-num {
    color: var(--text-heading);
    font-weight: 600;
    font-size: 0.8rem;
}

.player-count {
    color: var(--text-meta);
    font-size: 0.75rem;
}

.footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-default);
    padding: 3rem 2rem 1.5rem;
    margin-top: 4rem;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2.5rem;
    margin-bottom: 2rem;
}

.footer-col h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 1rem;
}

.footer-col a {
    display: block;
    color: var(--text-meta);
    margin-bottom: 0.625rem;
    font-size: 0.9rem;
    transition: color 0.2s ease;
    text-decoration: none !important;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
    color: var(--text-disabled);
    font-size: 0.85rem;
}

.to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 42px;
    height: 42px;
    background: var(--brand-primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: var(--elevation-3);
    transition: all 0.2s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 999;
}

.to-top.show {
    opacity: 1;
    visibility: visible;
}

.to-top:hover {
    background: var(--brand-secondary);
    transform: translateY(-3px);
    box-shadow: var(--elevation-3);
}

.empty-state-inline {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: var(--elevation-1);
    min-height: 200px;
    justify-content: center;
}

.empty-icon-small {
    font-size: 2.5rem;
    color: var(--text-disabled);
    opacity: 0.5;
    margin-bottom: 1rem;
}

.empty-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.empty-title-small {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0;
}

.empty-text-small {
    font-size: 0.875rem;
    color: var(--text-meta);
    margin: 0;
}

.empty-action-small {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    background: var(--brand-primary);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    text-decoration: none !important;
    margin-top: 0.5rem;
}

.empty-action-small:hover {
    background: #ff5252;
    transform: translateY(-2px);
    box-shadow: var(--elevation-2);
}

@media (max-width: 1024px) {
    .navbar-content {
        padding: 0 1rem;
    }

    .nav-links {
        display: none;
    }

    .search-wrapper {
        width: 200px;
    }

    .container {
        padding: 1.5rem 1rem;
    }

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



    
    .section,
    .games-section {
        margin-bottom: 2rem !important;
    }
    
    .games-grid,
    .featured-grid {
        gap: 0.75rem !important;
    }
    
    .item-info,
    .game-card-content {
        padding: 0.875rem 0.75rem !important;
    }
    
    .section-title {
        margin-bottom: 0.75rem !important;
    }
}


/* ============================================
   移动端导航栏完整修复 (480px及以下)
   ============================================ */
@media (max-width: 480px) {
    /* 导航栏容器 */
    .top-nav,
    .nav-bar,
    .header,
    .site-header {
        padding: 0.5rem 0.75rem !important;
        min-height: 56px;
    }
    
    /* 导航栏包装器 - 关键修复 */
    .nav-wrapper,
    .header-container,
    .nav-content,
    .header-inner {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 0.5rem !important;
        flex-wrap: nowrap !important;
    }
    
    /* Logo和品牌 - 左侧 */
    .brand,
    .site-logo,
    .logo-wrapper,
    .brand-logo,
    .logo {
        display: flex !important;
        align-items: center !important;
        gap: 0.5rem !important;
        font-size: 0.875rem !important;
        font-weight: 600;
        flex: 0 1 auto !important;
        min-width: 0;
        max-width: calc(100% - 50px);
        overflow: hidden;
    }
    
    .brand span,
    .site-logo span,
    .logo-wrapper span,
    .brand-logo span,
    .logo span {
        font-size: 0.875rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .brand img,
    .site-logo img,
    .logo-wrapper img,
    .brand-logo img,
    .logo img {
        height: 28px !important;
        width: auto !important;
        flex-shrink: 0;
    }
    
    /* 搜索框 - 导航栏中隐藏 */
    .search-wrapper,
    .search-container,
    .search-box {
        display: none !important;
    }
    
    /* 导航菜单 - 隐藏 */
    .nav-menu,
    .nav-links,
    .site-nav,
    .nav-actions,
    nav > ul {
        display: none !important;
    }
    
    /* 移动菜单按钮 - 右侧显示 */
    .mobile-menu-btn,
    .mobile-menu-toggle,
    .menu-toggle {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        padding: 0 !important;
        margin: 0 !important;
        flex-shrink: 0 !important;
        background: transparent !important;
        border: none !important;
        cursor: pointer;
        z-index: 1001;
        order: 999;
    }
    
    .mobile-menu-btn span,
    .menu-toggle span {
        display: block;
        width: 22px;
        height: 2px;
        background: currentColor;
        margin: 3px 0;
        transition: all 0.3s;
    }
    
    /* 移动菜单中的搜索框 */
    .mobile-nav .search-wrapper,
    .mobile-nav .search-container,
    .mobile-menu .search-wrapper {
        display: flex !important;
        width: 100% !important;
        padding: 0.75rem 1rem !important;
        margin: 0 !important;
        border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.1)) !important;
        gap: 0.5rem !important;
        box-sizing: border-box !important;
    }
    
    .mobile-nav .search-input,
    .mobile-menu .search-input {
        flex: 1 !important;
        padding: 0.625rem 0.75rem !important;
        font-size: 14px !important;
        border-radius: 6px !important;
        border: 1px solid var(--border, rgba(255, 255, 255, 0.2)) !important;
        background: rgba(255, 255, 255, 0.1) !important;
        color: var(--text-main, #ffffff) !important;
        min-height: 44px !important;
        box-sizing: border-box !important;
    }
    
    .mobile-nav .search-btn,
    .mobile-menu .search-btn {
        padding: 0.625rem 1rem !important;
        min-width: 44px !important;
        min-height: 44px !important;
        flex-shrink: 0 !important;
    }
}

/* ============================================
   中等屏幕导航栏优化 (768px及以下)
   ============================================ */
@media (max-width: 768px) {
    .top-nav,
    .nav-bar,
    .header,
    .site-header {
        padding: 0.75rem 1rem;
    }
    
    .nav-wrapper,
    .header-container,
    .nav-content,
    .header-inner {
        padding: 0;
        gap: 1rem;
    }
    
    .brand,
    .site-logo,
    .logo-wrapper,
    .brand-logo,
    .logo {
        font-size: 1rem !important;
    }
    
    .brand img,
    .site-logo img,
    .logo-wrapper img,
    .brand-logo img,
    .logo img {
        height: 32px !important;
    }
    
    .search-wrapper,
    .search-container {
        max-width: 200px;
        flex: 0 1 auto;
    }
    
    .nav-menu,
    .nav-links,
    .site-nav {
        display: none;
    }
    
    .mobile-menu-btn,
    .menu-toggle {
        display: flex !important;
    }
}
