/* City Builder 游戏的样式 */
.game-page {
    background-color: #f5f7fa;
}

/* 确保游戏内容区域使用正确的网格布局 */
.game-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    margin-bottom: 40px;
}

@media (min-width: 992px) {
    .game-content {
        grid-template-columns: 65fr 35fr; /* 更优化的比例：65%游戏区域，35%推荐区域 */
        align-items: start; /* 确保顶部对齐 */
    }
    
    /* 游戏主内容区域 */
    .game-main {
        display: flex;
        flex-direction: column;
    }
    
    /* 相关游戏卡片优化 */
    .related-games {
        align-self: flex-start; /* 从顶部开始对齐 */
        position: sticky;
        top: 20px;
    }
}

/* 调整游戏框架尺寸 */
.game-frame {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    background-color: #fff;
    position: relative;
    height: 480px; /* 减小游戏框高度 */
    width: 100%;
    max-width: 100%;
}

.game-frame iframe {
    width: 100%;
    height: 480px; /* 减小iframe高度 */
    border: none;
}

.game-controls {
    display: flex;
    justify-content: center;
    margin-top: 15px;
    gap: 15px;
}

.game-controls button {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    background: linear-gradient(135deg, #0056b3 0%, #0d6efd 100%);
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(13, 110, 253, 0.2);
}

.game-controls button i {
    margin-right: 8px;
}

.game-controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(13, 110, 253, 0.3);
}

.game-description {
    margin-top: 30px;
    background-color: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.game-description h2 {
    color: #212529;
    margin-bottom: 15px;
    font-size: 24px;
}

.game-description h3 {
    color: #0d6efd;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 20px;
}

.game-description p {
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 15px;
}

.game-description ul {
    padding-left: 20px;
    margin-bottom: 20px;
}

.game-description ul li {
    margin-bottom: 8px;
    color: #6c757d;
}

.social-share {
    margin-top: 30px;
    background-color: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.social-share h3 {
    color: #212529;
    margin-bottom: 15px;
    font-size: 20px;
}

.share-buttons {
    display: flex;
    gap: 15px;
}

.share-buttons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #0d6efd;
    color: white;
    transition: all 0.3s ease;
}

.share-buttons a:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(13, 110, 253, 0.3);
}

.share-buttons a.facebook {
    background-color: #3b5998;
}

.share-buttons a.twitter {
    background-color: #1da1f2;
}

