/* 自定义下拉：展开列表与主题一致；原生 select 仅作数据与表单兼容 */

.custom-select-wrap {
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

select.form-control.custom-select-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    cursor: pointer;
    padding: 14px 44px 14px 18px;
    border: 1px solid rgba(168, 85, 247, 0.28);
    border-radius: 12px;
    background-color: var(--bg-body, #f8fafc);
    color: var(--text-main, #111827);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a855f7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px;
}

.custom-select-trigger:hover:not(:disabled) {
    border-color: rgba(168, 85, 247, 0.5);
    background-color: #fff;
}

.custom-select-trigger:focus {
    outline: none;
    border-color: var(--primary, #a855f7);
    box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.18);
    background-color: #fff;
}

.custom-select-wrap.is-open .custom-select-trigger {
    border-color: var(--primary, #a855f7);
    box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.18);
    background-color: #fff;
}

.custom-select-trigger:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.custom-select-trigger .custom-select-trigger-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-select-panel {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 600;
    max-height: min(320px, 60vh);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 6px 0;
    margin: 0;
    list-style: none;
    background: #fff;
    border: 1px solid rgba(168, 85, 247, 0.35);
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(168, 85, 247, 0.06);
}

.custom-select-panel[hidden] {
    display: none !important;
}

.custom-select-option {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    color: var(--text-main, #111827);
    cursor: pointer;
    transition: background 0.15s ease;
}

.custom-select-option:hover {
    background: rgba(168, 85, 247, 0.1);
}

.custom-select-option.is-selected {
    background: rgba(168, 85, 247, 0.16);
    font-weight: 600;
    color: var(--text-main, #111827);
}

.custom-select-panel::-webkit-scrollbar {
    width: 8px;
}
.custom-select-panel::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.35);
    border-radius: 8px;
}
