/**
 * Zibll 文章评分插件 - 前端样式
 * 评分排行小工具样式由子比主题 .zib-widget.hot-posts 原生覆盖，无需额外定义
 */

/* ========== 评分组件容器 ========== */
.zrp-rating-box {
    position: relative;
    border-radius: var(--main-radius, 8px);
    box-shadow: var(--main-shadow, 0 1px 3px rgba(0,0,0,.05));
}

/* 侧边栏模式 */
.zrp-rating-box.zrp-mode-sidebar {
    margin: 20px 0;
    padding: 20px;
    text-align: center;
}

/* 悬浮窗模式 */
.zrp-rating-box.zrp-mode-float {
    position: fixed;
    right: 20px;
    bottom: 80px;  /* 默认距底距离，可通过后台设置覆盖 */
    z-index: 99;
    padding: 16px;
    width: 220px;
}

/* ========== 评分头部 ========== */
.zrp-rating-header {
    margin-bottom: 10px;
}

/* ========== 星级交互区 ========== */
.zrp-stars {
    display: inline-flex;
    gap: 4px;
    cursor: pointer;
    user-select: none;
    direction: ltr;
    font-size: 24px;
}

.zrp-star {
    position: relative;
    display: inline-block;
    color: var(--muted-3-color, #b1b1b1);
    transition: color .15s, transform .15s;
}

.zrp-star .fa-star {
    display: none;
}

.zrp-star .fa-star-o {
    display: inline;
}

/* 激活状态 */
.zrp-star.active .fa-star-o {
    display: none;
}

.zrp-star.active .fa-star {
    display: inline;
    color: var(--theme-color, #f1404b);
}

/* hover 预览 */
.zrp-star.hover .fa-star-o {
    display: none;
}

.zrp-star.hover .fa-star {
    display: inline;
    color: var(--theme-color, #f1404b);
}

/* 自定义激活颜色 */
.zrp-star.active .fa-star,
.zrp-star.hover .fa-star {
    color: var(--zrp-star-color, var(--theme-color, #f1404b));
}

/* 点击效果 */
.zrp-star:active {
    transform: scale(1.2);
}

/* ========== 评分信息区 ========== */
.zrp-rating-score-value {
    font-size: 1.6em;
}

/* ========== 显示模式星级（无交互） ========== */
.zrp-stars-display {
    display: inline-flex;
    gap: 2px;
    font-size: 14px;
    color: var(--muted-3-color, #b1b1b1);
}

.zrp-stars-display .zrp-star-display.active {
    color: var(--theme-color, #f1404b);
}

.zrp-stars-display .zrp-star-display.half {
    position: relative;
    color: var(--muted-3-color, #b1b1b1);
}

.zrp-stars-display .zrp-star-display.half::after {
    content: '\f005';
    font-family: FontAwesome;
    position: absolute;
    left: 0;
    top: 0;
    width: 50%;
    overflow: hidden;
    color: var(--theme-color, #f1404b);
}

/* ========== 暗色模式 ========== */
body.dark-theme .zrp-rating-box {
    background: var(--main-bg-color);
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .zrp-rating-box.zrp-mode-float {
        right: 10px;
        width: auto;
        max-width: 180px;
        padding: 12px 14px;
        max-height: 60vh;
        overflow-y: auto;
    }

    .zrp-stars {
        font-size: 22px;
    }
}
