:root{
    --fm-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, Arial, sans-serif;
}

/* 强制所有元素 */
*:not(.material-icons):not(.material-icons-outlined):not(.material-icons-round):not(.material-icons-sharp):not(.material-icons-two-tone):not(.fm-toast__icon){
    font-family: var(--fm-font) !important;
}

.fm-toast__icon{
    font-family: 'Material Icons' !important;
    font-weight: normal;
    font-style: normal;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    white-space: nowrap;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}
/* 登录弹窗：强制全站最高层 */
#login_modal.auth-overlay{
    position: fixed;
    inset: 0;
    z-index: 999999 !important;
}

/* 弹窗卡片本身也建立层级 */
#login_modal .auth-card{
    position: relative;
    z-index: 1;
}

/* 关闭按钮：提高层级 + 增大可点击热区 + 适配刘海屏安全区 */
#login_modal .auth-close{
    position: absolute;
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    z-index: 10;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    pointer-events: auto;
}

/* ✅ iOS 防止 input focus 自动放大（放在 auth-modal.css 最底部） */
#login_modal input,
#login_modal select,
#login_modal textarea,
#login_modal .auth-input-wrap input,
#login_modal .auth-input-wrap select,
#login_modal .auth-input-wrap textarea {
    font-size: 16px !important;
    line-height: 1.2;
}

html { -webkit-text-size-adjust: 100%; }
/* iOS：彻底阻止 focus 自动放大（核心：表单控件字号 >=16） */
@supports (-webkit-touch-callout: none) {
    input, select, textarea, button {
        font-size: 16px !important;
    }
    /* 你弹窗里那层再兜一次 */
    #login_modal input,
    #login_modal select,
    #login_modal textarea {
        font-size: 16px !important;
    }
}
@supports (-webkit-touch-callout: none) {
    /* 任意容器 focus-within 时，禁止 scale（你可以按需把选择器缩小到某些弹窗/卡片） */
    .auth-card:focus-within,
    .fm-modal-dialog:focus-within {
        transform: none !important;
    }
}
:root{
    --fm-mb-backbar-h: 52px;
    --fm-mb-tabbar-h: 62px;
}

/* 默认：PC 不显示 */
#mobile_back_header,
#mobile_tabbar{ display:none; }

@media (max-width: 768px){

    /* === TabBar === */
    body.mb-has-tabbar{
        padding-bottom: calc(var(--fm-mb-tabbar-h) + env(safe-area-inset-bottom));
    }
    #mobile_tabbar{
        display:flex;
        position: fixed;
        left:0; right:0; bottom:0;
        height: calc(var(--fm-mb-tabbar-h) + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        background:#fff;
        border-top:1px solid rgba(15,23,42,.10);
        box-shadow: 0 -8px 24px rgba(15,23,42,.10);
        z-index: 999;
        align-items:center;
        justify-content:space-around;
    }

    /* === Back Header === */
    body.mb-use-backheader{
        padding-top: calc(var(--fm-mb-backbar-h) + env(safe-area-inset-top));
    }
    body.mb-use-backheader #mobile_back_header{ display:flex; }

    /* ✅ 关键：使用返回头时，隐藏你现有的完整站点 Header（仅手机） */
    body.mb-use-backheader #site_header{ display:none; }

    #mobile_back_header{
        position: fixed;
        left:0; right:0; top:0;
        height: calc(var(--fm-mb-backbar-h) + env(safe-area-inset-top));
        padding-top: env(safe-area-inset-top);
        background:#fff;
        border-bottom:1px solid rgba(15,23,42,.10);
        z-index:1000;
        align-items:center;
        justify-content:center;
    }
    #mobile_back_header .mbh-left,
    #mobile_back_header .mbh-right{
        position:absolute;
        top: env(safe-area-inset-top);
        height: var(--fm-mb-backbar-h);
        display:flex;
        align-items:center;
    }
    #mobile_back_header .mbh-left{ left:6px; }
    #mobile_back_header .mbh-right{ right:6px; width:44px; } /* 占位保证标题居中 */

    #mobile_back_header .mbh-back{
        width:44px; height:44px;
        display:flex; align-items:center; justify-content:center;
        border-radius:12px;
        color:#0f172a;
        text-decoration:none;
        -webkit-tap-highlight-color: transparent;
    }
    #mobile_back_header .mbh-back:active{ background: rgba(15,23,42,.06); }
    #mobile_back_header .mbh-back .material-icons{ font-size:28px; line-height:1; }

    #mobile_back_header .mbh-title{
        font-size:16px;
        font-weight:900;
        color:#0f172a;
        max-width:72%;
        white-space:nowrap;
        overflow:hidden;
        text-overflow:ellipsis;
    }
}
@media (max-width: 768px){
    #mobile_back_header .mbh-title{
        display:flex;
        align-items:center;
        justify-content:center;
    }

    #mobile_back_header .mbh-logo{
        height: 33px;        /* 你想更大就改 28/30 */
        width: auto;
        display:block;
        object-fit: contain;
    }
}

