/* ================================================================
   AXIOM · 芒果帝国 —— 票面模板「laser」（镭射 / 全息铂金）
   v28.10 2026-09-14 模板化：本文档即 laser 模板的唯一样式表，被三处共用 ——
     ① 后台「🎁 赠送」弹窗预览/完成态（发放者截图）
     ② /REDEEM/<token> 线上票面（领取者看到的）
     ③ /redeem.php「兑换记录」点兑换码弹出的领奖凭证（存根态）
   ----------------------------------------------------------------
   视觉体系来源：用户提供的「全息礼物兑换券」模板（全息箔 + 眩光跟随 +
   精细纹理 + 光泽扫过 + 四角花线 + 3D 视差 + 烫金渐变数字）。
   类名全部以 .rr- 前缀收敛在本文件内，不污染其它页面。
   v28.10 之前本文件名为 css/redeem_receipt.css（仅 /redeem.php 引用）；
   模板化后改名并新增「内联容器 / 状态钢印 / 色带 / 拼手气提示 / 领取方式 / 二维码」。
   ================================================================ */

/* ========== 遮罩与舞台 ========== */
.rr-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* v28.10 2026-09-14 遮罩改为中性深色：凭证可能是复古票面（此遮罩为两模板共用），
       原金色径向光只适配镭射卡，会让复古卡显得串味 */
    background: rgba(3, 3, 6, 0.92);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.rr-modal.is-open {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    /* v28.2 2026-09-14 顶部让出固定导航栏的高度（--nav-height 70px）+ 28px 呼吸间距：
       原先 30px 会让卡片顶到导航栏区域（卡片顶部的品牌行被压住看不见） */
    padding: calc(var(--nav-height, 70px) + 28px) 16px 44px;
}
.rr-stage {
    position: relative;
    width: 400px;
    max-width: 100%;
    flex-shrink: 0;
    perspective: 1200px;
}
/* v28.3 2026-09-14 移除右上角 ✕ 关闭按钮（点卡片外 / Esc 即可关闭） */

/* ========== 卡片本体 ========== */
.rr-scene {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.12s ease-out;
}
.rr-card {
    position: relative;
    width: 100%;
    min-height: 700px;
    border-radius: 20px;
    transform-style: preserve-3d;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(212, 175, 55, 0.08), transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(212, 175, 55, 0.05), transparent 50%),
        linear-gradient(165deg, #1a1815 0%, #0d0c0a 50%, #14120f 100%);
    box-shadow:
        0 40px 80px rgba(0, 0, 0, 0.9),
        0 0 0 1px rgba(212, 175, 55, 0.3),
        inset 0 0 80px rgba(212, 175, 55, 0.04),
        inset 0 1px 0 rgba(255, 240, 180, 0.08);
}
.rr-card::after {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 14px;
    border: 1px solid rgba(212, 175, 55, 0.12);
    pointer-events: none;
    z-index: 3;
}

/* 全息彩虹箔层（每次打开随机一种） */
.rr-foil {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    pointer-events: none;
    z-index: 5;
    opacity: 0.9;
    mix-blend-mode: screen;
    transition: background 0.6s ease;
}

/* 眩光（跟随指针） */
.rr-glare {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: radial-gradient(
        circle at var(--mx, 50%) var(--my, 50%),
        rgba(255, 240, 200, 0.26) 0%,
        rgba(255, 223, 115, 0.1) 18%,
        transparent 50%
    );
    pointer-events: none;
    z-index: 6;
    mix-blend-mode: screen;
}

/* 精细纹理 */
.rr-texture {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background-image:
        repeating-linear-gradient(45deg, transparent, transparent 2px, rgba(255, 255, 255, 0.012) 2px, rgba(255, 255, 255, 0.012) 4px),
        repeating-linear-gradient(-45deg, transparent, transparent 3px, rgba(255, 255, 255, 0.008) 3px, rgba(255, 255, 255, 0.008) 6px),
        radial-gradient(circle at 50% 50%, transparent 0%, rgba(0, 0, 0, 0.35) 100%);
    pointer-events: none;
    z-index: 4;
}

