/**
 * 写真模式文章列表样式
 * 创享子主题 Clean 版
 */

:root {
    --cxzzt-photo-bg: #ffffff;
    --cxzzt-photo-surface: #f6f7f9;
    --cxzzt-photo-border: #e5e9f0;
    --cxzzt-photo-border-strong: #d6dde7;
    --cxzzt-photo-title: #111827;
    --cxzzt-photo-text: #4b5563;
    --cxzzt-photo-muted: #6b7280;
    --cxzzt-photo-accent: #f97316;
    --cxzzt-photo-dark: #0f172a;
}

.cxzztclean-photo-gallery-widget-container,
.widget_cxzztclean_photo_gallery_widget {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.zib-widget.widget_cxzztclean_photo_gallery_widget,
.widget_cxzztclean_photo_gallery_widget {
    margin-top: 16px;
}

.content-layout > .zib-widget.widget_cxzztclean_photo_gallery_widget:first-child,
.content-layout > .widget_cxzztclean_photo_gallery_widget:first-child {
    margin-top: 0;
}

.cxzztclean-photo-gallery-widget-container > h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    padding: 0 0 0 12px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #0f172a;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.2;
    box-shadow: none;
}

.cxzztclean-photo-gallery-widget-container > h3::before {
    content: "";
    flex: 0 0 auto;
    width: 4px;
    height: 22px;
    border-radius: 999px;
    background: #f59e0b;
    box-shadow: none;
}

.cxzztclean-photo-gallery-widget-container > h3::after {
    display: none;
}

.photo-gallery {
    --g-cols: 4;
    --g-gap: 18px;
    --g-ratio: 75%;
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    background: transparent !important;
}


.photo-gallery[data-cols="1"] {
    --g-cols: 1;
}

.photo-gallery[data-cols="2"] {
    --g-cols: 2;
}

.photo-gallery[data-cols="3"] {
    --g-cols: 3;
}

.photo-gallery[data-cols="4"] {
    --g-cols: 4;
}

.photo-gallery[data-cols="5"] {
    --g-cols: 5;
}

.photo-gallery[data-cols="6"] {
    --g-cols: 6;
}

.photo-gallery[data-ratio="56.25"] {
    --g-ratio: 56.25%;
}

.photo-gallery[data-ratio="66.7"] {
    --g-ratio: 66.7%;
}

.photo-gallery[data-ratio="75"] {
    --g-ratio: 75%;
}

.photo-gallery[data-ratio="100"] {
    --g-ratio: 100%;
}

.photo-gallery[data-ratio="133.3"] {
    --g-ratio: 133.3%;
}

.photo-gallery.photo-gallery--sidebar {
    --g-cols: 1;
    --g-gap: 16px;
}

.photo-gallery .posts-row {
    display: grid !important;
    grid-template-columns: repeat(var(--g-cols), minmax(0, 1fr));
    gap: var(--g-gap);
    align-items: start;
}

.photo-gallery.auto-height .posts-row {
    display: block !important;
    overflow: hidden;
}

.cxzztclean-photo-gallery-widget-container .photo-gallery .gallery-item {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin: 0 !important;
    overflow: hidden;
    box-sizing: border-box;
    border: 1px solid var(--cxzzt-photo-border) !important;
    border-radius: 0 !important;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 252, 0.96)) !important;
    box-shadow: 0 14px 28px rgba(148, 163, 184, 0.14) !important;
    transform: none !important;
    transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.cxzztclean-photo-gallery-widget-container .photo-gallery .gallery-item:hover {
    border-color: var(--cxzzt-photo-border-strong) !important;
    box-shadow: 0 18px 34px rgba(148, 163, 184, 0.18) !important;
    transform: translateY(-3px);
    z-index: 2;
}

.photo-gallery.auto-height .gallery-item {
    float: left;
    margin: 0 0 var(--g-gap) 0 !important;
}

.photo-gallery.auto-height[data-cols="1"] .gallery-item,
.photo-gallery.photo-gallery--sidebar.auto-height .gallery-item {
    width: 100%;
}

.photo-gallery.auto-height[data-cols="2"] .gallery-item {
    width: calc((100% - 18px) / 2);
}

