/* 全局基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", sans-serif;
    text-decoration: none;
}

body {
    background-color: #f5f5f5;
    padding: 20px 0;
    scroll-behavior: smooth;
    background-image: url('../images/home-bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
}

/* 主页遮罩透明度从0.9→0.8，背景纹理更清晰 */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(245, 245, 245, 0.8);
    z-index: -1;
}

/* 页面容器：默认只显示首页，其他页面隐藏 */
.page { display: none; }
.page.active { display: block; }

/* 1. 首页样式 */
.home-header h2 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 28px;
    opacity: 0;
    animation: titleFade 0.8s ease forwards;
    cursor: pointer;
    transition: color 0.3s ease;
}

.home-header h2:hover { color: #6a1b9a; }

@keyframes titleFade {
    to { opacity: 1; transform: translateY(0); }
    from { opacity: 0; transform: translateY(-20px); }
}

.game-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 0 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.game-card {
    background: #fff;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transition: all 0.4s ease;
    overflow: hidden;
    cursor: pointer;
    opacity: 0;
    transform: translateY(30px);
    animation: cardFade 0.6s ease forwards;
}

.game-card:nth-child(1) { animation-delay: 0.2s; }
.game-card:nth-child(2) { animation-delay: 0.4s; }
.game-card:nth-child(3) { animation-delay: 0.6s; }
.game-card:nth-child(4) { animation-delay: 0.8s; }

@keyframes cardFade {
    to { opacity: 1; transform: translateY(0); }
    from { opacity: 0; transform: translateY(30px); }
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

/* 首页卡片图：hover 放大+阴影 */
.game-img {
    width: 100%;
    height: 160px;
    border-radius: 6px;
    margin-bottom: 12px;
    background: #f0f0f0 center/contain no-repeat;
    transition: all 0.3s ease;
}

.game-img:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.game-card h3 {
    color: #222;
    margin-bottom: 8px;
    font-size: 18px;
    text-align: center;
}

.game-tags {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.game-tags span {
    background-color: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
}

.game-brief {
    font-size: 13px;
    color: #555;
    text-align: center;
    line-height: 1.4;
    margin-bottom: 15px;
}

/* 新增：主页卡片下方 - 游戏特征+第九艺术解读区域 */
.game-art-intro {
    padding: 12px;
    background-color: #f8f8f8;
    border-radius: 6px;
    border-left: 3px solid;
    margin-top: 10px;
}

.game-art-intro .feature-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 6px;
    color: #333;
}

.game-art-intro .game-feature {
    font-size: 12px;
    color: #666;
    line-height: 1.3;
    margin-bottom: 8px;
}

.game-art-intro .art-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 6px;
    color: #333;
}

.game-art-intro .art-explain {
    font-size: 12px;
    color: #666;
    line-height: 1.3;
}

/* 首页卡片+新增区域 专属色彩（边框+标题） */
.p5r-card { border-top: 3px solid #e53935; }
.p5r-card .game-art-intro { border-left-color: #e53935; }
.p5r-card .feature-title,
.p5r-card .art-title { color: #e53935; }

.rdr2-card { border-top: 3px solid #8b4513; }
.rdr2-card .game-art-intro { border-left-color: #8b4513; }
.rdr2-card .feature-title,
.rdr2-card .art-title { color: #8b4513; }

.cp2077-card { border-top: 3px solid #6a1b9a; }
.cp2077-card .game-art-intro { border-left-color: #6a1b9a; }
.cp2077-card .feature-title,
.cp2077-card .art-title { color: #6a1b9a; }

.witcher3-card { border-top: 3px solid #4a148c; }
.witcher3-card .game-art-intro { border-left-color: #4a148c; }
.witcher3-card .feature-title,
.witcher3-card .art-title { color: #4a148c; }

/* 2. 详情页通用样式 + 各游戏专属背景图（透明度降低） */
.detail-page {
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
    min-height: 100vh;
    padding: 20px 0;
}

/* 详情页遮罩透明度从0.92→0.85，背景更突出 */
.detail-page::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.85);
    z-index: -1;
}

/* 给每个详情页配专属背景图，风格更贴合 */
#p5r-page { background-image: url('../images/p5r-bg.jpg'); }
#rdr2-page { background-image: url('../images/rdr2-bg.jpg'); }
#cp2077-page { background-image: url('../images/cp2077-bg.jpg'); }
#witcher3-page { background-image: url('../images/witcher3-bg.jpg'); }

.detail-header {
    max-width: 1200px;
    margin: 0 auto 30px;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-header h1 { font-size: 26px; }

.back-btn {
    padding: 8px 16px;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

/* 详情页内容区背景透明度从0.95→0.9，轻微透出页面背景 */
.detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 30px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.05);
}

.img-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 详情页主图：hover 放大+阴影 */
.main-img {
    width: 100%;
    height: 300px;
    border-radius: 8px;
    background: #f0f0f0 center/cover no-repeat;
    transition: all 0.3s ease;
}

.main-img:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}

.sub-img-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

/* 详情页副图：hover 放大+阴影 */
.sub-img {
    width: 100%;
    height: 140px;
    border-radius: 6px;
    background: #f0f0f0 center/cover no-repeat;
    transition: all 0.3s ease;
}

.sub-img:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.content-area { color: #333; }

.game-info { margin-bottom: 20px; }

.game-info h2 {
    font-size: 22px;
    margin-bottom: 10px;
    color: #222;
}

.tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.tags span {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
}

.score {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.score strong { font-size: 16px; }

.content-section {
    margin-bottom: 25px;
}

.content-section h3 {
    font-size: 18px;
    margin-bottom: 10px;
    padding-left: 10px;
    border-left: 3px solid;
}

.content-section p {
    font-size: 15px;
    line-height: 1.6;
    color: #555;
}

/* 3. 各游戏详情页专属色彩 */
#p5r-page .detail-header h1,
#p5r-page .score strong,
#p5r-page .content-section h3 { color: #e53935; }

#p5r-page .back-btn { background-color: #e53935; }
#p5r-page .back-btn:hover { background-color: #c62828; }
#p5r-page .tags span {
    background-color: #ffebee;
    color: #c62828;
}

#rdr2-page .detail-header h1,
#rdr2-page .score strong,
#rdr2-page .content-section h3 { color: #8b4513; }

#rdr2-page .back-btn { background-color: #8b4513; }
#rdr2-page .back-btn:hover { background-color: #6d3610; }
#rdr2-page .tags span {
    background-color: #f5e6d3;
    color: #6d3610;
}

#cp2077-page .detail-header h1,
#cp2077-page .score strong,
#cp2077-page .content-section h3 { color: #6a1b9a; }

#cp2077-page .back-btn { background-color: #6a1b9a; }
#cp2077-page .back-btn:hover { background-color: #511279; }
#cp2077-page .tags span {
    background-color: #f3e5f5;
    color: #511279;
}

#witcher3-page .detail-header h1,
#witcher3-page .score strong,
#witcher3-page .content-section h3 { color: #4a148c; }

#witcher3-page .back-btn { background-color: #4a148c; }
#witcher3-page .back-btn:hover { background-color: #380f6b; }
#witcher3-page .tags span {
    background-color: #efebe9;
    color: #380f6b;
}

/* 4. 响应式适配 */
@media (max-width: 768px) {
    .home-header h2 { font-size: 24px; margin-bottom: 25px; }
    .game-img { height: 140px; }

    .detail-container {
        grid-template-columns: 1fr;
        padding: 15px;
    }
    .main-img { height: 220px; }
    .sub-img { height: 120px; }
    .detail-header h1 { font-size: 22px; }
}

@media (max-width: 480px) {
    .game-list { padding: 0 15px; gap: 20px; }
    .game-card { padding: 12px; }
    .game-img { height: 120px; }
    .home-header h2 { font-size: 22px; margin-bottom: 20px; }

    .detail-header {
        flex-direction: column;
        gap: 15px;
    }
    .sub-img-group { grid-template-columns: 1fr; }
    .sub-img { height: 100px; }
}