/* ==========================================================
   首页「学习排行榜」· 荣誉墙
   设计：前三名 = 三张金属质感名次卡（金/银/铜奖牌 + 顶部缎带条 + 头像光晕），
        4-10 名 = 带名次徽章的列表；配色沿用站内蓝 / 香槟金
   ========================================================== */

.lr-board {
    position: relative;
    background: #fff;
    border: 1px solid var(--rule, rgba(21, 33, 66, .1));
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(27, 36, 64, .04), 0 14px 30px -18px rgba(27, 36, 64, .28);
}

.lr-board [hidden] {
    display: none !important;
}

/* ---------- 顶部：标题 + 实时标记 + 双榜切换 ---------- */
.lr-top {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px 12px;
    background:
        radial-gradient(120% 180% at 0% 0%, rgba(245, 179, 53, .16), transparent 56%),
        linear-gradient(135deg, #f8fbff 0%, #fffdf7 100%);
    border-bottom: 1px solid var(--rule, rgba(21, 33, 66, .1));
}

.lr-kicker {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .6px;
    color: var(--gold, #b7791f);
}

.lr-live {
    flex: none;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .16);
    animation: lrPulse 2s ease-in-out infinite;
}

@keyframes lrPulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(34, 197, 94, .16); }
    50% { box-shadow: 0 0 0 5px rgba(34, 197, 94, .06); }
}

