/* 全局样式重置与基础 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Microsoft YaHei', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #f5f7fa;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    background-image: 
        radial-gradient(circle at 10% 10%, rgba(180, 190, 210, 0.15) 0%, transparent 25%),
        radial-gradient(circle at 90% 90%, rgba(200, 190, 220, 0.15) 0%, transparent 25%),
        linear-gradient(to bottom, #f0f2f5, #e8ebf0);
    position: relative;
    overflow-x: hidden;
    width: 100%;
}

/* 装饰性背景元素 */
.bg-element {
    position: fixed;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(210, 220, 235, 0.4), rgba(220, 210, 240, 0.4));
    z-index: -1;
    pointer-events: none;
}

.bg-element-1 {
    width: 80px;
    height: 80px;
    top: 5%;
    left: -20px;
}

.bg-element-2 {
    width: 60px;
    height: 60px;
    bottom: 15%;
    right: -15px;
}

/* 顶部导航栏 - 移动端适配 */
.top-bar {
    width: 100%;
    height: 44px;
    background: rgba(255, 255, 255, 0.98);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid rgba(200, 205, 215, 0.6);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.logo {
    display: flex;
    align-items: center;
    gap: 6px;
}

.logo-icon {
    color: #5a7bc8;
    font-size: 15px;
}

.logo-text {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.2px;
    background: linear-gradient(90deg, #4a6bc8, #6a5ae8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    white-space: nowrap;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5a7bc8, #7a6ae8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
}

.menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 3px;
    cursor: pointer;
    padding: 5px;
}

.menu-line {
    width: 18px;
    height: 2px;
    background-color: #6a7488;
    border-radius: 1px;
    transition: all 0.3s;
}

/* 主内容区域 */
.main-content {
    width: 100%;
    padding: 0 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 游戏分类标签 */
.category-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

.category-tabs::-webkit-scrollbar {
    height: 2px;
}

.category-tabs::-webkit-scrollbar-thumb {
    background-color: rgba(90, 123, 200, 0.4);
    border-radius: 2px;
}

.category-tab {
    padding: 6px 12px;
    font-size: 11px;
    background: rgba(240, 242, 245, 0.9);
    border-radius: 16px;
    color: #5a6270;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid rgba(180, 185, 200, 0.8);
    white-space: nowrap;
    flex-shrink: 0;
}

.category-tab.active {
    background: linear-gradient(135deg, rgba(90, 123, 200, 0.15), rgba(122, 110, 232, 0.15));
    color: #4a6bc8;
    border-color: rgba(90, 123, 200, 0.6);
    box-shadow: 0 0 8px rgba(90, 123, 200, 0.1);
}

.category-tab:hover:not(.active) {
    background: rgba(225, 228, 235, 0.9);
}

/* 收藏状态框 */
.collection-box {
    width: 100%;
    min-height: 220px;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 18px 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06),
                inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(200, 205, 215, 0.8);
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.collection-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #5a7bc8, #7a6ae8, #5a7bc8);
    background-size: 200% 100%;
    animation: shimmer 4s infinite linear;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.empty-icon {
    font-size: 38px;
    margin-bottom: 14px;
    color: #5a7bc8;
    opacity: 0.8;
}

.empty-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #444;
    text-align: center;
}

.empty-description {
    font-size: 11px;
    color: #6a7280;
    text-align: center;
    max-width: 240px;
    line-height: 1.4;
    margin-bottom: 18px;
}

.add-game-btn {
    background: linear-gradient(135deg, #5a7bc8, #3a58a0);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(90, 123, 200, 0.15);
    width: 100%;
    max-width: 180px;
}

.add-game-btn:hover, .add-game-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(90, 123, 200, 0.2);
}

/* 统计信息 */
.stats-container {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px solid rgba(200, 205, 215, 0.6);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.stat-value {
    font-size: 15px;
    font-weight: 700;
    color: #5a7bc8;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 9px;
    color: #6a7280;
    letter-spacing: 0.2px;
}

/* 高级功能提示 */
.premium-features {
    width: 100%;
    margin-top: 12px;
    background: rgba(240, 242, 245, 0.9);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid rgba(90, 123, 200, 0.2);
}

.premium-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.premium-icon {
    color: #b89437;
    font-size: 14px;
}

.premium-title {
    font-size: 12px;
    font-weight: 600;
    color: #b89437;
}

.premium-list {
    list-style: none;
    padding-left: 4px;
}

.premium-list li {
    font-size: 10px;
    color: #5a6270;
    margin-bottom: 6px;
    padding-left: 16px;
    position: relative;
}

.premium-list li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #5a7bc8;
    font-weight: bold;
    font-size: 10px;
}

/* 会员弹窗 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    padding: 12px;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: linear-gradient(145deg, #ffffff, #f0f2f5);
    border-radius: 14px;
    width: 100%;
    max-width: 280px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(200, 205, 215, 0.8);
    transform: translateY(20px);
    transition: transform 0.4s;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    padding: 16px 16px 12px;
    text-align: center;
    border-bottom: 1px solid rgba(200, 205, 215, 0.8);
    background: rgba(245, 247, 250, 0.9);
}

.modal-icon {
    font-size: 38px;
    color: #c93c3c;
    margin-bottom: 8px;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: #c93c3c;
    margin-bottom: 4px;
}

.modal-subtitle {
    font-size: 12px;
    color: #6a7280;
}

.modal-content {
    padding: 16px;
}

.modal-text {
    font-size: 12px;
    color: #444;
    line-height: 1.4;
    margin-bottom: 16px;
    text-align: center;
}

.modal-features {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.modal-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #5a6270;
}

.feature-icon {
    color: #5a7bc8;
    font-size: 12px;
}

.modal-actions {
    display: flex;
    gap: 8px;
}

.modal-btn {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-btn.primary {
    background: linear-gradient(135deg, #5a7bc8, #3a58a0);
    color: white;
    box-shadow: 0 4px 12px rgba(90, 123, 200, 0.15);
}

.modal-btn.secondary {
    background: rgba(230, 232, 240, 0.9);
    color: #444;
    border: 1px solid rgba(90, 123, 200, 0.2);
}

.modal-btn:hover, .modal-btn:active {
    transform: translateY(-1px);
}

.modal-btn.primary:hover, .modal-btn.primary:active {
    box-shadow: 0 6px 16px rgba(90, 123, 200, 0.2);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(230, 232, 240, 0.9);
    border: 1px solid rgba(200, 205, 215, 0.8);
    color: #5a6270;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
}

/* 侧边菜单 */
.side-menu {
    position: fixed;
    top: 0;
    left: -240px;
    width: 240px;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 3px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 200;
    transition: left 0.4s;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(200, 205, 215, 0.8);
}

.side-menu.active {
    left: 0;
}

.menu-header {
    padding: 18px 16px;
    border-bottom: 1px solid rgba(200, 205, 215, 0.8);
}

.menu-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5a7bc8, #7a6ae8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
}

.menu-user-info h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 3px;
    color: #333;
}

.menu-user-info p {
    font-size: 10px;
    color: #6a7280;
}

.menu-items {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #444;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.menu-item:hover, .menu-item.active {
    background: rgba(90, 123, 200, 0.08);
    color: #5a7bc8;
    border-left-color: #5a7bc8;
}

.menu-item i {
    width: 18px;
    text-align: center;
    font-size: 14px;
}

/* 页脚 */
.footer {
    width: 100%;
    margin-top: 18px;
    padding: 12px;
    border-top: 1px solid rgba(200, 205, 215, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 9px;
    color: #8a909d;
    text-align: center;
}

.footer-links {
    display: flex;
    gap: 12px;
}

.footer-link {
    color: #6a7280;
    text-decoration: none;
    font-size: 9px;
}

/* 响应式调整 */
@media (max-width: 360px) {
    .category-tab {
        padding: 5px 10px;
        font-size: 10px;
    }
    
    .empty-title {
        font-size: 14px;
    }
    
    .empty-description {
        font-size: 10px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
}