.photo-gallery.auto-height[data-cols="3"] .gallery-item {
    width: calc((100% - 36px) / 3);
}

.photo-gallery.auto-height[data-cols="4"] .gallery-item {
    width: calc((100% - 54px) / 4);
}

.photo-gallery.auto-height[data-cols="5"] .gallery-item {
    width: calc((100% - 72px) / 5);
}

.photo-gallery.auto-height[data-cols="6"] .gallery-item {
    width: calc((100% - 90px) / 6);
}

.photo-gallery.auto-height.masonry-fallback .posts-row {
    display: grid !important;
    grid-template-columns: repeat(var(--g-cols), minmax(0, 1fr));
    gap: var(--g-gap);
}

.photo-gallery.auto-height.masonry-fallback .gallery-item {
    width: auto !important;
    float: none;
}

.cxzztclean-photo-gallery-widget-container .photo-gallery .item-thumbnail {
    position: relative;
    overflow: hidden;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-bottom: 0;
    border-radius: 0;
    background:
        linear-gradient(180deg, rgba(226, 232, 240, 0.58), rgba(203, 213, 225, 0.2)),
        linear-gradient(180deg, #e6edf5, #d7e1ee);
}

.cxzztclean-photo-gallery-widget-container .photo-gallery .item-thumbnail::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 36%;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0), rgba(15, 23, 42, 0.18));
    opacity: 0.72;
    pointer-events: none;
    z-index: 1;
}

.cxzztclean-photo-gallery-widget-container .photo-gallery.auto-height .item-thumbnail {
    height: auto !important;
    aspect-ratio: auto;
    padding-bottom: 0 !important;
    overflow: hidden;
    max-height: var(--g-max-thumb-h, 480px);
}

.cxzztclean-photo-gallery-widget-container .photo-gallery:not(.auto-height) .item-thumbnail {
    height: 0 !important;
    padding-bottom: var(--item-ratio, var(--g-ratio)) !important;
}

.cxzztclean-photo-gallery-widget-container .photo-gallery.auto-height .item-thumbnail > a,
.cxzztclean-photo-gallery-widget-container .photo-gallery.auto-height .item-thumbnail .item-thumbnail-link,
.cxzztclean-photo-gallery-widget-container .photo-gallery.auto-height .item-thumbnail .item-thumb,
.cxzztclean-photo-gallery-widget-container .photo-gallery.auto-height .item-thumbnail .item-image {
    position: relative !important;
    inset: auto !important;
    display: block;
    width: 100% !important;
    height: auto !important;
    z-index: 0;
}

.cxzztclean-photo-gallery-widget-container .photo-gallery:not(.auto-height) .item-thumbnail > a,
.cxzztclean-photo-gallery-widget-container .photo-gallery:not(.auto-height) .item-thumbnail .item-thumbnail-link,
.cxzztclean-photo-gallery-widget-container .photo-gallery:not(.auto-height) .item-thumbnail .item-thumb,
.cxzztclean-photo-gallery-widget-container .photo-gallery:not(.auto-height) .item-thumbnail .item-image {
    position: absolute;
    inset: 0;
    display: block;
    z-index: 0;
}

.cxzztclean-photo-gallery-widget-container .photo-gallery:not(.auto-height) .item-thumbnail img {
    position: absolute !important;
    inset: 0 !important;
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    transition: transform 0.4s ease !important;
}

.cxzztclean-photo-gallery-widget-container .photo-gallery.auto-height .item-thumbnail img {
    position: relative !important;
    inset: auto !important;
    display: block;
    width: 100% !important;
    height: auto !important;
    max-height: var(--g-max-thumb-h, 480px);
    object-fit: cover;
}

.cxzztclean-photo-gallery-widget-container .photo-gallery .gallery-item:hover .item-thumbnail img {
    transform: scale(1.04);
}