.lr-sub {
    margin: 3px 0 0;
    font-size: 10px;
    line-height: 1.4;
    color: var(--ink-3, #9aa6bf);
}

.lr-tabs {
    flex: none;
    display: flex;
    gap: 2px;
    padding: 3px;
    border-radius: 999px;
    background: #e9effb;
    border: 1px solid rgba(36, 86, 223, .10);
}

.lr-tab {
    appearance: none;
    border: 0;
    padding: 6px 13px;
    border-radius: 999px;
    background: transparent;
    color: #5a6680;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
    transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}

.lr-tab:hover {
    color: var(--brand, #2456df);
}

.lr-tab.is-active {
    background: #fff;
    color: var(--brand, #2456df);
    box-shadow: 0 2px 6px rgba(27, 36, 64, .14);
}

.lr-tab:focus-visible {
    outline: 2px solid var(--brand, #2456df);
    outline-offset: 2px;
}

/* ---------- 榜单主体 ---------- */
.lr-body {
    position: relative;
    padding: 2px 12px 12px;
    background: linear-gradient(180deg, #fbfdff 0%, #f2f6ff 100%);
}

/* 荣誉墙：窄屏第 1 名独占一行，2/3 名并排；≥640px 三张等宽 */
.lr-podium {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 14px 2px 0;
    align-items: stretch;
}

.lr-podium-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 8px 12px;
    overflow: hidden;
    border: 1px solid rgba(21, 33, 66, .07);
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 4px 14px -10px rgba(21, 33, 66, .4);
    animation: lrRise .45s ease both;
}

/* 顶部缎带条：银 / 金 / 铜 */
.lr-podium-item::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 3px;
    background: linear-gradient(90deg, rgba(182, 195, 216, .25), #b6c3d8 50%, rgba(182, 195, 216, .25));
}

.lr-podium-item.is-1 {
    grid-column: 1 / -1;
    order: 1;
    border-color: rgba(240, 174, 47, .5);
    background: linear-gradient(180deg, #fffdf4 0%, #fff 62%);
    box-shadow:
        inset 0 0 0 1px rgba(240, 174, 47, .16),
        0 12px 28px -20px rgba(183, 121, 31, .95);
}

.lr-podium-item.is-1::before {
    background: linear-gradient(90deg, rgba(240, 174, 47, .25), #f0ae2f 22%, #ffd98a 50%, #f0ae2f 78%, rgba(240, 174, 47, .25));
}

.lr-podium-item.is-2 {
    order: 2;
}

.lr-podium-item.is-3 {
    order: 3;
    border-color: rgba(196, 130, 79, .38);
    background: linear-gradient(180deg, #fffcf8 0%, #fff 60%);
}

.lr-podium-item.is-3::before {
    background: linear-gradient(90deg, rgba(196, 130, 79, .22), #c4824f 50%, rgba(196, 130, 79, .22));
}

/* 不足 3 人时按自然顺序并排，不让第 1 名独占一行 */
.lr-podium.is-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lr-podium.is-pair .lr-podium-item {
    grid-column: auto;
    order: 0;
}

@keyframes lrRise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

/* 名次奖牌：借用原「台阶」节点，移到卡片最上方 */
.lr-stand {
    order: -1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 28px;
    height: 28px;
    margin: 0 0 8px;
    border: 1.5px solid rgba(255, 255, 255, .9);
    border-radius: 50%;
    background: linear-gradient(170deg, #f4f8ff, #b6c3d8);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 4px 10px -6px rgba(21, 33, 66, .65);
    color: #3f4d68;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1;
}

.lr-podium-item.is-1 .lr-stand {
    width: 34px;
    height: 34px;
    background: linear-gradient(170deg, #ffe9a6, #f0ae2f 68%, #d99a1e);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 6px 14px -6px rgba(183, 121, 31, .85);
    color: #5a3a05;
    font-size: 12px;
}

.lr-podium-item.is-3 .lr-stand {
    background: linear-gradient(170deg, #f9dfc9, #c4824f 70%, #a9693c);
    color: #4a2712;
}

/* 头像：名次色描边 + 光晕 */
.lr-podium-ava {
    position: relative;
    flex: none;
    width: 50px;
    height: 50px;
    margin-bottom: 6px;
    padding: 2.5px;
    border-radius: 50%;
    background: linear-gradient(145deg, #eef3fb, #c9d5e8);
    box-shadow: 0 6px 14px -8px rgba(21, 33, 66, .55);
}

.lr-podium-item.is-1 .lr-podium-ava {
    width: 62px;
    height: 62px;
    background: linear-gradient(145deg, #ffe9a6, #f0ae2f);
    box-shadow: 0 0 0 3px rgba(240, 174, 47, .16), 0 10px 20px -8px rgba(183, 121, 31, .8);
}

.lr-podium-item.is-3 .lr-podium-ava {
    background: linear-gradient(145deg, #f9dfc9, #c4824f);
}

.lr-podium-ava img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #fff;
    background: #eef3ff;
    object-fit: cover;
}

.lr-crown {
    position: absolute;
    top: -11px;
    right: -8px;
    left: auto;
    z-index: 3;
    transform: rotate(12deg);
    color: #f0ae2f;
    font-size: 13px;
    /* 双层白色描边，避免金色皇冠压在金色头像环上看不清 */
    filter: drop-shadow(0 0 1.5px #fff) drop-shadow(0 0 1.5px #fff) drop-shadow(0 1px 2px rgba(120, 80, 10, .5));
}

.lr-podium-name {
    max-width: 100%;
    color: var(--ink, #152142);
    font-size: 11.5px;
    font-weight: 800;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lr-podium-time {
    max-width: 100%;
    margin-top: 2px;
    color: var(--brand, #2456df);
    font-size: 13px;
    font-weight: 900;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.lr-podium-item.is-1 .lr-podium-time {
    color: var(--gold, #b7791f);
    font-size: 16px;
}

.lr-podium-total {
    max-width: 100%;
    margin-top: 1px;
    color: var(--ink-3, #9aa6bf);
    font-size: 9px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- 第 4 名以后 ---------- */
.lr-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 10px 0 0;
    padding: 0;
}

.lr-row {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 10px;
    border-radius: 12px;
    border: 1px solid rgba(21, 33, 66, .06);
    background: #fff;
    box-shadow: 0 2px 6px -5px rgba(21, 33, 66, .32);
}

.lr-no {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    background: #eef2fa;
    box-shadow: inset 0 0 0 1px rgba(21, 33, 66, .05);
    color: #63718c;
    font-size: 10.5px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.lr-row-ava {
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid #fff;
    background: #eef3ff;
    box-shadow: 0 0 0 1px #e4ebf8;
    object-fit: cover;
}

.lr-user {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.lr-user b {
    color: var(--ink, #152142);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lr-user span {
    color: var(--ink-3, #9aa6bf);
    font-size: 9px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lr-period {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    text-align: right;
}

.lr-period b {
    color: var(--brand, #2456df);
    font-size: 12.5px;
    font-weight: 900;
    line-height: 1.25;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.lr-period span {
    color: var(--ink-3, #9aa6bf);
    font-size: 8.5px;
    line-height: 1.2;
}

/* ---------- 底部 ---------- */
.lr-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 14px;
    border-top: 1px solid var(--rule, rgba(21, 33, 66, .1));
    background: #fff;
    color: var(--ink-3, #9aa6bf);
    font-size: 9.5px;
}

.lr-refresh {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 0;
    border: 0;
    background: transparent;
    color: var(--ink-3, #9aa6bf);
    font: inherit;
    font-size: 9.5px;
    cursor: pointer;
    transition: color .16s ease;
}

.lr-refresh:hover {
    color: var(--brand, #2456df);
}

.lr-refresh i {
    font-size: 9px;
    transition: transform .3s ease;
}

.lr-refresh.is-loading i {
    animation: lrSpin .8s linear infinite;
}

@keyframes lrSpin {
    to { transform: rotate(360deg); }
}

.lr-note {
    text-align: right;
    line-height: 1.35;
}

/* ---------- 加载骨架 ---------- */
.lr-loading {
    padding: 14px 0 0;
}

.lr-skel-podium {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 0 2px;
    align-items: stretch;
}

.lr-skel-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 8px 12px;
    border-radius: 15px;
    background: linear-gradient(180deg, #f9fbff, #f2f6fd);
}

.lr-skel-col:first-child {
    grid-column: 1 / -1;
}

.lr-skel-ava {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-bottom: 8px;
}

.lr-skel-col:first-child .lr-skel-ava {
    width: 62px;
    height: 62px;
}

.lr-skel-line {
    width: 68%;
    height: 9px;
    border-radius: 6px;
    margin-bottom: 6px;
}

.lr-skel-row {
    height: 46px;
    margin-top: 6px;
    border-radius: 12px;
}

.lr-skel-ava,
.lr-skel-line,
.lr-skel-row {
    background: linear-gradient(90deg, #edf2fb 25%, #f9fbff 37%, #edf2fb 63%);
    background-size: 400% 100%;
    animation: lrShimmer 1.3s ease infinite;
}

@keyframes lrShimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* ---------- 空态 / 错误态 ---------- */
.lr-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 18px 24px;
    text-align: center;
}

.lr-empty-ico {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin-bottom: 12px;
    border-radius: 50%;
    background: linear-gradient(150deg, #fff6da, #ffe9a8);
    box-shadow: inset 0 1px 0 #fff, 0 8px 18px -10px rgba(183, 121, 31, .5);
    color: #c98a1b;
    font-size: 24px;
}

.lr-empty b {
    color: var(--ink, #152142);
    font-size: 13px;
    font-weight: 800;
}

.lr-empty p {
    margin: 4px 0 0;
    color: var(--ink-3, #9aa6bf);
    font-size: 10.5px;
    line-height: 1.55;
}

.lr-empty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    margin-top: 12px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, #4a7bf0, #2456df);
    box-shadow: 0 6px 14px -8px rgba(22, 56, 168, .65);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.lr-empty-btn:active {
    transform: scale(.97);
}

/* ---------- 超窄屏 ---------- */
@media (max-width: 379px) {
    .lr-top {
        padding: 12px 12px 10px;
        gap: 8px;
    }

    .lr-sub {
        font-size: 9px;
    }

    .lr-tab {
        padding: 5px 10px;
        font-size: 10px;
    }

    .lr-body {
        padding: 0 9px 10px;
    }

    .lr-podium {
        gap: 6px;
        padding-top: 12px;
    }

    .lr-podium-item {
        padding: 13px 6px 10px;
        border-radius: 13px;
    }

    .lr-stand {
        width: 24px;
        height: 24px;
        margin-bottom: 6px;
        font-size: 10px;
    }

    .lr-podium-item.is-1 .lr-stand {
        width: 29px;
        height: 29px;
        font-size: 11px;
    }

    .lr-podium-ava {
        width: 44px;
        height: 44px;
        margin-bottom: 5px;
    }

    .lr-podium-item.is-1 .lr-podium-ava {
        width: 56px;
        height: 56px;
    }

    .lr-crown {
        top: -9px;
        right: -6px;
        font-size: 11px;
    }

    .lr-podium-name {
        font-size: 10.5px;
    }

    .lr-podium-time {
        font-size: 12px;
    }

    .lr-podium-item.is-1 .lr-podium-time {
        font-size: 14.5px;
    }

    .lr-podium-total {
        font-size: 8px;
    }

    .lr-row {
        gap: 7px;
        padding: 6px 8px;
    }

    .lr-row-ava {
        width: 28px;
        height: 28px;
    }

    .lr-user b {
        font-size: 11.5px;
    }

    .lr-period b {
        font-size: 11.5px;
    }

    .lr-foot {
        padding: 8px 11px;
        font-size: 8.5px;
    }

    .lr-refresh {
        font-size: 8.5px;
    }

    .lr-note {
        max-width: 62%;
    }

    .lr-skel-podium {
        gap: 6px;
    }

    .lr-skel-col {
        padding: 13px 6px 10px;
        border-radius: 13px;
    }

    .lr-skel-ava {
        width: 44px;
        height: 44px;
    }

    .lr-skel-col:first-child .lr-skel-ava {
        width: 56px;
        height: 56px;
    }
}

/* ---------- 桌面：三张等宽荣誉卡 ---------- */
@media (min-width: 640px) {
    .lr-board {
        border-radius: 22px;
    }

    .lr-top {
        padding: 17px 20px 14px;
    }

    .lr-kicker {
        font-size: 12px;
    }

    .lr-sub {
        font-size: 10.5px;
    }

    .lr-tab {
        padding: 7px 16px;
        font-size: 12px;
    }

    .lr-body {
        padding: 2px 16px 14px;
    }

    .lr-podium {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
        padding: 18px 4px 0;
    }

    .lr-podium-item {
        padding: 20px 12px 15px;
        border-radius: 17px;
    }

    .lr-podium-item.is-1 {
        grid-column: auto;
    }

    .lr-stand {
        width: 32px;
        height: 32px;
        margin-bottom: 10px;
        font-size: 12px;
    }

    .lr-podium-item.is-1 .lr-stand {
        width: 38px;
        height: 38px;
        font-size: 13px;
    }

    .lr-podium-ava {
        width: 60px;
        height: 60px;
        margin-bottom: 7px;
    }

    .lr-podium-item.is-1 .lr-podium-ava {
        width: 74px;
        height: 74px;
    }

    .lr-crown {
        font-size: 15px;
    }

    .lr-podium-name {
        font-size: 13px;
    }

    .lr-podium-time {
        font-size: 15px;
    }

    .lr-podium-item.is-1 .lr-podium-time {
        font-size: 18px;
    }

    .lr-podium-total {
        font-size: 9.5px;
    }

    .lr-list {
        gap: 7px;
        margin-top: 12px;
    }

    .lr-row {
        gap: 11px;
        padding: 9px 14px;
        border-radius: 13px;
    }

    .lr-no {
        width: 24px;
        height: 24px;
        font-size: 11.5px;
    }

    .lr-row-ava {
        width: 36px;
        height: 36px;
    }

    .lr-user b {
        font-size: 13px;
    }

    .lr-user span {
        font-size: 10px;
    }

    .lr-period b {
        font-size: 14px;
    }

    .lr-period span {
        font-size: 9px;
    }

    .lr-foot {
        padding: 11px 20px;
        font-size: 10.5px;
    }

    .lr-refresh {
        font-size: 10.5px;
    }

    .lr-skel-podium {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
        padding: 0 4px;
    }

    .lr-skel-col:first-child {
        grid-column: auto;
    }

    .lr-skel-col {
        padding: 20px 12px 15px;
        border-radius: 17px;
    }

    .lr-skel-ava {
        width: 60px;
        height: 60px;
    }

    .lr-skel-col:first-child .lr-skel-ava {
        width: 74px;
        height: 74px;
    }
}
