/* ===== 仿微信刀1:底部 4tab 导航 + 聊天双屏(列表屏 ↔ 详情屏)·黑绿白 =====
   小查执行单 2026-06-24 · 小六 · 落点宪法:新功能新建文件,别堆 index.html。
   路由真相源(app.js 写 body 上):
     body[data-tab = chat | discover | channels | me]
     body[data-screen = list | chat]   (仅 data-tab=chat 时有意义)
   详情屏 = 现有 header+#logwrap+footer 全套(对话/钻取/大脑切换/富进度/bench 全保留)·全屏无底部 nav(避与 #compose 争位)。
   列表屏 = #chatlist 竖列(复用 buildAssistantModel:主控置顶 + 各电脑员工)+ 底部 nav。
   #contacts 横排保留被 renderContacts 渲染(线程状态镜像·健壮性测试 __read 仍读它)但视觉永久隐藏=竖列替横排。 */

/* ---- #contacts 横排:视觉隐藏(逻辑镜像仍在) ---- */
#contacts { display:none !important; }

/* ---- 底部导航栏(4 tab) ---- */
#tabnav { flex:0 0 auto; display:flex; align-items:stretch; border-top:1px solid var(--line2); background:var(--bg); }
.tabnav-btn { flex:1 1 0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; padding:7px 0 6px; background:transparent; border:none; color:var(--faint); font-size:10.5px; font-weight:500; cursor:pointer; transition:color .15s; position:relative; -webkit-tap-highlight-color:transparent; }
.tabnav-btn .tni { width:26px; height:24px; display:flex; align-items:center; justify-content:center; }
.tabnav-btn .tni svg { width:24px; height:24px; }
.tabnav-btn.on { color:var(--accent); }
.tabnav-btn:active { opacity:.7; }
.tabnav-btn .tnbadge { display:none; position:absolute; top:4px; left:calc(50% + 7px); min-width:9px; height:9px; border-radius:5px; background:var(--danger); border:1.5px solid var(--bg); }
.tabnav-btn.hasbadge .tnbadge { display:block; }

