/* 全站共用组件 · 底部导航（tabbar）  v20261112d
   挂载方式：页面里放 <div class="tabbar-slot" data-active="home"></div>，
   并在 body 末尾、页面 js 之前引入 js/tabbar.js（组件同步注入，页面 js 里的
   btnPublish / btnMsg / btnAvatar 绑定可直接命中，无需改逻辑）。
   样式约定：不写内联 style，尺寸走 class 与 CSS 变量；safe-area 用 env() 兜底 0。 */

.tabbar-slot {
  flex: 0 0 auto;
  height: calc(48px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  position: relative;
  z-index: 9;
}

.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0;
  box-sizing: border-box;
  height: calc(48px + env(safe-area-inset-bottom, 0px));
  padding: 0 6px env(safe-area-inset-bottom, 0px);
  background: #fff;
  border-top: 1px solid var(--line, #eef1f3);
  display: flex; align-items: center;
}

.tb-item {
  flex: 1 1 0; min-width: 0; height: 30px; margin: 0 2px; padding: 0;
  border: 0; border-radius: 12px; background: transparent;
  font-family: inherit; font-size: var(--fs16, 16px);
  color: var(--t3, #646a73);
  display: flex; align-items: center; justify-content: center;
  position: relative; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s ease, color .15s ease;
}
/* 选中态：不铺底色，只靠「品牌深色 + 加粗」区分 */
.tb-item.on {
  color: var(--brand-deep, #0b6b74);
  font-weight: 700;
}
.tb-item:active { background: #f2f5f7; }

/* 五格等分：发布钮不再单独占固定宽度，否则中间两格会被挤窄、两侧变宽 */
.tb-add { flex: 1 1 0; min-width: 0; margin: 0 2px; display: flex; align-items: center; justify-content: center; }
.tb-plus {
  width: 48px; height: 32px; padding: 0;
  border: 0; border-radius: 11px;
  background: var(--brand, #14b8c4); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 5px 13px rgba(14, 154, 166, .30);
  transition: transform .12s ease, background .15s ease;
}
.tb-plus:active { transform: scale(.96); background: #0e9aa6; }
.tb-plus svg { width: 18px; height: 18px; }

/* 未读数：沿用 home.js 写入的 msgBadge（有值才显示，最多 99+） */
.tb-badge {
  position: absolute; right: 6px; top: 0;
  min-width: 15px; height: 15px; padding: 0 4px;
  box-sizing: border-box; border-radius: 8px;
  background: var(--danger, #d0453a); color: #fff;
  font-size: 9px; line-height: 15px; font-weight: 600; text-align: center;
}
.tb-badge[hidden] { display: none; }