.share-buttons a.instagram {
    background: linear-gradient(45deg, #405de6, #5851db, #833ab4, #c13584, #e1306c, #fd1d1d);
}

.share-buttons a.pinterest {
    background-color: #bd081c;
}

.game-comments {
    margin-top: 30px;
    background-color: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.game-comments h3 {
    color: #212529;
    margin-bottom: 20px;
    font-size: 20px;
}

.comment-form {
    margin-bottom: 30px;
}

.comment-form textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    resize: none;
    height: 120px;
    font-family: inherit;
    margin-bottom: 15px;
    transition: border-color 0.3s ease;
}

.comment-form textarea:focus {
    border-color: #0d6efd;
    outline: none;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

.comment-form button {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(13, 110, 253, 0.25);
}

.comment-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(13, 110, 253, 0.35);
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.comment {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.comment:last-child {
    border-bottom: none;
}

.comment-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-weight: bold;
    font-size: 20px;
    flex-shrink: 0;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.comment-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.comment-date {
    font-size: 14px;
    color: #6c757d;
}

.comment-content p {
    font-size: 15px;
    line-height: 1.5;
    color: #444;
    margin-bottom: 10px;
}

.comment-actions {
    display: flex;
    gap: 10px;
}

.comment-actions button {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 5px 10px;
    border-radius: 20px;
}

.comment-actions button:hover {
    color: #0d6efd;
    background-color: #f8f9fa;
}

/* 相关游戏部分样式 */
.related-games {
    margin-top: 0; /* 移除顶部边距，保持与主内容对齐 */
    background-color: white;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    height: 100%; /* 确保高度撑满 */
}

.related-games h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f2f5;
}

/* 移除旧的装饰线样式 */
.related-games h2::after {
    display: none;
}

.games-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 20px;
}

/* 游戏卡片样式统一 */
.game-card {
    border-radius: 12px;
    overflow: hidden;
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

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

.game-card-image {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 60%;
    overflow: hidden;
}

.game-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.game-card:hover .game-card-image img {
    transform: scale(1.05);
}

.game-card-rating {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #007aff, #5ac8fa);
    color: white;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.game-card-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.game-card-info h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.game-card-info p {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.play-btn {
    display: block;
    padding: 10px;
    text-align: center;
    background: linear-gradient(to bottom, #007aff, #0062cc);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    margin-top: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.play-btn:hover {
    background: linear-gradient(to bottom, #0062cc, #004c9e);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

@media (min-width: 768px) and (max-width: 991px) {
    .related-games .games-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
}

@media (max-width: 767px) {
    .related-games .games-grid {
        grid-template-columns: 1fr;
    }
    
    .game-card {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .related-games {
        padding: 15px;
    }
    
    .related-games h2 {
        font-size: 20px;
    }
}

/* City Builder游戏特定样式 */

/* 游戏截图样式 */
.city-screenshots {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 25px 0;
}

.city-screenshot {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.city-screenshot:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 按钮悬停效果增强 */
.game-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(13, 110, 253, 0.4);
}

.play-btn:hover {
    letter-spacing: 1px;
    transform: translateY(-2px);
}

/* iframe加载中样式 */
.game-frame {
    position: relative;
}

.game-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 0;
}

.game-frame iframe {
    position: relative;
    z-index: 1;
}

/* City Builder游戏样式 */

/* 游戏容器 */
#game-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background-color: #87CEEB;
}

/* 在iframe内的样式 */
body.city-builder-game {
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: Arial, sans-serif;
    background-color: #87CEEB;
}

.city-builder-game .game-container {
    position: relative;
    width: 100%;
    height: 100vh;
}

/* 游戏UI元素 */
.city-builder-game .game-ui {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    border-radius: 5px;
    z-index: 100;
}

.city-builder-game .resources {
    display: flex;
    gap: 15px;
    align-items: center;
}

.city-builder-game .resource {
    display: flex;
    align-items: center;
    gap: 5px;
}

.city-builder-game .resource i {
    font-size: 16px;
}

/* 工具栏 */
.city-builder-game .toolbar {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 5px;
    display: flex;
    gap: 10px;
    z-index: 100;
}

.city-builder-game .tool {
    width: 50px;
    height: 50px;
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 24px;
}

.city-builder-game .tool:hover {
    background-color: #e9ecef;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.city-builder-game .tool.active {
    background-color: #007bff;
    color: white;
    border-color: #0056b3;
}

/* 游戏地图 */
.city-builder-game .game-map {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: #8BC34A;
    overflow: hidden;
}

.city-builder-game .grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 3000px;
    height: 3000px;
    background-image: 
        linear-gradient(#00000015 1px, transparent 1px),
        linear-gradient(90deg, #00000015 1px, transparent 1px);
    background-size: 50px 50px;
    transform-origin: 0 0;
}

/* 建筑物 */
.city-builder-game .building {
    position: absolute;
    z-index: 10;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
}

.city-builder-game .building.residential {
    background-color: #2196F3;
    border: 2px solid #1976D2;
}

.city-builder-game .building.commercial {
    background-color: #FF9800;
    border: 2px solid #F57C00;
}

.city-builder-game .building.industrial {
    background-color: #FFEB3B;
    border: 2px solid #FBC02D;
}

.city-builder-game .building.park {
    background-color: #4CAF50;
    border: 2px solid #388E3C;
}

.city-builder-game .building:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* 道路 */
.city-builder-game .road {
    position: absolute;
    background-color: #616161;
    z-index: 5;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
}

/* 信息面板 */
.city-builder-game .info-panel {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 250px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px;
    border-radius: 5px;
    z-index: 100;
}

.city-builder-game .info-panel h3 {
    margin-top: 0;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 18px;
}

.city-builder-game .info-panel p {
    margin: 8px 0;
    font-size: 14px;
}

/* 状态消息 */
.city-builder-game .status-message {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    max-width: 80%;
    text-align: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.city-builder-game .status-message.hidden {
    opacity: 0;
}

/* 动画效果 */
@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    70% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.city-builder-game .building,
.city-builder-game .road {
    animation: popIn 0.3s ease;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .city-builder-game .toolbar {
        flex-wrap: wrap;
        justify-content: center;
        width: 80%;
    }
    
    .city-builder-game .info-panel {
        width: 200px;
        font-size: 12px;
    }
    
    .city-builder-game .resources {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* 自定义游戏页面样式 */
.game-page-wrapper .game-frame {
    background-color: #87CEEB;
}

.game-controls button {
    transition: all 0.3s ease;
}

.game-controls button:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.game-description p {
    line-height: 1.6;
}

.city-screenshots {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.city-screenshot {
    flex: 1;
    min-width: 250px;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.city-screenshot:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.feature-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.feature-item {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.feature-item:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.feature-item i {
    font-size: 24px;
    margin-bottom: 10px;
    color: #007bff;
}

.feature-item h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
}

.feature-item p {
    margin: 0;
    font-size: 14px;
    color: #6c757d;
}

/* 响应式尺寸调整 */
@media (max-width: 768px) {
    .game-frame {
        height: 400px;
    }
    
    .game-frame iframe {
        height: 400px;
    }
    
    .related-games {
        margin-top: 25px;
    }
}

@media (max-width: 576px) {
    .game-frame {
        height: 350px;
    }
    
    .game-frame iframe {
        height: 350px;
    }
}

/* 确保相关游戏区域样式统一 */
.game-main {
    height: 100%;
}

.related-games .games-grid .game-card {
    margin-bottom: 15px;
} 