/* 光泽扫过 */
.rr-sheen {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    overflow: hidden;
    pointer-events: none;
    z-index: 7;
}
.rr-sheen::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 50%;
    height: 200%;
    background: linear-gradient(
        to right,
        transparent,
        rgba(255, 240, 200, 0.1),
        rgba(255, 240, 200, 0.18),
        rgba(255, 240, 200, 0.1),
        transparent
    );
    animation: rrSheenMove 7s ease-in-out infinite;
}
@keyframes rrSheenMove {
    0% { transform: translateX(-200%) skewX(-25deg) rotate(20deg); }
    50% { transform: translateX(400%) skewX(-25deg) rotate(20deg); }
    100% { transform: translateX(400%) skewX(-25deg) rotate(20deg); }
}

/* 四角花线 */
.rr-corner {
    position: absolute;
    width: 24px;
    height: 24px;
    border-color: rgba(212, 175, 55, 0.6);
    border-style: solid;
    border-width: 0;
    z-index: 8;
    pointer-events: none;
}
.rr-corner-tl { top: 14px; left: 14px; border-top-width: 1.5px; border-left-width: 1.5px; border-top-left-radius: 6px; }
.rr-corner-tr { top: 14px; right: 14px; border-top-width: 1.5px; border-right-width: 1.5px; border-top-right-radius: 6px; }
.rr-corner-bl { bottom: 14px; left: 14px; border-bottom-width: 1.5px; border-left-width: 1.5px; border-bottom-left-radius: 6px; }
.rr-corner-br { bottom: 14px; right: 14px; border-bottom-width: 1.5px; border-right-width: 1.5px; border-bottom-right-radius: 6px; }

/* ========== 内容层 ========== */
.rr-content {
    position: relative;
    z-index: 10;
    padding: 28px 24px 24px;
    height: 100%;
    display: flex;
    flex-direction: column;
    transform-style: preserve-3d;
}
.rr-l { transform-style: preserve-3d; }
.rr-l10 { transform: translateZ(10px); }
.rr-l25 { transform: translateZ(25px); }
.rr-l40 { transform: translateZ(40px); }

/* ========== 头部 ========== */
.rr-header { text-align: center; margin-bottom: 14px; }
.rr-brand {
    font-size: 9.5px; letter-spacing: 6px; color: #e0c070;
    margin-bottom: 6px; font-weight: 600;
}
.rr-divider {
    display: flex; align-items: center; justify-content: center;
    gap: 8px; margin-bottom: 10px;
}
.rr-divider::before,
.rr-divider::after {
    content: ''; width: 40px; height: 1px;
    background: linear-gradient(to right, transparent, rgba(212, 175, 55, 0.5), transparent);
}
.rr-diamond {
    width: 4px; height: 4px; background: #d4af37;
    transform: rotate(45deg);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.8);
}
.rr-title {
    font-size: 28px; color: #f5f0e6; letter-spacing: 10px;
    text-shadow: 0 4px 20px rgba(212, 175, 55, 0.4), 0 1px 0 rgba(255, 240, 180, 0.15);
    font-weight: 500; line-height: 1.2; padding-left: 10px;
}
.rr-sub {
    font-size: 9px; color: #8e8a82; letter-spacing: 4px;
    margin-top: 4px; opacity: 0.7;
}

