/**
 * 图片上传组件样式
 */

.iu-upload-area {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-start;
}

/* 上传按钮 */
.iu-upload-btn {
    width: 80px;
    height: 80px;
    border: 2px dashed var(--border, #d9d9d9);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-sub, #999);
    font-size: 28px;
    transition: border-color 0.2s, color 0.2s;
    flex-shrink: 0;
}

.iu-upload-btn:hover {
    border-color: var(--primary, #005a64);
    color: var(--primary, #005a64);
}

/* 图片缩略图容器 */
.iu-thumb {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.iu-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
}

/* 删除按钮 */
.iu-thumb .iu-del {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    background: #FF4D4F;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    border: 2px solid #fff;
    line-height: 1;
    z-index: 1;
}

.iu-thumb .iu-del:hover {
    background: #ff7875;
}

/* 首图标记 */
.iu-thumb .iu-first-tag {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 90, 100, 0.8);
    color: #fff;
    font-size: 10px;
    text-align: center;
    padding: 2px 0;
    border-radius: 0 0 8px 8px;
    pointer-events: none;
}

/* 上传中状态 */
.iu-thumb .iu-loading {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.iu-thumb .iu-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: iu-spin 0.6s linear infinite;
}

@keyframes iu-spin {
    to { transform: rotate(360deg); }
}
