/* ============================================================================
 * 手机端官网样式 mobile.css
 * ----------------------------------------------------------------------------
 * 作用：独立手机端展示官网的全部样式（顶部栏 / 内容区 / 底部导航栏 / 卡片 / 按钮等）。
 * 设计：高端企业蓝 + 白，移动优先，单列布局，安全区适配，动效克制。
 * 变量：--m-accent 主强调色（由后台「前端设计·手机端H5」主题色注入）。
 * ========================================================================== */

/* -------------------- 基础重置 -------------------- */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
    --m-accent: #2f6fed;
    --m-bg: #f4f6fb;
    --m-card: #ffffff;
    --m-text: #131b2e;
    --m-soft: #5b6578;
    --m-line: #eceff5;
    --m-radius: 16px;
    --m-appbar-h: 52px;
    --m-tabbar-h: 60px;
    --m-tabbar-visible: 6;
}
html, body { height: 100%; }
.m-body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: var(--m-bg);
    color: var(--m-text);
    font-size: 15px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* 主体内部滚动，顶部/底部固定 */
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* -------------------- 顶部品牌栏 -------------------- */
.m-appbar {
    height: var(--m-appbar-h);
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: rgba(255,255,255,.92);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s ease, box-shadow .2s ease;
    z-index: 20;
}
.m-appbar.scrolled { border-color: var(--m-line); box-shadow: 0 4px 16px rgba(20,40,90,.06); }
.m-brand { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.m-brand-mark { font-size: 20px; }
.m-brand-logo { width: 26px; height: 26px; border-radius: 7px; object-fit: cover; }
.m-brand-name { font-size: 16px; letter-spacing: .3px; }
.m-appbar-login {
    font-size: 13px; font-weight: 600; color: var(--m-accent);
    padding: 5px 14px; border: 1px solid var(--m-accent); border-radius: 999px;
}

/* -------------------- 主体滚动区 -------------------- */
.m-main {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px 14px calc(var(--m-tabbar-h) + env(safe-area-inset-bottom) + 14px);
}

/* -------------------- 通用区块 / 卡片 -------------------- */
.m-section { margin-bottom: 20px; }
.m-section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 2px 12px; }
.m-section-title { font-size: 17px; font-weight: 800; }
.m-section-more { font-size: 13px; color: var(--m-accent); font-weight: 600; }
.m-card {
    background: var(--m-card);
    border-radius: var(--m-radius);
    padding: 16px;
    box-shadow: 0 6px 20px rgba(23,43,86,.05);
}

