/* ============================================================
   mobile.css · 移动端底座（全站 8 页共用）
   归属：A 移动底座独占。其他线不许编辑本文件。
   规则：
   - 所有移动端规则都挂在 html[data-m="1"] 作用域下
     （mobile.js 按 matchMedia 打标）。桌面宽度下 data-m 不存在，
     本文件一条规则都不生效，桌面布局 0 像素改变。
   - 不许重命名/删除桌面既有类名 id（app.js / avatar3d.js / panels/* 依赖）。
   - 主题走 var(--eng-*) 令牌，三主题自动适配；浅色不许残留黑底。
   - 底部标签栏高度统一由 --m-tabbar-h 控制（C 线 .pb-actions 靠它让位）。
   ------------------------------------------------------------
   【红色使用纪律 · 2026-11-10 立，防止回潮】
   - 三主题：黑 / 白 / 红；品牌正红 #C8102E（--eng-red），
     与电脑端同一支色号，手机端不许另起炉灶调"另一支红"。
   - 手机端禁止用 --eng-red-bright（#E11D38）做大面积填充或大字号文字；
     仅 1px 描边 / 细小发光 / 极小图标点缀可保留亮红。
   - 每屏红色实心填充 ≤ 8% 视口面积；
     宽度 > 200px 的主 CTA 一律走"红边框 + 深红渐变底 + 白字"
     （见 mobile-pages.css），不许满红块。
   - 手机端不新增电脑端没有的红色位；红只出现在电脑端也有红的位置，
     面积比例不放大。
   - 主题底色仅在 html[data-m="1"] 加深：dark #08080A / light 不动 / red #070103
     （比电脑端 red #0B0205 更深一档，衬托红更高级）。
   ============================================================ */

/* ---------- 0. 全局触控基线（非布局属性，桌面也安全） ---------- */
* { -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }

/* 防横向溢出兜底（真问题仍要修容器宽度，这里只是最后一道防线） */
@media (max-width: 900px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  img, canvas, video { max-width: 100%; }
}

/* ============================================================
   以下全部为 html[data-m="1"] 作用域 —— 移动端专属
   ============================================================ */
html[data-m="1"] {
  /* 底部标签栏固定高度（不含安全区；改这里，tabbar 与 body 底部让位一起变） */
  --m-tabbar-h: 65px;
}

/* ---------- 1. 页面骨架：单列、可纵向滚动 ---------- */
html[data-m="1"] body {
  grid-template-columns: 1fr;
  grid-template-rows: 56px auto;
  grid-template-areas: "top" "main";
  height: auto;
  min-height: 100vh;
  overflow: visible;
  /* 给固定底栏 + 固定输入区一起让位：只让 tabbar 的高度时，滚到底推荐问句仍会被浮起的输入框压住 */
  padding-bottom: calc(var(--m-tabbar-h, 65px) + 68px + env(safe-area-inset-bottom, 0px));
}
html[data-m="1"] .stage {
  overflow: visible;
  width: 100%;
  min-width: 0;
}
/* 桌面端已有的 ≤900px sidebar 隐藏由 app.css 负责；这里再保险一次（同优先级，后加载） */
html[data-m="1"] .sidebar { display: none !important; }

/* ---------- 2. 顶栏瘦身（第二轮 2026-11-12） ----------
   契约：手机端顶栏只剩 #drawerBtn 一个入口；logo / 服务灯 / 主题三键 / ◐ / 后台
   全部迁入 #settingsDrawer。顶栏高度 ≤48px，按钮热区 ≥44×44。 */
html[data-m="1"] .topbar {
  height: 48px;
  box-sizing: border-box;
  padding: 0 10px;
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: calc(10px + env(safe-area-inset-left, 0px));
  padding-right: calc(10px + env(safe-area-inset-right, 0px));
  gap: 8px;
}
/* 防御：结构线若残留旧顶栏子元素，手机端一律不显示（功能已在抽屉内） */
html[data-m="1"] .topbar .brand,
html[data-m="1"] .topbar .topbar-right { display: none !important; }
html[data-m="1"] #drawerBtn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}
html[data-m="1"] #drawerBtn svg { width: 20px; height: 20px; }

/* ---------- 2b. 设置抽屉 #settingsDrawer（左侧滑出，手机端） ---------- */
html[data-m="1"] #drawerScrim {
  display: none;
  position: fixed; inset: 0;
  z-index: 9500;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
html[data-m="1"] #drawerScrim.show { display: block; }
html[data-m="1"] #drawerScrim[hidden] { display: none !important; }

html[data-m="1"] #settingsDrawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: min(84vw, 320px);
  max-width: 100vw;
  z-index: 9600;
  display: flex;
  flex-direction: column;
  background: var(--eng-bg);
  border-right: 1px solid var(--eng-line);
  box-shadow: 12px 0 40px rgba(0, 0, 0, .35);
  transform: translateX(-100%);
  visibility: hidden;               /* 关闭态移出 tab 顺序与读屏，不参与可见性 */
  transition: transform .22s ease-out, visibility 0s linear .22s;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
html[data-m="1"] #settingsDrawer.open {
  transform: translateX(0);
  visibility: visible;
  transition: transform .22s ease-out;
}

html[data-m="1"] #settingsDrawer .drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--eng-line);
  flex: 0 0 auto;
}
html[data-m="1"] #settingsDrawer .brand-mark {
  width: 32px; height: 32px; border-radius: 8px;
}
html[data-m="1"] #settingsDrawer .drawer-close {
  width: 44px; height: 44px; min-width: 44px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px;
  font-size: 17px;
}
html[data-m="1"] #settingsDrawer .drawer-body {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 16px;
  padding: 14px 14px 22px;
}
html[data-m="1"] #settingsDrawer .dz-group {
  display: flex; flex-direction: column; gap: 10px;
  min-width: 0;
}
html[data-m="1"] #settingsDrawer .dz-group h3 {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--eng-text-dim); font-weight: 600;
}
/* 主题三键：整行铺满，44 热区 */
html[data-m="1"] #settingsDrawer .theme-switch {
  display: flex; width: 100%;
  border: 1px solid var(--eng-line); border-radius: 999px;
  overflow: hidden; background: var(--eng-surface);
}
html[data-m="1"] #settingsDrawer .theme-switch button {
  flex: 1 1 0;
  min-height: 44px;
  padding: 0 8px;
  font-size: 12.5px;
}
html[data-m="1"] #settingsDrawer #themeBtn {
  width: 44px; height: 44px; min-width: 44px; min-height: 44px;
  align-self: flex-start;
}
/* 服务状态灯：换行铺满，标签保留可见，每项 ≥44 热区，不横向滚动 */
html[data-m="1"] #settingsDrawer .svc-lights {
  display: flex; flex-wrap: wrap; gap: 8px;
  max-width: 100%;
}
html[data-m="1"] #settingsDrawer .svc-lights .svc {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; min-width: 44px;
  flex: 1 1 44px;
  padding: 0 10px;
  white-space: nowrap;
}
/* 体态五键：换行铺满，≥44 热区 */
html[data-m="1"] #settingsDrawer .holo-skins {
  display: flex; flex-wrap: wrap; gap: 8px;
}
html[data-m="1"] #settingsDrawer .holo-skins .skin {
  min-width: 44px; min-height: 44px;
  flex: 1 1 44px;
  border-radius: 12px;
  font-size: 13px;
}
/* 后台入口：整行链接 ≥44 热区 */
html[data-m="1"] #settingsDrawer .admin-entry {
  width: 100%;
  min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 0 14px;
  font-size: 13.5px;
}

