/**
 * 霸服游戏下载 - 前端样式 v2
 * 深色蓝调卡片列表 + 蓝色渐变 banner，移动端优先
 * 文件名 v2 用于绕过 CDN 缓存
 */

/* ===== 强制覆盖主题内容区背景，确保深色全宽 ===== */
.bafu-gd-page {
    background: #0f172a !important;
    min-height: 80vh;
    padding: 0 !important;
    margin: 0 !important;
    color: #e2e8f0;
    box-sizing: border-box;
}
.bafu-gd-page * { box-sizing: border-box; }
.bafu-gd-page a { color: inherit; }

body.bafu-gd-body,
.single-bafu_game .content-wrap,
.post-type-archive-bafu_game .content-wrap,
.single-bafu_game #main,
.post-type-archive-bafu_game #main {
    background: #0f172a !important;
}

/* ===== 顶部功能栏：返回首页 + 搜索过滤 ===== */
.bafu-gd-toolbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(15,23,42,0.97);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(148,163,184,0.15);
}
.bafu-gd-back-home {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 36px;
    padding: 0 14px;
    background: #1e293b;
    color: #93c5fd !important;
    border: 1px solid #3b82f6;
    border-radius: 18px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.bafu-gd-back-home:active { transform: scale(0.97); }
.bafu-gd-ico-back { font-size: 16px; line-height: 1; }

.bafu-gd-search {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    height: 36px;
    background: #0f172a;
    border: 1px solid rgba(148,163,184,0.2);
    border-radius: 18px;
    padding: 0 12px;
}
.bafu-gd-search:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}
.bafu-gd-ico-search {
    font-size: 14px;
    opacity: 0.7;
    margin-right: 6px;
    flex-shrink: 0;
}
#bafu-gd-search-input {
    flex: 1;
    min-width: 0;
    height: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: #e2e8f0;
    font-size: 13px;
}
#bafu-gd-search-input::placeholder { color: #64748b; }
#bafu-gd-search-clear {
    flex-shrink: 0;
    width: 22px; height: 22px;
    background: rgba(148,163,184,0.15);
    color: #94a3b8;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    margin-left: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}
#bafu-gd-search-clear:hover { background: rgba(148,163,184,0.3); color: #fff; }

/* ===== 卡片列表 ===== */
.bafu-gd-list {
    padding: 10px 0 30px;
    max-width: 720px;
    margin: 0 auto;
}

