html.wechat-blocked,
html.wechat-blocked body {
    overflow: hidden;
    height: 100%;
}

html.wechat-blocked body > :not(#wechat-browser-guard) {
    visibility: hidden;
}

#wechat-browser-guard {
    position: fixed;
    inset: 0;
    z-index: 2147483646;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    padding: 0;
    background: linear-gradient(180deg, rgba(8, 10, 24, 0.97) 0%, rgba(8, 10, 24, 0.94) 45%, rgba(8, 10, 24, 0.98) 100%);
    visibility: visible;
    overflow: hidden;
}

/* ===== 顶部模拟微信 + 引导动画 ===== */
.wechat-guide-scene {
    position: relative;
    flex: 0 0 auto;
    min-height: 168px;
    padding: env(safe-area-inset-top, 12px) 16px 8px;
    pointer-events: none;
}

.wechat-mock-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    margin-bottom: 8px;
}

.wechat-mock-back {
    position: absolute;
    left: 4px;
    width: 10px;
    height: 10px;
    border-left: 2px solid rgba(255, 255, 255, 0.5);
    border-bottom: 2px solid rgba(255, 255, 255, 0.5);
    transform: rotate(45deg);
}

.wechat-mock-title {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
}

.wechat-mock-dots {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 4px;
    padding: 8px 10px;
    border-radius: 8px;
}

.wechat-mock-dots span {
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #fff;
}

.wechat-anim-dots {
    animation: wechat-dots-glow 1.6s ease-in-out infinite;
}

@keyframes wechat-dots-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(89, 74, 226, 0);
        background: rgba(255, 255, 255, 0.08);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(89, 74, 226, 0.35), 0 0 24px rgba(30, 136, 229, 0.45);
        background: rgba(89, 74, 226, 0.25);
    }
}

.wechat-anim-ring {
    position: absolute;
    top: calc(env(safe-area-inset-top, 12px) + 6px);
    right: 10px;
    width: 52px;
    height: 52px;
    border: 2px solid rgba(89, 74, 226, 0.8);
    border-radius: 50%;
    animation: wechat-ring-pulse 1.6s ease-out infinite;
}

@keyframes wechat-ring-pulse {
    0% {
        transform: scale(0.75);
        opacity: 1;
    }
    100% {
        transform: scale(1.45);
        opacity: 0;
    }
}

.wechat-anim-arrow {
    position: absolute;
    top: calc(env(safe-area-inset-top, 12px) + 52px);
    right: 56px;
    width: 88px;
    height: 88px;
    color: #fff;
    filter: drop-shadow(0 2px 8px rgba(89, 74, 226, 0.6));
    animation: wechat-arrow-float 1.6s ease-in-out infinite;
}

.wechat-arrow-path {
    stroke-dasharray: 120;
    stroke-dashoffset: 120;
    animation: wechat-arrow-draw 2.4s ease-in-out infinite;
}

@keyframes wechat-arrow-draw {
    0% { stroke-dashoffset: 120; opacity: 0.3; }
    40%, 70% { stroke-dashoffset: 0; opacity: 1; }
    100% { stroke-dashoffset: 0; opacity: 0.5; }
}

@keyframes wechat-arrow-float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(6px, -8px); }
}

.wechat-mock-menu {
    position: absolute;
    top: calc(env(safe-area-inset-top, 12px) + 48px);
    right: 12px;
    width: min(220px, 58vw);
    padding: 8px 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    opacity: 0;
    transform: translateY(-12px) scale(0.92);
    transform-origin: top right;
}

.wechat-menu-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    font-size: 14px;
    color: #333;
}

.wechat-menu-icon {
    width: 18px;
    text-align: center;
    font-size: 13px;
}

.wechat-menu-target {
    color: #594AE2;
    font-weight: 700;
    background: linear-gradient(90deg, rgba(89, 74, 226, 0.12), rgba(30, 136, 229, 0.08));
    animation: wechat-menu-highlight 1.2s ease-in-out infinite;
}

@keyframes wechat-menu-highlight {
    0%, 100% { background-color: rgba(89, 74, 226, 0.1); }
    50% { background-color: rgba(89, 74, 226, 0.22); }
}

/* 引导场景随步骤切换 */
.wechat-guide-scene[data-guide-step="0"] .wechat-anim-menu {
    opacity: 0;
    animation: none;
}

