/* ============================================================
   全站统一「组合下拉」样式（与风水「修造时间」控件同款）
   —— 36px 高 / 8px 圆角 / 1px 米色描边 / 聚焦朱红；
      浮层挂 body（fixed），可溢出弹窗与卡片，默认露 5 条。
   改这一个文件，所有模块（八字 / 姓名 / 风水 / 万年历 / 弹窗）同步生效。
   ============================================================ */

.qy-combo {
    --qy-combo-h: 36px;
    --qy-combo-radius: 8px;
    --qy-combo-bd: var(--qy-field-bd, var(--border-color, #f0e0d0));
    --qy-combo-focus: var(--sun-red, #eb1313);
    --qy-combo-rows: 5;
    position: relative;
    display: inline-flex;
    align-items: center;
    min-width: 0;
    width: auto;              /* 默认自适应（行内与 data-ss-width 场景） */
    vertical-align: middle;
}

/* 原生 select 只作数据源，不参与显示 */
.qy-combo-native {
    display: none !important;
}

.qy-combo-input {
    width: 100%;
    height: var(--qy-combo-h);
    line-height: var(--qy-combo-h);
    padding: 0 20px 0 8px;
    box-sizing: border-box;
    text-align: center;
    font-size: 13px;
    color: var(--text-primary, #2a2420);
    background: #fff;
    border: 1px solid var(--qy-combo-bd);
    border-radius: var(--qy-combo-radius);
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease;
    cursor: pointer;
    text-overflow: ellipsis;
}

.qy-combo-input::placeholder {
    color: #b3a99b;
}

.qy-combo-input:focus,
.qy-combo.is-open .qy-combo-input {
    border-color: var(--qy-combo-focus);
    box-shadow: 0 0 0 3px rgba(235, 19, 19, .10);
}

.qy-combo-input:disabled,
.qy-combo.is-disabled .qy-combo-input {
    background: #f6f2ee;
    color: #b7aca2;
    cursor: not-allowed;
}

/* 右侧小箭头（纯 CSS，不额外占位） */
.qy-combo::after {
    content: "";
    position: absolute;
    right: 8px;
    top: 50%;
    width: 0;
    height: 0;
    margin-top: -2px;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #b9a48c;
    pointer-events: none;
    transition: transform .18s ease;
}

.qy-combo.is-open::after {
    transform: rotate(180deg);
}

/* ===== 浮层：挂 body + fixed，永不被父级 overflow 裁切 ===== */
.qy-combo-list {
    display: none;
    position: fixed;
    z-index: 9999;
    box-sizing: border-box;
    padding: 4px;
    /* 默认 5 条：34px * 5 + 8px 内边距（实际值由 JS 按可用空间精确设置） */
    max-height: 178px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border: 1px solid #e8d9c3;
    border-radius: 10px;
    box-shadow: 0 10px 26px rgba(90, 60, 20, .16), 0 2px 6px rgba(90, 60, 20, .08);
}

.qy-combo-list.is-open {
    display: block;
    animation: qyComboIn .12s ease-out;
}

@keyframes qyComboIn {
    from { opacity: .5; transform: translateY(-3px); }
    to   { opacity: 1; transform: translateY(0); }
}

.qy-combo-item {
    height: 34px;
    line-height: 34px;
    padding: 0 10px;
    text-align: center;
    font-size: 13px;
    color: #4a3f36;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qy-combo-item:hover,
.qy-combo-item.is-hover {
    background: #fff6f3;
    color: var(--sun-red, #eb1313);
    font-weight: 600;
}

/* 当前选中项：红底白字，置顶显示 */
.qy-combo-item.is-active,
.qy-combo-item.is-active:hover {
    background: var(--sun-red, #eb1313);
    color: #fff;
    font-weight: 600;
}

.qy-combo-empty {
    padding: 10px 8px;
    text-align: center;
    font-size: 12px;
    color: #9b8b7c;
    line-height: 1.5;
}

/* ===== 组合内嵌到既有布局（日期 4 列 / 地区 3 列 / 风水修造行） ===== */
.qy-ui-date > .qy-combo,
.qy-ui-region > .qy-combo,
.qy-ui-repair > .qy-combo {
    min-width: 0;
    width: 100%;
}

/* 筛选行（label + 下拉）：填满 label 之后的剩余空间 */
.filter-group > .qy-combo,
.gm-input-row .filter-group > .qy-combo {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
}

/* 姓名页四柱行：按模板给定宽度排列，不撑满 */
.select-group > .qy-combo {
    flex: 0 0 auto;
    width: auto;
}

/* 风水页：修造时间/分析时间内联排列，保持单行不换行 */
.gm-repair-inline .qy-combo,
.gm-input-row-2 .gm-predict-group .qy-combo {
    width: auto;
    min-width: 62px;
    flex: 0 0 auto;
}

/* 福主一/二的年月日：紧凑排列，不撑满 */
.gm-owner-pair .qy-combo {
    width: auto;
    min-width: 56px;
}

.gm-owner-pair .qy-combo-input {
    padding: 0 16px 0 4px;
    font-size: 12px;
}

.gm-repair-inline .qy-combo-input,
.gm-input-row-2 .qy-combo-input {
    min-width: 62px;
    padding: 0 18px 0 4px;
}

/* 年份下拉通常只有 4 位数字，窄一点更协调 */
.qy-combo.is-year { min-width: 74px; }

/* 窄屏：字号略收，仍保持 36px 触控高度 */
@media (max-width: 640px) {
    .qy-combo-input { font-size: 13px; }
    .qy-combo-item { font-size: 13px; }
}

/* ===== 覆盖各模块旧的 input[type=text] 规则（如 common.css .filter-group input 的 34px/6px） =====
   组合框的输入框必须始终与风水「修造时间」同款：36px 高 / 8px 圆角 / 13px 字号 */
.filter-group .qy-combo > .qy-combo-input,
.qy-ui-field .qy-combo > .qy-combo-input,
.qy-ui-date .qy-combo > .qy-combo-input,
.qy-ui-region .qy-combo > .qy-combo-input,
.qy-ui-repair .qy-combo > .qy-combo-input,
.gm-input-row .qy-combo > .qy-combo-input,
.gm-repair-inline .qy-combo > .qy-combo-input,
.qy-combo > .qy-combo-input {
    height: 36px !important;
    line-height: 34px !important;
    padding: 0 20px 0 8px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    background: #fff !important;
    box-sizing: border-box;
}

/* ===== 与「日期浮层 / 地区浮层」触发器对齐（tools-input.js: data-qy-date / data-qy-region） =====
   这两个触发器是「点开四列/三列浮层」的按钮，功能保留，仅把外观统一成修造时间同款：
   36px 高 / 8px 圆角 / 13px 字号 / 白底 / 同色描边。 */
.qy-date-trigger.qy-field,
.qy-region-trigger.qy-field {
    height: var(--qy-ctl-h, 36px);
    min-height: var(--qy-ctl-h, 36px);
    padding: 0 10px;
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
}
.qy-date-trigger .qy-field-val,
.qy-region-trigger .qy-field-val {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #2a2420);
}
.qy-date-trigger.ph .qy-field-val,
.qy-region-trigger.ph .qy-field-val {
    font-weight: 400;
    color: #9b8b7c;
}
.qy-date-trigger .qy-caret,
.qy-region-trigger .qy-caret { font-size: 11px; }
