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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.hidden {
    display: none !important;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    color: white;
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    color: white;
    text-align: center;
}

.error-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.error-content h2 {
    margin-bottom: 15px;
    font-size: 2rem;
}

.error-content button {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 20px;
    transition: background 0.3s ease;
}

.error-content button:hover {
    background: #ff5252;
}

.game-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 20px 0;
    margin-bottom: 40px;
}

.back-btn {
    color: white;
    text-decoration: none;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    margin-bottom: 15px;
    transition: opacity 0.3s ease;
}

.back-btn:hover {
    opacity: 0.8;
}

.game-header h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
}

.game-main {
    flex: 1;
    padding: 0 0 60px 0;
}

/* 游戏播放屏幕 */
.game-screen {
    height: 70vh;
    display: flex;
    flex-direction: column;
    background: #000;
}

/* 游戏信息屏幕 - 占据整个视口 */
.game-info-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 60px 0;
}

.game-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin: 0;
    align-items: start;
    width: 100%;
}

.game-image {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    background: #f8f9fa;
}

.game-image img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16/10;
    object-fit: cover;
}

/* 移除旧的 play-overlay 样式，现在直接显示游戏 */

/* iframe 游戏容器样式 */
.game-iframe-container {
    background: #000;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%; /* 占据游戏屏幕的全部高度 */
    align-items: center;
    justify-content: center;
}

.iframe-header {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    font-size: 14px;
    font-weight: 600;
}

.iframe-controls {
    display: flex;
    gap: 10px;
}

.control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.control-btn svg {
    width: 16px;
    height: 16px;
}

#game-iframe {
    width: 100%;
    max-width: 100vw;
    height: calc(100% - 52px); /* 减去头部高度 */
    border: none;
    display: block;
    /* 16:10 宽高比约束 */
    aspect-ratio: 16/10;
    object-fit: contain;
    background: #000;
}

/* 全屏状态 */
.game-iframe-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    height: 100vh;
}

.game-iframe-container.fullscreen #game-iframe {
    height: calc(100vh - 52px);
}

/* iframe 备用方案样式 */
.iframe-fallback {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    color: white;
}

.fallback-content {
    text-align: center;
    padding: 40px;
    max-width: 500px;
}

.fallback-content h2 {
    margin-bottom: 15px;
    color: #ff6b6b;
}

.fallback-content p {
    margin-bottom: 30px;
    color: #ccc;
    line-height: 1.6;
}

.fallback-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.fallback-actions .primary-btn,
.fallback-actions .secondary-btn {
    margin: 0;
}

/* 游戏信息面板样式 */
.game-info-panel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px 0;
    min-height: 30vh;
}

.game-info-compact {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 30px;
    align-items: start;
    padding: 30px;
}

.game-thumbnail {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.game-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16/10;
    object-fit: cover;
}

.game-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.game-meta-compact {
    display: flex;
    align-items: center;
    gap: 10px;
}

#game-title-compact {
    color: white;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

.description-compact {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    font-size: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-actions-compact {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* 信息面板中的按钮样式 */
.game-actions-compact .primary-btn {
    background: rgba(255, 107, 107, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 107, 107, 0.5);
}

.game-actions-compact .primary-btn:hover {
    background: rgba(255, 82, 82, 0.9);
    transform: translateY(-1px);
}

.game-actions-compact .secondary-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.game-actions-compact .secondary-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.game-info {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.game-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.category {
    background: #667eea;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.hot-badge {
    background: #ff6b6b;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

/* 信息面板中的分类和热门标记样式调整 */
.game-meta-compact .category,
.game-meta-compact .hot-badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.description {
    font-size: 18px;
    line-height: 1.7;
    color: #666;
    margin-bottom: 30px;
}

.game-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.primary-btn, .secondary-btn {
    padding: 15px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    border: none;
    cursor: pointer;
    text-align: center;
}

.primary-btn {
    background: #ff6b6b;
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.primary-btn:hover {
    background: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.secondary-btn {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e9ecef;
}

.secondary-btn:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.game-content {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.content-section {
    margin-bottom: 40px;
}

.content-section:last-child {
    margin-bottom: 0;
}

.content-section h2 {
    color: #333;
    font-size: 1.8rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.content-text {
    color: #555;
    line-height: 1.8;
    font-size: 16px;
}

.content-text h1 {
    font-size: 2rem;
    margin: 30px 0 15px 0;
    color: #333;
}

.content-text h2 {
    font-size: 1.6rem;
    margin: 25px 0 15px 0;
    color: #444;
    border: none;
}

.content-text h3 {
    font-size: 1.3rem;
    margin: 20px 0 10px 0;
    color: #555;
}

.content-text p {
    margin-bottom: 15px;
}

.content-text ul, .content-text ol {
    margin: 15px 0 15px 30px;
}

.content-text li {
    margin-bottom: 8px;
}

/* Markdown 样式增强 */
.content-text code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 0.9em;
    color: #d14;
}

.content-text pre {
    background: #f8f8f8;
    border: 1px solid #e1e1e8;
    border-radius: 6px;
    padding: 16px;
    overflow-x: auto;
    margin: 15px 0;
}

.content-text pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    color: #333;
}

.content-text blockquote {
    border-left: 4px solid #667eea;
    margin: 15px 0;
    padding: 10px 15px;
    background: #f9f9f9;
    color: #666;
    font-style: italic;
}

.content-text hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    margin: 30px 0;
    border-radius: 2px;
}

.content-text a {
    color: #667eea;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.content-text a:hover {
    border-bottom-color: #667eea;
}

.content-text strong {
    color: #333;
    font-weight: 600;
}

.content-text em {
    color: #555;
    font-style: italic;
}

.game-footer {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 30px 0;
    margin-top: 60px;
    text-align: center;
    color: white;
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .game-hero {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .game-header h1 {
        font-size: 2rem;
    }
    
    .game-info, .game-content {
        padding: 30px 20px;
    }
    
    .game-actions {
        flex-direction: column;
    }
    
    .primary-btn, .secondary-btn {
        width: 100%;
        text-align: center;
    }
    
    /* 移动端按钮优化 */
    
    /* 移动端游戏屏幕优化 */
    .game-info-screen {
        padding: 40px 0;
    }
}

@media (max-width: 480px) {
    .game-header {
        padding: 15px 0;
    }
    
    .game-header h1 {
        font-size: 1.5rem;
    }
    
    .game-info, .game-content {
        padding: 20px;
        margin: 0 -5px;
    }
    
    .content-section h2 {
        font-size: 1.5rem;
    }
    
    .description {
        font-size: 16px;
    }
    
    /* 移动端 iframe 游戏优化 */
    .iframe-header {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .control-btn {
        width: 28px;
        height: 28px;
    }
    
    .control-btn svg {
        width: 14px;
        height: 14px;
    }
    
    .game-screen {
        height: 60vh; /* 移动端减少游戏区域高度 */
    }
    
    #game-iframe {
        height: calc(100% - 44px);
        /* 在移动端保持 16:10 比例 */
        aspect-ratio: 16/10;
        max-height: calc(100vw * 10 / 16);
    }
    
    .game-iframe-container.fullscreen #game-iframe {
        height: calc(100vh - 44px);
        max-height: none;
    }
    
    /* 移动端游戏信息面板优化 */
    .game-info-panel {
        min-height: 40vh;
        padding: 20px 0;
    }
    
    .game-info-compact {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
    
    .game-thumbnail {
        max-width: 300px;
        margin: 0 auto;
    }
    
    #game-title-compact {
        font-size: 1.5rem;
    }
    
    .game-actions-compact {
        justify-content: center;
    }
}