/* === 现代化可搜索选择器 === */
.modern-select {
    position: relative;
    width: 100%;
    min-width: 200px;
    max-width: 300px;
    font-family: inherit;
}

.modern-select__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    user-select: none;
}

.modern-select__trigger:hover {
    border-color: #555;
    background: #2a2a3e;
}

.modern-select__trigger:focus {
    border-color: #ffd700;
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.2);
}

.modern-select__value {
    color: #ffffff;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    text-align: left;
}

.modern-select__arrow {
    color: #ffd700;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-left: 8px;
}

.modern-select.is-open .modern-select__trigger {
    border-color: #ffd700;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.modern-select.is-open .modern-select__arrow {
    transform: rotate(180deg);
}

.modern-select__dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1a2e;
    border: 1px solid #ffd700;
    border-top: none;
    border-radius: 0 0 6px 6px;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.23, 1, 0.32, 1);
    max-height: 320px;
    display: flex;
    flex-direction: column;
}

.modern-select.is-open .modern-select__dropdown {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.modern-select__search {
    padding: 8px;
    background: #2a2a3e;
    border-bottom: 1px solid #333;
}

.modern-select__search-input {
    width: 100%;
    padding: 8px 12px;
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 4px;
    color: #ffffff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.modern-select__search-input:focus {
    border-color: #ffd700;
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.1);
}

.modern-select__search-input::placeholder {
    color: #888;
}

.modern-select__options {
    overflow-y: auto;
    max-height: 250px;
    scrollbar-width: thin;
    scrollbar-color: #ffd700 transparent;
}

.modern-select__options::-webkit-scrollbar {
    width: 4px;
}

.modern-select__options::-webkit-scrollbar-track {
    background: transparent;
}

.modern-select__options::-webkit-scrollbar-thumb {
    background: #ffd700;
    border-radius: 2px;
}

.modern-select__group-label {
    padding: 8px 12px 4px;
    font-size: 12px;
    font-weight: 600;
    color: #ffd700;
    background: #2a2a3e;
    border-bottom: 1px solid #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.modern-select__option {
    padding: 10px 12px;
    cursor: pointer;
    color: #ffffff;
    font-size: 14px;
    transition: all 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.modern-select__option:hover {
    background: linear-gradient(135deg, #2a2a3e 0%, #3a3a5e 100%);
    color: #ffd700;
}

.modern-select__option.is-selected {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4a 100%);
    color: #000000;
    font-weight: 500;
}

.modern-select__option.is-selected:hover {
    background: linear-gradient(135deg, #ffed4a 0%, #ffd700 100%);
}

.modern-select__no-results {
    padding: 20px 12px;
    text-align: center;
    color: #888;
    font-style: italic;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .modern-select {
        max-width: 100%;
    }
    
    .modern-select__dropdown {
        max-height: 280px;
    }
    
    .modern-select__options {
        max-height: 200px;
    }
}

/* 加载状态 */
.modern-select.is-loading .modern-select__arrow {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 禁用状态 */
.modern-select.is-disabled {
    opacity: 0.6;
    pointer-events: none;
}

/* 聚焦可见性增强 */
.modern-select__trigger:focus-visible {
    outline: 2px solid #ffd700;
    outline-offset: 2px;
}

/* 高对比度支持 */
@media (prefers-contrast: high) {
    .modern-select__trigger {
        border-width: 2px;
    }
    
    .modern-select__option:hover {
        background: #ffffff;
        color: #000000;
    }
}
