/* 公共样式 - Common Styles */

/* CSS变量定义 */
:root {
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --bg-accent: #0f3460;
    --text-primary: #ffffff;
    --text-secondary: #a8b2d1;
    --text-muted: #6b7280;
    --accent-primary: #4f46e5;
    --accent-secondary: #7c3aed;
    --accent-tertiary: #ec4899;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --border-light: #374151;
    --border-medium: #4b5563;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 16px 64px rgba(0, 0, 0, 0.7);
    --gradient-primary: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --gradient-secondary: linear-gradient(135deg, #ec4899 0%, #f97316 100%);
    --gradient-tertiary: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --gradient-card: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

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

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(79, 70, 229, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* 容器样式 */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 15px 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

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

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: var(--shadow-md);
}

.logo-text h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-text .tagline {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* 搜索容器 */
.search-container {
    flex: 1;
    max-width: 400px;
    position: relative;
    z-index: 1000;
}

.search-form {
    display: flex;
    background: var(--bg-card);
    border-radius: 25px;
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: all 0.3s ease;
}

.search-form:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.search-input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

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

.search-btn {
    padding: 12px 20px;
    background: var(--gradient-primary);
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* 搜索建议 */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-top: none;
    border-radius: 0 0 15px 15px;
    padding: 15px;
    margin-top: 5px;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: all 0.3s ease;
    z-index: 1001;
}

.search-container:hover .search-suggestions,
.search-form:focus-within .search-suggestions,
.search-suggestions:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.suggestion-title {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.suggestion-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-tag {
    padding: 6px 12px;
    background: var(--bg-accent);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 15px;
    font-size: 12px;
    transition: all 0.3s ease;
}

.suggestion-tag:hover {
    background: var(--accent-primary);
    color: white;
}

/* 返回按钮 */
.back-btn {
    padding: 10px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

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

/* 底部样式 */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
    padding: 30px 0;
    margin-top: 60px;
}

.footer-content {
    text-align: center;
}

.footer-text {
    color: var(--text-muted);
    font-size: 14px;
}

/* 移动端菜单 */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    max-width: 80vw;
    height: 100vh;
    background: var(--bg-card);
    border-left: 1px solid var(--border-light);
    padding: 20px;
    transition: right 0.3s ease;
    z-index: 1002;
    overflow-y: auto;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
}

.mobile-nav.active {
    right: 0;
}

.mobile-nav * {
    position: relative;
    z-index: 1003;
}

.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    position: fixed;
    top: 0;
    height: 100vh;
    width: 100vw;
}

.mobile-nav-list {
    list-style: none;
    margin-top: 20px;
}

.mobile-nav-link {
    display: block;
    padding: 15px 0;
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.mobile-nav-link:hover {
    color: var(--accent-primary);
    padding-left: 10px;
}

.mobile-search {
    margin-bottom: 20px;
    position: relative;
    z-index: 1003;
}

.mobile-search-form {
    display: flex;
    background: var(--bg-accent);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 15px;
}

.mobile-search-input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

.mobile-search-input::placeholder {
    color: var(--text-muted);
}

.mobile-search-btn {
    padding: 12px 15px;
    background: var(--gradient-primary);
    border: none;
    color: white;
    cursor: pointer;
}

/* 通用按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--gradient-primary);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* 通用卡片样式 */
.card {
    background: var(--gradient-card);
    border-radius: 16px;
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-primary);
}

/* 通用标题样式 */
.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-light);
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* 加载动画 */
.loading-skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--border-light) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* 响应式设计 */
@media (max-width: 1200px) {
    .container {
        max-width: 1200px;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
    }
    
    .search-container {
        order: 3;
        max-width: 100%;
        margin-top: 15px;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .main-content {
        padding: 20px 0;
    }
    
    .footer {
        padding: 20px 0;
        margin-top: 40px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .header {
        padding: 10px 0;
    }
    
    .logo-icon {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    .logo-text h1 {
        font-size: 18px;
    }
    
    .search-input {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .search-btn {
        padding: 10px 15px;
    }
    
    .mobile-nav {
        width: 280px;
        max-width: 85vw;
    }
}

/* 游戏卡片覆盖层通用样式 */
.game-card-image {
    position: relative;
    overflow: hidden;
}

.game-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(79, 70, 229, 0.9), rgba(236, 72, 153, 0.9));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 3;
}

.game-card:hover .game-card-overlay {
    opacity: 1;
}

.play-button {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--accent-primary);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-lg);
    text-decoration: none;
}

.play-button:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
}