/* ---------- 3. 内容区单列、卡片自然堆叠 ---------- */
html[data-m="1"] .core-wrap { grid-template-columns: minmax(0, 1fr) !important; height: auto !important; }
html[data-m="1"] .core-stage { border-right: 0 !important; border-bottom: 1px solid var(--eng-line); min-height: 320px; }
html[data-m="1"] .core-chat { padding: 12px; }
html[data-m="1"] .panel { padding: 12px !important; }
html[data-m="1"] .panel-head { flex-wrap: wrap; gap: 10px; }
html[data-m="1"] .head-stats,
html[data-m="1"] .hstat { flex-wrap: wrap; }
html[data-m="1"] .bot-grid,
html[data-m="1"] .store-grid { grid-template-columns: 1fr !important; }
html[data-m="1"] .kb-grid { grid-template-columns: 1fr !important; }
html[data-m="1"] .voice-wrap { grid-template-columns: 1fr !important; }
html[data-m="1"] .live-body { grid-template-columns: 1fr !important; }
html[data-m="1"] .live-wrap { padding: 12px !important; }
/* 表格类容器横向滚（不撑破视口） */
html[data-m="1"] .ch-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- 4. 热区与点按反馈 ---------- */
html[data-m="1"] button,
html[data-m="1"] a[href],
html[data-m="1"] .icon-btn,
html[data-m="1"] .nav-item,
html[data-m="1"] input,
html[data-m="1"] select,
html[data-m="1"] textarea {
  touch-action: manipulation;
}
html[data-m="1"] .btn,
html[data-m="1"] .chip {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
html[data-m="1"] :active { -webkit-tap-highlight-color: rgba(200, 16, 46, .18); }

/* ============================================================
   5. 底部标签栏 #mTabbar（mobile.js 注入，桌面下 display:none）
   ============================================================ */
#mTabbar {
  display: none; /* 桌面：永远不显示 */
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 9000;
  height: calc(var(--m-tabbar-h, 65px) + env(safe-area-inset-bottom, 0px));
  grid-template-columns: repeat(5, 1fr);
  align-items: stretch;
  background: color-mix(in srgb, var(--eng-surface) 92%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--eng-line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
html[data-m="1"] #mTabbar { display: grid; }

#mTabbar .mtab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: var(--m-tabbar-h, 65px);
  min-height: 44px;
  padding: 6px 0;
  text-decoration: none;
  color: var(--eng-text-dim);
  font-size: 10.5px;
  letter-spacing: .02em;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-top: 2px solid transparent;
  transition: color .15s, background .15s;
}
#mTabbar .mtab .mtab-ico { font-size: 20px; line-height: 1; display: flex; align-items: center; justify-content: center; }
#mTabbar .mtab .mtab-ico svg { width: 22px; height: 22px; display: block; }
/* 点按反馈：不许出圆角/矩形填色块（老板实测"舰桥"格上有深色底块就是这里）；
   :active 只做 ≤120ms 亮度变化；:focus-visible 用 2px outline offset，不填色。 */
#mTabbar .mtab:active { background: transparent; filter: brightness(1.4); }
#mTabbar .mtab:focus-visible { outline: 2px solid var(--eng-red); outline-offset: -3px; background: transparent; }
#mTabbar .mtab.on {
  color: var(--eng-red);
  border-top-color: var(--eng-red);
  font-weight: 600;
  background: transparent;
}

/* 键盘弹起时隐藏底栏，防止遮挡输入框 */
html[data-kb="on"] #mTabbar { display: none !important; }
html[data-kb="on"] body { padding-bottom: 0 !important; }

/* ============================================================
   6. 抽屉 #mDrawer（右侧滑入）
   ============================================================ */
#mDrawerMask {
  display: none;
  position: fixed; inset: 0;
  z-index: 9500;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(2px);
}
#mDrawer {
  display: none;
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(78vw, 320px);
  z-index: 9600;
  flex-direction: column;
  background: var(--eng-bg);
  border-left: 1px solid var(--eng-line);
  box-shadow: -12px 0 40px rgba(0, 0, 0, .35);
  transform: translateX(100%);
  transition: transform .22s ease-out;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
html[data-m="1"] #mDrawer.open { display: flex; transform: translateX(0); }
html[data-m="1"] #mDrawerMask.show { display: block; }

#mDrawer .md-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--eng-line);
  font-weight: 700; font-size: 15px;
}
#mDrawer .md-close {
  width: 44px; height: 44px; min-width: 44px;
  border: 1px solid var(--eng-line);
  background: var(--eng-surface);
  color: var(--eng-text);
  border-radius: 10px;
  font-size: 18px; cursor: pointer;
}
#mDrawer .md-list {
  flex: 1 1 0; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 8px 0;
}
#mDrawer .md-group {
  padding: 10px 16px 4px;
  font-size: 11px; letter-spacing: .08em;
  color: var(--eng-text-dim);
  text-transform: uppercase;
}
#mDrawer .md-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  color: var(--eng-text);
  text-decoration: none;
  font-size: 14.5px;
  border-left: 2px solid transparent;
}
#mDrawer .md-item:active { background: var(--eng-surface-2); }
#mDrawer .md-item.on {
  color: var(--eng-red);
  border-left-color: var(--eng-red);
  background: linear-gradient(90deg, var(--eng-line-red), transparent 70%);
}
#mDrawer .md-foot {
  padding: 12px 16px;
  border-top: 1px solid var(--eng-line);
  font-size: 11px; color: var(--eng-text-dim);
}

/* ============================================================
   7. 3D 舞台手势策略
   ============================================================ */
/* 舞台内：默认旋转（touch-action:none）；锁定后跟随页面滚动（pan-y） */
html[data-m="1"] .holo-stage,
html[data-m="1"] #avatarStage { touch-action: none; }
html[data-m="1"][data-stage-lock="1"] .holo-stage,
html[data-m="1"][data-stage-lock="1"] #avatarStage { touch-action: pan-y; }

