/*
Theme Name: 子比子主题 - 性能测试版
Description: 当前子主题副本；增加访客游戏列表查询缓存，保留布局与功能。
Template: zibll
Version: 1.8.1.1
Text Domain: zibll-child
*/

/* =========================================================
   沉浸海报卡片
   竖图铺满卡片，标题、标签和文章信息叠在底部渐变蒙版上。
   由 functions.php 添加的 body.poster-card 控制。
   ========================================================= */

body.poster-card .posts-item.card:not(.product-item) {
    --zcc-card-meta-size: 12px;
    position: relative;
    aspect-ratio: 2 / 3;
    padding: 0;
    overflow: hidden;
    border-radius: var(--main-radius);
}

body.poster-card .posts-item.card:not(.product-item) .item-thumbnail {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding-bottom: 0;
    border-radius: 0;
}

body.poster-card .posts-item.card:not(.product-item) .item-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

/* 沉浸海报不显示缩略图右上角的视频播放符号。 */
body.poster-card .posts-item.card:not(.product-item) .item-thumbnail > .abs-center.right-top .fa-play-circle {
    display: none !important;
}

body.poster-card .posts-item.card:not(.product-item) .item-body {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 3;
    margin: 0;
    padding: 46px 14px 12px;
    border-radius: 0 0 var(--main-radius) var(--main-radius);
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.88) 0%,
        rgba(0, 0, 0, 0.6) 42%,
        rgba(0, 0, 0, 0) 100%
    );
    pointer-events: none;
}

body.poster-card .posts-item.card:not(.product-item) .item-body a,
body.poster-card .posts-item.card:not(.product-item) .item-body .item-tags,
body.poster-card .posts-item.card:not(.product-item) .item-body .item-meta {
    pointer-events: auto;
}

