* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

:root {
    --primary-color: #6a11cb;
    --secondary-color: #2575fc;
    --accent-color: #ff416c;
    --dark-bg: #0a0a15;
    --card-bg: #15152b;
    --text-primary: #ffffff;
    --text-secondary: #b0b0ff;
}

body {
    background-color: var(--dark-bg);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

/* 背景效果 */
.bg-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
}

.gradient-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 30%, rgba(106, 17, 203, 0.2) 0%, transparent 50%),
                radial-gradient(circle at 80% 70%, rgba(37, 117, 252, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 40% 80%, rgba(255, 65, 108, 0.1) 0%, transparent 50%);
}

.floating-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    opacity: 0.05;
    filter: blur(40px);
    animation: float 20s infinite linear;
}

.shape:nth-child(1) {
    width: 300px;
    height: 300px;
    top: 10%;
    left: 5%;
    animation-delay: 0s;
}

.shape:nth-child(2) {
    width: 200px;
    height: 200px;
    top: 60%;
    right: 10%;
    animation-delay: -5s;
    background: linear-gradient(45deg, var(--accent-color), #ff4b2b);
}

.shape:nth-child(3) {
    width: 150px;
    height: 150px;
    bottom: 20%;
    left: 20%;
    animation-delay: -10s;
    background: linear-gradient(45deg, #00dbde, #fc00ff);
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(50px, 50px) rotate(90deg);
    }
    50% {
        transform: translate(0, 100px) rotate(180deg);
    }
    75% {
        transform: translate(-50px, 50px) rotate(270deg);
    }
}

/* 主容器 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
    padding-bottom: 5rem; /* 添加底部边距防止内容被底部信息遮挡 */
}

/* 顶部标题栏 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    font-size: 2.5rem;
    color: var(--primary-color);
    text-shadow: 0 0 20px rgba(106, 17, 203, 0.7);
}

.logo-text h1 {
    font-size: 2.2rem;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: 1px;
}

.logo-text p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    letter-spacing: 2px;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-info {
    text-align: right;
}

.user-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
}

.user-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: 3px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: transform 0.3s;
}

.user-avatar:hover {
    transform: scale(1.05);
}

/* 登录/退出按钮 */
.auth-button {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.auth-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 15px rgba(106, 17, 203, 0.5);
}

/* 控制栏 */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.search-box {
    display: flex;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    padding: 0.8rem 1.5rem;
    width: 350px;
    max-width: 100%;
    border: 1px solid rgba(106, 17, 203, 0.3);
    transition: all 0.3s;
}

.search-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(106, 17, 203, 0.3);
    background: rgba(255, 255, 255, 0.1);
}

.search-box i {
    color: var(--text-secondary);
    margin-right: 10px;
    font-size: 1.2rem;
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    width: 100%;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-secondary);
}

.filter-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 0.7rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid transparent;
    font-weight: 500;
    color: var(--text-secondary);
}

.filter-tab:hover {
    background: rgba(106, 17, 203, 0.2);
    color: white;
}

.filter-tab.active {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 5px 15px rgba(106, 17, 203, 0.4);
}

.view-toggle {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-secondary);
}

.view-btn:hover, .view-btn.active {
    background: rgba(106, 17, 203, 0.3);
    color: white;
}

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

/* 列表视图 */
.games-grid.list-view {
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.games-grid.list-view .game-card {
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
}

.games-grid.list-view .game-header {
    padding: 1.5rem;
    flex: 1;
}

.games-grid.list-view .game-info {
    padding: 1.5rem;
    flex: 2;
    border-left: 1px solid rgba(106, 17, 203, 0.2);
}

.games-grid.list-view .game-description {
    margin-bottom: 1rem;
}

.games-grid.list-view .game-actions {
    justify-content: flex-end;
    width: auto;
}

.game-card {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s;
    border: 1px solid rgba(106, 17, 203, 0.2);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.game-card:hover {
    transform: translateY(-15px);
    border-color: var(--primary-color);
    box-shadow: 0 15px 30px rgba(106, 17, 203, 0.3);
}

.game-card.featured {
    border: 2px solid var(--accent-color);
}

.game-card.featured::before {
    content: "精选";
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--accent-color);
    color: white;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 2;
}

.game-header {
    padding: 1.5rem 1.5rem 0 1.5rem;
}

.game-title-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.game-title-section h3 {
    font-size: 1.5rem;
    margin: 0;
}

.game-category {
    display: inline-block;
    background: rgba(106, 17, 203, 0.7);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    width: fit-content;
}

.game-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.game-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.game-actions {
    display: flex;
    gap: 1rem;
}

.play-btn {
    flex-grow: 1;
    padding: 0.9rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.play-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 15px rgba(106, 17, 203, 0.5);
}

.action-btn {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.action-btn:hover {
    background: rgba(106, 17, 203, 0.3);
    color: white;
}

.action-btn.favorite.active {
    color: var(--accent-color);
}

/* 侧边栏 - 最近游玩和收藏 */
.sidebar {
    position: fixed;
    right: -350px;
    top: 0;
    width: 350px;
    height: 100vh;
    background: rgba(10, 10, 25, 0.95);
    backdrop-filter: blur(10px);
    border-left: 1px solid rgba(106, 17, 203, 0.3);
    padding: 2rem;
    overflow-y: auto;
    transition: right 0.4s;
    z-index: 100;
}

.sidebar.active {
    right: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.close-sidebar {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

.close-sidebar:hover {
    color: white;
}

.sidebar-section {
    margin-bottom: 2.5rem;
}

.sidebar-section h3 {
    font-size: 1.2rem;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.sidebar-section h3 i {
    color: var(--primary-color);
}

.recent-game, .favorite-game {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.recent-game:hover, .favorite-game:hover {
    background: rgba(106, 17, 203, 0.2);
    transform: translateX(5px);
}

.recent-game-img, .favorite-game-img {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    object-fit: cover;
}

.recent-game-info, .favorite-game-info {
    flex-grow: 1;
}

.recent-game-info h4, .favorite-game-info h4 {
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.recent-game-info p, .favorite-game-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* 底部信息 */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    padding: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid rgba(106, 17, 203, 0.2);
    background: rgba(10, 10, 21, 0.8);
    backdrop-filter: blur(5px);
    z-index: 10;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 992px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        width: 100%;
    }
    
    .filter-tabs, .view-toggle {
        justify-content: center;
    }
    
    .sidebar {
        width: 300px;
        right: -300px;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        text-align: center;
    }
    
    .user-section {
        justify-content: center;
    }
    
    .user-info {
        text-align: center;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .container {
        padding: 1.5rem;
    }
    
    .games-grid.list-view .game-card {
        flex-direction: column;
        text-align: center;
    }
    
    .games-grid.list-view .game-info {
        border-left: none;
        border-top: 1px solid rgba(106, 17, 203, 0.2);
    }
    
    .games-grid.list-view .game-actions {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        width: 100%;
        right: -100%;
    }
    
    .game-actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
    }
}