/* =============================================================================
 * 邀约（邀请好友）样式 —— 与首页 hero 区主按钮同源（1rem = 10px）
 *
 * 与「免费下载」的关系：同高、同圆角、同水平排布，但**白底描边**，
 * 视觉上明确是次级按钮，不抢主 CTA。
 * ============================================================================= */

.btn-invite {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    height: 6.8rem;
    padding: 0 2.4rem;
    background: #FFFFFF;
    border: 1px solid #D5DCEC;
    border-radius: 4rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.8rem;
    color: #2E3A59;
    line-height: 1;
    white-space: nowrap;
    transition: border-color 0.2s, color 0.2s, transform 0.2s;
}

.btn-invite:hover {
    border-color: #5B4BE8;
    color: #3F32C9;
    transform: translateY(-1px);
}

.btn-invite .icon-gift {
    width: 1.8rem;
    height: 1.8rem;
    flex: none;
    color: #5B4BE8;
}

.btn-invite .tag {
    font-size: 1.1rem;
    font-weight: 500;
    color: #15803D;
    background: #ECF9F0;
    border-radius: 0.4rem;
    padding: 0.3rem 0.6rem;
    line-height: 1;
}

/* ---------------------------------------------------------------------------
 * 主/次互换：URL 带 invite 或 inviteCode 时，.buttons 会被加上 is-invite-focus
 *   免费下载 → 降级成白底描边（把它身上 6 层装饰全部压掉）
 *   邀请好友 → 升级成跟主按钮完全相同的渐变
 * 位置、宽度、高度、圆角、内边距一律不动，只换颜色。
 * ------------------------------------------------------------------------- */

/* 下载按钮里的单色图标（替代原来的 ⚡ emoji，白底上不会显脏） */
.btn-icon-download {
    width: 1em;
    height: 1em;
    vertical-align: -0.12em;
    margin-right: 0.12em;
}

/* ===== 免费下载降级 ===== */
.buttons.is-invite-focus .btn-enhanced {
    background: #FFFFFF;
    border: 1px solid #D5DCEC;
    box-shadow: none;
    animation: none;
    filter: none;
}

/* ::before 是白色光斑、::after 是 45° 扫光 —— 白底上会变成脏痕，必须关掉 */
.buttons.is-invite-focus .btn-enhanced::before,
.buttons.is-invite-focus .btn-enhanced::after {
    display: none;
}

.buttons.is-invite-focus .btn-enhanced .btn-main-text {
    color: #2E3A59;
    text-shadow: none;
}

.buttons.is-invite-focus .btn-enhanced .btn-sub-text {
    color: #8A94A6;
    text-shadow: none;
}

/* 箭头留一点品牌色，避免整个按钮完全没有色彩 */
.buttons.is-invite-focus .btn-enhanced .icon-arrow {
    color: #5B4BE8;
}

/* hover：只上浮，不放大（白色大块放大比彩色更扎眼），也不加 brightness */
.buttons.is-invite-focus .btn-enhanced:hover {
    transform: translateY(-4px);
    background: #FFFFFF;
    border-color: #5B4BE8;
    box-shadow: 0 6px 18px rgba(46, 58, 89, 0.08);
    filter: none;
}

.buttons.is-invite-focus .btn-enhanced:active {
    transform: translateY(-1px);
    box-shadow: none;
}

/* ---------------------------------------------------------------------------
 * 🚧 测试期隐藏入口（invite.js 里 HIDE_ENTRY = true 时生效）
 *
 * 挪到导航栏下方的左上角，做成一块**完全透明但仍可点击**的区域。
 * 不用 display:none / visibility:hidden —— 那会连点击一起禁掉。
 * 开放给用户时，把 invite.js 的 HIDE_ENTRY 改成 false 即可恢复原按钮。
 * ------------------------------------------------------------------------- */
.btn-invite.is-ghost {
    position: fixed;
    left: 0;
    top: 58px;
    width: 96px;
    height: 30px;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    color: transparent;
    font-size: 0;
    line-height: 0;
    z-index: 900;
    cursor: default;
    animation: none;
    transform: none;
}

.btn-invite.is-ghost:hover,
.btn-invite.is-ghost:active {
    background: transparent;
    border: none;
    box-shadow: none;
    transform: none;
    animation: none;
}

.btn-invite.is-ghost .icon-gift,
.btn-invite.is-ghost .tag {
    display: none;
}

/* ===== 邀请好友升级成主按钮：与免费下载同一套渐变与动画 ===== */
.btn-invite.is-highlight {
    background: linear-gradient(135deg, #2563EB, #7C3AED, #06B6D4);
    background-size: 300% 300%;
    animation: gradientShift 4s ease infinite;
    border-color: rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.3),
                0 4px 12px rgba(124, 58, 237, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-invite.is-highlight:hover {
    background: linear-gradient(135deg, #1E40AF, #6D28D9, #0891B2);
    border-color: rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
    transform: translateY(-1px);
}

.btn-invite.is-highlight .tag {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.2);
}

.btn-invite.is-highlight .icon-gift {
    color: #FFFFFF;
}

/* ---------------------------------------------------------------- 分享面板 */
.cti-mask {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cti-box {
    width: 100%;
    max-width: 430px;
    background: #FFFFFF;
    border-radius: 14px;
    padding: 20px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    animation: cti-in 0.18s ease-out;
}

@keyframes cti-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cti-head {
    display: flex;
    align-items: center;
    margin-bottom: 14px;
}

.cti-title {
    font-size: 15px;
    font-weight: 600;
    color: #1F2733;
}

.cti-close {
    margin-left: auto;
    border: none;
    background: transparent;
    font-size: 16px;
    color: #9AA5B5;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.cti-close:hover { color: #4A5566; }

.cti-link-row {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.cti-link {
    flex: 1;
    min-width: 0;
    height: 38px;
    padding: 0 10px;
    background: #F6F8FC;
    border: 1px solid #E4E9F2;
    border-radius: 8px;
    font-size: 12px;
    color: #3A4658;
    line-height: 36px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cti-copy {
    flex: none;
    height: 38px;
    padding: 0 16px;
    border: none;
    border-radius: 8px;
    background: #5B4BE8;
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.cti-copy:hover { background: #4B3FD1; }
.cti-copy.is-done { background: #15803D; }

.cti-steps {
    background: #F8FAFD;
    border-radius: 10px;
    padding: 13px 14px 12px;
}

.cti-step {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-bottom: 8px;
    font-size: 12px;
    color: #4A5566;
    line-height: 1.5;
}

.cti-step:last-child { margin-bottom: 0; }

.cti-step i {
    flex: none;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #E7E4FB;
    color: #4B3FD1;
    font-size: 11px;
    font-style: normal;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cti-reward {
    margin-top: 12px;
    font-size: 12px;
    font-weight: 500;
    color: #15803D;
}

.cti-error {
    margin-top: 10px;
    font-size: 12px;
    color: #C0392B;
}

/* ---------------------------------------------------------------- 移动端 */
@media (max-width: 768px) {
    .buttons {
        flex-direction: column;
        align-items: center;
        gap: 1.6rem;
    }

    .btn-invite {
        width: 100%;
        max-width: 340px;
        min-width: 300px;
        height: auto;
        min-height: 60px;
        padding: 14px 24px;
        font-size: 1.6rem;
    }

    .cti-box { padding: 16px; }
}