/* 舞台右上角「锁定舞台」按钮（mobile.js 注入，≥44 热区） */
#mStageLock {
  display: none;
  position: absolute;
  top: calc(8px + env(safe-area-inset-top, 0px));
  right: 8px;
  z-index: 5;
  width: 44px; height: 44px;
  min-width: 44px; min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--eng-line);
  background: color-mix(in srgb, var(--eng-surface) 88%, transparent);
  color: var(--eng-text-dim);
  font-size: 18px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
html[data-m="1"] #mStageLock { display: inline-flex; }
#mStageLock.on { color: var(--eng-red); border-color: var(--eng-red); }

/* 「全景」兜底钮（stage-control.js 注入；显隐/文案归 A 线）手机端几何：
   舞台右下角 48×48 热区，与右上角 #mStageLock 分居上下两角，互不重叠；文案不折行不压字。
   选择器抬高一级，盖过后注入的 stage-control.css 等权规则（含其 ≤520px 的 bottom:64px 旧值）。 */
html[data-m="1"] .core-stage .stage-control-home-btn {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 30;
  min-width: 48px;
  min-height: 48px;
  height: 48px;
  padding: 0 14px;
  white-space: nowrap;
  line-height: 1;
  border-radius: 12px;
}
@media (max-width: 767px) {
  html[data-m="1"] .core-stage .stage-control-home-btn {
    right: 10px;
    bottom: 10px;
    min-width: 48px;
    min-height: 48px;
  }
}

/* webgl 不可用时的降级占位卡（mobile.js 注入） */
#mStageFallback {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%; height: 100%;
  min-height: 280px;
  text-align: center;
  padding: 24px;
  background: radial-gradient(80% 60% at 50% 30%, var(--eng-line-red), transparent 70%);
  color: var(--eng-text-dim);
  font-size: 13px;
  line-height: 1.7;
}
html[data-m="1"] #mStageFallback.show,
#mStageFallback.show { display: flex; }
#mStageFallback img { width: 84px; height: 84px; object-fit: contain; border-radius: 20px; }

/* ============================================================
   8. 性能模式 html[data-perf="low"]：关阴影 / 关后处理
   ============================================================ */
html[data-perf="low"] body::before,
html[data-perf="low"] .orb-glow,
html[data-perf="low"] .holo-scan { display: none !important; }
html[data-perf="low"] .topbar,
html[data-perf="low"] #mTabbar,
html[data-perf="low"] #mDrawerMask { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
html[data-perf="low"] * {
  text-shadow: none !important;
}

/* ============================================================
   9. 三主题移动端规则
   ============================================================ */
/* 底色加深一档（仅手机端；桌面端 --eng-bg #0A0A0A / red #0B0205 不许动）：
   dark → #08080A，red → #070103（更沉，衬托品牌红更高级）；light 不动。 */
html[data-m="1"][data-theme="dark"] body { background: #08080A; }
html[data-m="1"][data-theme="red"] body { background: #070103; }

/* dark 已是默认，无需特别 */
/* light：任何写死深色的容器在浅色下都要换令牌色 */
html[data-m="1"][data-theme="light"] body { background: var(--eng-bg); }
/* 浅色下 92% 太透：卡片暗图（尤其机器人卡片的红色仪表盘）会透成一块灰/红方块，
   正好压在"舰桥"格下面，被误读成"标签栏有块底色"。提到 96% 保留磨砂感但不透出图形。 */
html[data-m="1"][data-theme="light"] #mTabbar {
  background: color-mix(in srgb, #FFFFFF 96%, transparent);
}
html[data-m="1"][data-theme="light"] #mDrawer { background: var(--eng-bg); }
/* red：底栏带一丝红调 */
html[data-m="1"][data-theme="red"] #mTabbar {
  background: #120308;
}

/* ============================================================
   10. toast 轻提示
   ============================================================ */
#mToast {
  position: fixed;
  left: 50%;
  bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(8px);
  z-index: 9999;
  max-width: 80vw;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--eng-surface-2);
  color: var(--eng-text);
  font-size: 13.5px;
  box-shadow: var(--eng-shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s, transform .18s;
}
#mToast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 3D 舞台在手机端必须有高度（原来 flex:1 1 0 在 auto 高度父容器下塌成 0） ---------- */
/* 三个病灶一起治：
   ① .core-stage 被内容撑到 435 > 视口 375：flex 默认 min-width:auto，必须显式收住
   ② #avatarStage 是 position:absolute 但没有 inset，宽度由 canvas 内容反推，锁死在 435×153
   ③ .scene-bar 的 calc(100% - 10px) 参照的是 435，算出 425，右边 6 个场景被推出屏外
   收住参照系后，canvas 回到 351 宽 / 340 高，场景条回到 341 可横滚全见。 */
html[data-m="1"] .core-stage {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box;
  height: auto !important;      /* 不锁总高：里面还有 skins/status/meta/bars 要占位 */
  min-height: 0 !important;
  overflow: visible;
}

html[data-m="1"] .core-stage .holo-stage {
  position: relative;
  flex: 0 0 auto !important;    /* 固定高度，不参与剩余空间分配 */
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: 300px !important;
  min-height: 300px !important;
}

html[data-m="1"] #avatarStage {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0;
  overflow: hidden;
}

