/**
 * Steam 玩家评价插件样式
 * 适配子比主题（Zibll）浅色/深色模式
 */

/* === 游戏信息栏 === */
.spr-game-info-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 12px 0 14px;
    padding: 10px 14px;
    font-size: 13px;
    color: #6b7a90;
    background: linear-gradient(145deg, #fbfdff 0%, #f5f8fc 100%);
    border-radius: 10px;
    border: 1px solid rgba(106, 135, 171, 0.12);
}

.spr-game-info-item {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
}

.spr-game-info-item::before {
    content: '';
    display: inline-block;
    width: 1px;
    height: 12px;
    background: #c8d3e0;
    margin: 0 10px;
    vertical-align: middle;
}

.spr-game-info-item:first-child::before {
    display: none;
}

.spr-game-info-label {
    color: #8a9bb5;
    font-weight: 500;
}

.spr-game-info-value {
    color: #4a5a72;
    font-weight: 600;
}

/* 暗黑模式 */
body.dark-theme .spr-game-info-bar,
html.dark .spr-game-info-bar {
    color: #748192;
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(229, 238, 247, 0.1);
}

body.dark-theme .spr-game-info-label,
html.dark .spr-game-info-label {
    color: #748192;
}

body.dark-theme .spr-game-info-value,
html.dark .spr-game-info-value {
    color: #c8d3e0;
}

body.dark-theme .spr-game-info-item::before,
html.dark .spr-game-info-item::before {
    background: #4a5568;
}

/* 移动端：游戏厂商单独一排，游戏发行和更新时间同一排 */
@media (max-width: 768px) {
    .spr-game-info-bar {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 4px 0;
    }

    /* 游戏厂商独占一排 */
    .spr-game-info-item:first-child {
        flex-basis: 100%;
        margin-bottom: 4px;
    }

    /* 游戏发行和更新时间在同一排，空间不够自动换行 */
    .spr-game-info-item:nth-child(2),
    .spr-game-info-item:nth-child(3) {
        flex-basis: auto;
        white-space: nowrap;
    }

    /* 游戏发行后面留间距 */
    .spr-game-info-item:nth-child(2) {
        margin-right: 16px;
    }

    /* 所有项目前无竖线 */
    .spr-game-info-item::before {
        display: none !important;
    }
}

