/* ══════════════════════════════════════════════════════════════
   AI智驾 · 全局顶部导航条（共享组件样式）
   所有类名以 tb- 开头并挂在 #app-topbar 下，避免污染页面样式
   ══════════════════════════════════════════════════════════════ */

#app-topbar {
  --tb-brand:#ff6900; --tb-brand-soft:#fff3ea;
  --tb-ink:#333; --tb-ink2:#777; --tb-line:#e8e8e8;
  position:fixed; top:0; left:0; right:0; height:56px; z-index:1000;
  background:#fff; border-bottom:1px solid var(--tb-line);
  display:flex; align-items:center; gap:4px; padding:0 16px;
  font-family:"Microsoft YaHei",-apple-system,"PingFang SC",sans-serif; font-size:14px;
}
#app-topbar * { margin:0; padding:0; box-sizing:border-box; }
#app-topbar button { font-family:inherit; cursor:pointer; }

/* ── 品牌：回到首页 ── */
#app-topbar .tb-logo {
  border:none; background:none; font-size:17px; font-weight:700; color:var(--tb-ink);
  display:flex; align-items:center; gap:8px; margin-right:16px; white-space:nowrap;
}
#app-topbar .tb-logo:hover { color:var(--tb-brand); }
#app-topbar .tb-logo .tb-logo-dot { width:10px; height:10px; border-radius:50%; background:var(--tb-brand); }

/* 当前项目名（2026-08-27 裁定：只读显示，点击去设置页切换——切换只在设置页发生） */
#app-topbar .tb-proj {
  border:1px solid var(--tb-line); background:#f6f7f9; color:var(--tb-ink);
  font-size:12px; border-radius:14px; padding:3px 12px; white-space:nowrap;
  max-width:200px; overflow:hidden; text-overflow:ellipsis;
}
#app-topbar .tb-proj:hover { border-color:var(--tb-brand); color:var(--tb-brand); }

/* ── 对象链主导航（2026-09-14 方案 B：六字链居中，骨架稳定） ── */
#app-topbar .tb-nav { display:flex; gap:2px; height:100%; margin:0 auto; }
#app-topbar .tb-link {
  border:none; background:none; padding:0 14px; height:100%; font-size:13px; color:var(--tb-ink2);
  border-bottom:2px solid transparent; display:flex; align-items:center; gap:5px; white-space:nowrap;
}
#app-topbar .tb-link:hover:not(.tb-disabled) { color:var(--tb-brand); }
#app-topbar .tb-link.tb-active { color:var(--tb-brand); font-weight:600; border-bottom-color:var(--tb-brand); }
#app-topbar .tb-link.tb-disabled { opacity:.45; cursor:not-allowed; }

/* ── 右侧操作区 ── */
#app-topbar .tb-actions { margin-left:auto; display:flex; align-items:center; gap:8px; }
#app-topbar .tb-action {
  border:none; background:none; padding:7px 12px; border-radius:8px; font-size:13px; color:var(--tb-ink2);
  display:flex; align-items:center; gap:5px; white-space:nowrap;
}
#app-topbar .tb-action:hover:not(.tb-disabled) { background:var(--tb-brand-soft); color:var(--tb-brand); }
#app-topbar .tb-action.tb-disabled { opacity:.45; cursor:not-allowed; }

/* 经营分析：品牌色实心按钮，表达"穿透四层"的中枢地位 */
#app-topbar .tb-action.tb-accent {
  background:var(--tb-brand); color:#fff; font-weight:600; border-radius:16px; padding:7px 14px;
}
#app-topbar .tb-action.tb-accent:hover { background:#e65e00; }
#app-topbar .tb-action.tb-accent.tb-active { box-shadow:0 0 0 2px #ffd9bd; }
#app-topbar .tb-accent-note { font-size:10px; font-weight:400; opacity:.85; }

/* 页面自定义槽（如 bmc_game）：顶栏只显示品牌键 + 页面自己的操作 */
#app-topbar .tb-page-slot { display:flex; align-items:center; justify-content:flex-end; gap:8px; flex:1; min-width:0; height:100%; }

/* 品牌两行版（2026-09-04 用户裁定 3b）：PC 显示全名，手机显示两行 Lucid F / 明见 */
#app-topbar .tb-txt-m { display:none; }

/* ── 移动端：顶部只留 品牌 + 右侧操作（导航移到下方 Tab 栏） ── */
@media (max-width:720px) {
  #app-topbar { padding:0 10px; }
  #app-topbar .tb-nav { display:none; }
  #app-topbar .tb-txt, #app-topbar .tb-accent-note { display:none; }
  #app-topbar .tb-txt-pc { display:none; }
  #app-topbar .tb-txt-m { display:inline-block; font-size:12px; font-weight:700; line-height:1.18; white-space:nowrap; }
  #app-topbar .tb-logo { margin-right:6px; white-space:normal; }
}

/* ══════════════════════════════════════════════════════════
   底部 Tab 栏（仅移动端显示）
   与 APP tabBar 一一对应：首页 + 4 层，将来套壳成 APP 时
   导航结构零改动；分析/助手/设置保留在顶部操作区
   ══════════════════════════════════════════════════════════ */
