/**
 * 推荐指数 - 前端样式
 *
 * 只用主题自身的 CSS 变量，日间 / 暗黑模式都不用单独写一套。
 * 星星、进度条、分数统一用主题色（--theme-color）。
 *
 * ⚠️ 状态类一律用 zr-on / zr-open，绝不能用 .show / .active：
 *    主题自带的 bootstrap.min.css 有全局 `.show{display:block!important}`，
 *    会把本该 display:none 的元素强行显示出来（曾导致桌面端分档文案跑到最左边）。
 */

.zmo-rating {
    position: relative;
    margin: 0;
    font-size: 12.5px;
    line-height: 1.5;
    --zr-accent: var(--theme-color, #f3a90a);
    --zr-accent-soft: rgba(243, 169, 10, .55);
}

/* 各容器的间距：已付费 PC 右列是 grid（gap 14），其余是 flex 堆叠 */
.sg-pay-main > .zmo-rating,
.sg-pay-mobile-main > .zmo-rating {
    margin-top: 14px;
}

.sg-pay-paid-content .sg-pay-main > .zmo-rating {
    margin-top: 0;
}

.sg-pay-mobile-main > .zmo-rating {
    margin-top: 12px;
}

/* ============ 主长条 ============ */

.zr-line {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 5px 11px;
    border-radius: var(--main-radius, 8px);
    background: var(--muted-bg-2-color, #f6f7f8);
    border: 1px solid var(--main-border-color, rgba(0, 0, 0, .06));
    box-sizing: border-box;
}

.zr-label {
    flex: 0 0 auto;
    font-size: 12.5px;
    color: var(--muted-color, #777);
    white-space: nowrap;
    letter-spacing: .2px;
}

/* 桌面/移动两套标题，按断点切换（手机屏窄，默认用「评分」两个字） */
.zr-label .zr-lmb {
    display: none;
}

.zr-track {
    position: relative;
    display: block;
    flex: 1 1 auto;
    min-width: 110px;
    height: 8px;
    border-radius: 4px;
    background: var(--muted-bg-color, #eee);
}

.zr-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--zr-accent-soft), var(--zr-accent));
    transition: width .4s cubic-bezier(.2, .8, .3, 1);
}

.zr-mark {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translate(-50%, -50%);
    min-width: 30px;
    height: 18px;
    line-height: 16px;
    padding: 0 5px;
    box-sizing: border-box;
    border-radius: 9px;
    background: var(--main-bg-color, #fff);
    border: 1px solid var(--main-border-color, rgba(0, 0, 0, .1));
    box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
    font-size: 11px;
    font-weight: 700;
    color: var(--muted-2-color, #999);
    text-align: center;
    white-space: nowrap;
    transition: left .4s cubic-bezier(.2, .8, .3, 1);
}

.zr-mark.has {
    color: var(--zr-accent);
    border-color: rgba(243, 169, 10, .45);
}

/* ============ 右侧：头像墙 + 人数 + 按钮 ============ */

.zr-tail {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.zr-faces {
    display: flex;
    align-items: center;
}

.zr-face {
    position: relative;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    margin-left: -8px;
    border-radius: 50%;
    overflow: hidden;
    box-sizing: content-box;
    border: 2px solid var(--main-bg-color, #fff);
    background: #4a4b4f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #fff;
    line-height: 1;
}

.zr-face:first-child {
    margin-left: 0;
}

/* 头像图盖在首字上：图挂了（例如外链被墙）就露出底下的首字，不会出现空白圆 */
.zr-face .zr-ini {
    font-style: normal;
    line-height: 1;
}

/* 有头像图时用浅底：站点默认头像是「52」这种透明底图形，
   深灰底会显得脏，浅底和主题其它位置的头像观感一致 */
.zr-face.has-img {
    background: var(--main-bg-color, #fff);
}

/* 头像图盖住整个圆圈 */
.zr-face img {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.zr-face.new::after {
    content: "";
    position: absolute;
    right: -1px;
    top: -1px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--zr-accent);
    border: 1px solid var(--main-bg-color, #fff);
    box-sizing: border-box;
}

.zr-more {
    position: relative;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    margin-left: -8px;
    border-radius: 50%;
    box-sizing: content-box;
    border: 2px solid var(--main-bg-color, #fff);
    background: var(--muted-bg-color, #eee);
    color: var(--muted-color, #777);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    line-height: 1;
}

.zr-total {
    font-size: 11.5px;
    color: var(--muted-2-color, #999);
    white-space: nowrap;
}

.zr-btn {
    flex: 0 0 auto;
    height: 26px;
    padding: 0 12px;
    border-radius: 13px;
    border: 1px solid rgba(243, 169, 10, .45);
    background: rgba(243, 169, 10, .1);
    color: var(--zr-accent);
    font-size: 12px;
    line-height: 24px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, border-color .15s;
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
}

.zr-btn:hover {
    background: rgba(243, 169, 10, .18);
    border-color: rgba(243, 169, 10, .7);
}

.zr-btn b {
    font-weight: 700;
}

/* 「已评 9★」里的那颗星，颜色跟分数走（主题色） */
.zr-btn .zr-starm {
    font-style: normal;
    color: var(--zr-accent);
    margin-left: 1px;
}

.zr-btn.done {
    background: transparent;
    color: var(--muted-2-color, #999);
    border-color: var(--main-border-color, rgba(0, 0, 0, .1));
}

.zr-btn.done b {
    color: var(--zr-accent);
}

.zr-btn.locked,
.zr-btn:disabled {
    opacity: .65;
    cursor: default;
}

/* ============ 未购买时的提示浮框 ============ */

.zr-tip {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    padding: 5px 10px;
    border-radius: 6px;
    background: var(--main-bg-color, #fff);
    border: 1px solid var(--main-border-color, rgba(0, 0, 0, .1));
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
    color: var(--zr-accent);
    font-size: 11.5px;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(3px);
    pointer-events: none;
    transition: opacity .15s, transform .15s;
    z-index: 30;
}

.zr-tip::after {
    content: "";
    position: absolute;
    left: auto;
    right: 16px;
    top: 100%;
    width: 6px;
    height: 6px;
    transform: translateY(-3px) rotate(45deg);
    background: var(--main-bg-color, #fff);
    border-right: 1px solid var(--main-border-color, rgba(0, 0, 0, .1));
    border-bottom: 1px solid var(--main-border-color, rgba(0, 0, 0, .1));
}

.zr-tip.zr-on {
    opacity: 1;
    transform: translateY(0);
}

/* ============ 评分覆盖层（盖住整条） ============ */

.zr-overlay {
    position: absolute;
    inset: -1px;
    display: none;
    align-items: center;
    border-radius: var(--main-radius, 8px);
    background: var(--muted-bg-2-color, #f6f7f8);
    border: 1px solid rgba(243, 169, 10, .38);
    box-shadow: inset 0 0 0 1px rgba(243, 169, 10, .06);
    z-index: 20;
}

.zr-line.zr-open {
    /* 覆盖层打开时抬高一层，免得移动端浮窗被下面的模块盖住 */
    z-index: 6;
}

.zr-line.zr-open .zr-overlay {
    display: flex;
}

.zr-otitle {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12.5px;
    color: var(--muted-color, #777);
}


/* 星星绝对居中：右侧文案长短完全推不动它 */
.zr-stars {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 2px;
}

.zr-star {
    width: 20px;
    height: 20px;
    font-size: 18px;
    line-height: 20px;
    text-align: center;
    color: var(--muted-3-color, #b1b1b1);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: color .08s, transform .08s;
}

.zr-star.on {
    color: var(--zr-accent);
}

.zr-star.hot {
    transform: scale(1.18);
}

.zr-osel {
    position: absolute;
    right: 52px;
    top: 50%;
    transform: translateY(-50%);
    width: 76px;
    text-align: right;
    font-size: 11.5px;
    color: var(--zr-accent);
    white-space: nowrap;
    overflow: hidden;
}

.zr-cancel {
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11.5px;
    color: var(--muted-2-color, #999);
    cursor: pointer;
    white-space: nowrap;
}

.zr-cancel:hover {
    color: var(--main-color, #333);
}

/* 移动端专用：分档文案浮在星星下方（桌面端永不显示，JS 也不会加 zr-on） */
.zr-omtip {
    display: none;
}

/* ============ 奖励飘字 ============ */

.zr-bonus {
    position: absolute;
    right: 4px;
    top: -22px;
    padding: 3px 9px;
    border-radius: 11px;
    background: rgba(243, 169, 10, .12);
    border: 1px solid rgba(243, 169, 10, .38);
    font-size: 11.5px;
    line-height: 1.4;
    font-weight: 700;
    color: var(--zr-accent);
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    z-index: 40;
}

.zr-bonus.zr-on {
    animation: zrBonus 2.4s ease-out forwards;
}

@keyframes zrBonus {
    0% {
        opacity: 0;
        transform: translateY(6px);
    }

    18% {
        opacity: 1;
        transform: translateY(0);
    }

    72% {
        opacity: 1;
        transform: translateY(-4px);
    }

    100% {
        opacity: 0;
        transform: translateY(-12px);
    }
}

/* ============ 移动端 ============ */

@media (max-width: 768px) {

    .zr-line {
        gap: 8px;
        min-height: 42px;
        padding: 5px 9px;
    }

    .zr-label {
        font-size: 12px;
    }

    .zr-label .zr-lpc {
        display: none;
    }

    .zr-label .zr-lmb {
        display: inline;
    }

    .zr-track {
        min-width: 56px;
        height: 7px;
    }

    .zr-mark {
        min-width: 26px;
        height: 16px;
        line-height: 14px;
        font-size: 10px;
        padding: 0 4px;
    }

    .zr-tail {
        gap: 6px;
    }

    .zr-face,
    .zr-more {
        width: 20px;
        height: 20px;
        flex: 0 0 20px;
        margin-left: -7px;
        border-width: 1.5px;
        font-size: 8.5px;
    }

    .zr-more {
        display: none;
    }

    .zr-total {
        font-size: 11px;
    }

    .zr-btn {
        height: 24px;
        padding: 0 9px;
        border-radius: 12px;
        font-size: 11.5px;
        line-height: 22px;
    }

    .zr-otitle,
    .zr-osel {
        display: none;
    }

    .zr-star {
        width: 16px;
        height: 16px;
        font-size: 15px;
        line-height: 16px;
    }

    .zr-stars {
        gap: 1px;
    }

    /* 分档文案浮窗：必须放在长条**上方**。
       ⚠️ 付费框 .pay-box/zib-widget 是 overflow:hidden，长条又是框内最后一个元素，
          浮窗如果朝下放，只有 12px 的框内下边距，实测被裁掉 90%（只剩 5px），
          手机上等于完全看不见。朝上放则落在下载区里，不会被裁。 */
    .zr-omtip {
        display: block;
        position: absolute;
        left: 50%;
        bottom: calc(100% + 8px);
        top: auto;
        transform: translateX(-50%) translateY(2px);
        padding: 4px 9px;
        border-radius: 5px;
        background: var(--main-bg-color, #fff);
        border: 1px solid var(--main-border-color, rgba(0, 0, 0, .1));
        box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
        color: var(--zr-accent);
        font-size: 11px;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: opacity .12s, transform .12s;
        z-index: 30;
    }

    /* 小尖角朝下，指着被选中的星星 */
    .zr-omtip::after {
        content: "";
        position: absolute;
        left: 50%;
        top: 100%;
        width: 7px;
        height: 7px;
        margin-left: -4px;
        transform: translateY(-4px) rotate(45deg);
        background: inherit;
        border-right: 1px solid var(--main-border-color, rgba(0, 0, 0, .1));
        border-bottom: 1px solid var(--main-border-color, rgba(0, 0, 0, .1));
    }

    .zr-omtip.zr-on {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}
