/* ============================================================
   手机端适配（v1.0.5）
   底部 APP 导航（首页/板块/发帖/消息/我的）+ 板块底部抽屉
   顶栏精简 + 页脚隐藏 + 列表/楼层/表单细化
   断点 760px 与既有 .f-layout 单栏断点保持一致
   ============================================================ */

/* 手机专用元素：PC 端一律不显示（媒体查询内再打开） */
.f-tabbar, .f-sheet, .f-search-toggle { display: none; }

@media (max-width: 760px) {

  /* ---------- 顶栏精简 ---------- */
  .f-topbar-inner { height: 54px; padding: 0 12px; gap: 10px; }
  .f-signin-btn { display: none; }                 /* 签到收进「我的」，顶栏只留图标 */
  .f-user-chip { border: 0; padding: 0; gap: 0; }
  .f-user-chip .f-user-name,
  .f-user-chip .f-user-pts { display: none; }      /* 只留头像 */
  .f-search-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border: 0; border-radius: 9px;
    background: transparent; color: var(--f-text); cursor: pointer;
  }
  .f-search-toggle:hover { background: #f3f4f6; }

  /* 搜索框：默认收起，点放大镜后在顶栏正下方整行展开 */
  .f-search {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    max-width: none; padding: 10px 12px; background: #fff;
    border-bottom: 1px solid var(--f-line);
    box-shadow: 0 10px 22px -16px rgba(15, 23, 42, .55); z-index: 1;
  }
  .f-topbar.search-open .f-search { display: flex; }
  .f-search-input { font-size: 16px; }             /* 16px 防止 iOS 聚焦时自动放大 */
  .f-search-btn { height: 38px; }
  .f-search-input { height: 38px; }

  /* ---------- 内容留白：避免被固定底部导航遮挡 ---------- */
  .f-wrap { padding: 12px; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .f-layout { gap: 12px; }

  /* 顶部板块横条由底部「板块」抽屉取代（无 JS 时由 <noscript> 恢复显示） */
  .f-boardnav { display: none; }

  /* ---------- 页脚整块隐藏 ----------
     注意：备案号在手机端将不可见。若需合规显示，删除下面这一行即可恢复页脚。 */
  .f-footer { display: none; }

  /* ---------- 帖子列表 ---------- */
  .f-row { padding: 11px 12px; gap: 8px; }
  .f-row-badge { width: 52px; }
  .f-badge { font-size: 11px; padding: 2px 6px; }
  .f-row-title { font-size: 14px; }
  .f-row-meta { gap: 9px; font-size: 11.5px; }
  .f-row-last { display: none; }                   /* 最后回复信息在窄屏省略 */

  /* Tabs 横向滚动，避免换行 */
  .f-tabs { overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .f-tabs a { flex: 0 0 auto; }

  /* 板块头 / 标签 */
  .f-board-head { padding: 14px; gap: 10px; }
  .f-board-name { font-size: 17px; }
  .f-tagbar { padding: 10px 12px; }

  /* ---------- 帖子详情 ---------- */
  .f-topic-head { padding: 14px; }
  .f-topic-title { font-size: 18px; }
  .f-topic-meta { gap: 10px; }
  .f-floor, .f-floor-op { padding: 12px 13px; }
  .f-floor-content, .f-floor-content-op { font-size: 14.5px; }
  .f-op-meta { padding-left: 0; gap: 10px; }       /* 原为 44px 头像预留 54px 缩进 */
  .f-floor-hd-time { width: 100%; margin-left: 0; }/* 时间独占一行，避免挤压昵称 */
  .f-floor-acts { gap: 10px; }
  .f-reply { grid-template-columns: 32px minmax(0, 1fr); gap: 8px; padding: 12px 13px; }
  .f-reply-content { font-size: 14px; }
  .f-subreply { grid-template-columns: 20px minmax(0, 1fr); padding: 7px 0; }
  .f-replies-head { padding: 10px 13px; }

  /* 发卡表单 / 红包 / 分页 */
  .f-fieldgrid { grid-template-columns: 1fr; }
  .f-fieldlabel { flex-basis: 68px; }
  .f-rp { width: 100%; }
  .f-rp-card { min-height: 330px; padding: 26px 14px 20px; }
  .f-rp-fu { font-size: 120px; }
  .f-pager { margin: 14px 0; }

  /* 输入框统一 16px（本 CSS 在插件 CSS 之后加载，可覆盖 .uc-*） */
  .f-reply-textarea, .uc-input, .uc-textarea,
  .ucm-form textarea, .ucfp-input, .ucfp-input.mono { font-size: 16px; }

  /* 用户中心（插件页面，复用本模板 header/footer） */
  .uc-card { padding: 16px; }
  .uc-main { margin-bottom: 20px; }
  .ucm-item { padding: 11px 12px; }

  /* ---------- 底部 APP 导航 ---------- */
  .f-tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 800;
    height: calc(52px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: #fff; border-top: 1px solid var(--f-line);
    box-shadow: 0 -2px 14px -8px rgba(15, 23, 42, .35);
    transition: transform .2s ease;
  }
  .f-tabbar.is-hidden { transform: translateY(110%); }  /* 输入框聚焦（iOS 键盘）时收起 */
  .f-tabbar-item {
    flex: 1 1 0; min-width: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 2px;
    color: var(--f-sub); font-size: 11px; line-height: 1.1;
    text-decoration: none; -webkit-tap-highlight-color: transparent;
  }
  .f-tabbar-item.on { color: var(--f-primary); }
  .f-tabbar-item.on .f-tabbar-txt { font-weight: 600; }
  .f-tabbar-ico { position: relative; display: inline-flex; }
  .f-tabbar-ico svg { width: 22px; height: 22px; display: block; }
  .f-tabbar-txt { display: block; }
  .f-tabbar-badge {
    position: absolute; top: -5px; right: -9px; min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 999px; background: #dc2626; color: #fff;
    font-size: 10.5px; line-height: 16px; text-align: center; font-weight: 700;
  }
  /* 中间凸起的圆形「发帖」主按钮 */
  .f-tabbar-post .f-tabbar-post-btn {
    width: 46px; height: 46px; margin-top: -20px; border-radius: 50%;
    background: var(--f-primary); color: #fff; border: 3px solid #fff;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 18px -6px rgba(47, 111, 237, .55);
  }
  .f-tabbar-post .f-tabbar-post-btn svg { width: 24px; height: 24px; }
  .f-tabbar-post .f-tabbar-txt { margin-top: 1px; }

  /* ---------- 板块底部抽屉 ---------- */
  .f-sheet { display: block; position: fixed; inset: 0; z-index: 900; }
  .f-sheet[hidden] { display: none; }
  .f-sheet-mask {
    position: absolute; inset: 0; background: rgba(15, 23, 42, .45);
    opacity: 0; transition: opacity .25s ease;
  }
  .f-sheet.open .f-sheet-mask { opacity: 1; }
  .f-sheet-panel {
    position: absolute; left: 0; right: 0; bottom: 0; max-height: 72vh;
    display: flex; flex-direction: column; background: #fff;
    border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom);
    transform: translateY(100%);
    transition: transform .28s cubic-bezier(.2, .8, .3, 1);
    box-shadow: 0 -12px 30px -14px rgba(15, 23, 42, .5);
  }
  .f-sheet.open .f-sheet-panel { transform: none; }
  .f-sheet-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; border-bottom: 1px solid var(--f-line); font-weight: 700;
  }
  .f-sheet-close {
    border: 0; background: transparent; color: var(--f-sub);
    padding: 4px; cursor: pointer; display: inline-flex;
  }
  .f-sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 6px 0 8px; }
  .f-sheet-item {
    display: flex; align-items: center; gap: 10px; padding: 13px 18px;
    color: var(--f-text); text-decoration: none; font-size: 15px;
  }
  .f-sheet-item:active { background: #f3f4f6; }
  .f-sheet-item.on { color: var(--f-primary); font-weight: 600; }
}

