html, body {
    overflow-x: hidden; /* 严禁水平滚动条 */
    width: 100%;
    position: relative;
}
:root {
    --accent: #00f2ff;
    --hot-pink: #ff007a;
    --bg: #0d0f1a;
    --card-bg: #161a2e;
    --nav-bg: rgba(13, 15, 26, 0.95);
    --text-muted: #8e95b3;
    --sidebar-width: 240px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    font-family: 'Inter', sans-serif;
    color: #fff;
    line-height: 1.5;
    overflow-x: hidden;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Header --- */
.top-bar {
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 12px 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 22px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent), var(--hot-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.search-area {
    flex: 0 1 450px;
    position: relative;
    margin: 0 25px;
}

.search-area input {
    width: 100%;
    background: #1f233b;
    border: 1px solid #2d325a;
    border-radius: 10px;
    padding: 10px 15px 10px 42px;
    color: #fff;
    outline: none;
}

.search-area i {
    position: absolute;
    left: 16px;
    top: 13px;
    color: #5c6282;
}

/* --- Main Layout --- */
.main-layout {
    display: flex;
    gap: 30px;
    margin-top: 30px;
}

/* --- Sidebar Categories --- */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    position: sticky;
    top: 100px;
    height: fit-content;
}

.cat-group {
    margin-bottom: 30px;
}

.cat-title {
    font-size: 12px;
    color: #4e5471;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
    font-weight: 800;
}

.cat-list {
    list-style: none;
}

.cat-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: 0.3s;
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: 600;
}

.cat-link i {
    width: 18px;
    text-align: center;
    font-size: 16px;
}

.cat-link:hover,
.cat-link.active {
    background: rgba(0, 242, 255, 0.1);
    color: var(--accent);
}

/* --- Content Area --- */
.content-area {
    flex-grow: 1;
    min-width: 0;
}

/* --- Game Grid --- */
.game-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 50px;
}

@media (min-width: 768px) {
    .game-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .game-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1440px) {
    .game-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 20px;
    }
}

.game-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 12px;
    text-decoration: none;
    transition: 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.game-card:hover {
    transform: translateY(-8px);
    background: #1e233d;
    border-color: var(--accent);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.game-img-wrapper {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    background: #1f233b; /* 图片加载前的占位底色 */
    position: relative;
}

/* 2. 确保图片填满且不压缩变形 */
.game-img {
    width: 100%;
    height: 100%;
    /* 核心属性：等比例裁剪填充，防止图片被压扁 */
    object-fit: cover;
    display: block;
    transition: 0.6s;
}

/* 3. 手机端网格微调 */
@media (max-width: 767px) {
    .game-grid {
        /* 手机端强制两列平分，间距固定 */
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }

    .game-card{
        width: 187.5px !important;
        height: 286.8px !important;
    }

    .game-card {
        /* 确保卡片不会被内容撑开不同高度 */
        display: flex;
        flex-direction: column;
        padding: 8px;
    }

    .game-info h4 {
        font-size: 13px; /* 手机端标题稍微调小 */
    }

    .game-img {
        width: 161.5px;
        height: 161.5px;
        /* 核心属性：等比例裁剪填充，防止图片被压扁 */
        object-fit: cover;
        display: block;
        transition: 0.6s;
    }
}

.game-card:hover .game-img {
    transform: scale(1.1);
}

.game-info h4 {
    font-size: 15px;
    color: #fff;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-desc {
    font-size: 11px;
    color: var(--text-muted);
    height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 10px;
    line-height: 1.4;
}


.game-desc {
    /* 强制显示两行，高度固定 */
    height: 2.8em;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.game-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tag {
    font-size: 10px;
    color: var(--hot-pink);
    font-weight: 800;
    background: rgba(255, 0, 122, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

/* --- About Section --- */
.site-about {
    background: linear-gradient(to right, rgba(22, 26, 46, 1), rgba(22, 26, 46, 0));
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 60px;
    border-left: 4px solid var(--accent);
}

.site-about h2 {
    color: var(--accent);
    margin-bottom: 15px;
    font-size: 24px;
}

.site-about p {
    color: var(--text-muted);
    font-size: 15px;
    max-width: 1000px;
}

/* --- Footer --- */
.nx-footer {
    background: #060812;
    padding: 60px 0 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h3 {
    font-size: 14px;
    color: #fff;
    letter-spacing: 2px;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.footer-link {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    margin-bottom: 10px;
    transition: 0.2s;
}

.footer-link:hover {
    color: var(--accent);
}

/* --- Mobile Responsiveness --- */
@media (max-width: 1024px) {
    .sidebar {
        display: none;
    }

    /* Hide sidebar on small screens */
    .mobile-nav {
        display: flex;
        overflow-x: auto;
        gap: 15px;
        padding: 10px 0 20px;
        scrollbar-width: none;
    }

    .mobile-nav::-webkit-scrollbar {
        display: none;
    }

    .mobile-cat {
        background: #161a2e;
        padding: 8px 18px;
        border-radius: 20px;
        white-space: nowrap;
        font-size: 13px;
        color: var(--text-muted);
        text-decoration: none;
        border: 1px solid #2d325a;
    }

    .mobile-cat.active {
        background: var(--accent);
        color: #000;
        border-color: var(--accent);
    }
}

@media (min-width: 1025px) {
    .mobile-nav {
        display: none;
    }
}