/* 微信引流组件样式
   层级关系：常驻入口与一键反馈按钮同层（z-index 60，纵向堆叠），
   智能卡片高于浮动按钮（z-index 9990）但低于一键反馈弹窗（9999），
   移动端卡片为底部横幅形态，打开期间隐藏两个浮动按钮避免遮挡。 */

/* ---------- 常驻浮动入口（位于一键反馈按钮正上方） ---------- */
.wc-entry {
    position: fixed;
    right: 1.25rem;
    bottom: 5.4rem; /* 一键反馈按钮 bottom 1.5rem + 按钮高约 2.9rem + 间距 1rem */
    z-index: 60;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.7rem 0.95rem;
    border: none;
    border-radius: 999px;
    background: #ffffff;
    color: #334155;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.15);
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.2s ease;
}

.wc-entry.is-visible {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.wc-entry:hover {
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.22);
    color: #0ea5e9; /* 站点主色 sky-500 */
}

.wc-entry:active {
    transform: translateY(0) scale(0.98);
}

.wc-entry-emoji {
    font-size: 1.05rem;
    line-height: 1;
}

.wc-entry-text {
    line-height: 1;
}

/* ---------- 智能卡片（桌面右下角滑入 / 移动端底部横幅） ---------- */
.wc-card {
    position: fixed;
    right: 1.25rem;
    bottom: 5.4rem; /* 打开期间常驻入口已隐藏，卡片占据其位置，仍在一键反馈按钮上方 */
    z-index: 9990;
    width: 300px;
    padding: 1.5rem 1.25rem 1.1rem;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 50px -12px rgba(15, 23, 42, 0.28);
    text-align: center;
    opacity: 0;
    transform: translateY(12px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.wc-card.is-open {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

/* 卡片打开期间隐藏常驻入口，避免视觉堆叠 */
body.wc-card-open .wc-entry {
    display: none;
}

.wc-card-close {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.wc-card-close:hover {
    background: #e2e8f0;
    color: #334155;
}

.wc-card-head {
    margin-bottom: 0.6rem;
}

.wc-card-emoji {
    font-size: 1.9rem;
    line-height: 1;
    margin-bottom: 0.4rem;
}

.wc-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
}

.wc-card-text {
    font-size: 0.82rem;
    line-height: 1.6;
    color: #475569;
    margin: 0 0 0.9rem;
}

.wc-card-text b {
    color: #0ea5e9;
}

.wc-card-qr {
    width: 150px;
    height: 150px;
    margin: 0 auto 0.8rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
}

.wc-card-qr img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: pointer; /* 点击二维码也计为扫码意图 */
    transition: transform 0.2s ease;
}

.wc-card-qr img:hover {
    transform: scale(1.03);
}

/* 二维码图片缺失时的兜底提示（不影响微信号复制功能） */
.wc-card-qr.wc-qr-missing img {
    display: none;
}

.wc-card-qr.wc-qr-missing::after {
    content: "二维码待配置\A替换 static/img/wechat-qr.png";
    white-space: pre;
    font-size: 0.7rem;
    color: #94a3b8;
    line-height: 1.6;
}

.wc-card-id {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #f1f5f9;
    border-radius: 10px;
    margin-bottom: 0.75rem;
}

.wc-card-id-label {
    font-size: 0.75rem;
    color: #64748b;
    flex-shrink: 0;
}

.wc-card-id code {
    font-size: 0.85rem;
    font-weight: 600;
    color: #0f172a;
    word-break: break-all;
}

.wc-copy-btn {
    flex-shrink: 0;
    padding: 0.3rem 0.7rem;
    border: none;
    border-radius: 8px;
    background: #0ea5e9;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.wc-copy-btn:hover {
    background: #0284c7;
}

.wc-card-dismiss {
    width: 100%;
    padding: 0.5rem 0;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 0.75rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.wc-card-dismiss:hover {
    color: #64748b;
}

/* ---------- 移动端：卡片降级为底部横幅（无遮罩、不覆盖内容，规避插页惩罚） ---------- */
@media (max-width: 768px) {
    .wc-entry {
        right: 0.875rem;
        bottom: 4.5rem; /* 与移动端一键反馈按钮（bottom 1rem）保持堆叠间距 */
        padding: 0.65rem 0.9rem;
        font-size: 0.8rem;
    }

    .wc-entry-emoji {
        font-size: 1rem;
    }

    .wc-card {
        left: 0.75rem;
        right: 0.75rem;
        bottom: 0;
        width: auto;
        border-radius: 16px 16px 0 0;
        padding: 1.25rem 1.1rem 1rem;
        transform: translateY(100%);
    }

    .wc-card.is-open {
        transform: none;
    }

    /* 横幅贴底会盖住浮动按钮，打开期间一并隐藏 */
    body.wc-card-open .qf-trigger {
        display: none;
    }
}

/* ---------- 反馈成功弹窗内嵌引导（黄金时机层） ---------- */
.wc-inline {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-align: left;
}

.wc-inline-qr {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 8px;
    object-fit: contain;
    cursor: pointer;
}

.wc-inline-body {
    min-width: 0;
}

.wc-inline-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 0.2rem;
}

.wc-inline-sub {
    font-size: 0.72rem;
    line-height: 1.5;
    color: #64748b;
    margin: 0 0 0.45rem;
}

@media (max-width: 480px) {
    /* 小屏成功弹窗较窄，内嵌块收紧间距 */
    .wc-inline {
        gap: 0.5rem;
        padding: 0.6rem;
    }

    .wc-inline-qr {
        width: 54px;
        height: 54px;
    }
}
