.cm-upload {
    display: inline-flex;
    flex-direction: column;
    input.cm-upload-input {
        display: none;
    }
}
.cm-upload-list {
    display: flex;
    flex-direction: column;
    margin-top: 8px;
    margin-bottom: 8px;
    padding: 0;
}
.cm-upload-files {
    display: flex;
    flex-direction: column;
}
.cm-upload-list-title {
    display: flex;
    flex-direction: row;
    margin-bottom: 4px;
    gap: 8px;
}
.cm-upload-drag {
    .cm-upload-out {
        display: flex;
        padding: 20px;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        background: #fff;
        border: 1px dashed rgb(var(--cui-grey-3));
        border-radius: var(--cui-border-radius-small);
        cursor: pointer;
        position: relative;
        overflow: hidden;
        -webkit-transition: border-color .2s ease;
        transition: border-color .2s ease;
        &:hover {
            border-color: rgb(var(--cui-blue-5));
        }
    }
}
.cm-upload-dragOver{
    .cm-upload-out {
        border-color: rgb(var(--cui-blue-5));
    }
}
.cm-upload-clear {
    cursor: pointer;
}
.cm-upload-file-card {
    border-radius: var(--cui-border-radius-small);
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
    width: 250px;
    background-color: var(--cui-color-fill-0);
    cursor: pointer;
    margin-bottom: 8px;
    &:hover {
        background-color: var(--cui-color-fill-1);
    }
}
.cm-upload-file-preview-img,
.cm-upload-file-preview {
    height: 36px;
    width: 36px;
    color: var(--cui-color-text-2);
    margin: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: var(--cui-border-radius-small);
    flex-shrink: 0;
}
.cm-upload-file-card-info,
.cm-upload-file-card-body {
    flex: 1;
    display: flex;
    flex-direction: row;
    color: var(--cui-color-text-2);
    font-size: 12px;
}
.cm-upload-file-card-info {
    align-items: flex-end;
    gap: 2px;
}
.cm-upload-file-card-body {
    flex-direction: column;
    width: 0;
}
.cm-upload-file-card-info-name {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: rgb(var(--cui-grey-8));
    font-size: 14px;
}
.cm-upload-file-control {
    margin: 0 10px;
}
.cm-upload-error {
    font-size: 12px;
    .cm-icon {
        color: rgb(var(--cui-red-5));
    }
    .cm-upload-retry {
        margin-left: 5px;
    }
}

.cm-upload-picture-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
}
.cm-upload-picture-add,
.cm-upload-picture-card {
    width: 64px;
    height: 64px;
    border-radius: var(--cui-border-radius-small);
    overflow: hidden;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}
.cm-upload-picture-card {
    position: relative;
    cursor: pointer;
    img {
        object-fit: cover;
        width: 64px;
        height: 64px;
        border-radius: var(--cui-border-radius-small);
    }
    &:before {
        visibility: hidden;
        background-color: rgba(var(--cui-grey-3), 0.6);
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
    }
    &:hover {
        &:before {
            visibility: visible;
        }
        .cm-upload-picture-preview,
        .cm-upload-picture-remove {
            opacity: 1;
        }
    }
}
.cm-upload-picture-preview,
.cm-upload-picture-remove {
    position: absolute;
    opacity: 0;
    color: #fff;
}
.cm-upload-picture-remove {
    top: 3px;
    right: 3px;
}
.cm-upload-picture-preview {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.cm-upload-picture-add {
    background-color: var(--cui-color-fill-0);
    border: 2px dashed var(--cui-default-border);
    color: rgb(var(--cui-grey-3));
    cursor: pointer;
    &:hover {
        background-color: var(--cui-color-fill-1);
    }
}