/* ============================================================
 * 微信内置浏览器访问守卫（强制引导到手机浏览器）
 * 配套脚本：/static/js/wechat-guard.js
 * 说明：脚本会在 <html> 上加 .wg-on，先隐藏 body 避免内容闪现；
 *       遮罩节点挂在 <html> 下，因此不受 body visibility 影响。
 * ============================================================ */

html.wg-on body {
    visibility: hidden !important;
}

#wechat-guard {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background:
        radial-gradient(circle at 12% 6%, rgba(255, 170, 128, .30) 0%, rgba(255, 170, 128, 0) 42%),
        radial-gradient(circle at 92% 18%, rgba(125, 150, 255, .22) 0%, rgba(125, 150, 255, 0) 40%),
        linear-gradient(180deg, #fdf8f4 0%, #f4f6ff 58%, #ffffff 100%);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    color: #2b2620;
}

#wechat-guard .wg-guide {
    position: absolute;
    top: 14px;
    right: 18px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    color: #e5483d;
    font-size: 13px;
    letter-spacing: .5px;
}

#wechat-guard .wg-arrow {
    font-size: 32px;
    line-height: 1;
    margin-right: 10px;
    animation: wg-arrow-move 1.6s ease-in-out infinite;
}

@keyframes wg-arrow-move {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(6px, -6px);
    }
}

#wechat-guard .wg-card {
    width: 100%;
    max-width: 342px;
    background: #fffdf8;
    border-radius: 18px;
    padding: 26px 22px 22px;
    box-sizing: border-box;
    text-align: center;
    box-shadow: 0 18px 44px -22px rgba(27, 25, 22, .55), inset 0 1px 0 rgba(255, 255, 255, .9);
}

#wechat-guard .wg-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
}

#wechat-guard .wg-logo {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: linear-gradient(180deg, #3a332b, #221f1b);
    color: #f7f1e3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
}

#wechat-guard .wg-name {
    font-size: 15px;
    color: #5c564c;
    letter-spacing: .5px;
}

#wechat-guard .wg-title {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1px;
}

#wechat-guard .wg-sub {
    margin: 0 0 18px;
    font-size: 13px;
    color: #8b8578;
}

#wechat-guard .wg-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    text-align: left;
}

#wechat-guard .wg-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #eee4d2;
    border-radius: 12px;
    background: #faf4e8;
    font-size: 14px;
    color: #4a443a;
}

#wechat-guard .wg-step-index {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #3a332b;
    color: #f7f1e3;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#wechat-guard .wg-copy {
    width: 100%;
    height: 46px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(180deg, #3a332b, #221f1b);
    color: #f7f1e3;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .5px;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease;
    box-shadow: 0 8px 18px -12px rgba(27, 25, 22, .9);
}

#wechat-guard .wg-copy:active {
    transform: scale(.97);
}

#wechat-guard .wg-manual {
    display: none;
    margin-top: 12px;
}

#wechat-guard .wg-manual.show {
    display: block;
}

#wechat-guard .wg-manual textarea {
    width: 100%;
    height: 72px;
    padding: 8px 10px;
    box-sizing: border-box;
    border: 1px solid #e0d7c6;
    border-radius: 10px;
    background: #fffdf8;
    color: #4a443a;
    font-size: 12px;
    line-height: 1.6;
    resize: none;
}

#wechat-guard .wg-note {
    margin: 12px 0 0;
    font-size: 12px;
    line-height: 1.7;
    color: #9aa0b0;
}

@media (max-height: 640px) {
    #wechat-guard {
        align-items: flex-start;
        padding-top: 40px;
    }

    #wechat-guard .wg-card {
        padding: 20px 18px 18px;
    }

    #wechat-guard .wg-title {
        font-size: 18px;
    }

    #wechat-guard .wg-steps {
        margin-bottom: 16px;
    }
}

@media (prefers-color-scheme: dark) {
    /* 保持纸底配色，不改暗色，避免与站点主题冲突 */
}