.photo-gallery .independent-div {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 4;
    transform: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.cxzztclean-photo-gallery-widget-container .photo-gallery .independent_div_tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-width: fit-content;
    max-width: calc(100% - 24px);
    height: auto;
    min-height: 22px;
    padding: 0 10px 0 11px;
    border: 0 !important;
    border-radius: 999px !important;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.58) 0%, rgba(15, 23, 42, 0.18) 72%, rgba(15, 23, 42, 0) 100%) !important;
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    text-shadow: none !important;
    box-shadow: none !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    box-sizing: border-box;
    flex: 0 0 auto;
    letter-spacing: 0.01em;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.cxzztclean-photo-gallery-widget-container .photo-gallery .independent_div_tag::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 4px;
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffb36a 0%, #ff7a18 100%);
    transform: translateY(-50%);
}

.photo-gallery .hover-badges {
    display: none !important;
}

.photo-gallery .photo-overlay {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 14px 15px;
    background: var(--cxzzt-photo-bg);
    pointer-events: auto;
}

.photo-gallery .overlay-inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.photo-gallery .item-title-badges {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 6px;
    margin: 0 8px 0 0;
    vertical-align: top;
    flex-shrink: 0;
    max-width: 100%;
}

.photo-gallery .item-title-badges > * {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    margin: 0 !important;
    padding: 0 8px;
    border: 1px solid var(--cxzzt-photo-border);
    border-radius: 0 !important;
    background: var(--cxzzt-photo-surface);
    color: var(--cxzzt-photo-muted) !important;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    box-shadow: none !important;
    white-space: nowrap;
}

.photo-gallery .item-title,
.photo-gallery .item-title a,
.photo-gallery .item-title a:hover {
    margin: 0 !important;
    color: var(--cxzzt-photo-title) !important;
    font-size: 16px !important;
    font-weight: 400 !important;
    line-height: 1.48 !important;
    text-shadow: none !important;
}

.photo-gallery .item-title {
    display: flex;
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: 8px;
}

.photo-gallery .item-title a {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    display: -webkit-box;
    min-height: 46px;
    overflow: hidden;
    white-space: normal !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.photo-gallery .item-title a:hover {
    color: var(--cxzzt-photo-accent) !important;
}

.photo-gallery .item-title .item-title-badges:empty {
    display: none !important;
}

.photo-gallery .item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0;
    padding-top: 12px;
    border-top: 1px solid var(--cxzzt-photo-border);
    color: var(--cxzzt-photo-muted) !important;
    font-size: 12px !important;
}

.photo-gallery .meta-left,
.photo-gallery .meta-right .meta-item {
    color: var(--cxzzt-photo-muted) !important;
}

