/* 等级达标活动 — 新设计布局（与旧 gift 样式独立） */

html {
    /* 覆盖 base.css 的 height:100%，否则 html 仅一屏高，::after 无法铺满长文档，底部只剩纯色 */
    position: relative;
    min-height: 100%;
    height: auto;
    background-color: #0b1f4a;
    /* 预留滚动条槽位，缩小 100vw 与背景定位区域宽度的偏差 */
    scrollbar-gutter: stable;
    isolation: isolate;
}

/*
 * 主视觉在 html::before；长页向下用 bg-repeat-y.png 纵向拼接（tile 须上下可无缝）。
 * body 整块叠在 z-index:0 的伪元素之上，且背景透明才能看到 html 底层图。
 *
 * 主图高度须与 background-size:100% auto 同一宽度基准：用 padding-bottom（% 相对包含块宽度）。
 * 桌面优先用 100cqw（与布局宽一致）；勿用 100vw 当主图高 —— 与 100% 宽差滚动条时会产生与 repeat 层的横缝或 repeat 内部露底。
 */
html::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 0;
    /* 与 background-size:100% 同基准；无 cqw 时先用 vw 近似，由 @supports 升级为 cqw */
    padding-bottom: max(280px, calc(100vw * 2484 / 1920));
    box-sizing: border-box;
    z-index: 0;
    pointer-events: none;
    background: url("../images/bg.png") no-repeat center top;
    background-size: 100% auto;
}

html::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: max(280px, calc(100vw * 2484 / 1920));
    /* 与主图区轻微重叠，消除分界线亚像素露底 */
    margin-top: -3px;
    padding-top: 3px;
    box-sizing: border-box;
    bottom: 0;
    z-index: 0;
    pointer-events: none;
    background-color: #0b1f4a;
    background-image: url("../images/bg-repeat-y.png");
    background-repeat: repeat-y;
    background-position: center top;
    /* 1920×243：高度 = 宽×243/1920；+1px 减轻 repeat-y 舍入导致的横向「死带」 */
    background-size: 100% calc(100vw * 243 / 1920 + 1px);
}

@supports (width: 1cqw) {
    html {
        container-type: inline-size;
    }

    html::before {
        padding-bottom: max(280px, calc(100cqw * 2484 / 1920));
    }

    html::after {
        top: max(280px, calc(100cqw * 2484 / 1920));
        background-size: 100% calc(100cqw * 243 / 1920 + 1px);
    }
}

body.lr-body {
    margin: 0;
    /* 覆盖 base.css 的 height:100%，与 html 一起随内容增高，否则伪元素背景铺不满长页 */
    height: auto;
    min-height: 100vh;
    color: #fff;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    font-size: 0.22rem;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    position: relative;
    z-index: 1;
    background: transparent;
    background-image: none;
}

.lr-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.lr-page {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 12rem;
    margin: 0 auto;
    padding: 0 clamp(12px, 3.6vw, 20px) 0.8rem;
    box-sizing: border-box;
}

.lr-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin: 30px auto 0;
    padding: 0.24rem 0.4rem 0.1rem;
    box-sizing: border-box;
}

.lr-logo {
    display: block;
    /* width: 2.1rem; */
    height: auto;
    max-height: 1.5rem;
    object-fit: contain;
    margin-top: -0.2rem;
}

.lr-btn-site {
    display: inline-block;
    line-height: 0;
    flex-shrink: 0;
    text-decoration: none;
}

.lr-btn-site__img {
    display: block;
    width: auto;
    height: 0.44rem;
    max-width: min(100%, 3rem);
}

.lr-btn-site__img--hover {
    display: none;
}

.lr-btn-site:hover .lr-btn-site__img--default,
.lr-btn-site:focus-visible .lr-btn-site__img--default {
    display: none;
}

.lr-btn-site:hover .lr-btn-site__img--hover,
.lr-btn-site:focus-visible .lr-btn-site__img--hover {
    display: block;
}

.lr-main-hero-titles {
    text-align: center;
    margin: 0 0 0.4rem;
}

.lr-main-title-img,
.lr-main-subtitle-img {
    display: block;
    max-width: 100%;
    height: auto;
    margin-left: auto;
    margin-right: auto;
}

.lr-main-subtitle-img {
    margin-top: 0.16rem;
}

.lr-hero-spacer {
    height: clamp(220px, 36vh, 420px);
    pointer-events: none;
}

.lr-tagline {
    text-align: center;
    font-size: 0.2rem;
    color: rgba(255, 255, 255, 0.92);
    margin: 0 0 0.32rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.lr-login-row {
    text-align: center;
    font-size: 0.26rem;
    margin-bottom: 0.48rem;
    color: #fff;
}

.lr-login-row .lr-link-login {
    color: #ffd66b;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 0.08em;
    font-weight: 600;
}

.lr-user-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    column-gap: 0.32rem;
    row-gap: 0.12rem;
    text-align: center;
    margin-bottom: 0.36rem;
    font-size: 0.22rem;
}

