/* 排盘结果：择吉事项（米黄/橘金）+ 盘面分数/高亮 */

.paipan-matter-bar-mount {
    display: block;
    width: 100%;
    margin-top: 0.55rem;
    flex: 0 0 auto;
    overflow: visible;
    position: relative;
    z-index: 28;
}

.paipan-matter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.4rem 0.55rem;
    margin: 0;
    padding: 0.55rem 0.7rem;
    border-radius: 12px;
    background: linear-gradient(
        145deg,
        rgba(255, 252, 246, 0.98) 0%,
        rgb(252, 244, 228) 48%,
        rgba(236, 199, 131, 0.28) 100%
    );
    border: 1px solid rgba(212, 168, 95, 0.55);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.65) inset,
        0 6px 18px rgba(138, 104, 52, 0.1);
    overflow: visible;
    position: relative;
    z-index: 28;
}

.paipan-matter-bar__label {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    flex: 0 1 auto;
    width: auto;
    max-width: 100%;
    gap: 0.35rem;
    margin: 0;
    font-size: 0.9rem;
    color: var(--cream-text, #3a2f21);
}

.paipan-matter-bar__title {
    flex: 0 0 auto;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.02em;
    color: #5a4528;
}

.paipan-matter-dd {
    position: relative;
    display: inline-block;
    flex: 0 1 auto;
    min-width: 7.5rem;
    max-width: min(100%, 14rem);
    z-index: 30;
}

.paipan-matter-dd__btn {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    width: 100%;
    min-width: 7.5rem;
    max-width: min(100%, 14rem);
    padding: 0.38rem 0.75rem 0.38rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(212, 168, 95, 0.75);
    color: var(--cream-text, #3a2f21);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.3;
    cursor: pointer;
    background: linear-gradient(
        180deg,
        rgb(255, 248, 230) 0%,
        rgb(244, 214, 160) 55%,
        var(--tone-gold, #ecc783) 100%
    );
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.55) inset,
        0 2px 8px rgba(180, 130, 60, 0.18);
}

.paipan-matter-dd__btn--placeholder .paipan-matter-dd__value {
    font-weight: 500;
    opacity: 0.78;
}

.paipan-matter-dd__btn:hover,
.paipan-matter-dd__btn:focus-visible,
.paipan-matter-dd--open .paipan-matter-dd__btn {
    border-color: var(--tone-gold-deep, #d4a85f);
    outline: none;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.65) inset,
        0 0 0 3px rgba(236, 199, 131, 0.35),
        0 3px 10px rgba(180, 130, 60, 0.22);
}

.paipan-matter-dd__value {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.paipan-matter-dd__caret {
    flex: 0 0 auto;
    width: 0.55rem;
    height: 0.55rem;
    border-right: 2px solid #5a4528;
    border-bottom: 2px solid #5a4528;
    transform: rotate(45deg) translateY(-1px);
    opacity: 0.75;
}

.paipan-matter-dd--open .paipan-matter-dd__caret {
    transform: rotate(225deg) translateY(2px);
}

/* 贴按钮展开（手机/电脑统一 absolute，避免 fixed + 父级 transform 飘空） */
.paipan-matter-dd__menu {
    position: absolute;
    left: 0;
    right: auto;
    top: auto;
    bottom: calc(100% + 6px);
    margin: 0;
    padding: 0.35rem 0;
    list-style: none;
    min-width: 100%;
    width: max(100%, 11.5rem);
    max-width: min(18rem, calc(100vw - 1.2rem));
    max-height: min(280px, 42vh);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    border-radius: 12px;
    border: 1px solid rgba(212, 168, 95, 0.65);
    background: linear-gradient(180deg, #fffdf8 0%, #faf3e4 100%);
    box-shadow:
        0 10px 28px rgba(90, 60, 20, 0.18),
        0 1px 0 rgba(255, 255, 255, 0.7) inset;
    z-index: 80;
}

.paipan-matter-dd__menu.paipan-matter-dd__menu--down {
    top: calc(100% + 6px);
    bottom: auto;
}

.paipan-matter-dd__menu.paipan-matter-dd__menu--up {
    top: auto;
    bottom: calc(100% + 6px);
}

.paipan-matter-dd__menu[hidden] {
    display: none !important;
}

.paipan-matter-dd__option {
    display: block;
    padding: 0.55rem 0.85rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #3a2f21;
    cursor: pointer;
    user-select: none;
}

.paipan-matter-dd__option:hover,
.paipan-matter-dd__option:focus-visible {
    background: rgba(236, 199, 131, 0.35);
    outline: none;
}

.paipan-matter-dd__option--active {
    background: linear-gradient(90deg, rgba(244, 214, 160, 0.85), rgba(236, 199, 131, 0.45));
    font-weight: 700;
    color: #4a3518;
}

.paipan-matter-bar__hint {
    flex: 1 1 100%;
    width: 100%;
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.4;
    color: rgba(90, 69, 40, 0.82);
}

/* —— 奇门宫分 / 高亮（米黄·橘金）—— */
.qimen-palace-cell {
    position: relative;
}

.qimen-palace-cell__matter-score {
    position: absolute;
    right: 3px;
    bottom: 2px;
    z-index: 3;
    min-width: 1.55rem;
    padding: 0 0.22rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    color: #5a4528;
    background: rgba(255, 248, 230, 0.95);
    border: 1px solid rgba(212, 168, 95, 0.55);
    pointer-events: none;
}

.qimen-palace-cell--matter-hi {
    box-shadow: inset 0 0 0 2.5px rgba(212, 168, 95, 0.95);
    background: linear-gradient(
        160deg,
        rgba(255, 244, 214, 0.95) 0%,
        rgba(236, 199, 131, 0.38) 100%
    ) !important;
}

.qimen-palace-cell--matter-hi .qimen-palace-cell__matter-score {
    color: #4a3518;
    background: linear-gradient(180deg, #fff8e6, #f4d6a0);
    border-color: rgba(180, 120, 40, 0.7);
}

.qimen-palace-cell--matter-xiong .qimen-palace-cell__matter-score {
    color: #6a3a2a;
    background: rgba(255, 236, 220, 0.95);
    border-color: rgba(180, 110, 70, 0.45);
}

/* —— 六壬地支宫分 / 高亮 —— */
.liuren-qkbj__plate-cell {
    position: relative;
}

.liuren-qkbj__plate-cell__matter-score {
    position: absolute;
    left: 2px;
    bottom: 1px;
    z-index: 2;
    min-width: 1.35rem;
    padding: 0 0.15rem;
    border-radius: 3px;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    color: #5a4528;
    background: rgba(255, 248, 230, 0.95);
    border: 1px solid rgba(212, 168, 95, 0.5);
    pointer-events: none;
}

.liuren-qkbj__plate-cell--matter-hi {
    box-shadow: inset 0 0 0 2.5px rgba(212, 168, 95, 0.95);
    background: linear-gradient(
        160deg,
        rgba(255, 244, 214, 0.95) 0%,
        rgba(236, 199, 131, 0.4) 100%
    ) !important;
}

.liuren-qkbj__plate-cell--matter-hi .liuren-qkbj__plate-cell__matter-score {
    color: #4a3518;
    background: linear-gradient(180deg, #fff8e6, #f4d6a0);
    border-color: rgba(180, 120, 40, 0.7);
}

.liuren-qkbj__plate-cell--matter-low .liuren-qkbj__plate-cell__matter-score {
    color: #6a3a2a;
    background: rgba(255, 236, 220, 0.92);
}

.liuren-result-shell .paipan-matter-bar {
    margin-top: 0.35rem;
}

@media (max-width: 720px) {
    .paipan-matter-bar {
        padding: 0.48rem 0.55rem;
        gap: 0.35rem 0.4rem;
    }

    .paipan-matter-bar__label {
        gap: 0.28rem;
    }

    .paipan-matter-bar__title {
        font-size: 0.86rem;
    }

    .paipan-matter-dd,
    .paipan-matter-dd__btn {
        min-width: 6.8rem;
        max-width: 11rem;
        font-size: 0.86rem;
    }

    .paipan-matter-dd__option {
        padding: 0.62rem 0.85rem;
        font-size: 0.88rem;
    }

    .qimen-palace-cell__matter-score,
    .liuren-qkbj__plate-cell__matter-score {
        font-size: 0.64rem;
    }
}
