/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #000;
    color: #fff;
    overflow-x: hidden;
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: rgba(107, 70, 193, 0.9);
    border: none;
    border-radius: 5px;
    padding: 10px;
    cursor: pointer;
    flex-direction: column;
    width: 40px;
    height: 40px;
    justify-content: center;
    align-items: center;
}

.mobile-menu-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    margin: 2px 0;
    transition: 0.3s;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* 左侧边栏 */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 200px;
    height: 100vh;
    background: linear-gradient(180deg, #6B46C1 0%, #553C9A 50%, #4C1D95 100%);
    padding: 20px 0;
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar.hidden {
    transform: translateX(-100%);
}

.logo {
    text-align: center;
    padding: 0 20px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 20px;
}

.logo img {
    width: 40px;
    height: 40px;
    margin-bottom: 10px;
}

.logo h1 {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
}

/* 分类导航 */
.category-nav ul {
    list-style: none;
}

.category-nav li {
    margin-bottom: 2px;
}

.category-nav a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #fff;
    text-decoration: none;
    transition: background-color 0.3s ease;
    position: relative;
}

.category-nav a:hover,
.category-nav a.active {
    background-color: rgba(255, 255, 255, 0.1);
}

.category-nav .category-icon {
    width: 24px;
    height: 24px;
    margin-right: 12px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-nav .category-name {
    flex: 1;
    font-size: 14px;
}

.category-nav .category-count {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    min-width: 20px;
    text-align: center;
}

/* 主内容区 */
.main-content {
    margin-left: 200px;
    min-height: 100vh;
    background-color: #000;
    transition: margin-left 0.3s ease;
}

/* 顶部搜索区 */
.top-header {
    padding: 20px 30px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    background-color: #000;
    position: sticky;
    top: 0;
    z-index: 100;
}

.search-container {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 5px;
    min-width: 300px;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px 15px;
    color: #fff;
    font-size: 14px;
    outline: none;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-btn {
    background: #6B46C1;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.search-btn:hover {
    background: #553C9A;
}

.search-btn img {
    width: 16px;
    height: 16px;
}

/* 内容区域 */
.content-area {
    padding: 0 30px 30px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

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

.page-header h2 {
    font-size: 28px;
    font-weight: bold;
    color: #fff;
}

.game-count {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

/* 游戏网格 */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
}

.game-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(107, 70, 193, 0.3);
}

.game-card .game-number {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #6B46C1;
    color: #fff;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    z-index: 2;
}

.game-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background: linear-gradient(45deg, #6B46C1, #EC4899, #F59E0B);
}

.game-card .game-title {
    padding: 15px;
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
}

/* 游戏详情页 */
.game-detail-container {
    max-width: 1000px;
    margin: 0 auto;
}

.game-detail-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
}

.back-btn {
    background: #6B46C1;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    margin-right: 20px;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.back-btn:hover {
    background: #553C9A;
}

.game-detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 50px;
}

.game-preview {
    text-align: center;
}

.game-preview img {
    width: 100%;
    max-width: 400px;
    height: 300px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #6B46C1, #EC4899, #F59E0B);
}

.play-btn {
    background: linear-gradient(45deg, #EF4444, #DC2626);
    color: #fff;
    border: none;
    padding: 15px 40px;
    border-radius: 25px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.play-btn:hover {
    transform: scale(1.05);
}

.game-info h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #fff;
}

.game-info p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin-bottom: 20px;
}

.game-stats {
    display: flex;
    gap: 20px;
}

.game-stats span {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
}

/* 热门游戏区域 */
.hot-games-section h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #fff;
}

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

.hot-games-grid .game-card {
    transform: scale(0.9);
}

.hot-games-grid .game-card img {
    height: 120px;
}

/* 底部 */
.footer {
    background: #1a1a1a;
    padding: 40px 30px 20px;
    margin-left: 200px;
    transition: margin-left 0.3s ease;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-description {
    margin-bottom: 30px;
}

.footer-description h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #fff;
}

.footer-description p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin-bottom: 15px;
}

.footer-links {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #6B46C1;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #8B5CF6;
}

.footer-copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-copyright p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 50px;
    color: rgba(255, 255, 255, 0.6);
}

/* 无结果提示 */
.no-results {
    text-align: center;
    padding: 50px;
    color: rgba(255, 255, 255, 0.6);
}

.no-results h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

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

::-webkit-scrollbar-thumb:hover {
    background: #553C9A;
}



/* 游戏页面样式 */
.game-play-page {
    padding: 0;
}

.game-play-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.game-play-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.game-play-header h2 {
    color: #fff;
    font-size: 20px;
    margin: 0;
    flex: 1;
    text-align: center;
}

.fullscreen-btn {
    background: #6B46C1;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.fullscreen-btn:hover {
    background: #553C9A;
}

.game-iframe-container {
    flex: 1;
    position: relative;
    background: #000;
    overflow: hidden;
}

.game-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #000;
    color: #fff;
    z-index: 10;
}

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

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #6B46C1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.game-loading p {
    font-size: 16px;
    margin: 0;
}

#gameIframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.8);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.control-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

/* 全屏模式样式 */
.game-play-page.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: #000;
}

.game-play-page.fullscreen .game-play-container {
    height: 100vh;
}

.game-play-page.fullscreen .game-play-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-play-page.fullscreen:hover .game-play-header {
    opacity: 1;
}

.game-play-page.fullscreen .game-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-play-page.fullscreen:hover .game-controls {
    opacity: 1;
}


/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 30px 0;
    padding: 20px;
    grid-column: 1 / -1; /* 占满整个网格宽度 */
}

.pagination-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    min-width: 40px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.pagination-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    font-weight: bold;
    cursor: default;
}

.pagination-btn.active:hover {
    transform: none;
}

.pagination-ellipsis {
    color: rgba(255, 255, 255, 0.6);
    padding: 8px 4px;
    font-size: 14px;
}

/* 响应式分页 */
@media (max-width: 768px) {
    .pagination {
        gap: 4px;
        margin: 20px 0;
        padding: 15px;
        flex-wrap: wrap;
    }
    
    .pagination-btn {
        padding: 6px 10px;
        font-size: 12px;
        min-width: 32px;
        height: 32px;
    }
    
    .pagination-ellipsis {
        padding: 6px 2px;
        font-size: 12px;
    }
}

/* 加载状态优化 */
.loading {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.8);
}

.loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 无结果状态优化 */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.8);
}

.no-results h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #fff;
}

.no-results p {
    font-size: 16px;
    opacity: 0.8;
}

