/* ==========================================================
   列表页 list.php 专属样式
   公共骨架/导航/筛选条/游戏卡片/分页/页脚见 css/style.css
   ========================================================== */

/* ---------- 页头 ---------- */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.page-title {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 6px;
}
.page-subtitle {
    font-size: 15px;
    color: #86868b;
    margin: 0;
}
.page-count {
    font-size: 14px;
    color: #86868b;
    flex-shrink: 0;
}
.page-count strong {
    color: #1d1d1f;
    font-weight: 600;
}

/* ---------- 空状态 ---------- */
.empty-state {
    display: none;
    text-align: center;
    padding: 70px 20px;
    color: #86868b;
}
.empty-state.show { display: block; }
.empty-state i {
    font-size: 40px;
    color: #d0d0d6;
    margin-bottom: 16px;
}
.empty-state p { font-size: 15px; margin: 0; }

/* ---------- 热门关键词 & 人气榜 ---------- */
.bottom-section { margin-top: 50px; }
.bottom-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1d1d1f;
}
.keyword-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
}
.keyword-tag {
    background: #ffffff;
    border: 1px solid #e5e5ea;
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 14px;
    color: #1d1d1f;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-width: 130px;
}
.keyword-tag:hover {
    background: #f5f5f7;
    border-color: #d0d0d6;
    color: #1d1d1f;
}
.kw-name { font-weight: 500; }
.kw-index {
    font-size: 12px;
    color: #0071e3;
    font-weight: 600;
}
.keyword-tag.top .kw-index { color: #ff6b00; }
.kw-count { font-size: 12px; color: #86868b; white-space: nowrap; }
.keyword-tag:hover .kw-count { color: #6e6e73; }

/* 人气榜列表卡片（覆盖公共 .ranking-card 的首页榜样式） */
.ranking-card {
    background: #ffffff;
    border: 1px solid #e5e5ea;
    border-radius: 18px;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-align: left;
    transition: transform 0.22s, box-shadow 0.22s;
}
.ranking-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}
.ranking-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #f0f0f3;
}
.ranking-header-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.ranking-more {
    font-size: 13px;
    color: #0071e3;
    text-decoration: none;
}
.ranking-more:hover { text-decoration: underline; }
.ranking-list {
    display: flex;
    flex-direction: column;
    flex: 1;
}
.ranking-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f3;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
    min-height: 68px;
}
.ranking-item:last-child { border-bottom: none; }
.ranking-item:hover { background: #f9f9fb; color: inherit; }
.ranking-item.no-icon { min-height: 46px; padding: 10px 20px; }
.rank-num {
    width: 20px;
    font-size: 15px;
    font-weight: 700;
    color: #c0c0c8;
    text-align: center;
    flex-shrink: 0;
}
.rank-num.top-1 { color: #ff3b30; }
.rank-num.top-2 { color: #ff9500; }
.rank-num.top-3 { color: #ffcc00; }
.rank-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.04);
}
.rank-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.rank-name {
    font-size: 14px;
    font-weight: 600;
    color: #1d1d1f;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rank-desc {
    font-size: 12px;
    color: #86868b;
    margin-top: 2px;
}
.ranking-item.no-icon .rank-name { font-weight: 500; }

/* ---------- 筛选条 ---------- */
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 18px;
    border-bottom: 1px solid #e5e5ea;
    margin-bottom: 24px;
}
.chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    min-width: 0;
}
.chips::-webkit-scrollbar { display: none; }
.chips-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.chips-sub .chip { font-size: 13px; padding: 6px 14px; }
.chip {
    flex-shrink: 0;
    border: 1px solid #e5e5ea;
    background: #ffffff;
    border-radius: 999px;
    padding: 7px 16px;
    font-size: 14px;
    color: #1d1d1f;
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.2s;
}
.chip:hover { border-color: #c8c8cf; color: #1d1d1f; text-decoration: none; }
.chip.active {
    background: #1d1d1f;
    border-color: #1d1d1f;
    color: #ffffff;
}
.sort-btn {
    flex-shrink: 0;
    border: 1px solid #e5e5ea;
    background: #ffffff;
    border-radius: 999px;
    padding: 7px 16px;
    font-size: 14px;
    color: #1d1d1f;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s;
}
.sort-btn:hover { border-color: #c8c8cf; }
.sort-btn::after { margin-left: 2px; }
.sort-btn i { font-size: 14px; color: #86868b; transition: transform 0.2s; }
.sort-dropdown { position: relative; }
.sort-dropdown.open .sort-btn i { transform: rotate(180deg); }
/* 自定义排序菜单 */
.sort-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 176px;
    background: #ffffff;
    border: 1px solid #e5e5ea;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.10);
    padding: 6px;
    display: none;
    z-index: 30;
}
.sort-menu.open { display: block; }
.sort-item {
    display: block;
    padding: 9px 14px;
    border-radius: 9px;
    font-size: 14px;
    color: #1d1d1f;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.sort-item:hover { background: #f5f5f7; color: #0071e3; }
.sort-item.active { color: #0071e3; font-weight: 600; }
.sort-item.active::after {
    content: "\f00c";
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", FontAwesome;
    font-weight: 900;
    font-size: 12px;
    float: right;
    margin-top: 2px;
}

/* ---------- 横向游戏卡片（列表 / 首页 / 搜索结果共用） ---------- */
.game-card {
    display: flex;
    align-items: center;
    gap: 18px;
    height: 100%;
    background: #ffffff;
    border: 1px solid #e5e5ea;
    border-radius: 18px;
    padding: 16px 20px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.22s, box-shadow 0.22s, border-color 0.22s;
}
.game-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
    border-color: #d8d8de;
    color: inherit;
}
.game-icon {
    width: 86px;
    height: 86px;
    border-radius: 19px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.04);
}
.game-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.game-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.game-name {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.game-desc {
    font-size: 13px;
    color: #86868b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.game-info-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.plat-icons {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #c0c0c8;
    font-size: 15px;
}
.plat-icons i { transition: color 0.2s; }
.game-card:hover .plat-icons i { color: #86868b; }
.dl-btn {
    background: #e8f0fe;
    color: #0071e3;
    border-radius: 999px;
    padding: 6px 20px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}
.game-card:hover .dl-btn { background: #0071e3; color: #ffffff; }

/* ---------- 分页 ---------- */
.pagination-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 40px 0 10px;
    flex-wrap: wrap;
}
.pagination-wrap a,
.pagination-wrap span {
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid #e5e5ea;
    background: #ffffff;
    color: #1d1d1f;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s;
}
.pagination-wrap a:hover { border-color: #1d1d1f; color: #1d1d1f; }
.pagination-wrap .active,
.pagination-wrap strong {
    background: #1d1d1f;
    border-color: #1d1d1f;
    color: #ffffff;
}
/* 统计文案（共 X 条/ Y 页） */
.pagination-wrap cite {
    font-style: normal;
    font-size: 14px;
    color: #86868b;
    border: none;
    background: none;
    padding: 0 6px;
}
.pagination-wrap cite strong,
.pagination-wrap cite b { color: #1d1d1f; font-weight: 600; }
/* 跳页输入框 + GO 按钮 */
.pagination-wrap .pages_inp {
    width: 64px;
    height: 38px;
    padding: 0 8px;
    border: 1px solid #e5e5ea;
    border-radius: 10px;
    background: #ffffff;
    text-align: center;
    font-size: 14px;
    color: #1d1d1f;
    outline: none;
    transition: border-color 0.2s;
}
.pagination-wrap .pages_inp:focus { border-color: #0071e3; }
.pagination-wrap .pages_btn {
    height: 38px;
    padding: 0 18px;
    border: 1px solid #1d1d1f;
    border-radius: 10px;
    background: #1d1d1f;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}
.pagination-wrap .pages_btn:hover { background: #000000; }
.pagination-wrap .pages_btn:hover,
.pagination-wrap .pages_inp:hover { border-color: #1d1d1f; }

/* ---------- 搜索大框（搜索页 / 标签页，参照 words.php） ---------- */
.search-hero {
    background: #ffffff;
    border-radius: 24px;
    padding: 36px 30px 30px;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
    text-align: center;
}
.search-hero-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
}
.search-hero-title span { color: #0071e3; }
.hero-input-group {
    position: relative;
    max-width: 720px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
}
.hero-input-group i.fa-search {
    position: absolute;
    left: 24px;
    color: #86868b;
    font-size: 18px;
    pointer-events: none;
}
.hero-input {
    width: 100%;
    padding: 16px 24px 16px 56px;
    border: 2px solid #e5e5ea;
    border-radius: 999px;
    font-size: 16px;
    background: #f5f5f7;
    transition: all 0.2s;
    outline: none;
}
.hero-input:focus {
    border-color: #0071e3;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}
.hero-search-btn {
    position: absolute;
    right: 6px;
    background: #0071e3;
    color: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 10px 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.hero-search-btn:hover { background: #0060c0; }

/* ---------- 相关搜索 ---------- */
.related-keywords {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}
.related-keywords span {
    font-size: 14px;
    color: #86868b;
}
.kw-link {
    font-size: 14px;
    color: #1d1d1f;
    background: #ffffff;
    border: 1px solid #e5e5ea;
    border-radius: 8px;
    padding: 6px 16px;
    text-decoration: none;
    transition: all 0.2s;
}
.kw-link:hover {
    border-color: #0071e3;
    color: #0071e3;
    box-shadow: 0 2px 8px rgba(0, 113, 227, 0.1);
    text-decoration: none;
}

/* ---------- 搜索统计 ---------- */
.result-stats { margin-bottom: 20px; }
.stats-text { font-size: 15px; color: #86868b; }
.stats-text strong { color: #1d1d1f; }

/* ---------- 关键词高亮 ---------- */
.game-name mark,
.game-desc mark {
    background: #fff3cd;
    color: #1d1d1f;
    padding: 0 2px;
    border-radius: 2px;
}

/* ---------- 原生排序下拉（Destoon $order_select 输出的 select） ---------- */
.filter-bar select {
    flex-shrink: 0;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border: 1px solid #e5e5ea;
    background: #ffffff url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%231d1d1f' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 16px center;
    border-radius: 999px;
    padding: 7px 38px 7px 18px;
    font-size: 14px;
    color: #1d1d1f;
    cursor: pointer;
    transition: border-color 0.2s;
    outline: none;
}
.filter-bar select:hover,
.filter-bar select:focus { border-color: #c8c8cf; }

/* ---------- 加载更多 ---------- */
/* 注意：loadmore-wrap 位于 #gameGrid 的 .row 弹性网格内部，必须通栏占满一行，否则会挤进卡片格子中间 */
.loadmore-wrap {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: 26px 0 10px;
}
.loadmore-btn {
    min-width: 180px;
    height: 44px;
    padding: 0 36px;
    border: 1px solid #e5e5ea;
    border-radius: 999px;
    background: #ffffff;
    color: #1d1d1f;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.loadmore-btn:hover {
    border-color: #1d1d1f;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}
.loadmore-btn.loading {
    opacity: 0.6;
    cursor: default;
    box-shadow: none;
}
.loadmore-done {
    display: none;
    font-size: 14px;
    color: #86868b;
}
.loadmore-done.show { display: block; }

/* ---------- 响应式（共用组件） ---------- */
@media (max-width: 767px) {
    .game-card { padding: 14px 16px; gap: 14px; border-radius: 16px; }
    .game-icon { width: 72px; height: 72px; border-radius: 16px; }
    .game-name { font-size: 15px; }
    .game-desc { font-size: 12px; }
    .game-info { gap: 10px; }
    .plat-icons { font-size: 13px; gap: 10px; }
    .dl-btn { padding: 5px 16px; font-size: 12px; }
    .chip { padding: 6px 14px; font-size: 13px; }
    .sort-btn { padding: 6px 12px; font-size: 13px; }
    .filter-bar { padding-bottom: 14px; margin-bottom: 18px; }
    .pagination-wrap { gap: 5px; margin-top: 28px; }
    .pagination-wrap a,
    .pagination-wrap span { min-width: 34px; height: 34px; padding: 0 10px; font-size: 13px; }
    .pagination-wrap .pages_inp { width: 52px; height: 34px; }
    .pagination-wrap .pages_btn { height: 34px; padding: 0 14px; }
}
@media (max-width: 575px) {
    .game-card { padding: 12px; gap: 12px; }
    .game-icon { width: 64px; height: 64px; border-radius: 14px; }
}
@media (max-width: 767px) {
    .page-title { font-size: 26px; }
    .page-subtitle { font-size: 14px; }
    .page-head { margin-bottom: 18px; }
    .bottom-title { font-size: 18px; margin-bottom: 14px; }
    .keyword-tag { padding: 6px 12px; font-size: 13px; min-width: 115px; }
    .kw-index { font-size: 11px; }
    .ranking-header { padding: 14px 16px; }
    .ranking-header-title { font-size: 15px; }
    .ranking-item { padding: 10px 16px; gap: 10px; min-height: 60px; }
    .ranking-item.no-icon { min-height: 42px; padding: 8px 16px; }
    .rank-icon { width: 38px; height: 38px; border-radius: 9px; }
    .rank-name { font-size: 13px; }
    .rank-desc { font-size: 11px; }
    .search-hero { padding: 24px 20px; border-radius: 20px; }
    .search-hero-title { font-size: 20px; margin-bottom: 16px; }
    .hero-input-group { margin-bottom: 16px; }
    .hero-input { padding: 12px 16px 12px 42px; font-size: 15px; }
    .hero-input-group i.fa-search { left: 16px; font-size: 16px; }
    .hero-search-btn { padding: 8px 20px; font-size: 14px; }
    .related-keywords { gap: 8px; }
    .kw-link { font-size: 13px; padding: 4px 12px; }
}
@media (max-width: 575px) {
    .sort-btn .sort-text { display: none; }
    .sort-btn { padding: 6px 12px; }
}