/* ---- 列表屏:聊天会话竖列(一行一个 AI/会话) ---- */
#chatlist { flex:1 1 auto; min-height:0; overflow-y:auto; -webkit-overflow-scrolling:touch; display:none; flex-direction:column; }
.chatrow { display:flex; align-items:center; gap:13px; padding:12px 16px; border:none; background:transparent; color:var(--fg); cursor:pointer; text-align:left; width:100%; position:relative; }
.chatrow::after { content:""; position:absolute; left:75px; right:0; bottom:0; height:1px; background:var(--line2); }   /* 微信式:分隔线从头像右侧起 */
.chatrow:last-child::after { display:none; }
.chatrow:active { background:var(--fill1); }
.chatrow.active { background:var(--blue-soft); }
.chatrow-av { flex:0 0 auto; width:48px; height:48px; border-radius:14px; display:grid; place-items:center; font-size:22px; background:var(--card); border:1px solid var(--line); position:relative; color:var(--accent); }
.chatrow-av svg { width:24px; height:24px; }
.chatrow-av.master { background:rgba(245,196,81,.16); border-color:rgba(245,196,81,.35); color:#f5c451; }
.chatrow-av .cdot { position:absolute; right:-2px; bottom:-2px; width:13px; height:13px; border-radius:50%; border:2.5px solid var(--bg); background:var(--ok); }
.chatrow-av .cdot.off { background:var(--faint); }
.chatrow-tx { flex:1 1 auto; min-width:0; }
.chatrow-nm { font-size:16px; font-weight:600; display:flex; align-items:center; gap:6px; overflow:hidden; }
.chatrow-nm .nmtxt { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.chatrow-crown { flex:0 0 auto; font-size:12px; }
.chatrow-sub { font-size:13px; color:var(--dim); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-top:3px; }
.chatrow-sub.busy { color:var(--accent); }
.chatrow-meta { flex:0 0 auto; align-self:flex-start; margin-top:4px; color:var(--faint); font-size:11px; }
.chatlist-empty { color:var(--faint); font-size:13.5px; text-align:center; padding:48px 24px; line-height:1.6; }
[dir="rtl"] .chatrow { text-align:right; }
[dir="rtl"] .chatrow::after { left:0; right:75px; }
/* 聊天列表 v2:电脑分组头(可点开/收起·🖥️ 名 + 在线点 + N个助手 + ▸/▾) */
.chatgrp-hd { display:flex; align-items:center; gap:8px; width:100%; padding:9px 16px; border:none; background:var(--surface); color:var(--dim); cursor:pointer; text-align:left; font-size:13px; border-top:1px solid var(--line2); border-bottom:1px solid var(--line2); }
.chatgrp-hd:active { background:var(--fill1); }
.chatgrp-ic { flex:0 0 auto; font-size:15px; }
.chatgrp-nm { flex:0 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:600; color:var(--fg); }
.chatgrp-dot { flex:0 0 auto; width:8px; height:8px; border-radius:50%; background:var(--ok); }
.chatgrp-dot.off { background:var(--faint); }
.chatgrp-ct { flex:1 1 auto; color:var(--faint); font-size:12px; }
.chatgrp-chev { flex:0 0 auto; color:var(--faint); font-size:12px; }
.chatrow-emp { padding-left:22px; }   /* 分组下的会话行略缩进=层级感 */
[dir="rtl"] .chatgrp-hd { text-align:right; }
[dir="rtl"] .chatrow-emp { padding-left:16px; padding-right:22px; }

/* ---- 占位 tab(发现/视频号/我:刀1 只放壳,内容刀2/刀3) ---- */
.tabpane { flex:1 1 auto; min-height:0; overflow-y:auto; -webkit-overflow-scrolling:touch; display:none; flex-direction:column; align-items:center; justify-content:center; text-align:center; padding:40px 30px; gap:13px; }
.tabpane-ic { font-size:56px; opacity:.45; line-height:1; }
.tabpane-ttl { font-size:20px; font-weight:600; }
.tabpane-sub { font-size:14px; color:var(--dim); line-height:1.55; max-width:280px; }
.tabpane-soon { font-size:12px; font-weight:700; color:var(--accent); background:var(--accent-soft); border:1px solid var(--accent-line); border-radius:999px; padding:4px 14px; margin-top:4px; }

/* ---- 详情屏返回钮(列表屏隐藏·详情屏占 header 左位,与 #info 互斥) ---- */
#backtolist { position:absolute; left:8px; top:50%; transform:translateY(-50%); display:none; align-items:center; justify-content:center; width:34px; height:34px; background:transparent; border:none; color:var(--accent); cursor:pointer; z-index:2; }
#backtolist svg { width:23px; height:23px; }
#backtolist:active { opacity:.6; }
[dir="rtl"] #backtolist { left:auto; right:8px; }
[dir="rtl"] #backtolist svg { transform:scaleX(-1); }

/* ===================== 显隐路由 ===================== */
/* 聊天 tab · 列表屏:显竖列 + nav;藏对话上下文条/对话区/输入 */
body[data-tab="chat"][data-screen="list"] #chatlist { display:flex; }
body[data-tab="chat"][data-screen="list"] #orchpanel,
body[data-tab="chat"][data-screen="list"] #agents,
body[data-tab="chat"][data-screen="list"] #quotabar,
body[data-tab="chat"][data-screen="list"] #logwrap,
body[data-tab="chat"][data-screen="list"] footer { display:none !important; }

/* 聊天 tab · 详情屏:藏 nav,显返回钮(占 header 左位) */
body[data-tab="chat"][data-screen="chat"] #tabnav { display:none; }
body[data-tab="chat"][data-screen="chat"] #backtolist { display:flex; }
/* v193 IA 精简:「新对话」(=清空当前对话·像 Clear)只在【详情屏】出现,列表屏/其它 tab 顶栏不显(老板:顶栏极简=头像+标题+👥) */
body[data-tab="chat"][data-screen="list"] #newsession,
body:not([data-tab="chat"]) #newsession { display:none; }
/* 件①(执行单 2026-06-24):详情屏隐藏「让谁当脑子」横排 agent 选择条 #agents
   (☁云端助手 + 已配对电脑·老板截图 IMG_3156 那排 chip)——进了聊天不再屏内切会话,
   要切返回列表屏(#chatlist 竖列已能选 agent/会话)。
   🔴 只视觉隐藏、保留 DOM(renderAgents 仍跑·dashAgents/updateBrainName 不受影响·
   browser-robustness 不读 #agents);#contacts 早已全局隐藏。 */
body[data-tab="chat"][data-screen="chat"] #agents { display:none !important; }

/* 非聊天 tab(发现/视频号/我):藏聊天那整套,显对应占位壳;保留 nav */
body:not([data-tab="chat"]) #orchpanel,
body:not([data-tab="chat"]) #agents,
body:not([data-tab="chat"]) #quotabar,
body:not([data-tab="chat"]) #logwrap,
body:not([data-tab="chat"]) #chatlist,
body:not([data-tab="chat"]) footer { display:none !important; }
body[data-tab="discover"] #tabpane-discover { display:flex; }
body[data-tab="channels"] #tabpane-channels { display:flex; }
body[data-tab="me"] #tabpane-me { display:flex; }

/* ---- 刀2:「我」tab 内容(设置/账号/配置归位·微信式个人页·只搬入口) ---- */
#tabpane-me.metab { align-items:stretch; justify-content:flex-start; padding:0; gap:0; }
.metab-acct { display:flex; align-items:center; gap:14px; width:100%; padding:24px 18px; background:var(--card); border:none; border-top:1px solid var(--line2); border-bottom:1px solid var(--line2); color:var(--fg); cursor:pointer; text-align:left; }
.metab-acct:active { background:var(--fill1); }
.metab-av { flex:0 0 auto; width:56px; height:56px; border-radius:15px; background:var(--accent-soft); border:1px solid var(--accent-line); display:grid; place-items:center; font-size:26px; }
.metab-acctx { flex:1 1 auto; min-width:0; display:flex; flex-direction:column; gap:4px; }
.metab-acctname { font-size:18px; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.metab-acctsub { font-size:13px; color:var(--dim); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.metab-list { display:flex; flex-direction:column; margin-top:12px; background:var(--card); border-top:1px solid var(--line2); border-bottom:1px solid var(--line2); }
.metab-row { display:flex; align-items:center; gap:13px; width:100%; padding:15px 18px; background:transparent; border:none; border-bottom:1px solid var(--line2); color:var(--fg); cursor:pointer; text-align:left; font-size:16px; }
.metab-row:last-child { border-bottom:none; }
.metab-row:active { background:var(--fill1); }
.metab-ri { flex:0 0 auto; width:24px; text-align:center; font-size:18px; }
.metab-rt { flex:1 1 auto; min-width:0; }
.metab-chev { flex:0 0 auto; color:var(--faint); font-size:19px; line-height:1; }
.metab-ver { text-align:center; color:var(--faint); font-size:11.5px; padding:18px; margin-top:auto; }
body.mode-simple #metab-msg { display:none; }   /* 云端/BYO 普通用户:消息 tab 本就隐藏(同 .dashtabs simple)→「我」里也藏消息行 */
[dir="rtl"] .metab-acct, [dir="rtl"] .metab-row { text-align:right; }
[dir="rtl"] .metab-chev { transform:scaleX(-1); }

/* 异构统一显示(契约-v1 §4·v197·小六):聊天线程顶部「agent 类型」chip——非主控编码 agent(Codex/Gemini…)显类型,主控/查不到不标 */
.threadkind { display:flex; align-items:center; gap:5px; width:fit-content; max-width:80%; margin:6px auto 10px; padding:3px 11px; border-radius:999px; background:var(--card); border:1px solid var(--line2); color:var(--dim); font-size:11.5px; line-height:1; }
.threadkind svg { width:13px; height:13px; flex:0 0 auto; }
.threadkind span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
