/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 全局变量 */
:root {
    --theme-color: #ff7f50;
    --theme-color-dark: #e66a3d;
    --light-theme-bg: #ffffff;
    --font-color: #333;
    --border-color: #eee;
    --sidebar-width: 240px;
    --shadow-light: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-medium: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-heavy: 0 8px 32px rgba(0,0,0,0.15);
}

/* 基础样式 */
body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    color: var(--font-color);
    background: var(--light-theme-bg);
    margin: 0;
    padding: 0;
}
a {
    color: #444c69;
}
a:hover {
    color: #444c69;
}


/* 顶部栏 */
.topbar {
    background: #ffffff80;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    height: 60px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1010;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-light);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.topbar-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0 2rem;
    width: 100%;
    /*max-width: 1400px;*/
    margin: 0 auto;
}

.sidebar-toggle {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    font-size: 1.2rem;
    cursor: pointer;
    color: #666;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-light);
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    color: var(--theme-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.sidebar-toggle:active {
    transform: translateY(0);
    box-shadow: var(--shadow-light);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--theme-color);
    text-decoration: none;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.nav-logo i {
    font-size: 1.8rem;
    background: linear-gradient(135deg, var(--theme-color) 0%, var(--theme-color-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-logo span {
    background: linear-gradient(135deg, var(--theme-color) 0%, var(--theme-color-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.nav-logo:hover {
    transform: scale(1.02);
}

.nav-search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    max-width: 500px;
    margin: 0 auto;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    /*border: 2px solid rgba(0,0,0,0.08);*/
    border-radius: 25px;
    padding: 3px 6px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-light);
    /*position: relative;*/
    overflow: hidden;
    min-width: 0; /* 允许flex项目收缩 */
    position: absolute;
    top: 10px;
    left: 0;
    right: 0;
}

.nav-search::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s ease;
}

.nav-search:hover::before {
    left: 100%;
}

.nav-search:focus-within {
    border-color: var(--theme-color);
    box-shadow: 0 0 0 4px rgba(255, 127, 80, 0.1), var(--shadow-medium);
    transform: translateY(-1px);
}

.nav-search input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 15px;
    color: #333;
    font-weight: 500;
    min-width: 0; /* 允许input收缩 */
}

.nav-search input::placeholder {
    color: #999;
    font-weight: 400;
}

.nav-search input:focus::placeholder {
    color: #ccc;
}

.search-button {
    background: linear-gradient(135deg, var(--theme-color) 0%, var(--theme-color-dark) 100%);
    color: white;
    border: none;
    border-radius: 18px;
    padding: 5px 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-light);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    white-space: nowrap;
}

.search-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.search-button:hover::before {
    left: 100%;
}

.search-button:hover {
    /*transform: translateY(-2px);*/
    box-shadow: var(--shadow-medium);
    background: linear-gradient(135deg, var(--theme-color-dark) 0%, var(--theme-color) 100%);
}

.search-button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-light);
}

.search-button span {
    position: relative;
    z-index: 1;
}

/* 侧边栏 */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: #fff;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding-top: 70px;
    z-index: 1000;
    transition: left 0.3s ease, width 0.3s ease;
}

/* 侧边栏收缩状态 - 使用更高优先级的选择器 */
body .sidebar.collapsed,
html body .sidebar.collapsed {
    width: 70px !important;
    max-width: 70px !important;
    min-width: 70px !important;
}

/* 确保收缩状态下的所有子元素都正确显示 */
body .sidebar.collapsed .sidebar-nav ul li a span,
body .sidebar.collapsed .sidebar-footer .copyright,
body .sidebar.collapsed .social-links {
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

body .sidebar.collapsed .sidebar-nav ul li a {
    justify-content: center !important;
    padding: 0.8rem 0 !important;
}

body .sidebar.collapsed .sidebar-nav ul li a i {
    margin: 0 !important;
    font-size: 1.2rem !important;
}

body .sidebar.collapsed .sidebar-nav ul {
    padding: 0 0.5rem !important;
}

body .sidebar.collapsed .sidebar-footer {
    padding: 1rem 0.5rem !important;
}

.sidebar-nav {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.sidebar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0 1rem;
}

.sidebar-nav ul li {
    margin: 5px 0;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--font-color);
    font-weight: 500;
    transition: all 0.3s ease;
}

