/* ============================================================
 * mobile-app.css — 移动端完整样式
 * 包含: body / 顶栏 / Tab Bar / 搜索栏 / 分类Tab / Feed / 浮动条 / 热榜
 * 所有 svg 默认 20x20, 不会变成巨型
 * ============================================================ */

/* ========== 全局重置 ========== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body.bm-app {
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue",
                 "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    color: #1A1A1A;
    background: #F5F6F8;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    padding-top: 0;
}
/* svg 默认尺寸 —— 关键! 防止巨型图标 */
body.bm-app svg {
    width: 20px;
    height: 20px;
    display: block;
    flex-shrink: 0;
}
body.bm-app button { background: none; border: none; font: inherit; color: inherit; cursor: pointer; }
body.bm-app a { /*color: inherit;*/ text-decoration: none; }

/* ========== 1. 顶栏 48px ========== */
.bm-topbar {
    position: sticky;
    top: 0;
    z-index: 200;
    background: #fff;
    padding-top: env(safe-area-inset-top, 0);
    border-bottom: 1px solid #F0F0F0;
}
.bm-topbar-inner {
    height: 48px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 8px;
}
.bm-logo {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    flex-shrink: 0;
    min-width: 0;
}
.bm-logo-img {
    height: 32px;
    width: 32px;
    max-height: 32px;
    max-width: 32px;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
    display: block;
    flex-shrink: 0;
}
.bm-logo-text {
    font-size: 16px;
    color: #2932E1;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bm-top-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}
.bm-search-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}
.bm-search-btn svg { width: 20px; height: 20px; }
.bm-login-btn {
    font-size: 13px;
    color: #2932E1 !important;
    padding: 4px 10px;
    border: 1px solid #2932E1;
    border-radius: 14px;
    background: transparent !important;
}
.bm-avatar, .bm-avatar-text {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #2932E1;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    overflow: hidden;
}
.bm-avatar { object-fit: cover; }

/* ========== 1b. 顶栏下拉搜索框 ========== */
.bm-top-search-pop {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    background: #fff;
    border-top: 1px solid #F0F0F0;
}
.bm-top-search-pop.bm-top-search-show {
    max-height: 80px;
}
.bm-top-search-form {
    display: flex;
    align-items: center;
    gap: 0;
    background: #F2F4F7;
    border-radius: 22px;
    padding: 0 4px 0 12px;
    height: 38px;
    margin: 10px 12px;
}
.bm-top-search-ico {
    width: 16px; height: 16px;
    color: #999;
    flex-shrink: 0;
}
.bm-top-search-form input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    padding: 0 8px;
    min-width: 0;
    font-family: inherit;
    color: #1A1A1A;
}
.bm-top-search-form input::placeholder { color: #B8BEC6; }
.bm-top-search-go {
    background: #2932E1 !important;
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    padding: 0 14px;
    height: 30px !important;
    line-height: 30px;
    border-radius: 18px;
    white-space: nowrap;
    flex-shrink: 0;
    width: auto !important;
    display: inline-block !important;
    border: none;
    cursor: pointer;
}

/* ========== 2. 主内容区 ========== */
.bm-main {
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0) + 8px);
    min-height: calc(100vh - 48px);
}

