/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    display: flex;
    background-color: #121212;
    color: #ffffff;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 250px;
    background-color: #1e1e1e;
    height: 100vh;
    position: fixed;
    transition: all 0.3s ease;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3);
    z-index: 100;
}

.sidebar.collapsed {
    width: 60px;
}

.logo-container {
    display: flex;
    align-items: center;
    padding: 20px 15px;
    border-bottom: 1px solid #2a2a2a;
}

.logo {
    width: 40px;
    height: 40px;
}

.logo-text {
    margin-left: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #ffffff;
}

.sidebar-toggle {
    position: absolute;
    top: 20px;
    right: 10px;
    cursor: pointer;
    font-size: 1.2rem;
    color: #aaaaaa;
}

.sidebar-nav {
    padding: 15px 0;
}

.category-header {
    padding: 10px 15px;
    color: #aaaaaa;
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-top: 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #ffffff;
    text-decoration: none;
    transition: background-color 0.2s;
}

.nav-item:hover {
    background-color: #2a2a2a;
}

.nav-item.active {
    background-color: #3a3a3a;
    border-left: 3px solid #4caf50;
}

.nav-item i {
    width: 24px;
    text-align: center;
    font-size: 1.1rem;
}

.nav-text {
    margin-left: 10px;
}

.sidebar.collapsed .nav-text,
.sidebar.collapsed .logo-text,
.sidebar.collapsed .category-header {
    display: none;
}

/* 主内容区样式 */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 20px;
    transition: margin-left 0.3s ease;
}

.main-content.expanded {
    margin-left: 60px;
}

/* 顶部导航栏样式 */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    margin-bottom: 20px;
}

.search-container {
    flex: 1;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 10px 15px;
    border-radius: 25px;
    border: none;
    background-color: #2a2a2a;
    color: #ffffff;
    font-size: 1rem;
    padding-right: 40px;
}

.search-button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #aaaaaa;
    cursor: pointer;
}

.language-selector {
    margin-left: 20px;
    position: relative;
    z-index: 200;
}

.language-button {
    padding: 8px 15px;
    background-color: #2a2a2a;
    border: none;
    border-radius: 15px;
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.language-button:hover {
    background-color: #3a3a3a;
}

.language-button i:first-child {
    margin-right: 2px;
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    background-color: #2a2a2a;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    overflow: hidden;
    display: none;
    margin-top: 5px;
    max-height: 400px;
    overflow-y: auto;
}

.language-dropdown.show {
    display: block;
}

.language-option {
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
}

.language-option:hover {
    background-color: #3a3a3a;
}

.language-option.active {
    background-color: rgba(74, 105, 189, 0.3);
    color: #4caf50;
}

.flag {
    margin-right: 10px;
    font-size: 1.2rem;
    display: inline-block;
    width: 24px;
    text-align: center;
}

/* 游戏分类区域样式 */
.category {
    padding: 20px 0;
    margin-bottom: 30px;
    scroll-margin-top: 80px; /* 为锚点导航提供顶部边距 */
    border-top: 1px solid #eee;
}

.category:first-child {
    border-top: none;
}

.category-title {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #ffffff;
    font-weight: 600;
    position: relative;
    padding-left: 15px;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(74, 105, 189, 0.5);
}

.category-title::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -2px;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background-color: #4a69bd;
    border-radius: 3px;
}

.category.active .category-title {
    color: #4caf50;
}

.category.active .category-title::before {
    background-color: #4caf50;
    width: 150px;
}

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

/* 游戏卡片样式 */
.game-card {
    background-color: #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.game-thumbnail {
    width: 100%;
    height: 150px;
    overflow: hidden;
}

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

.game-card:hover .game-thumbnail img {
    transform: scale(1.1);
}

.game-info {
    padding: 10px;
}

.game-title {
    font-size: 1rem;
    margin-bottom: 5px;
}

.game-tag {
    display: inline-block;
    background-color: #4caf50;
    color: #ffffff;
    font-size: 0.8rem;
    padding: 3px 8px;
    border-radius: 12px;
}

/* 加载动画样式 */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 0;
    color: #aaaaaa;
}

.loading i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #4caf50;
}

.loading p {
    font-size: 1.1rem;
}

/* 错误信息样式 */
.error-message {
    background-color: rgba(255, 0, 0, 0.1);
    border-left: 4px solid #ff3333;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
    color: #ff6666;
}

/* 搜索结果样式 */
.no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    background-color: #1e1e1e;
    border-radius: 8px;
    text-align: center;
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #aaaaaa;
}

.no-results p {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: #dddddd;
}

.reset-search {
    background-color: #4caf50;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.reset-search:hover {
    background-color: #45a049;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    
    .sidebar .nav-text,
    .sidebar .logo-text,
    .sidebar .category-header {
        display: none;
    }
    
    .main-content {
        margin-left: 60px;
    }
    
    .sidebar.expanded {
        width: 250px;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    }
    
    .sidebar.expanded .nav-text,
    .sidebar.expanded .logo-text,
    .sidebar.expanded .category-header {
        display: block;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* 游戏详情页全宽显示 */
.game-detail-page .main-content.full-width {
    margin-left: 0;
    width: 100%;
}

/* 增强的导航项样式 */
.nav-item.active {
    background-color: rgba(74, 105, 189, 0.15);
    border-left: 4px solid #4a69bd;
}

.nav-item[data-category]:hover {
    background-color: rgba(74, 105, 189, 0.1);
    border-left: 4px solid #4a69bd;
    transition: all 0.2s ease;
}

/* 增强的游戏卡片交互 */
.game-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* 搜索建议框样式 */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #2a2a2a;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 10;
    max-height: 300px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #333;
    transition: background-color 0.2s;
}

.suggestion-item:last-child {
    border-bottom: none;
    border-radius: 0 0 10px 10px;
}

.suggestion-item:hover {
    background-color: #3a3a3a;
}

.suggestion-thumbnail {
    width: 40px;
    height: 40px;
    border-radius: 5px;
    overflow: hidden;
    margin-right: 10px;
    flex-shrink: 0;
}

.suggestion-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.suggestion-info {
    flex: 1;
}

.suggestion-title {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 3px;
}

.suggestion-category {
    color: #aaaaaa;
    font-size: 0.8rem;
} 