html[data-m="1"] #stage-glb { width: 100% !important; height: 100% !important; }
html[data-m="1"] #stage-glb canvas,
html[data-m="1"] #avatarStage canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* ---------- 输入区固定：聊天页输入框必须随时可打字，不能要求用户先滚到页底 ---------- */
/* 实测未修前 #totalInput 在文档 899px 处，375×812 视口根本够不到，看起来就像"被底栏压住" */
html[data-m="1"] .total-composer {
  position: fixed !important;
  left: 8px;
  right: 8px;
  bottom: calc(var(--m-tabbar-h, 65px) + env(safe-area-inset-bottom, 0px) + 6px);
  z-index: 990;
  background: var(--eng-bg, #0a0a0a);
  border-radius: 12px;
  box-shadow: 0 -6px 18px rgba(0, 0, 0, .38);
}
/* 给固定输入区让位，避免最后一条消息被盖住 */
html[data-m="1"] .core-chat {
  padding-bottom: 88px !important;
}

/* ---------- 手机/窄屏也要 3D 舞台：app.css 在 ≤1080px 把 .core-stage 整块 display:none，等于把主舞台关掉 ---------- */
@media (max-width: 1080px) {
  html[data-m="1"] .core-stage {
    display: flex !important;
  }
  html[data-m="1"] .core-stage .holo-stage {
    padding: 0;
  }
}

/* ============================================================
   11. 2026-11-11 商用收口：实测发现的问题一次性补齐
   归属：A 移动底座独占。
   ------------------------------------------------------------
   11.1  发送/语音/+/电话 圆形按钮热区 38/34px → 44px（A6 核心断言）
   11.2  3D 舞台在手机上太占纵向（holo-stage 300 + 装饰 bars 8 根），
         导致推荐问句 chips 在首屏被固定输入框压住一半。
         → holo-stage 300→240，装饰 .core-bars 隐藏，chips 露出。
   11.3  .core-chat 底部让位从 88→148px，保证最后一条消息不被固定输入框盖住
   11.4  对话气泡 .msg 在窄屏 max-width 66% 太窄 → 85%，文字更易读
   11.5  输入框 textarea 在手机上 13.5px → 16px（防 iOS 聚焦自动放大）
   ============================================================ */

/* 11.1 圆形/胶囊按钮热区统一 44 */
html[data-m="1"] .total-composer .send-round,
html[data-m="1"] .total-composer .mic-round,
html[data-m="1"] .total-composer .plus-btn,
html[data-m="1"] .total-composer .call-btn {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px;
  min-height: 44px;
  flex: 0 0 44px !important;
  font-size: 17px;
}
html[data-m="1"] .total-composer .voice-toggle {
  height: 44px !important;
  min-height: 44px;
  flex: 0 0 auto;
  padding: 0 12px;
  font-size: 13px;
}

/* 11.2 舞台纵向：第二轮撤掉场景条、体态条迁入抽屉后，省下的纵向空间还给 3D 舞台。
   改前 holo-stage 200px（上一轮为给对话让位压下来的）；本轮 +16px → 216px。
   装饰竖条 / 状态行 / 信息卡继续隐藏，不回占高度。 */
html[data-m="1"] .core-stage .holo-stage {
  height: 216px !important;
  min-height: 216px !important;
}
/* 装饰性 8 根小竖条，手机端藏掉省 12px */
html[data-m="1"] .core-bars { display: none !important; }
/* core-meta 那行"正在连接…"压一行 */
html[data-m="1"] .core-meta { font-size: 11px; padding: 2px 0 4px; }
/* 体态五键已迁入 #settingsDrawer（见 2b 抽屉规则），舞台内不再保留 skins 条 */
/* 舞台中间那两块悬浮信息卡（"24 个会话 / 盯着全渠道"）手机上藏掉，
   它跟右上角"待命中"标签重复，还占 80px 纵向空间 */
html[data-m="1"] .core-meta { display: none !important; }
html[data-m="1"] .core-status { display: none !important; }

/* 11.2b 场景条残留防御：契约 §3 整块撤掉；手机端若有任何残留场景按钮/标签/分隔条，
   一律不显示、不撑高容器。（DOM 已由结构线删除，这里是兜底，不删 DOM。） */
html[data-m="1"] .scene-bar,
html[data-m="1"] .scene-bar-label,
html[data-m="1"] .scene-bar-more,
html[data-m="1"] .scene-btn,
html[data-m="1"] .scene-sep {
  display: none !important;
}
/* 场景切换轻提示（avatar3d.js 注入的 #stageSceneToast「场景 · 告警」）：
   手机端场景条已撤、无场景切换入口，该浮标属残留场景文字，移动端隐藏；桌面端不变。 */
html[data-m="1"] .stage-scene-toast { display: none !important; }
/* 注：「全景」回门面浮钮（stage-control.js 注入）保留在手机端——它是 closeup 后
   显式回全景的入口；StageControl 接管点选后，点空白只 deselect，不主动 play('family')，
   隐藏该钮会让触屏失去回门面路径。显隐/文案归 A 线，B 线只管位置与热区。 */

/* 11.3 让位：最后一条消息/推荐问句不被固定输入框盖住 */
html[data-m="1"] .core-chat {
  padding-bottom: 148px !important;
}
html[data-m="1"] .total-chips {
  margin-bottom: 6px;
}

/* 11.4 对话气泡窄屏放宽（index 的 .tm 与 bot/bridge 的 .msg 一起处理） */
html[data-m="1"] .msg { max-width: 85%; }
html[data-m="1"] .tm { max-width: 88%; }

/* 11.5 输入框字号 ≥16px 防 iOS 聚焦放大 */
html[data-m="1"] .total-composer textarea,
html[data-m="1"] .composer input,
html[data-m="1"] .console-in input {
  font-size: 16px !important;
}

/* 11.6 首屏滚动到底时，chips 能滚到固定输入框上方 */
html[data-m="1"] .core-chat {
  scroll-padding-bottom: 160px;
}

/* 11.7 webgl 降级卡在手机 216px 高 stage 内铺满（场景条已随契约撤掉，无场景条间距）
   作用域：holder 被 mobile.js showStageFallback() 打上 .is-fallback。
   桌面端（无 data-m="1"）保持原 280px 卡片不变。 */
html[data-m="1"] #avatarStage.is-fallback #mStageFallback {
  position: absolute;
  inset: 0;
  z-index: 10;
  min-height: 0;
  height: 100%;
  padding: 10px 12px;
  gap: 6px;
  font-size: 11.5px;
  line-height: 1.45;
}
html[data-m="1"] #avatarStage.is-fallback #mStageFallback img {
  width: 40px; height: 40px;
  border-radius: 10px;
}
html[data-m="1"] #avatarStage.is-fallback #mStageFallback .fb-title {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 2px;
}
html[data-m="1"] #avatarStage.is-fallback #mStageFallback .fb-desc {
  display: block;
  color: var(--eng-text-dim);
}

/* 11.8 降级态下"全景"浮钮直接隐藏（3D 都没了回全景无意义），文案用满宽度自然换行 */
html[data-m="1"] #avatarStage.is-fallback .fb-text {
  padding-right: 0;
  box-sizing: border-box;
}
html[data-m="1"] #avatarStage.is-fallback ~ .stage-control-home-btn,
html[data-m="1"] .core-stage:has(#avatarStage.is-fallback) .stage-control-home-btn {
  display: none !important;
}

/* 11.9 手机端 composer 改两行：第一行 输入框(flex:1, min 200) + 语音切换 + 发送；
   第二行 + / 电话 / 麦克风。390 宽下输入框可视宽度 ≥200px，placeholder 不再被截成"跟总"。
   44px 热区不缩。桌面端（无 data-m="1"）保持单行。 */
