/* ========== 自定义下拉容器 ========== */
.custom-select-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 46px;  /* ← 加上固定高度 */
}

/* ========== 隐藏原生 select（保留功能） ========== */
.custom-select-wrapper select {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
    /* 保留可访问性，但视觉上透明 */
}

/* ========== 自定义显示层 ========== */
.custom-select-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    height: 46px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    z-index: 1;
}

.custom-select-display:hover {
    border-color: #9ca3af;
}

/* ========== 下拉框展开时 = 蓝色边框 + 阴影 ========== */
.custom-select-wrapper.open .custom-select-display,
.custom-select-wrapper:focus-within .custom-select-display {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* ========== 验证错误状态 ========== */
.custom-select-wrapper.has-error .custom-select-display {
    border-color: #dc3545;
}

.custom-select-wrapper.has-error.open .custom-select-display,
.custom-select-wrapper.has-error:focus-within .custom-select-display {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* ========== 左侧图标 ========== */
.custom-select-display .icon-left {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #6b7280;
    width: 24px;
    height: 24px;
}

.custom-select-display .icon-left svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

/* ========== 选中文本 ========== */
.custom-select-display .selected-value {
    flex: 1;
    font-size: 16px;
    color: #1f2937;
    font-weight: 400;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 占位符样式（未选择时） */
.custom-select-display .selected-value.placeholder {
    color: #9ca3af;
}

/* ========== 右侧箭头 ========== */
.custom-select-display .icon-right {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #6b7280;
    width: 24px;
    height: 24px;
    transition: transform 0.25s ease;
}

/* 下拉展开时箭头旋转 */
.custom-select-wrapper.open .icon-right {
    transform: rotate(180deg);
}

.custom-select-display .icon-right svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

/* ========== 表单验证状态 ========== */
/* 必填验证失败时 */
.custom-select-wrapper.has-error .custom-select-display {
    border-color: #ef4444;
}

.custom-select-wrapper.has-error .custom-select-display:focus-within {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* 验证成功时 */
.custom-select-wrapper.has-success .custom-select-display {
    border-color: #22c55e;
}

/* ========== 禁用状态 ========== */
.custom-select-wrapper.disabled .custom-select-display {
    background: #f3f4f6;
    cursor: not-allowed;
    opacity: 0.7;
}

.custom-select-wrapper.disabled select {
    cursor: not-allowed;
}

/* ========== 响应式适配 ========== */
@media (max-width: 640px) {
    .custom-select-wrapper {
        max-width: 100%;
    }

    .custom-select-display {
        padding: 10px 8px;    /* ← 稍微缩小一点，但仍保持较高 */
        min-height: 42px;      /* ← 移动端略微降低 */
        gap: 5px;
        border-radius: 0;
    }
    .border-radius-right .custom-select-display {
        border-radius: 0 5px 5px 0;
    }

    .custom-select-display .selected-value {
        font-size: 15px;       /* ← 移动端稍小一点 */
    }

    .custom-select-display .icon-left,
    .custom-select-display .icon-right {
        width: 20px;
        height: 20px;
    }
}

.custom-date-wrapper {
    position: relative;
}

/* 让 input-group 变成相对定位容器 */
.custom-date-wrapper .input-group {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    height: 46px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.custom-date-wrapper .input-group:focus-within {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* 隐藏原有图标按钮的边框和背景，让它浮在输入框内 */
.custom-date-wrapper .input-group-addon {
    position: absolute !important;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    border: none !important;
    background: transparent !important;
    padding: 0 0 0 14px !important;
    color: #6b7280;
    font-size: 18px;
    height: auto !important;
}

.custom-date-wrapper .input-group-addon i {
    font-size: 16px;
    color: #6b7280;
}

/* 输入框左侧留出空间，并去掉默认边框 */
.custom-date-wrapper .form-control {
    border: none !important;
    height: 46px;
    font-size: 16px;
    padding: 0 16px 0 46px !important;
    background: transparent !important;
    box-shadow: none !important;
    flex: 1;
    z-index: 1;
}

.custom-date-wrapper .form-control:focus {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

/* 隐藏清除按钮（如果不需要） */
.custom-date-wrapper .kv-date-remove {
    display: none !important;
}

/* 调整 input-group 内部元素顺序 */
.custom-date-wrapper .input-group .form-control {
    order: 2;
}

.custom-date-wrapper .input-group .input-group-addon {
    order: 1;
}

.custom-select-wrapper .form-group,
.custom-date-wrapper .form-group {
    margin-bottom: 0 !important;
}

@media (max-width: 640px) {
    .custom-date-wrapper .input-group {
        border-radius: 0;
    }
    .custom-date-wrapper.border-radius-left .input-group {
        border-radius: 5px 0 0 5px;
    }
    .custom-date-wrapper .input-group-addon {
        padding-left: 10px !important;
    }
    .custom-date-wrapper .form-control {
        padding-left: 32px !important;
    }

}

.datepicker {
    margin-top: 18px !important; /* 将整体向下推移 6px，你可以调整这个值 */
}
.custom-date-wrapper .date-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 18px;
    pointer-events: none;
    z-index: 2;
}
@media (max-width: 640px) {
    .custom-date-wrapper .date-arrow {
        right: 10px;
    }
}