/* 全局样式 */
:root {
    --primary-color: #ff4d4d;
    --secondary-color: #ff9900;
    --background-color: #800000;
    --text-color: #ffffff;
    --card-bg-color: rgba(0, 0, 0, 0.3);
    --sidebar-bg-color: rgba(0, 0, 0, 0.2);
    --header-height: 60px;
    --sidebar-width: 250px;
    --border-radius: 8px;
    --transition-speed: 0.3s;
}

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

body {
    font-family: 'Arial', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

/* 头部样式 */
.header {
    background-color: var(--background-color);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-color);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    margin-right: 1rem;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 5px 0;
    transition: var(--transition-speed);
}

.nav {
    display: flex;
    align-items: center;
}

.nav-link {
    margin-left: 1.5rem;
    font-weight: bold;
    transition: color var(--transition-speed);
}

.nav-link:hover {
    color: var(--secondary-color);
}

.header-right {
    display: flex;
    align-items: center;
}

.search-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color var(--transition-speed);
}

.search-btn:hover {
    color: var(--secondary-color);
}

/* 搜索栏样式 */
.search-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: var(--background-color);
    z-index: 200;
    transform: translateY(-100%);
    transition: transform var(--transition-speed);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.search-container.active {
    transform: translateY(0);
}

.search-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    height: 100%;
    display: flex;
    align-items: center;
}

.search-input {
    flex: 1;
    height: 40px;
    padding: 0 1rem;
    border: none;
    border-radius: var(--border-radius);
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    font-size: 1rem;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-close {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: 1rem;
    transition: color var(--transition-speed);
}

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

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    flex: 1;
}

/* 侧边栏样式 */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-right: 1rem;
    overflow-y: auto;
    max-height: calc(100vh - var(--header-height) - 2rem);
    position: sticky;
    top: calc(var(--header-height) + 1rem);
}

.sidebar-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h3 {
    font-size: 1.2rem;
    color: var(--text-color);
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background-color: rgba(0, 0, 0, 0.2);
    border: none;
    border-radius: var(--border-radius);
    color: var(--text-color);
    cursor: pointer;
    transition: background-color var(--transition-speed);
    text-align: left;
    font-size: 0.9rem;
}

.category-btn:hover {
    background-color: rgba(0, 0, 0, 0.4);
}

.category-btn.active {
    background-color: var(--primary-color);
}

.category-count {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    font-size: 0.8rem;
}

/* 主内容区域样式 */
.main-content {
    flex: 1;
    padding: 1rem;
    background-color: var(--sidebar-bg-color);
    border-radius: var(--border-radius);
}

.welcome-section {
    margin-bottom: 2rem;
    text-align: center;
}

.welcome-section h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.welcome-section p {
    color: rgba(255, 255, 255, 0.8);
    max-width: 800px;
    margin: 0 auto;
}

/* 游戏网格样式 */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.game-card {
    background-color: var(--card-bg-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: transform var(--transition-speed);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

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

.game-image {
    height: 150px;
    background-color: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    font-weight: bold;
    overflow: hidden;
}

.game-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-weight: bold;
    text-align: center;
    padding: 1rem;
}

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

.game-name {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.game-description {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
    flex: 1;
}

.game-category {
    font-size: 0.8rem;
    color: var(--secondary-color);
    background-color: rgba(0, 0, 0, 0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    align-self: flex-start;
}

/* 游戏分类样式 */
.games-section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

/* 底部样式 */
.footer {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 2rem 0;
    margin-top: 2rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-logo {
    margin-bottom: 1.5rem;
    text-align: center;
}

.footer-logo h2 {
    font-size: 1.5rem;
    color: var(--text-color);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.footer-link {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    transition: color var(--transition-speed);
}

.footer-link:hover {
    color: var(--text-color);
}

.footer-copyright {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    text-align: center;
}

/* 移动端侧边栏覆盖层 */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 90;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}

/* 无游戏提示 */
.no-games {
    text-align: center;
    padding: 3rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.2rem;
}

/* Logo样式 */
.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-image {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: contain;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-logo .logo-image {
    width: 32px;
    height: 32px;
}

/* 分类图标样式 */
.category-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    margin-right: 0.5rem;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.category-btn:hover .category-icon,
.category-btn.active .category-icon {
    opacity: 1;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .logo-image {
        width: 32px;
        height: 32px;
    }
    
    .footer-logo .logo-image {
        width: 28px;
        height: 28px;
    }
    
    .category-icon {
        width: 18px;
        height: 18px;
    }
}

/* 响应式样式 */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        margin-right: 0;
        margin-bottom: 1rem;
        position: fixed;
        top: var(--header-height);
        left: -100%;
        height: calc(100vh - var(--header-height));
        max-height: none;
        z-index: 100;
        transition: left var(--transition-speed);
        border-radius: 0;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .footer-links {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
}

