/* ==================== 游戏屋样式 ==================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6c5ce7;
    --secondary: #a29bfe;
    --accent: #fd79a8;
    --dark: #2d3436;
    --light: #f5f6fa;
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success: #00b894;
    --warning: #fdcb6e;
}

body {
    font-family: 'Segoe UI', 'PingFang SC', -apple-system, sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
}

/* 导航 */
header {
    background: var(--gradient);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

nav {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: 0.3s;
}

.nav-links a:hover {
    background: rgba(255,255,255,0.2);
}

/* 主内容 */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* 英雄区 */
.hero {
    text-align: center;
    padding: 3rem 1rem;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 20px;
    color: white;
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* 分类标签 */
.categories {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.category-btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 25px;
    background: white;
    color: var(--dark);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.category-btn:hover, .category-btn.active {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* 游戏网格 */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

.game-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.game-card.new::before {
    content: '🆕';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.2rem;
    z-index: 2;
}

.game-card.hot::after {
    content: '🔥';
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 1.2rem;
    z-index: 2;
}

.game-preview {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.game-preview-icon {
    font-size: 4rem;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
    transition: transform 0.3s;
    z-index: 1;
}

.game-card:hover .game-preview-icon {
    transform: scale(1.15);
}

.game-preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(transparent, rgba(0,0,0,0.15));
}

/* 各分类颜色 */
.game-preview.puzzle { background: linear-gradient(135deg, #a29bfe, #6c5ce7); }
.game-preview.arcade { background: linear-gradient(135deg, #fd79a8, #e84393); }
.game-preview.classic { background: linear-gradient(135deg, #ffeaa7, #fdcb6e); }
.game-preview.card { background: linear-gradient(135deg, #55efc4, #00b894); }
.game-preview.word { background: linear-gradient(135deg, #74b9ff, #0984e3); }
.game-preview.strategy { background: linear-gradient(135deg, #a29bfe, #a55eea); }
.game-preview.sports { background: linear-gradient(135deg, #55efc4, #00cec9); }
.game-preview.music { background: linear-gradient(135deg, #fd79a8, #e17055); }
.game-preview.racing { background: linear-gradient(135deg, #ff7675, #d63031); }
.game-preview.shooter { background: linear-gradient(135deg, #636e72, #2d3436); }

.game-info {
    padding: 1.2rem;
}

.game-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.game-info p {
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
}

.game-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #aaa;
}

.game-rating {
    color: #f39c12;
}

.game-plays {
    background: #f0f0f0;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
}

/* 标签 */
.game-tags {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.tag {
    padding: 0.2rem 0.6rem;
    background: #f0f0f0;
    border-radius: 10px;
    font-size: 0.75rem;
    color: #666;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 900px;
    max-height: 95vh;
    overflow: hidden;
    position: relative;
}

.modal-header {
    padding: 1rem 1.5rem;
    background: var(--gradient);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.3rem;
}

.close-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: 0.3s;
}

.close-btn:hover {
    background: rgba(255,255,255,0.4);
}

.game-container {
    background: #000;
    aspect-ratio: 16/10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.game-instructions {
    padding: 1.5rem;
}

.game-instructions h3 {
    margin-bottom: 1rem;
    color: var(--primary);
}

.controls-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.control-item {
    background: #f8f9fa;
    padding: 0.8rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.control-key {
    background: var(--dark);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* 页脚 */
footer {
    text-align: center;
    padding: 3rem 2rem;
    background: #f8f9fa;
    margin-top: 3rem;
}

footer a {
    color: var(--primary);
    text-decoration: none;
}

/* 响应式 */
@media (max-width: 768px) {
    .hero h1 { font-size: 1.8rem; }
    .hero p { font-size: 1rem; }
    main { padding: 1rem; }
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }
    .game-preview { height: 120px; font-size: 2.5rem; }
    .game-info { padding: 0.8rem; }
    .game-info h3 { font-size: 1rem; }
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 2rem;
    color: #888;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #ddd;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #888;
    grid-column: 1/-1;
}

.empty-state span {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
}

/* 搜索高亮 */
.highlight {
    background: #fff3cd;
    padding: 0 2px;
    border-radius: 2px;
}