/* ---------------------------------------------------------------------- */
/* games.css - 游戏列表和详情页特有样式 (最终完整优化版) */
/* ---------------------------------------------------------------------- */

/* ========== 列表页卡片样式 (Game Grid) ========== */
.game-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}
.game-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    display: block;
}
.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}
.card-cover {
    width: 100%;
    padding-top: 75%; /* 4:3 比例，可修改 */
    position: relative;
    background: var(--color-bg-light);
}
.card-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.card-info {
    padding: 12px;
}
.card-info h3 {
    font-size: 16px;
    color: var(--color-text-dark);
    /* 缩小间距 */
    margin-bottom: 4px; 
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.card-info .rating {
    font-size: 14px;
    color: var(--color-text-light);
}
.card-info .rating strong {
    color: var(--color-primary);
    font-weight: bold;
    margin-right: 4px;
}

/* ========== 详情页样式 (Game Detail) ========== */

/* 1. 顶部区域：确保与右侧栏顶部对齐 (移除负 margin) */
.game-header-area {
    background-color: #333; /* 黑色背景 */
    color: #fff;
    padding: 20px;
    /* 顶部不再负 margin，确保与右侧栏顶部对齐 */
    margin: 0 0 20px 0; 
    border-radius: 8px 8px 0 0;
}

/* 2. 信息盒子：缩小间距 */
.game-info-box {
    display: flex;
    /* 缩小间距 */
    gap: 20px; 
    max-width: 1200px;
    margin: 0 auto;
    align-items: flex-start;
}

.game-info-box img {
    width: 150px;
    height: 200px; /* 3:4 比例 */
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 5px 5px 15px rgba(50, 50, 50, 0.6); 
    flex-shrink: 0;
}

/* 3. 右侧信息容器：实现垂直对齐的关键 */
.game-meta { 
    flex-grow: 1; 
    display: flex;
    flex-direction: column; 
    /* 强制高度与封面图一致，实现底部平齐 */
    height: 200px; 
    /* 垂直方向两端对齐：标题/元数据在顶部，按钮在底部 */
    justify-content: space-between; 
}

.game-meta h1 {
    font-size: 32px;
    margin-bottom: 5px;
    color: #fff;
    margin-top: 0; /* 标题紧贴顶部 */
}

/* 4. 游戏元数据通用段落 p (包含原标题) */
.game-meta p {
    /* 缩小间距 */
    margin-bottom: 8px; 
    font-size: 16px;
}

/* 5. 游戏元数据行（发行年份/平台）的间距 */
.game-meta-row {
    display: flex;
    gap: 20px;
    margin-bottom: 10px; 
    font-size: 16px;
    color: #fff;
    /* ------------------------------------------- */
    /* 🚀 修复点：移除背景色 */
    background: none; /* 或者直接删除这一行 */
    /* ------------------------------------------- */
    padding: 5px 0; /* 移除左右 padding，防止间距过大 */
    border-radius: 5px;
    display: inline-flex; 
}

.game-meta-row .meta-item {
    display: flex;
    align-items: center;
}

.game-meta-row .meta-item i {
    margin-right: 5px;
    color: var(--color-primary); /* 使用主题色点缀图标 */
}

/* 6. 评分/开发者信息 */
.rating-dev-info {
    /* ------------------------------------------- */
    /* 🚀 优化点：将 margin-top 减少至 0，使其向上移动 */
    margin-top: 0px; 
    /* ------------------------------------------- */
    /* 保持与下载按钮的间距 */
    margin-bottom: 10px !important; 
}

.game-actions a {
    display: inline-block;
    background: var(--color-primary);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    margin-right: 15px;
    transition: opacity 0.2s;
}

.game-actions a:hover {
    opacity: 0.9;
}

/* 7. 通用内容框样式 */
.game-description,
.game-details-box,
.related-games,
.user-reviews {
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.game-description h2,
.game-details-box h3 {
    font-size: 24px;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 10px;
}


/* ========== 移动端响应式调整 (≤600px) ========== */
@media (max-width: 600px) {
    .layout-grid {
        display: flex;
        flex-direction: column;
    }

    /* 左侧导航栏隐藏 */
    .sidebar-left {
        display: none;
    }

    /* 中间内容区域 */
    .main-content-feed {
        order: 1;
    }
    
    /* 详情页优化 */
    .game-info-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
    }

    .game-info-box img {
        width: 120px;
        height: 160px;
    }
    
    /* 移动端恢复 game-meta 的高度，避免强制限制 */
    .game-meta {
        height: auto; 
    }
    
    /* 移动端内容居中 */
    .game-meta-row {
        justify-content: center;
        margin-left: auto;
        margin-right: auto;
    }
    
    /* 评分信息也居中 */
    .rating-dev-info {
        text-align: center;
    }

    .game-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
        margin-top: 10px;
    }

    .game-actions a {
        margin-right: 0;
        text-align: center;
    }

    /* 右侧内容移动到中间并调整顺序 */
    .sidebar-right {
        display: flex;
        flex-direction: column;
        order: 2; /* 保证在封面之后显示 */
        padding: 0 15px; /* 移动端增加水平 padding */
    }

    .game-details-box {
        order: 1; /* 游戏信息在最上 */
        margin-top: 15px;
    }

    .game-description {
        order: 2;
    }

    .user-reviews {
        order: 3;
    }

    .related-games {
        display: none; /* 移动端隐藏相关游戏 */
    }
}