/* =========================================================
   EF Games 重构版样式（干净重写，参考主项目视觉规范）
   深色主题：背景 #0f0f13 / 卡片 #1a1a24 / 边框 #2a2a3a / 主色 #4fc3f7
   ========================================================= */

/* ===== Reset & Base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --sidebar-w: 160px;   /* 侧栏宽度 */
    --content-pad: 32px;  /* 内容区左右内边距（与 .container padding 同步） */
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
    background: #0f0f13;
    color: #e0e0e0;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: #4fc3f7; text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    max-width: 1876px;
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--content-pad);
}

/* ===== 侧边栏（参考腾讯视频左侧导航：透明、在顶栏下方） ===== */
.sidebar {
    position: fixed;
    left: 0; top: 80px; bottom: 0;
    width: var(--sidebar-w);
    background: transparent;
    z-index: 300;
    display: flex;
    flex-direction: column;
    padding: 8px 0 10px;
    overflow-y: auto;
    scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-menu { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 0 14px; }
.sidebar-item {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 10px;
    color: #b8b8c8;
    font-size: 14px;
    line-height: 1.3;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s, font-weight 0.2s;
    border: none;
    background: none;
    width: 100%;
    font-family: inherit;
    font-weight: 400;
}
.sidebar-item svg { width: 22px; height: 22px; flex-shrink: 0; }
.sidebar-item:hover { color: #fff; font-weight: 700; background: none; text-decoration: none; }
.sidebar-item.active { color: #4fc3f7; font-weight: 700; background: none; }
.sidebar-item .sb-badge {
    font-size: 9px;
    background: #e74c3c;
    color: #fff;
    border-radius: 6px;
    padding: 0 4px;
    margin-left: 3px;
    vertical-align: top;
}

/* ===== 侧栏开关：logo 左边两横杠（一长一短） =====
   只在窄屏出现（桌面侧栏常驻，用不着这个开关）。
   笔画做成圆头、纯白加粗，跟旁边 logo 文字一个调子；
   展开后两横杠淡出、换成 > 箭头。 */
.nav-toggle {
    display: none;
    position: relative;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 26px;
    height: 30px;
    padding: 0 3px;
    margin-right: -6px;      /* 抵消 .header-left 的 gap，别离 logo 太远 */
    border: 0;
    background: none;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.nt-bar {
    display: block;
    height: 3px;
    border-radius: 999px;    /* 圆头 */
    background: #fff;
    transition: width .18s ease, opacity .18s ease;
}
.nav-toggle .nt-bar:first-child { width: 20px; }
.nav-toggle .nt-bar.nt-short { width: 13px; }

/* 展开态的 > 箭头：白色、圆角笔头、加粗。
   viewBox 是 24，字号 18px —— stroke-width 要按比例放大到 4，
   实际落在屏幕上是 4 × 18/24 = 3px，跟两横杠一样粗。 */
.nt-arrow {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
}
.nt-arrow path {
    fill: none;
    stroke: #fff;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}
html.nav-open .nt-bar { opacity: 0; }
html.nav-open .nt-arrow { opacity: 1; }

/* 侧栏滑出 / 整页被推开时，文案跟着平滑移动 */
.banner-info,
.arrow-left { transition: left .22s ease; }

/* ===== Header（顶栏横跨全宽：logo 在最左，搜索框紧跟其后；透明，滚动后变不透明） ===== */
.header {
    background: rgba(22, 22, 29, 0);
    border-bottom: 1px solid rgba(42, 42, 58, 0);
    padding: 16px 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: auto;
    z-index: 200;
    transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
}
.header.scrolled {
    background: rgba(22, 22, 29, 0.95);
    border-bottom-color: rgba(42, 42, 58, 0.8);
    backdrop-filter: blur(8px);
}
.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    position: relative;
}
.logo { display: flex; align-items: center; flex-shrink: 0; text-decoration: none; }
.logo img { height: 48px; width: auto; display: block; }
.logo-text { font-size: 18px; font-weight: 600; color: #fff; margin-left: 10px; white-space: nowrap; }
.logo:hover { opacity: 0.85; text-decoration: none; }
/* 主页（有侧边栏）：logo 更靠左 */
body:has(.sidebar) .header .container { padding-left: 8px; }

.header-left { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #e0e0e0;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    transition: all 0.2s;
    white-space: nowrap;
    text-decoration: none;
}
.back-btn:hover { color: #fff; background: rgba(79, 195, 247, 0.15); border-color: #4fc3f7; text-decoration: none; }

/* ===== Search ===== */
.search-box { flex: 1; max-width: 560px; }
.search-box input {
    width: 100%;
    padding: 9px 36px 9px 14px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cline x1='16' y1='16' x2='22' y2='22'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    background-size: 16px;
}
.search-box input:focus { border-color: rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.10); }
.search-box input::placeholder { color: rgba(255, 255, 255, 0.4); }

/* ===== 搜索下拉面板 ===== */
.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s;
}
.search-overlay.show { opacity: 1; visibility: visible; }

.search-dropdown {
    position: absolute;
    top: calc(100% + 13px);
    left: 50%;
    right: 32px;
    z-index: 600;
    background: #1a1a24;
    border: 1px solid #2a2a3a;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s, transform 0.2s;
}
.search-dropdown.show { opacity: 1; visibility: visible; transform: translateY(0); }
.sd-head { padding: 12px 20px; font-size: 13px; color: #888; border-bottom: 1px solid #2a2a3a; }
.sd-list { max-height: 420px; overflow-y: auto; }
.sd-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}
.sd-item:hover { background: #252535; text-decoration: none; }
.sd-item img { width: 64px; height: 36px; object-fit: cover; border-radius: 4px; flex-shrink: 0; background: #111; border: 1px solid #2a2a3a; }
.sd-info { min-width: 0; }
.sd-title { font-size: 14px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-meta { font-size: 12px; color: #888; margin-top: 2px; }
.sd-empty { padding: 24px 20px; text-align: center; font-size: 13px; color: #888; }

/* ===== 横幅轮播（16:9 静态大图，铺满整个视口，侧边栏透明叠在其上） ===== */
.banner-wrap {
    width: auto;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
.banner {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
}
.banner-track { position: absolute; inset: 0; }
/* banner 等截图 / 等大图下载时，居中一个转圈。
   样式对齐评论区的 .reviews-loading span（2px 边框 + 浅蓝高亮弧 + 0.8s 匀速），
   背景保持纯黑不做呼吸光效；画布是全屏 16:9，所以按比例放大到 40px。 */
.banner.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border-radius: 50%;
    border: 3px solid #2a2a3a;
    border-top-color: #4fc3f7;
    animation: dmlSpin 0.8s linear infinite;
    z-index: 4;
}
.banner-track .banner-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.6s ease;
    cursor: pointer;
}
.banner-track .banner-slide.active { opacity: 1; }
.banner-track .banner-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.banner-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(to top, rgba(15, 15, 19, 0.95) 0%, rgba(15, 15, 19, 0.35) 30%, rgba(15, 15, 19, 0.1) 60%, rgba(15, 15, 19, 0.3) 100%);
}
.banner-info { position: absolute; left: calc(var(--sidebar-w) + var(--content-pad)); bottom: 28px; z-index: 5; pointer-events: none; }
.banner-info .banner-title { font-size: 36px; font-weight: 700; color: #fff; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.75); margin-bottom: 8px; }
.banner-info .banner-sub { font-size: 17px; color: #ddd; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.75); }
.banner-info .banner-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.banner-info .banner-tag { font-size: 15px; color: rgba(255, 255, 255, 0.85); text-shadow: 0 1px 8px rgba(0, 0, 0, 0.75); }

.banner-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 6;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, opacity 0.2s;
    opacity: 0;
}
.banner:hover .banner-arrow { opacity: 1; }
.banner-arrow:hover { background: rgba(79, 195, 247, 0.5); }
.arrow-left { left: calc(var(--sidebar-w) + var(--content-pad)); }
.arrow-right { right: 16px; }

.banner-dots { position: absolute; right: 32px; bottom: 30px; z-index: 6; display: flex; gap: 8px; }
.banner-dots .dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.4); cursor: pointer; transition: all 0.2s; }
.banner-dots .dot.active { background: #4fc3f7; width: 22px; border-radius: 4px; }

/* ===== Main ===== */
.main { flex: 1; padding-top: 32px; padding-bottom: 32px; margin-left: var(--sidebar-w); width: auto; }
/* 18+ 分类页把大图整块收掉后，内容会钻到 fixed header 底下（大图在时是它顶着
   页首、header 透明浮在图上）。这里把顶栏那段高度补回给 .main。 */
body.banner-off .main { padding-top: 93px; }
.section-block { margin-bottom: 40px; }

.section-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.section-header h1 { font-size: 24px; color: #fff; display: flex; align-items: center; gap: 10px; }
.section-header h1 svg { width: 24px; height: 24px; color: #f0a040; flex-shrink: 0; }
.count { font-size: 14px; color: #888; }

/* ===== 标签区块标题（样式与侧栏标签一致：菱形图标 + 标签名） ===== */
.tag-section { margin-bottom: 40px; }
.tag-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    color: #fff;
}
.tag-section-header svg {
    width: 22px;
    height: 22px;
    color: #4fc3f7;
    flex-shrink: 0;
}
.tag-section-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}
.tag-section-header .count {
    font-size: 14px;
    color: #888;
    font-weight: 400;
}
.tag-section-header .view-all-btn {
    margin-left: auto;
    padding: 0;
    border: none;
    background: none;
    color: #4fc3f7;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    white-space: nowrap;
    transition: font-weight 0.15s;
}
.tag-section-header .view-all-btn:hover { font-weight: 700; color: #4fc3f7; }

/* ===== 精品推荐卡片（横版，与游戏资源一致） ===== */
.featured-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.featured-card {
    background: #1a1a24;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #2a2a3a;
    transition: transform 0.2s, border-color 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    position: relative;
}
.featured-card:hover { transform: translateY(-4px); border-color: #4fc3f7; text-decoration: none; }
.featured-card .cover-wrap { width: 100%; aspect-ratio: 16/9; background: #2a2a3a; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.featured-card .cover-wrap .cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.featured-card .fc-info { padding: 10px 14px; flex: 1; display: flex; flex-direction: column; justify-content: center; min-height: 60px; }
.featured-card .fc-title { font-size: 14px; color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.featured-card .fc-info .card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.featured-card .fc-info .card-tag { font-size: 12px; color: #888; line-height: 1.2; }
.featured-card .fc-info .info-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.featured-card .fc-info .date { font-size: 12px; color: #666; }
.featured-card .fc-badge {
    position: absolute;
    top: 8px; left: 8px;
    background: rgba(240, 160, 64, 0.94);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    z-index: 2;
}

/* 普通卡片左上角热度徽章（只数字，如 11k+）—— 与 fc-badge 同款红底白字 */
.game-card .hot-badge {
    position: absolute;
    top: 8px; left: 8px;
    background: rgba(231, 76, 60, 0.92);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    z-index: 2;
}

/* 普通卡片左上角 NEW 徽章（绿色，区别于 HOT 红色） */
.game-card .new-badge {
    position: absolute;
    top: 8px; left: 8px;
    background: rgba(46, 204, 113, 0.92);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    z-index: 2;
}

/* ===== 排序 ===== */
.sort-tabs { display: flex; gap: 0; border-radius: 10px; overflow: hidden; border: 1px solid #2a2a3a; margin-bottom: 24px; width: fit-content; }
.sort-tab {
    padding: 8px 20px;
    border: none;
    background: #1a1a24;
    color: #888;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}
.sort-tab:not(:last-child) { border-right: 1px solid #2a2a3a; }
.sort-tab:hover { background: #252535; color: #ccc; }
.sort-tab.active { background: #4fc3f7; color: #0f0f13; font-weight: 600; }

/* ===== 游戏网格 ===== */
.game-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.game-card {
    background: #1a1a24;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #2a2a3a;
    transition: transform 0.2s, border-color 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}
.game-card:hover { transform: translateY(-4px); border-color: #4fc3f7; text-decoration: none; }
.game-card .cover-wrap { width: 100%; aspect-ratio: 16/9; background: #2a2a3a; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.game-card .cover-wrap .cover { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ===== 18+ 图片遮罩：先糊住 + 一只眼睛，点一下才看清 ===== */
/* 用在首页/列表的卡片封面、详情页头部小封面、详情页左栏大图。
   类加在容器上（.cover-wrap / .detail-head-cover / .img-guard-host），
   遮罩层 .img-guard 由 js（utils.js guardMaskHtml / guardImage）插进去；
   点击由 utils.js 的捕获阶段监听处理，揭开时加 .is-revealed。 */
.is-guarded { position: relative; }
.is-guarded > img,
.is-guarded > .cover {
    filter: blur(16px);
    transform: scale(1.12);            /* 模糊会让边缘透亮，放大一点把边盖住 */
    transition: filter .25s ease, transform .25s ease;
}
.is-revealed > img,
.is-revealed > .cover { filter: none; transform: none; }

.img-guard {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px;
    border-radius: inherit;
    background: rgba(8, 8, 14, .34);
    color: #fff;
    text-align: center;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: opacity .22s ease;
}
.img-guard-eye { display: flex; }
.img-guard-eye svg {
    width: 26px;
    height: 26px;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .65));
    transition: transform .18s ease;
}
.img-guard:hover .img-guard-eye svg { transform: scale(1.1); }
.img-guard-txt {
    font-size: 12px;
    line-height: 1.25;
    color: #ececf4;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .75);
}
.is-revealed .img-guard { opacity: 0; pointer-events: none; }

/* 徽章（NEW / HOT / 热度）压在遮罩上面，别被糊成一片 */
.game-card .new-badge,
.game-card .hot-badge,
.featured-card .fc-badge { z-index: 3; }

/* 详情页左栏大图外面套的一层（大图原先直接挂在 .detail-main 里，
   不套一层的话遮罩会盖住整条左栏，连下面的缩略图一起糊掉）。
   overflow:hidden 是必须的：模糊态为了盖住边缘会放大 1.12 倍，
   不裁的话糊边会溢出到右栏的缝隙里。 */
.img-guard-host {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

/* 没有封面（或 CDN 图挂了）时的占位：游戏名首字 + 渐变底，不占带宽、不出破图 */
.featured-card .cover-wrap { position: relative; }
.game-card .cover-wrap.no-img::after,
.featured-card .cover-wrap.no-img::after {
    content: attr(data-initial);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: 600;
    color: #4d4d66;
    background: linear-gradient(135deg, #1c1c26 0%, #262636 100%);
}
.game-card .info { padding: 10px 14px; flex: 1; display: flex; flex-direction: column; justify-content: center; min-height: 60px; }
.game-card .info h3 { font-size: 14px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-card .info .card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.game-card .info .card-tag { font-size: 12px; color: #888; line-height: 1.2; }
.game-card .info .info-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.game-card .info .date { font-size: 12px; color: #666; }

.no-result { text-align: center; padding: 60px 20px; font-size: 18px; color: #666; }

/* ===== Pagination ===== */
.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 32px; flex-wrap: wrap; }
.page-btn {
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid #2a2a3a;
    background: #1a1a24;
    color: #e0e0e0;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}
.page-btn:hover:not(.disabled):not(.active) { border-color: #4fc3f7; color: #4fc3f7; }
.page-btn.active { background: #4fc3f7; color: #0f0f13; border-color: #4fc3f7; font-weight: 600; }
.page-btn.disabled { opacity: 0.35; cursor: default; }
.page-ellipsis { color: #555; padding: 0 4px; font-size: 14px; }

/* ===== 详情页 ===== */
.detail-page {
    max-width: 1400px;
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
    padding-top: 93px;
}

/* 详情页容器（含 header 的 container）：与内容区一致 1400px 居中，使顶栏返回按钮/logo/搜索框对齐卡片左右两边 */
body:has(.detail-page) .container {
    max-width: 1400px;
}

/* 详情页 header 默认不透明（无横幅背景区） */
body:has(.detail-page) > .header {
    background: rgba(22, 22, 29, 0.95);
    border-bottom-color: rgba(42, 42, 58, 0.8);
    backdrop-filter: blur(8px);
    padding: 12px 0;
}
body:has(.detail-page) .logo img { height: 36px; }
body:has(.detail-page) .logo-text { font-size: 16px; margin-left: 8px; }
body:has(.detail-page) .search-box { max-width: 480px; }

.game-detail { display: grid; grid-template-columns: 1fr 340px; gap: 0 32px; }

.game-detail .detail-head {
    grid-column: 1 / -1;
    display: flex;
    align-items: stretch;
    gap: 24px;
    margin-bottom: 20px;
}
.game-detail .detail-head-cover {
    flex-shrink: 0;
    width: 200px;
    border-radius: 12px;
    overflow: hidden;
    background: #111;
    border: 1px solid #2a2a3a;
}
.game-detail .detail-head-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.game-detail .detail-head-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 14px; }

.detail-title { font-size: 28px; font-weight: 600; line-height: 1.35; color: #fff; }

/* 详情页头部：游戏名下方的标签文字（与卡片标签一致，纯文字无背景） */
.detail-head-info .card-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.detail-head-info .card-tag { font-size: 14px; color: #888; line-height: 1.2; }

.game-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 14px; color: #999; }
.game-meta span { display: flex; align-items: center; gap: 4px; }
.game-meta .tag { background: #2a2a3a; padding: 3px 12px; border-radius: 5px; font-size: 13px; color: #e0e0e0; }

.official-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #4fc3f7;
    background: rgba(79, 195, 247, 0.08);
    border: 1px solid rgba(79, 195, 247, 0.4);
    border-radius: 5px;
    transition: all 0.2s;
    white-space: nowrap;
    text-decoration: none;
}
.official-btn:hover { background: rgba(79, 195, 247, 0.18); border-color: #4fc3f7; text-decoration: none; }

.game-description {
    grid-column: 1 / -1;
    background: #1a1a24;
    border: 1px solid #2a2a3a;
    border-radius: 12px;
    padding: 18px 22px;
    margin-bottom: 24px;
    font-size: 15px;
    line-height: 1.8;
    color: #ccc;
}

/* 简介骨架：detail.js 只输出三个灰条撑住高度，文字由 steam-detail.js
   从 /api/steam 拿到后替换。高度故意压得比真实简介矮一点——真文字一般
   2~4 行，宁可加载完往下推，也不要先撑一个大空框再塌回去。 */
.game-description.is-loading { padding: 20px 22px; }
.desc-skeleton {
    display: block;
    height: 13px;
    border-radius: 6px;
    margin-bottom: 11px;
    background: linear-gradient(110deg, #22222e 8%, #2b2b3a 18%, #22222e 33%);
    background-size: 220% 100%;
    animation: dmlShimmer 1.6s linear infinite;
}
.desc-skeleton-last { width: 46%; margin-bottom: 0; }
@media (prefers-reduced-motion: reduce) {
    .desc-skeleton { animation: none; }
}

.game-detail .detail-main { grid-column: 1; min-width: 0; }
.game-detail .detail-right {
    grid-column: 2;
    width: auto;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
    align-self: start;
}

.game-detail .detail-cover { width: 100%; max-height: 700px; object-fit: contain; border-radius: 12px; margin-bottom: 24px; background: #111; }

/* 没有截图素材时的左栏占位（撑高度用，避免右侧下载区旁边塌空） */
.detail-noimg {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    border-radius: 12px;
    border: 1px dashed #2a2a3a;
    background: linear-gradient(135deg, #14141c 0%, #1b1b26 100%);
    color: #4d4d66;
    font-size: 14px;
    letter-spacing: 1px;
}

/* 详情页左栏在等 /api/steam 返回素材时的骨架（大图 + 截图墙的位置） */
.detail-media-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 420px;
    margin-bottom: 32px;
    border-radius: 12px;
    border: 1px solid #22222e;
    background: linear-gradient(110deg, #14141c 8%, #1b1b26 18%, #14141c 33%);
    background-size: 220% 100%;
    animation: dmlShimmer 1.6s linear infinite;
    color: #5b5b78;
    font-size: 13px;
    letter-spacing: 1px;
}
.dml-spin {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid #2c2c3d;
    border-top-color: #6f6ff0;
    animation: dmlSpin 0.9s linear infinite;
}
@keyframes dmlSpin { to { transform: rotate(360deg); } }
@keyframes dmlShimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@media (prefers-reduced-motion: reduce) {
    .detail-media-loading { animation: none; }
    .dml-spin { animation: none; }
    .banner.is-loading::after { animation: none; }
}

.screenshots { margin-bottom: 32px; }
.screenshots h2 { font-size: 20px; color: #fff; margin-bottom: 12px; }
.screenshots-list { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.screenshots-list img { width: 100%; border-radius: 8px; cursor: pointer; transition: opacity 0.2s; }
.screenshots-list img:hover { opacity: 0.85; }

/* ===== 右栏：下载 ===== */
.download-section { background: #1a1a24; border-radius: 12px; padding: 24px; border: 1px solid #2a2a3a; margin-bottom: 16px; }
.download-section h2 { font-size: 18px; color: #fff; margin-bottom: 14px; }
/* 标题前的图标单独包一层：桌面保留（间距等同原来的那个空格），
   手机端整块去背景、只当纯文字标题，图标在那里多余（见文件末尾的 ≤768 块）。 */
.download-section h2 .h2-ico { margin-right: 5px; }
.download-list { display: flex; flex-direction: column; gap: 8px; }
.download-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #222230;
    padding: 10px 14px;
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
}
.download-item .link-name { font-weight: 600; color: #fff; }
.download-item a {
    padding: 5px 16px;
    background: #4fc3f7;
    color: #0f0f13;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: opacity 0.2s;
}
.download-item a:hover { text-decoration: none; opacity: 0.85; }
.download-item .download-btn.disabled { background: #3a3a44; color: #777; cursor: not-allowed; opacity: 0.6; }

.install-guide-section {
    background: #1a1a24;
    border: 1px solid #2a2a3a;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.install-guide-section h2 { font-size: 14px; color: #e0e0e0; margin: 0; }
.install-guide-link {
    display: inline-block;
    background: #e74c3c;
    color: #fff !important;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background 0.2s;
}
.install-guide-link:hover { background: #c0392b; text-decoration: none !important; }

/* ===== 右栏：海外账户卡（下载链接下方） ===== */
/* 类名前缀用 hw-（海外）而不是 ad-：ad 开头的 class 名会被部分广告拦截
   规则（EasyList 的 ##.ad、##[class^="ad-"] 之类）误杀，整卡直接消失。
   卡内所有图标都是内联 SVG，QQ logo 走本地 img/qq-logo.png，不请求任何外部资源，
   所以断网、CDN 挂掉都不会变成破图。 */
.hw-card {
    position: relative;
    background: #171b26;
    border: 1px solid #2b3a4a;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    overflow: hidden;
}
/* 顶部一条蓝色渐变细线：和下载卡区分开，又不抢按钮的视觉 */
.hw-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #4fc3f7, transparent);
    opacity: 0.45;
}
.hw-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.hw-title { font-size: 15px; font-weight: 700; color: #fff; letter-spacing: 0.2px; }
.hw-sub { font-size: 11.5px; color: #7d8798; margin-top: 4px; letter-spacing: 0.2px; }
.hw-badge {
    flex: none;
    font-size: 10px;
    color: #78859a;
    border: 1px solid #303d4d;
    border-radius: 4px;
    padding: 1px 5px;
    line-height: 1.5;
    margin-top: 1px;
}

.hw-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0 10px; }
.hw-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 32px;
    padding: 0 7px;
    background: #1e2330;
    border: 1px solid #28303f;
    border-radius: 8px;
    font-size: 11px;
    color: #cdd5e2;
    white-space: nowrap;
    overflow: hidden;
}
.hw-chip svg { width: 15px; height: 15px; flex: none; }
.hw-chip span { overflow: hidden; text-overflow: ellipsis; }
.hw-chip-wide {
    grid-column: 1 / -1;
    justify-content: center;
    gap: 6px;
    border-style: dashed;
    border-color: #2f3c4c;
    background: #191e29;
    color: #8b97a8;
}

.hw-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    height: 36px;
    padding: 0;
    border: 0;
    background: #4fc3f7;
    color: #0d1218;
    border-radius: 8px;
    /* 它是 <a>，但要长得像按钮：清掉链接默认样式，宽度撑满卡片 */
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.2px;
    -webkit-appearance: none;
    appearance: none;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s;
}
.hw-cta:hover { text-decoration: none; opacity: 0.88; }
/* QQ logo 自带白底，按字号缩放（1.15em 让企鹅本体的高度和「联系QQ」齐平），
   圆角把方角白底收成图标感 */
.hw-cta img { height: 1.15em; width: auto; flex: none; display: block; border-radius: 3px; }

/* 二维码浮层：整卡是紫→蓝渐变（和二维码配色一致），点任意处关闭。
   图片本身按四边等距 20px 裁好，白底用 multiply 混进渐变，不出现白色方块。 */
.hw-qr-card {
    width: min(316px, 84vw);
    padding: 12px 12px 0;
    background: linear-gradient(145deg, #f6efff 0%, #eef2ff 52%, #e4efff 100%);
    border-radius: 16px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
    animation: slideUp 0.25s ease;
    overflow: hidden;
    /* 关住混合范围：不加这个，下面图片的 multiply 会连遮罩层一起乘，
       整张卡被压暗成灰片 */
    isolation: isolate;
}
.hw-qr-card img {
    display: block;
    width: 100%;
    height: auto;
    /* 白底与渐变相乘 = 直接透出背景，二维码的彩色点阵保留 */
    mix-blend-mode: multiply;
}
.hw-qr-tip {
    padding: 9px 0 13px;
    text-align: center;
    font-size: 13.5px;
    line-height: 1.4;
    font-weight: 600;
    letter-spacing: 0.3px;
    /* 两行：第一行「QQ扫描 · 平台合作供货商 搜索 <号>」，第二行为备注提示 */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.hw-qr-line {
    /* 文字本身也用同一套渐变色，靠 background-clip 抠进字里 */
    background: linear-gradient(90deg, #b45cf5 0%, #6a7bf7 55%, #3b82f6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hw-qr-tip b {
    font-weight: 800;
    /* -webkit-text-fill-color 会继承，background 不会 —— 不给 <b> 自己上色，
       数字就是透明的（原来就是透明的，只是被前面的字挡住了没注意） */
    -webkit-text-fill-color: #6a7bf7;
    color: #6a7bf7;
}
.hw-qr-sub {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
    color: #8b7fd6;
}

.game-notes {
    background: #2a2520;
    border: 1px solid #5a4a30;
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 13px;
    color: #f0c070;
    white-space: pre-line;
    line-height: 1.6;
}
.game-notes::before { content: "⚠️ "; }

.game-tips {
    background: #1a2430;
    border: 1px solid #2a4a6a;
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 13px;
    color: #8fc4e8;
    white-space: pre-line;
    line-height: 1.6;
    margin-top: 12px;
}
.game-tips::before { content: "💡 "; }

/* ===== 下载确认弹窗 ===== */
.download-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.download-modal {
    background: #1a1a24;
    border: 1px solid #2a2a3a;
    border-radius: 16px;
    padding: 32px;
    max-width: 460px;
    width: 90%;
    text-align: center;
    animation: slideUp 0.25s ease;
}
@keyframes slideUp { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.download-modal .modal-title { font-size: 22px; font-weight: 700; color: #fff; margin-bottom: 14px; }
.download-modal .modal-body { font-size: 15px; color: #aaa; line-height: 1.8; margin-bottom: 24px; }
.download-modal .modal-body em { color: #f0c070; font-style: normal; }
.download-modal .modal-pwd { font-size: 18px; color: #fff; margin-bottom: 16px; padding: 10px 16px; background: #232330; border-radius: 8px; }
.download-modal .modal-pwd strong { color: #4fc3f7; letter-spacing: 2px; }
.download-modal .modal-qr { display: flex; align-items: center; justify-content: center; width: 160px; height: 160px; margin: 0 auto 16px; border-radius: 8px; border: 2px solid #333; background: #fff; overflow: hidden; }
.download-modal .modal-qr img,
.download-modal .modal-qr canvas { display: block; width: 160px !important; height: 160px !important; }
.download-modal .modal-qr-fallback { font-size: 14px; color: #4fc3f7; text-decoration: none; padding: 0 12px; text-align: center; }
.download-modal .modal-tip { font-size: 15px; color: #aaa; margin-bottom: 8px; }
.download-modal .modal-reason { font-size: 13px; color: #666; line-height: 1.6; }
.download-modal .modal-btn {
    display: inline-block;
    padding: 10px 36px;
    background: #4fc3f7;
    color: #0f0f13;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
}
.download-modal .modal-btn:hover { opacity: 0.9; transform: scale(1.03); }
.download-modal .modal-btn:active { transform: scale(0.97); }

/* ===== 18+ 游戏：下载改走 Telegram（两个按钮的专用弹窗） ===== */
.download-modal .tg-lead {
    font-size: 15px;
    line-height: 1.75;
    color: #b9b9c8;
    margin-bottom: 18px;
}
.download-modal .tg-qr { width: 180px; height: 180px; border-color: #2f3f4d; margin-bottom: 18px; }
.download-modal .tg-qr img { width: 180px !important; height: 180px !important; }
.download-modal .tg-tip {
    font-size: 13.5px;
    line-height: 1.7;
    color: #8d8d9e;
    margin-bottom: 6px;
}
.download-modal .tg-btns {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 18px 0 12px;
}
.download-modal .tg-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    border: 0;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: opacity .2s, transform .15s, background .2s;
}
.download-modal .tg-btn-main { background: #229ED9; color: #fff; }
.download-modal .tg-btn-main:hover { background: #2eb0ec; color: #fff; text-decoration: none; }
.download-modal .tg-btn-sub { background: #232330; color: #e6e6f0; border: 1px solid #35354a; }
.download-modal .tg-btn-sub:hover { background: #2a2a3a; color: #fff; }
.download-modal .tg-btn:active { transform: scale(.98); }
.download-modal .tg-close {
    background: none;
    color: #777;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 500;
}
.download-modal .tg-close:hover { color: #aaa; transform: none; }

/* ===== Footer ===== */
.footer { text-align: center; padding: 24px 20px; color: #555; font-size: 13px; border-top: 1px solid #1e1e28; margin-left: var(--sidebar-w); }
.footer-disclaimer { margin-top: 6px; font-size: 12px; color: #666; line-height: 1.7; }
.copy-email { color: #4fc3f7; cursor: pointer; transition: color 0.2s; position: relative; }
.copy-email:hover { color: #81d4fa; text-decoration: underline; }
.copy-email.copied::after {
    content: '已复制';
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    background: #4fc3f7;
    color: #0f0f13;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    animation: copyFadeOut 0.8s ease forwards;
}
@keyframes copyFadeOut {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    70% { opacity: 1; transform: translateX(-50%) translateY(-6px); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-12px); }
}

/* ===== Responsive ===== */
@media (max-width: 1440px) {
    :root { --content-pad: 24px; }
    .container { padding-left: var(--content-pad); padding-right: var(--content-pad); }
    .game-grid { grid-template-columns: repeat(5, 1fr); gap: 16px; }
    .featured-grid { grid-template-columns: repeat(5, 1fr); gap: 16px; }
    .screenshots-list { grid-template-columns: repeat(4, 1fr); }
    .game-detail .detail-right { width: 300px; }
    .search-dropdown { right: 24px; }
}
@media (max-width: 1200px) {
    :root { --content-pad: 20px; }
    .container { padding-left: var(--content-pad); padding-right: var(--content-pad); }
    .game-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
    .featured-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
    .screenshots-list { grid-template-columns: repeat(3, 1fr); }
    .game-detail { grid-template-columns: 1fr; }
    .game-detail .detail-main { grid-column: 1; }
    .game-detail .detail-right { grid-column: 1; width: 100%; position: static; }
    .search-dropdown { right: 20px; }
}
@media (max-width: 992px) {
    :root { --sidebar-w: 0px; --drawer-w: 214px; }
    .header { left: 0; }
    .banner-wrap, .main, .footer { margin-left: 0; }
    .banner-info { left: var(--content-pad); }
    .arrow-left { left: var(--content-pad); }

    .nav-toggle { display: inline-flex; margin-right: 0; }   /* 窄屏 gap 只有 8px，别再用负边距 */

    /* 这个宽度以下侧栏改成抽屉：点两横杠，整页往右推开，把侧栏让出来 ——
       是「挤出」不是「盖住」：顶栏（logo + 搜索框）、banner、列表、页脚全部一起让位。
       抽屉从屏幕最顶上开始，被推开的顶栏不会留一条空档。 */
    .sidebar {
        display: flex;
        width: var(--drawer-w);
        top: 0;
        background: #12121a;
        border-right: 1px solid #23232f;
        border-radius: 0 8px 8px 0;   /* 滑出后右边一点点圆角，不是块砖 */
        box-shadow: 14px 0 30px rgba(0, 0, 0, .45);
        z-index: 90;
        padding-top: 10px;
        transform: translateX(-100%);
        transition: transform .24s cubic-bezier(.22, .61, .36, 1);
    }
    html.nav-open .sidebar { transform: none; }

    /* 被推出去的页面不能撑出横向滚动条 */
    html, body { overflow-x: hidden; }

    .banner-wrap, .main, .footer {
        position: relative;
        z-index: 1;
        transition: transform .24s cubic-bezier(.22, .61, .36, 1);
    }
    .header {
        transition: transform .24s cubic-bezier(.22, .61, .36, 1),
                    background .3s, border-color .3s, backdrop-filter .3s;
    }
    html.nav-open .header,
    html.nav-open .banner-wrap,
    html.nav-open .main,
    html.nav-open .footer {
        transform: translateX(var(--drawer-w));
    }
}
@media (max-width: 768px) {
    :root { --content-pad: 16px; }
    .container { padding-left: var(--content-pad); padding-right: var(--content-pad); }
    .logo-text { display: none; }
    .game-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
    .featured-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
    .screenshots-list { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    /* banner 文案：手机上三行挤在 219px 高的图里，原来行距和底部留白都按桌面
       那套（8 + 10、bottom 28）来，显得又散又高。全部收紧一档。 */
    .banner-info {
        bottom: 10px;
    }
    .banner-info .banner-title {
        font-size: 18px;
        line-height: 1.25;
        margin-bottom: 2px;
    }
    .banner-info .banner-sub {
        font-size: 12px;
        line-height: 1.35;
    }
    .banner-info .banner-tags {
        margin-top: 4px;
        gap: 8px;
    }
    .banner-info .banner-tag {
        font-size: 12px;
    }
    /* 右下角的小圆点也贴下来，跟文案最后一行一条线（圆点 6px，比文字行底再抬 4px 才对齐） */
    .banner-dots {
        right: var(--content-pad);
        bottom: 14px;
        gap: 6px;
    }
    .banner-dots .dot { width: 6px; height: 6px; }
    .banner-dots .dot.active { width: 16px; }
    .detail-title { font-size: 17px; }
    .game-detail .detail-head { align-items: center; gap: 14px; }
    .game-detail .detail-head-cover { width: 92px; }
    .game-detail .detail-head-info { gap: 8px; }
    .game-meta { gap: 8px; }
    .search-box { max-width: none; width: 100%; }
    .header { padding: 8px 0; }
    .header .container { gap: 8px; }
    .logo img { height: 28px; }
    .search-dropdown { left: 0; right: 16px; top: calc(100% + 9px); }
    /* 面板高度必须跟着视口走。sd-list 写死 420px，加上头部在矮屏（软键盘弹出后
       可视区只剩 400 出头）会直接盖满整屏，底下一点遮罩都点不到 —— 面板收不起来。
       这里改成 flex 列 + 视口上限，列表内部滚动，下方永远留出可点的遮罩。 */
    .search-dropdown {
        display: flex;
        flex-direction: column;
        max-height: calc(100vh - 96px);
        max-height: calc(100dvh - 96px);
    }
    .search-dropdown .sd-list {
        max-height: none;
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    /* 详情页：LOGO 左边放一枚返回箭头（只留 < ，不带「返回」二字）。
       样式和主页那颗侧栏开关（.nav-toggle）完全一套：无底色、无边框、
       白色加粗圆头笔尖，尺寸也照抄 26×30 —— 两页顶栏来回切才不跳。 */
    .back-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 26px;
        height: 30px;
        padding: 0;
        gap: 0;
        margin-right: -6px;       /* 和 .nav-toggle 一样抵消 gap，别离 logo 太远 */
        color: #fff;
        background: none;
        border: 0;
        border-radius: 0;
        transition: opacity 0.2s;
        -webkit-tap-highlight-color: transparent;
    }
    /* 手上点完 :hover 会粘住，这里把它钉回常态，只留按下的反馈 */
    .back-btn:hover { background: none; border-color: transparent; color: #fff; }
    .back-btn:active { opacity: 0.55; }
    .back-btn .back-btn-text { display: none; }
    /* 图标与 .nt-arrow 同规格：18px 容器、viewBox 24 → stroke-width 4 落在屏上 3px */
    .back-btn svg { width: 18px; height: 18px; stroke-width: 4; }

    /* 详情页顶栏与主页保持同一尺寸：默认的 logo 36px / padding 12px 是桌面规格，
       手机上必须压回主页那套，否则两页切来切去会「跳一下」。
       注意选择器要带上 body:has(.detail-page)，否则压不过 495-497 行那几条。 */
    body:has(.detail-page) > .header { padding: 8px 0; }
    body:has(.detail-page) .logo img { height: 28px; }
    body:has(.detail-page) .search-box { max-width: none; }
    /* 顶栏矮了，内容顶部留白跟着收。手机上顶栏只有 43px 高，
       原来留到 78px 等于空出 35px 一条空白带，内容像被推到半屏下面；
       收到「顶栏 + 13px」刚好透气又不空旷。 */
    .detail-page { padding-top: 56px; }
    .header-left { gap: 8px; }
    .download-section { padding: 16px; }
    .section-header h1 { font-size: 20px; }
    .game-card .info h3 { font-size: 13px; }
}
@media (max-width: 480px) {
    :root { --content-pad: 12px; }
    .container { padding-left: var(--content-pad); padding-right: var(--content-pad); }
    .game-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .featured-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .screenshots-list { grid-template-columns: repeat(2, 1fr); }
    .game-card .info { padding: 8px 10px; min-height: 48px; }
    .game-card .info h3 { font-size: 12px; }
    .logo img { height: 22px; }
    .search-box input { padding: 6px 30px 6px 10px; font-size: 12px; }
    .header { padding: 6px 0; }
    /* 详情页跟主页对齐到同一档（这个宽度下主页是 22px / 6px） */
    body:has(.detail-page) > .header { padding: 6px 0; }
    body:has(.detail-page) .logo img { height: 22px; }
    .detail-page { padding-top: 56px; }
    .pagination { gap: 4px; }
    .page-btn { padding: 5px 10px; font-size: 13px; }
    .game-description { font-size: 14px; line-height: 1.7; }
    .search-dropdown { right: 12px; }
}

/* ===== 右下角悬浮：回到顶部（深色圆角方块+箭头图标，hover 变青色+左侧提示气泡带尖角） ===== */
.back-top {
    position: fixed;
    right: 8px;   /* 直接压在内容上（详情页也落在这一档），不再挤在卡片与屏幕边缘的缝隙里 */
    bottom: 44px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: #26262f;
    color: #c9c9d4;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 300;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .35);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: background .2s, color .2s, transform .2s, opacity .25s, visibility .25s;
}
.back-top.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.back-top svg { width: 18px; height: 18px; }
.back-top:hover {
    background: #00c8d7;
    color: #fff;
    transform: translateY(-2px);
}
.back-top-tip {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: #1a1a22;
    color: #fff;
    font-size: 14px;
    line-height: 1;
    padding: 12px 18px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
}
/* 气泡右侧指向按钮的尖角 */
.back-top-tip::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: #1a1a22;
}
.back-top:hover .back-top-tip { opacity: 1; }
@media (max-width: 992px) {
    /* 窄屏只需要把按钮抬低一点（避开底部浏览器工具栏）。
       right 在基础样式里已经是 8px，首页和详情页天然同一位置。 */
    .back-top { bottom: 28px; }
}

/* 主页右侧不再为回到顶部按钮预留空隙：按钮改成覆盖在卡片上方（见 .back-top），
   卡片区的左右内边距必须一致，否则整排卡片会明显偏左。 */

/* ===== 手机端：圆角统一收小 =====
   桌面那套 12~22px 的圆角在 390 宽的屏幕上太「软」，块与块之间糊成一片。
   统一成两档：
     6px —— 块（卡片 / 封面 / 面板 / 视频 / 弹层）
     4px —— 小元件（按钮 / 标签 / 徽章 / 缩略图）
   圆形（头像 / 播放键 / 回顶 / 转圈 / 圆点）仍用 50%，进度条仍用 2px，这里不动。
   本块必须留在文件最后：靠「后来居上」压过前面的同名规则，别往中间挪。 */
@media (max-width: 768px) {
    /* 搜索框保持原来的 22px 胶囊形，不参与收小 */
    .sidebar-item,
    .search-dropdown,
    .featured-card,
    .sort-tabs,
    .game-card,
    .game-detail .detail-head-cover,
    .game-description,
    .game-detail .detail-cover,
    .detail-noimg,
    .detail-media-loading,
    .screenshots-list img,
    .download-section,
    .download-item,
    .install-guide-section,
    .game-notes,
    .game-tips,
    .download-modal,
    .download-modal .modal-pwd,
    .download-modal .modal-qr,
    .back-top,
    .back-top-tip {
        border-radius: 6px;
    }

    .sidebar-item .sb-badge,
    .sd-item img,
    .featured-card .fc-badge,
    .game-card .hot-badge,
    .game-card .new-badge,
    .page-btn,
    .game-meta .tag,
    .official-btn,
    .download-item a,
    .install-guide-link,
    .download-modal .modal-btn,
    .copy-email.copied::after {
        border-radius: 4px;
    }
}

/* ===== 手机端：下载区不再是卡片 ===== */
/* 去背景、去边框、去内边距，只留一行标题 + 三条下载条目（条目本身不动，
   仍是各自的小卡片）。标题前的 📥 也藏掉 —— 这里只需要文字，
   字号和「游戏简介」「关于此游戏」那两处标题对齐成 20px。 */
@media (max-width: 768px) {
    .download-section {
        background: none;
        border: 0;
        border-radius: 0;
        padding: 0;
        margin-bottom: 22px;
    }

    .download-section h2 {
        font-size: 20px;
        line-height: 1.6;
        margin: 0 0 14px;
    }

    .download-section .h2-ico { display: none; }

    /* 海外账户卡在手机端保留卡片外观（下载区可以去背景，广告卡不行：
       贴边一张没有边界的内容会被当成页面正文，反而更容易误点） */
    .hw-card { padding: 14px; border-radius: 6px; margin-bottom: 18px; }
    .hw-grid { gap: 7px; }
    .hw-chip { height: 34px; font-size: 11.5px; }
    .hw-cta { height: 40px; font-size: 13px; }
}

/* ===== 18+ 遮罩：手机上收小一点 ===== */
@media (max-width: 768px) {
    .img-guard { gap: 4px; }
    .img-guard-eye svg { width: 21px; height: 21px; }
    .img-guard-txt { font-size: 11px; }

    /* 详情页头部封面只有 92px 宽，「敏感内容 · 点击查看」放不下，只留眼睛 */
    .detail-head-cover .img-guard-txt { display: none; }
    .detail-head-cover .img-guard-eye svg { width: 20px; height: 20px; }

    /* 卡片更窄，糊得太狠会连轮廓都看不出来，收一档 */
    .is-guarded > img,
    .is-guarded > .cover { filter: blur(12px); }

    /* 手机端大图圆角是 6px，套的那层跟着走，别一大一小 */
    .img-guard-host { border-radius: 6px; }
}

/* ===== 18+ 分类页：收掉整块大图 ===== */
/* 手机顶栏只有 43px 高，补 56px（和详情页同一套数值）刚好透气 */
@media (max-width: 768px) {
    body.banner-off .main { padding-top: 56px; }
}