.photo-gallery .meta-right {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.photo-gallery .meta-item {
    display: inline-flex;
    align-items: center;
    margin-left: 0 !important;
    white-space: nowrap;
}

.photo-gallery .meta-item .icon,
.photo-gallery .meta-item i {
    margin-right: 4px;
    opacity: 0.7;
}

.photo-gallery .abc {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.photo-gallery .abc.abc--single {
    grid-template-columns: minmax(0, 1fr);
}

.photo-gallery .abc .xo_left,
.photo-gallery .abc .xo_right {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--cxzzt-photo-border);
    border-radius: 0 !important;
    background: var(--cxzzt-photo-surface);
    color: var(--cxzzt-photo-title) !important;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: none;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.photo-gallery .abc .xo_left span,
.photo-gallery .abc .xo_right span {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: inherit !important;
}

.photo-gallery .abc .xo_left:hover,
.photo-gallery .abc .xo_right:hover,
.photo-gallery .abc .xo_left:focus-visible,
.photo-gallery .abc .xo_right:focus-visible {
    background: #ffffff;
    border-color: var(--cxzzt-photo-border-strong);
    color: var(--cxzzt-photo-accent) !important;
}

.photo-gallery.lightbox-enabled .item-thumbnail {
    cursor: zoom-in;
}

.photo-gallery .lightbox-tip {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0 !important;
    background: rgba(15, 23, 42, 0.8) !important;
    color: #ffffff;
    font-size: 12px;
    line-height: 1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.photo-gallery .item-thumbnail:hover .lightbox-tip {
    opacity: 1;
}

.photo-gallery.is-loading .posts-row {
    opacity: 0.3;
    pointer-events: none;
}

.photo-gallery.is-loaded .posts-row {
    opacity: 1;
    transition: opacity 0.25s ease;
}

.photo-gallery .skeleton-item,
.photo-gallery .skeleton-wrapper {
    display: none !important;
}

.photo-gallery .no-posts {
    padding: 18px;
    border: 1px solid var(--cxzzt-photo-border);
    border-radius: 0;
    background: var(--cxzzt-photo-bg);
    color: var(--cxzzt-photo-muted);
    text-align: center;
}

@media (max-width: 1024px) {
    .photo-gallery[data-cols="4"],
    .photo-gallery[data-cols="5"],
    .photo-gallery[data-cols="6"] {
        --g-cols: 3;
    }

    .photo-gallery.auto-height[data-cols="4"] .gallery-item,
    .photo-gallery.auto-height[data-cols="5"] .gallery-item,
    .photo-gallery.auto-height[data-cols="6"] .gallery-item {
        width: calc((100% - 36px) / 3);
    }
}

@media (max-width: 768px) {
    .cxzztclean-photo-gallery-widget-container > h3 {
        margin-bottom: 12px;
        padding: 0 0 0 12px;
        border-radius: 0;
        font-size: 17px;
    }

    .photo-gallery {
        --g-gap: 12px;
    }

    .photo-gallery:not(.photo-gallery--sidebar)[data-cols="2"],
    .photo-gallery:not(.photo-gallery--sidebar)[data-cols="3"],
    .photo-gallery:not(.photo-gallery--sidebar)[data-cols="4"],
    .photo-gallery:not(.photo-gallery--sidebar)[data-cols="5"],
    .photo-gallery:not(.photo-gallery--sidebar)[data-cols="6"] {
        --g-cols: 2;
    }

    .photo-gallery .item-title,
    .photo-gallery .item-title a {
        font-size: 14px !important;
    }

    .photo-gallery .item-title a {
        min-height: 42px;
    }

    .photo-gallery .photo-overlay {
        gap: 10px;
        padding: 13px;
    }

    .photo-gallery .item-meta {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .photo-gallery.auto-height:not(.photo-gallery--sidebar)[data-cols="2"] .gallery-item,
    .photo-gallery.auto-height:not(.photo-gallery--sidebar)[data-cols="3"] .gallery-item,
    .photo-gallery.auto-height:not(.photo-gallery--sidebar)[data-cols="4"] .gallery-item,
    .photo-gallery.auto-height:not(.photo-gallery--sidebar)[data-cols="5"] .gallery-item,
    .photo-gallery.auto-height:not(.photo-gallery--sidebar)[data-cols="6"] .gallery-item {
        width: calc((100% - 12px) / 2);
    }
}

@media (max-width: 480px) {
    .cxzztclean-photo-gallery-widget-container > h3 {
        gap: 10px;
        padding: 0 0 0 10px;
        font-size: 16px;
    }

    .cxzztclean-photo-gallery-widget-container > h3::before {
        width: 4px;
        height: 18px;
    }

    .photo-gallery .independent-div {
        top: 10px;
        left: 10px;
    }

    .photo-gallery .independent_div_tag {
        max-width: calc(100% - 20px);
        min-height: 20px;
        padding: 0 9px 0 10px;
        font-size: 11px !important;
    }

    .photo-gallery .abc {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* 2026-03-27 回归修复：统一写真角标宽度与普通卡片一致，避免被压缩成一截 */
.cxzztclean-photo-gallery-widget-container .photo-gallery .independent_div_tag {
    width: fit-content !important;
    min-width: fit-content !important;
    max-width: calc(100% - 24px) !important;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.58) 0%, rgba(15, 23, 42, 0.18) 72%, rgba(15, 23, 42, 0) 100%) !important;
    background-image: none !important;
    color: #ffffff !important;
    box-sizing: border-box !important;
    flex: 0 0 auto !important;
    box-shadow: none !important;
}

.cxzztclean-photo-gallery-widget-container .photo-gallery .independent_div_tag.is-default-cat {
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.58) 0%, rgba(15, 23, 42, 0.18) 72%, rgba(15, 23, 42, 0) 100%) !important;
}

.photo-gallery .item-title-badges .badg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 10px !important;
    border: 0 !important;
    border-radius: 999px !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12) !important;
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 24px !important;
    text-shadow: none !important;
    white-space: nowrap;
    word-break: keep-all;
    writing-mode: horizontal-tb;
}