.wechat-guide-scene[data-guide-step="1"] .wechat-anim-menu {
    animation: wechat-menu-in 0.55s ease forwards;
}

.wechat-guide-scene[data-guide-step="2"] .wechat-anim-menu {
    opacity: 0.55;
    transform: translateY(0) scale(1);
    animation: wechat-menu-out 0.4s ease forwards;
}

@keyframes wechat-menu-in {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(0.92);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes wechat-menu-out {
    to {
        opacity: 0.35;
        transform: translateY(4px) scale(0.98);
    }
}

.wechat-guide-scene[data-guide-step="0"] .wechat-anim-arrow,
.wechat-guide-scene[data-guide-step="0"] .wechat-anim-ring {
    opacity: 1;
}

.wechat-guide-scene[data-guide-step="1"] .wechat-anim-arrow {
    opacity: 0.35;
    right: 72px;
}

.wechat-guide-scene[data-guide-step="2"] .wechat-anim-arrow,
.wechat-guide-scene[data-guide-step="2"] .wechat-anim-ring {
    opacity: 0;
    transition: opacity 0.35s;
}

/* ===== 底部说明面板 ===== */
.wechat-guard-panel {
    position: relative;
    flex: 0 0 auto;
    width: 100%;
    max-height: min(72vh, 520px);
    padding: 22px 20px calc(22px + env(safe-area-inset-bottom, 0px));
    border-radius: 20px 20px 0 0;
    background: #fff;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.22);
    text-align: center;
    overflow-y: auto;
}

.wechat-step-indicator {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
}

.wechat-step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d8d8e6;
    transition: width 0.35s, background 0.35s;
}

.wechat-step-dot.is-active {
    width: 22px;
    border-radius: 4px;
    background: linear-gradient(90deg, #594AE2, #1E88E5);
}

.wechat-guard-title {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
}

.wechat-guard-desc {
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.65;
    color: #555;
    text-align: left;
}

.wechat-step-cards {
    position: relative;
    min-height: 72px;
    margin-bottom: 14px;
    text-align: left;
}

.wechat-step-card {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f4f3ff;
    border: 1px solid #e4e0ff;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.4s, transform 0.4s;
}

.wechat-step-card.is-active {
    position: relative;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.wechat-step-num {
    flex: 0 0 28px;
    height: 28px;
    line-height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #594AE2, #1E88E5);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
}

.wechat-step-card p {
    margin: 2px 0 0;
    font-size: 15px;
    line-height: 1.55;
    color: #333;
}

.wechat-url-box {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f7f7fb;
    border: 1px dashed #c8c8d8;
    font-size: 12px;
    line-height: 1.5;
    color: #666;
    word-break: break-all;
    text-align: left;
    user-select: all;
    -webkit-user-select: all;
}

.wechat-url-box.is-full {
    font-size: 11px;
    max-height: 72px;
    overflow-y: auto;
}

.wechat-guard-btn {
    display: block;
    width: 100%;
    padding: 14px 16px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #594AE2 0%, #1E88E5 100%);
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(89, 74, 226, 0.35);
    transition: transform 0.15s, box-shadow 0.15s;
}

.wechat-guard-btn:active {
    transform: scale(0.98);
}

.wechat-btn-done {
    display: none;
}

.wechat-guard-btn.is-copied .wechat-btn-label {
    display: none;
}

.wechat-guard-btn.is-copied .wechat-btn-done {
    display: inline;
}

.wechat-guard-btn.is-copied {
    background: linear-gradient(135deg, #2e7d32, #43a047);
    box-shadow: 0 8px 24px rgba(46, 125, 50, 0.35);
}

.wechat-guard-tip {
    min-height: 1.4em;
    margin: 12px 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: #888;
}

.wechat-guard-tip.is-success {
    color: #2e7d32;
    font-weight: 600;
}

.wechat-guard-tip.is-warn {
    color: #e65100;
}

@media (min-width: 480px) {
    #wechat-browser-guard {
        justify-content: center;
        padding: 24px;
    }

    .wechat-guide-scene {
        max-width: 420px;
        margin: 0 auto;
        width: 100%;
    }

    .wechat-guard-panel {
        max-width: 420px;
        margin: 0 auto;
        border-radius: 20px;
    }
}