.lr-user-account {
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 0;
}

.lr-user-role {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.2rem;
    margin-bottom: 0;
}

.lr-user-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.24rem;
}

.lr-text-btn {
    background: transparent;
    border: none;
    padding: 0;
    color: #7ecbff;
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
}

.lr-text-btn:hover {
    color: #ffd66b;
}

.lr-section-head {
    text-align: center;
    margin-bottom: 0.36rem;
}

.lr-section-head__img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto 0.2rem;
}

.lr-times {
    text-align: center;
    font-size: 0.2rem;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.7;
    margin-bottom: 0.48rem;
}

.lr-times p {
    margin: 0.06rem 0;
}

.lr-tiers {
    display: flex;
    flex-direction: column;
    gap: 0.56rem;
    margin-bottom: 0.28rem;
}

.lr-global-claim-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.56rem;
}

.lr-tier {
    position: relative;
    border-radius: 0.16rem;
    padding: 0.32rem 0.28rem;
    background: url("../images/文本框.png") center / 100% 100% no-repeat;
    border: none;
    box-shadow: none;
}

.lr-tier-title {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.1rem;
    margin: 0 0 0.28rem;
    font-size: 0.22rem;
    font-weight: 500;
    color: #3d2910;
    text-align: center;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.lr-tier-title__text {
    flex: 0 1 auto;
}

.lr-tier-star {
    width: 0.28rem;
    height: 0.28rem;
    object-fit: contain;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

.lr-reward-grid {
    display: grid;
    /* 列数由 JS 按 levelPrizeList 长度设置 grid-template-columns */
    gap: 0.16rem;
    max-width: 9.2rem;
    margin: 0 auto 0.2rem;
}

.lr-reward-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
}

.lr-reward-box {
    width: 100%;
    aspect-ratio: 1;
    max-width: 1.28rem;
    margin: 0 auto;
    border: none;
    border-radius: 0;
    background: url("../images/道具框.png") center / 100% 100% no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.lr-reward-box img {
    width: 72%;
    height: 72%;
    object-fit: contain;
}

.lr-reward-name {
    font-size: 0.16rem;
    color: #3d2910;
    text-align: center;
    min-height: 0.44rem;
    width: 100%;
    word-break: break-all;
}

.lr-claim-wrap {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translate(-50%, 50%);
}

.lr-claim-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: auto;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    line-height: 0;
    box-shadow: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.lr-claim-btn__visual {
    position: relative;
    display: inline-block;
    line-height: 0;
}

.lr-claim-btn__visual img {
    display: block;
    height: 0.56rem;
    width: auto;
    max-width: 4.8rem;
    object-fit: contain;
}

.lr-claim-btn.is-ready .lr-claim-face--hover {
    display: none;
}

.lr-claim-btn.is-ready:hover:not(:disabled) .lr-claim-face--normal,
.lr-claim-btn.is-ready:focus-visible:not(:disabled) .lr-claim-face--normal {
    display: none;
}

.lr-claim-btn.is-ready:hover:not(:disabled) .lr-claim-face--hover,
.lr-claim-btn.is-ready:focus-visible:not(:disabled) .lr-claim-face--hover {
    display: block;
}

.lr-claim-btn:disabled {
    cursor: not-allowed;
}

.lr-claim-btn.is-idle:disabled,
.lr-claim-btn.is-done:disabled {
    opacity: 1;
}

.lr-claim-btn.is-done:disabled {
    cursor: default;
}

.lr-rules {
    margin: 0 auto;
    padding: 0.24rem;
    border-radius: 0.12rem;
    /* background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.12); */
}

.lr-rules h3 {
    margin: 0 0 0.16rem;
    font-size: 0.24rem;
    color: #fff;
}

.lr-rules ol {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.2rem;
    line-height: 1.75;
}

.lr-rules li {
    margin-bottom: 0.12rem;
}

#rule-dialog .mod-dialog-main {
    width: min(9rem, 92vw);
    max-height: 80vh;
    overflow: auto;
    background: linear-gradient(180deg, #1a2f5f 0%, #0f1f44 100%);
    border: 1px solid rgba(212, 175, 55, 0.45);
}

#rule-dialog .mod-dialog-content {
    padding: 0.44rem;
    color: #fff;
}

#rule-dialog .lr-rules {
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
}

#rule-dialog .mod-dialog-close1 img {
    opacity: 0;
    width: 0.36rem;
    height: 0.36rem;
}

#rule-dialog .mod-dialog-close1 {
    position: relative !important;
    margin: 0.2rem !important;
    width: 0.44rem !important;
    height: 0.44rem !important;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
}

#rule-dialog .mod-dialog-close1::after {
    content: '\00d7';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -54%);
    font-size: 0.34rem;
    color: #fff;
    line-height: 1;
}

