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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

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

/* Top Header */
.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    height: 60px;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header-left {
    flex-shrink: 0;
}

.site-title {
    font-size: 1.4em;
    font-weight: 600;
    color: #1a1a1a;
}

.header-center {
    display: flex;
    gap: 8px;
}

.nav-btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.95em;
    color: #666;
    transition: all 0.3s;
}

.nav-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.nav-btn.active {
    background: #007bff;
    color: #fff;
}

.header-right {
    flex-shrink: 0;
}

.search-box-header {
    display: flex;
    gap: 8px;
}

.search-box-header input {
    padding: 10px 16px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    background: #fff;
    color: #333;
    font-size: 0.9em;
    width: 200px;
    transition: border-color 0.3s;
}

.search-box-header input:focus {
    outline: none;
    border-color: #007bff;
}

.search-box-header input::placeholder {
    color: #999;
}

.search-box-header button {
    padding: 10px 20px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s;
}

.search-box-header button:hover {
    background: #0056b3;
}

/* Main Container */
.main-container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    gap: 20px;
}

/* Left Sidebar */
.left-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.sidebar-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e9ecef;
}

.platform-section {
    margin-bottom: 16px;
}

.platform-section-title {
    font-size: 0.85em;
    color: #888;
    margin-bottom: 8px;
    padding-left: 4px;
}

.latest-game-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.latest-game-item:hover {
    background: #e9ecef;
    transform: translateX(4px);
}

.game-thumb {
    width: 50px;
    height: 50px;
    object-fit: contain;
    background: #f5f5f5;
    border-radius: 4px;
    flex-shrink: 0;
}

.game-info-mini {
    flex: 1;
    min-width: 0;
}

.game-title-mini {
    font-size: 0.85em;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.game-price-mini {
    font-size: 0.9em;
    font-weight: 600;
    color: #dc3545;
}

/* Main Content */
.main-content {
    flex: 1;
    min-width: 0;
}

/* Announcement */
.announcement {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 24px 32px;
    margin-bottom: 20px;
}

.announcement h2 {
    font-size: 1.8em;
    color: #fff;
    margin-bottom: 12px;
}

.announcement p {
    color: #ccc;
    font-size: 1em;
}

/* Platform Stats */
.platform-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.stat-item {
    flex: 1;
    background: #fff;
    border-radius: 12px;
    padding: 24px 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.stat-number {
    font-size: 3em;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.95em;
    color: #666;
}

/* Hot Games */
.hot-games {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.section-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 16px;
}

.hot-games-content {
    min-height: 200px;
}

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

.hot-games-grid .game-card {
    min-height: 280px;
}

.hot-games-grid .game-cover {
    height: 140px;
}

.hot-games-grid .game-title {
    font-size: 0.95em;
}

.hot-games-grid .game-info {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #fff;
    padding: 32px;
    border-radius: 16px;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover {
    color: #333;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #1a1a1a;
}

#priceChart {
    max-height: 400px;
}

.chart-filter {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.time-btn {
    padding: 10px 20px;
    border: 2px solid #007bff;
    background: transparent;
    color: #007bff;
    border-radius: 8px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s;
}

.time-btn:hover {
    background: #e7f1ff;
}

.time-btn.active {
    background: #007bff;
    color: #fff;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-size: 1em;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f5f5f5;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Games Grid - PC (多列网格布局) */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.game-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.game-cover {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: #f5f5f5;
    padding: 10px;
}

.game-info {
    padding: 16px;
}

.game-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
    line-height: 1.4;
}

.game-genres {
    font-size: 0.85em;
    color: #888;
    margin-bottom: 12px;
}

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

.game-price {
    font-size: 1.3em;
    font-weight: 700;
    color: #dc3545;
}

.game-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.game-metacritic {
    font-size: 0.9em;
    color: #666;
}

.metacritic-badge {
    background: #1a1a1a;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
}

.preview-btn {
    background: #007bff;
    color: #fff;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preview-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.preview-btn:active {
    transform: translateY(0);
}

/* Filter Section (用于游戏列表页) */
.filter-section {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.search-box input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: #007bff;
}

.btn-search {
    padding: 12px 32px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-search:hover {
    background: #0056b3;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-item label {
    color: #666;
    font-size: 0.95em;
}

.filter-item select {
    padding: 10px 16px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.95em;
    background: #fff;
    cursor: pointer;
    min-width: 160px;
}

.filter-item select:focus {
    outline: none;
    border-color: #007bff;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    color: #666;
    font-size: 0.95em;
}

.page-info {
    color: #007bff;
    font-weight: 500;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
}

.pagination button {
    padding: 12px 28px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    cursor: pointer;
    transition: background 0.3s;
}

.pagination button:hover:not(:disabled) {
    background: #0056b3;
}

.pagination button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

#pageIndicator {
    color: #666;
    font-size: 0.95em;
}

/* Page Header (用于游戏列表页) */
.page-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e9ecef;
}

.back-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    background: #e7f1ff;
    transition: background 0.3s;
}

.back-link:hover {
    background: #d4e5ff;
}