.steam-review-card {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 22px;
    box-sizing: border-box;
    margin: 16px 0 20px;
    padding: 17px 18px;
    border: 1px solid #dce6f1;
    border-radius: 14px;
    background: linear-gradient(145deg, #fbfdff 0%, #f5f8fc 100%);
    box-shadow: 0 14px 30px -27px rgba(29, 56, 96, 0.5);
    color: #354052;
}

/* === 左侧概览区 === */
.steam-review-overview {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding-right: 20px;
    border-right: 1px solid #e3e9f1;
}

.steam-review-heading {
    display: flex;
    align-items: center;
    min-width: 0;
}

.steam-review-icon {
    display: inline-flex !important;
    flex: 0 0 40px;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: 11px;
    border: 1px solid #d5e1ee;
    border-radius: 11px;
    background: #eaf2fa;
    color: #4f779f;
    overflow: visible;
    text-decoration: none;
}

.steam-review-icon svg {
    display: block;
    width: 22px;
    height: 22px;
}

/* 评价等级徽章图标 */
.steam-review-level-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.steam-review-level-icon svg {
    display: block;
}

.steam-review-heading strong {
    display: block;
    color: #2d394a;
    font-size: 16px;
    font-weight: 700;
    line-height: 22px;
    white-space: nowrap;
}

.steam-review-heading small {
    display: block;
    color: #8a96a5;
    font-size: 13px;
    line-height: 20px;
}

/* 评价等级徽章 */
.steam-review-level {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 6px;
    min-height: 27px;
    margin: 10px 0 0 51px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    line-height: 27px;
}

.steam-review-level.is-positive {
    background: #e3f4ec;
    color: #2e8660;
}

.steam-review-level.is-mixed {
    background: #fff1d8;
    color: #a26c17;
}

.steam-review-level.is-negative {
    background: #f9e7e9;
    color: #bd545d;
}

/* === 右侧详情区 === */
.steam-review-detail {
    display: grid;
    grid-template-columns: minmax(225px, 0.9fr) minmax(260px, 1.2fr);
    gap: 18px;
    min-width: 0;
}

.steam-review-primary {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding-right: 18px;
    border-right: 1px solid #e3e9f1;
}

.steam-review-judgment {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

/* 综合评分 */
.steam-review-final-score {
    display: flex;
    align-items: baseline;
    gap: 7px;
    min-width: 0;
    white-space: nowrap;
}

.steam-review-final-score > strong {
    color: #356da8;
    font-size: 31px;
    font-weight: 800;
    line-height: 34px;
    letter-spacing: -0.04em;
}

.steam-review-final-score > span {
    display: flex;
    align-items: baseline;
    gap: 8px;
    color: #536174;
}

.steam-review-final-score b {
    color: #788595;
    font-size: 13px;
    font-weight: 600;
}

.steam-review-final-score small {
    font-size: 15px;
    font-weight: 700;
}

/* 好评率与评价数 */
.steam-review-rate {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 1px 0 0 !important;
    padding: 0 !important;
    min-width: 0;
    color: #748192;
    font-size: 14px;
    line-height: 21px;
    white-space: nowrap;
}

.steam-review-rate b {
    color: #536174;
    font-size: 14px;
    font-weight: 700;
}

.steam-review-primary > small {
    margin-top: 3px;
    color: #98a3b0;
    font-size: 12px;
    line-height: 19px;
    white-space: nowrap;
}

.steam-review-primary > small[hidden] {
    display: none !important;
}

/* 推荐语 */
.steam-review-verdict {
    margin: 0 0 10px !important;
    padding: 0 !important;
    color: #3d4a5c;
    font-size: 15px;
    font-weight: 700;
    line-height: 22px;
}

/* 口碑进度条 */
.steam-review-meter {
    position: relative;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e9cfd2;
}

.steam-review-meter span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #55b58b, #72c99f);
    transition: width 0.5s;
}

/* 好评/差评统计 */
.steam-review-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin: 8px 0 0 !important;
    padding: 0 !important;
    color: #7c8999;
    font-size: 13px;
    line-height: 20px;
}

.steam-review-meta b {
    color: #5c697a;
    font-size: 14px;
    font-weight: 700;
}

.steam-review-meta b.is-positive {
    color: #2f8a63;
}

.steam-review-meta b.is-negative {
    color: #c66068;
}