html[data-m="1"] .total-composer {
  flex-wrap: wrap;
  row-gap: 8px;
}
html[data-m="1"] .total-composer #totalInput {
  flex: 1 1 calc(100% - 60px) !important;
  min-width: 200px !important;
  width: auto !important;
  order: 1;
}
html[data-m="1"] .total-composer .send-round { order: 2; flex: 0 0 44px; }
html[data-m="1"] .total-composer .plus-btn,
html[data-m="1"] .total-composer .call-btn,
html[data-m="1"] .total-composer .mic-round,
html[data-m="1"] .total-composer .voice-toggle {
  order: 3;
}
/* 让位随两行增高：composer 高度从 60 → 约 116，.core-chat padding-bottom 148 够用 */

/* ============================================================
   12. bot.html 手机端遮挡修复（2026-11-12）
   归属：A 移动底座。
   问题：mobile-chat.css 给 body[data-m-page="bot"] .wrap 加了 170px 底部 padding，
         但实测 390×844 下"同场景 Bot / 相关页面"等卡片滚到底时，仍被 fixed
         .composer（高 66）+ #mTabbar（高 65）切到上沿；chatLog 内部滚动时，
         最后一条消息贴在 chatLog 底部，离 composer 太近。
   修法：
   - .wrap 底部 padding 从 170 → 196，多 26px 让最后卡片完全露出在 composer 上方
   - .chat-log 加 scroll-padding-bottom，内部滚动时最后一条消息停在 composer 上方
   桌面端（无 data-m="1"）不受影响。
   ============================================================ */
html[data-m="1"] body[data-m-page="bot"] .wrap {
  padding-bottom: calc(196px + env(safe-area-inset-bottom, 0px));
}
html[data-m="1"] body[data-m-page="bot"] .chat-log {
  scroll-padding-bottom: calc(66px + 14px);
}
/* 12.3 快捷回答条出现时，composer 增高到约 156px：对话区底部让位同步加大，
   保证最后一张卡片底 ↔ 输入条顶 ≥56px 安全间距（data-quick 由 bot.html 在有建议条时打到 body）。
   让位 = composer 高 156 + 标签栏 65 + 安全间距 56 + 余量 ≈ 284px。 */
html[data-m="1"] body[data-m-page="bot"][data-quick="1"] .wrap {
  padding-bottom: calc(284px + env(safe-area-inset-bottom, 0px));
}
html[data-m="1"] body[data-m-page="bot"][data-quick="1"] .chat-log {
  scroll-padding-bottom: calc(156px + 14px);
}

/* ============================================================
   13. 控制台 index · 390 宽和电脑同一套层次
   - 对话是主区。进门舞台是收着的，只留一条「人 / 判 / 演 / 动」，不把脸铺满屏。
   - 底栏就是电脑那五个组：办事、人、干活、接入、生态。点开只列这一组里的原名。
     设置仍走左上角原来的按钮。
   ============================================================ */

html[data-m="1"] body[data-m-page="index"] {
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  padding-bottom: 0;
  grid-template-rows: 48px minmax(0, 1fr);
}
html[data-m="1"] body[data-m-page="index"] .stage {
  min-height: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
html[data-m="1"] body[data-m-page="index"] .stage > .panel.active {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

/* 总管：对话列撑满，消息在中间滚 */
html[data-m="1"] body[data-m-page="index"] #panel-total.active {
  overflow: hidden;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
}
html[data-m="1"] body[data-m-page="index"] .core-wrap {
  flex: 1 1 auto;
  min-height: 0;
  height: 100% !important;
  display: flex !important;
  flex-direction: column;
}
html[data-m="1"] body[data-m-page="index"] .core-chat {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 10px 12px 0 !important;
  /* 底栏 65 + 两行输入条约 118 + 空隙，最后一句和快捷问句要停在输入条上面 */
  padding-bottom: calc(220px + env(safe-area-inset-bottom, 0px)) !important;
}
html[data-m="1"] body[data-m-page="index"] #totalStream {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
html[data-m="1"] body[data-m-page="index"] .total-chips,
html[data-m="1"] body[data-m-page="index"] .total-foot,
html[data-m="1"] body[data-m-page="index"] .core-head {
  flex: 0 0 auto;
}
html[data-m="1"] body[data-m-page="index"] .total-composer {
  bottom: calc(var(--m-tabbar-h, 65px) + 8px + env(safe-area-inset-bottom, 0px));
  max-width: calc(100vw - 16px);
  box-sizing: border-box;
}

/* 折叠（进门默认）：舞台只留一条「人 / 判 / 演 / 动」，隐藏的全息层不占高度。
   全息层仍留着尺寸，只是挪出文档流，展开时 Three 还能量到画布。 */
html[data-m="1"] body[data-m-page="index"] .core-wrap.is-folded .core-stage {
  flex: 0 0 52px;
  height: 52px !important;
  min-height: 0 !important;
  max-height: 52px;
  width: 100% !important;
  overflow: hidden;
  justify-content: stretch;
  align-items: stretch;
  gap: 0;
  padding: 0;
  border-bottom: 1px solid var(--eng-line);
}
html[data-m="1"] body[data-m-page="index"] .core-wrap.is-folded .holo-stage {
  position: absolute !important;
  left: 0;
  top: 0;
  width: 100% !important;
  height: 216px !important;
  min-height: 0 !important;
  flex: none !important;
  pointer-events: none !important;
}
html[data-m="1"] body[data-m-page="index"] .core-wrap.is-folded .stage-dock {
  height: 52px;
  flex-wrap: nowrap;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}
html[data-m="1"] body[data-m-page="index"] .core-wrap.is-folded .sd-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html[data-m="1"] body[data-m-page="index"] .core-wrap.is-folded .sd-modes {
  flex: 0 0 auto;
  flex-wrap: nowrap;
}
html[data-m="1"] body[data-m-page="index"] .core-wrap.is-folded .sd-mode,
html[data-m="1"] body[data-m-page="index"] .core-wrap.is-folded .sd-fold {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  flex: 0 0 44px;
  box-sizing: border-box;
}

/* 自己点开舞台时，对话仍留在下半，不再被整块舞台挤没 */
html[data-m="1"] body[data-m-page="index"] .core-wrap:not(.is-folded) .core-stage {
  flex: 0 1 auto;
  max-height: 42vh;
  height: auto !important;
  min-height: 0 !important;
  overflow: hidden;
  width: 100% !important;
}
html[data-m="1"] body[data-m-page="index"] .core-wrap:not(.is-folded) .holo-stage {
  height: min(200px, 32vh) !important;
  min-height: 120px !important;
}

/* 底栏激活：只有字变红 + 顶上 2px 红线。不要红底胶囊，也不要把整条挪到右上角。 */
html[data-m="1"] body[data-m-page="index"] #mTabbar .mtab,
html[data-m="1"] body[data-m-page="index"] #mTabbar .mtab.on,
html[data-m="1"] body[data-m-page="index"] #mTabbar .mtab:active,
html[data-m="1"] body[data-m-page="index"] #mTabbar .mtab:focus-visible {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

/* 设置抽屉：补上看得见的标题（原来只有图标和关闭） */
html[data-m="1"] #settingsDrawer .drawer-head::before {
  content: "设置";
  order: 1;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--eng-text);
}
html[data-m="1"] #settingsDrawer .drawer-head .brand-mark { order: 0; }
html[data-m="1"] #settingsDrawer .drawer-head .drawer-close { order: 2; margin-left: auto; }
html[data-m="1"] #settingsDrawer .st-offline,
html[data-m="1"] #settingsDrawer .st-title,
html[data-m="1"] #settingsDrawer .st-ro-empty {
  overflow-wrap: anywhere;
}

