* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #13141f;
    color: #ffffff;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== 侧边栏 ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    background: #1a1b2e;
    border-right: 1px solid #2a2c45;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
    border-bottom: 1px solid #2a2c45;
}

.logo-icon {
    font-size: 24px;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #7c5cff, #4d8aff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav, .sidebar-categories {
    padding: 12px 0;
}

.sidebar-nav a,
.sidebar-categories a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: #8b8da3;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover,
.sidebar-categories a:hover {
    color: #ffffff;
    background: rgba(124, 92, 255, 0.08);
    border-left-color: #7c5cff;
}

.sidebar-nav a.sidebar-active {
    color: #ffffff;
    background: rgba(124, 92, 255, 0.12);
    border-left-color: #7c5cff;
}

.sidebar-icon {
    font-size: 16px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-divider {
    height: 1px;
    background: #2a2c45;
    margin: 8px 16px;
}

/* ===== 主内容区域 ===== */
.main-wrapper {
    margin-left: 240px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.main-content {
    padding: 0;
    max-width: 100%;
}

/* ===== 顶部Header ===== */
.top-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background: #1a1b2e;
    border-bottom: 1px solid #2a2c45;
    gap: 20px;
}

.header-search {
    position: relative;
    flex: 1;
    max-width: 480px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #5c5e76;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    background: #13141f;
    border: 1px solid #2a2c45;
    border-radius: 10px;
    color: #ffffff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.search-input::placeholder {
    color: #5c5e76;
}

.search-input:focus {
    border-color: #7c5cff;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.header-btn {
    position: relative;
    background: none;
    border: none;
    color: #8b8da3;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-btn:hover {
    color: #ffffff;
    background: rgba(255,255,255,0.05);
}

.notification-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: #f87171;
    border-radius: 50%;
    border: 2px solid #1a1b2e;
}

/* ===== 分类横幅区域 ===== */
.category-banners {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #2a2c45 transparent;
}

.category-banners::-webkit-scrollbar {
    height: 6px;
}

.category-banners::-webkit-scrollbar-track {
    background: transparent;
}

.category-banners::-webkit-scrollbar-thumb {
    background: #2a2c45;
    border-radius: 3px;
}

.category-card {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 140px;
    height: 100px;
    border-radius: 14px;
    padding: 16px;
    text-decoration: none;
    color: #ffffff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.category-emoji {
    font-size: 28px;
}

.category-label {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

/* ===== 游戏分区 ===== */
.games-section {
    padding: 24px 24px 0;
}

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
}

.section-more {
    color: #7c5cff;
    text-decoration: none;
    font-size: 14px;
    transition: opacity 0.2s ease;
}

.section-more:hover {
    opacity: 0.8;
}

/* ===== 游戏网格 ===== */
.games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 640px) {
    .games-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }
}

@media (min-width: 1024px) {
    .games-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 16px;
    }
}

@media (min-width: 1440px) {
    .games-grid {
        grid-template-columns: repeat(7, 1fr);
    }
}

/* ===== 游戏卡片 ===== */
.game-card {
    border-radius: 12px;
    overflow: hidden;
    background: #1e1f35;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    background: #252740;
}

.game-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.card-image-wrapper {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #13141f;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.game-card:hover .card-image-wrapper img {
    transform: scale(1.05);
}

.card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff;
}

.card-info {
    padding: 10px 10px 12px;
}

.card-title {
    font-size: 13px;
    font-weight: 500;
    color: #8b8da3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

.game-card:hover .card-title {
    color: #ffffff;
}

/* ===== 详情页 ===== */
.detail-page {
    padding: 24px;
    max-width: 1100px;
    margin: 0 auto;
}

.detail-back {
    margin-bottom: 20px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #7c5cff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(124, 92, 255, 0.1);
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: rgba(124, 92, 255, 0.2);
}

.detail-hero {
    display: flex;
    gap: 32px;
    background: #1e1f35;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
}

.detail-thumb-wrapper {
    flex-shrink: 0;
    width: 320px;
    border-radius: 12px;
    overflow: hidden;
}

.detail-thumb {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

.detail-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.detail-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
}

.detail-desc {
    color: #8b8da3;
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 24px;
}

.play-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 36px;
    background: linear-gradient(135deg, #7c5cff, #4d8aff);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.play-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 24px rgba(124, 92, 255, 0.35);
}

.game-iframe-container {
    width: 100%;
    height: 650px;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 24px;
    background: #000;
}

.game-iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.related-section {
    margin-top: 40px;
}

.related-games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (min-width: 768px) {
    .related-games-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.related-card .card-info {
    padding: 8px 8px 10px;
}

.related-card .card-title {
    font-size: 12px;
}

/* ===== 静态页面 ===== */
.static-page {
    padding: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.static-back {
    margin-bottom: 24px;
}

.static-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px;
}

.static-content {
    background: #1e1f35;
    border-radius: 16px;
    padding: 32px;
    color: #8b8da3;
    line-height: 1.8;
    font-size: 15px;
}

.static-content p {
    margin-bottom: 16px;
}

.static-content strong {
    color: #ffffff;
}

.static-content ul {
    margin: 12px 0 12px 24px;
}

.static-content li {
    margin-bottom: 8px;
}

/* ===== 移动端侧边栏切换按钮 ===== */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1001;
    background: #1a1b2e;
    border: 1px solid #2a2c45;
    color: #ffffff;
    cursor: pointer;
    padding: 10px;
    border-radius: 10px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

/* ===== 响应式设计 ===== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
    }

    .main-wrapper {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .main-wrapper.shifted {
        margin-left: 0;
    }

    .detail-hero {
        flex-direction: column;
    }

    .detail-thumb-wrapper {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }
}

@media (max-width: 640px) {
    /* 手机端隐藏分类横幅 */
    .category-banners {
        display: none;
    }

    /* 手机端隐藏导航栏 */
    .sidebar {
        display: none !important;
    }

    .sidebar-toggle {
        display: none !important;
    }

    .sidebar-overlay {
        display: none !important;
    }

    .games-section {
        padding: 16px 16px 0;
    }

    .section-title {
        font-size: 17px;
    }

    .detail-page {
        padding: 16px;
    }

    .detail-hero {
        padding: 16px;
    }

    .detail-title {
        font-size: 22px;
    }

    .game-iframe-container {
        height: 450px;
    }

    .static-page {
        padding: 16px;
    }

    .static-content {
        padding: 20px;
    }
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #13141f;
}

::-webkit-scrollbar-thumb {
    background: #2a2c45;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3a3c55;
}

::selection {
    background: rgba(124, 92, 255, 0.3);
    color: #fff;
}

a {
    color: inherit;
}