/* ========== 3. 底部 4 Tab Bar ========== */
.bm-tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #F0F0F0;
    padding-bottom: env(safe-area-inset-bottom, 0);
    height: calc(56px + env(safe-area-inset-bottom, 0));
    display: flex;
    z-index: 200;
}
.bm-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: #999;
    text-decoration: none;
    padding: 6px 0;
}
.bm-tab svg { width: 22px; height: 22px; }
.bm-tab span { font-size: 11px; }
.bm-tab.bm-tab-active { color: #2932E1; }

/* ========== 4. 首页: 搜索栏 ========== */
.bm-hero {
    padding: 14px 14px 8px;
    background: #fff;
}
.bm-hero-search {
    display: flex;
    align-items: center;
    gap: 0;
    background: #F2F4F7;
    border-radius: 24px;
    padding: 4px 4px 4px 14px;
    height: 40px;
}
.bm-hero-search svg {
    width: 18px;
    height: 18px;
    color: #999;
    flex-shrink: 0;
}
.bm-hero-search input[type="text"] {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    padding: 0 10px;
    min-width: 0;
    font-family: inherit;
    color: #1A1A1A;
}
.bm-hero-search input::placeholder { color: #B8BEC6; }
.bm-hero-btn {
    background: #2932E1 !important;
    color: #fff !important;
    font-size: 14px;
    font-weight: 600;
    padding: 0 16px;
    height: 32px !important;
    line-height: 32px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 4px;
    width: auto !important;
    display: inline-block !important;
    box-sizing: border-box;
    border: none;
}

/* 首页顶部 LOGO (移动端) */
.bm-home-logo-wrap {
    padding: 10px 12px 4px;
    text-align: center;
}
.bm-home-logo-img {
    max-width: 100%;
    max-height: 60px;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    display: inline-block;
}

/* ========== 5. 分类 Tab 横滑 ========== */
.bm-cat-tabs {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    padding: 6px 10px 10px;
    gap: 4px;
    border-bottom: 1px solid #F0F0F0;
}
.bm-cat-tabs::-webkit-scrollbar { display: none; }
.bm-cat-tabs a {
    flex-shrink: 0;
    font-size: 14px;
    color: #1A1A1A;
    padding: 6px 14px;
    background: #F2F4F7;
    border-radius: 16px;
    white-space: nowrap;
}
.bm-cat-tabs a.bm-cat-on {
    background: #2932E1;
    color: #fff;
    font-weight: 600;
}

/* ========== 5b. 搜索结果页样式 (图三修复) ========== */
.bm-search-bar {
    background: #fff;
    padding: 10px 14px;
    border-bottom: 1px solid #F0F0F0;
    position: sticky;
    top: 48px;
    z-index: 100;
}
.bm-sresult {
    background: #fff;
    padding: 14px 16px;
    border-bottom: 1px solid #F2F2F2;
}
.bm-sresult a { text-decoration: none; color: inherit; display: block; }
.bm-sresult-title {
    font-size: 16px;
    font-weight: 600;
    color: #1A1A1A;
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.bm-sresult-title em { color: #E81C1C; font-style: normal; font-weight: 600; }
.bm-sresult-snippet {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.bm-sresult-snippet em { color: #E81C1C; font-style: normal; font-weight: 600; }
.bm-sresult-meta {
    font-size: 12px;
    color: #9AA0A6;
    display: flex;
    gap: 12px;
}
.bm-empty {
    text-align: center;
    padding: 60px 20px;
    color: #9AA0A6;
    font-size: 14px;
}

/* ========== 6. 热搜榜大卡片 (隐藏时不渲染, 保留类名备用) ========== */
.bm-page { padding: 0; }
.bm-hero-card {
    background: #fff;
    margin: 10px 12px 0;
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.bm-hc-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #F2F2F2;
}
.bm-hc-ico { font-size: 16px; }
.bm-hc-title { font-size: 15px; font-weight: 700; color: #1A1A1A; }
.bm-hc-more { margin-left: auto; font-size: 12px; color: #999; }
.bm-hc-list { list-style: none; padding: 0; margin: 0; }
.bm-hc-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    cursor: pointer;
}
.bm-hc-r {
    width: 18px; height: 18px;
    border-radius: 3px;
    background: #C8CCD1;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.bm-hc-r.r1, .bm-hc-r.r2, .bm-hc-r.r3 { background: #E81C1C; }
.bm-hc-t {
    flex: 1;
    font-size: 14px;
    color: #1A1A1A;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========== 7. Feed 信息流 ========== */
.bm-feed { padding: 10px 12px 0; }
.bm-icard {
    display: flex;
    gap: 10px;
    background: #fff;
    border-radius: 12px;
    padding: 12px 12px;
    margin-bottom: 10px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}
.bm-icard-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.bm-icard-title {
    font-size: 15px;
    font-weight: 600;
    color: #1A1A1A;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.bm-icard-summary {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.bm-icard-meta {
    font-size: 12px;
    color: #999;
    display: flex;
    gap: 8px;
    margin-top: auto;
}
.bm-icard-img {
    width: 104px;
    height: 82px;
    border-radius: 8px;
    background: #F2F4F7;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.bm-icard-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.bm-icard-img img:not([src]), .bm-icard-img img[src=""] { display: none; }

/* 纯文字卡 (无图) — 全宽 + 更大标题 + 加分割线 */
.bm-icard.bm-icard-text {
    display: block;
    padding: 14px 16px;
}
.bm-icard.bm-icard-text .bm-icard-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.45;
    margin-bottom: 6px;
    -webkit-line-clamp: 2;
}
.bm-icard.bm-icard-text .bm-icard-summary {
    font-size: 13px;
    color: #888;
    line-height: 1.55;
    -webkit-line-clamp: 2;
    margin-bottom: 8px;
}
.bm-icard.bm-icard-text .bm-icard-meta {
    font-size: 12px;
    margin-top: 0;
}

/* ========== 8. 浮动条 ========== */
.bm-float-bar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(64px + env(safe-area-inset-bottom, 0));
    background: linear-gradient(135deg, #2932E1, #1A73E8);
    color: #fff;
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 16px rgba(41,50,225,0.3);
    z-index: 150;
}
.bm-float-info { flex: 1; min-width: 0; }
.bm-float-text {
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bm-float-sub { font-size: 11px; opacity: 0.8; margin-top: 2px; }
.bm-float-btn {
    background: #fff;
    color: #2932E1;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 16px;
    flex-shrink: 0;
}

/* ============================================================
 * Auth 登录/注册/密码修改 (.bm-auth-*)
 * 风格: 百度 App 蓝白风格, 无 auth layout 时 fallback 到 mobile layout
 * ============================================================ */

/* Auth 页面背景: 蓝色渐变 + 白色卡片居中 */
body.bm-auth {
    background: linear-gradient(160deg, #2932E1 0%, #1A73E8 60%, #4A90E2 100%) !important;
    min-height: 100vh;
    padding: 48px 20px 24px;
    display: flex;
    flex-direction: column;
}
.bm-auth-header {
    text-align: center;
    padding: 16px 0 28px;
}
.bm-auth-logo {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 1px;
}
.bm-auth-logo b { color: #FFE066; }
.bm-auth-sub {
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    margin-top: 6px;
}
.bm-auth-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px 20px;
    box-shadow: 0 8px 32px rgba(41,50,225,0.2);
    flex: 1;
}

/* 表单 */
.bm-auth-form { display: block; }
.bm-auth-tabs {
    display: flex;
    border-bottom: 1px solid #F0F0F0;
    margin-bottom: 18px;
}
.bm-auth-tab {
    flex: 1;
    padding: 10px 0;
    font-size: 14px;
    color: #999;
    background: transparent !important;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
}
.bm-auth-tab.active {
    color: #2932E1 !important;
    border-bottom-color: #2932E1;
    font-weight: 600;
}
.bm-auth-field { margin-bottom: 14px; }
.bm-auth-label {
    display: block;
    font-size: 13px;
    color: #333;
    margin-bottom: 6px;
    font-weight: 500;
}
.bm-auth-input {
    width: 100%;
    height: 42px;
    border: 1px solid #E5E6EB;
    border-radius: 10px;
    padding: 0 12px;
    font-size: 14px;
    background: #FAFBFC;
    color: #1A1A1A;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.15s, background 0.15s;
}
.bm-auth-input:focus {
    outline: none;
    border-color: #2932E1;
    background: #fff;
}
.bm-auth-row { display: flex; gap: 10px; }
.bm-auth-half { flex: 1; }
.bm-auth-group { margin-bottom: 4px; }

/* 提交按钮 */
.bm-auth-submit {
    width: 100%;
    height: 44px;
    background: #2932E1 !important;
    color: #fff !important;
    border: none;
    border-radius: 22px;
    font-size: 15px;
    font-weight: 600;
    margin-top: 12px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(41,50,225,0.35);
    display: inline-block !important;
}
.bm-auth-submit:active { opacity: 0.9; }

/* 底部 */
.bm-auth-footer {
    text-align: center;
    margin-top: 18px;
    font-size: 13px;
    color: #70757A;
}
.bm-auth-link {
    color: #2932E1 !important;
    text-decoration: none;
    font-weight: 500;
}
.bm-auth-error {
    background: #FEF0F0;
    color: #D93025;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 14px;
    border-left: 3px solid #D93025;
}

/* 修改密码页 */
.bm-auth-pwd-title {
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    color: #1A1A1A;
    margin-bottom: 4px;
}
.bm-auth-pwd-sub {
    text-align: center;
    color: #999;
    font-size: 13px;
    margin-bottom: 18px;
}

/* ============================================================
 * 热榜专属 (.bh-*)
 * ============================================================ */

/* ---- Banner ---- */
.bh-banner {
    background: linear-gradient(180deg, #FE3C3C 0%, #E81C1C 100%);
    padding: 28px 20px 24px;
    color: #fff;
    text-align: center;
    position: relative;
}
.bh-banner-inner { max-width: 480px; margin: 0 auto; }
.bh-banner-title {
    font-size: 26px; font-weight: 800;
    margin: 0 0 4px;
    letter-spacing: 2px;
}
.bh-banner-sub {
    display: inline-block;
    font-size: 12px;
    background: rgba(255,255,255,0.25);
    padding: 3px 12px;
    border-radius: 12px;
}

/* ---- Tab 横滑 ---- */
.bh-tabs {
    background: #fff;
    border-bottom: 1px solid #F0F0F0;
    position: sticky;
    top: 48px;
    z-index: 150;
}
.bh-tabs-scroll {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 4px;
}
.bh-tabs-scroll::-webkit-scrollbar { display: none; }
.bh-tab {
    flex-shrink: 0;
    padding: 11px 13px;
    font-size: 14px;
    color: #666;
    border-bottom: 2px solid transparent;
    text-decoration: none;
    white-space: nowrap;
}
.bh-tab.bh-tab-on {
    color: #E81C1C;
    border-bottom-color: #E81C1C;
    font-weight: 700;
    font-size: 15px;
}

/* ---- 头条卡片 ---- */
.bh-headline-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #F6F6F6;
    border-bottom: 1px solid #EFEFEF;
    text-decoration: none;
    color: inherit;
}
.bh-headline-ico {
    width: 20px; height: 20px;
    background: #E81C1C;
    color: #fff;
    border-radius: 50%;
    font-size: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.bh-headline-content {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.bh-headline-tip {
    font-size: 11px;
    color: #E81C1C;
    background: #FFE8EA;
    padding: 1px 6px;
    border-radius: 3px;
    flex-shrink: 0;
}
.bh-headline-title {
    font-size: 13px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- 主榜列表 ---- */
.bh-list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #fff;
}
.bh-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #F5F5F5;
    cursor: pointer;
}
.bh-list li:last-child { border-bottom: none; }
.bh-list li:active { background: #FAFAFA; }

.bh-rk {
    width: 22px; height: 22px;
    border-radius: 3px;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    background: #C8CCD1;
}
.bh-rk.rk1 { background: #E81C1C; }
.bh-rk.rk2 { background: #E81C1C; }
.bh-rk.rk3 { background: #E81C1C; }
.bh-rk.rk4 { background: #C8CCD1; }

.bh-li-main {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.bh-title {
    font-size: 15px;
    color: #1A1A1A;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}
.bh-new {
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: #E81C1C;
    padding: 1px 5px;
    border-radius: 2px;
    flex-shrink: 0;
}
.bh-lbl {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 3px;
    flex-shrink: 0;
    white-space: nowrap;
}
.bh-lbl.hot     { background: #FFE8EA; color: #E81C1C; }
.bh-lbl.boil    { background: #FFF3E0; color: #FF6B00; }
.bh-lbl.new     { background: #E3F2FD; color: #1A73E8; }
.bh-lbl.discuss { background: #F5F5F5; color: #616161; }
.bh-lbl.sharp   { background: #FFF8E1; color: #F57C00; }

/* ---- 分榜 (默认收缩, 点击展开) ---- */
.bh-board { background: #fff; }
.bh-board-head {
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 700;
    color: #222;
    background: #fff;
    border-top: 8px solid #F5F5F5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.bh-board-head:active { background: #FAFAFA; }
.bh-arrow {
    font-size: 11px;
    color: #999;
    transition: transform 0.2s;
}
/* 展开的列表复用主榜样式 */
.bh-board-list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #fff;
}
.bh-board-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #F5F5F5;
    cursor: pointer;
}
.bh-board-list li:last-child { border-bottom: none; }
.bh-board-list li:active { background: #FAFAFA; }
