/* style.css 兼容性增强版（v9：按钮配色调换 + PC 图标统一红色） */
/* style.css */
/* ============================================================
 * Toy 页面样式（自包含，不依赖原站资源）
 * ------------------------------------------------------------
 * v5 新增：领取方式选择弹窗样式
 * v6 兼容性修复（解决部分旧版浏览器组件之间没有间隙的问题）：
 *   - 移除 flex 容器上的 gap，统一改用 margin，100% 兼容；
 *   - 网格间隙使用 grid-gap + gap 双写；
 *   - 用 width + max-width 替换 min()，兼容旧内核；
 *   - 为 clamp() 字号增加固定像素兜底；
 *   - backdrop-filter 增加 -webkit- 前缀。
 * v7 压缩引流卡片 promo-banner__inner，使其更紧凑。
 * v8 新增：PC 端提示弹窗、弹窗说明分点列表样式。
 * v9 调整：
 *   - 领取弹窗内「复制链接」改为主色按钮，「直接领取」改为次要按钮；
 *   - PC 提示弹窗图标与圆点统一为红色，不再使用蓝色；
 *   - 说明中的加粗文字统一使用主题红色。
 * ============================================================ */

:root {
    --red: #ff393f;
    --red-deep: #e92730;
    --ink: #211617;
    --muted: #897879;
    --line: rgba(81, 32, 35, .1);
}

* { box-sizing: border-box; }

html {
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
    background: #ffdfe0;
}

body {
    width: 100%;
    max-width: 100%;
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--ink);
    font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at 85% 6%, rgba(255,255,255,.75) 0 2px, transparent 3px),
        radial-gradient(circle at 18% 24%, rgba(255,255,255,.7) 0 2px, transparent 3px),
        linear-gradient(180deg, #ffcacc 0%, #ffe5e3 42%, #fff2ef 100%);
}

button { font: inherit; -webkit-tap-highlight-color: transparent; }

.svg-icon {
    width: 1em;
    height: 1em;
    display: inline-block;
    flex-shrink: 0;
    fill: currentColor;
    vertical-align: -0.14em;
    pointer-events: none;
}

/* 原 width: min(980px, calc(100% - 48px)) 的等价兼容写法 */
.page-shell {
    position: relative;
    z-index: 2;
    width: 980px;
    max-width: calc(100% - 48px);
    margin: 0 auto;
    padding-top: 20px;
    padding-bottom: 60px;
}

/* ---------- 用户信息栏 ---------- */
.user-bar {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    margin-bottom: 14px;
    border-radius: 14px;
    background: rgba(255,255,255,.7);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,.9);
    box-shadow: 0 4px 14px rgba(137,59,65,.06);
}
/* 替代 flex gap: 10px，全兼容 */
.user-bar > * + * { margin-left: 10px; }

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #fff;
    object-fit: cover;
    flex: 0 0 auto;
}
.user-nickname {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- 引流卡片（v7 压缩，更紧凑） ---------- */
.promo-banner { margin-bottom: 14px; }

.promo-banner__inner {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 13px;
    background: linear-gradient(135deg, #fff5f5, #ffe8e5);
    border: 1px solid rgba(255,57,63,.15);
    box-shadow: 0 6px 18px rgba(137,59,65,.07);
}
/* 替代 flex gap: 10px，全兼容 */
.promo-banner__inner > * + * { margin-left: 10px; }

.promo-banner__icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(145deg, #ff5b64, #e92730);
    box-shadow: 0 4px 10px rgba(255,57,63,.22);
}
.promo-banner__icon .svg-icon { width: 18px; height: 18px; }

.promo-banner__text { flex: 1 1 auto; min-width: 0; }
.promo-banner__text strong { display: block; font-size: 13.5px; font-weight: 800; margin-bottom: 1px; }
.promo-banner__text span { display: block; color: var(--muted); font-size: 11px; }

.promo-banner__btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    padding: 7px 13px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: var(--red);
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 5px 12px rgba(255,57,63,.24);
    transition: .18s;
    white-space: nowrap;
}
.promo-banner__btn:hover { background: var(--red-deep); transform: translateY(-1px); }
/* 替代 flex gap: 4px（按钮内文字与箭头的间距），全兼容 */
.promo-banner__btn .svg-icon { width: 13px; height: 13px; margin-left: 4px; }

/* ---------- 信封 ---------- */
.envelope {
    position: relative;
    z-index: 2;
    padding: 36px 44px 34px;
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(255,255,255,.72), rgba(255,238,235,.63));
    box-shadow: 0 24px 60px rgba(137,59,65,.15), inset 0 1px 1px #fff;
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    margin-bottom: 20px;
}

