/* 全局样式 */
:root {
    /* 苹果风格配色 */
    --apple-blue: #007aff;
    --apple-light-gray: #f5f5f7;
    --apple-gray: #d2d2d7;
    --apple-dark-gray: #86868b;
    --apple-black: #1d1d1f;
    --white: #ffffff;
    
    --container-width: 1200px;
    --border-radius: 10px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--apple-black);
    background-color: var(--apple-light-gray);
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: var(--apple-blue);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    opacity: 0.8;
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    background: none;
    transition: var(--transition);
}

/* 语言切换 */
.zh {
    display: none; /* 默认显示英文 */
}

body.lang-zh .zh {
    display: block;
}

body.lang-zh .en {
    display: none;
}

/* 头部样式 */
header {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--apple-blue);
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    padding: 8px 12px;
    border-radius: var(--border-radius);
    color: var(--apple-dark-gray);
}

nav ul li a.active, nav ul li a:hover {
    color: var(--apple-blue);
    background-color: rgba(0, 122, 255, 0.1);
}

/* 英雄区域 */
.hero {
    text-align: center;
    padding: 60px 0 40px;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.hero p {
    font-size: 1.2rem;
    color: var(--apple-dark-gray);
    max-width: 600px;
    margin: 0 auto;
}

/* 分类筛选 */
.categories {
    margin-bottom: 40px;
    text-align: center;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 20px;
    font-weight: 500;
}

.category-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.category-btn {
    padding: 10px 20px;
    background-color: var(--white);
    border-radius: var(--border-radius);
    color: var(--apple-dark-gray);
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.category-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.category-btn.active {
    background-color: var(--apple-blue);
    color: var(--white);
}

/* 游戏网格 */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    padding-bottom: 60px;
}

.game-card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.game-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.game-info {
    padding: 20px;
}

.game-title {
    font-size: 1.4rem;
    font-weight: 500;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-description {
    color: var(--apple-dark-gray);
    font-size: 0.95rem;
    margin-bottom: 15px;
    height: 60px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.game-category {
    display: inline-block;
    background-color: var(--apple-light-gray);
    color: var(--apple-blue);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.play-button {
    display: block;
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    background-color: var(--apple-blue);
    color: var(--white);
    text-align: center;
    border-radius: var(--border-radius);
    font-weight: 500;
}

.play-button:hover {
    opacity: 0.9;
}

/* 加载中 */
.loading {
    text-align: center;
    grid-column: 1 / -1;
    padding: 50px 0;
    color: var(--apple-dark-gray);
}

/* 游戏弹窗 */
.game-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    display: none;
}

.game-overlay.active {
    display: flex;
}

.game-modal {
    width: 95%;
    max-width: 1200px;
    background-color: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 90vh;
    max-height: 800px;
}

.game-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--apple-gray);
    min-height: 60px;
}

.game-modal-header h2 {
    font-size: 1.6rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.close-btn {
    font-size: 1.5rem;
    color: var(--apple-dark-gray);
    background: none;
    border: none;
    padding: 5px;
    transition: var(--transition);
}

.close-btn:hover {
    color: var(--apple-black);
    transform: scale(1.1);
}

.game-frame-container {
    position: relative;
    flex-grow: 1;
    width: 100%;
    height: calc(90vh - 60px);
    overflow: hidden;
}

/* 响应式游戏iframe */
.game-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    background-color: var(--apple-light-gray);
}

/* 嵌入错误提示 */
.embed-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
    text-align: center;
    background-color: var(--apple-light-gray);
}

.embed-error p {
    margin-bottom: 20px;
    color: var(--apple-dark-gray);
    font-size: 1.2rem;
    max-width: 600px;
}

.external-link {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--apple-blue);
    color: var(--white);
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
}

.external-link:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* 页脚 */
footer {
    background-color: var(--apple-black);
    color: var(--white);
    padding: 30px 0;
    text-align: center;
    margin-top: 30px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .game-modal {
        width: 100%;
        height: 100vh;
        max-height: none;
        border-radius: 0;
    }
    
    .game-modal-header h2 {
        font-size: 1.3rem;
    }

    .game-frame-container {
        height: calc(100vh - 60px);
    }
}

@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .category-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .game-modal-header {
        padding: 10px 15px;
    }

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

    .close-btn {
        font-size: 1.3rem;
    }
} 