/* ========== 通用重置 ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: #333;
    background: #f5f5f5;
    line-height: 1.6;
}
a { color: #1976d2; text-decoration: none; transition: color .2s; }
a:hover { color: #d32f2f; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 15px; }

/* ========== 头部 ========== */
.header-wrap { background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.08); position: sticky; top: 0; z-index: 100; }
.site-header { padding: 0; }
.site-header .container { display: flex; align-items: center; height: 64px; flex-wrap: wrap; }
.logo { font-size: 22px; font-weight: bold; margin-right: 30px; }
.logo a { color: #d32f2f; }
.main-nav { flex: 1; }
.main-nav ul { display: flex; gap: 4px; }
.main-nav li a { display: block; padding: 10px 16px; color: #333; border-radius: 4px; font-size: 16px; }
.main-nav li a:hover, .main-nav li.active a { background: #d32f2f; color: #fff; }
.search-box { display: flex; }
.search-box form { display: flex; }
.search-box input { padding: 8px 12px; border: 1px solid #ddd; border-right: none; border-radius: 4px 0 0 4px; width: 160px; outline: none; }
.search-box button { padding: 8px 18px; background: #d32f2f; color: #fff; border: none; border-radius: 0 4px 4px 0; cursor: pointer; }
.menu-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.menu-toggle span { width: 24px; height: 3px; background: #d32f2f; border-radius: 2px; transition: .3s; }

/* ========== 主容器 ========== */
.main-container { min-height: calc(100vh - 64px - 100px); padding: 20px 0 40px; }

/* ========== 轮播图 ========== */
.banner-wrap { position: relative; margin-bottom: 24px; }
.banner-list { position: relative; height: 360px; overflow: hidden; border-radius: 8px; }
.banner-item { position: absolute; inset: 0; opacity: 0; transition: opacity .6s; }
.banner-item.active { opacity: 1; }
.banner-item a { display: block; width: 100%; height: 100%; }
.banner-item img { width: 100%; height: 100%; object-fit: cover; }
.banner-item .title { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 20px 14px; background: linear-gradient(transparent, rgba(0,0,0,.7)); color: #fff; font-size: 20px; font-weight: bold; }
.banner-dots { position: absolute; right: 16px; bottom: 16px; display: flex; gap: 8px; z-index: 2; }
.banner-dots span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.5); cursor: pointer; }
.banner-dots span.active { background: #d32f2f; }

/* ========== 区块标题 ========== */
.section { background: #fff; border-radius: 8px; padding: 20px; margin-bottom: 24px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid #f0f0f0; }
.section-head h2 { font-size: 20px; color: #d32f2f; position: relative; padding-left: 14px; }
.section-head h2::before { content: ''; position: absolute; left: 0; top: 4px; bottom: 4px; width: 4px; background: #d32f2f; border-radius: 2px; }
.section-head .more { font-size: 14px; color: #999; }
.section-head .more:hover { color: #d32f2f; }

/* ========== 主布局 ========== */
.layout-2col { display: grid; grid-template-columns: 1fr 300px; gap: 24px; }
@media (max-width: 900px) { .layout-2col { grid-template-columns: 1fr; } }

/* ========== 游戏卡片 ========== */
.game-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
@media (max-width: 1000px) { .game-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 700px) { .game-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; } }
@media (max-width: 480px) { .game-grid { grid-template-columns: repeat(2, 1fr); } }
.game-card { background: #fff; border-radius: 8px; overflow: hidden; transition: transform .2s, box-shadow .2s; }
.game-card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,.1); }
.game-card .thumb { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: #f0f0f0; }
.game-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.game-card .thumb .tag { position: absolute; top: 6px; left: 6px; background: rgba(211,47,47,.9); color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 3px; }
.game-card .info { padding: 10px; }
.game-card .title { font-size: 14px; font-weight: bold; color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-card .meta { font-size: 12px; color: #999; margin-top: 4px; }
.game-card .btn-view { display: block; text-align: center; background: #1976d2; color: #fff; padding: 6px; font-size: 13px; margin-top: 8px; border-radius: 4px; }
.game-card .btn-view:hover { background: #1565c0; }

/* ========== 分类筛选 ========== */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.filter-bar a { padding: 6px 16px; background: #f0f0f0; border-radius: 16px; color: #555; font-size: 14px; }
.filter-bar a:hover, .filter-bar a.active { background: #d32f2f; color: #fff; }

/* ========== 资讯列表 ========== */
.article-list li { padding: 10px 0; border-bottom: 1px dashed #eee; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.article-list li:last-child { border-bottom: none; }
.article-list .a-title { color: #333; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.article-list .a-title:hover { color: #d32f2f; }
.article-list .a-date { color: #999; font-size: 12px; }
.article-list.with-thumb li { display: flex; gap: 12px; padding: 12px 0; }
.article-list.with-thumb .a-thumb { width: 90px; height: 60px; flex-shrink: 0; border-radius: 4px; overflow: hidden; }
.article-list.with-thumb .a-thumb img { width: 100%; height: 100%; object-fit: cover; }
.article-list.with-thumb .a-content { flex: 1; }
.article-list.with-thumb .a-title2 { font-weight: bold; color: #333; font-size: 15px; display: block; margin-bottom: 4px; }
.article-list.with-thumb .a-desc { color: #777; font-size: 13px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ========== 游戏详情 ========== */
.game-detail { }
.game-detail .gd-top { display: flex; gap: 24px; background: #fff; padding: 24px; border-radius: 8px; margin-bottom: 24px; }
.game-detail .gd-icon { width: 140px; height: 140px; flex-shrink: 0; border-radius: 12px; overflow: hidden; background: #f0f0f0; }
.game-detail .gd-icon img { width: 100%; height: 100%; object-fit: cover; }
.game-detail .gd-info { flex: 1; }
.game-detail .gd-info h1 { font-size: 26px; margin-bottom: 12px; }
.game-detail .gd-meta { display: flex; flex-wrap: wrap; gap: 20px; color: #888; font-size: 14px; margin-bottom: 12px; }
.game-detail .gd-meta span b { color: #333; }
.game-detail .gd-tags a { display: inline-block; padding: 2px 10px; background: #fff3e0; color: #e65100; border-radius: 12px; font-size: 12px; margin-right: 8px; }
.game-detail .gd-tags a:hover { background: #ffe0b2; }
.game-detail .gd-download { margin-top: 16px; }
.game-detail .btn-download { display: inline-block; padding: 12px 40px; background: #d32f2f; color: #fff; border-radius: 6px; font-size: 16px; font-weight: bold; }
.game-detail .btn-download:hover { background: #b71c1c; }
.game-detail .gd-score { display: inline-block; background: #ff9800; color: #fff; padding: 4px 10px; border-radius: 4px; font-weight: bold; margin-bottom: 8px; }

.breadcrumb { padding: 12px 0; color: #999; font-size: 13px; }
.breadcrumb a { color: #666; }
.breadcrumb a:hover { color: #d32f2f; }
.breadcrumb span { margin: 0 6px; color: #ccc; }

.content-block { background: #fff; border-radius: 8px; padding: 24px; margin-bottom: 24px; line-height: 1.8; }
.content-block h1, .content-block h2, .content-block h3, .content-block h4 { margin: 18px 0 10px; color: #222; }
.content-block h3 { font-size: 18px; border-left: 4px solid #d32f2f; padding-left: 10px; }
.content-block p { margin-bottom: 12px; color: #444; }
.content-block img { max-width: 100%; border-radius: 6px; margin: 10px 0; }
.content-block ul, .content-block ol { margin: 10px 0 10px 20px; }
.content-block li { margin-bottom: 6px; }

/* 游戏信息表 */
.game-info-table { width: 100%; border-collapse: collapse; }
.game-info-table th, .game-info-table td { padding: 10px; border: 1px solid #eee; text-align: left; }
.game-info-table th { background: #fafafa; width: 120px; color: #666; }

/* 截图 */
.screenshots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 600px) { .screenshots { grid-template-columns: repeat(2, 1fr); } }
.screenshots img { width: 100%; border-radius: 6px; cursor: pointer; transition: transform .2s; }
.screenshots img:hover { transform: scale(1.02); }

/* 版本列表 */
.version-list li { padding: 12px; border: 1px solid #eee; border-radius: 6px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.version-list a { font-weight: bold; }

/* ========== 分页 ========== */
.pagination { text-align: center; margin-top: 24px; }
.pagination ul { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.pagination li a, .pagination li.ellipsis { display: block; min-width: 36px; padding: 8px 12px; background: #fff; border: 1px solid #eee; border-radius: 4px; color: #555; }
.pagination li.active a { background: #d32f2f; color: #fff; border-color: #d32f2f; }
.pagination li.ellipsis { border: none; background: transparent; }

/* ========== 侧边栏 ========== */
.sidebar .section { padding: 16px; }
.sidebar .game-mini { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed #eee; }
.sidebar .game-mini:last-child { border-bottom: none; }
.sidebar .game-mini img { width: 50px; height: 50px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.sidebar .game-mini .gm-title { font-size: 13px; color: #333; font-weight: bold; }
.sidebar .game-mini .gm-meta { font-size: 12px; color: #999; margin-top: 2px; }

/* ========== 页脚 ========== */
.site-footer { background: #2c2c2c; color: #aaa; padding: 28px 0; text-align: center; }
.site-footer a { color: #ccc; }
.site-footer .copyright { margin-bottom: 6px; }
.site-footer .powered { font-size: 12px; color: #777; }

/* ========== 搜索结果 ========== */
.search-result .result-item { padding: 14px 0; border-bottom: 1px solid #eee; }
.search-result .result-item a { font-size: 16px; font-weight: bold; }

/* ========== 移动端 ========== */
@media (max-width: 768px) {
    .container { padding: 0 10px; }
    .site-header .container { height: auto; padding: 10px; flex-wrap: wrap; }
    .logo { font-size: 18px; margin-right: auto; }
    .menu-toggle { display: flex; }
    .main-nav { flex-basis: 100%; max-height: 0; overflow: hidden; transition: max-height .3s; order: 3; }
    .main-nav.open { max-height: 600px; }
    .main-nav ul { flex-direction: column; gap: 0; }
    .main-nav li a { padding: 12px 16px; border-radius: 0; border-bottom: 1px solid #f5f5f5; }
    .search-box { width: 100%; margin-top: 10px; }
    .search-box input { flex: 1; width: auto; }

    .banner-list { height: 200px; }
    .banner-item .title { font-size: 16px; padding: 30px 14px 10px; }
    .section { padding: 14px; }
    .section-head h2 { font-size: 18px; }

    .game-detail .gd-top { flex-direction: column; padding: 16px; }
    .game-detail .gd-icon { width: 100px; height: 100px; margin: 0 auto 14px; }
    .game-detail .gd-info { text-align: center; }
    .game-detail .gd-info h1 { font-size: 20px; }
    .game-detail .gd-meta { justify-content: center; gap: 10px 20px; }
    .game-detail .gd-tags { text-align: center; }
    .game-detail .gd-download { text-align: center; }

    .content-block { padding: 16px; }
    .game-info-table th { width: 90px; }

    .pagination li a, .pagination li.ellipsis { padding: 6px 10px; min-width: 32px; }
}

@media (max-width: 480px) {
    .game-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .article-list.with-thumb .a-thumb { width: 70px; height: 48px; }
}
