/* ============================================================
   邀请好友
   设计稿基准：382 × 814（移动端），1rem = min(100vw, 480px) / 38.2
   注：本页 1rem 对应设计稿 1px（用 38.2 做基底，比例对齐设计稿）
   ============================================================ */

html {
    /* 让 1rem ≈ 设计稿 1px（容器最大 480px 时） */
    font-size: calc(min(100vw, 480px) / 38.2);
    background: #9e1412;            /* html 兜底：滚动溢出 / iOS 弹性区域不会露白 */
}

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

html, body {
    margin: 0;
    padding: 0;
    background: #9e1412;
    min-height: 100%;
}

body {
    min-height: 100vh;
    background: #9e1412;
    font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
    color: #333;
    overflow-x: hidden;             /* 防止任何子元素超宽产生横向滚动条 */
}

a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
button { font-family: inherit; }

/* ===== Phone 容器 ===== */
.phone {
    position: relative;
    width: 100%;
    max-width: 38.2rem;             /* 设计稿宽度上限，超出后两边由 body 红色兜底 */
    margin: 0 auto;
    min-height: 100vh;
    background: #9e1412;
    overflow: hidden;
}


/* ===== 政策海报主体 ===== */
.iv-poster {
    position: relative;
    min-height: 100vh;
    padding: 3.2rem 1.4rem 2rem;
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 231, 150, 0.75), transparent 22rem),
        linear-gradient(180deg, #e31b24 0%, #c70f18 32%, #9e1412 100%);
    overflow: hidden;
}
.iv-poster::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, transparent 0 40%, rgba(255, 215, 110, 0.18) 40% 42%, transparent 42%),
        radial-gradient(circle at 10% 20%, rgba(255,255,255,0.18), transparent 7rem),
        radial-gradient(circle at 90% 45%, rgba(255,215,110,0.16), transparent 9rem);
    pointer-events: none;
}
.iv-poster__glow {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    filter: blur(18px);
}
.iv-poster__glow--top {
    top: -4rem;
    left: 50%;
    width: 24rem;
    height: 10rem;
    transform: translateX(-50%);
    background: rgba(255, 230, 140, 0.45);
}
.iv-poster__glow--bottom {
    bottom: -6rem;
    right: -6rem;
    width: 18rem;
    height: 18rem;
    background: rgba(255, 170, 40, 0.28);
}

.iv-back {
    position: absolute;
    top: 1.3rem;
    left: 1rem;
    width: 4.2rem;
    height: 4.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    -webkit-tap-highlight-color: transparent;
    background: rgba(255,255,255,0.16);
    border-radius: 50%;
    backdrop-filter: blur(4px);
}
.iv-back:active { background: rgba(255, 255, 255, 0.25); }

