/* ==================== 手机端专用样式（独立于 style.css，便于整体回滚） ==================== */
/* 说明：本文件为手机端首页的专门 UI，桌面端隐藏，≤768px 生效。 */
/* 回滚方式：删除本文件 + 移除 index.html 中的引入 + 移除 m-home / m-bottom-nav 结构即可。 */

.m-home {
    display: none;
}
.m-bottom-nav {
    display: none;
}
.m-msg-bar {
    display: none;
}

@media (max-width: 768px) {
    /* ---------- 隐藏桌面端首页与旧移动端头部（顶部改用 60px 空区） ---------- */
    .home-view,
    .site-footer {
        display: none !important;
    }
    .header,
    .mobile-header,
    .mobile-menu-panel,
    .mobile-menu-mask {
        display: none !important;
    }

    /* ---------- 主内容区：下方 #f5f9fc 背景填满（首页由 .m-home 自带背景覆盖，不受影响） ---------- */
    .content {
        background: #f5f9fc;
    }

    /* ---------- 手机端首页容器：三层背景叠加（色层 → 图层面 → 内容层） ---------- */
    .m-home {
        display: block;
        min-height: 100%;
        position: relative;
    }
    /* 背景色层（底层） */
    .m-bg-color {
        position: absolute;
        inset: 0;
        background: #bbdefc;
        z-index: 0;
    }
    /* bg_head.png 图片层（中层，完整显示不裁剪） */
    .m-bg-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        aspect-ratio: 1006 / 1013;
        background: url('../images/mobile_bg_head.png') no-repeat center top / 100% auto;
        z-index: 1;
    }
    /* 内容层（最上层） */
    .m-home-content {
        position: relative;
        z-index: 2;
    }

    /* ---------- 左上角消息 / 私信图标：上、左、中间均间隔 20px（随页面滚动） ---------- */
    .m-msg-bar {
        position: absolute;
        top: 20px;
        left: 20px;
        z-index: 3;
        display: flex;
        gap: 20px;
    }
    .m-msg-btn {
        position: relative;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #2588bf;
        text-decoration: none;
    }
    .m-msg-btn .iconfont {
        font-size: 28px;
        line-height: 1;
    }
    .m-msg-dot {
        position: absolute;
        top: -6px;
        right: -10px;
        min-width: 16px;
        height: 16px;
        line-height: 14px;
        padding: 0 4px;
        border-radius: 999px;
        background-color: #f5222d;
        color: #fff;
        font-size: 10px;
        font-weight: 600;
        text-align: center;
        box-sizing: border-box;
        border: 1px solid #fff;
        white-space: nowrap;
    }
    .m-top-space {
        height: 80px;
    }

    /* ---------- 头部介绍区：透明，简介 div 无专门背景色 ---------- */
    .m-hero {
        padding: 0 18px 28px;
    }
    .m-intro {
        display: flex;
        align-items: center;
        gap: 14px;
    }
    .m-intro-text {
        flex: 1;
        min-width: 0;
    }
    .m-site-name {
        font-size: 24px;
        font-weight: 700;
        color: #155f8f;
        letter-spacing: 1px;
    }
    .m-site-desc {
        margin-top: 8px;
        font-size: 13px;
        line-height: 1.7;
        color: #4d82a6;
    }
    .m-robot {
        width:120px;
        height: auto;
        flex-shrink: 0;
    }

    /* ---------- 主体内容 ---------- */
    .m-body {
        padding: 0 14px;
    }
    .m-section-title {
        display: flex;
        align-items: center;
        gap: 6px;
        margin: 20px 4px 10px;
        font-size: 15px;
        font-weight: 700;
        color: #155f8f;
    }
    .m-section-title .iconfont {
        font-size: 18px;
        color: #2588bf;
    }

    /* ---------- 工具区外围框：白边 + 轻度透明背景，卡片距外 div 16px ---------- */
    .m-tool-box {
        border: 1px solid rgba(255, 255, 255, 0.9);
        background: rgba(255, 255, 255, 0.45);
        -webkit-backdrop-filter: blur(8px);
        backdrop-filter: blur(8px);
        border-radius: 16px;
        padding: 16px;
        box-shadow: 0 4px 16px rgba(37, 136, 191, 0.10);
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    /* ---------- 单行卡片：圆角矩形 + 渐变背景 #feffff → #e6f5fd（从上到下） ---------- */
    .m-tool-card {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 14px;
        border-radius: 12px;
        background: linear-gradient(to bottom, #feffff 0%, #e6f5fd 100%);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .m-tool-card:active {
        background: #d9edfa;
    }
    .m-tool-icon {
        flex-shrink: 0;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .m-tool-icon img {
        width: 32px;
        height: 32px;
        object-fit: contain;
        display: block;
    }
    .m-tool-icon .iconfont {
        font-size: 17px;
        color: #2588bf;
    }
    .m-tool-info {
        flex: 1;
        min-width: 0;
    }
    .m-tool-name {
        font-size: 15px;
        font-weight: 600;
        color: #1d3d52;
    }
    .m-tool-desc {
        margin-top: 3px;
        font-size: 12px;
        color: #6b8aa3;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* ---------- 底部占位：给固定菜单留空间（底部菜单上移 20px，占位同步加高） ---------- */
    .m-bottom-space {
        height: 96px;
    }

    /* ---------- 底部固定菜单 ---------- */
    .m-bottom-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9000;
        padding-bottom: calc(env(safe-area-inset-bottom) + 20px);
        background: rgba(255, 255, 255, 0.94);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        border-top: 1px solid rgba(255, 255, 255, 0.85);
        box-shadow: 0 -3px 12px rgba(37, 136, 191, 0.08);
    }
    .m-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        height: 56px;
        color: #8ba2b3;
        text-decoration: none;
        font-size: 11px;
    }
    .m-nav-icon {
        font-size: 22px;
        line-height: 1;
    }
    .m-nav-item.active {
        color: #2588bf;
        font-weight: 600;
    }

    /* ---------- 工具页/子页面 iframe：底部留出固定菜单高度，避免被遮挡 ---------- */
    .entry-view {
        padding-bottom: 76px;
        padding-bottom: calc(56px + env(safe-area-inset-bottom) + 20px);
    }
}