.photo-gallery .item-title-badges .badg i {
    margin-right: 4px;
}

.photo-gallery .item-title-badges .badg.jb-red {
    background: linear-gradient(135deg, #ff7a18, #ff3d54) !important;
}

.photo-gallery .item-title-badges .badg.jb-blue {
    background: linear-gradient(135deg, #2563eb, #38bdf8) !important;
}

.photo-gallery .item-title-badges .badg.jb-green {
    background: linear-gradient(135deg, #16a34a, #34d399) !important;
}

.photo-gallery .item-title-badges .badg.jb-yellow {
    background: linear-gradient(135deg, #f59e0b, #facc15) !important;
    color: #422006 !important;
}

.photo-gallery .item-title-badges .badg:not([class*="jb-"]) {
    background: linear-gradient(135deg, #64748b, #334155) !important;
}

@media (max-width: 575px) {
    .content-layout > .zib-widget.widget_cxzztclean_photo_gallery_widget:not(:first-child),
    .content-layout > .widget_cxzztclean_photo_gallery_widget:not(:first-child) {
        margin-top: 12px;
    }

    .cxzztclean-photo-gallery-widget-container .photo-gallery,
    .widget_cxzztclean_photo_gallery_widget .photo-gallery {
        --g-cols: 2 !important;
        --g-gap: 10px !important;
    }

    .cxzztclean-photo-gallery-widget-container .photo-gallery:not(.auto-height) .posts-row,
    .widget_cxzztclean_photo_gallery_widget .photo-gallery:not(.auto-height) .posts-row,
    .cxzztclean-photo-gallery-widget-container .photo-gallery.auto-height.masonry-fallback .posts-row,
    .widget_cxzztclean_photo_gallery_widget .photo-gallery.auto-height.masonry-fallback .posts-row {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .cxzztclean-photo-gallery-widget-container .photo-gallery.auto-height:not(.masonry-fallback) .posts-row,
    .widget_cxzztclean_photo_gallery_widget .photo-gallery.auto-height:not(.masonry-fallback) .posts-row {
        display: block !important;
    }

    .cxzztclean-photo-gallery-widget-container .photo-gallery:not(.auto-height) .gallery-item,
    .widget_cxzztclean_photo_gallery_widget .photo-gallery:not(.auto-height) .gallery-item,
    .cxzztclean-photo-gallery-widget-container .photo-gallery.auto-height.masonry-fallback .gallery-item,
    .widget_cxzztclean_photo_gallery_widget .photo-gallery.auto-height.masonry-fallback .gallery-item {
        width: auto !important;
        float: none !important;
        min-width: 0;
    }

    .cxzztclean-photo-gallery-widget-container .photo-gallery .photo-overlay,
    .widget_cxzztclean_photo_gallery_widget .photo-gallery .photo-overlay {
        gap: 8px;
        padding: 10px 10px 11px;
    }

    .cxzztclean-photo-gallery-widget-container .photo-gallery .overlay-inner,
    .widget_cxzztclean_photo_gallery_widget .photo-gallery .overlay-inner {
        gap: 8px;
    }

    .cxzztclean-photo-gallery-widget-container .photo-gallery .item-title,
    .cxzztclean-photo-gallery-widget-container .photo-gallery .item-title a,
    .widget_cxzztclean_photo_gallery_widget .photo-gallery .item-title,
    .widget_cxzztclean_photo_gallery_widget .photo-gallery .item-title a {
        font-size: 13px !important;
        line-height: 1.45 !important;
    }

    .cxzztclean-photo-gallery-widget-container .photo-gallery .item-title a,
    .widget_cxzztclean_photo_gallery_widget .photo-gallery .item-title a {
        min-height: 38px;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .cxzztclean-photo-gallery-widget-container .photo-gallery .item-meta,
    .widget_cxzztclean_photo_gallery_widget .photo-gallery .item-meta {
        gap: 8px;
        padding-top: 9px;
        font-size: 11px !important;
    }

    .cxzztclean-photo-gallery-widget-container .photo-gallery .meta-right,
    .widget_cxzztclean_photo_gallery_widget .photo-gallery .meta-right {
        gap: 8px;
    }
}

/* ========== 写真小工具「加载更多」========== */
.cxzztclean-photo-gallery-loader {
    text-align: center;
    margin-top: 24px;
    padding: 0;
}

.cxzztclean-photo-load-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 180px;
    height: 44px;
    padding: 0 32px;
    border: 1px solid var(--cxzzt-photo-border-strong, #d6dde7);
    border-radius: 0;
    background: transparent;
    color: var(--cxzzt-photo-text, #4b5563);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.25s ease, color 0.25s ease, background-color 0.25s ease;
}

.cxzztclean-photo-load-more-btn:hover {
    border-color: var(--cxzzt-photo-accent, #f97316);
    color: var(--cxzzt-photo-accent, #f97316);
    background: rgba(249, 115, 22, 0.04);
}

.cxzztclean-photo-load-more-btn .load-more-text {
    display: inline;
}

.cxzztclean-photo-load-more-btn .load-more-loading {
    display: none;
    align-items: center;
    gap: 8px;
}

.cxzztclean-photo-load-more-btn.is-loading .load-more-text {
    display: none;
}

.cxzztclean-photo-load-more-btn.is-loading .load-more-loading {
    display: inline-flex;
}

.cxzztclean-photo-load-more-btn.is-loading {
    pointer-events: none;
    border-color: var(--cxzzt-photo-border, #e5e9f0);
    color: var(--cxzzt-photo-muted, #6b7280);
}

@keyframes cxzztclean-photo-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.cxzztclean-photo-load-more-btn .load-more-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    animation: cxzztclean-photo-spin 0.8s linear infinite;
}

.photo-gallery.is-appending .posts-row {
    transition: opacity 0.28s ease;
}

.photo-gallery.is-appending:not(.auto-height) .posts-row {
    opacity: 0.94;
}

.photo-gallery-item--fade-in {
    opacity: 0;
    transform: translate3d(0, 18px, 0) scale(0.985) !important;
    transition:
        opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--photo-fade-delay, 0ms);
    will-change: opacity, transform;
}

.photo-gallery-item--fade-in.photo-gallery-item--visible {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1) !important;
}

.cxzztclean-photo-gallery-end-message {
    display: none;
    text-align: center;
    padding: 12px 0;
    color: var(--cxzzt-photo-muted, #6b7280);
    font-size: 13px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.cxzztclean-photo-gallery-end-message.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 575px) {
    .cxzztclean-photo-gallery-loader {
        margin-top: 16px;
    }

    .cxzztclean-photo-load-more-btn {
        min-width: 140px;
        height: 40px;
        padding: 0 20px;
        font-size: 13px;
    }
}

/* ========== 隐藏标题（悬浮显示）========== */
.photo-gallery--hide-title .gallery-item {
    position: relative;
}

.photo-gallery--hide-title .photo-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    /* 底部往上黑色半透明渐变，与缩略图融合 */
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.55) 55%, rgba(0, 0, 0, 0.9) 100%);
    box-shadow: none;
    padding-top: 32px;
}

.photo-gallery--hide-title .gallery-item:hover .photo-overlay {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* 隐藏标题模式：覆盖在缩略图上的文字统一为白色 */
.photo-gallery--hide-title .item-title,
.photo-gallery--hide-title .item-title a {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45) !important;
}

.photo-gallery--hide-title .item-title a:hover {
    color: var(--cxzzt-photo-accent) !important;
}

.photo-gallery--hide-title .item-meta {
    border-top-color: rgba(255, 255, 255, 0.18) !important;
    color: rgba(255, 255, 255, 0.82) !important;
}

.photo-gallery--hide-title .meta-left,
.photo-gallery--hide-title .meta-right .meta-item {
    color: rgba(255, 255, 255, 0.82) !important;
}

@media (prefers-reduced-motion: reduce) {
    .photo-gallery-item--fade-in,
    .photo-gallery-item--fade-in.photo-gallery-item--visible,
    .photo-gallery.is-appending .posts-row,
    .cxzztclean-photo-gallery-end-message {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }
}
