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

:root {
    --bg-0: #0a0a0f;
    --bg-1: #12121a;
    --bg-2: #1a1a26;
    --bg-3: #242436;
    --border: #2a2a3e;
    --text-1: #f0f0f5;
    --text-2: #9898b0;
    --text-3: #606078;
    --green: #4ade80;
    --blue: #60a5fa;
    --yellow: #fbbf24;
    --red: #f87171;
    --purple: #a78bfa;
    --orange: #fb923c;
    --cyan: #22d3ee;
    --pink: #f472b6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-0);
    color: var(--text-1);
    line-height: 1.6;
    min-height: 100vh;
}

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

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 80px;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 32px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.logo-text {
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(135deg, #4ade80, #22d3ee);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    gap: 4px;
    flex: 1;
}

.nav-link {
    padding: 8px 16px;
    color: var(--text-2);
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--text-1);
    background: var(--bg-3);
}

.nav-link.active {
    color: var(--green);
    background: rgba(74, 222, 128, 0.08);
}

.header-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 14px;
    flex-shrink: 0;
}

.header-search input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-1);
    font-size: 13px;
    width: 160px;
    font-family: inherit;
}

.header-search input::placeholder {
    color: var(--text-3);
}

.category-bar {
    background: var(--bg-1);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.category-bar::-webkit-scrollbar {
    height: 0;
}

.category-bar-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 80px;
    display: flex;
    gap: 6px;
    height: 46px;
    align-items: center;
}

.cat-tag {
    padding: 6px 16px;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    border-radius: 20px;
    white-space: nowrap;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.cat-tag:hover {
    color: var(--text-1);
    background: var(--bg-3);
}

.cat-tag.active {
    color: var(--green);
    background: rgba(74, 222, 128, 0.1);
    border-color: rgba(74, 222, 128, 0.25);
}

.main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 80px;
}

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

.section-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-1);
}

.see-all {
    color: var(--green);
    font-size: 13px;
    font-weight: 600;
    transition: opacity 0.2s;
}

.see-all:hover {
    opacity: 0.8;
}

.featured-section {
    margin-bottom: 48px;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.featured-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.25s;
    cursor: pointer;
}

.featured-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.featured-card:hover {
    border-color: var(--text-3);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.game-thumb {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.thumb-icon {
    opacity: 0.9;
    transition: transform 0.3s;
}

.thumb-image {
    width: 48px;
    height: 48px;
    object-fit: contain;
    opacity: 0.9;
    transition: transform 0.3s;
}

.featured-card:hover .thumb-icon,
.featured-card:hover .thumb-image {
    transform: scale(1.1);
}

.thumb-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--green);
    color: var(--bg-0);
}

.thumb-badge.hot {
    background: var(--red);
}

.featured-info {
    padding: 14px;
}

.featured-info h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-1);
}

.featured-info p {
    font-size: 12px;
    color: var(--text-2);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.leaderboard-section {
    margin-bottom: 48px;
}

.leaderboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.lb-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: all 0.2s;
    cursor: pointer;
}

.lb-card:hover {
    background: var(--bg-3);
    border-color: var(--text-3);
}

.lb-card.rank-1 {
    border-color: rgba(251, 191, 36, 0.3);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.05), var(--bg-2));
}

.lb-card.rank-2 {
    border-color: rgba(148, 163, 184, 0.3);
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.05), var(--bg-2));
}

.lb-card.rank-3 {
    border-color: rgba(180, 83, 9, 0.3);
    background: linear-gradient(135deg, rgba(180, 83, 9, 0.05), var(--bg-2));
}

.lb-rank {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-3);
    min-width: 32px;
    text-align: center;
}

.rank-1 .lb-rank { color: #fbbf24; }
.rank-2 .lb-rank { color: #94a3b8; }
.rank-3 .lb-rank { color: #b45309; }

.lb-thumb {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.lb-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-1);
}

.lb-score {
    font-size: 12px;
    color: var(--text-2);
}

.lb-trend {
    font-size: 12px;
    font-weight: 700;
}

.lb-trend.up { color: var(--green); }
.lb-trend.down { color: var(--red); }
.lb-trend.same { color: var(--text-3); }

.categories-section {
    margin-bottom: 48px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.category-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.25s;
    cursor: pointer;
}

.category-card:hover {
    border-color: var(--text-3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.cat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.category-card h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-1);
    margin-bottom: 4px;
}

.category-card > span {
    font-size: 12px;
    color: var(--text-3);
}

.cat-games {
    display: flex;
    gap: 6px;
    margin-top: 14px;
}

.cat-game-dot {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    transition: transform 0.2s;
}

.category-card:hover .cat-game-dot {
    transform: scale(1.1);
}

.guides-section {
    margin-bottom: 48px;
}

.guides-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.guide-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.25s;
}

.guide-card:hover {
    border-color: var(--text-3);
}

.guide-icon {
    margin-bottom: 16px;
}

.guide-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-1);
    margin-bottom: 8px;
}

.guide-card p {
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.6;
}

.popular-section {
    margin-bottom: 48px;
}

.filter-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-2);
    border-radius: 8px;
    padding: 3px;
}

.filter-btn {
    padding: 6px 16px;
    color: var(--text-2);
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.2s;
}

.filter-btn:hover {
    color: var(--text-1);
}

.filter-btn.active {
    background: var(--green);
    color: var(--bg-0);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

.game-card {
    cursor: pointer;
    transition: all 0.25s;
}

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

.game-card:hover .gc-thumb {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    border-color: var(--text-3);
}

.game-card.hidden {
    display: none;
}

.gc-thumb {
    aspect-ratio: 1;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
}

.gc-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.3) 100%);
    border-radius: 10px;
}

.gc-image {
    width: 48px;
    height: 48px;
    object-fit: contain;
    opacity: 0.9;
    transition: transform 0.3s;
}

.game-card:hover .gc-image {
    transform: scale(1.1);
}

.game-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.gc-name {
    position: relative;
    z-index: 1;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    text-align: center;
    padding: 0 8px;
}

.gc-label {
    text-align: center;
    font-size: 12px;
    color: var(--text-2);
    margin-top: 8px;
    font-weight: 500;
}

.footer {
    background: var(--bg-1);
    border-top: 1px solid var(--border);
    margin-top: 48px;
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 80px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
}

.footer-col h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-1);
    margin-bottom: 12px;
}

.footer-col p {
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.6;
}

.footer-col a {
    display: block;
    font-size: 13px;
    color: var(--text-2);
    padding: 4px 0;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: var(--green);
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding: 16px 80px;
    text-align: center;
}

.footer-bottom p {
    font-size: 12px;
    color: var(--text-3);
}

@media (max-width: 1024px) {
    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .games-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .footer-inner {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .nav {
        display: none;
    }
    .header-search input {
        width: 120px;
    }
    .featured-grid {
        grid-template-columns: 1fr;
    }
    .leaderboard-grid {
        grid-template-columns: 1fr;
    }
    .categories-grid {
        grid-template-columns: 1fr;
    }
    .guides-grid {
        grid-template-columns: 1fr;
    }
    .games-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .footer-inner {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .header-inner {
        padding: 0 16px;
        gap: 16px;
    }
    .main {
        padding: 20px 16px;
    }
}
