/* 底部图片预览脸板 - 方格布局 */
.image-preview-panel {
    position: fixed;
    bottom: 58px;
    left: 0;
    right: 0;
    max-width: 100%; /* 改为100%自适应 */
    margin: 0 auto;
    padding: 12px;
    z-index: 95;
    animation: slideInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-preview-panel.menu-open {
    transform: translateY(-95px);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 方格容器 - 添加白色背景框 */
.preview-grid {
    display: flex;
    gap: 10px;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 10px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1),
                0 2px 8px rgba(0, 0, 0, 0.05);
}

/* 方格项 */
.grid-item {
    width: 100px;
    height: 100px;
    border-radius: 14px;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12),
                0 1px 4px rgba(0, 0, 0, 0.06);
}

/* 图片方格 */
.image-grid-item {
    background: #fff;
    border: 2px solid rgba(123, 107, 214, 0.25);
    overflow: hidden;
}

.grid-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: filter 0.3s ease;
}

/* 模糊效果 */
.grid-image.blurred {
    filter: blur(12px);
}

/* 查看按钮 */
.view-image-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(123, 107, 214, 0.95);
    color: #fff;
    border: none;
    border-radius: 18px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(123, 107, 214, 0.4);
    z-index: 2;
}

.view-image-btn:hover {
    background: rgba(123, 107, 214, 1);
    transform: translate(-50%, -50%) scale(1.05);
}

.view-image-btn:active {
    transform: translate(-50%, -50%) scale(0.95);
}

.view-image-btn.hidden {
    display: none;
}

/* 删除按钮 */
.remove-grid-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 3;
}

.remove-grid-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.remove-grid-btn:active {
    transform: scale(0.95);
}

/* 加号方格 */
.add-grid-item {
    background: rgba(245, 245, 248, 0.95);
    border: 2px dashed rgba(123, 107, 214, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.add-grid-item:hover {
    background: rgba(123, 107, 214, 0.08);
    border-color: rgba(123, 107, 214, 0.5);
    transform: scale(1.02);
}

.add-grid-item:active {
    transform: scale(0.98);
}

.add-grid-item svg {
    color: #7B6BD6;
    opacity: 0.8;
}

/* 全屏图片查看器 */
.fullscreen-viewer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
    cursor: pointer;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fullscreen-image {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    animation: zoomIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