/* ========== 奖励区 ========== */
.rr-reward {
    position: relative;
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.14) 0%, rgba(212, 175, 55, 0.02) 100%);
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-radius: 14px;
    padding: 14px 16px;
    text-align: center;
    margin-bottom: 12px;
    box-shadow:
        inset 0 1px 0 rgba(255, 240, 180, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3),
        0 4px 20px rgba(0, 0, 0, 0.3);
}
.rr-reward-label {
    display: flex; align-items: center; justify-content: center;
    gap: 10px; font-size: 9px; letter-spacing: 5px;
    color: #d4af37; margin-bottom: 6px; opacity: 0.9;
}
.rr-reward-label::before,
.rr-reward-label::after {
    content: ''; width: 24px; height: 1px; background: rgba(212, 175, 55, 0.4);
}
.rr-value-wrap {
    display: flex; align-items: baseline; justify-content: center;
    gap: 8px; margin-bottom: 2px;
}
.rr-value {
    font-size: 50px; font-weight: 700;
    background: linear-gradient(to bottom, #fff 0%, #ffe58f 45%, #d4af37 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1; font-family: 'Times New Roman', Georgia, serif;
    letter-spacing: 2px;
    filter: drop-shadow(0 4px 12px rgba(212, 175, 55, 0.4));
}
.rr-unit { font-size: 15px; color: #d4af37; font-weight: 400; letter-spacing: 2px; }
/* 领取印章（金色 · 与站内「统一金色」口径一致，不用绿色） */
.rr-stamp {
    font-size: 11px; color: #e8cd76; letter-spacing: 6px;
    margin-top: 5px; padding-left: 6px; opacity: 0.95;
    text-shadow: 0 0 12px rgba(212, 175, 55, 0.45);
}

/* ========== 数据网格 ========== */
.rr-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 7px 14px; line-height: 1.4;
    margin-bottom: 12px; padding: 11px 4px;
    border-top: 1px solid rgba(212, 175, 55, 0.12);
    border-bottom: 1px solid rgba(212, 175, 55, 0.12);
    font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
}
.rr-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rr-item .k {
    color: rgba(255, 255, 255, 0.48); font-size: 9px; letter-spacing: 1.5px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rr-item .v {
    color: #ffe58f; letter-spacing: 0.5px;
    font-size: 11.5px; font-weight: 500;
    word-break: break-all;
}
.rr-item .v.is-strong { font-size: 12.5px; color: #fff3cf; letter-spacing: 1.5px; }

/* ========== 寄语（仅有祝福语时显示） ========== */
.rr-bless {
    font-size: 11.5px; color: #a89f91; text-align: center;
    font-style: italic; line-height: 1.6;
    margin-bottom: 12px; padding: 0 12px; position: relative;
}
.rr-bless::before {
    content: '"'; position: absolute; top: -8px; left: 0;
    font-size: 26px; color: rgba(212, 175, 55, 0.3);
    font-family: Georgia, serif;
}
.rr-bless .sign {
    display: block; margin-top: 4px; color: #d4af37;
    font-style: normal; font-size: 10px; letter-spacing: 2px;
}

/* ========== 凭证说明 ========== */
.rr-notes {
    font-size: 11px; color: #8e8a82; line-height: 1.6;
    margin-bottom: 12px; padding: 8px 12px;
    background: rgba(0, 0, 0, 0.25); border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.1);
}
.rr-notes .notes-title {
    color: #d4af37; font-size: 9px; letter-spacing: 2px;
    margin-bottom: 4px; opacity: 0.9;
}
.rr-notes ol { padding-left: 16px; margin: 0; }
.rr-notes li { margin-bottom: 2px; color: #b8b2a6; }
.rr-notes li:last-child { margin-bottom: 0; }
.rr-notes li::marker { color: #d4af37; font-weight: bold; }

/* ========== 链接区 ========== */
.rr-link {
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(212, 175, 55, 0.18);
    border-radius: 8px; padding: 8px 12px; margin-bottom: 14px;
    font-family: 'JetBrains Mono', Consolas, monospace; gap: 10px;
}
.rr-link-left {
    display: flex; flex-direction: column; gap: 3px;
    min-width: 0; flex: 1;
}
.rr-link-left .k {
    color: #d4af37; font-size: 9px; letter-spacing: 1.5px; opacity: 0.9;
}
.rr-link-left .v {
    color: #8e8a82; font-size: 9px; word-break: break-all; opacity: 0.85;
}
.rr-link-btn {
    padding: 6px 12px; background: rgba(212, 175, 55, 0.15);
    border: 1px solid rgba(212, 175, 55, 0.4); border-radius: 5px;
    color: #d4af37; font-size: 10px; cursor: pointer;
    transition: all 0.3s; white-space: nowrap;
    font-family: inherit; letter-spacing: 0.5px;
    flex-shrink: 0;
}
.rr-link-btn:hover {
    background: rgba(212, 175, 55, 0.3);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.35);
}

/* ========== 主按钮 ========== */
.rr-actions { margin-top: auto; padding-top: 8px; flex-shrink: 0; }
.rr-actions form { margin: 0; }
.rr-btn {
    width: 100%;
    padding: 11px 16px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #8c6b14 0%, #d4af37 50%, #ffe58f 100%);
    color: #0a0a0a;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 3px;
    cursor: pointer;
    transform: translateZ(40px);
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.5),
        0 0 18px rgba(212, 175, 55, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    font-family: inherit;
}
.rr-btn:hover {
    transform: translateZ(50px) scale(1.02);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.6), 0 0 30px rgba(212, 175, 55, 0.75);
}
.rr-btn:active { transform: translateZ(36px) scale(0.98); }
.rr-btn::after {
    content: ''; position: absolute;
    top: 0; left: -120%; width: 60%; height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.75), transparent);
    transform: skewX(-25deg); transition: left 0.6s;
}
.rr-btn:hover::after { left: 180%; }