/* -------------------- 首页 Hero -------------------- */
.m-hero {
    position: relative;
    border-radius: 20px;
    padding: 26px 20px;
    color: #fff;
    overflow: hidden;
    background: linear-gradient(135deg, var(--m-accent), #16357e);
    box-shadow: 0 14px 34px rgba(31,74,168,.28);
    margin-bottom: 18px;
}
.m-hero::after {
    content: ""; position: absolute; right: -40px; top: -40px;
    width: 160px; height: 160px; border-radius: 50%;
    background: rgba(255,255,255,.12);
}
.m-hero-badge { font-size: 12px; letter-spacing: 2px; opacity: .85; }
.m-hero-title { font-size: 24px; font-weight: 900; margin: 8px 0; line-height: 1.3; }
.m-hero-desc { font-size: 13.5px; opacity: .9; max-width: 90%; }
.m-hero-actions { display: flex; gap: 10px; margin-top: 18px; }

/* -------------------- 数据条 -------------------- */
.m-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.m-stat { background: var(--m-card); border-radius: 14px; padding: 14px 8px; text-align: center; box-shadow: 0 6px 20px rgba(23,43,86,.05); }
.m-stat-num { font-size: 22px; font-weight: 900; color: var(--m-accent); }
.m-stat-label { font-size: 12px; color: var(--m-soft); margin-top: 2px; }

/* -------------------- 应用网格 / 列表 -------------------- */
.m-app-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.m-app-card {
    background: var(--m-card); border-radius: var(--m-radius); padding: 16px 14px;
    box-shadow: 0 6px 20px rgba(23,43,86,.05);
    transition: transform .15s ease, box-shadow .15s ease;
}
.m-app-card:active { transform: scale(.97); box-shadow: 0 10px 26px rgba(31,74,168,.14); }
.m-app-ico { font-size: 30px; }
.m-app-name { font-weight: 800; margin-top: 8px; font-size: 15px; }
.m-app-desc { font-size: 12.5px; color: var(--m-soft); margin-top: 4px; min-height: 34px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.m-app-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.m-app-price { font-weight: 800; color: #f5576c; font-size: 15px; }
.m-app-price .free { color: #16a34a; }
.m-app-go { font-size: 12px; color: var(--m-accent); font-weight: 700; }

/* 列表型（应用页/价格页） */
.m-list { display: flex; flex-direction: column; gap: 10px; }
.m-row {
    display: flex; align-items: center; gap: 12px;
    background: var(--m-card); border-radius: 14px; padding: 13px 14px;
    box-shadow: 0 5px 16px rgba(23,43,86,.05);
    transition: transform .15s ease;
}
.m-row:active { transform: scale(.98); }
.m-row-ico { font-size: 26px; width: 40px; text-align: center; flex: 0 0 auto; }
.m-row-main { flex: 1 1 auto; min-width: 0; }
.m-row-name { font-weight: 700; font-size: 15px; }
.m-row-desc { font-size: 12px; color: var(--m-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-row-right { flex: 0 0 auto; text-align: right; }
.m-row-price { font-weight: 800; color: #f5576c; }
.m-row-price .free { color: #16a34a; }
.m-row-days { font-size: 11px; color: var(--m-soft); }

/* -------------------- 优势特性 -------------------- */
.m-feats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.m-feat { background: var(--m-card); border-radius: 14px; padding: 14px; box-shadow: 0 5px 16px rgba(23,43,86,.05); }
.m-feat-ico { font-size: 24px; }
.m-feat-title { font-weight: 800; margin-top: 8px; font-size: 14px; }
.m-feat-desc { font-size: 12px; color: var(--m-soft); margin-top: 3px; }

/* -------------------- 按钮 -------------------- */
.m-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 11px 20px; border-radius: 999px; font-weight: 700; font-size: 14px;
    border: none; cursor: pointer; transition: transform .12s ease, opacity .2s ease;
}
.m-btn:active { transform: scale(.96); }
.m-btn-primary { background: var(--m-accent); color: #fff; box-shadow: 0 8px 20px rgba(31,74,168,.28); }
.m-btn-light { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.4); }
.m-btn-ghost { background: #eef3ff; color: var(--m-accent); }
.m-btn-block { display: flex; width: 100%; }
.m-btn-lg { padding: 14px 24px; font-size: 15px; }

/* -------------------- 详情页 -------------------- */
.m-detail-head { text-align: center; padding: 26px 16px 20px; }
.m-detail-ico { font-size: 56px; }
.m-detail-name { font-size: 22px; font-weight: 900; margin-top: 10px; }
.m-detail-desc { font-size: 14px; color: var(--m-soft); margin-top: 8px; }
.m-detail-meta { display: flex; gap: 12px; justify-content: center; margin-top: 16px; }
.m-meta-pill { background: var(--m-card); border-radius: 12px; padding: 10px 16px; box-shadow: 0 5px 16px rgba(23,43,86,.05); text-align: center; }
.m-meta-num { font-weight: 900; color: var(--m-accent); font-size: 18px; }
.m-meta-num.price { color: #f5576c; }
.m-meta-label { font-size: 11px; color: var(--m-soft); }
.m-buybar {
    margin: 18px 0 8px;
    padding: 14px 16px;
    background: var(--m-card);
    border: 1px solid var(--m-line);
    border-radius: var(--m-radius);
    box-shadow: 0 6px 20px rgba(23, 43, 86, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

/* -------------------- 我的 / 登录 -------------------- */
.m-me-hero { background: linear-gradient(135deg, var(--m-accent), #16357e); color: #fff; border-radius: 20px; padding: 24px 20px; text-align: center; margin-bottom: 16px; box-shadow: 0 14px 34px rgba(31,74,168,.24); }
.m-me-avatar { width: 60px; height: 60px; border-radius: 50%; background: rgba(255,255,255,.2); display: inline-flex; align-items: center; justify-content: center; font-size: 30px; }
.m-menu { background: var(--m-card); border-radius: var(--m-radius); overflow: hidden; box-shadow: 0 6px 20px rgba(23,43,86,.05); }
.m-menu-item { display: flex; align-items: center; gap: 12px; padding: 15px 16px; border-bottom: 1px solid var(--m-line); }
.m-menu-item:last-child { border-bottom: none; }
.m-menu-ico { font-size: 20px; width: 24px; text-align: center; }
.m-menu-txt { flex: 1 1 auto; font-weight: 600; }
.m-menu-arrow { color: var(--m-soft); }

.m-form { background: var(--m-card); border-radius: var(--m-radius); padding: 18px; box-shadow: 0 6px 20px rgba(23,43,86,.05); }
.m-field { margin-bottom: 14px; }
.m-field label { display: block; font-size: 13px; font-weight: 600; color: var(--m-text); margin-bottom: 6px; }
.m-input { width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--m-line); border-radius: 12px; font-size: 15px; background: #fafbfe; }
.m-input:focus { outline: none; border-color: var(--m-accent); background: #fff; }

/* -------------------- 教程/步骤 -------------------- */
.m-steps { display: flex; flex-direction: column; gap: 10px; }
.m-step { display: flex; gap: 12px; background: var(--m-card); border-radius: 14px; padding: 14px; box-shadow: 0 5px 16px rgba(23,43,86,.05); }
.m-step-no { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; background: var(--m-accent); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.m-step-title { font-weight: 700; }
.m-step-desc { font-size: 12.5px; color: var(--m-soft); }

/* -------------------- 页脚 -------------------- */
.m-footer { text-align: center; color: var(--m-soft); font-size: 12px; padding: 22px 0 8px; }
.m-switch-pc { display: inline-block; margin-top: 8px; color: var(--m-accent); font-weight: 600; }

/* -------------------- 空状态 -------------------- */
.m-empty { text-align: center; color: var(--m-soft); padding: 50px 20px; font-size: 14px; }
.m-empty-state { text-align: center; padding: 56px 24px; color: var(--m-soft); }
.m-empty-state .m-empty-ico { font-size: 42px; margin-bottom: 12px; }
.m-empty-state p { margin: 0 0 6px; font-size: 15px; font-weight: 700; color: #334155; }
.m-empty-state span { font-size: 12px; }
.m-decor-page { padding-bottom: 8px; overflow-x: hidden; max-width: 100%; }
/* 装修块手机布局见 fedesign-mobile-blocks.css（与电脑端组件视觉分离） */

/* -------------------- 搜索框 -------------------- */
.m-search { position: relative; margin-bottom: 14px; }
.m-search input { width: 100%; height: 44px; padding: 0 16px 0 40px; border: 1px solid var(--m-line); border-radius: 999px; background: #fff; font-size: 14px; }
.m-search input:focus { outline: none; border-color: var(--m-accent); }
.m-search .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--m-soft); }

/* -------------------- 底部功能导航栏（固定） -------------------- */
.m-tabbar {
    flex: 0 0 auto;
    height: calc(var(--m-tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    display: flex;
    background: rgba(255,255,255,.96);
    backdrop-filter: saturate(180%) blur(12px);
    border-top: 1px solid var(--m-line);
    z-index: 30;
}
.m-tab {
    flex: 1 1 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--m-soft); font-size: 11px; font-weight: 600;
    transition: color .15s ease;
}
.m-tab-ico { font-size: 21px; line-height: 1; transition: transform .18s ease; filter: grayscale(1) opacity(.7); }
.m-tab.active { color: var(--m-accent); }
.m-tab.active .m-tab-ico { transform: translateY(-2px) scale(1.12); filter: none; }
.m-tabbar.is-scroll {
    overflow-x: auto; overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    scrollbar-width: none;
    display: block;
    container-type: inline-size;
}
.m-tabbar.is-scroll::-webkit-scrollbar { display: none; }
.m-tabbar.is-scroll .m-tabbar-track {
    display: inline-flex; flex-wrap: nowrap;
    width: max-content; min-width: 100%;
}
.m-tabbar.is-scroll .m-tab {
    /* 相对底栏视口宽度：一屏刚好显示 N 个 */
    flex: 0 0 calc(100cqw / var(--m-tabbar-visible, 6)) !important;
    width: calc(100cqw / var(--m-tabbar-visible, 6));
    max-width: none;
    box-sizing: border-box;
}
.m-tabbar:not(.is-scroll) .m-tabbar-track { display: flex; width: 100%; }

/* -------------------- Toast -------------------- */
.m-toast {
    position: fixed; left: 50%; top: 64px; transform: translateX(-50%);
    max-width: 86%; padding: 10px 18px; border-radius: 12px; font-size: 13.5px; z-index: 60;
    box-shadow: 0 10px 30px rgba(0,0,0,.16); transition: opacity .4s ease, transform .4s ease;
}
.m-toast-error { background: #fff1f3; color: #db2777; border: 1px solid #fbd0da; }
.m-toast-ok { background: #dcfce7; color: #16a34a; border: 1px solid #bbf7d0; }
.m-toast.hide { opacity: 0; transform: translateX(-50%) translateY(-8px); }
