.custom-select {
    position: relative;
    width: 100%;
}

.select-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 60px;
    background-color: #fff;
    border: 1px solid #bbb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    color: #2c3e50;
}

.select-header.open {
    border-radius: 8px 8px 0 0;
    border: none;
}

.select-header:hover {
    border-color: #999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.select-header::after {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #666;
    transition: transform 0.3s ease;
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    transform-origin: center;
}

.select-header.open::after {
    transform: translateY(-50%) rotate(180deg);
}

.selected-option-container {
    display: flex;
    align-items: center;
    width: 100%;
}

.selected-option {
    display: flex;
    align-items: center;
    width: 100%; /* 确保宽度填充 */
}

.placeholder {
    color: #999;
}

/* 搜索输入框样式 */
.search-input {
    position: absolute;
    top: 0;
    left: 0;
    width: calc(100% - 40px); /* 留出一些空间 */
    height: 100%;
    padding: 0 20px;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: #2c3e50;
    outline: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.select-header.open .search-input {
    opacity: 1;
}

.select-header.open .selected-option-container {
    display: none;
}

/* 确保选中状态下的样式 */
.select-header.open .selected-option {
    display: none;
}

.options-container {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #bbb;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1);
    z-index: 100;
}

.select-header.open + .options-container {
    max-height: 300px;
    opacity: 1;
    visibility: visible;
    overflow-y: auto;
}

/* 美化滚动条样式 */
.options-container::-webkit-scrollbar {
    width: 8px;
}

.options-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.options-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.options-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.option {
    padding: 14px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #eee;
    text-align: left;
    font-size: 1rem;
    color: #444;
    display: flex;
    align-items: center;
}

.option:last-child {
    border-bottom: none;
}

.option:hover {
    background-color: #f8f8f8;
    color: #333;
}

.option.selected {
    background-color: rgba(192,0,0, 0.05);
    color: rgba(192,0,0, 0.8);
    font-weight: 500;
}

.flag-icon {
    width: 24px;
    height: 18px;
    margin-right: 12px;
    background-size: cover;
    background-position: center;
    display: inline-block;
}