/* 12.2 气泡内部 meta（answer · done 这类 actions 状态）默认对客户隐藏
   仅 ?debug=1（body[data-debug="1"]）时展开。桌面端同样隐藏，避免客户看到调试行。 */
.msg .meta-debug[hidden] { display: none !important; }
body[data-debug="1"] .msg .meta-debug[hidden] { display: block !important; }

/* ============================================================
   14. 彩色 emoji 换成单色线条（不改 index.html 里的字）
   电话 / 麦克风 / 喇叭 / 附件菜单，手机上不露系统自带的彩图标。
   亮红不做大面积底：这些图标只走 currentColor，1px 级。
   ============================================================ */
html[data-m="1"] {
  --m-mask-phone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.2 3.6h3.1l1.2 3.1-1.9 1.1a12 12 0 0 0 5.6 5.6l1.1-1.9 3.1 1.2v3.1a1.6 1.6 0 0 1-1.7 1.6A14.6 14.6 0 0 1 4.6 5.3a1.6 1.6 0 0 1 1.6-1.7z'/%3E%3C/svg%3E");
  --m-mask-mic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='9' y='3' width='6' height='11' rx='3'/%3E%3Cpath d='M6.5 11a5.5 5.5 0 0 0 11 0M12 16.5V20M8.5 20h7'/%3E%3C/svg%3E");
  --m-mask-spk: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9.5h3.2L12 5.2v13.6l-4.8-4.3H4z'/%3E%3Cpath d='M15.4 9.2a3.3 3.3 0 0 1 0 5.6M17.8 7a6 6 0 0 1 0 10'/%3E%3C/svg%3E");
  --m-mask-text: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M5 7h14M5 12h14M5 17h9'/%3E%3C/svg%3E");
  --m-mask-clip: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M8 12.5 14.2 6.2a3 3 0 0 1 4.2 4.2l-8.2 8.2a4.2 4.2 0 0 1-6-6l7.6-7.6'/%3E%3C/svg%3E");
  --m-mask-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Crect x='4' y='5' width='16' height='14' rx='2'/%3E%3Ccircle cx='9' cy='10' r='1.3'/%3E%3Cpath d='M4 16.5 8.8 12l3.2 3 2.3-2.1L20 16.5'/%3E%3C/svg%3E");
  --m-mask-bot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='6' y='8' width='12' height='10' rx='2'/%3E%3Cpath d='M12 4.5V8M9 18.5v1.5M15 18.5v1.5'/%3E%3Ccircle cx='10' cy='12.5' r='.8' fill='black'/%3E%3Ccircle cx='14' cy='12.5' r='.8' fill='black'/%3E%3C/svg%3E");
  --m-mask-puzzle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M8 4h4.2a2 2 0 1 1 0 4H14v2.2a2 2 0 1 1-4 0V10H8a2 2 0 1 1 0-4V4z'/%3E%3Cpath d='M14 12.2V16H9.8a2 2 0 1 0 0 4H16a2 2 0 0 0 2-2v-5.8h-4z'/%3E%3C/svg%3E");
}
html[data-m="1"] #callStartBtn,
html[data-m="1"] #totalMic,
html[data-m="1"] #lcMic,
html[data-m="1"] #micBtn,
html[data-m="1"] .tm-act[data-act="speak"],
html[data-m="1"] .pm-item > i {
  font-size: 0 !important;
  color: var(--eng-text);
}
html[data-m="1"] #callStartBtn::before,
html[data-m="1"] #totalMic::before,
html[data-m="1"] #lcMic::before,
html[data-m="1"] #micBtn::before,
html[data-m="1"] .tm-act[data-act="speak"]::before,
html[data-m="1"] .pm-item > i::before,
html[data-m="1"] #totalVoiceToggle::before,
html[data-m="1"] #sideSpeak::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  background: currentColor;
  -webkit-mask: var(--m-mask, var(--m-mask-mic)) center / contain no-repeat;
  mask: var(--m-mask, var(--m-mask-mic)) center / contain no-repeat;
}
html[data-m="1"] #callStartBtn { --m-mask: var(--m-mask-phone); }
html[data-m="1"] #totalMic,
html[data-m="1"] #lcMic,
html[data-m="1"] #micBtn { --m-mask: var(--m-mask-mic); }
html[data-m="1"] .tm-act[data-act="speak"] { --m-mask: var(--m-mask-spk); }
html[data-m="1"] .pm-item[data-pm="file"] > i { --m-mask: var(--m-mask-clip); }
html[data-m="1"] .pm-item[data-pm="asset"] > i { --m-mask: var(--m-mask-img); }
html[data-m="1"] .pm-item[data-pm="bot"] > i { --m-mask: var(--m-mask-bot); }
html[data-m="1"] .pm-item[data-pm="skill"] > i { --m-mask: var(--m-mask-puzzle); }
html[data-m="1"] #totalVoiceToggle,
html[data-m="1"] #sideSpeak {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  --m-mask: var(--m-mask-spk);
}
html[data-m="1"] #totalVoiceToggle:not(.on) { --m-mask: var(--m-mask-text); }
html[data-m="1"] body[data-m-page="index"] .total-chips,
html[data-m="1"] body[data-m-page="index"] .core-head,
html[data-m="1"] body[data-m-page="index"] .total-tags {
  max-width: 100%;
  min-width: 0;
}
html[data-m="1"] body[data-m-page="index"] .chip { max-width: 100%; box-sizing: border-box; }
/* 390 顶栏 Bot 计数：允许折行，刷新后也能写上完整「N 个 Bot · 已启用 · 在岗」 */
html[data-m="1"] #totalBotCount {
  white-space: normal;
  max-width: min(100%, 240px);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: clip;
}

