.preview-grid {
    display: none;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding: 0.75rem;
    border: 1px solid #eee;
    
}

.night .preview-grid {
    border:1px solid #444;
}

.preview-card {
    border-radius: 3px;
    border: 1px solid #eee;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.night .preview-card{
    border:1px solid #444;
    background-color: #181a1b;
}

.preview-img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #f7f8fa;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}

.preview-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s;
}

.zoom-hint {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.5rem;
    padding: 0.2rem 0.8rem;
    border-radius: 10px;
    transition: opacity 0.2s;
    pointer-events: none;
    opacity: 0;
}

.preview-card:hover .zoom-hint { opacity: 1; }

.preview-info {
    padding: 0.5rem;
}

.preview-info .file-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.6rem;
}

.preview-info .file-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 0.6rem;
}

.preview-info .file-meta span {
    padding: 0.1rem 0.2rem;
    font-size: 0.5rem;
    border-radius: 4px;
    background: #e6eaf2;
}

.night .preview-info .file-meta span{
    background: #3c3c3c;
}

.preview-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    flex-shrink: 0;
    border-top: 1px solid #eee;
}

.night .preview-actions {
    border-top: 1px solid #444;
}

.preview-actions button{
    padding: 0.25rem 0;
    background-color: #05b672;
    color: #fff;
    border: 0;
    width: 100%;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.6rem;
}

.preview-actions button.btn-remove{
    background-color: tomato;
}

/* 灯箱遮罩 */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgb(0 0 0 / 64%);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
}

.lightbox-overlay img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 3px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    transition: transform 0.2s;
}

.lightbox-overlay img.zoomed {
    transform: scale(1.6);
}

.lightbox-close {
    position: fixed;
    top: 1rem;
    right: 1.5rem;
    z-index: 10001;
    width: 1.8rem;
    height: 1.8rem;
    line-height: 1.8rem;
    font-size: 0.8rem;
    text-align: center;
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}


.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10001;
    width: 1.8rem;
    height: 1.8rem;
    font-size: 1.5rem;
    line-height: 1.8rem;
    text-align: center;
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.lightbox-nav.prev {
    left: 1rem;
}

.lightbox-nav.next {
    right: 1rem;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-info {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    color: #fff;
    font-size: 0.6rem;
    background: rgba(0, 0, 0, 0.55);
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

@media screen and (max-width: 1360px){
    .preview-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media screen and (max-width: 1100px){
    .preview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 530px){
    .preview-grid {
        grid-template-columns: repeat(1, 1fr);
    }
}