/* ============================================
   模块背景美化 — 仿 tfbkw.com 风格
   ============================================ */

/* ── 文章卡片背景 ── */
.posts-item.card {
    background-image: var(--zm-card-bg);
    background-size: cover;
    background-position: center;
    overflow: visible !important;
    position: relative !important;
    z-index: 1 !important;
}

/* ── 卡片标签彩色悬浮效果 ── */
.posts-item.card .item-tags .but,
.posts-item.card .meta-category a {
    position: relative !important;
    overflow: hidden !important;
    z-index: 2 !important;
    display: inline-block !important;
    padding: 4px 10px !important;
    margin: 0 6px 8px 0 !important;
    font-size: 10px !important;
    font-weight: 400 !important;
    text-decoration: none !important;
    border-radius: 999px !important;
    background-color: #f1f3f5 !important;
    color: #5f6368 !important;
    border: 1px solid #e9ecef !important;
    transition: all .3s ease-out !important;
    box-shadow: none !important;
}
.posts-item.card .item-tags .but:before,
.posts-item.card .meta-category a:before {
    content: '' !important;
    position: absolute !important;
    top: 50%;
    left: 50%;
    width: 150%;
    padding-bottom: 150%;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform .6s cubic-bezier(.1,.7,.3,1), opacity .6s ease;
    z-index: -1 !important;
}
.posts-item.card .item-tags .but:hover,
.posts-item.card .meta-category a:hover {
    transform: translateY(-2px);
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: 0 5px 12px -2px rgba(0,0,0,.2) !important;
}
.posts-item.card .item-tags .but:hover:before,
.posts-item.card .meta-category a:hover:before {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}
/* 标签循环配色 */
.posts-item.card .item-tags .but:nth-child(4n+1):hover,
.posts-item.card .meta-category a:nth-child(4n+1):hover { background-color: #8e44ad !important; }
.posts-item.card .item-tags .but:nth-child(4n+1):before,
.posts-item.card .meta-category a:nth-child(4n+1):before { background-image: radial-gradient(circle, #9b59b6, #8e44ad) !important; }
.posts-item.card .item-tags .but:nth-child(4n+2):hover,
.posts-item.card .meta-category a:nth-child(4n+2):hover { background-color: #27ae60 !important; }
.posts-item.card .item-tags .but:nth-child(4n+2):before,
.posts-item.card .meta-category a:nth-child(4n+2):before { background-image: radial-gradient(circle, #2ecc71, #27ae60) !important; }
.posts-item.card .item-tags .but:nth-child(4n+3):hover,
.posts-item.card .meta-category a:nth-child(4n+3):hover { background-color: #2980b9 !important; }
.posts-item.card .item-tags .but:nth-child(4n+3):before,
.posts-item.card .meta-category a:nth-child(4n+3):before { background-image: radial-gradient(circle, #3498db, #2980b9) !important; }
.posts-item.card .item-tags .but:nth-child(4n+4):hover,
.posts-item.card .meta-category a:nth-child(4n+4):hover { background-color: #d35400 !important; }
.posts-item.card .item-tags .but:nth-child(4n+4):before,
.posts-item.card .meta-category a:nth-child(4n+4):before { background-image: radial-gradient(circle, #e67e22, #d35400) !important; }

/* ── 卡片悬停浮起效果 ── */
.posts-item.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 85, 128, .12);
    z-index: 99;
    transition: all .2s;
}

/* ── 缩略图悬浮光环 ── */
.item-thumbnail {
    position: relative;
}
.item-thumbnail:before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0);
    transition: background .35s;
    border-radius: 8px;
    z-index: 2;
    max-width: 765px;
    margin: 0 auto;
    pointer-events: none;
}
.item-thumbnail:after {
    content: '';
    position: absolute;
    top: 47%; left: 47%;
    width: 50px; height: 50px;
    margin: -20px 0 0 -20px;
    background: var(--zm-hover-rings);
    background-repeat: no-repeat;
    background-size: 100% 100%;
    z-index: 3;
    transform: scale(2);
    transition: transform .35s, opacity .35s;
    opacity: 0;
    pointer-events: none;
}
.item-thumbnail:hover:before {
    background: rgba(0,0,0,.5);
}
.item-thumbnail:hover:after {
    transform: scale(1);
    opacity: 1;
}

/* ── 标题气球装饰 ── */
.title-theme {
    position: relative;
    padding-left: 1.3em;
    font-size: 20px;
    margin: 5px;
}
.title-theme:before {
    content: '';
    top: -30px;
    width: 64px;
    height: 64px;
    left: -32px;
    background: var(--zm-title-balloon);
    box-shadow: 0 0 #000;
    background-size: cover;
}

/* ── 侧栏小工具卡片美化 ── */
.sidebar .widget,
.sidebar-col .widget {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(71, 135, 236, .06);
    transition: box-shadow .3s ease;
}
.sidebar .widget:hover,
.sidebar-col .widget:hover {
    box-shadow: 0 4px 18px rgba(71, 135, 236, .12);
}

/* ── 翻页按钮美化 ── */
.pagenav .current,
.pagenav .page-numbers,
.pagenav a {
    border: 0;
    padding: 8px 14px;
    background: linear-gradient(148deg, hsla(0,0%,100%,0), var(--main-bg-color));
    box-shadow: 0 0 8px 0 rgba(95,95,95,.15);
    border-radius: 6px;
}

/* ── 文章内图片圆角 ── */
.wp-posts-content img {
    border-radius: 10px;
}

/* ── 暗黑模式兼容 ── */
html.dark .posts-item.card,
html.night .posts-item.card,
body.dark .posts-item.card,
body.night .posts-item.card {
    background-image: none !important;
    background-color: var(--main-bg-color, #2a2a2a);
}