/* ============================================================
   15. 390 宽对齐：拆开互相盖住的层（只在 html[data-m="1"]）
   实测 390×844：
   - 电话 / 麦克风 / 语音开关同时画了原来的 SVG 和 ::before，两套图标挤在同一个 44px 钮里
   - flex 两行靠 order 挤：输入框 min-width:200 再加语音钮，发送容易被顶到下一行
   - 展开的舞台 flex-shrink 把整块压到约 17px，3D 被 justify-content:center 撑出盒子，
     名单用 left:50% 只拿到右半宽，四行名字盖住顶上的「人 / 判 / 演 / 动」
   - Bot 卡的类别字写在大图上；列表滚到底时底栏切住下一张卡
   ============================================================ */

/* 15.1 总管输入区：格子排死，不靠换行去碰运气。
   第一行：输入框（约占 300px）+ 发送。
   第二行：加号、电话、麦克风、语音开关。各占各的格，不能叠。 */
html[data-m="1"] body[data-m-page="index"] .total-composer {
  display: grid !important;
  grid-template-columns: 44px 44px 44px minmax(0, 1fr) 44px;
  grid-template-areas:
    "input input input input send"
    "plus  call  mic   voice  voice";
  gap: 8px;
  align-items: center;
  justify-items: stretch;
  flex-wrap: nowrap;
  padding: 8px;
  min-width: 0;
  max-width: calc(100vw - 16px);
  box-sizing: border-box;
}
html[data-m="1"] body[data-m-page="index"] .total-composer #totalInput {
  grid-area: input;
  order: 0;
  flex: none !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100%;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  margin: 0;
  padding: 10px 8px;
  box-sizing: border-box;
  line-height: 22px;
}
html[data-m="1"] body[data-m-page="index"] .total-composer .send-round { grid-area: send; order: 0; justify-self: end; }
html[data-m="1"] body[data-m-page="index"] .total-composer .plus-btn { grid-area: plus; order: 0; justify-self: start; }
html[data-m="1"] body[data-m-page="index"] .total-composer .call-btn { grid-area: call; order: 0; justify-self: start; }
html[data-m="1"] body[data-m-page="index"] .total-composer .mic-round { grid-area: mic; order: 0; justify-self: start; }
html[data-m="1"] body[data-m-page="index"] .total-composer .voice-toggle {
  grid-area: voice;
  order: 0;
  width: auto;
  max-width: 100%;
  min-width: 0;
  justify-self: start;
  padding: 0 10px;
  overflow: hidden;
  white-space: nowrap;
}
html[data-m="1"] body[data-m-page="index"] .total-composer .voice-toggle span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 语音状态条出现时独占一行，不插进按钮中间 */
html[data-m="1"] body[data-m-page="index"] .total-composer .mic-state {
  grid-column: 1 / -1;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  flex: none !important;
  margin: 2px 0 0;
}
html[data-m="1"] body[data-m-page="index"] .total-composer .plus-menu {
  left: 0;
  right: auto;
  width: min(286px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  box-sizing: border-box;
}
/* 圆钮里只留一个图标。页面里已经是线条 SVG 的，不再叠一层 ::before。 */
html[data-m="1"] body[data-m-page="index"] .total-composer .send-round,
html[data-m="1"] body[data-m-page="index"] .total-composer .mic-round,
html[data-m="1"] body[data-m-page="index"] .total-composer .plus-btn,
html[data-m="1"] body[data-m-page="index"] .total-composer .call-btn {
  display: grid !important;
  place-items: center;
  padding: 0;
  margin: 0;
}
html[data-m="1"] #callStartBtn > svg,
html[data-m="1"] #totalMic > svg,
html[data-m="1"] #lcMic > svg,
html[data-m="1"] #micBtn > svg,
html[data-m="1"] #totalVoiceToggle > svg,
html[data-m="1"] #sideSpeak > svg {
  display: none !important;
}
html[data-m="1"] #callStartBtn::before,
html[data-m="1"] #totalMic::before,
html[data-m="1"] #totalVoiceToggle::before {
  margin: 0;
}
/* 最后一条、快捷句、脚注都停在输入条上面。输入条两行约 112px，再加底栏。 */
html[data-m="1"] body[data-m-page="index"] .core-chat {
  padding-bottom: calc(var(--m-tabbar-h, 65px) + 168px + env(safe-area-inset-bottom, 0px)) !important;
}
html[data-m="1"] body[data-m-page="index"] #totalStream {
  scroll-padding-bottom: 16px;
}
html[data-m="1"] body[data-m-page="index"] #totalStream .tm,
html[data-m="1"] body[data-m-page="index"] #totalStream .tm-user {
  max-width: 100%;
  min-width: 0;
}
html[data-m="1"] body[data-m-page="index"] #totalStream .tm-body {
  min-width: 0;
}
html[data-m="1"] body[data-m-page="index"] #totalStream .tm-text {
  overflow-wrap: anywhere;
}

/* 15.2 舞台 / 名单 / 对话分成上下三截，不再挤在 17px 里。
   顶条「人 / 判 / 演 / 动」回到文档流，3D 在它下面，名单贴在 3D 底边。 */
html[data-m="1"] body[data-m-page="index"] .core-wrap:not(.is-folded) .core-stage {
  flex: 0 0 auto !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: hidden;
  justify-content: flex-start !important;
  align-items: stretch !important;
  gap: 0 !important;
}
html[data-m="1"] body[data-m-page="index"] .core-wrap:not(.is-folded) .stage-dock {
  position: relative !important;
  left: auto;
  right: auto;
  top: auto;
  flex: 0 0 44px;
  width: 100%;
  height: 44px;
  z-index: 3;
}
html[data-m="1"] body[data-m-page="index"] .core-wrap:not(.is-folded) .stage-pane {
  top: 44px;
}
html[data-m="1"] body[data-m-page="index"] .core-wrap:not(.is-folded) .holo-stage {
  position: relative !important;
  flex: 0 0 auto !important;
  width: 100% !important;
  height: 160px !important;
  min-height: 152px !important;
  margin: 0 !important;
}
html[data-m="1"] body[data-m-page="index"] .avatar-roster {
  left: 6px !important;
  right: 58px !important;
  bottom: 4px !important;
  top: auto !important;
  transform: none !important;
  width: auto !important;
  max-width: none !important;
  max-height: 68px;
  display: flex !important;
  flex-flow: row wrap;
  align-content: flex-end;
  justify-content: center;
  gap: 4px;
  overflow: hidden;
  z-index: 6;
  box-sizing: border-box;
}
html[data-m="1"] body[data-m-page="index"] .avatar-roster-item,
html[data-m="1"] body[data-m-page="index"] .avatar-roster-item:hover,
html[data-m="1"] body[data-m-page="index"] .avatar-roster-item.on {
  transform: none;
  min-width: 0;
  height: 30px;
  min-height: 30px;
  padding: 0 8px;
  font-size: 12px;
  flex: 0 0 auto;
}