body.poster-card .posts-item.card:not(.product-item) .item-heading {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 0;
    max-height: none;
    margin: 0 0 6px;
    overflow: hidden;
    font-size: 15px;
    line-height: 1.35em;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

body.poster-card .posts-item.card:not(.product-item) .item-heading > a {
    display: block;
    overflow: hidden;
    flex: 1;
    min-width: 0;
    color: #fff;
    white-space: nowrap;
    text-overflow: ellipsis;
}

body.poster-card .posts-item.card:not(.product-item) .item-heading > a:hover {
    color: #fff;
}

body.poster-card .posts-item.card:not(.product-item) .item-tags {
    min-height: 0;
    margin-bottom: 6px;
}

body.poster-card .posts-item.card:not(.product-item) .item-tags a {
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
    border-color: transparent;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

body.poster-card .posts-item.card:not(.product-item) .item-meta,
body.poster-card .posts-item.card:not(.product-item) .item-meta item,
body.poster-card .posts-item.card:not(.product-item) .item-meta a,
body.poster-card .posts-item.card:not(.product-item) .item-meta .meta-right item {
    color: rgba(255, 255, 255, 0.85) !important;
}

body.poster-card .posts-item.card:not(.product-item) .item-meta .meta-author span {
    color: #fff !important;
}

/* 评论、访问和点赞改为文章更新时间。 */
body.poster-card .posts-item.card:not(.product-item) .meta-right .meta-comm,
body.poster-card .posts-item.card:not(.product-item) .meta-right .meta-view,
body.poster-card .posts-item.card:not(.product-item) .meta-right .meta-like {
    display: none !important;
}

body.poster-card .posts-item.card:not(.product-item) .meta-right .zcc-modified-date {
    display: inline-flex !important;
    align-items: center;
}

body.poster-card .posts-item.card:not(.product-item) .meta-right .zcc-modified-date {
    font-size: var(--zcc-card-meta-size);
    line-height: 20px;
    white-space: nowrap;
}

/* 卡片只显示主标题；副标题仍保留在页面 DOM 中。 */
body.poster-card .posts-item.card:not(.product-item) .item-heading .focus-color {
    display: none;
}

/* 海报底部空间有限，隐藏卡片时间；评论、浏览和点赞不受影响。 */
body.poster-card .posts-item.card:not(.product-item) .item-meta > .icon-circle,
body.poster-card .posts-item.card:not(.product-item) .item-meta > .meta-author .icon-circle {
    display: none;
}

/* Steam 十分制评分：固定在卡片右下角。 */
body.poster-card .posts-item.card:not(.product-item) > .zcc-steam-score {
    position: absolute;
    right: 12px;
    bottom: 10px;
    z-index: 4;
    min-width: 30px;
    height: 20px;
    box-sizing: border-box;
    padding: 0 3px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--main-radius);
    color: var(--focus-color);
    background: rgba(10, 16, 24, 0.72);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    font-size: var(--zcc-card-meta-size);
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

/* 下载量和标题同一行，颜色与阅读/访问数据一致。 */
body.poster-card .posts-item.card:not(.product-item) .item-heading > .zcc-game-downloads {
    flex: 0 0 auto;
    height: 20px;
    box-sizing: border-box;
    padding: 0;
    color: rgba(255, 255, 255, 0.85);
    background: transparent;
    font-size: var(--zcc-card-meta-size);
    line-height: 20px;
    text-align: center;
}

body.poster-card .posts-item.card:not(.product-item) .item-heading > .zcc-game-downloads .fa {
    margin-right: 3px;
    color: inherit;
}

body.poster-card .posts-item.card:not(.product-item):has(> .zcc-steam-score) .item-meta {
    padding-right: 38px;
}

@media (max-width: 768px) {
    body.poster-card .posts-item.card:not(.product-item) {
        --zcc-card-meta-size: 11px;
    }

    body.poster-card .posts-item.card:not(.product-item) .item-heading {
        font-size: 14px;
    }

    body.poster-card .posts-item.card:not(.product-item) .item-body {
        padding: 36px 10px 10px;
    }

    body.poster-card .posts-item.card:not(.product-item) > .zcc-steam-score {
        right: 9px;
        bottom: 9px;
        min-width: 28px;
        height: 18px;
        padding: 0 2px;
        font-size: var(--zcc-card-meta-size);
        line-height: 16px;
    }

    body.poster-card .posts-item.card:not(.product-item) .item-heading > .zcc-game-downloads {
        height: 18px;
        font-size: var(--zcc-card-meta-size);
        line-height: 18px;
    }

    body.poster-card .posts-item.card:not(.product-item) .meta-right .zcc-modified-date {
        line-height: 18px;
    }
}

/* =========================================================
   侧边栏：游戏截图
   ========================================================= */

.zgr-shots {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.zgr-shot {
    display: block;
    overflow: hidden;
    line-height: 0;
}

.zgr-shot-img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.zgr-shot:hover .zgr-shot-img {
    transform: scale(1.03);
}

.zgr-shots-more {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 0;
    border: 0;
    color: var(--focus-color);
    background: transparent;
    font: inherit;
    font-size: 13px;
    text-align: center;
    cursor: pointer;
}

.zgr-shots-more:hover {
    opacity: 0.8;
}

.zgr-more-arrow {
    margin-left: 4px;
    transition: transform 0.2s ease;
}

.zgr-shots-more:hover .zgr-more-arrow {
    transform: translateY(2px);
}

/* =========================================================
   侧边栏：系统配置
   ========================================================= */

.zgr-req-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.zgr-req-tab {
    flex: 1;
    padding: 6px 10px;
    border: 0;
    border-radius: var(--main-radius, 8px);
    color: var(--muted-color);
    background: var(--muted-bg-color);
    font: inherit;
    font-size: 13px;
    text-align: center;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.zgr-req-tab.active {
    color: #fff;
    background: var(--focus-color, #f04494);
    font-weight: 600;
}

.zgr-req-panel {
    display: none;
}

.zgr-req-panel.active,
.zgr-req-p-only {
    display: block;
}

.zgr-req-panel ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.zgr-req-panel li {
    padding: 5px 0;
    border-bottom: 1px solid var(--main-border-color);
    color: var(--muted-color);
    font-size: 13px;
    line-height: 1.5;
}

.zgr-req-panel li:last-child {
    border-bottom: 0;
}

.zgr-req-panel strong,
.zgr-req-panel b {
    color: var(--key-color);
    font-weight: 600;
}

/* =========================================================
   文章正文中的图片和视频居中
   ========================================================= */

.wp-posts-content img:not(.wp-smiley):not(.emoji):not(.avatar):not(.img-icon),
.wp-posts-content video {
    display: block;
    margin-right: auto;
    margin-left: auto;
}

.wp-posts-content video {
    max-width: 100% !important;
    height: auto !important;
}

.wp-posts-content .wp-video,
.wp-posts-content .mejs-container {
    max-width: 100% !important;
}

.wp-posts-content p:has(> img:not(.wp-smiley):not(.emoji):not(.avatar):not(.img-icon)),
.wp-posts-content p:has(> video) {
    text-align: center;
}