.iv-poster__head {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #fff;
}
.iv-poster__logo {
    width: 4.8rem;
    height: 4.8rem;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0.3rem 0.8rem rgba(120,0,0,0.24);
    margin-bottom: 0.8rem;
}
.iv-poster__logo img {
    width: 4.2rem;
    height: 4.2rem;
    border-radius: 50%;
}
.iv-poster__brand {
    font-size: 2.3rem;
    font-weight: 900;
    letter-spacing: 0.2rem;
    text-shadow: 0 0.15rem 0.3rem rgba(80,0,0,0.55);
}
.iv-poster__tag {
    margin-top: 0.45rem;
    padding: 0.3rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    border: 0.05rem solid rgba(255, 230, 150, 0.55);
    font-size: 1.05rem;
    letter-spacing: 0.08rem;
}
.iv-poster__title {
    position: relative;
    z-index: 2;
    margin: 1.8rem 0 1rem;
    text-align: center;
    color: #fff;
}
.iv-poster__title span {
    display: block;
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: 0.15rem;
    text-shadow: 0 0.12rem 0.25rem rgba(90,0,0,0.5);
}
.iv-poster__title b {
    display: block;
    margin-top: 0.25rem;
    font-size: 4rem;
    line-height: 1;
    font-weight: 900;
    color: #ffe38a;
    text-shadow: 0 0.15rem 0 #9a0d12, 0 0.5rem 1rem rgba(0,0,0,0.35);
}
.iv-poster__intro {
    position: relative;
    z-index: 2;
    margin: 0;
    padding: 1.1rem 1.2rem;
    border-radius: 1rem;
    color: #fff8dc;
    background: rgba(0, 0, 0, 0.16);
    border: 0.05rem solid rgba(255, 230, 150, 0.45);
    font-size: 1.15rem;
    line-height: 1.75;
    text-align: justify;
}
.iv-benefits {
    position: relative;
    z-index: 2;
    list-style: none;
    margin: 1.1rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.iv-benefits li {
    position: relative;
    min-height: 4.6rem;
    padding: 0.72rem 0.9rem 0.72rem 3.2rem;
    border-radius: 0.9rem;
    background: linear-gradient(180deg, #fff 0%, #fff2d2 100%);
    border: 0.08rem solid rgba(255, 215, 110, 0.75);
    color: #5b2505;
    box-shadow: 0 0.25rem 0.6rem rgba(80, 0, 0, 0.14);
    line-height: 1.45;
}
.iv-benefits li::before {
    content: counter(list-item);
    position: absolute;
    left: 0.9rem;
    top: 0.9rem;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #ea1c25, #ad0810);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
}
.iv-benefits span {
    display: block;
    font-size: 1.05rem;
    color: #8a4a06;
}
.iv-benefits b {
    display: inline-block;
    color: #d8131c;
    font-size: 1.32rem;
    font-weight: 900;
}
.iv-benefits em {
    display: block;
    margin-top: 0.15rem;
    color: #b14406;
    font-style: normal;
    font-size: 1.02rem;
}
.iv-poster__note {
    position: relative;
    z-index: 2;
    margin: 1rem 0 0;
    padding: 0.85rem 1rem;
    border-radius: 0.8rem;
    background: rgba(255, 255, 255, 0.14);
    border: 0.05rem dashed rgba(255, 230, 150, 0.65);
    color: #fff7dc;
    font-size: 1.1rem;
    line-height: 1.6;
}
.iv-share-card {
    position: relative;
    z-index: 2;
    margin-top: 1.2rem;
    padding: 1.6rem 1.4rem 1.5rem;
    border-radius: 1.2rem;
    background: linear-gradient(180deg, #fff8e6 0%, #ffe1a8 100%);
    border: 0.12rem solid rgba(255, 215, 110, 0.9);
    box-shadow: 0 0.35rem 1rem rgba(80, 0, 0, 0.22);
    text-align: center;
}
.iv-share-card__title {
    font-size: 1.55rem;
    font-weight: 800;
    color: #c81222;
    letter-spacing: 0.12rem;
    margin-bottom: 0.35rem;
}
.iv-share-card__hint {
    font-size: 1.1rem;
    color: #8a4a06;
    letter-spacing: 0.04rem;
    margin-bottom: 1.1rem;
}

.iv-qr {
    width: 16rem;
    height: 16rem;
    margin: 0 auto 1.2rem;
    padding: 0.55rem;
    border-radius: 0.8rem;
    background: #fff;
    border: 0.1rem solid #f3d8a5;
    box-shadow: 0 0.3rem 0.8rem rgba(0, 0, 0, 0.16);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.iv-qr__canvas {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* qrcode.js 同时产出 canvas + img；前者优先显示，img 隐藏避免叠加 */
.iv-qr__canvas canvas { display: block; width: 100% !important; height: 100% !important; }
.iv-qr__canvas img    { display: none; }
.iv-qr__canvas:not(:has(canvas)) img { display: block; width: 100% !important; height: 100% !important; }

.iv-code {
    height: 4.2rem;
    background: #fff;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0 0.45rem 0 1.4rem;
    color: #5d2b0b;
    font-size: 1.2rem;
    box-shadow: 0 0.2rem 0.5rem rgba(180, 80, 0, 0.12);
    border: 0.05rem solid #f3d8a5;
}
.iv-code__label {
    flex: 0 0 auto;
    font-weight: 600;
}
.iv-code__value {
    flex: 1;
    color: #c81222;
    font-size: 1.65rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-align: left;
    font-feature-settings: "tnum" 1, "lnum" 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.iv-code__copy {
    flex: 0 0 auto;
    height: 3.2rem;
    padding: 0 1.3rem;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, #ea1c25, #ad0810);
    color: #fff;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.12rem;
    box-shadow: 0 0.2rem 0.45rem rgba(180, 10, 16, 0.28);
    cursor: pointer;
}
.iv-code__copy:active { transform: translateY(0.08rem); }

.iv-actions {
    margin-top: 1.1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}
.iv-btn {
    height: 4.4rem;
    border: 0;
    border-radius: 999px;
    font-size: 1.32rem;
    font-weight: 800;
    letter-spacing: 0.1rem;
    cursor: pointer;
    transition: transform 0.12s ease;
}
.iv-btn:active { transform: translateY(0.1rem); }
.iv-btn--save {
    background: #fff;
    color: #c81222;
    border: 0.1rem solid #c81222;
}
.iv-btn--copy {
    background: linear-gradient(180deg, #ea1c25, #ad0810);
    color: #fff;
    box-shadow: 0 0.3rem 0.7rem rgba(180, 10, 16, 0.32);
}

/* ===== 提示气泡 ===== */
.iv-toast {
    position: fixed;
    left: 50%;
    bottom: 30%;
    transform: translate(-50%, 1rem);
    padding: 1rem 1.6rem;
    border-radius: 0.6rem;
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    font-size: 1.3rem;
    line-height: 1.4;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 200;
    white-space: nowrap;
}

.iv-toast--show {
    opacity: 1;
    transform: translate(-50%, 0);
}