/* 15.3 Bot 卡：大图自己一层，字在图下面。底栏不切住最后一张。 */
html[data-m="1"] .bot-art {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 140px auto;
  height: auto;
  min-height: 0;
  margin: -20px -20px 12px;
  overflow: hidden;
}
html[data-m="1"] .bot-art img {
  grid-row: 1;
  grid-column: 1;
  position: relative;
  inset: auto;
  width: 100%;
  height: 140px;
  max-height: 140px;
  object-fit: cover;
}
html[data-m="1"] .bot-art::after { content: none; }
html[data-m="1"] .bot-art-lbl {
  grid-row: 2;
  grid-column: 1;
  position: static;
  left: auto;
  right: auto;
  top: auto;
  bottom: auto;
  z-index: 1;
  margin: 0;
  padding: 8px 20px 0;
  color: var(--eng-text-dim);
  text-shadow: none;
  letter-spacing: .04em;
  line-height: 1.4;
}
html[data-m="1"] .bot-top { min-width: 0; }
html[data-m="1"] .bot-top > div:last-child { min-width: 0; flex: 1 1 auto; }
html[data-m="1"] .bot-name,
html[data-m="1"] .bot-handle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
html[data-m="1"] .bot-actions { flex-wrap: wrap; }
html[data-m="1"] .sc-art {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 120px auto;
  height: auto;
  margin: -16px -16px 10px;
  overflow: hidden;
}
html[data-m="1"] .sc-art img {
  grid-row: 1;
  grid-column: 1;
  width: 100%;
  height: 120px;
  max-height: 120px;
  object-fit: cover;
}
html[data-m="1"] .sc-art::after { content: none; }
html[data-m="1"] .sc-art-tag {
  grid-row: 2;
  grid-column: 1;
  position: static;
  right: auto;
  top: auto;
  margin: 0;
  padding: 8px 16px 0;
  width: auto;
  justify-self: start;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--eng-text-dim);
  letter-spacing: .04em;
  backdrop-filter: none;
}
/* 总管和对话上下分开：3D 在上，名字条在 3D 下面，不压在脸上 */
html[data-m="1"] body[data-m-page="index"] .core-wrap:not(.is-folded) .core-stage {
  flex: 0 0 auto !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}
html[data-m="1"] body[data-m-page="index"] .core-wrap:not(.is-folded) .holo-stage {
  height: 188px !important;
  min-height: 168px !important;
}
html:not([data-m="1"]) body[data-m-page="index"] .core-stage {
  min-height: 240px !important;
  height: 42vh !important;
  max-height: 460px !important;
}
html:not([data-m="1"]) body[data-m-page="index"] .core-stage #avatarStage {
  top: 0 !important;
  bottom: 48px !important;
  height: auto !important;
  overflow: visible !important;
}
html[data-m="1"] body[data-m-page="index"] .core-wrap:not(.is-folded) #avatarStage {
  top: 0 !important;
  bottom: 44px !important;
  height: auto !important;
  overflow: visible !important;
}
html[data-m="1"] body[data-m-page="index"] .core-wrap:not(.is-folded) .avatar-roster {
  position: absolute !important;
  left: 6px !important;
  right: 6px !important;
  bottom: -40px !important;
  top: auto !important;
  transform: none !important;
  width: auto !important;
  max-width: none !important;
  max-height: 40px;
  height: 40px;
  background: var(--bg, #08080a);
}
/* 手机上屏幕留给对话（12-01 体检：375 宽时对话区只剩 177px）。
   快捷句、顶部标签各占一行，放不下就横着滑，不换行、不收省略号；底下那段使用说明手机上不占地方。
   快捷句的手机样子只在这一处定（原先这里和上面各有一条，一条不换行、一条换两列，互相盖）。 */
html[data-m="1"] body[data-m-page="index"] .total-chips,
html[data-m="1"] body[data-m-page="index"] .total-tags {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  max-width: 100%;
  min-width: 0;
}
/* 靠右排的话，溢出的是左边，滑不回去 */
html[data-m="1"] body[data-m-page="index"] .total-tags { justify-content: flex-start; }
html[data-m="1"] body[data-m-page="index"] .total-chips::-webkit-scrollbar,
html[data-m="1"] body[data-m-page="index"] .total-tags::-webkit-scrollbar { display: none; }
html[data-m="1"] body[data-m-page="index"] .total-chips .chip,
html[data-m="1"] body[data-m-page="index"] .total-tags > * {
  flex: 0 0 auto;
  max-width: none;
  white-space: nowrap;
}
html[data-m="1"] body[data-m-page="index"] .total-chips .chip { min-height: 44px; }
html[data-m="1"] body[data-m-page="index"] #totalBotCount { white-space: nowrap; max-width: none; }
html[data-m="1"] body[data-m-page="index"] .total-foot { display: none; }
html[data-m="1"] .call-screen { z-index: 10000; }
html[data-m="1"] #callScreen #holoStage,
html[data-m="1"] #callScreen #avatarStage,
html[data-m="1"] #callScreen .avatar-roster {
  display: none !important;
}
html[data-m="1"] #callScreen .call-orb {
  width: min(220px, 32vh, 56vw);
  height: min(220px, 32vh, 56vw);
}
/* closest-side：细线落在圆内。默认 mask 按最远角算，小圆上会把线裁到圆外。 */
html[data-m="1"] #callScreen .call-orb .orb-ring {
  -webkit-mask: radial-gradient(circle closest-side, transparent 84%, #000 86%, #000 93%, transparent 95%);
  mask: radial-gradient(circle closest-side, transparent 84%, #000 86%, #000 93%, transparent 95%);
}
html[data-m="1"] #callScreen .call-orb .orb-core {
  border-color: rgba(200, 16, 46, .45);
  box-shadow: 0 0 8px rgba(200, 16, 46, .16), inset 0 0 6px rgba(200, 16, 46, .1);
}
html[data-m="1"] #callScreen .call-orb .orb-mark span { color: var(--eng-red, #C8102E); }
html[data-m="1"] #callScreen .cs-hang {
  min-width: 44px;
  min-height: 44px;
}
html[data-theme="red"] .call-screen,
html[data-theme="red"] .cs-card { background: #0B0205; }
html[data-m="1"][data-theme="red"] .call-screen,
html[data-m="1"][data-theme="red"] .cs-card { background: #070103; }

html[data-m="1"] body[data-m-page="index"] .stage > .panel.active:not(#panel-total) {
  padding-bottom: calc(12px + var(--m-tabbar-h, 65px) + 16px) !important;
  scroll-padding-bottom: calc(var(--m-tabbar-h, 65px) + 16px);
}