/* 领取记录弹窗 */
#records-dialog .mod-dialog-main {
    width: min(11rem, 94vw);
    max-height: 80vh;
    overflow: auto;
    background: linear-gradient(180deg, #1a2f5f 0%, #0f1f44 100%);
    border: 1px solid rgba(212, 175, 55, 0.45);
}

#records-dialog .mod-dialog-content {
    padding: 0.4rem;
    color: #fff;
}

#records-dialog .mod-dialog-close1 img {
    opacity: 0;
    width: 0.36rem;
    height: 0.36rem;
}

#records-dialog .mod-dialog-close1 {
    position: relative !important;
    margin: 0.2rem !important;
    width: 0.44rem !important;
    height: 0.44rem !important;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
}

#records-dialog .mod-dialog-close1::after {
    content: '\00d7';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -54%);
    font-size: 0.34rem;
    color: #fff;
    line-height: 1;
}

.lr-records-title {
    font-size: 0.28rem;
    margin: 0 0 0.24rem;
    text-align: center;
    color: #ffd66b;
}

.lr-records-empty {
    text-align: center;
    opacity: 0.8;
    padding: 0.4rem 0;
}

.lr-records-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.18rem;
}

.lr-records-table th,
.lr-records-table td {
    padding: 0.12rem 0.1rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    text-align: center;
}

.lr-records-table th {
    background: rgba(0, 0, 0, 0.25);
    color: #ffd66b;
}

@media screen and (max-width: 768px) {
    .lr-page {
        max-width: none;
        width: 100%;
        padding-left: clamp(14px, 4vw, 20px);
        padding-right: clamp(14px, 4vw, 20px);
        padding-bottom: 0.64rem;
    }

    html::before {
        padding-bottom: clamp(220px, 34vh, 380px);
    }

    html::after {
        top: clamp(220px, 34vh, 380px);
        background-size: 100% calc(100% * 243 / 1920 + 1px);
    }

    body.lr-body {
        font-size: 0.26rem;
    }

    .lr-header {
        margin-top: 12px;
        padding-left: 0;
        padding-right: 0;
        padding-top: 0.16rem;
    }

    .lr-logo {
        width: min(2.05rem, 34vw);
        max-height: 0.68rem;
    }

    .lr-btn-site__img {
        height: 0.34rem;
        max-height: 30px;
    }

    .lr-main-hero-titles {
        margin-bottom: 0.32rem;
    }

    .lr-hero-spacer {
        height: clamp(120px, 22vh, 200px);
    }

    .lr-login-row {
        font-size: 0.3rem;
        margin-bottom: 0.36rem;
    }

    .lr-user-row {
        font-size: 0.24rem;
        row-gap: 0.12rem;
        margin-bottom: 0.28rem;
    }

    .lr-user-role {
        font-size: 0.22rem;
    }

    .lr-text-btn {
        font-size: 0.24rem;
    }

    .lr-section-head {
        margin-bottom: 0.28rem;
    }

    .lr-section-head__img {
        margin-bottom: 0.16rem;
    }

    .lr-times {
        font-size: 0.18rem;
        margin-bottom: 0.36rem;
    }

    .lr-times p {
        margin: 0.08rem 0;
    }

    .lr-tiers {
        gap: 0.44rem;
        margin-bottom: 0.24rem;
    }

    .lr-global-claim-wrap {
        margin-bottom: 0.48rem;
    }

    .lr-tier {
        padding: 0.26rem clamp(0.1rem, 2vw, 0.2rem);
    }

    .lr-tier-title {
        font-size: 0.18rem;
        line-height: 1.35;
        margin-bottom: 0.18rem;
        gap: 0.05rem;
    }

    .lr-tier-star {
        display: none;
    }

    /* 保持与 JS 内联相同的列数，单行显示；仅收紧间距与格子尺寸 */
    .lr-reward-grid {
        max-width: 100% !important;
        width: 100%;
        gap: 0.06rem !important;
        margin-bottom: 0.12rem;
    }

    .lr-reward-cell {
        gap: 0.06rem;
        min-width: 0;
    }

    .lr-reward-box {
        max-width: 0.82rem;
        width: 100%;
        margin-left: auto;
        margin-right: auto;
        aspect-ratio: 1;
    }

    .lr-reward-box img {
        width: 62%;
        height: 62%;
    }

    .lr-reward-name {
        font-size: 0.15rem;
        min-height: 0.36rem;
        line-height: 1.18;
    }

    .lr-claim-btn__visual img {
        height: max(0.72rem, 40px);
        max-width: min(5.6rem, 92vw);
    }

    .lr-rules {
        padding: 0.28rem 0 0;
        max-width: 100%;
    }

    .lr-rules h3 {
        font-size: 0.22rem;
        margin-bottom: 0.14rem;
    }

    .lr-rules ol {
        font-size: 0.19rem;
        line-height: 1.52;
        padding-left: 0.32rem;
    }

    .lr-rules li {
        margin-bottom: 0.1rem;
    }
}

