/* =========================================================
   Steam Game Rating Widget v2.3 — 细横条横幅样式
   扁长 ribbon 风格，桌面/平板/手机自适应
   ========================================================= */

.sgr-widget {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    max-width: 900px;
    margin: 16px auto;
    padding: 8px 12px;
    border-radius: 8px;
    line-height: 1.4;
    box-sizing: border-box;
}

.sgr-widget *,
.sgr-widget *::before,
.sgr-widget *::after {
    box-sizing: border-box;
}

.sgr-theme-dark {
    background: #161b22;
    color: #c9d1d9;
}

.sgr-theme-light {
    background: #f6f8fa;
    color: #24292f;
}

/* ---------- 顶部元信息行（紧凑） ---------- */
.sgr-header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    margin-bottom: 8px;
    padding: 2px 0;
}

.sgr-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin: 0 3px 0 5px;
    flex-shrink: 0;
}

.sgr-dot-blue  { background: #58a6ff; }
.sgr-dot-red   { background: #f85149; }

.sgr-meta-label { opacity: 0.65; }
.sgr-meta-value { font-weight: 500; }

/* =========================================================
   主横条 — 扁长横幅
   ========================================================= */
.sgr-card {
    display: flex;
    align-items: stretch;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid;
    height: 80px;
}

.sgr-theme-dark .sgr-card {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}

.sgr-theme-light .sgr-card {
    background: #ffffff;
    border-color: #d0d7de;
}

/* ---------- 封面图（左侧，按高度撑满） ---------- */
.sgr-cover {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: #0d1117;
}

.sgr-cover img {
    height: 100%;
    width: auto;
    max-width: 180px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.sgr-cover:hover img {
    transform: scale(1.04);
}

/* ---------- 内容区：单行横排 ---------- */
.sgr-card-body {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 16px;
    min-width: 0;
    overflow: hidden;
}

/* ---------- 区块1：Steam 图标 + 标签 ---------- */
.sgr-card-left {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-right: 14px;
    border-right: 1px solid;
}

.sgr-theme-dark .sgr-card-left {
    border-color: rgba(255, 255, 255, 0.1);
}

.sgr-theme-light .sgr-card-left {
    border-color: #d0d7de;
}

.sgr-steam-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sgr-theme-dark .sgr-steam-icon {
    background: rgba(88, 166, 255, 0.12);
    color: #58a6ff;
}

.sgr-theme-light .sgr-steam-icon {
    background: #ddf4ff;
    color: #0969da;
}

.sgr-review-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 2px;
    white-space: nowrap;
}

.sgr-theme-dark .sgr-review-title { color: #f0f6fc; }
.sgr-theme-light .sgr-review-title { color: #1f2328; }

.sgr-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(63, 185, 80, 0.18);
    color: #3fb950;
    white-space: nowrap;
}

.sgr-theme-light .sgr-badge {
    background: #dafbe1;
    color: #1a7f37;
}

/* ---------- 区块2：评分 + 好评率 ---------- */
.sgr-card-middle {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 14px;
    border-right: 1px solid;
}

.sgr-theme-dark .sgr-card-middle {
    border-color: rgba(255, 255, 255, 0.1);
}

.sgr-theme-light .sgr-card-middle {
    border-color: #d0d7de;
}

.sgr-score-row {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.sgr-score {
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
}

.sgr-theme-dark .sgr-score { color: #58a6ff; }
.sgr-theme-light .sgr-score { color: #0969da; }

.sgr-score-total {
    font-size: 12px;
    opacity: 0.6;
}

.sgr-score-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.15);
}

.sgr-theme-light .sgr-score-divider {
    background: #d0d7de;
}

.sgr-pct-block {
    display: flex;
    flex-direction: column;
}

.sgr-pct-row {
    font-size: 12px;
    opacity: 0.7;
}

.sgr-pct-row strong {
    font-size: 15px;
    font-weight: 700;
}

.sgr-theme-dark .sgr-pct-row strong { color: #f0f6fc; }
.sgr-theme-light .sgr-pct-row strong { color: #1f2328; }

.sgr-count-row {
    font-size: 11px;
    opacity: 0.55;
}

/* ---------- 区块3：描述 + 进度条 + 统计 ---------- */
.sgr-card-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    overflow: hidden;
}

.sgr-desc {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sgr-theme-dark .sgr-desc { color: #f0f6fc; }
.sgr-theme-light .sgr-desc { color: #1f2328; }

.sgr-progress-bar {
    width: 100%;
    height: 5px;
    border-radius: 3px;
    overflow: hidden;
}

.sgr-theme-dark .sgr-progress-bar {
    background: rgba(248, 81, 73, 0.35);
}

.sgr-theme-light .sgr-progress-bar {
    background: #ffebe9;
}

.sgr-progress-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #3fb950, #56d364);
    transition: width 0.6s ease;
}

.sgr-theme-light .sgr-progress-fill {
    background: linear-gradient(90deg, #1a7f37, #2da44e);
}

.sgr-stats-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 3px 10px;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
}

.sgr-stat-item {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
}

.sgr-stat-label { opacity: 0.6; }
.sgr-stat-positive { color: #3fb950; font-weight: 700; }
.sgr-stat-negative { color: #f85149; font-weight: 700; }
.sgr-stat-total { font-weight: 700; }
.sgr-stat-adjusted { font-weight: 700; }

.sgr-theme-light .sgr-stat-positive { color: #1a7f37; }
.sgr-theme-light .sgr-stat-negative { color: #cf222e; }

/* ---------- 底部游戏名 + 价格 ---------- */
.sgr-game-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
    padding: 0 4px;
    font-size: 12px;
}

.sgr-game-name {
    text-decoration: none;
    font-weight: 600;
}

.sgr-theme-dark .sgr-game-name { color: #58a6ff; }
.sgr-theme-light .sgr-game-name { color: #0969da; }
.sgr-game-name:hover { text-decoration: underline; }
.sgr-price { opacity: 0.6; font-weight: 500; }

/* ---------- 错误提示 ---------- */
.sgr-error {
    padding: 12px;
    border-radius: 6px;
    background: rgba(248, 81, 73, 0.1);
    color: #f85149;
    text-align: center;
    font-size: 13px;
}

/* =========================================================
   平板（768–1024px）
   ========================================================= */
@media (max-width: 1024px) {
    .sgr-card { height: 72px; }
    .sgr-card-body { padding: 0 12px; gap: 12px; }
    .sgr-card-left { padding-right: 10px; gap: 6px; }
    .sgr-card-middle { padding-right: 10px; gap: 8px; }
    .sgr-cover img { max-width: 140px; }
    .sgr-score { font-size: 22px; }
    .sgr-desc { font-size: 12px; }
    .sgr-stats-row { font-size: 10px; gap: 2px 8px; }
}

/* =========================================================
   手机（<768px）：纵向堆叠
   ========================================================= */
@media (max-width: 767px) {
    .sgr-widget {
        padding: 8px 10px;
        margin: 10px 0;
        border-radius: 8px;
    }

    .sgr-header-row {
        font-size: 11px;
        margin-bottom: 6px;
    }

    .sgr-dot { width: 5px; height: 5px; margin: 0 2px 0 4px; }

    .sgr-card {
        flex-direction: column;
        height: auto;
    }

    .sgr-cover {
        width: 100%;
        height: 100px;
    }

    .sgr-cover img {
        width: 100%;
        height: 100%;
        max-width: none;
        object-fit: cover;
    }

    .sgr-card-body {
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        gap: 0;
    }

    .sgr-card-left,
    .sgr-card-middle {
        border-right: none;
        border-bottom: 1px solid;
        padding: 8px 0;
    }

    .sgr-theme-dark .sgr-card-left,
    .sgr-theme-dark .sgr-card-middle {
        border-color: rgba(255, 255, 255, 0.1);
    }

    .sgr-theme-light .sgr-card-left,
    .sgr-theme-light .sgr-card-middle {
        border-color: #d0d7de;
    }

    .sgr-card-right {
        padding-top: 10px;
        gap: 6px;
    }

    .sgr-score { font-size: 28px; }
    .sgr-desc { white-space: normal; }
    .sgr-stats-row { flex-wrap: wrap; font-size: 11px; }

    .sgr-game-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
        font-size: 11px;
    }
}

/* =========================================================
   超小屏（<380px）
   ========================================================= */
@media (max-width: 380px) {
    .sgr-cover { height: 80px; }
    .sgr-score { font-size: 24px; }
    .sgr-stats-row { font-size: 10px; gap: 2px 6px; }
}

/* =========================================================
   无封面时
   ========================================================= */
.sgr-widget:not(.sgr-has-cover) .sgr-cover {
    display: none;
}
