* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

/* 搜索框样式 */
.select-search-box {
    padding: 6px 10px;
}

.select-search-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #dcdee2;
    background-color: #ffffff;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    outline: none;
    color: #333333;
    transition: border-color 0.2s ease-in-out;
}

.select-search-input:focus {
    border-color: #57a3f3;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* 调整下拉框样式以适应搜索框 */
.select-dropdown {
    padding-top: 5px;
    padding-bottom: 5px;
}

.select-dropdown-list {
    margin-top: 5px;
}

/* 无结果项样式 */
.no-result {
    background-color: #f9f9f9;
}

.main {
    padding: 40px;
}

.my-select {
    width: 100%;
    display: inline-block;
    min-width: 80px;
    box-sizing: border-box;
    vertical-align: middle;
    color: #515a6e;
    font-size: 14px;
    line-height: normal;
    position: relative;
}

.select.is-invalid .select-selection {
    border-color: var(--bs-danger);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(24px + 0.1875rem) center;
    background-size: calc(0.75em + 0.45rem + 12px) calc(0.75em + 0.45rem);
}

.select.is-invalid .select-selected-value {
    padding-right: 52px;
}

.select.is-invalid .select-selection:hover,
.select.is-invalid .select-selection.select-focus {
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-danger-rgb), 0.25);
}

.select.is-valid .select-selection {
    border-color: var(--bs-success);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(24px + 0.1875rem) center;
    background-size: calc(0.75em + 0.45rem + 12px) calc(0.75em + 0.45rem);
}

.select.is-valid .select-selected-value {
    padding-right: 52px;
}

.select.is-valid .select-selection:hover,
.select.is-valid .select-selection.select-focus {
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-success-rgb), 0.25);
}

.select-selection {
    display: block;
    box-sizing: border-box;
    outline: 0;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    cursor: pointer;
    position: relative;
    background-color: #fff;
    border-radius: 6px;
    border: 1px solid #dcdee2;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.select-selection:hover,
.select-selection.select-focus {
    border-color: #57a3f3;
    /* box-shadow: 0 0 0 2px rgba(45, 140, 240, 0.2); */
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.select-selected-value {
    display: block;
    height: 38px;
    line-height: 38px;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-left: 8px;
    padding-right: 24px;
    color: #212529;
}

.icon-select-arrow {
    position: absolute;
    top: 50%;
    right: 8px;
    line-height: 1;
    transform: translateY(-50%);
    font-size: 14px;
    color: #808695;
    transition: all 0.2s ease-in-out;
    display: inline-block;
    font-style: normal;
    font-weight: 400;
    font-variant: normal;
    text-transform: none;
    text-rendering: auto;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    vertical-align: middle;
}

.icon-select-arrow::before {
    content: "";
    display: block;
    width: 6px;
    height: 6px;
    background-color: transparent;
    border-left: 1.5px solid #808695;
    border-bottom: 1.5px solid #808695;
    transform: rotate(-45deg);
}

.select-dropdown {
    width: 100%;
    min-width: 80px;
    /* max-height: 200px; */
    max-height: 250px;
    overflow: auto;
    margin: 5px 0;
    padding: 5px 0;
    background-color: #fff;
    box-sizing: border-box;
    border-radius: 4px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
    position: absolute;
    z-index: 2;
    transform-origin: center top 0px;
    transition: all 0.3s;
    will-change: top, left;
    top: 30px;
    left: 0;
    transform: scale(1, 0);
    opacity: 0;
}

.select-dropdown-list {
    padding-left: 0;
    margin-bottom: 0;
}

.select-item {
    height: 38px;
    line-height: normal;
    padding: 7px 16px;
    clear: both;
    color: #515a6e;
    font-size: 14px !important;
    white-space: nowrap;
    list-style: none;
    cursor: pointer;
    transition: background 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.select-item.select-item-selected,
.select-item:hover {
    color: #2d8cf0;
    background-color: #f3f3f3;
}

.select-show-box.multiple {
    height: 38px;
    line-height: 38px;
    padding: 0 0.75rem;
    display: flex;
    align-items: center;
}

.tags-container {
    display: flex;
    align-items: center;
}

.select-tag {
    width: fit-content;
    height: 24px;
    display: flex;
    align-items: center;
    padding-left: 9px;
    padding-right: 5px;
    background-color: #e6e6e7;
    border-radius: 4px;
    margin-right: 6px;
}

.tag-remove {
    width: 14px;
    height: 14px;
    margin-left: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
}

.tag-remove:hover {
    background-color: #909399;
}

.tag-remove .tag-remove-img {
    width: 12px;
    height: 12px;
    background-image: url(../../images/cross.png);
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
}

.tag-remove:hover .tag-remove-img {
    background-image: url(../../images/cross-select.png);
}

.select-check-icon {
    width: 22px;
    height: 22px;
}

/* Loading */
.select-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    padding: 4px 8px;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-top-color: #666;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.select-disabled {
    opacity: 0.7;
    background-color: #f5f5f5;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