.giver { position: relative; z-index: 1; display: flex; align-items: center; }
.giver > * { margin-right: 14px; }
.giver > *:last-child { margin-right: 0; }

.avatar {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 50px;
    height: 50px;
    border: 3px solid #fff;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(145deg, #4e2e32, #da7d83);
    box-shadow: 0 5px 15px rgba(69,31,34,.16);
}
.avatar .svg-icon { width: 22px; height: 22px; }
.giver strong { font-size: 17px; }
.giver p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }

.gift-count {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: baseline;
    margin: 32px 0 10px;
}
.gift-count > * { margin-right: 9px; }
.gift-count > *:last-child { margin-right: 0; }
.gift-count span { font-size: 15px; color: #6f5a5b; }
.gift-count strong {
    /* 先给固定字号兜底，再让支持 clamp 的浏览器覆盖 */
    font: 800 64px/.82 "Trebuchet MS", sans-serif;
    font: 800 clamp(54px, 7.5vw, 84px)/.82 "Trebuchet MS", sans-serif;
    letter-spacing: -.06em;
    color: var(--ink);
}

.total-claimed {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 26px;
    color: var(--muted);
    font-size: 13px;
}
.total-claimed > * { margin-right: 6px; }
.total-claimed > *:last-child { margin-right: 0; }
.total-claimed .svg-icon { width: 14px; height: 14px; color: #ff7a83; }
.total-claimed b { margin: 0 2px; color: var(--red-deep); font: 800 17px/1 "Trebuchet MS", sans-serif; }

/* ---------- 列表 ---------- */
.links {
    margin-top: 0;
    padding: 28px 38px 34px;
    background: rgba(255,255,255,.65);
    box-shadow: 0 22px 55px rgba(138,74,77,.08);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: 24px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}
.tabs h2 { margin: 0; font-size: 22px; }
.list-label { color: var(--muted); font-size: 12px; white-space: nowrap; }

.link-list { display: grid; }

.link-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    /* grid-gap 兼容旧版 grid 实现，gap 为标准写法 */
    grid-gap: 14px 14px;
    gap: 14px 14px;
    align-items: center;
    padding: 16px 4px;
    border-bottom: 1px solid rgba(77,35,38,.07);
    animation: rise .45s both;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.link-avatar {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 3px solid #fff;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(145deg, #ff7a83, #ff393f);
    box-shadow: 0 5px 12px rgba(255,57,63,.22);
    font-family: "Trebuchet MS", sans-serif;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
}

.link-main { min-width: 0; }

.link-title {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}
.link-title > * { margin-right: 8px; }
.link-title > *:last-child { margin-right: 0; }
.link-no { color: var(--ink); font-size: 14.5px; font-weight: 800; }

/* 网易云头像小图 */
.link-avatar-img {
    display: inline-block;
    flex: 0 0 auto;
    width: 1em;
    height: 1em;
    margin-right: 6px;
    border-radius: 4px;
    overflow: hidden;
    background: #f0e6e6;
    vertical-align: -0.12em;
    line-height: 0;
    box-shadow: 0 1px 3px rgba(137, 59, 65, .12);
}
.link-avatar-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border: 0;
}

.link-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    color: #a59495;
    font-size: 11.5px;
    line-height: 1;
    margin-bottom: -4px;
}
.link-meta > * { margin-right: 12px; margin-bottom: 4px; }
.link-meta > *:last-child { margin-right: 0; }
.meta-item { display: inline-flex; align-items: center; white-space: nowrap; }
.meta-item > * { margin-right: 4px; }
.meta-item > *:last-child { margin-right: 0; }
.meta-item .svg-icon { width: 12px; height: 12px; color: #bcaaab; }
.meta-item b { color: var(--red-deep); font-weight: 800; }

.actions { display: flex; align-items: center; }
.actions > * { margin-right: 8px; }
.actions > *:last-child { margin-right: 0; }

.claim {
    border: 0;
    min-width: 88px;
    padding: 10px 16px;
    border-radius: 999px;
    color: #fff;
    background: var(--red);
    font-size: 13.5px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    transition: .18s;
    text-decoration: none;
    text-align: center;
}
.claim:hover { background: var(--red-deep); transform: translateY(-1px); }
.claim:disabled { opacity: .5; cursor: wait; transform: none; }

.loading, .empty {
    padding: 50px 4px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.page-intro {
    margin: 32px auto 0;
    max-width: 720px;
    padding: 0 8px;
    color: #b0a0a1;
    font-size: 11.5px;
    line-height: 1.85;
    text-align: center;
}

.toast {
    position: fixed;
    z-index: 30;
    left: 50%;
    bottom: 25px;
    padding: 11px 18px;
    border-radius: 999px;
    color: #fff;
    background: rgba(48,22,24,.9);
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
    max-width: calc(100% - 32px);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 15px);
    transition: .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============================================================
 * ★ 领取方式选择弹窗 / PC 端提示弹窗
 * ============================================================ */
/* 原 width: min(420px, calc(100% - 32px)) 的等价兼容写法 */
.claim-dialog {
    width: 420px;
    max-width: calc(100% - 32px);
    padding: 0;
    border: 0;
    border-radius: 22px;
    color: var(--ink);
    background: #fff7f5;
    box-shadow: 0 35px 100px rgba(89,31,35,.3);
    overflow: visible;
    overscroll-behavior: contain;
    touch-action: pan-y;
}
.claim-dialog::backdrop {
    background: rgba(84,42,45,.42);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.claim-dialog[open] {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
}
.claim-dialog.fallback::before {
    content: "";
    position: fixed;
    z-index: -1;
    inset: -100vh -100vw;
    background: rgba(84,42,45,.48);
}

.claim-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #927f80;
    background: rgba(255,255,255,.7);
    cursor: pointer;
    transition: .15s;
}
.claim-close:hover { color: var(--ink); background: #fff; }
.claim-close .svg-icon { width: 16px; height: 16px; }

.claim-dialog-body {
    padding: 28px 22px 24px;
    text-align: center;
}
.claim-icon {
    display: inline-grid;
    place-items: center;
    width: 60px;
    height: 60px;
    margin-bottom: 14px;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(145deg, #ff5b64, #e92730);
    box-shadow: 0 12px 26px rgba(255,57,63,.3), inset 0 0 0 3px rgba(255,255,255,.25);
}
.claim-icon .svg-icon { width: 28px; height: 28px; }
.claim-dialog h2 {
    margin: 0 0 10px;
    font-family: "Songti SC", "STSong", serif;
    font-size: 20px;
    font-weight: 900;
}
.claim-dialog p {
    margin: 0 0 20px;
    padding: 10px 12px;
    border-radius: 12px;
    color: #8a6a6c;
    background: rgba(255,235,232,.7);
    font-size: 12.5px;
    line-height: 1.75;
    text-align: left;
}

/* ★ 分点说明列表（主领取弹窗 / PC 提示弹窗共用） */
.claim-tips {
    margin: 0 0 20px;
    padding: 10px 14px 10px 30px;
    border-radius: 12px;
    color: #8a6a6c;
    background: rgba(255,235,232,.7);
    font-size: 12.5px;
    line-height: 1.75;
    text-align: left;
    list-style: none;
}
.claim-tips li { position: relative; }
.claim-tips li + li { margin-top: 4px; }
.claim-tips li::before {
    content: "";
    position: absolute;
    left: -14px;
    top: .72em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #ff7a83;
}
/* v9：说明中的加粗文字统一使用主题红色 */
.claim-tips strong { font-weight: 800; color: var(--red-deep); }

/* ★ PC 端提示弹窗：v9 起与主弹窗统一红色，不再使用蓝色 */

.claim-actions { display: flex; }
.claim-actions > * { margin-right: 10px; }
.claim-actions > *:last-child { margin-right: 0; }

.claim-actions button {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 12px;
    border: 0;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: .15s;
    white-space: nowrap;
}
.claim-actions button > * { margin-right: 6px; }
.claim-actions button > *:last-child { margin-right: 0; }

.claim-actions .svg-icon { width: 15px; height: 15px; }
.claim-actions .claim-copy {
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
}
.claim-actions .claim-copy:hover { background: #fdf2f2; }
.claim-actions .claim-go {
    color: #fff;
    background: var(--red);
    box-shadow: 0 8px 18px rgba(255,57,63,.25);
}
.claim-actions .claim-go:hover { background: var(--red-deep); }
.claim-actions button:disabled { opacity: .5; cursor: wait; }

/* ★ v9：领取弹窗内调换两个按钮的主次颜色
 *   - 复制链接 → 主色按钮（红底白字）
 *   - 直接领取 → 次要按钮（白底描边）
 *   仅作用于 #claimDialog，PC 提示弹窗按钮颜色不受影响。 */
#claimDialog .claim-actions .claim-copy {
    color: #fff;
    background: var(--red);
    border: 0;
    box-shadow: 0 8px 18px rgba(255,57,63,.25);
}
#claimDialog .claim-actions .claim-copy:hover { background: var(--red-deep); }
#claimDialog .claim-actions .claim-go {
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: none;
}
#claimDialog .claim-actions .claim-go:hover { background: #fdf2f2; }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
    .page-shell {
        width: auto;
        max-width: none;
        margin: 0 14px;
        padding-top: 14px;
        padding-bottom: 40px;
    }

    /* v7 压缩：移动端引流卡片进一步收紧 */
    .promo-banner { margin-bottom: 12px; }
    .promo-banner__inner { padding: 9px 12px; border-radius: 12px; }
    .promo-banner__inner > * + * { margin-left: 8px; }
    .promo-banner__icon { width: 32px; height: 32px; border-radius: 9px; }
    .promo-banner__icon .svg-icon { width: 16px; height: 16px; }
    .promo-banner__text strong { font-size: 12.5px; }
    .promo-banner__text span { font-size: 10.5px; }
    .promo-banner__btn { padding: 6px 11px; font-size: 11.5px; }
    .promo-banner__btn .svg-icon { width: 12px; height: 12px; margin-left: 4px; }

    .envelope { padding: 16px 16px 18px; border-radius: 16px; margin-bottom: 14px; }
    .giver > * { margin-right: 9px; }
    .avatar { width: 38px; height: 38px; border-width: 2px; }
    .avatar .svg-icon { width: 17px; height: 17px; }
    .giver strong { font-size: 13.5px; }
    .giver p { font-size: 11px; }

    .gift-count { margin: 16px 0 6px; white-space: nowrap; }
    .gift-count > * { margin-right: 6px; }
    .gift-count span { font-size: 13px; }
    /* 先给固定字号兜底，再让支持 clamp 的浏览器覆盖 */
    .gift-count strong {
        font-size: 52px;
        font-size: clamp(44px, 14vw, 58px);
    }
    .total-claimed { margin: 0 0 14px; font-size: 12px; }
    .total-claimed > * { margin-right: 5px; }
    .total-claimed .svg-icon { width: 13px; height: 13px; }
    .total-claimed b { font-size: 15px; }

    .links { padding: 16px 12px 18px; border-radius: 16px; }
    .section-head { padding-bottom: 14px; }
    .tabs h2 { font-size: 16px; }
    .list-label { font-size: 10px; }

    .link-card {
        grid-template-columns: auto minmax(0,1fr) auto;
        /* 替代原 row-gap / column-gap: 10px */
        grid-gap: 10px 10px;
        gap: 10px 10px;
        padding: 13px 0;
    }
    .link-avatar { width: 36px; height: 36px; border-width: 2px; border-radius: 10px; font-size: 13px; }
    .link-no { font-size: 13.5px; }
    .link-avatar-img { margin-right: 5px; border-radius: 3px; }
    .link-meta { font-size: 11px; }
    .link-meta > * { margin-right: 9px; }
    .meta-item .svg-icon { width: 12px; height: 12px; }
    .claim { min-width: 60px; padding: 9px 12px; font-size: 13px; }

    .page-intro { margin-top: 22px; font-size: 11px; line-height: 1.75; }

    /* 弹窗响应式 */
    .claim-dialog { width: calc(100% - 24px); border-radius: 20px; }
    .claim-dialog-body { padding: 24px 18px 20px; }
    .claim-close { top: 8px; right: 8px; width: 30px; height: 30px; }
    .claim-close .svg-icon { width: 15px; height: 15px; }
    .claim-icon { width: 54px; height: 54px; margin-bottom: 12px; }
    .claim-icon .svg-icon { width: 24px; height: 24px; }
    .claim-dialog h2 { font-size: 18px; }
    .claim-dialog p { font-size: 12px; margin-bottom: 16px; padding: 9px 11px; }
    .claim-tips { font-size: 12px; margin-bottom: 16px; padding: 9px 11px 9px 26px; }
    .claim-tips li::before { left: -12px; }
    .claim-actions > * { margin-right: 8px; }
    .claim-actions button { padding: 12px 10px; font-size: 13px; }
    .claim-actions .svg-icon { width: 14px; height: 14px; }
}

@media (max-width: 380px) {
    .page-shell { margin-inline: 10px; }
    .envelope { padding: 14px 14px 16px; }
    .gift-count strong { font-size: 46px; }
    .links { padding: 14px 10px 16px; }
    .link-avatar { width: 32px; height: 32px; border-radius: 9px; font-size: 12px; }
    .link-avatar-img { margin-right: 4px; border-radius: 3px; }
    .claim { min-width: 56px; padding: 8px 10px; font-size: 12px; }

    /* 超小屏弹窗：按钮竖排 */
    .claim-actions {
        flex-direction: column;
    }
    .claim-actions > * { margin-right: 0; margin-bottom: 8px; }
    .claim-actions > *:last-child { margin-bottom: 0; }
    .claim-actions .claim-go { order: 0; }
    .claim-actions .claim-copy { order: 1; }
    .claim-actions button { padding: 12px; font-size: 13.5px; }
}