/* 地区选择器样式 */
.area-selector {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.area-selector select {
    min-width: 120px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    font-size: 14px;
    color: #333;
    transition: border-color 0.3s ease;
}

.area-selector select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.area-selector select:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

/* 带搜索功能的地区选择器 */
.area-selector-with-search {
    position: relative;
}

.area-search-container {
    position: relative;
    margin-bottom: 15px;
}

.area-search-input {
    width: 100%;
    padding: 10px 40px 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    transition: border-color 0.3s ease;
}

.area-search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.area-search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    pointer-events: none;
}

.area-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}

.search-item:hover {
    background-color: #f8f9fa;
}

.search-item:last-child {
    border-bottom: none;
}

.search-item .name {
    font-size: 14px;
    color: #333;
}

.search-item .level {
    font-size: 12px;
    color: #6c757d;
    background-color: #e9ecef;
    padding: 2px 6px;
    border-radius: 2px;
}

.no-results {
    padding: 15px 12px;
    text-align: center;
    color: #6c757d;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .area-selector {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .area-selector select {
        min-width: auto;
        width: 100%;
    }
}

/* 表单集成样式 */
.form-group .area-selector {
    margin-top: 5px;
}

.form-group .area-selector select {
    border-color: #ced4da;
}

.form-group .area-selector select:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Bootstrap 集成 */
.area-selector .form-select {
    min-width: 120px;
}

.area-selector .form-control {
    min-width: 120px;
}

