/* 
   ToolBuddy Art - 效果图集合样式优化 
   解决用户反馈的布局错乱、按钮遮挡问题，并适配拖拽排序功能
*/

.image-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
    max-height: 480px;
    overflow-y: auto;
    padding-right: 8px;
    padding-bottom: 20px;
}

.effect-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    position: relative;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
    /* 移除 all，避免 opacity 冲突 */
}

/* 拖拽时的样式状态 */
.effect-item.dragging {
    opacity: 0.5;
    transform: scale(0.98);
    background: rgba(30, 41, 59, 0.8);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 100;
}

/* 拖拽放置目标的高亮状态 */
.effect-item.drag-over {
    border: 2px dashed var(--primary);
    background: rgba(99, 102, 241, 0.1);
    transform: scale(1.02);
}

.effect-item:hover {
    background: rgba(30, 41, 59, 0.7);
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
    /* transform: translateY(-2px); // 移除悬停位移，防止干扰拖拽 */
}

/* 拖拽手柄样式 */
.drag-handle {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    border-radius: 6px;
    padding: 4px;
    cursor: grab;
    z-index: 10;
    opacity: 0;
    /* 默认隐藏 */
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.effect-item:hover .drag-handle {
    opacity: 1;
}

.drag-handle:active {
    cursor: grabbing;
    background: var(--primary);
    color: white;
}

/* 预览图：增加阴影和圆角 */
.effect-item img {
    width: 100%;
    height: 160px;
    border-radius: 8px;
    object-fit: cover;
    background: #000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    /* 禁止图片响应鼠标事件，防止干扰拖拽 */
    pointer-events: none;
}

/* 标签输入：增加内边距和背景色差异 */
.effect-item input.effect-label-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--glass-border);
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.95rem;
    outline: none;
    transition: 0.2s;
}

.effect-item input.effect-label-input:focus {
    border-color: var(--primary);
    background: rgba(15, 23, 42, 0.9);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* 删除按钮：移到右上角并增强对比度 */
.btn-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 28px;
    height: 28px;
    background: #ef4444;
    color: white;
    border: 2px solid #1e293b;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.btn-remove:hover {
    transform: scale(1.2) rotate(90deg);
    background: #f87171;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.6);
}

/* 滚动条美化 */
.image-list::-webkit-scrollbar {
    width: 5px;
}

.image-list::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.2);
    border-radius: 10px;
}

.image-list::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

/* =========================================
   新增：参考图清除按钮样式
   ========================================= */
.btn-clear-ref {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-container:hover .btn-clear-ref {
    opacity: 1;
    transform: scale(1);
}

.btn-clear-ref:hover {
    background: #ef4444;
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}