#app-tabbar {
  display:none;
  position:fixed; bottom:0; left:0; right:0; z-index:1000;
  background:#fff; border-top:1px solid var(--tb-line, #e8e8e8);
  padding-bottom:env(safe-area-inset-bottom);
  font-family:"Microsoft YaHei",-apple-system,"PingFang SC",sans-serif;
}
#app-tabbar * { margin:0; padding:0; box-sizing:border-box; }
#app-tabbar .tt-item {
  flex:1 0 auto; min-width:52px; border:none; background:none; cursor:pointer;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
  padding:6px 4px 5px; font-size:10px; color:#777; white-space:nowrap;
  font-family:inherit;
}
/* 2026-09-15：底栏九项（首页+六字链+消息+我的）横滑 */
@media (max-width:720px) {
  #app-tabbar { overflow-x:auto; scrollbar-width:none; -webkit-overflow-scrolling:touch; }
  #app-tabbar::-webkit-scrollbar { display:none; }
}
#app-tabbar .tt-item .tt-ico { font-size:20px; line-height:1.2; }
#app-tabbar .tt-item.tt-active { color:#ff6900; font-weight:600; }
#app-tabbar .tt-item.tt-disabled { opacity:.4; }
#app-tabbar .tt-item:active { color:#ff6900; }

@media (max-width:720px) {
  #app-tabbar { display:flex; }
  /* 页面内容避让底部 Tab 栏 */
  body { padding-bottom:calc(56px + env(safe-area-inset-bottom)); }
}

/* 页面内容避让：引用方给主容器加这个类（或自行 padding-top:56px） */
.tb-page-offset { padding-top:56px; }

/* ── 消息铃铛（2026-08-19 消息机制 V1）── */.tb-badge { display:inline-block; min-width:16px; height:16px; line-height:16px; border-radius:8px;
  background:#e74c3c; color:#fff; font-size:10px; padding:0 4px; margin-left:4px; vertical-align:2px; }
.tb-inbox { position:fixed; top:52px; right:14px; width:340px; max-width:92vw; max-height:60vh; overflow:auto;
  background:#fff; border:1px solid #e5e5e5; border-radius:12px; box-shadow:0 10px 36px rgba(0,0,0,.16); z-index:1500; }
.tb-inbox-hd { display:flex; justify-content:space-between; align-items:center; padding:10px 14px;
  font-size:13px; font-weight:600; border-bottom:1px solid #f0f0f0; }
.tb-inbox-clear { font-size:11px; color:#ff6900; cursor:pointer; font-weight:400; }
.tb-inbox-empty { text-align:center; color:#bbb; font-size:12px; padding:26px 0; }
.tb-inbox-item { display:flex; gap:8px; align-items:flex-start; padding:10px 14px; font-size:12.5px;
  border-bottom:1px solid #f6f6f6; cursor:pointer; }
.tb-inbox-item:hover { background:#fff8f2; }
.tb-inbox-item.unread .tb-inbox-t { font-weight:600; color:#222; }
.tb-inbox-t { flex:1; color:#666; line-height:1.5; }
.tb-inbox-time { color:#bbb; font-size:10.5px; white-space:nowrap; }
.tb-inbox-lv { font-size:10px; border-radius:6px; padding:1px 5px; flex:none; margin-top:1px; }
.lv-P0 { background:#fff3ea; color:#c05a00; }
.lv-P1 { background:#e3f0ff; color:#3563d9; }
.lv-P2 { background:#f2f2f2; color:#999; }

/* ── 头像菜单（2026-09-14 方案 B：昵称 + 配置/退出）── */
#app-topbar .tb-avatar {
  border:none; background:none; display:flex; align-items:center; gap:6px;
  padding:4px 6px; border-radius:8px; cursor:pointer; white-space:nowrap;
  font-size:13px; color:var(--tb-ink2);
}
#app-topbar .tb-avatar:hover { background:var(--tb-brand-soft); }
#app-topbar .tb-ava-face {
  width:26px; height:26px; border-radius:50%; background:var(--tb-brand); color:#fff;
  font-size:12px; display:inline-flex; align-items:center; justify-content:center; flex:none;
}
.tb-ava-menu { position:fixed; z-index:1600; min-width:150px; background:#fff; border:1px solid #e5e5e5;
  border-radius:10px; box-shadow:0 8px 28px rgba(0,0,0,.12); overflow:hidden; padding:4px; }
.tb-ava-mi { padding:9px 12px; font-size:13px; color:#333; border-radius:7px; cursor:pointer; }
.tb-ava-mi:hover { background:#fff3ea; }
.tb-ava-mi.tb-ava-out { color:#b3402f; }
.tb-ava-mi.tb-ava-out:hover { background:#fdecea; }

/* ── 公司切换器（2026-09-05 入司与引导）── */
#app-topbar .tb-org { cursor:pointer; }
.tb-org-menu { position:fixed; z-index:1600; min-width:220px; background:#fff; border:1px solid #e5e5e5;
  border-radius:10px; box-shadow:0 8px 28px rgba(0,0,0,.12); overflow:hidden; }
.tb-org-mi { padding:10px 14px; font-size:13px; display:flex; align-items:center; gap:8px; cursor:pointer; color:#333; }
.tb-org-mi:hover { background:#fff3ea; }
.tb-org-mi.on { color:#ff6900; font-weight:600; }
.tb-org-tag { margin-left:auto; font-size:10.5px; color:#999; }

/* 站内信邀请卡按钮（2026-09-05 邀请制） */
.tb-invite-ops { display:inline-flex; gap:6px; margin-left:8px; }
.tb-iv-ok, .tb-iv-no { border-radius:6px; font-size:11px; padding:2px 10px; cursor:pointer; font-family:inherit; }
.tb-iv-ok { background:#ff6900; border:1px solid #ff6900; color:#fff; }
.tb-iv-ok:hover { background:#e65e00; }
.tb-iv-no { background:#fff; border:1px solid #e8e8e8; color:#777; }
.tb-iv-no:hover { border-color:#ff6900; color:#ff6900; }
