/* The image-only latest-post wall from zhaizheku.com, scoped to this widget. */
.zyh-zzk-latest,
.zyh-zzk-latest *,
.zyh-zzk-latest *::before,
.zyh-zzk-latest *::after {
    box-sizing: border-box;
}

.zyh-zzk-latest.section {
    padding: 0;
    background: transparent;
    color: #34495e;
    font-family: Lato, "Microsoft YaHei", "PingFang SC", sans-serif;
}

.zyh-zzk-latest .zyh-zzk-container {
    margin: 0 auto;
}

.zyh-zzk-latest .zyh-zzk-panel {
    padding-top: 30px;
    padding-bottom: 10px;
    border-radius: 8px;
    background: #f0f3f4;
}

.zyh-zzk-latest .zyh-zzk-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin: 0 0 24px;
}

.zyh-zzk-latest .section-title {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    color: inherit;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: .5px;
    text-align: left;
}

.zyh-zzk-latest .section-title small,
.zyh-zzk-latest .zyh-zzk-desc {
    margin-left: 10px;
    color: inherit;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: 0;
    opacity: .85;
    text-transform: none;
}

.zyh-zzk-latest .zyh-zzk-desc {
    margin: 0;
}

.zyh-zzk-latest .zyh-zzk-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.zyh-zzk-latest .zyh-zzk-cats a {
    display: inline-flex;
    padding: 4px 9px;
    border-radius: 4px;
    background: rgba(52, 73, 94, .09);
    color: inherit;
    font-size: 12px;
    text-decoration: none;
}

.zyh-zzk-latest .zyh-zzk-cats a:hover,
.zyh-zzk-latest .zyh-zzk-cats a:focus-visible {
    background: #34495e;
    color: #fff;
}

.zyh-zzk-latest .zyh-zzk-grid.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
}

.zyh-zzk-latest .zyh-zzk-col {
    display: block;
    flex: 0 0 33.333333%;
    width: 33.333333%;
    max-width: 33.333333%;
    min-width: 0;
    margin: 0;
    padding: 0;
}

.zyh-zzk-latest .img-item {
    display: block;
    margin: 0;
    padding: 5px;
}

.zyh-zzk-latest .thumbnail {
    position: relative;
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.zyh-zzk-latest .entry-media {
    position: relative;
    display: block;
    width: 100%;
    overflow: hidden;
    border-radius: 4px;
    background: #dbe1e6;
    aspect-ratio: 190 / 90;
}

.zyh-zzk-latest .entry-media > a {
    display: block;
    width: 100%;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.zyh-zzk-latest .entry-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0;
    transition: transform .25s ease, opacity .25s ease;
}

.zyh-zzk-latest .thumbnail:hover img,
.zyh-zzk-latest .thumbnail:focus-within img {
    transform: scale(1.035);
}

.zyh-zzk-latest .thumbnail::after {
    content: attr(data-title);
    position: absolute;
    z-index: 3;
    bottom: calc(100% + 7px);
    left: 50%;
    width: max-content;
    max-width: min(360px, 90vw);
    padding: 6px 9px;
    border-radius: 3px;
    background: rgba(0, 0, 0, .9);
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 4px);
    transition: opacity .16s ease, transform .16s ease;
}

.zyh-zzk-latest .thumbnail:hover::after,
.zyh-zzk-latest .thumbnail:focus-within::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* Keep long hover titles inside the viewport at the outer columns. */
.zyh-zzk-latest .zyh-zzk-col:nth-child(3n+1) .thumbnail::after {
    left: 0;
    right: auto;
    transform: translateY(4px);
}

.zyh-zzk-latest .zyh-zzk-col:nth-child(3n) .thumbnail::after {
    left: auto;
    right: 0;
    transform: translateY(4px);
}

.zyh-zzk-latest .zyh-zzk-col:nth-child(3n+1) .thumbnail:hover::after,
.zyh-zzk-latest .zyh-zzk-col:nth-child(3n+1) .thumbnail:focus-within::after,
.zyh-zzk-latest .zyh-zzk-col:nth-child(3n) .thumbnail:hover::after,
.zyh-zzk-latest .zyh-zzk-col:nth-child(3n) .thumbnail:focus-within::after {
    transform: translateY(0);
}

.zyh-zzk-latest .zyh-zzk-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 8px;
    font-size: 12px;
    line-height: 1.4;
    text-align: center;
}

.zyh-zzk-latest .zyh-zzk-empty {
    width: 100%;
    padding: 20px 5px;
    color: #758390;
}

.zyh-zzk-latest .zyh-zzk-pagination {
    display: flex;
    justify-content: center;
    margin: 20px 0 0;
}