.bafu-gd-card {
    position: relative;
    margin: 8px 10px;
    border-radius: 14px;
    border: 1px solid rgba(0,0,0,0.06);
    background: #1e293b;
    box-shadow: 0 8px 24px rgba(17,24,39,0.25);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.bafu-gd-card:active { transform: scale(0.99); }

.bafu-gd-card-main {
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

.bafu-gd-icon {
    width: 4.5rem;
    min-width: 4.5rem;
    height: 4.5rem;
    margin: 12px;
    flex-shrink: 0;
}
.bafu-gd-icon img {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    object-fit: cover;
    background: #334155;
}

.bafu-gd-info {
    display: flex;
    flex-direction: column;
    margin: 12px 0;
    gap: 6px;
    flex: 1;
    min-width: 0;
}
.bafu-gd-name {
    color: #fff;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.2px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bafu-gd-tag {
    color: #94a3b8;
    font-size: 13px;
    line-height: 1.2;
}
.bafu-gd-desc {
    color: #64748b;
    font-size: 12px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}
.bafu-gd-stats {
    display: flex;
    gap: 14px;
    color: #64748b;
    font-size: 12px;
    margin-top: 2px;
}
.bafu-gd-stat { display: inline-flex; align-items: center; }

.bafu-gd-arrow {
    align-self: center;
    margin: 0 14px 0 6px;
    width: 8px;
    height: 8px;
    border-top: 2px solid #475569;
    border-right: 2px solid #475569;
    transform: rotate(45deg);
    flex-shrink: 0;
}

/* 广告角标（右上角迷你徽章，不遮挡图标） */
.bafu-gd-ribbon {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 3;
}
.bafu-gd-ribbon span {
    display: inline-block;
    background: #f59e0b;
    color: #fff;
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 2px;
    font-weight: 600;
    line-height: 1.2;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    letter-spacing: -0.2px;
}

/* ===== 分页 ===== */
.bafu-gd-list .pagination,
.bafu-gd-list .nav-links {
    text-align: center;
    margin: 20px 0 10px;
    padding: 0 10px;
}
.bafu-gd-list .page-numbers {
    display: inline-block;
    min-width: 36px;
    height: 36px;
    line-height: 36px;
    margin: 0 3px;
    padding: 0 10px;
    background: #1e293b;
    color: #e2e8f0 !important;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
}
.bafu-gd-list .page-numbers.current { background: #3d8bf4; color: #fff !important; }

/* ===== 空状态 ===== */
.bafu-gd-empty {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
    font-size: 15px;
}

/* ===== 详情页 ===== */
.bafu-gd-single { padding-bottom: 120px !important; }

.bafu-gd-detail-card {
    background: #1e293b;
    margin: 10px;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(17,24,39,0.25);
}
.bafu-gd-detail-head {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.bafu-gd-detail-icon {
    width: 80px;
    height: 80px;
    min-width: 80px;
    flex-shrink: 0;
}
.bafu-gd-detail-icon img {
    width: 100%;
    height: 100%;
    border-radius: 16px;
    object-fit: cover;
    background: #334155;
}
.bafu-gd-detail-info { flex: 1; min-width: 0; }
.bafu-gd-detail-name {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 6px;
    line-height: 1.3;
}
.bafu-gd-detail-tag {
    color: #94a3b8;
    font-size: 13px;
    margin-bottom: 6px;
}
.bafu-gd-detail-meta {
    color: #64748b;
    font-size: 12px;
    display: flex;
    gap: 12px;
}
.bafu-gd-detail-tags2 {
    color: #a78bfa;
    font-size: 13px;
    margin-top: 10px;
}

.bafu-gd-section {
    background: #1e293b;
    margin: 10px;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(17,24,39,0.25);
}
.bafu-gd-section-title {
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 12px;
    padding-left: 10px;
    border-left: 3px solid #3d8bf4;
}
.bafu-gd-detail-content {
    color: #cbd5e1;
    font-size: 14px;
    line-height: 1.7;
    word-break: break-word;
}
.bafu-gd-detail-content p { margin: 0 0 10px; color: #cbd5e1; }
.bafu-gd-detail-content img { max-width: 100%; height: auto; border-radius: 8px; }

.bafu-gd-shots {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.bafu-gd-shot img {
    width: 100%;
    border-radius: 8px;
    display: block;
}

/* ===== 底部下载栏（上排左右双下载按钮，下排更新日志按钮） ===== */
.bafu-gd-dl-bar {
    position: fixed;
    bottom: 60px;
    left: 0;
    right: 0;
    padding: 8px 12px;
    background: rgba(15,23,42,0.97);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(148,163,184,0.15);
    border-bottom: 1px solid rgba(148,163,184,0.15);
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 9999;
    max-width: 720px;
    margin: 0 auto;
    border-radius: 12px 12px 0 0;
}

/* 下载按钮一排（左立即下载 + 右备用下载） */
.bafu-gd-dl-row {
    display: flex;
    flex-direction: row;
    gap: 8px;
}

/* 立即下载按钮（左侧主按钮） */
.bafu-gd-dl-big {
    flex: 1;
    display: block;
    height: 42px;
    line-height: 42px;
    background: linear-gradient(90deg, #3d8bf4, #2563eb);
    color: #fff !important;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    border-radius: 21px;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(61,139,244,0.4);
}
.bafu-gd-dl-big:active { transform: scale(0.99); }

/* 备用下载按钮（右侧次按钮） */
.bafu-gd-dl-bak {
    flex: 1;
    display: block;
    height: 42px;
    line-height: 42px;
    background: #1e293b;
    color: #93c5fd !important;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    border: 1px solid #3b82f6;
    border-radius: 21px;
    text-decoration: none;
    box-sizing: border-box;
}
.bafu-gd-dl-bak:active { transform: scale(0.99); }
.bafu-gd-dl-bak:hover { background: #334155; }

/* 单个下载按钮时占满整行 */
.bafu-gd-dl-row .bafu-gd-dl-big:only-child {
    width: 100%;
}

/* 更新日志切换按钮（下方，全宽，点击弹窗） */
.bafu-gd-cl-btn {
    display: block;
    width: 100%;
    height: 30px;
    line-height: 30px;
    background: #1e293b;
    color: #93c5fd;
    border: 1px solid #3b82f6;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    padding: 0;
    text-align: center;
}
.bafu-gd-cl-btn:hover { background: #334155; }
.bafu-gd-cl-btn:active { transform: scale(0.99); }
.bafu-gd-cl-btn::after {
    content: ' ▾';
    font-size: 10px;
}

/* ===== 更新日志弹窗（底部抽屉式） ===== */
.bafu-gd-cl-modal { position: fixed; inset: 0; z-index: 10000; }
.bafu-gd-cl-modal[hidden] { display: none; }
.bafu-gd-cl-mask {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.55);
    animation: bafuFade 0.2s ease;
}
.bafu-gd-cl-sheet {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    max-height: 75vh;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 16px 16px 0 0;
    display: flex;
    flex-direction: column;
    animation: bafuSlideUp 0.25s ease;
    box-shadow: 0 -8px 30px rgba(0,0,0,0.4);
}
.bafu-gd-cl-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid rgba(148,163,184,0.15);
}
.bafu-gd-cl-sheet-title {
    font-size: 15px;
    font-weight: 600;
    color: #93c5fd;
}
.bafu-gd-cl-close {
    width: 30px; height: 30px;
    background: transparent;
    color: #94a3b8;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
}
.bafu-gd-cl-close:hover { background: rgba(148,163,184,0.15); color: #fff; }
.bafu-gd-cl-sheet-body {
    padding: 14px 16px 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 13px;
    color: #cbd5e1;
    line-height: 1.7;
}
.bafu-gd-cl-sheet-body p { margin: 0 0 8px; }
.bafu-gd-cl-sheet-body p:last-child { margin-bottom: 0; }
@keyframes bafuFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes bafuSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.bafu-gd-back {
    text-align: center;
    margin: 20px 0;
}
.bafu-gd-back a {
    display: inline-block;
    padding: 8px 24px;
    background: #334155;
    color: #94a3b8 !important;
    border-radius: 20px;
    font-size: 13px;
    text-decoration: none;
}

/* ===== 响应式 ===== */
@media (min-width: 768px) {
    .bafu-gd-list { max-width: 720px; }
    .bafu-gd-name { font-size: 1.3rem; }
}

@media (max-width: 360px) {
    .bafu-gd-icon { width: 4rem; min-width: 4rem; height: 4rem; margin: 10px; }
    .bafu-gd-name { font-size: 1.05rem; }
}
