/* ==================== 全局样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-bg: #1a1a2e;
    --secondary-bg: #16213e;
    --accent: #e94560;
    --accent-hover: #ff6b6b;
    --text-primary: #eaeaea;
    --text-secondary: #a0a0a0;
    --highlight: #0f3460;
    --card-bg: #1f1f3a;
    --border-color: #2a2a4a;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

ul {
    list-style: none;
}

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

/* ==================== 导航栏 ==================== */
.navbar {
    background: var(--secondary-bg);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.navbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 700;
}

.logo-icon {
    font-size: 28px;
}

.logo-text {
    background: linear-gradient(135deg, var(--accent), #ff9a8b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-links a:hover,
.nav-links a.active {
    background: var(--accent);
    color: white;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--primary-bg);
    border-radius: 25px;
    padding: 5px 15px;
    border: 1px solid var(--border-color);
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 8px;
    width: 200px;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-secondary);
}

.search-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
}

/* ==================== 横幅区域 ==================== */
.hero {
    background: linear-gradient(135deg, var(--secondary-bg) 0%, var(--primary-bg) 100%);
    padding: 60px 0;
    text-align: center;
    border-bottom: 2px solid var(--accent);
}

.hero-content h1 {
    font-size: 48px;
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--text-primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content p {
    font-size: 18px;
    color: var(--text-secondary);
}

/* ==================== 主内容区 ==================== */
.main-content {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
    padding: 40px 20px;
}

/* ==================== 侧边栏 ==================== */
.sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.sidebar-section h3 {
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent);
}

.category-list li {
    margin-bottom: 10px;
}

.category-list a {
    display: block;
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    color: var(--text-secondary);
}

.category-list a:hover {
    background: var(--highlight);
    color: var(--text-primary);
    transform: translateX(5px);
}

/* ==================== 游戏列表 ==================== */
.games-section {
    flex: 1;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-header h2 {
    font-size: 28px;
}

.filter-tabs {
    display: flex;
    gap: 10px;
}

.filter-tab {
    padding: 8px 20px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-secondary);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-tab:hover,
.filter-tab.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

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

/* ==================== 游戏卡片 ==================== */
.game-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.game-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
    box-shadow: 0 10px 30px rgba(233, 69, 96, 0.2);
}

.game-card-image {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: var(--secondary-bg);
}

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

.game-card-image > div {
    width: 100%;
    height: 100%;
}

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

.game-card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.game-card-content {
    padding: 20px;
}

.game-card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-card-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.game-card-tag {
    background: var(--secondary-bg);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.game-card-desc {
    font-size: 14px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 15px;
}

.game-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-card-size {
    font-size: 13px;
    color: var(--text-secondary);
}

.download-btn {
    background: var(--accent);
    color: white;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.download-btn:hover {
    background: var(--accent-hover);
}

/* ==================== 分页 ==================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.pagination button {
    padding: 10px 15px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination button:hover,
.pagination button.active {
    background: var(--accent);
    border-color: var(--accent);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== 底部 ==================== */
.footer {
    background: var(--secondary-bg);
    padding: 30px 0;
    text-align: center;
    margin-top: 60px;
    border-top: 1px solid var(--border-color);
}

.footer p {
    color: var(--text-secondary);
    margin: 5px 0;
}

/* ==================== 游戏详情页 ==================== */
.game-detail {
    padding: 40px 0;
}

.game-detail-header {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.game-detail-cover {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, var(--secondary-bg), var(--highlight));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 100px;
    overflow: hidden;
}

.game-detail-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-detail-info h1 {
    font-size: 36px;
    margin-bottom: 20px;
}

.game-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.game-detail-meta span {
    background: var(--card-bg);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
}

.game-detail-desc {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 25px;
}

.game-detail-actions {
    display: flex;
    gap: 15px;
}

.game-detail-actions .download-btn {
    padding: 15px 40px;
    font-size: 16px;
}

/* ==================== 截图展示 ==================== */
.game-screenshots {
    margin-top: 40px;
}

.game-screenshots h2 {
    margin-bottom: 20px;
}

.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.screenshot-item {
    height: 200px;
    background: var(--card-bg);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.screenshot-item:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

/* ==================== 搜索页面 ==================== */
.search-results {
    padding: 40px 0;
}

.search-results h1 {
    margin-bottom: 30px;
}

.search-results .games-grid {
    margin-top: 20px;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.no-results h2 {
    margin-bottom: 15px;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .game-detail-header {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .navbar-content {
        flex-direction: column;
        gap: 15px;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .search-box {
        width: 100%;
    }

    .search-box input {
        width: 100%;
    }

    .hero-content h1 {
        font-size: 32px;
    }

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

    .section-header {
        flex-direction: column;
        gap: 15px;
    }

    .filter-tabs {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ==================== 加载动画 ==================== */
.loading {
    text-align: center;
    padding: 60px 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}