/* ==========================================================
   标签中心 /tag/ —— 全部标签 + 单个标签页
   依赖 style.css（卡片 / 骨架）与 list.css（筛选栏 / chips）
   ========================================================== */

/* ---------- 首页头部 ---------- */
.tag-hero {
    background: #ffffff;
    border: 1px solid #e5e5ea;
    border-radius: 20px;
    padding: 30px 26px 24px;
    margin-bottom: 22px;
}
.tag-hero-title {
    font-size: 26px;
    font-weight: 700;
    color: #1d1d1f;
    letter-spacing: -0.3px;
    margin-bottom: 8px;
}
.tag-hero-sub {
    font-size: 14px;
    color: #86868b;
    margin-bottom: 18px;
}
.tag-hero-sub strong { color: #1d1d1f; font-weight: 600; }
.tag-search {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 460px;
}
.tag-search i.fa-search {
    position: absolute;
    left: 15px;
    font-size: 14px;
    color: #a1a1a6;
    pointer-events: none;
}
.tag-search input {
    width: 100%;
    height: 42px;
    border: 1px solid #e5e5ea;
    border-radius: 999px;
    background: #f5f5f7;
    padding: 0 42px 0 38px;
    font-size: 14px;
    color: #1d1d1f;
    outline: none;
    transition: border-color .2s, background .2s;
}
.tag-search input:focus {
    background: #ffffff;
    border-color: #0071e3;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, .12);
}
.tag-search-clear {
    position: absolute;
    right: 8px;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: #e5e5ea;
    color: #6e6e73;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tag-search-clear:hover { background: #d8d8de; color: #1d1d1f; }

/* ---------- 区块 ---------- */
.tag-block {
    background: #ffffff;
    border: 1px solid #e5e5ea;
    border-radius: 20px;
    padding: 22px 24px 24px;
    margin-bottom: 22px;
}
.tag-block-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.tag-block-title {
    font-size: 17px;
    font-weight: 600;
    color: #1d1d1f;
}
.tag-block-tip {
    font-size: 12px;
    color: #a1a1a6;
}

/* ---------- 标签云 ---------- */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid #e5e5ea;
    border-radius: 999px;
    background: #ffffff;
    color: #1d1d1f;
    font-size: 13px;
    line-height: 1;
    text-decoration: none;
    transition: all .18s;
    white-space: nowrap;
}
.tag-chip em {
    font-style: normal;
    font-size: 11px;
    color: #a1a1a6;
    background: #f5f5f7;
    border-radius: 999px;
    padding: 3px 6px;
    line-height: 1;
}
.tag-chip:hover {
    border-color: #0071e3;
    color: #0071e3;
    background: #f2f8ff;
    text-decoration: none;
    transform: translateY(-1px);
}
.tag-chip:hover em { background: #e8f0fe; color: #0071e3; }
.tag-chip.hot {
    border-color: #ffe0c7;
    background: #fff8f2;
    color: #c2410c;
}
.tag-chip.hot em { background: #ffe9d8; color: #c2410c; }
.tag-chip.hot:hover { border-color: #f97316; color: #ea580c; background: #fff2e6; }

/* ---------- 字母导航 ---------- */
.tag-letters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px dashed #ececf2;
}
.tag-letters a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 34px;
    height: 30px;
    padding: 0 9px;
    border-radius: 8px;
    background: #f5f5f7;
    color: #1d1d1f;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all .16s;
}
.tag-letters a em {
    font-style: normal;
    font-size: 11px;
    font-weight: 400;
    color: #a1a1a6;
}
.tag-letters a:hover { background: #0071e3; color: #ffffff; }
.tag-letters a:hover em { color: rgba(255, 255, 255, .8); }

/* ---------- 分组 ---------- */
.tag-group {
    display: flex;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid #f2f2f6;
    scroll-margin-top: 20px;
}
.tag-group:last-child { border-bottom: none; padding-bottom: 4px; }
.tag-group-letter {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 10px;
    background: #f5f5f7;
    color: #6e6e73;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tag-group .tag-cloud { flex: 1; }

/* ---------- 无结果 ---------- */
.tag-filter-empty {
    display: none;
    text-align: center;
    padding: 48px 0 30px;
    color: #a1a1a6;
}
.tag-filter-empty.show { display: block; }
.tag-filter-empty i { font-size: 34px; color: #d8d8de; margin-bottom: 12px; display: block; }
.tag-filter-empty p { font-size: 14px; margin: 0; }

/* ==========================================================
   单个标签页
   ========================================================== */
.tag-crumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #86868b;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.tag-crumb a { color: #6e6e73; text-decoration: none; }
.tag-crumb a:hover { color: #0071e3; }
.tag-crumb i { font-size: 11px; color: #c7c7cc; }
.tag-crumb span { color: #1d1d1f; }

.tag-head {
    background: #ffffff;
    border: 1px solid #e5e5ea;
    border-radius: 20px;
    padding: 26px 26px 22px;
    margin-bottom: 18px;
}
.tag-head-title {
    font-size: 26px;
    font-weight: 700;
    color: #1d1d1f;
    letter-spacing: -0.3px;
    margin-bottom: 8px;
}
.tag-head-title span {
    font-size: 13px;
    font-weight: 500;
    color: #0071e3;
    background: #e8f0fe;
    border-radius: 999px;
    padding: 4px 10px;
    margin-left: 10px;
    vertical-align: middle;
}
.tag-head-sub {
    font-size: 14px;
    color: #86868b;
    margin: 0;
}
.tag-head-sub strong { color: #1d1d1f; font-size: 16px; }
.tag-head-empty { text-align: center; padding: 56px 26px; }
.tag-404-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 18px;
    border-radius: 20px;
    background: #f5f5f7;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tag-404-icon i { font-size: 30px; color: #c7c7cc; }
.tag-head-empty .tag-head-sub a { color: #0071e3; }

.tag-initial {
    font-size: 12px;
    color: #a1a1a6;
    white-space: nowrap;
}
.tag-initial a {
    display: inline-block;
    min-width: 22px;
    padding: 2px 6px;
    margin-left: 4px;
    border-radius: 6px;
    background: #f5f5f7;
    color: #6e6e73;
    font-weight: 600;
    text-decoration: none;
}
.tag-initial a:hover { background: #0071e3; color: #ffffff; }

/* 筛选 chips 里的数量 */
.chips .chip-num {
    font-style: normal;
    font-size: 11px;
    color: #a1a1a6;
    margin-left: 5px;
}
.chips .chip.active .chip-num { color: #0071e3; }

/* 卡片里的来源模块小标 */
.src-badge {
    font-size: 11px;
    line-height: 1;
    color: #86868b;
    background: #f5f5f7;
    border-radius: 5px;
    padding: 3px 6px;
    margin-right: 2px;
}

/* ---------- 分页 ---------- */
.tag-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 32px 0 6px;
}
.tag-pager a,
.tag-pager span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 9px;
    border: 1px solid #e5e5ea;
    background: #ffffff;
    color: #1d1d1f;
    font-size: 13px;
    text-decoration: none;
    transition: all .16s;
}
.tag-pager a:hover { border-color: #0071e3; color: #0071e3; }
.tag-pager .pg-num.active {
    background: #0071e3;
    border-color: #0071e3;
    color: #ffffff;
    font-weight: 600;
}
.tag-pager .pg-dot { border: none; background: transparent; color: #a1a1a6; }
.tag-pager .pg-prev,
.tag-pager .pg-next { gap: 4px; padding: 0 14px; }
.tag-pager .pg-info {
    border: none;
    background: transparent;
    color: #a1a1a6;
    font-size: 12px;
    margin-left: 6px;
}

/* ---------- 相关标签 ---------- */
.tag-block-related { margin-top: 26px; }

/* ---------- 移动端 ---------- */
@media (max-width: 991px) {
    .tag-hero, .tag-block, .tag-head { border-radius: 16px; padding: 18px 16px; }
    .tag-hero-title, .tag-head-title { font-size: 21px; }
    .tag-head-title span { font-size: 12px; padding: 3px 8px; margin-left: 8px; }
    .tag-hero-sub, .tag-head-sub { font-size: 13px; }
    .tag-search input { height: 40px; font-size: 15px; }
    .tag-group { gap: 10px; padding: 13px 0; }
    .tag-group-letter { width: 28px; height: 28px; font-size: 13px; border-radius: 8px; }
    .tag-chip { padding: 6px 11px; font-size: 12px; }
    .tag-cloud { gap: 8px; }
    .tag-letters { gap: 5px; }
    .tag-letters a { min-width: 30px; height: 28px; padding: 0 7px; font-size: 12px; }
    .tag-pager a, .tag-pager span { min-width: 32px; height: 32px; font-size: 12px; }
    .tag-initial { display: none; }
}

/* ---------- 平台角标（卡片右上角，灰色无底色；替代原“手机/电视”文字标签） ---------- */
.game-card { position: relative; }
.plat-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #b3b3bb;
    pointer-events: none;
}
.game-card:hover .plat-badge { color: #8e8e96; }
.pb-ico { width: 16px; height: 16px; display: block; }
.game-card .game-name { padding-right: 34px; }
@media (max-width: 575px) {
    .plat-badge { top: 10px; right: 10px; width: 20px; height: 20px; }
    .plat-badge .pb-ico { width: 15px; height: 15px; }
    .game-card .game-name { padding-right: 30px; }
}

/* ---------- 标签自定义介绍（与标题合并为同一张卡片） ---------- */
.tag-head-intro {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #f0f0f4;
}
.tag-head-pic {
    width: 200px;
    height: 125px;
    border-radius: 12px;
    overflow: hidden;
    flex: 0 0 auto;
    background: #f1f5f9;
    border: 1px solid rgba(0, 0, 0, 0.04);
}
.tag-head-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tag-head-desc {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    line-height: 1.9;
    color: #4b5563;
    white-space: pre-line;
    word-break: break-word;
}
.tag-head.has-intro { padding-bottom: 24px; }
@media (max-width: 767px) {
    .tag-head-intro { flex-direction: column; gap: 12px; margin-top: 14px; padding-top: 14px; }
    .tag-head-pic { width: 100%; height: auto; aspect-ratio: 16 / 9; }
    .tag-head-desc { font-size: 13px; line-height: 1.85; }
}

/* ---------- 平台选项卡（button 版 chip，站内切换不跳转） ---------- */
.chips button.chip {
    font-family: inherit;
    font-size: 14px;
    line-height: 1.2;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
}
.chips button.chip:focus-visible { box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.16); }
.chips button.chip.active { cursor: default; }
.chips button.chip .chip-num { pointer-events: none; }
#tagGrid.is-loading { opacity: 0.45; transition: opacity 0.15s; pointer-events: none; }
@media (max-width: 575px) {
    .chips button.chip { font-size: 13px; padding: 6px 14px; }
}

/* ---------- 精选标签（有封面图的图文卡片） ---------- */
.pic-tag-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 14px;
}
.pic-tag-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e5e5ea;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    transition: transform .18s, box-shadow .18s, border-color .18s;
}
.pic-tag-card:hover {
    transform: translateY(-3px);
    border-color: #d8d8de;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .08);
    text-decoration: none;
}
.pic-tag-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #f5f5f7;
    overflow: hidden;
}
.pic-tag-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}
.pic-tag-card:hover .pic-tag-thumb img { transform: scale(1.04); }
.pic-tag-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 11px 14px 2px;
}
.pic-tag-meta strong {
    font-size: 15px;
    font-weight: 600;
    color: #1d1d1f;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pic-tag-meta em {
    font-style: normal;
    font-size: 11px;
    color: #a1a1a6;
    background: #f5f5f7;
    border-radius: 999px;
    padding: 3px 8px;
    line-height: 1;
    flex-shrink: 0;
}
.pic-tag-intro {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* 注意：此元素不能加 padding——新版 Chromium 中 -webkit-line-clamp + padding 会漏出第三行文字碎片，间距一律用 margin */
    margin: 4px 14px 13px;
    font-size: 12px;
    line-height: 1.6;
    color: #86868b;
}
.pic-tag-card:hover .pic-tag-meta strong { color: #0071e3; }
.pic-tag-card:hover .pic-tag-meta em { background: #e8f0fe; color: #0071e3; }

/* 手机端精选标签简介只显示 1 行 */
@media (max-width: 767px) {
    .pic-tag-intro {
        -webkit-line-clamp: 1;
        line-clamp: 1;
    }
}
