/* IE 兼容样式 - 针对 Win7 IE 内核 */
/* 下拉菜单高亮蓝色兼容 */

/* 基础下拉菜单样式修复 */
select {
    background-color: #fff;
    border: 1px solid #ccc;
}

/* IE 下拉菜单选项高亮样式 */
select option {
    background-color: #fff;
    color: #333;
}

/* 选中/悬停高亮为蓝色 */
select option:hover,
select option:focus,
select option:checked,
select option:active {
    background-color: #1e40af !important;  /* 蓝色高亮 */
    color: #fff !important;
}

/* IE 特定hack */
@media screen\0 {
    select {
        background-color: #fff !important;
    }
    
    select option {
        background-color: #fff;
    }
    
    /* 强制蓝色高亮 */
    select:focus option:hover,
    select:focus option:checked {
        background-color: #1e40af !important;
        color: #ffffff !important;
    }
}

/* IE9-11 兼容 */
_:-ms-input-placeholder, :root select option:hover {
    background-color: #1e40af !important;
    color: #fff !important;
}

_:-ms-input-placeholder, :root select option:checked {
    background-color: #1e40af !important;
    color: #fff !important;
}

/* 下拉框焦点样式 */
select:focus {
    outline: none;
    border-color: #1e40af;
    box-shadow: 0 0 0 2px rgba(30, 64, 175, 0.2);
}

/* 自定义下拉箭头兼容 */
select::-ms-expand {
    background-color: transparent;
    border: none;
    color: #1e40af;
}

/* ============================================
   Win7 IE 内核增强兼容样式
   针对 Electron 旧版本 Chromium 内核
   ============================================ */

/* 全局样式重置 - 确保一致性 */
* {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

/* 下拉菜单容器样式 */
select.form-select,
select.form-control,
select.custom-select {
    background-color: #ffffff !important;
    border: 1px solid #d1d5db !important;
    color: #374151 !important;
}

/* 关键：覆盖 Tailwind 的 appearance-none */
select {
    -webkit-appearance: menulist !important;
    -moz-appearance: menulist !important;
    appearance: menulist !important;
}

/* 下拉选项样式 - 强制蓝色高亮 */
select option {
    background-color: #ffffff !important;
    color: #1f2937 !important;
    padding: 4px 8px !important;
}

/* 选中状态 - 蓝色背景白字 */
select option:checked,
select option:selected,
select option[selected] {
    background-color: #2563eb !important;  /* 亮蓝色 */
    background: #2563eb !important;
    color: #ffffff !important;
}

/* 悬停状态 */
select option:hover {
    background-color: #3b82f6 !important;  /* 浅蓝色 */
    background: #3b82f6 !important;
    color: #ffffff !important;
}

/* 焦点状态 */
select:focus option:focus {
    background-color: #2563eb !important;
    color: #ffffff !important;
}

/* IE10+ 特定样式 */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    select {
        background-color: #fff !important;
    }
    
    select option {
        background-color: #fff;
    }
    
    select option:checked,
    select option:hover {
        background-color: #2563eb !important;
        color: #fff !important;
    }
}

/* Webkit 内核浏览器（Electron Chromium）下拉菜单样式 */
select::-webkit-scrollbar {
    width: 8px;
}

select::-webkit-scrollbar-track {
    background: #f1f1f1;
}

select::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

select::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 确保下拉菜单在不同系统下显示一致 */
select {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* 禁用状态下的样式 */
select:disabled {
    background-color: #f3f4f6 !important;
    color: #9ca3af !important;
    cursor: not-allowed;
}

/* 下拉菜单焦点轮廓 */
select:focus {
    outline: 2px solid #2563eb;
    outline-offset: -2px;
}

/* 修复 Win7 下可能出现的渲染问题 */
select {
    text-indent: 0.01px;
    text-overflow: '';
}

/* 针对旧版 Chromium 的额外样式 */
@supports (-webkit-appearance: none) {
    select {
        background-image: none !important;
    }
    
    select option {
        background-color: #fff;
    }
    
    select option:checked {
        background-color: #2563eb !important;
        color: #fff !important;
    }
}