/* 加载状态 */
.area-selector select.loading {
    background-image: url("data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 1V4M8 12V15M15 8H12M4 8H1M13.5 2.5L11.5 4.5M4.5 11.5L2.5 13.5M13.5 13.5L11.5 11.5M4.5 4.5L2.5 2.5' stroke='%236c757d' stroke-width='2' stroke-linecap='round'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 错误状态 */
.area-selector select.error {
    border-color: #dc3545;
}

.area-selector select.error:focus {
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* 成功状态 */
.area-selector select.success {
    border-color: #28a745;
}

.area-selector select.success:focus {
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* 单个下拉框选择器样式 */
.area-single-selector {
    position: relative;
}

.area-single-selector select {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 返回选项样式 */
.area-single-selector select option.back-option {
    font-weight: bold;
    background-color: #f8f9fa;
    color: #6c757d;
    border-bottom: 1px solid #dee2e6;
}

/* 当前选择样式 */
.area-single-selector select option.current-selection {
    font-weight: bold;
    background-color: #e7f3ff;
    color: #0066cc;
    border-bottom: 1px solid #cce7ff;
}

/* 省级选项样式 */
.area-single-selector select option.level-1 {
    font-weight: bold;
    background-color: #e3f2fd;
    color: #1976d2;
    padding-left: 8px;
}

/* 市级选项样式 */
.area-single-selector select option.level-2 {
    background-color: #f3e5f5;
    color: #7b1fa2;
    padding-left: 16px;
}

/* 区县级选项样式 */
.area-single-selector select option.level-3 {
    background-color: #fff3e0;
    color: #f57c00;
    padding-left: 24px;
}

/* 增强下拉框的可读性 */
.area-single-selector select {
    max-height: 300px;
    overflow-y: auto;
    line-height: 1.5;
}

/* 选项间距 */
.area-single-selector select option {
    padding: 8px 12px;
    line-height: 1.4;
}

/* 悬停效果 */
.area-single-selector select option:hover {
    background-color: #f0f8ff !important;
}

/* 加载状态 */
.area-single-selector select.loading {
    background-image: url("data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 1V4M8 12V15M15 8H12M4 8H1M13.5 2.5L11.5 4.5M4.5 11.5L2.5 13.5M13.5 13.5L11.5 11.5M4.5 4.5L2.5 2.5' stroke='%236c757d' stroke-width='2' stroke-linecap='round'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    animation: spin 1s linear infinite;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .area-single-selector select {
        font-size: 14px;
    }
    
    .area-single-selector select option {
        padding: 6px 8px;
    }
}

/* Element UI 风格的级联选择器样式 */
.el-cascader {
    position: relative;
    display: inline-block;
    width: 100%;
    font-size: 14px;
    line-height: 1.5;
}

/* 输入框样式 */
.el-input {
    position: relative;
    font-size: 14px;
    display: inline-block;
    width: 100%;
}

.el-input--large {
    font-size: 16px;
}

.el-input--small {
    font-size: 13px;
}

.el-input--mini {
    font-size: 12px;
}

.el-input.is-disabled .el-input__inner {
    background-color: #f5f7fa;
    border-color: #e4e7ed;
    color: #c0c4cc;
    cursor: not-allowed;
}

.el-input__inner {
    -webkit-appearance: none;
    background-color: #fff;
    background-image: none;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    box-sizing: border-box;
    color: #212529;
    display: inline-block;
    font-size: 1rem;
    height: 36px;
    line-height: 36px;
    outline: none;
    padding: 0 15px;
    transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
    width: 100%;
    cursor: pointer;
}

.el-input--large .el-input__inner {
    height: 48px;
    line-height: 48px;
}

.el-input--small .el-input__inner {
    height: 36px;
    line-height: 36px;
}

.el-input--mini .el-input__inner {
    height: 28px;
    line-height: 28px;
}

.el-input__inner:hover {
    border-color: #c0c4cc;
}

.el-input.is-focus .el-input__inner {
    border-color: #409eff;
    outline: none;
}

.el-input__suffix {
    position: absolute;
    height: 100%;
    right: 5px;
    top: 0;
    text-align: center;
    color: #c0c4cc;
    transition: all 0.3s;
    pointer-events: none;
    opacity: 0;
}

.el-input__suffix-inner {
    pointer-events: all;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* 图标样式 */
.el-icon-arrow-down, .el-icon-circle-close, .el-icon-arrow-right {
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    vertical-align: baseline;
    display: inline-block;
    cursor: pointer;
}

.el-icon-arrow-down:before {
    content: "▼";
    font-size: 12px;
}

.el-icon-circle-close:before {
    content: "✕";
    font-size: 14px;
    color: #c0c4cc;
}

.el-icon-arrow-right:before {
    content: "▶";
    font-size: 10px;
    color: #c0c4cc;
}

.el-cascader__arrow {
    transition: transform 0.3s;
}

.el-cascader__arrow.is-reverse {
    transform: rotateZ(180deg);
}

.el-cascader__clear {
    color: #c0c4cc;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.el-cascader__clear:hover {
    color: #909399;
}

/* 下拉面板样式 */
.el-cascader__dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1001;
    border: 1px solid #e4e7ed;
    border-radius: 4px;
    background-color: #fff;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
    margin-top: 5px;
    min-width: 100%;
    transition: opacity 0.2s cubic-bezier(0.645, 0.045, 0.355, 1),
                transform 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
    transform-origin: center top;
}

/* 级联面板样式 */
.el-cascader-panel {
    display: flex;
    min-width: 600px;
    max-height: 300px;
}

.el-cascader-menu__wrap {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.el-cascader-menu {
    min-width: 200px;
    max-height: 300px;
    overflow-y: auto;
    border-right: 1px solid #e4e7ed;
    background-color: #fff;
}

.el-cascader-menu:last-child {
    border-right: none;
}

/* 滚动条样式 */
.el-cascader-menu::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.el-cascader-menu::-webkit-scrollbar-thumb {
    border-radius: 3px;
    background: #c1c1c1;
}

.el-cascader-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
}

/* 菜单节点样式 */
.el-cascader-node {
    position: relative;
    display: flex;
    align-items: center;
    padding: 8px 10px;
    height: 36px;
    line-height: 20px;
    cursor: pointer;
    color: #606266;
    font-size: 14px;
    text-align: left;
    outline: none;
    border-bottom: 1px solid transparent;
    transition: background-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.el-cascader-node:hover {
    background-color: #f5f7fa;
}

.el-cascader-node.is-active {
    color: #409eff;
    font-weight: 600;
}

.el-cascader-node.is-disabled {
    color: #c0c4cc;
    cursor: not-allowed;
}

.el-cascader-node__label {
    flex: 1;
    padding-right: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.el-cascader-node__postfix {
    position: absolute;
    right: 10px;
    color: #c0c4cc;
}

.el-cascader-node.is-active .el-cascader-node__postfix {
    color: #409eff;
}

/* 空状态样式 */
.el-cascader-menu__empty-text {
    margin: 10px 0;
    color: #c0c4cc;
    font-size: 14px;
    text-align: center;
}

/* 加载状态样式 */
.el-cascader-menu__loading {
    margin: 10px 0;
    color: #c0c4cc;
    font-size: 14px;
    text-align: center;
}

.el-cascader-menu__loading:after {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #c0c4cc;
    border-top-color: transparent;
    border-radius: 50%;
    animation: cascader-loading 1s linear infinite;
    margin-left: 5px;
    vertical-align: middle;
}

@keyframes cascader-loading {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 搜索功能样式 */
.el-cascader__search-input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    font-size: inherit;
    color: inherit;
}

.el-cascader__suggestion-panel {
    border-right: none;
}

.el-cascader__suggestion-list {
    max-height: 204px;
    overflow: auto;
}

.el-cascader__suggestion-item {
    padding: 8px 10px;
    line-height: 20px;
    cursor: pointer;
    color: #606266;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.el-cascader__suggestion-item:hover {
    background-color: #f5f7fa;
}

.el-cascader__suggestion-item.is-checked {
    color: #409eff;
    font-weight: 600;
}

/* 不同尺寸的适配 */
.el-cascader--large .el-cascader-panel {
    min-width: 700px;
}

.el-cascader--large .el-cascader-menu {
    min-width: 233px;
}

.el-cascader--large .el-cascader-node {
    height: 40px;
    padding: 10px 12px;
    font-size: 16px;
}

.el-cascader--small .el-cascader-panel {
    min-width: 500px;
}

.el-cascader--small .el-cascader-menu {
    min-width: 167px;
}

.el-cascader--small .el-cascader-node {
    height: 32px;
    padding: 6px 8px;
    font-size: 13px;
}

.el-cascader--mini .el-cascader-panel {
    min-width: 450px;
}

.el-cascader--mini .el-cascader-menu {
    min-width: 150px;
}

.el-cascader--mini .el-cascader-node {
    height: 28px;
    padding: 4px 6px;
    font-size: 12px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .el-cascader-panel {
        min-width: 100%;
        max-width: 100vw;
        flex-direction: column;
        max-height: 50vh;
    }
    
    .el-cascader-menu {
        min-width: 100%;
        border-right: none;
        border-bottom: 1px solid #e4e7ed;
        max-height: 200px;
    }
    
    .el-cascader-menu:last-child {
        border-bottom: none;
    }
    
    .el-cascader__dropdown {
        left: 0;
        right: 0;
        width: auto;
    }
}

/* 主题色彩变量支持 */
.el-cascader.el-cascader--primary .el-input.is-focus .el-input__inner {
    border-color: #409eff;
}

.el-cascader.el-cascader--primary .el-cascader-node.is-active {
    color: #409eff;
}

.el-cascader.el-cascader--success .el-input.is-focus .el-input__inner {
    border-color: #67c23a;
}

.el-cascader.el-cascader--success .el-cascader-node.is-active {
    color: #67c23a;
}

.el-cascader.el-cascader--warning .el-input.is-focus .el-input__inner {
    border-color: #e6a23c;
}

.el-cascader.el-cascader--warning .el-cascader-node.is-active {
    color: #e6a23c;
}

.el-cascader.el-cascader--danger .el-input.is-focus .el-input__inner {
    border-color: #f56c6c;
}

.el-cascader.el-cascader--danger .el-cascader-node.is-active {
    color: #f56c6c;
} 


/* 统一AreaCascader和MultiSelect的箭头样式 */
.el-input__inner {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='%23212529' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 16px 12px !important;
    padding-right: 2.25rem !important;
}

/* AreaCascader验证样式 */
.el-input__inner.is-invalid {
    border-color: #dc3545 !important;
    /*background-color: #fff5f5 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;*/
}

.el-input__inner.is-valid {
    border-color: #28a745 !important;
    background-color: #f8fff9 !important;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25) !important;
}