.zyh-zzk-latest .zyh-zzk-pagination ul {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.zyh-zzk-latest .zyh-zzk-pagination a,
.zyh-zzk-latest .zyh-zzk-pagination .current {
    display: block;
    padding: 5px 10px;
    border-radius: 4px;
    background: rgba(52, 73, 94, .1);
    color: inherit;
    text-decoration: none;
}

.zyh-zzk-latest .zyh-zzk-pagination a:hover,
.zyh-zzk-latest .zyh-zzk-pagination a:focus-visible,
.zyh-zzk-latest .zyh-zzk-pagination .current {
    background: #34495e;
    color: #fff;
}

[data-bs-theme="dark"] .zyh-zzk-latest.section {
    color: #e5ebf3;
}

[data-bs-theme="dark"] .zyh-zzk-latest .zyh-zzk-panel {
    /* 深色模式下面板跟随主题卡片色（原 #f0f3f4 在黑夜模式里是一片亮灰，标题几乎看不见） */
    background: #21242b;
}

[data-bs-theme="dark"] .zyh-zzk-latest .entry-media {
    background: #303845;
}

[data-bs-theme="dark"] .zyh-zzk-latest .zyh-zzk-empty {
    color: #9aa8b8;
}

[data-bs-theme="dark"] .zyh-zzk-latest .zyh-zzk-cats a {
    background: rgba(255, 255, 255, .08);
    color: #e5ebf3;
}

[data-bs-theme="dark"] .zyh-zzk-latest .zyh-zzk-cats a:hover,
[data-bs-theme="dark"] .zyh-zzk-latest .zyh-zzk-cats a:focus-visible {
    background: var(--ri-primary, #3b6ff5);
    color: #fff;
}

[data-bs-theme="dark"] .zyh-zzk-latest .zyh-zzk-pagination a,
[data-bs-theme="dark"] .zyh-zzk-latest .zyh-zzk-pagination .current {
    background: rgba(255, 255, 255, .08);
    color: #e5ebf3;
}

[data-bs-theme="dark"] .zyh-zzk-latest .zyh-zzk-pagination a:hover,
[data-bs-theme="dark"] .zyh-zzk-latest .zyh-zzk-pagination a:focus-visible,
[data-bs-theme="dark"] .zyh-zzk-latest .zyh-zzk-pagination .current {
    background: var(--ri-primary, #3b6ff5);
    color: #fff;
}

@media (min-width: 768px) {
    .zyh-zzk-latest .zyh-zzk-col {
        flex-basis: 25%;
        width: 25%;
        max-width: 25%;
    }

    .zyh-zzk-latest .zyh-zzk-col:nth-child(n) .thumbnail::after {
        left: 50%;
        right: auto;
        transform: translate(-50%, 4px);
    }

    .zyh-zzk-latest .zyh-zzk-col:nth-child(4n+1) .thumbnail::after {
        left: 0;
        right: auto;
        transform: translateY(4px);
    }

    .zyh-zzk-latest .zyh-zzk-col:nth-child(4n) .thumbnail::after {
        left: auto;
        right: 0;
        transform: translateY(4px);
    }

    .zyh-zzk-latest .zyh-zzk-col:nth-child(n) .thumbnail:hover::after,
    .zyh-zzk-latest .zyh-zzk-col:nth-child(n) .thumbnail:focus-within::after {
        transform: translate(-50%, 0);
    }

    .zyh-zzk-latest .zyh-zzk-col:nth-child(4n+1) .thumbnail:hover::after,
    .zyh-zzk-latest .zyh-zzk-col:nth-child(4n+1) .thumbnail:focus-within::after,
    .zyh-zzk-latest .zyh-zzk-col:nth-child(4n) .thumbnail:hover::after,
    .zyh-zzk-latest .zyh-zzk-col:nth-child(4n) .thumbnail:focus-within::after {
        transform: translateY(0);
    }
}

@media (min-width: 992px) {
    .zyh-zzk-latest .zyh-zzk-col {
        flex-basis: 16.666667%;
        width: 16.666667%;
        max-width: 16.666667%;
    }

    .zyh-zzk-latest .zyh-zzk-col:nth-child(n) .thumbnail::after {
        left: 50%;
        right: auto;
        transform: translate(-50%, 4px);
    }

    .zyh-zzk-latest .zyh-zzk-col:nth-child(6n+1) .thumbnail::after {
        left: 0;
        right: auto;
        transform: translateY(4px);
    }

    .zyh-zzk-latest .zyh-zzk-col:nth-child(6n) .thumbnail::after {
        left: auto;
        right: 0;
        transform: translateY(4px);
    }

    .zyh-zzk-latest .zyh-zzk-col:nth-child(6n+1) .thumbnail:hover::after,
    .zyh-zzk-latest .zyh-zzk-col:nth-child(6n+1) .thumbnail:focus-within::after,
    .zyh-zzk-latest .zyh-zzk-col:nth-child(6n) .thumbnail:hover::after,
    .zyh-zzk-latest .zyh-zzk-col:nth-child(6n) .thumbnail:focus-within::after {
        transform: translateY(0);
    }
}

@media (max-width: 767.98px) {
    .zyh-zzk-latest .zyh-zzk-panel {
        padding-top: 15px;
    }

    .zyh-zzk-latest .zyh-zzk-heading {
        margin-bottom: 15px;
    }

    .zyh-zzk-latest .section-title {
        font-size: 15px;
    }

    .zyh-zzk-latest .section-title small {
        margin-left: 6px;
        font-size: 12px;
    }
}

@media (hover: none) {
    .zyh-zzk-latest .thumbnail::after {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .zyh-zzk-latest .entry-media img,
    .zyh-zzk-latest .thumbnail::after {
        transition: none;
    }
}
