/* ============================================
 * 卡片悬浮遮罩美化 v1.6.13
 * hover 封面：黑色遮罩 + flex居中"立即查看"按钮
 * ============================================ */

.post-item {
    overflow: hidden !important;
    border-radius: 12px !important;
}
.post-item .entry-media {
    position: relative;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

/* VIP/置顶角标保持在遮罩上面 */
.post-item .tips-badge {
    z-index: 6 !important;
}

/* flex 居中容器（覆盖整个封面，hover时淡入） */
.post-item .sq-cms-wrap {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .82);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .3s ease;
    z-index: 4;
    border-radius: inherit;
    backdrop-filter: blur(2px);
}

.post-item:hover .sq-cms-wrap {
    opacity: 1;
}

/* 按钮 */
.post-item .sq-cms-btn {
    display: inline-block;
    background: #FEC195;
    color: #3a2a1a;
    padding: 10px 28px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: background .25s ease, color .25s ease, border .25s ease, box-shadow .25s ease;
    text-decoration: none;
    border: 1.5px solid #FEC195;
    box-shadow: 0 6px 18px rgba(254, 193, 149, .45);
    white-space: nowrap;
}

/* hover 按钮本身 */
.post-item .sq-cms-btn:hover {
    background: transparent;
    color: #FEC195;
    border-color: #FEC195;
    box-shadow: 0 6px 22px rgba(254, 193, 149, .7);
}

/* ============================================
 * 深色模式文章卡片四角露白修复 v1.6.82
 * 封面占位浅灰(#e7e7e7)深色化 + 圆角裁剪保障
 * ============================================ */
[data-bs-theme=dark] .post-item .media-img,
[data-bs-theme=dark] .post-item .entry-media .media-preview,
[data-bs-theme=dark] .post-item .entry-media {
    background-color: #191b1d !important;
}
[data-bs-theme=dark] .post-item .entry-media,
[data-bs-theme=dark] .post-item .entry-media .media-img,
[data-bs-theme=dark] .post-item .entry-media .media-preview,
[data-bs-theme=dark] .post-item .sq-cms-wrap {
    border-radius: 12px 12px 0 0 !important;
    overflow: hidden !important;
}
[data-bs-theme=dark] .post-item .sq-cms-wrap {
    background: rgba(0, 0, 0, .86) !important;
    border-radius: 12px !important;
}

/* ============================================
 * 深色模式文章卡片四角露白修复 v1.6.83（全面兜底）
 * 卡片本体/子元素/hover阴影/网格容器全部强制深色
 * ============================================ */
[data-bs-theme=dark] .post-item,
[data-bs-theme=dark] .post-item.item-grid,
[data-bs-theme=dark] .post-item.item-list {
    background-color: #191b1d !important;
    border: 1px solid rgba(255, 255, 255, .06) !important;
}
[data-bs-theme=dark] .post-item .entry-wrapper,
[data-bs-theme=dark] .post-item .entry-title,
[data-bs-theme=dark] .post-item .entry-desc,
[data-bs-theme=dark] .post-item .entry-meta,
[data-bs-theme=dark] .post-item .entry-cat-dot,
[data-bs-theme=dark] .post-item .entry-body,
[data-bs-theme=dark] .post-item .entry-footer {
    background-color: transparent !important;
}
[data-bs-theme=dark] .post-item:hover {
    -webkit-box-shadow: 0 1rem 3rem rgba(0, 0, 0, .5) !important;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, .5) !important;
}
[data-bs-theme=dark] .posts-warp,
[data-bs-theme=dark] .cms-post-warp,
[data-bs-theme=dark] .home-widget,
[data-bs-theme=dark] .section .container {
    background-color: transparent !important;
}

/* ============================================
 * 卡片整体圆角开关 v1.6.87
 * 开（body.sq-radius-0）：深浅模式卡片整体圆角归零（方角）
 * 关：10.5默认圆角（12px），深浅模式一致，深色四角不漏白
 * ============================================ */
body.sq-radius-0 .post-item,
body.sq-radius-0 .post-item.item-grid,
body.sq-radius-0 .post-item.item-list,
body.sq-radius-0 .post-item .entry-media,
body.sq-radius-0 .post-item .entry-media .media-img,
body.sq-radius-0 .post-item .entry-media .media-preview,
body.sq-radius-0 .post-item .sq-cms-wrap,
body.sq-radius-0 .post-item .tips-badge {
    border-radius: 0 !important;
}
body.sq-radius-0 .post-item .sq-cms-wrap {
    background: #000 !important;
    inset: 0 !important;
}

/* ============================================
 * 深色封面强制压暗 v1.6.89
 * filter 直接压暗封面图 + 暗化层双保险，四角绝不漏白
 * 保留圆角（非直角），暗化层随卡片圆角继承
 * ============================================ */
[data-bs-theme=dark] .post-item .entry-media .media-img,
[data-bs-theme=dark] .post-item .entry-media .media-preview {
    filter: brightness(.45) contrast(1.05) !important;
}
[data-bs-theme=dark] .post-item .entry-media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    pointer-events: none;
    z-index: 3;
    border-radius: inherit;
}
[data-bs-theme=dark] .post-item .sq-cms-wrap {
    background: rgba(0, 0, 0, .95) !important;
}
