/* 修改国家区号选择器宽度 */
.country-wrap {
    position: relative;
    width: 110px;
    margin: 0;
    line-height: 32px;
    padding-top: 15px;
}

/* 下拉菜单样式优化 */
.select2-dropdown {
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-width: 220px !important; /* 确保下拉菜单有足够宽度 */
}

/* 选项内容样式优化 */
.country-option {
    display: flex;
    padding: 2px 5px;
    align-items: center;
    line-height: 32px;
    font-size:14px;
}

.country-code {
    width: 50px;
    font-weight: 500;
    padding-right: 5px;
}

.country-name {
    flex: 1;
    color: #666;
    white-space: nowrap; /* 防止国家名称换行 */
}
.input-phone{flex:1;width: 100%;}
/* 选中项显示优化 */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-right: 25px !important; /* 为下拉箭头留出空间 */
    text-overflow: ellipsis; /* 文本溢出显示省略号 */
    white-space: nowrap;
}

/* 高亮选中项样式 */
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #4a89dc; /* 与您图片中的蓝色保持一致 */
    color: white;
}

/* 优化下拉选项中的国家显示 */
.select2-results__option {
    padding: 2px 3px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered{color:#ffffff;}
.select2-container--default .select2-selection--single{background-color:transparent;border:0 none;}
.select2-results__option{border-bottom:1px solid #ccc;}
.select2-results__option--highlighted .country-code {
    color: white;
}

.select2-results__option--highlighted .country-name {
    color: white;
}

/* 当前选中项的高亮样式 */
.select2-results__option[aria-selected=true] {
    background-color: #f0f0f0;
}

/* 添加滚动条样式 */
.select2-results__options::-webkit-scrollbar {
    width: 8px;
}

.select2-results__options::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.select2-results__options::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.select2-results__options::-webkit-scrollbar-thumb:hover {
    background: #555;
}


/* 响应式调整 */
@media (max-width: 767px) {
    .country-wrap {
        width: 100px; /* 在移动端稍微缩小宽度 */
    }
    
    .select2-dropdown {
        min-width: 200px !important; /* 移动端下拉菜单宽度 */
    }
    
    /* 确保下拉菜单不会超出屏幕 */
    .select2-container--open .select2-dropdown {
        left: auto;
        right: 0;
    }
}

/* 针对特小屏幕的优化 */
@media (max-width: 375px) {
    .phone {
        flex-direction: column;
    }
    
    .country-wrap {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .country-wrap .select2-selection {
        border-radius: 4px;
    }
    
    .input-phone .input {
        border-radius: 4px;
        border-left: 1px solid #e1e1e1;
    }
}
