/* fy-select：X5 内核自定义下拉（原生 select 弹层在此类浏览器不认作者 CSS）。
   原生 select 视觉隐藏但保留在 DOM 中，表单提交与 JS 对 .value 的读写不受影响；
   弹层由 JS 以 portal 方式挂到 document.body 并用 position:fixed + inline 样式定位。 */
.fy-select-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.fy-select {
    position: relative;
    display: inline-block;
    vertical-align: middle;
}

.fy-select-btn {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid rgba(216, 179, 106, .35);
    border-radius: 10px;
    background: rgba(10, 13, 21, .6);
    color: #e8e3d5;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color .2s ease, background .2s ease;
}

.fy-select-btn:hover {
    border-color: rgba(216, 179, 106, .6);
    background: rgba(216, 179, 106, .08);
}

.fy-select-btn:focus-visible {
    outline: 3px solid rgba(216, 179, 106, .55);
    outline-offset: 2px;
}

.fy-select-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fy-select-arrow {
    flex: 0 0 auto;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #d8b36a;
    transition: transform .18s ease;
}

.fy-select.fy-open .fy-select-arrow {
    transform: rotate(180deg);
}

.fy-select-list {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 60;
    max-height: 260px;
    margin: 0;
    padding: 4px;
    overflow-y: auto;
    list-style: none;
    border: 1px solid rgba(216, 179, 106, .35);
    border-radius: 10px;
    background: #131926;
    box-shadow: 0 18px 44px rgba(0, 0, 0, .55);
}

/* portal 方案：弹层搬到 body 后由本 class 直接控制显隐（inline fixed 定位覆盖基础声明） */
.fy-list-open {
    display: block !important;
}

.fy-select-option {
    padding: 8px 12px;
    border-radius: 6px;
    color: #e8e3d5;
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fy-select-option:hover,
.fy-select-option.fy-hl {
    background: rgba(216, 179, 106, .16);
}

.fy-select-option.is-active {
    background: #c93b2e;
    color: #fff;
}

/* ===== 手机端适配（2026-08 追加：仅布局/触控覆盖） ===== */
@media (max-width: 640px) {
    /* 触发按钮加高到 42px 触控目标 */
    .fy-select-btn {
        min-height: 42px;
        padding: 9px 12px;
    }

    /* 选项行加高到约 40px，便于点按（不改动 display，保留 nowrap+ellipsis） */
    .fy-select-option {
        padding: 11px 12px;
    }

    /* 小屏弹层限高防超视口：先 260px 兜底，支持 min() 的内核再按 56vh 收紧 */
    .fy-select-list {
        max-height: 260px;
        max-height: min(260px, 56vh);
    }
}