.sidebar-nav li a:hover {
    background: #f8f8f8;
}

.sidebar-nav li.active a {
    color: var(--theme-color);
    background: var(--light-theme-bg);
}

.sidebar-nav li a i {
    width: 20px;
    text-align: center;
    color: #888;
    transition: color 0.3s ease;
}

.sidebar-nav li.active a i {
    color: var(--theme-color);
}

.sidebar-nav li a span {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    transition: padding 0.3s ease;
}

.social-links {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.social-links a {
    color: #fff;
    background: #333;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    text-decoration: none;
}

img.img-nav {
    width: 20px;
    height: 20px;
}

.copyright {
    font-size: 0.8rem;
    color: #999;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* 主内容区 */
main {
    padding: 90px 2rem 2rem 2rem;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
}

/* 主内容区收缩状态 - 使用更高优先级的选择器 */
body main.sidebar-collapsed,
html body main.sidebar-collapsed {
    margin-left: 70px !important;
    padding-left: 2rem !important;
}

section {
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h2 {
    font-size: 1.5rem;
    margin: 0;
    font-weight: bold;
}

#con-game .games-grid {
    min-height: 300px;
}

.more-link {
    color: #999;
    text-decoration: none;
    font-size: 0.9rem;
}

.action-link {
    color: var(--theme-color);
    font-weight: 500;
}

.horizontal-scroll-container {
    overflow-x: auto;
    padding-bottom: 1rem;
    position: relative;
}

/* 游戏卡片样式 */
.games-grid-small {
    display: inline-flex;
    gap: 1rem;
}

.continue-game-card-small {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    background: #ddd;
    cursor: pointer;
    overflow: hidden;
}

.game-image-small {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.games-grid-featured {
    display: inline-flex;
    gap: 1rem;
}

.featured-game-card {
    width: 350px;
    height: 200px;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: #ddd;
}

.featured-game-image {
    width: 100%;
    height: 100%;
    background-color: #ddd;
}

.featured-game-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
    display: flex;
    align-items: center;
    gap: 1rem;
    color: white;
}

.featured-game-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: #eee;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.featured-game-text {
    width: 56%;
}

.featured-game-text h3,
.featured-game-text p {
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.featured-game-text h3 {
    font-size: 1.1rem;
}

.featured-game-text p {
    font-size: 0.8rem;
    opacity: 0.8;
}

.featured-game-card .play-button {
    margin-left: auto;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.5);
    color: white;
    border-radius: 16px;
    padding: 0.5rem 1rem;
    flex-shrink: 0;
    cursor: pointer;
}

.games-grid {
    display: inline-flex;
    gap: 1rem;
}

.game-card {
    width: 190px;
    background: #fff;
    border-radius: 9px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    margin: 2px 0 12px 2px;
    box-shadow: 0 .22rem .67rem 0 rgba(0, 0, 0, .08);
    outline: 2px solid transparent;
    transition: all 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.game-card:hover {
    /*border: solid 2px #fc5214;*/
    outline-color: #fc5214;
    /*box-shadow: 0 8px 24px rgba(0,0,0,0.15);*/
}

.game-card .game-image {
    width: 100%;
    height: 120px;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    position: relative;
    border-top-right-radius: 5px;
    transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
    transform-origin: center center;
}



.game-card .game-image:hover {
    transform: scale(1.08);
    object-fit: cover;
}

.game-card .game-info {
    padding: 0.8rem;
}

.game-card .game-info h3,
.game-card .game-info p {
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-card .game-info h3 {
    font-size: 1rem;
}

.game-card .game-info p {
    font-size: 0.8rem;
    color: #888;
}

.play-button-small {
    position: absolute;
    bottom: 0.8rem;
    right: 0.8rem;
    background: #f1f1f1;
    border: none;
    color: #555;
    border-radius: 12px;
    padding: 0.4rem 0.8rem;
    font-weight: 500;
    cursor: pointer;
}

/* 角标 */
.new-badge,
.hot-badge {
    position: absolute;
    top: 0;
    left: 0;
    color: white;
    padding: 3px 8px;
    border-radius: 15px;
    font-size: 15px;
    font-weight: 500;
    border-top-left-radius: 6px;
    border-bottom-left-radius: 0;
}

.new-badge {
    background: linear-gradient(90deg, #fc5214, #ff8e30);
}

.hot-badge {
    background: linear-gradient(90deg, #fc5214, #ff8e30);
}

/* 随机游戏按钮 */
.random-games-button-card {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 220px;
}

.random-games-button {
    background: var(--theme-color);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
}

/* 分隔线 */
hr.separator {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1rem 0;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .nav-search {
        max-width: 400px;
    }
}

@media (max-width: 900px) {
    .sidebar {
        left: -240px;
        width: var(--sidebar-width) !important; /* 移动端强制使用完整宽度 */
    }
    
    .sidebar.active {
        left: 0;
    }
    
    /* 移动端不使用收缩状态，强制覆盖 */
    .sidebar.collapsed {
        width: var(--sidebar-width) !important;
        left: -240px;
    }
    
    /* 移动端不使用收缩状态的主内容区 */
    main {
        margin-left: 0 !important; /* 移动端强制不使用边距 */
    }
    
    main.sidebar-collapsed {
        margin-left: 0 !important;
    }
    
    .nav-search {
        display: none;
    }
    
    .search-button {
        display: none;
    }
    
    .nav-logo {
        flex-grow: 1;
    }
    
    .topbar-container {
        padding: 0 1rem;
        gap: 1rem;
    }

    .scrollleft,.scrollright {
        display: none;
    }

    #con-game .game-kuai {
        width: 49% !important;
    }
    #con-game .game-kuai .game-card {
        margin: 0 !important;
        width: 170px !important;
    }
    #con-game .games-grid {
        gap: 1%;
        justify-content: space-between;
    }
}

@media (max-width: 768px) {
    .topbar {
        height: 60px;
    }
    
    .topbar-container {
        padding: 0 0.8rem;
        gap: 0.8rem;
    }
    
    .sidebar-toggle {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .nav-logo {
        font-size: 1.4rem;
        gap: 0.6rem;
    }
    
    .nav-logo i {
        font-size: 1.6rem;
    }
    
    main {
        padding: 80px 1rem 1rem 1rem;
    }

    .scrollleft,.scrollright {
        display: none;
    }
}

@media (max-width: 480px) {
    .topbar-container {
        padding: 0 0.6rem;
        gap: 0.6rem;
    }
    
    .nav-logo {
        font-size: 1.2rem;
        gap: 0.5rem;
    }
    
    .nav-logo i {
        font-size: 1.4rem;
    }
    
    .sidebar-toggle {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .scrollleft,.scrollright {
        display: none;
    }
}

/* 加载动画 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.empty-state i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 1.5rem;
}

.empty-state h3 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.5rem;
}

.empty-state p {
    color: #888;
    font-size: 1.1rem;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1002;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 550px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2rem 1rem 2rem;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    color: #333;
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-close {
    background: #f8f9fa;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #666;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.3s;
}

.modal-close:hover {
    background: #e9ecef;
}

.modal-body {
    padding: 2rem;
}

.game-preview {
    margin-bottom: 1.5rem;
}

.game-preview img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 15px;
}

.game-info p {
    color: #666;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.game-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    color: #888;
}

.modal-footer {
    padding: 2rem;
    border-top: 1px solid #eee;
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex: 1;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #e9ecef;
} 