/* mobile.css - 手机端适配（header 精简版） */

@media (max-width: 768px) {
  html, body { width: 100%; overflow-x: hidden; }

  /* ===== 顶部吸顶区域：更紧凑、更少留白 ===== */
  .nav.site-header {
    padding: 8px 0 !important;
  }

  /* 只调整 header 内的容器边距，避免影响正文 */
  .nav.site-header .container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .nav.site-header .row {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 6px !important;              /* ✅ 缩小元素间距，减少“空位” */
  }

  /* 汉堡按钮 */
  .m-nav-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(51, 65, 85, .6);
    background: rgba(15, 23, 42, .55);
    color: #e5e7eb;
    font-size: 18px;
    flex: 0 0 auto;
  }

  /* 左侧品牌 + 发帖/规范（允许换行，但尽量紧凑） */
  .nav.site-header .row > div:first-child {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 6px !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }

  .nav.site-header .brand {
    font-size: 18px !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
  }

  /* Header 按钮统一缩小 */
  .nav.site-header .btn,
  .nav.site-header .btn-ghost {
    padding: 7px 10px !important;
    font-size: 14px !important;
    border-radius: 12px !important;
    line-height: 1 !important;
  }

  .nav.site-header .ico { width: 18px; height: 18px; }

  /* ===== 搜索：占满一行但不“占高度”，让下面功能上移 ===== */
  .nav.site-header form[action="/search"] {
    width: 100% !important;
    flex: 1 1 100% !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin-top: 2px !important;       /* ✅ 减少上下空白 */
  }

  .nav.site-header form[action="/search"] .input {
    flex: 1 1 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 34px !important;
  }

  .nav.site-header form[action="/search"] .btn {
    height: 34px !important;
    padding: 0 12px !important;
  }

  /* ===== 汉堡展开区：功能按钮“上移贴近”，减少留白 ===== */
  .m-nav-actions {
    width: 100% !important;
    display: none !important;         /* 默认收起 */
    flex-wrap: wrap !important;
    gap: 6px !important;
    margin-top: 2px !important;       /* ✅ 上移 */
    padding-top: 2px !important;
  }

  .m-open .m-nav-actions {
    display: flex !important;
  }

  /* 分类条：默认隐藏（相当于“放进汉堡”），展开才显示 */
  .m-catbar {
    width: 100% !important;
    display: none !important;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 2px 0 0 0;
    margin: 0;
    border-top: none;
  }
  .m-open .m-catbar { display: flex !important; }
  .m-catbar::-webkit-scrollbar { display: none; }

  /* ✅ 手机端去掉“全部”（如果它还存在且是第一个） */
  .m-catbar .m-cat:first-child { display: none !important; }

  .m-cat {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(51, 65, 85, .6);
    background: rgba(15, 23, 42, .55);
    color: #e5e7eb;
    white-space: nowrap;
    font-size: 14px;
  }
}

/* 超小屏再压一点按钮内边距 */
@media (max-width: 380px) {
  .nav.site-header .btn,
  .nav.site-header .btn-ghost {
    padding: 7px 9px !important;
  }
  .nav.site-header form[action="/search"] .btn {
    padding: 0 10px !important;
  }
}