/* === 响应式 === */
@media screen and (max-width: 640px) {
    .steam-review-card {
        grid-template-columns: 1fr;
        gap: 13px;
        margin: 14px 0 18px;
        padding: 15px !important;
        border-radius: 12px;
    }

    /* 标题区：图标+标题在左，评价徽章在右（垂直居中） */
    .steam-review-overview {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 0 0 13px;
        border-right: none;
        border-bottom: 1px solid #e3e9f1;
    }

    .steam-review-icon {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
        margin-right: 9px;
    }

    .steam-review-icon svg {
        width: 20px;
        height: 20px;
    }

    .steam-review-heading strong {
        font-size: 16px;
    }

    .steam-review-heading small {
        font-size: 13px;
    }

    /* 评价徽章：在标题区右侧垂直居中 */
    .steam-review-level {
        flex: 0 0 auto;
        align-self: auto;
        min-height: 27px;
        margin: 0;
        padding: 0 9px;
        font-size: 13px;
    }

    /* 详情区：单列 */
    .steam-review-detail {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .steam-review-primary {
        position: relative;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        justify-content: flex-start;
        padding: 0 !important;
        margin: 0 !important;
        border-right: none;
        border-bottom: none;
    }

    .steam-review-judgment {
        margin: 0 !important;
        padding: 0 !important;
    }

    /* 评分 */
    .steam-review-final-score > strong {
        font-size: 34px;
        line-height: 37px;
    }

    .steam-review-final-score > span {
        display: flex;
        align-items: baseline;
        gap: 7px;
    }

    .steam-review-final-score b,
    .steam-review-final-score small {
        display: inline;
        line-height: 20px;
    }

    .steam-review-final-score small {
        font-size: 14px;
    }

    /* 好评率 */
    .steam-review-rate {
        flex-wrap: wrap;
        gap: 1px 7px;
        margin: 3px 0 0 !important;
        padding: 0 !important;
        font-size: 14px;
        line-height: 20px;
        white-space: normal;
    }

    /* 数据更新于：绝对定位在评分区右上角 */
    .steam-review-primary > small {
        position: absolute;
        top: 5px;
        right: 0;
        margin: 0 !important;
        padding: 0 !important;
        font-size: 11px;
    }

    /* 口碑推荐语 */
    .steam-review-verdict {
        margin: 0 0 9px !important;
        padding: 0 !important;
        font-size: 15px;
        line-height: 22px;
    }

    /* 好评/差评统计 */
    .steam-review-meta {
        gap: 4px 12px;
        margin: 8px 0 0 !important;
        padding: 0 !important;
        font-size: 13px;
    }

    .steam-review-meta b {
        font-size: 14px;
    }
}

/* === 深色模式（子比主题风格） === */
/* 子比主题暗黑模式: body.dark-theme + html.dark
   主背景 #292a2d，边框 #e5eef7，正文 #748192，标题 #e5eef7 */
body.dark-theme .steam-review-card,
html.dark .steam-review-card,
body.night .steam-review-card,
body.theme-dark .steam-review-card,
html.theme-dark .steam-review-card,
body.dark .steam-review-card {
    border-color: rgba(229, 238, 247, 0.15);
    background: rgba(255, 255, 255, 0.02);
    box-shadow: none;
    color: #748192;
}

body.dark-theme .steam-review-overview,
html.dark .steam-review-overview,
body.night .steam-review-overview,
body.theme-dark .steam-review-overview,
html.theme-dark .steam-review-overview,
body.dark .steam-review-overview {
    border-color: rgba(229, 238, 247, 0.15);
}

body.dark-theme .steam-review-icon,
html.dark .steam-review-icon,
body.night .steam-review-icon,
body.theme-dark .steam-review-icon,
html.theme-dark .steam-review-icon,
body.dark .steam-review-icon {
    border-color: rgba(229, 238, 247, 0.15);
    background: rgba(255, 255, 255, 0.04);
    color: #748192;
}

body.dark-theme .steam-review-heading strong,
html.dark .steam-review-heading strong,
body.night .steam-review-heading strong,
body.theme-dark .steam-review-heading strong,
html.theme-dark .steam-review-heading strong,
body.dark .steam-review-heading strong {
    color: #e5eef7;
}

body.dark-theme .steam-review-heading small,
html.dark .steam-review-heading small,
body.night .steam-review-heading small,
body.theme-dark .steam-review-heading small,
html.theme-dark .steam-review-heading small,
body.dark .steam-review-heading small,
body.dark-theme .steam-review-primary > small,
html.dark .steam-review-primary > small,
body.night .steam-review-primary > small,
body.theme-dark .steam-review-primary > small,
html.theme-dark .steam-review-primary > small,
body.dark .steam-review-primary > small,
body.dark-theme .steam-review-meta,
html.dark .steam-review-meta,
body.night .steam-review-meta,
body.theme-dark .steam-review-meta,
html.theme-dark .steam-review-meta,
body.dark .steam-review-meta {
    color: #748192;
}

body.dark-theme .steam-review-level.is-positive,
html.dark .steam-review-level.is-positive,
body.night .steam-review-level.is-positive,
body.theme-dark .steam-review-level.is-positive,
html.theme-dark .steam-review-level.is-positive,
body.dark .steam-review-level.is-positive {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

body.dark-theme .steam-review-level.is-mixed,
html.dark .steam-review-level.is-mixed,
body.night .steam-review-level.is-mixed,
body.theme-dark .steam-review-level.is-mixed,
html.theme-dark .steam-review-level.is-mixed,
body.dark .steam-review-level.is-mixed {
    background: rgba(234, 179, 8, 0.15);
    color: #facc15;
}

body.dark-theme .steam-review-level.is-negative,
html.dark .steam-review-level.is-negative,
body.night .steam-review-level.is-negative,
body.theme-dark .steam-review-level.is-negative,
html.theme-dark .steam-review-level.is-negative,
body.dark .steam-review-level.is-negative {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

body.dark-theme .steam-review-primary,
html.dark .steam-review-primary,
body.night .steam-review-primary,
body.theme-dark .steam-review-primary,
html.theme-dark .steam-review-primary,
body.dark .steam-review-primary {
    border-color: rgba(229, 238, 247, 0.15);
}

body.dark-theme .steam-review-final-score > strong,
html.dark .steam-review-final-score > strong,
body.night .steam-review-final-score > strong,
body.theme-dark .steam-review-final-score > strong,
html.theme-dark .steam-review-final-score > strong,
body.dark .steam-review-final-score > strong {
    color: #60a5fa;
}

body.dark-theme .steam-review-final-score > span,
html.dark .steam-review-final-score > span,
body.night .steam-review-final-score > span,
body.theme-dark .steam-review-final-score > span,
html.theme-dark .steam-review-final-score > span,
body.dark .steam-review-final-score > span,
body.dark-theme .steam-review-final-score b,
html.dark .steam-review-final-score b,
body.night .steam-review-final-score b,
body.theme-dark .steam-review-final-score b,
html.theme-dark .steam-review-final-score b,
body.dark .steam-review-final-score b {
    color: #748192;
}

body.dark-theme .steam-review-rate,
html.dark .steam-review-rate,
body.night .steam-review-rate,
body.theme-dark .steam-review-rate,
html.theme-dark .steam-review-rate,
body.dark .steam-review-rate {
    color: #748192;
}

body.dark-theme .steam-review-rate b,
html.dark .steam-review-rate b,
body.night .steam-review-rate b,
body.theme-dark .steam-review-rate b,
html.theme-dark .steam-review-rate b,
body.dark .steam-review-rate b,
body.dark-theme .steam-review-meta b,
html.dark .steam-review-meta b,
body.night .steam-review-meta b,
body.theme-dark .steam-review-meta b,
html.theme-dark .steam-review-meta b,
body.dark .steam-review-meta b {
    color: #e5eef7;
}

body.dark-theme .steam-review-verdict,
html.dark .steam-review-verdict,
body.night .steam-review-verdict,
body.theme-dark .steam-review-verdict,
html.theme-dark .steam-review-verdict,
body.dark .steam-review-verdict {
    color: #e5eef7;
}

body.dark-theme .steam-review-meter,
html.dark .steam-review-meter,
body.night .steam-review-meter,
body.theme-dark .steam-review-meter,
html.theme-dark .steam-review-meter,
body.dark .steam-review-meter {
    background: rgba(255, 255, 255, 0.08);
}

body.dark-theme .steam-review-meta b.is-positive,
html.dark .steam-review-meta b.is-positive,
body.night .steam-review-meta b.is-positive,
body.theme-dark .steam-review-meta b.is-positive,
html.theme-dark .steam-review-meta b.is-positive,
body.dark .steam-review-meta b.is-positive {
    color: #4ade80;
}

body.dark-theme .steam-review-meta b.is-negative,
html.dark .steam-review-meta b.is-negative,
body.night .steam-review-meta b.is-negative,
body.theme-dark .steam-review-meta b.is-negative,
html.theme-dark .steam-review-meta b.is-negative,
body.dark .steam-review-meta b.is-negative {
    color: #f87171;
}