.page-header h1 {
    font-size: 1.8em;
    color: #1a1a1a;
}

/* Platform Container (用于游戏列表页) */
.platform-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 30px;
}

/* Platform Page Title */
.platform-page-title {
    font-size: 1.5em;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e9ecef;
}

/* Search Result Page */
.search-result-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 30px;
}

.search-keyword-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e9ecef;
}

.search-label {
    font-size: 1em;
    color: #666;
}

.search-keyword {
    font-size: 1.3em;
    font-weight: 600;
    color: #007bff;
}

.platform-filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.platform-filter-btn {
    padding: 12px 24px;
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.95em;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
}

.platform-filter-btn:hover {
    border-color: #007bff;
    color: #007bff;
}

.platform-filter-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: #fff;
}

/* Mobile Styles */
@media (max-width: 1024px) {
    .main-container {
        flex-direction: column;
    }

    .left-sidebar {
        width: 100%;
        max-height: 300px;
    }

    .platform-stats {
        flex-wrap: wrap;
    }

    .stat-item {
        flex: 1 1 45%;
    }
}

@media (max-width: 768px) {
    .top-header {
        flex-direction: column;
        height: auto;
        padding: 16px;
        gap: 12px;
    }

    .header-center {
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-btn {
        padding: 8px 14px;
        font-size: 0.85em;
    }

    .header-right {
        width: 100%;
    }

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

    .search-box-header input {
        flex: 1;
        width: auto;
    }

    .main-container {
        padding: 12px;
    }

    .announcement {
        padding: 16px 20px;
    }

    .announcement h2 {
        font-size: 1.4em;
    }

    .stat-number {
        font-size: 2.2em;
    }

    .stat-item {
        padding: 16px 12px;
    }

    .platform-filter-bar {
        gap: 8px;
    }

    .platform-filter-btn {
        padding: 10px 16px;
        font-size: 0.85em;
        flex: 1 1 40%;
    }

    .search-keyword-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .search-keyword {
        font-size: 1.2em;
    }

    /* 移动端游戏卡片单列布局 */
    .games-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .game-card {
        display: flex;
        flex-direction: row;
        overflow: hidden;
    }

    .game-cover {
        width: 120px;
        height: auto;
        min-height: 140px;
        flex-shrink: 0;
    }

    .game-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 12px 16px;
    }

    .game-title {
        font-size: 1em;
        margin-bottom: 6px;
    }

    .game-genres {
        font-size: 0.8em;
        margin-bottom: 8px;
    }

    .game-footer {
        margin-top: auto;
    }

    .game-price {
        font-size: 1.1em;
    }

    .filter-section {
        padding: 16px;
    }

    .search-box {
        flex-direction: column;
    }

    .filter-row {
        flex-direction: column;
        gap: 16px;
    }

    .filter-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .filter-item select {
        width: 100%;
    }

    .stats-bar {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .pagination {
        flex-direction: column;
        gap: 12px;
    }

    .pagination button {
        width: 100%;
        max-width: 200px;
    }

    .modal-content {
        padding: 20px;
        margin: 16px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .page-header h1 {
        font-size: 1.4em;
    }

    .search-result-container {
        padding: 16px;
    }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #888;
    grid-column: 1 / -1;
}

.empty-state h3 {
    font-size: 1.2em;
    margin-bottom: 8px;
    color: #666;
}

/* Game Detail Page */
.game-detail-container {
    display: flex;
    gap: 32px;
    padding: 32px;
    max-width: 1400px;
    margin: 0 auto;
}

.game-detail-left {
    flex: 0 0 400px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.game-detail-cover {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    object-fit: cover;
}

.game-detail-info {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.game-detail-title {
    font-size: 1.6em;
    margin-bottom: 20px;
    color: #333;
    line-height: 1.4;
}

.game-detail-meta {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-label {
    font-weight: 600;
    color: #666;
    min-width: 80px;
}

.meta-value {
    color: #333;
}

.metacritic-score {
    background: #1a1a1a;
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 600;
}

.game-detail-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.price-section {
    background: #fff;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    text-align: center;
}

.current-price {
    margin-bottom: 16px;
}

.price-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 8px;
}

.price-value {
    font-size: 3em;
    font-weight: 700;
    color: #dc3545;
}

.last-update {
    color: #888;
    font-size: 0.85em;
}

.chart-section {
    background: #fff;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    flex: 1;
}

.chart-title {
    font-size: 1.3em;
    margin-bottom: 20px;
    color: #333;
}

.chart-filter {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.time-btn {
    background: #f0f0f0;
    color: #333;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.time-btn:hover {
    background: #e0e0e0;
}

.time-btn.active {
    background: #007bff;
    color: #fff;
}

.chart-container {
    position: relative;
    height: 400px;
}

.no-data {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

@media (max-width: 1024px) {
    .game-detail-container {
        flex-direction: column;
        padding: 20px;
    }

    .game-detail-left {
        flex: none;
        width: 100%;
    }

    .game-detail-right {
        flex: none;
        width: 100%;
    }

    .chart-container {
        height: 300px;
    }
}
