/* ============================================================
   top10.top - Steam 新游发布榜
   暗色游戏主题 - 现代化设计
   ============================================================ */

:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #131825;
    --bg-card: #1a2030;
    --bg-card-hover: #232b3d;
    --border: #2a3548;
    --text-primary: #e8edf5;
    --text-secondary: #8b95a8;
    --text-muted: #5a6478;
    --accent: #00d9ff;
    --accent-glow: rgba(0, 217, 255, 0.15);
    --accent-purple: #b366ff;
    --accent-green: #00ff9f;
    --accent-orange: #ff9f43;
    --accent-red: #ff4757;
    --gradient: linear-gradient(135deg, #00d9ff 0%, #b366ff 100%);
    --gradient-dark: linear-gradient(135deg, #0a0e17 0%, #131825 100%);
    --radius: 12px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px var(--accent-glow);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 背景装饰 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(0, 217, 255, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(179, 102, 255, 0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* ============================================================
   Header / Navigation
   ============================================================ */

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 14, 23, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

.logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--gradient);
    border-radius: 8px;
    color: #0a0e17;
    font-weight: 900;
    font-size: 0.85rem;
}

.logo-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    padding: 8px 0;
    position: relative;
}

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

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient);
    border-radius: 2px;
}

.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(0, 255, 159, 0.1);
    border: 1px solid rgba(0, 255, 159, 0.3);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--accent-green);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.ai-badge:hover {
    background: rgba(0, 255, 159, 0.2);
    border-color: rgba(0, 255, 159, 0.5);
}

.ai-badge-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-green);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ============================================================
   Hero Section
   ============================================================ */

.hero {
    padding: 60px 0 40px;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 30px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.hero-badge strong {
    color: var(--accent);
    font-weight: 600;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 16px;
    letter-spacing: -0.03em;
}

.hero-title .gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 32px;
}

.hero-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
}

.hero-meta-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.hero-meta-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.hero-meta-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================================
   Category Tabs
   ============================================================ */

.category-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 0 24px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.category-tabs::-webkit-scrollbar {
    height: 4px;
}

.category-tabs::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.category-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none;
}

.category-tab:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--accent);
}

.category-tab.active {
    background: var(--gradient);
    color: #0a0e17;
    font-weight: 600;
    border-color: transparent;
}

.category-tab .tab-current {
    font-size: 0.7rem;
    padding: 2px 6px;
    background: rgba(0, 255, 159, 0.2);
    color: var(--accent-green);
    border-radius: 4px;
}

.category-tab.active .tab-current {
    background: rgba(10, 14, 23, 0.2);
    color: #0a0e17;
}

/* ============================================================
   Section Header
   ============================================================ */

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

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
}

.section-title .week-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.section-actions {
    display: flex;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: var(--gradient);
    color: #0a0e17;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-ghost {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--accent);
}

/* ============================================================
   Game Card List - Top 10 Ranking
   ============================================================ */

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

.game-card {
    display: grid;
    grid-template-columns: 60px 184px 1fr auto;
    gap: 20px;
    align-items: center;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    overflow: hidden;
}

.game-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow), var(--shadow-glow);
}

.game-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
    font-weight: 800;
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-muted);
    transition: var(--transition);
}

.game-card:hover .game-rank {
    background: var(--gradient);
    color: #0a0e17;
}

.game-card[data-rank="1"] .game-rank { color: var(--accent-orange); background: rgba(255, 159, 67, 0.15); }
.game-card[data-rank="2"] .game-rank { color: var(--text-secondary); background: rgba(139, 149, 168, 0.15); }
.game-card[data-rank="3"] .game-rank { color: var(--accent-orange); background: rgba(255, 159, 67, 0.1); }

.game-image {
    width: 184px;
    height: 69px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-secondary);
    flex-shrink: 0;
}

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

.game-info {
    min-width: 0;
}

.game-name {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.game-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.game-tag {
    padding: 3px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.game-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    text-align: right;
}

.game-price {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-green);
}

.game-price.free {
    color: var(--accent-green);
}

.game-followers {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.game-release {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.game-platform {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: rgba(0, 217, 255, 0.1);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 6px;
    font-size: 0.7rem;
    color: var(--accent);
}

/* ============================================================
   Archive Grid
   ============================================================ */

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

.archive-card {
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.archive-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.archive-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.archive-week {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.archive-category {
    display: inline-flex;
    padding: 4px 12px;
    background: rgba(0, 217, 255, 0.1);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
}

.archive-top-game {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.archive-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.archive-game-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ============================================================
   Category Grid (for archive page)
   ============================================================ */

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

.category-card {
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.category-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.category-card-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.category-card-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.category-card-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ============================================================
   API Info Section
   ============================================================ */

.api-section {
    margin-top: 60px;
    padding: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.api-section h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.api-section p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.api-endpoints {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.api-endpoint {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
}

.api-method {
    padding: 2px 8px;
    background: rgba(0, 255, 159, 0.15);
    color: var(--accent-green);
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
}

.api-path {
    color: var(--text-primary);
}

.api-desc {
    color: var(--text-muted);
    margin-left: auto;
    font-size: 0.8rem;
}

/* ============================================================
   Footer
   ============================================================ */

.footer {
    margin-top: 80px;
    padding: 40px 0;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-info {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--accent);
}

/* ============================================================
   Loading & States
   ============================================================ */

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
    gap: 16px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.error {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 900px) {
    .game-card {
        grid-template-columns: 50px 1fr;
        grid-template-rows: auto auto;
        gap: 12px;
    }

    .game-image {
        width: 100%;
        height: 80px;
        grid-column: 1 / -1;
    }

    .game-meta {
        grid-column: 2;
        grid-row: 1;
        align-items: flex-end;
    }

    .game-rank {
        grid-column: 1;
        grid-row: 1;
    }

    .game-info {
        grid-column: 2;
        grid-row: 2;
    }
}

@media (max-width: 640px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-meta {
        gap: 20px;
    }

    .hero-meta-value {
        font-size: 1.2rem;
    }

    .nav-links {
        gap: 16px;
    }

    .nav-links a {
        font-size: 0.85rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .game-card {
        grid-template-columns: 40px 1fr;
        padding: 16px;
    }

    .game-rank {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }

    .game-name {
        font-size: 1rem;
    }

    .api-endpoint {
        flex-wrap: wrap;
    }

    .api-desc {
        width: 100%;
        margin-left: 0;
    }
}

/* ============================================================
   Animations
   ============================================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-card {
    animation: fadeInUp 0.4s ease-out backwards;
}

.game-card:nth-child(1) { animation-delay: 0.05s; }
.game-card:nth-child(2) { animation-delay: 0.1s; }
.game-card:nth-child(3) { animation-delay: 0.15s; }
.game-card:nth-child(4) { animation-delay: 0.2s; }
.game-card:nth-child(5) { animation-delay: 0.25s; }
.game-card:nth-child(6) { animation-delay: 0.3s; }
.game-card:nth-child(7) { animation-delay: 0.35s; }
.game-card:nth-child(8) { animation-delay: 0.4s; }
.game-card:nth-child(9) { animation-delay: 0.45s; }
.game-card:nth-child(10) { animation-delay: 0.5s; }