/* ========== 底部 ========== */
.rr-footer {
    margin-top: 12px; font-size: 9px;
    color: rgba(255, 255, 255, 0.18);
    display: flex; flex-direction: column; align-items: center;
    gap: 3px; font-family: 'JetBrains Mono', Consolas, monospace;
    text-align: center; line-height: 1.5;
}
.rr-footer .af { color: rgba(212, 175, 55, 0.45); letter-spacing: 1px; }
.rr-footer .brand { color: rgba(255, 255, 255, 0.25); letter-spacing: 2px; font-size: 8px; }

/* ========== 记录表里的「兑换码」可点样式 ========== */
.rr-code-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: none;
    background: none;
    color: #e0c070;
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 13px;
    letter-spacing: 1px;
    cursor: pointer;
    border-bottom: 1px dashed rgba(224, 192, 112, 0.45);
    transition: color 0.2s, border-color 0.2s, text-shadow 0.2s;
}
.rr-code-link:hover {
    color: #ffe9a8;
    border-bottom-color: #ffe9a8;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}
.rr-code-link .ticket {
    font-size: 12px;
    opacity: 0.75;
}

/* ================================================================
   v28.10 2026-09-14 模板化新增：内联容器 + 状态 + 发放态补充件
   ================================================================ */

/* 内联容器：后台预览 / /REDEEM 线上票面里直接摆一张卡（不套遮罩） */
.rr-laser { display: flex; justify-content: center; width: 100%; }
.rr-laser .rr-stage { width: 400px; max-width: 100%; }

/* 弹窗宿主（/redeem.php 领奖凭证）：两模板共用同一个中性遮罩，卡片由服务端按模板渲染后注入 */
.rr-host { width: 100%; display: flex; justify-content: center; }
.rr-loading { color: #8d8d9e; font-size: 13px; padding: 40px 24px; }

/* 状态钢印变体（口径与复古版一致：已领取亮金、过期/作废暗红、待领取常规金） */
.rr-stamp.is-claimed { color: #ffd76a; opacity: 1; text-shadow: 0 0 14px rgba(212, 175, 55, 0.6); }
.rr-stamp.is-bad { color: #d98c8c; letter-spacing: 5px; text-shadow: 0 0 12px rgba(214, 90, 90, 0.45); }

/* 拼手气红包提示 */
.rr-lucky-note {
    margin: 0 0 10px; text-align: center; font-size: 11px; line-height: 1.65;
    color: #f0e0b6; background: rgba(212, 175, 55, 0.10);
    border: 1px solid rgba(212, 175, 55, 0.30); border-radius: 8px; padding: 6px 10px;
}

/* 卡片内状态提示色带（定向 / 已过期 / 已作废 / 已领完 / 领取成功） */
.rr-notice {
    margin: 0 0 12px; padding: 9px 12px; border-radius: 9px;
    text-align: center; font-size: 12px; line-height: 1.7;
}
.rr-notice b { color: #ffe58f; }
.rr-notice-ok   { background: rgba(127, 214, 163, 0.10); border: 1px solid rgba(127, 214, 163, 0.38); color: #9fe6bb; }
.rr-notice-bad  { background: rgba(214, 127, 127, 0.10); border: 1px solid rgba(214, 127, 127, 0.38); color: #f0a8a8; }
.rr-notice-info { background: rgba(212, 175, 55, 0.09);  border: 1px solid rgba(212, 175, 55, 0.34);  color: #f0e0b6; }

/* 领取方式（仅「赠送票面」渲染：对方拿的是截图，必须知道怎么领） */
.rr-steps {
    margin: 0 0 10px; padding: 9px 12px; border-radius: 9px;
    background: rgba(0, 0, 0, 0.28); border: 1px solid rgba(212, 175, 55, 0.14);
    font-size: 11px; color: #b8b2a6; line-height: 1.75;
}
.rr-steps-t { color: #d4af37; font-size: 9px; letter-spacing: 2px; margin-bottom: 4px; }
.rr-steps ol { padding-left: 16px; margin: 0; }
.rr-steps li { margin-bottom: 2px; }
.rr-steps li::marker { color: #d4af37; font-weight: bold; }

/* 二维码（米纸底 → 与深色卡面形成高对比，扫码更稳）
   ⚠️ v29.1 2026-09-14 必须给 canvas 加 !important：inc/qrcode.min.js 会把 width/height 写成
   **内联样式**（按 options.width = 222px），类选择器压不过内联样式 —— 之前没写 !important，
   二维码实际渲染成 222px，把右侧「扫码领取 / 票面链接」挤到几乎没位置（用户上报）。 */
.rr-qr {
    display: flex; align-items: center; gap: 12px;
    margin: 0 0 12px; padding: 10px 12px;
    background: rgba(0, 0, 0, 0.32); border: 1px solid rgba(212, 175, 55, 0.18);
    border-radius: 10px;
}
/* 烫金印章（v29.1 配色改版：原先「平涂米纸底」与镭射卡的暗底烫金不搭，现改为金色渐变箔边 + 暖香槟底；
   二维码本体仍保持「深墨 on 浅底」确保扫码识别率）
   ⚠️ 尺寸不写死容器：印章由 canvas + 自身 padding 撑开（auto 宽度），这样金边四周恒定 4px 均匀环绕，
   不受全局 box-sizing / 父级影响；canvas 必须 !important 压住库写入的内联 222px（见下条说明） */
.rr-qr-seal {
    flex: 0 0 auto; padding: 4px; border-radius: 10px;
    background: linear-gradient(145deg, rgba(247, 225, 164, 0.75), rgba(162, 130, 61, 0.45));
    box-shadow: 0 0 16px rgba(212, 175, 55, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.rr-qr-seal canvas {
    display: block;
    width: 104px !important; height: 104px !important;
    border-radius: 8px; image-rendering: -webkit-optimize-contrast;
}
.rr-qr-side { flex: 1; min-width: 0; }
.rr-qr-t1 { font-size: 10px; letter-spacing: 2px; color: #d4af37; margin-bottom: 4px; }
.rr-qr-link {
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 9px; color: #8e8a82; word-break: break-all; line-height: 1.5;
}

/* ========== 响应式 ========== */
@media (max-width: 480px) {
    .rr-modal.is-open { padding: calc(var(--nav-height, 70px) + 14px) 12px 30px; }
    .rr-stage { width: 100%; }
    .rr-card { min-height: 660px; }
    .rr-value { font-size: 42px; }
    .rr-title { font-size: 23px; letter-spacing: 7px; }
    .rr-content { padding: 22px 16px 20px; }
    .rr-grid { font-size: 10px; gap: 6px 10px; }
    .rr-item .v { font-size: 10.5px; }
    .rr-item .v.is-strong { font-size: 11.5px; }
    .rr-item .k { font-size: 8.5px; letter-spacing: 1px; }
    .rr-qr { gap: 10px; padding: 8px 10px; }
    .rr-qr-seal canvas { width: 88px !important; height: 88px !important; }
}

/* 矮屏优化（笔记本 720~800px 高） */
@media (max-height: 820px) {
    .rr-card { min-height: 640px; }
    .rr-content { padding: 22px 20px 18px; }
    .rr-title { font-size: 24px; }
    .rr-value { font-size: 42px; }
    .rr-reward { padding: 10px 14px; margin-bottom: 10px; }
    .rr-grid { padding: 8px 4px; margin-bottom: 10px; gap: 6px 12px; }
    .rr-bless { margin-bottom: 10px; }
    .rr-notes { padding: 6px 10px; margin-bottom: 10px; }
    .rr-link { padding: 6px 10px; margin-bottom: 10px; }
    .rr-btn { padding: 9px 14px; font-size: 13px; min-height: 40px; letter-spacing: 2px; }
    .rr-steps { padding: 7px 10px; margin-bottom: 8px; }
    .rr-qr { padding: 8px 10px; margin-bottom: 8px; }
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
    .rr-sheen::before { animation: none; }
    .rr-scene { transition: none; }
}
