/* 照片灯箱：大图 + 该张照片的留言 */

/* 网格浮层里的留言入口 */
.photo-comment-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    margin-top: 8px;
    font-family: inherit;
    font-size: 12px;
    color: #fff;
    cursor: pointer;
    background: rgba(255, 255, 255, .25);
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 14px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: background .2s;
}

.photo-comment-btn:hover {
    background: rgba(255, 255, 255, .45);
}

.photo-comment-btn .layui-icon {
    font-size: 12px;
}

.timeline-item[data-lightbox-open] {
    cursor: pointer;
}

/* 遮罩与弹层 */
.photo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.photo-lightbox[hidden] {
    display: none;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 16, 12, .75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: lightbox-fade .25s ease;
}

.lightbox-dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1040px;
    max-height: 100%;
    overflow: hidden;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
    animation: lightbox-pop .25s ease;
}

.lightbox-close {
    position: absolute;
    top: 10px;
    right: 14px;
    z-index: 2;
    width: 34px;
    height: 34px;
    font-size: 22px;
    line-height: 1;
    color: #fff;
    cursor: pointer;
    background: rgba(0, 0, 0, .35);
    border: none;
    border-radius: 50%;
    transition: background .2s;
}

.lightbox-close:hover {
    background: rgba(0, 0, 0, .6);
}

.lightbox-body {
    display: flex;
    min-height: 0;
}

.lightbox-figure {
    display: flex;
    flex: 1 1 55%;
    align-items: center;
    justify-content: center;
    min-width: 0;
    background: #1c1917;
}

.lightbox-img {
    display: block;
    max-width: 100%;
    max-height: 72vh;
    object-fit: contain;
}

.lightbox-side {
    display: flex;
    flex: 1 1 45%;
    flex-direction: column;
    min-width: 0;
    max-height: 72vh;
    padding: 24px;
    overflow-y: auto;
    background: #fff;
}

.lightbox-head {
    padding-bottom: 14px;
    margin-bottom: 8px;
    border-bottom: 1px dashed #f0e6d2;
}

.lightbox-title {
    margin: 0;
    font-size: 18px;
    color: var(--text-color, #4A4A4A);
    word-wrap: break-word;
}

.lightbox-date {
    margin: 6px 0 0;
    font-size: 12px;
    color: #b0a89c;
}

/* 灯箱里的留言区去掉卡片外壳，交给灯箱本身承载 */
.lightbox-comment.comment-section {
    max-width: none;
    padding: 0;
    margin: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.lightbox-comment .comment-title {
    margin: 16px 0 12px;
    font-size: 16px;
}

.lightbox-comment .comment-form {
    padding: 16px;
}

body.lightbox-open {
    overflow: hidden;
}

@keyframes lightbox-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes lightbox-pop {
    from { opacity: 0; transform: scale(.96); }
    to { opacity: 1; transform: scale(1); }
}

@media (max-width: 900px) {
    .photo-lightbox {
        padding: 0;
    }

    .lightbox-dialog {
        max-width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .lightbox-body {
        flex-direction: column;
        overflow-y: auto;
    }

    .lightbox-figure {
        flex: 0 0 auto;
    }

    .lightbox-img {
        max-height: 40vh;
    }

    .lightbox-side {
        max-height: none;
        overflow: visible;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lightbox-backdrop,
    .lightbox-dialog {
        animation: none;
    }
}
