/* =========================================================
   折扣手游大全 discount_games —— 对齐 wxminigame 设计体系（科技蓝浅色风）
   前缀 dg-，复用主站 :root 变量与 .btn/.btn-primary 等基础组件
   ========================================================= */
.page-wrap { width: 100%; }

/* ---------- 左右布局（对齐 wxminigame 的 .wxmg-page） ---------- */
.dg-page { max-width: 1200px; margin: 0 auto 40px; padding: 0; display: flex; gap: 24px; align-items: flex-start; box-sizing: border-box; width: 100%; overflow-x: hidden; }
.dg-main { flex: 1; min-width: 0; }
.dg-sidebar { width: 300px; flex: 0 0 300px; }

/* ---------- 首屏 header：与 wxminigame 首页标题板块同款（蓝色渐变 + 居中白字） ---------- */
.dg-header { background: linear-gradient(135deg, #1890ff, #0056b3); color: #fff; border-radius: 8px; padding: 24px; margin-bottom: 20px; text-align: center; }
.dg-header h1 { margin: 0 0 8px; font-size: 26px; font-weight: 700; color: #fff; }
.dg-header p { margin: 0; opacity: .9; font-size: 14px; color: #fff; line-height: 1.7; }

/* ---------- 板块（section_block 宏） ---------- */
.dg-block { background: var(--white); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 24px; box-shadow: var(--shadow); }
.dg-block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; border-left: 4px solid var(--primary-color); padding-left: 12px; }
.dg-block-title { font-size: 19px; font-weight: 700; color: var(--text-color); line-height: 1.4; }
.dg-block-more { font-size: 13px; color: var(--primary-color); white-space: nowrap; }
.dg-block-more:hover { color: var(--primary-hover); }
.dg-block-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

/* ---------- 游戏列表网格（横向卡片，2 列） ---------- */
.dg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

/* ---------- 游戏列表项：logo + 名称 + 简介 + 标签（分类/类型/题材） ---------- */
.dg-card { display: flex; align-items: flex-start; gap: 12px; padding: 12px; background: var(--white); border: 1px solid var(--border-color); border-radius: 10px; color: var(--text-color); text-decoration: none; transition: all .25s; min-width: 0; }
.dg-card:hover { border-color: var(--primary-color); box-shadow: 0 6px 18px rgba(24,144,255,.15); transform: translateY(-2px); }
.dg-card-logo { position: relative; width: 64px; height: 64px; flex: 0 0 64px; border-radius: 12px; background: #f5f7fa; overflow: hidden; }
/* logo 覆盖在占位符之上：定位元素必须显式给 z-index，否则会被同样定位的占位 🎮 盖住 */
.dg-card-logo img { position: absolute; inset: 0; z-index: 1; display: block; width: 100%; height: 100%; object-fit: cover; }
/* 图片加载失败时 img 被 onerror 移除，自动露出这层占位符 */
.dg-card-logo-ph { position: absolute; inset: 0; z-index: 0; display: flex; align-items: center; justify-content: center; font-size: 30px; background: linear-gradient(135deg,#e6f4ff,#f0f5ff); }
.dg-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.dg-card-title { font-size: 15px; font-weight: 600; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dg-card-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 38px; }
.dg-card-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.dg-card-tag { font-size: 11px; padding: 2px 8px; border-radius: 4px; background: #f3f6fb; color: #666; white-space: nowrap; }
.dg-card-tag-cat { background: #e6f7ff; color: var(--primary-color); }
.dg-card-tag-theme { background: #f6ffed; color: #52c41a; }
/* 兼容右侧栏热榜占位符（旧类名保留） */
.dg-card-noimg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 42px; background: linear-gradient(135deg,#e6f4ff,#f0f5ff); }

/* ---------- 排行榜 tabs ---------- */
.dg-rank-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.dg-rank-tab { display: inline-block; padding: 6px 16px; border: 1px solid var(--border-color); border-radius: 999px; color: #555; font-size: 14px; text-decoration: none; transition: all .15s; background: #fff; cursor: pointer; }
.dg-rank-tab:hover { border-color: var(--primary-color); color: var(--primary-color); }
.dg-rank-tab.active { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }
.dg-rank-pane { display: none; }
.dg-rank-pane.active { display: block; }

/* ---------- 排行榜行（仿 milu 底部排行榜：排名 + logo + 名称/版本 + 游戏专区） ---------- */
.dg-rank-list { display: flex; flex-direction: column; }
.dg-rank-row { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid #f0f2f5; transition: background .15s; }
.dg-rank-row:last-child { border-bottom: none; }
.dg-rank-row:hover { background: #f7fbff; }
.dg-rank-num { font-size: 16px; font-weight: 700; color: #bbb; min-width: 26px; text-align: center; flex: 0 0 26px; }
.dg-rank-num.top { color: #ff4d4f; font-size: 18px; }
.dg-rank-logo { width: 52px; height: 52px; flex: 0 0 52px; border-radius: 12px; overflow: hidden; background: #f0f5ff; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.dg-rank-logo img { width: 100%; height: 100%; object-fit: cover; }
.dg-rank-logo-ph { font-size: 26px; }
.dg-rank-info { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.dg-rank-name { max-width: 100%; font-size: 15px; font-weight: 600; color: #333; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dg-rank-name:hover { color: var(--primary-color); }
.dg-rank-version { max-width: 100%; font-size: 12px; line-height: 1.5; color: var(--primary-color); background: #e6f4ff; border-radius: 4px; padding: 1px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-rank-zone { flex: 0 0 auto; padding: 6px 14px; border: 1px solid var(--primary-color); border-radius: 6px; color: var(--primary-color); font-size: 13px; text-decoration: none; white-space: nowrap; transition: all .15s; }
.dg-rank-zone:hover { background: var(--primary-color); color: #fff; }
.dg-rank-empty { text-align: center; color: #999; padding: 30px 0; margin: 0; }

/* ---------- FAQ ---------- */
.dg-faq-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.dg-faq-item { padding: 12px 14px; background: #fafbfc; border: 1px solid #eef0f3; border-radius: 10px; }
.dg-faq-q { font-size: 15px; font-weight: 600; color: var(--text-color); margin-bottom: 6px; }
.dg-faq-a { font-size: 14px; line-height: 1.8; color: #555; }

/* ---------- 简介 / 注意事项 ---------- */
.dg-intro-text { font-size: 14px; line-height: 1.9; color: #555; margin: 0; }
.dg-notice { background: #fff7e6; border-radius: 8px; padding: 14px 16px; }
.dg-notice-title { font-size: 15px; font-weight: 600; color: #d48806; margin-bottom: 10px; }
.dg-notice-list { list-style: none; padding: 0; margin: 0; }
.dg-notice-list li { font-size: 14px; color: #666; line-height: 1.8; padding-left: 20px; position: relative; margin-bottom: 6px; }
.dg-notice-list li::before { content: "•"; position: absolute; left: 0; color: #faad14; font-weight: bold; }

/* ---------- 右侧侧栏（平台/分类/类型/题材/热门榜/工具） ---------- */
.dg-side-card { background: var(--white); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow); }
.dg-side-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; padding-left: 10px; border-left: 4px solid var(--primary-color); }
.dg-side-search { display: flex; gap: 8px; }
.dg-side-search input { flex: 1; min-width: 0; height: 38px; padding: 0 12px; border: 1px solid var(--border-color); border-radius: var(--radius); font-size: 13px; outline: none; }
.dg-side-search input:focus { border-color: var(--primary-color); }
.dg-side-search .btn { height: 38px; padding: 0 16px; font-size: 13px; }
.dg-side-tags { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.dg-side-tag { display: inline-block; padding: 5px 13px; background: #f3f6fb; border-radius: 14px; color: #555; font-size: 13px; text-decoration: none; transition: all .15s; }
.dg-side-tag:hover { background: var(--primary-color); color: #fff; }
.dg-side-rank { display: flex; flex-direction: column; gap: 8px; }
.dg-side-rank-item { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text-color); padding: 6px 8px; border-radius: 8px; transition: background .15s; position: relative; }
.dg-side-rank-item:hover { background: #f0f5ff; }
.dg-side-rank-no { font-size: 14px; font-weight: 700; color: #999; min-width: 18px; text-align: center; }
.dg-side-rank-no.top { color: #ff4d4f; }
.dg-side-rank-icon { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; background: #f5f5f5; flex-shrink: 0; }
.dg-side-rank-name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-side-tools { display: flex; flex-direction: column; gap: 8px; }
.dg-side-tool { display: flex; align-items: center; padding: 8px 10px; background: #f8f9fa; border-radius: 8px; text-decoration: none; transition: all .2s; }
.dg-side-tool:hover { background: #e8f4ff; }
.dg-side-tool-icon { width: 32px; height: 32px; margin-right: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex: 0 0 32px; }
.dg-side-tool-icon img { width: 100%; height: 100%; object-fit: contain; }
.dg-side-tool-name { color: #333; font-size: 14px; }
.dg-side-tool:hover .dg-side-tool-name { color: var(--primary-color); }

/* ---------- 档位分类导航已下线（按需求移除） ---------- */

/* ---------- 折扣手游盒子卡片 ---------- */
.dg-box-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.dg-box-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; background: #f8f9fa; border: 1px solid var(--border-color); border-radius: 10px; min-width: 0; }
.dg-box-logo { width: 52px; height: 52px; flex: 0 0 52px; border-radius: 12px; background: linear-gradient(135deg,#e6f4ff,#f0f5ff); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.dg-box-logo img { width: 100%; height: 100%; object-fit: cover; }
.dg-box-logo span { font-size: 22px; font-weight: 700; color: var(--primary-color); }
.dg-box-info { flex: 1; min-width: 0; }
.dg-box-name { font-size: 15px; font-weight: 600; color: var(--text-color); margin-bottom: 4px; }
.dg-box-intro { font-size: 12px; line-height: 1.6; color: var(--text-secondary); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- 热门文字链 ---------- */
.dg-hot-links { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.dg-hot-links a { display: inline-block; padding: 5px 12px; background: #f3f6fb; border-radius: 6px; font-size: 13px; color: #555; text-decoration: none; }
.dg-hot-links a:hover { background: #e6f7ff; color: var(--primary-color); }

/* ---------- 分类子页分页 ---------- */
.dg-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin: -8px 0 24px; }
.dg-pager-btn { padding: 6px 13px; border: 1px solid var(--border-color); border-radius: 6px; background: #fff; color: #555; font-size: 13px; text-decoration: none; }
.dg-pager-btn:hover { border-color: var(--primary-color); color: var(--primary-color); }
.dg-pager-btn.active { background: var(--primary-color); border-color: var(--primary-color); color: #fff; }
.dg-pager-total { font-size: 12px; color: #999; margin-left: 8px; }

/* =========================================================
   响应式（对齐 wxminigame 的 1024 / 900 / 768 断点）
   ========================================================= */
@media (max-width: 1024px) {
    .dg-sidebar { width: 280px; flex-basis: 280px; }
    .dg-box-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
    .dg-page { flex-direction: column; padding: 0 12px; gap: 16px; }
    .dg-sidebar { width: 100%; flex: none; }
}
@media (max-width: 768px) {
    .dg-header { padding: 18px; }
    .dg-header h1 { font-size: 22px; }
    .dg-block { padding: 16px 14px; }
    .dg-block-title { font-size: 17px; }
    .dg-grid { grid-template-columns: 1fr; gap: 10px; }
    .dg-card-logo { width: 56px; height: 56px; flex-basis: 56px; }
    .dg-rank-tabs { gap: 6px; }
    .dg-rank-tab { padding: 5px 12px; font-size: 13px; }
    .dg-rank-row { gap: 8px; padding: 9px 4px; }
    .dg-rank-num { min-width: 20px; flex-basis: 20px; font-size: 14px; }
    .dg-rank-logo { width: 44px; height: 44px; flex-basis: 44px; }
    .dg-rank-name { font-size: 14px; }
    .dg-rank-zone { padding: 5px 9px; font-size: 12px; }
    .dg-box-grid { grid-template-columns: 1fr; }
}
