/* ============================================================
   LoomRoom · zoom.css
   Zoom / 腾讯会议式的**参会者宫格**（room.js 的新渲染）。

   设计意图（用户原话）："没有代入感……每个人也应该有他自己的头像，
   就是真实的头像，然后头像也应该大一点。做成类似于 Zoom 的那种开会的界面形式。"

   · 每个参会者一个 tile：头像是视觉主体（直径下限 80px，宽屏更大）
   · 名字条压在 tile 底部：半透明深色 + 圆角 + 左侧身份色条
   · 正在发言：整块边框高亮 + 呼吸发光 + 名字条上"正在说话"声波
   · 音频播放中：青色声波（保留旧交互）

   落地方式：room.css **一个字都没改**。本文件在 index.html 里排在 room.css 之后，
   同优先级后者胜；要压过 room.css 的媒体查询时用 id / 双类提升优先级。
   （.overlay 那次"display:flex 盖掉 [hidden]"的坑，靠 base.css 的 [hidden]{display:none!important} 兜着，
   本文件不引入任何会常显的浮层。）
   ============================================================ */

/* ══════════════ 布局：左栏从"圆桌"变成"参会者宫格" ══════════════ */
#room-pane {
  justify-content: flex-start;   /* 旧圆桌是垂直居中，宫格必须从顶部开始排 */
  align-items: stretch;
  gap: 8px;
  min-width: 0;
  overflow: hidden;              /* 横向溢出的兜底闸门 */
}

#round-table.round-table {
  display: flex; flex-direction: column; gap: 8px;
  width: 100%;
  max-height: none;
  aspect-ratio: auto;            /* 旧值是 1/1 的圆桌，宫格不需要 */
  flex: 1 1 auto;
  min-width: 0; min-height: 0;
}

/* ── 顶部信息条（原来的"桌面中心"） ── */
#table-hub {
  position: static; transform: none;
  width: 100%; height: auto;
  display: flex; flex-direction: row; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  text-align: left;
  background: linear-gradient(180deg, rgba(14,30,50,.88), rgba(7,13,23,.92));
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-1);
  flex: none;
}
#table-hub::after { content: none; }         /* 干掉旧桌心那道台灯光斑 */
#table-hub[data-status="running"] { border-color: var(--lamp-line); }
.hub-left { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
#table-hub .hub-topic { -webkit-line-clamp: 1; font-size: var(--fs-3); font-weight: 620; color: var(--text); }
#table-hub .hub-meta { display: flex; align-items: center; gap: 5px; font-size: var(--fs-1); color: var(--muted);
  /* 信息栏在「房间 624px」这种半宽里会被右侧按钮挤窄：
     以前每个 span 都能被压到逐字换行（"第/1/2/轮"、"轮/流/发/言" 竖成一条），
     实测 1440px 下就是这个样子。整块按项换行 + 单项不折行，最多两行。 */
  flex-wrap: wrap; row-gap: 2px; }
#table-hub .hub-meta > span { flex: none; white-space: nowrap; }
#table-hub .hub-status { flex: none; font-size: var(--fs-1); color: var(--muted); white-space: nowrap; }
#table-hub[data-status="running"] .hub-status { color: var(--lamp-strong, var(--lamp)); }
#table-hub[data-status="paused"] .hub-status { color: var(--warn); }
.hub-count { color: var(--faint); }

/* ── 宫格本体：列数由 JS 算好写进 --cols（保证头像够大且不横向溢出） ── */
#seats.seats {
  position: static; inset: auto;
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
  /* 行高由 JS 给死（--tile-h）：auto 行不会把 aspect-ratio 撑出来的高度算进行高，
     窄屏实测会缩成 24px 行高而 tile 仍画 201px，导致 tile 互相重叠、点击错位。 */
  grid-auto-rows: var(--tile-h, 122px);
  gap: 10px;                                  /* 与 room.js 的 GAP 常量一致 */
  align-content: start;
  overflow-x: hidden;                         /* 绝不横向滚 */
  overflow-y: auto;                           /* 人多就在区域内纵向滚（Zoom 也一样） */
  padding: 2px;
  flex: 1 1 auto;
  min-width: 0; min-height: 0;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
#seats.seats::-webkit-scrollbar { width: 6px; }
#seats.seats::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
/* 1 人：居中大格；2 人：并排（封顶宽度，别把人拉成一堵墙） */
#seats.seats[data-grid="solo"] { grid-template-columns: minmax(0, 420px); justify-content: center; }
#seats.seats[data-grid="duo"]  { grid-template-columns: repeat(var(--cols, 2), minmax(0, 360px)); justify-content: center; }

/* ══════════════ tile ══════════════ */
.seat.fx-tile {
  position: relative; transform: none;
  display: block;
  width: auto; height: var(--tile-h, 122px); margin: 0; padding: 0;
  min-width: 0; min-height: 0;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: none;
  overflow: hidden;
  text-align: left;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color .16s, box-shadow .16s, transform .16s, background .16s;
}
.seat.fx-tile:hover {
  border-color: var(--line);
  transform: none;
  box-shadow: none;
}
.seat.fx-tile:focus-visible { outline: 1.5px solid var(--lamp); outline-offset: 2px; }

/* ══════════════ 头像：tile 里最大的那个东西 ══════════════ */
/* 头像在"名字条以上的空间"里垂直居中：这样小 tile 不会被姓名标签盖住脸，
   大 tile 也不会顶到上边缘（top 用 calc 而不是固定百分比，正是为了两者都对）。 */
.fx-avatar {
  position: absolute; left: 50%;
  top: calc((100% - var(--bar-h, 26px)) / 2);
  transform: translate(-50%, -50%);
  width: var(--av, 96px); height: var(--av, 96px);
  max-width: calc(100% - 6px); max-height: calc(100% - 6px);
  border-radius: 50%;
  display: grid; place-items: center;
  overflow: visible;                          /* 角标/声波要露在圆外，圆内裁剪交给 .fx-portrait */
  background: var(--avatar-bg);
  border: 1px solid var(--hairline);
  box-shadow: none;
  transition: border-color .2s;
}
.fx-portrait {
  position: absolute; inset: 0;
  border-radius: 50%;
  overflow: hidden;
  display: grid; place-items: center;
  background: var(--avatar-bg);
}
/* avatars.js 交出来的节点（<img> / svg / canvas / div.avatar-node 包装）铺满圆。
   ⚠️ avatarNode() 会在 <img> 上写 inline 的 width/height = size，inline 优先级高于本表，
   所以这里必须 !important —— 否则窗口缩放后头像不跟着 --av 变大，会缩在圆圈中央。
   object-position（脸部取景）是队友调好的，保留不动。 */
/* 「我」的占位剪影（与剧场同一套）：摄像头关闭样式，不用挥手 emoji */
.fx-self-figure {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 24%;
  color: var(--muted);
  opacity: .9;
}
.fx-self-figure .self-figure-svg { width: 100%; height: 100%; }
/* 自视视频：铺满圆形头像位，镜像显示（像照镜子，符合视频会议习惯） */
.fx-self-video {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  background: #000;
  border-radius: 50%;
}
/* 出画面时藏掉剪影，否则两层叠在一起会像"鬼影" */
.seat.fx-tile.fx-self[data-camera="live"] .fx-self-figure { display: none; }
.fx-portrait > :not(.fx-emoji) {
  width: 100% !important; height: 100% !important;
  display: block;
  object-fit: cover;
  border-radius: 50%;
  overflow: hidden;
}
/* avatarNode() 外面包了一层 div.avatar-node，里面的 svg 也要跟着铺满 */
.fx-portrait > .avatar-node > svg,
.sa-avatar > .avatar-node > svg {
  width: 100%; height: 100%;
  display: block;
  border-radius: 50%;
}
/* 兜底：avatars.js 还没到 / 这个人没有画像时的 emoji，字号随 --av 放大 */
.fx-emoji {
  display: grid; place-items: center;
  width: 100%; height: 100%;
  font-size: calc(var(--av, 96px) * .52);
  line-height: 1;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.45));
}

/* 主持人角标 */
.seat.fx-tile .host-badge {
  position: absolute; left: -3px; top: -5px; z-index: 4;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: var(--fs-1); line-height: 1;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
/* 身份色标：优先 agent 自带的 a.color，缺省已在 JS 里回退成供应商色 */
.seat.fx-tile .provider-dot {
  position: absolute; right: 0; bottom: 4px; z-index: 4;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--agent-color, var(--muted));
  border: 2px solid var(--bg);
}

/* 声波律动：发言中（暖色）/ 音频播放中（青色）。
   注意别挂在圆外 —— 大 tile 上会正好压住底部的名字条；放在圆内底部更干净。 */
.seat.fx-tile .waves {
  position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%);
  display: none; align-items: flex-end; gap: 3px; height: 20px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--lamp-line);
  z-index: 3;
}
.seat.fx-tile.speaking .waves,
.seat.fx-tile.audio-on .waves { display: flex; }
.seat.fx-tile .waves i {
  display: block; width: 3px; height: 5px; border-radius: 2px;
  background: var(--lamp);
  animation: wave 900ms ease-in-out infinite;   /* @keyframes wave 在 room.css */
}
.seat.fx-tile.audio-on .waves { border-color: rgba(156, 184, 174,.45); }
.seat.fx-tile.audio-on .waves i { background: var(--cool); }

/* ══════════════ 名字条：压在 tile 底部（Zoom 的姓名标签） ══════════════ */
/* 单行：名字 + 主持人 chip + 角色小字（发言时角色换成"正在说话"声波）。
   小 tile 上两行会吃掉头像三分之一，所以按 Zoom 的做法压成一行。 */
.seat.fx-tile { --bar-h: 26px; }
.fx-bar {
  position: absolute; left: 6px; right: 6px; bottom: 6px; z-index: 2;
  display: flex; flex-direction: row; align-items: center; flex-wrap: nowrap; gap: 6px;
  padding: 3px 8px 4px;
  border-radius: 6px;
  background: var(--bar-bg);
  border: 1px solid transparent;
  border-left: 2px solid var(--agent-color, var(--line));
  backdrop-filter: none;
  text-align: left;
  min-width: 0;
  transition: background .2s, border-color .2s, box-shadow .2s;
}
/* 让名字 / chip / 角色 都成为同一行的 flex 项 */
.fx-bar-top { display: contents; }
.fx-name {
  flex: none; max-width: 58%;
  font-size: var(--fs-3); font-weight: 600; line-height: 1.2; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fx-role {
  flex: 0 1 auto; min-width: 0;
  font-size: var(--fs-1); line-height: 1.2; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fx-host {
  flex: none; font-size: var(--fs-1); line-height: 1.5; padding: 0 5px;
  border-radius: 999px;
  background: var(--lamp-soft); border: 1px solid var(--lamp-line); color: var(--lamp);
}
.fx-live { display: none; align-items: center; gap: 4px; flex: none; font-size: var(--fs-1); color: var(--lamp); }
.fx-live-waves { display: inline-flex; align-items: flex-end; gap: 2px; height: 10px; }
.fx-live-waves i {
  width: 2px; height: 3px; border-radius: 1px;
  background: var(--lamp);
  animation: fxLive 780ms ease-in-out infinite;
}
.fx-live-waves i:nth-child(2) { animation-delay: 130ms; }
.fx-live-waves i:nth-child(3) { animation-delay: 260ms; }
@keyframes fxLive {
  0%, 100% { height: 3px; opacity: .6; }
  50%      { height: 10px; opacity: 1; }
}
/* 发言时名字条换成"正在说话"，不加高度、不推挤布局 */
.seat.fx-tile.speaking .fx-role { display: none; }
.seat.fx-tile.speaking .fx-live { display: inline-flex; }

/* ══════════════ 状态：正在发言 / 音频播放中 / 选中 / 被打断 / 被点名 ══════════════ */
.seat.fx-tile.speaking {
  border-color: var(--lamp-line);
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px rgba(200,68,42, .22);
  transform: none;
}
.seat.fx-tile.speaking .fx-avatar {
  border-color: var(--lamp);
  box-shadow: none;
}
.seat.fx-tile.speaking .fx-bar {
  background: var(--panel-3);
  border-color: transparent;
  border-left-color: var(--lamp);
  box-shadow: none;
}
.seat.fx-tile.speaking .fx-name { color: var(--text); }

.seat.fx-tile.audio-on {
  border-color: rgba(156, 184, 174, .35);
  box-shadow: none;
}
.seat.fx-tile.audio-on .fx-bar { border-color: transparent; border-left-color: var(--cool); }
.seat.fx-tile.audio-on .fx-name { color: var(--text); }

.seat.fx-tile[aria-pressed="true"] {
  border-color: var(--lamp);
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px rgba(200,68,42, .30);
}
.seat.fx-tile[aria-pressed="true"] .fx-bar { border-left-color: var(--lamp); }
/* 选中角标：点了谁一眼可见 */
.seat.fx-tile[aria-pressed="true"]::after {
  content: "✓";
  position: absolute; right: 7px; top: 7px; z-index: 4;
  width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: var(--fs-1); font-weight: 700; line-height: 1;
  color: var(--bg); background: var(--lamp);
}

.seat.fx-tile.seat-cut .fx-avatar { filter: saturate(.45) brightness(.85); }
.seat.fx-tile.seat-cut .fx-name { color: var(--text-2); }

/* @点名轻闪：voice.css 的版本挂在 .seat-avatar 上（那个类已经不存在了），这里补一份，
   并且必须把 translate(-50%,-50%) 一起写进关键帧，否则头像会在动画里跳位。 */
.seat.fx-tile.mentioned .fx-avatar { animation: fxMentionNudge .5s ease-in-out 2; }
@keyframes fxMentionNudge {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% {
    transform: translate(-50%, -50%) scale(1.12);
    box-shadow: 0 0 0 6px rgba(200,68,42, .18);
  }
}

/* ══════════════ 点名操作条（保留旧交互，只换皮） ══════════════ */
.seat-actions {
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  box-shadow: var(--shadow-2);
  gap: 8px;
  z-index: 6;
}
.sa-avatar {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; overflow: hidden;
  border: 2px solid var(--line);
  background: linear-gradient(180deg, var(--panel-2), var(--panel-2));
}
/* 同上：avatarNode 的 inline width/height 需要 !important 才能被 30px 圆约束住 */
.sa-avatar > :not(.fx-emoji) { width: 100% !important; height: 100% !important; display: block; object-fit: cover; border-radius: 50%; overflow: hidden; }
.sa-avatar .fx-emoji { font-size: var(--fs-5); }

/* ══════════════ 响应式：窄屏 2 列 / 单列，绝不横向溢出 ══════════════ */
@media (max-width: 900px) {
  /* room.css 把 stage 折成上下两行、上行为 auto。宫格的方 tile 必须自己封顶，
     否则 19 个方 tile 会把上面那行撑到 2000px，把发言流整个挤出屏幕。 */
  .stage { grid-template-rows: minmax(0, 46vh) minmax(0, 1fr); }
  #room-pane { padding: 10px 10px 6px; }
  #table-hub { padding: 7px 10px; }
  #table-hub .hub-topic { font-size: var(--fs-2); }
}
@media (max-width: 760px) {
  #seats.seats { gap: 8px; padding: 0; }
  .fx-bar { left: 5px; right: 5px; bottom: 5px; padding: 2px 6px 3px; border-radius: 8px; }
  .fx-name { font-size: var(--fs-1); }
  .fx-role { font-size: var(--fs-1); }
  .seat.fx-tile .waves { height: 16px; padding: 3px 6px; }
  #table-hub .hub-meta { gap: 4px; }
}
@media (max-width: 460px) {
  .fx-role, .fx-host { display: none; }
  /* 触控目标加大后顶栏变高；430px 上优先保证发言流可读，运行指标条让位（它另有专门面板/统计） */
  .metrics-bar { display: none; }
  #table-hub .hub-count { display: none; }
}
@media (max-height: 560px) {
  #mode-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .seat.fx-tile,
  .seat.fx-tile .waves i,
  .seat.fx-tile .fx-live-waves i,
  .seat.fx-tile.mentioned .fx-avatar { animation: none !important; }
  .seat.fx-tile, .fx-avatar { transition: none; }
}

/* ============================================================
   以下为 P5/Zoom 第二轮：会议信息栏（时长/连接/下一位）/ 发言队列 /
   tile 麦克风角标与电平波纹 / 我自己的座位 / 底部 Zoom 式控制条。
   全部是**追加**规则：排在 room.css & 上面的 zoom.css 之后，同优先级后来者胜。
   ============================================================ */

/* ══════════════ 会议信息栏：右半区（下一位 + 状态） ══════════════ */
#table-hub .hub-right {
  flex: none; display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 62%;
}
#table-hub .hub-next {
  font-size: var(--fs-1); line-height: 1.6; padding: 1px 8px 2px;
  border-radius: 999px; white-space: nowrap;
  color: var(--text-2); background: rgba(91, 140, 255, .13);
  border: 1px solid rgba(91, 140, 255, .38);
  overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
/* 时长计时器：跑起来是暖灯色，结束后转灰 */
#table-hub .hub-timer {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: var(--fs-1); padding: 1px 6px 2px; border-radius: 999px;
  color: var(--text-2);
  background: var(--tint-2);
  border: 1px solid var(--line-soft);
  white-space: nowrap;
}
#table-hub .hub-timer[data-state="running"] {
  /* #2D8CFF 压在 --lamp-soft 上只有 2.79:1；文字用加深色（仓库约定 --lamp 只做描边/圆点） */
  color: var(--lamp-text, var(--lamp-strong, var(--lamp))); background: var(--lamp-soft); border-color: var(--lamp-line);
}
#table-hub .hub-timer[data-state="ended"] { color: var(--faint); }
/* 连接状态：与服务端断开必须一眼看出来（不然用户只会怀疑自己耳朵） */
#table-hub .hub-conn { font-size: var(--fs-1); white-space: nowrap; color: var(--faint); }
/* 暗色主题的薄荷绿 #9fe8c9 放到 v5 浅色底上只有 1.31:1（几乎看不见）——改用浅底可读的深绿 */
#table-hub .hub-conn[data-state="on"] { color: var(--ok-strong, var(--ok)); }
#table-hub .hub-conn[data-state="mock"] { color: var(--warn-strong, var(--warn)); }
#table-hub .hub-conn[data-state="off"] { color: var(--danger); }

/* ══════════════ 发言队列条 ══════════════ */
.floor-queue {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  flex: none;
  padding: 4px 8px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  min-width: 0;
}
#floor-queue[hidden] { display: none; }
.fq-label { font-size: var(--fs-1); letter-spacing: .02em; color: var(--faint); flex: none; }
.fq-item {
  font-size: var(--fs-1); line-height: 1.6; padding: 1px 8px 2px;
  border-radius: 999px; white-space: nowrap;
  color: var(--text-2); background: var(--panel-2); border: 1px solid var(--line);
  max-width: 46%; overflow: hidden; text-overflow: ellipsis;
}
.fq-item.fq-cur { color: var(--lamp); background: var(--lamp-soft); border-color: var(--lamp-line); }
.fq-item.fq-next { color: var(--text-2); background: rgba(91, 140, 255, .13); border-color: rgba(91, 140, 255, .4); }
.fq-item.fq-me {
  color: #dcffee; background: rgba(70, 201, 138, .15); border-color: rgba(70, 201, 138, .5);
}
.fq-item.fq-wait, .fq-item.fq-free, .fq-item.fq-end { color: var(--muted); }
@keyframes fqPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(70, 201, 138, 0); }
  50%      { box-shadow: 0 0 0 4px rgba(70, 201, 138, .16); }
}

/* ══════════════ tile：入场过渡 / 降权 / 麦克风角标 / 电平波纹 ══════════════ */
.seat.fx-tile {
  /* 降权通过 CSS 变量下发，避免和入场过渡的 opacity 打架 */
  opacity: var(--dim-op, 1);
  filter: var(--dim-filter, none);
  transition: border-color .16s, box-shadow .16s, transform .16s, background .16s,
              opacity .24s ease-out, filter .24s ease-out;
}
/* 入场：只给"刚进来的人"一格过渡（transition 实现，不影响 hover / speaking 的 transform） */
.seat.fx-tile.fx-enter { opacity: 0; transform: scale(.94) translateY(6px); }
/* 有人说话时其他人降权——但我自己的座位不降权 */
#seats[data-speaker="1"] .seat.fx-tile:not(.speaking):not(.audio-on):not(.fx-self) {
  --dim-op: .74;
  --dim-filter: saturate(.76) brightness(.94);
}

/* 麦克风状态角标：发言中 / 播报中 / 静音 / 被打断 / 等待 */
.fx-mic {
  position: absolute; left: 7px; top: 7px; z-index: 4;
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 7px 2px;
  border-radius: 999px;
  font-size: var(--fs-1); line-height: 1.55; white-space: nowrap;
  color: var(--muted);
  background: rgba(7, 10, 15, .7);
  border: 1px solid var(--hairline);
  backdrop-filter: none;
  transition: color .2s, border-color .2s, background .2s;
}
.fx-mic[data-state="speaking"] { color: var(--lamp); border-color: var(--lamp-line); background: rgba(8,26,42,.78); }
.fx-mic[data-state="audio"]    { color: #bff0ec; border-color: rgba(86, 200, 192, .45); }
.fx-mic[data-state="muted"]    { color: var(--danger); border-color: rgba(255,77,109,.42); background: rgba(8,26,42,.72); }
.fx-mic[data-state="cut"]      { color: var(--violet); border-color: rgba(190, 140, 255, .42); }
.fx-mic[data-state="wait"]     { opacity: .8; }
.fx-mic-txt { letter-spacing: .02em; }

/* 麦克风电平波纹：发言时一圈一圈荡开；我自己的座位由真实电平（--level）驱动 */
.fx-level { position: absolute; inset: -5px; border-radius: 50%; pointer-events: none; }
.fx-level i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--lamp); opacity: 0; }
.seat.fx-tile.speaking .fx-level i { animation: fxRipple 1.7s ease-out infinite; }
.seat.fx-tile.speaking .fx-level i:nth-child(2) { animation-delay: .55s; }
.seat.fx-tile.speaking .fx-level i:nth-child(3) { animation-delay: 1.1s; }
@keyframes fxRipple {
  0%   { transform: scale(.94); opacity: .5; }
  70%  { opacity: .14; }
  100% { transform: scale(1.3); opacity: 0; }
}
.seat.fx-tile.fx-self.recording .fx-level i {
  border-color: var(--user);
  opacity: calc(.14 + var(--level, 0) * .5);
  transform: scale(calc(1 + var(--level, 0) * .12));
  transition: transform .09s linear, opacity .09s linear;
}

/* "下一位" chip（在名字条里，和主持人 chip 一排） */
.fx-next {
  flex: none; font-size: var(--fs-1); line-height: 1.55; padding: 0 5px 1px;
  border-radius: 999px; white-space: nowrap;
  color: var(--text-2); background: rgba(91, 140, 255, .16);
  border: 1px solid rgba(91, 140, 255, .45);
}
.seat.fx-tile.is-next { border-color: rgba(91, 140, 255, .5); }

/* ══════════════ 我自己的座位（最后一格） ══════════════ */
.seat.fx-tile.fx-self {
  cursor: default;
  background: radial-gradient(125% 105% at 50% 0%, var(--panel-3), var(--panel-2) 70%);
  border-color: rgba(91, 140, 255, .34);
}
.seat.fx-tile.fx-self:hover { transform: none; box-shadow: var(--shadow-1); border-color: rgba(91, 140, 255, .5); }
.seat.fx-tile.fx-self .fx-avatar { border-color: rgba(91, 140, 255, .55); }
.seat.fx-tile.fx-self .fx-bar { border-left-color: var(--user); background: rgba(10, 14, 24, .68); }
.seat.fx-tile.fx-self.recording { border-color: var(--user); box-shadow: 0 0 0 2px rgba(91, 140, 255, .45), 0 0 26px 5px rgba(91, 140, 255, .22); }
.seat.fx-tile.fx-self.recording .fx-avatar { border-color: var(--user); }
.seat.fx-tile.fx-self.muted .fx-avatar { filter: saturate(.35) brightness(.82); }
.seat.fx-tile.fx-self.hand-up {
  border-color: rgba(70, 201, 138, .6);
  box-shadow: 0 0 0 2px rgba(70, 201, 138, .3), 0 0 24px 4px rgba(70, 201, 138, .18);
}
.fx-you-badge {
  position: absolute; right: -4px; top: -4px; z-index: 5;
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: var(--fs-1); font-weight: 700; line-height: 1; color: var(--text-2);
  background: linear-gradient(180deg, var(--user), #26428c);
  border: 2px solid var(--panel);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .5);
}
.fx-hand {
  position: absolute; right: 7px; top: 7px; z-index: 5;
  font-size: var(--fs-1); line-height: 1.55; padding: 1px 7px 2px;
  border-radius: 999px; white-space: nowrap;
  color: #dcffee; background: rgba(22, 70, 48, .88);
  border: 1px solid rgba(70, 201, 138, .55);
}
#floor-queue[hidden], .fx-hand[hidden], .fx-next[hidden], .fx-glance[hidden] { display: none; }
/* 「看一眼」：右上角的小眼睛 + 底部一行结果（12 秒后自己收起，不做成常驻状态） */
.fx-self-glance {
  position: absolute; right: 7px; top: 7px; z-index: 6;
  width: 27px; height: 27px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: var(--fs-2); line-height: 1; cursor: pointer;
  color: var(--text-2); background: rgba(10, 14, 24, .72);
  border: 1px solid var(--line);
}
.fx-self-glance:hover { color: #fff; background: var(--panel-2); border-color: rgba(120, 168, 255, .5); }
.fx-glance {
  position: absolute; left: 8px; right: 42px; bottom: 38px; z-index: 5;
  padding: 3px 8px; border-radius: 8px;
  background: rgba(10, 14, 24, .84); border: 1px solid var(--line);
  color: var(--text-2); font-size: var(--fs-1); line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none;
}
.fx-self-mic {
  position: absolute; right: 7px; bottom: 38px; z-index: 6;
  width: 27px; height: 27px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: var(--fs-3); line-height: 1; cursor: pointer;
  color: var(--text-2);
  background: rgba(11, 15, 22, .88);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  transition: background .15s, color .15s, border-color .15s;
}
.fx-self-mic:hover { background: var(--panel-2); color: #fff; border-color: var(--line); }
.seat.fx-tile.fx-self .fx-live { color: var(--text-2); }
.seat.fx-tile.fx-self .fx-live-waves i { background: var(--user); }

/* ══════════════ 底部 Zoom 式控制条 ══════════════ */
.dock { flex-wrap: wrap; }
.dock {
  gap: 10px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  overflow: visible;   /* tooltip / 模式菜单要能探出去 */
}
.dock-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-width: 0; flex-wrap: wrap;
}
.dock-left.ctl-cluster {
  position: relative; flex: none;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.ctl {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 14px; flex: none;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text-2);
  font-size: var(--fs-3); line-height: 1.2; white-space: nowrap; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .06s, box-shadow .15s;
}
.ctl:hover { background: var(--panel-3); color: var(--text); border-color: var(--line); }
.ctl:active { transform: translateY(1px); }
.ctl:disabled { opacity: .45; cursor: not-allowed; }
.ctl .ctl-ico { font-size: var(--fs-5); line-height: 1; }
.ctl .ctl-txt { font-weight: 600; }
.ctl .ctl-caret { font-size: var(--fs-1); opacity: .6; }
.ctl[aria-pressed="true"], .ctl.on {
  border-color: var(--lamp-line); background: var(--lamp-soft); color: var(--lamp);
  box-shadow: inset 0 0 0 1px rgba(200,68,42,.18);
}
.ctl[aria-pressed="true"] .ctl-ico, .ctl.on .ctl-ico { filter: drop-shadow(0 0 6px rgba(200,68,42,.45)); }
.ctl.ctl-icon { min-width: 64px; justify-content: center; }
.ctl.ctl-mode.open { border-color: var(--lamp-line); background: var(--lamp-soft); color: var(--lamp); }
.ctl.ctl-blocked, .ctl.blocked { border-color: rgba(200,68,42,.5); }

/* 图标化按钮的原生 tooltip 之外，再给一层 CSS 气泡（截图里也看得见） */
.ctl[data-tip]::after {
  content: attr(data-tip);
  position: absolute; left: 50%; bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  width: max-content; max-width: 268px;
  padding: 6px 10px;
  border-radius: 9px;
  background: rgba(8, 11, 16, .97);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-2);
  color: var(--text-2);
  font-size: var(--fs-1); font-weight: 400; line-height: 1.45; white-space: normal; text-align: left;
  opacity: 0; pointer-events: none;
  transition: opacity .14s, transform .14s;
  z-index: 62;
}
.ctl[data-tip]:hover::after,
.ctl[data-tip]:focus-visible::after,
#dock[data-tips="all"] .ctl[data-tip]::after { opacity: 1; transform: translateX(-50%) translateY(0); }
/* 模式菜单开着时，不要再让 tooltip 压住菜单本身
   （选择器要写到与 :hover 规则同权重：否则 hover 优先级更高，气泡照样压在菜单上） */
.ctl.ctl-mode[aria-expanded="true"]::after,
.ctl.ctl-mode.open::after { opacity: 0; }

/* 发言模式菜单 */
.dock-pop {
  position: absolute; left: 0; bottom: calc(100% + 10px);
  min-width: 196px; padding: 6px;
  display: flex; flex-direction: column; gap: 2px;
  border-radius: 12px;
  background: rgba(11, 15, 21, .98);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-3);
  z-index: 70;
}
.dock-pop[hidden] { display: none; }
.dock-pop-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-2);
  font-size: var(--fs-3); text-align: left; cursor: pointer;
}
.dock-pop-item:hover { background: var(--panel-2); color: var(--text); }
.dock-pop-item .dpi-ico { flex: none; width: 18px; text-align: center; }
.dock-pop-item .dpi-label { flex: 1 1 auto; }
.dock-pop-item .dpi-check { flex: none; opacity: 0; color: var(--lamp); }
.dock-pop-item.active { background: var(--lamp-soft); color: var(--lamp); }
.dock-pop-item.active .dpi-check { opacity: 1; }

/* 暂停 / 结束：文字由 main.js 改，图标用 ::before 跟着状态走（不会被 textContent 抹掉） */
.ctl-pause::before { content: "⏸"; margin-right: 5px; font-size: var(--fs-2); opacity: .85; }
.ctl-pause[data-paused="1"]::before { content: "▶"; }
.ctl-end::before { content: "⏻"; margin-right: 5px; font-size: var(--fs-2); opacity: .85; }
#btn-end:not(:disabled) { border-color: rgba(217, 113, 107, .32); color: var(--danger); background: linear-gradient(180deg, rgba(178, 74, 66, .12), rgba(178, 74, 66, .12)); }
#btn-end:not(:disabled):hover { background: var(--danger-soft); color: var(--danger); }

/* ══════════════ 窄屏：430px 也要能用 ══════════════ */
@media (max-width: 760px) {
  #table-hub .hub-right { max-width: 100%; }
  .fx-mic { left: 5px; top: 5px; padding: 1px 5px; font-size: var(--fs-1); }
  .fq-item { max-width: 60%; }
}
@media (max-width: 560px) {
  /* 控制条：图标化，一行放下 5 个按钮 */
  #dock { padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); gap: 8px; }
  .dock-row { gap: 8px; }
  .dock-left.ctl-cluster { gap: 6px; }
  .ctl { padding: 9px 11px; font-size: var(--fs-2); }
  .ctl.ctl-icon { min-width: 40px; padding: 9px 0; }
  .ctl.ctl-icon .ctl-txt { display: none; }
  .ctl-mode .ctl-txt { display: inline; }
  .interrupt-btn { padding: 10px 14px; font-size: var(--fs-4); }
  .ctl[data-tip]::after { max-width: 210px; }
  .dock-pop { left: auto; right: 0; min-width: 168px; }
  /* 会议信息栏：两行，去掉分隔点省高度 */
  #table-hub { flex-wrap: wrap; row-gap: 4px; }
  #table-hub .dot-sep { display: none; }
  #table-hub .hub-meta { flex-wrap: wrap; gap: 6px; }
  #table-hub .hub-right { max-width: 100%; }
  .floor-queue { padding: 3px 6px; gap: 4px; }
  .fq-label { display: none; }
}
@media (max-width: 420px) {
  /*
   * 375px（iPhone 竖屏 / 半屏小窗）实测发现三处"能开但不好用"：
   *   ① 会议信息栏 109px 高：同一句"下一位"在信息栏和发言队列条各显示一次，
   *      连接状态在发言流表头也有 —— 重复项把高度从宫格/发言流里抢走；
   *   ② 宫格单列 355px：room.js 的 TINY_VW=400 会切单列，而宫格可视高度只有 ~126px，
   *      用户看到的是一张被裁掉半张脸的头像（375-home 截图）；
   *   ③ 控制条 5 个控件差 ~1px 换行 → 模式按钮独占一行，dock 涨到 314px。
   * 这里只改展示层（列数/tile/间距），不动 room.js 的分页与"看全部"逻辑。
   */
  #table-hub #hub-conn,
  #table-hub #hub-mode,
  #table-hub #hub-next,
  /* 会议状态在顶栏 status-badge 已经写着，hub 里再来一个「进行中」只是重复 */
  #table-hub #hub-status { display: none; }
  #table-hub .hub-meta { flex-wrap: nowrap; overflow: hidden; }
  /* 关键：hub-left 的 flex-basis 从 auto 改成 0，右侧「剧场视图」才会和标题同排
     （basis:auto 时内容宽度 325 → 右块被挤到下一行，hub 从 59px 涨到 109px）。 */
  #table-hub .hub-left { flex: 1 1 0; }
  #table-hub .hub-right { flex: 0 0 auto; max-width: none; }

  /* 375×812 的预算：header + room 36vh(292) + stream + dock。
     列数/tile/头像**由 room.js 按宫格真实可用高度算**（C11），这里不再用 !important
     把 --cols/--tile-h/--av 钉死 —— 两套规则打架时谁赢取决于源码顺序，调一次窗口就露馅。 */
  .stage { grid-template-rows: minmax(0, 36vh) minmax(0, 1fr); }
  .seats-expand { min-height: 36px; padding: 4px 10px; margin: 1px 0 2px; }
  /* 队列条 31px 在 375 上是压垮宫格的最后一根稻草：它显示的"下一位"在 tile 的
     角标里也有，举手反馈另有 meeting-banner。隐藏它换取一整行参会者可见。 */
  #floor-queue { display: none; }

  .dock-left.ctl-cluster { gap: 4px; }
  .dock-left.ctl-cluster .interrupt-btn { padding: 9px 10px; }
  .voice-btn { padding: 9px 10px; }
  .ctl.ctl-mode { padding: 9px 8px; }
}

@media (max-width: 460px) {
  /* 超窄屏：tile 上的文字只留名字，麦克风状态退回纯图标 */
  .fx-mic-txt { display: none; }
  .fx-mic { padding: 2px 6px; }
  .fx-you-badge { width: 20px; height: 20px; font-size: var(--fs-1); }
  .fx-self-mic { right: 5px; bottom: 34px; width: 24px; height: 24px; font-size: var(--fs-2); }
  .fx-next { display: none; }
}
@media (max-height: 560px) {
  .floor-queue { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .seat.fx-tile { transition: none; }
  .seat.fx-tile.fx-enter { opacity: 1; transform: none; }
  .fx-level i, .fx-hand, .fq-item.fq-me { animation: none !important; }
  .seat.fx-tile.fx-self.recording .fx-level i { transition: none; }
  .meeting-banner { transition: none; }
}

/* ============================================================
   第三轮：对照 docs/research/zoom-meeting-ux.md §9/§10 收口。
   三套颜色各管一件事，不许互相顶：
     说话者描边 = 黄（Zoom B 级实拍：the one highlighted in yellow is speaking）
     麦克风/音频电平 = 绿（Zoom：will flicker in green to indicate audio levels）
     TTS 正在出声 = 冷青（项目原有 --cool）
   同时：等大 tile（说话不许放大）、旁听 👁、举手 ✋、统一提示条、红色结束分离。
   ============================================================ */
:root {
  --speak: var(--lamp);
  --speak-line: var(--lamp-line);
  --mic-live: var(--ok);
  --hand: var(--warn);
  --hand-soft: rgba(200,68,42,.16);
  --obs: var(--muted);
  --badge: 20px;
}

/* ① 等大 tile：说话只给描边与发光，**绝不改变尺寸/位置**（四家会议产品一致） */
.seat.fx-tile.speaking { transform: none; }

/* ② 音频电平波纹：正在出声（真人麦克风/TTS 播放）用绿，纯"谁在说话"用黄 */
.seat.fx-tile .fx-level i { border-color: var(--speak); }
.seat.fx-tile.audio-on .fx-level i { border-color: var(--mic-live); }
.seat.fx-tile.fx-self.recording .fx-level i { border-color: var(--mic-live); }

/* ③ 旁听 👁（= Zoom 的"静音"，灰，不是红；红斜杠留给"关掉全部声音"那只按钮） */
.fx-mic[data-state="obs"] { color: var(--obs); border-color: rgba(23,20,15, .1); background: rgba(7, 10, 15, .66); }
.fx-tile[data-state="observing"] .fx-avatar { filter: saturate(.72) brightness(.94); }
.fx-tile[data-state="observing"] .fx-name { color: var(--text); }

/* ④ 举手 ✋：右上角圆形角标，持续到被处理（不是一次性动画） */
.seat.fx-tile .fx-hand {
  position: absolute; right: -4px; top: -5px; z-index: 5;
  width: var(--badge); height: var(--badge); border-radius: 50%;
  display: grid; place-items: center;
  font-size: var(--fs-1); line-height: 1; padding: 0;
  background: linear-gradient(180deg, #3d3418, #221d08);
  border: 1px solid var(--hand); color: var(--hand);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .5);
}
.seat.fx-tile.fx-self.hand-up { border-color: var(--hand); box-shadow: 0 0 0 2px var(--hand-soft), 0 0 24px 4px rgba(200,68,42,.16); }
.seat.fx-tile.hand-up .fx-avatar { border-color: var(--hand); }

/* ⑤ 退席态（数据侧有 left 标记时的视觉；trigger 需要后端/ store 支持） */
.fx-tile[data-state="left"] { opacity: .5; filter: saturate(.4); pointer-events: none; }
.fx-tile[data-state="left"] .fx-name::after { content: " · 已退席"; color: var(--faint); font-weight: 400; }

/* ⑥ 顶部：自动纪要 + 快结束时出现的「延长 10 分钟」 */
#table-hub .hub-rec {
  flex: none; font-size: var(--fs-1); line-height: 1.6; padding: 1px 7px 2px;
  border-radius: 999px; white-space: nowrap;
  color: var(--danger); background: var(--danger-soft); border: 1px solid rgba(255,77,109,.45);
}
#table-hub .hub-rec::before { content: ""; }
#table-hub .hub-extend {
  flex: none; font: inherit; font-size: var(--fs-1); line-height: 1.6;
  padding: 1px 8px 2px; border-radius: 999px; white-space: nowrap; cursor: pointer;
  color: var(--warn); background: rgba(166, 106, 31, .12);
  border: 1px solid rgba(166, 106, 31, .45);
}
#table-hub .hub-extend:hover { background: rgba(166, 106, 31, .2); }
#table-hub .hub-extend[hidden] { display: none; }

/* ⑦ 统一提示条：入席 / 退席 / 请求发言 / 断连（只此一处播报，不进发言流） */
.meeting-banner {
  flex: none;
  display: flex; align-items: center; gap: 8px;
  padding: 5px 12px;
  border-radius: 10px;
  font-size: var(--fs-2); line-height: 1.5;
  color: var(--text-2);
  background: rgba(20, 26, 36, .94);
  border: 1px solid var(--line);
  transform: translateY(-4px);
  opacity: 0;
  transition: opacity var(--t-base, 180ms) ease-out, transform var(--t-base, 180ms) ease-out;
}
#meeting-banner[hidden] { display: none; }
.meeting-banner.show { opacity: 1; transform: translateY(0); }
.meeting-banner[data-kind="join"]  { border-color: rgba(91, 140, 255, .45); color: var(--text-2); }
.meeting-banner[data-kind="leave"] { border-color: var(--line); color: var(--muted); }
.meeting-banner[data-kind="raise"] { border-color: var(--hand); color: var(--warn); background: var(--hand-soft); }
.meeting-banner[data-kind="error"] { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.meeting-banner[data-kind="rec"]   { border-color: var(--speak-line); color: var(--lamp); }

/* ⑧ 危险操作与其它按钮分离：红色结束键靠右、留出间距 */
#btn-end:not(:disabled) { margin-left: 8px; }

/* ⑨ 队列条上的「全场静音中」：静音只影响"你听不听得见"，不影响谁在发言 */
.fq-item.fq-muted { color: var(--danger); background: var(--danger-soft); border-color: rgba(255,77,109,.4); }

/* ⑩ 窄屏修正：控制条左侧集群占满一行、语音按钮不许被压成竖排字；
      并给宫格让出高度（模式提示在窄屏收进模式按钮里） */
@media (max-width: 560px) {
  .dock-left.ctl-cluster { flex: 1 1 100%; min-width: 0; gap: 6px; }
  .dock-left.ctl-cluster .voice-btn { flex: 0 0 auto; white-space: nowrap; }
  .dock-left.ctl-cluster .interrupt-btn { flex: 0 0 auto; padding: 9px 12px; }
  .voice-bar { padding: 5px 8px; gap: 6px; }
  #mode-hint { display: none; }
  .meeting-banner { padding: 4px 10px; font-size: var(--fs-1); }
  /* 触控目标 ≥ 44×44（research §8 M6）：窄屏上按钮只剩图标，必须撑够尺寸 */
  .ctl, .ctl.ctl-icon, .ctl-mode { min-height: 44px; }
  .ctl.ctl-icon { min-width: 44px; }
  .interrupt-btn { min-height: 44px; }
  .voice-btn { min-height: 44px; }
  .dock-right .ghost-btn, .dock-right .icon-btn { min-height: 44px; min-width: 44px; }
  #btn-send { min-height: 44px; }
  /* 自己的 tile 里那颗小麦克风在手机上只有 24px（低于 44px 触控线）：
     窄屏隐藏它，静音统一走底部控制条那颗 44px 的按钮，别给用户留一个点不准的小目标 */
  .fx-self-mic { display: none; }
}
@media (max-width: 460px) {
  .seat.fx-tile .fx-hand { right: -3px; top: -4px; }
}

/* ============================================================
   第四轮（P5 收尾）：430px 窄屏可用 + 能力降级徽标
   ============================================================ */

/* ══════════════ 能力降级徽标（room.js 动态插入 #app-header .head-meeting） ══════════════ */
#health-wrap { position: relative; display: inline-flex; align-items: center; flex: none; }
#health-wrap[hidden] { display: none; }
.health-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel-2);
  color: var(--text-2); font-size: var(--fs-1); line-height: 1.5; cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.health-badge:hover { background: var(--panel-3); color: var(--text); border-color: var(--line); }
.health-badge .hb-ico { font-size: var(--fs-2); line-height: 1; }
#health-wrap[data-state="probing"] .health-badge,
#health-wrap[data-state="unknown"] .health-badge { color: var(--muted); border-style: dashed; }
#health-wrap[data-state="degraded"] .health-badge { color: var(--lamp); border-color: var(--lamp-line); background: var(--lamp-soft); }
#health-wrap[data-state="error"] .health-badge { color: var(--danger); border-color: rgba(255,77,109,.5); background: var(--danger-soft); }

/* 悬停 / 聚焦 / 钉住时展开：哪个不可用 + 影响什么 */
.health-body { position: absolute; right: 0; top: calc(100% + 8px); z-index: 80; display: none; }
#health-wrap:hover .health-body,
#health-wrap:focus-within .health-body,
#health-wrap[data-pinned="1"] .health-body { display: block; }
.health-pop {
  min-width: 232px; max-width: min(330px, calc(100vw - 24px));
  padding: 8px 10px; border-radius: 12px;
  background: rgba(10, 14, 20, .98);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-3);
  display: flex; flex-direction: column; gap: 6px;
  text-align: left;
}
.hp-head { font-size: var(--fs-1); color: var(--muted); }
.hp-item {
  display: flex; flex-direction: column; gap: 1px;
  padding: 5px 7px; border-radius: 8px;
  background: var(--tint); border: 1px solid var(--line-soft);
}
.hp-item[data-level="bad"] { border-color: rgba(255,77,109,.4); background: var(--danger-soft); }
.hp-item[data-level="warn"] { border-color: var(--lamp-line); background: var(--lamp-soft); }
.hp-item.hp-ok { color: var(--muted); }
.hp-t { font-size: var(--fs-2); color: var(--text); }
.hp-i { font-size: var(--fs-1); color: var(--muted); line-height: 1.45; }

/* ══════════════ 430px（手机 / 半屏小窗）可用性收口 ══════════════ */
@media (max-width: 560px) {
  /*
   * ① 顶栏按钮排：原来 .head-actions 是 flex:none + max-content，11 个按钮排成 713px 宽，
   *    被 #app 的 overflow-x:hidden **静默裁掉**（新会议/纪要/记忆/设置根本点不到，
   *    页面还不出现横向滚动条，用户只会以为"没这个功能"）。
   *    改成：占满一行 + 横向滑动（显式可达），并把主操作「新会议」提到最前。
   */
  #app-header .head-actions {
    flex: 1 1 100%; min-width: 0; width: 100%;
    flex-wrap: nowrap; justify-content: flex-start; margin-left: 0;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding-bottom: 2px; scrollbar-width: none;
  }
  #app-header .head-actions::-webkit-scrollbar { display: none; }
  #app-header .head-actions > * { flex: none; }
  /*
   * 这里原来有一条 order:-1 规则，把主操作"视觉提前"到按钮排最左边。
   * 那是假顺序：DOM 里它仍在最后，键盘用户要 Tab 过十几个控件才够得着（C12）。
   * 现在「新会议」在 .head-primary 里、DOM 紧随品牌，order 不再参与定位。
   */

  /*
   * ② 发言流表头：窄屏下 4 个块互挤导致"发言流 ● 已连接"叠在一起。
   *    重排成两行：标题 + 连接徽章 / 统计 + 正在发言（后两者省略号收口）。
   */
  .stream-head { flex-wrap: wrap; gap: 6px; padding: 8px 12px; }
  .stream-head .stream-title { flex: none; }
  .stream-head #conn-badge { margin-left: auto; flex: none; }
  .stream-head #stream-stats { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .stream-head #speaking-badge { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /*
   * ③ 控制条：语音按钮图标化 → 左侧 5 个控件压回一行，dock 从 290px 降到 ~230px，
   *    把高度还给发言流（43ch 宽的小窗里，dock 占 1/3 屏是不可接受的）。
   */
  #btn-voice { padding: 10px 12px; gap: 6px; min-width: 44px; }
  #btn-voice .voice-label, #btn-voice .voice-kbd { display: none; }

  /*
   * ④ 小窗口的高度分配：宫格纵向可滚，但必须给发言流留下可读高度。
   * 第 10 轮把顶栏触控目标提到 44px 后顶栏高了 ~32px，这里从宫格让回 4vh 给发言流
   * （否则 430×900 下 transcript 只剩 111px，低于本套件的 120px 可读线）。
   */
  .stage { grid-template-rows: minmax(0, 32vh) minmax(0, 1fr); }

  /*
   * ⑤ 能力徽标也是顶栏里的可点按钮，但它是 room.js 后插进 .head-meeting 的，
   *    没吃到上面「顶栏按钮 ≥44px」那条规则：实测只有 25px 高（430px 手指点不中）。
   *    详情面板原来 right:0 展开，在 430px 上会跑到视口左侧之外（实测 popLeft=-39）；
   *    这里改成以徽标为中心、宽度封顶在视口内。
   */
  #health-wrap .health-badge { min-height: 44px; padding: 6px 12px; }
  #health-wrap .health-body { left: 50%; right: auto; transform: translateX(-50%); }
  #health-wrap .health-pop { min-width: 0; width: min(260px, calc(100vw - 24px)); max-width: calc(100vw - 24px); }
}

/*
 * ⑤ 浮层（澄清问答 / 新会议 / 快捷键）在窄屏或矮窗口下要能滚动，而且**主按钮必须一直看得见**。
 *
 * 实测（430x900）：澄清卡片 max-height=88dvh=792px、内部 overflow:auto，卡片底部
 * 「全部跳过 / 开始会议」在 y=912..958 —— 落在卡片的可视区之外，只能靠"卡片内部滚动"
 * 才点得到（没有任何滚动提示，用户会以为按钮不存在）。更糟的是 .overlay 当时
 * `overflow-y: visible`：卡片一高就没有第二个滚动兜底。
 * 这里做两件事：浮层自己可滚（兜底）+ 卡片页脚 sticky 常驻（主按钮永远可见）。
 */
@media (max-height: 860px), (max-width: 560px) {
  .overlay { align-items: flex-start; overflow-y: auto; overscroll-behavior: contain; }
  .clarify-card, .modal-card { margin: 0 auto; }
  .clarify-foot, .modal-foot {
    position: sticky; bottom: 0; z-index: 2;
    margin-top: 14px;
    padding: 10px 0 2px;
    border-top: 1px solid var(--line-soft);
    /* 2026-10-21：原来写死深色渐变，浅色主题下页脚变成一条黑带（截图实测）。
       sticky 页脚只需要盖住下方内容，用卡片同色即可，两套主题都成立。 */
    background: var(--panel);
    backdrop-filter: none;
  }
}
@media (max-width: 560px) {
  .overlay { padding: 12px; }
}



/* ══════════════ 会中「投屏」：共享画面（覆盖宫格，像 Zoom 的 screenshare）══════════════
   安全约束在 DOM 层也要写死：iframe 只开 sandbox="allow-scripts"（无同源/无 top 导航/无表单）。
   模型产出的 HTML 永远只进 iframe.srcdoc，绝不进我们的 DOM。 */
.present-stage {
  position: absolute; inset: 0; z-index: 40;
  display: flex; flex-direction: column;
  background: var(--panel);
  border-radius: 10px; overflow: hidden;
  padding: 8px;
  gap: 8px;
}
.present-bar {
  flex: none;
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px 6px;
  font-size: var(--fs-2); color: var(--text-2);
  border-bottom: 1px solid var(--line-soft);
}
.present-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--danger);
  box-shadow: 0 0 0 0 rgba(255,77,109,.5); animation: presentPulse 2s ease-out infinite;
}
@keyframes presentPulse { 0% { box-shadow: 0 0 0 0 rgba(255,77,109,.45); } 70% { box-shadow: 0 0 0 7px rgba(255,77,109,0); } 100% { box-shadow: 0 0 0 0 rgba(255,77,109,0); } }
.present-label { color: var(--danger); font-weight: 600; }
.present-title { color: var(--text); font-weight: 600; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.present-by { color: var(--muted); max-width: 30%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.present-canvas { flex: 1; min-height: 0; position: relative; border-radius: 8px; overflow: hidden; background: var(--panel); }
/* 投屏中：共享画面占大头，发言流收窄（Zoom 的共享语义；否则 44% 的左侧装不下 16:9） */
#app[data-presenting="1"] .stage { grid-template-columns: minmax(0, 1fr) minmax(280px, 26%); }
@media (max-width: 760px) {
  /* 窄屏本来就是单列上下排；投屏时宫格让位给共享画面，发言流继续在下方 */
  #app[data-presenting="1"] .stage { grid-template-columns: minmax(0, 1fr); }
}
.present-frame {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: 0; border-radius: 8px; background: #fff;
}
.present-card { width: min(560px, 100%); }
/* 放大：把共享画面拉成整屏（窄屏/小窗看 16:9 简报时非常有用；再点一次恢复） */
.present-stage.fullscreen { position: fixed; inset: 0; z-index: 120; border-radius: 0; padding: 10px; }
.present-stage.fullscreen .present-frame { border-radius: 8px; }
.present-status {
  margin-top: 12px; padding: 9px 11px; border-radius: var(--r-sm);
  font-size: var(--fs-2); line-height: 1.6;
  border: 1px solid var(--line); background: var(--tint); color: var(--text-2);
}
.present-status[data-kind="ok"] { border-color: rgba(70,245,170,.4); background: rgba(70,245,170,.09); color: var(--ok); }
.present-status[data-kind="warn"] { border-color: rgba(80,235,255,.45); background: rgba(80,235,255,.1); color: var(--lamp); }
.present-status[data-kind="error"] { border-color: rgba(255,77,109,.45); background: rgba(255,77,109,.1); color: var(--danger); }
.present-history { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.present-history:empty { display: none; }
.present-history .ph-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 9px; font-size: var(--fs-2);
  border: 1px solid var(--line-soft); border-radius: var(--r-sm);
  background: var(--tint);
}
.present-history .ph-item b { font-weight: 600; color: var(--text-2); }
.present-history .ph-item .flex-spacer { flex: 1; }
.ph-open { border: 1px solid var(--line); background: transparent; color: var(--text-2); border-radius: 6px; padding: 3px 9px; cursor: pointer; font-size: var(--fs-1); min-height: 30px; }
.ph-open:hover { border-color: var(--lamp-line); color: var(--lamp); }
@media (max-width: 760px) {
  .present-title { max-width: 38%; }
  .present-by { display: none; }
}

/* ══════════════ 窄屏「看全部」：宫格临时铺满主舞台 ══════════════
   430px 下宫格可用高度只有 ~142px，2 行 200px tile 放不下；压到 95px 才放得下但头像跌破 80px。
   所以做一键放大：铺满主舞台（临时隐藏信息栏/发言流），一屏看见 2×2；再点收起。 */
.seats-expand {
  flex: none; align-self: center; margin: 2px 0 4px;
  font-size: var(--fs-2); min-height: 36px;
}
@media (max-width: 460px) { .seats-expand { min-height: 44px; } }
#app[data-seats-expanded="1"] .stage { position: relative; grid-template-columns: minmax(0, 1fr); }
#app[data-seats-expanded="1"] .room-pane {
  position: absolute; inset: 0; z-index: 60;
  align-items: stretch; justify-content: flex-start;
  padding: 10px;
  background: linear-gradient(180deg, var(--panel), var(--panel));
  border-right: 0;
}
#app[data-seats-expanded="1"] #table-hub,
#app[data-seats-expanded="1"] #mode-hint,
#app[data-seats-expanded="1"] #floor-queue,
#app[data-seats-expanded="1"] #metrics-bar,
#app[data-seats-expanded="1"] .stream-pane { display: none !important; }
#app[data-seats-expanded="1"] #seats { flex: 1; min-height: 0; }
#app[data-seats-expanded="1"] .seats-expand {
  position: absolute; top: 8px; right: 10px; z-index: 70; margin: 0;
}

/* ══════════════ 会中「投屏」：共享画面（覆盖宫格，像 Zoom 的 screenshare）══════════════
   安全约束在 DOM 层也要写死：iframe 只开 sandbox="allow-scripts"（无同源/无 top 导航/无表单）。
   模型产出的 HTML 永远只进 iframe.srcdoc，绝不进我们的 DOM。 */
.present-stage {
  position: absolute; inset: 0; z-index: 40;
  display: flex; flex-direction: column;
  background: var(--panel);
  border-radius: 10px; overflow: hidden;
  padding: 8px;
  gap: 8px;
}
.present-bar {
  flex: none;
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px 6px;
  font-size: var(--fs-2); color: var(--text-2);
  border-bottom: 1px solid var(--line-soft);
}
.present-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--danger);
  box-shadow: 0 0 0 0 rgba(255,77,109,.5); animation: presentPulse 2s ease-out infinite;
}
@keyframes presentPulse { 0% { box-shadow: 0 0 0 0 rgba(255,77,109,.45); } 70% { box-shadow: 0 0 0 7px rgba(255,77,109,0); } 100% { box-shadow: 0 0 0 0 rgba(255,77,109,0); } }
.present-label { color: var(--danger); font-weight: 600; }
.present-title { color: var(--text); font-weight: 600; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.present-by { color: var(--muted); max-width: 30%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.present-canvas { flex: 1; min-height: 0; position: relative; border-radius: 8px; overflow: hidden; background: var(--panel); }
/* 投屏中：共享画面占大头，发言流收窄（Zoom 的共享语义；否则 44% 的左侧装不下 16:9） */
#app[data-presenting="1"] .stage { grid-template-columns: minmax(0, 1fr) minmax(280px, 26%); }
@media (max-width: 760px) {
  /* 窄屏本来就是单列上下排；投屏时宫格让位给共享画面，发言流继续在下方 */
  #app[data-presenting="1"] .stage { grid-template-columns: minmax(0, 1fr); }
}
.present-frame {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: 0; border-radius: 8px; background: #fff;
}
.present-card { width: min(560px, 100%); }
/* 放大：把共享画面拉成整屏（窄屏/小窗看 16:9 简报时非常有用；再点一次恢复） */
.present-stage.fullscreen { position: fixed; inset: 0; z-index: 120; border-radius: 0; padding: 10px; }
.present-stage.fullscreen .present-frame { border-radius: 8px; }
.present-status {
  margin-top: 12px; padding: 9px 11px; border-radius: var(--r-sm);
  font-size: var(--fs-2); line-height: 1.6;
  border: 1px solid var(--line); background: var(--tint); color: var(--text-2);
}
.present-status[data-kind="ok"] { border-color: rgba(70,245,170,.4); background: rgba(70,245,170,.09); color: var(--ok); }
.present-status[data-kind="warn"] { border-color: rgba(80,235,255,.45); background: rgba(80,235,255,.1); color: var(--lamp); }
.present-status[data-kind="error"] { border-color: rgba(255,77,109,.45); background: rgba(255,77,109,.1); color: var(--danger); }
.present-history { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.present-history:empty { display: none; }
.present-history .ph-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 9px; font-size: var(--fs-2);
  border: 1px solid var(--line-soft); border-radius: var(--r-sm);
  background: var(--tint);
}
.present-history .ph-item b { font-weight: 600; color: var(--text-2); }
.present-history .ph-item .flex-spacer { flex: 1; }
.ph-open { border: 1px solid var(--line); background: transparent; color: var(--text-2); border-radius: 6px; padding: 3px 9px; cursor: pointer; font-size: var(--fs-1); min-height: 30px; }
.ph-open:hover { border-color: var(--lamp-line); color: var(--lamp); }
@media (max-width: 760px) {
  .present-title { max-width: 38%; }
  .present-by { display: none; }
}

/* ══════════════ 窄屏宫格分页（2×2 一屏 4 人）══════════════
   为什么不压 tile：430px 上把 tile 压到 95px 一屏才塞得下 2 行，但头像会跌到 80px 验收线以下。
   分页能同时保住"头像够大"和"一屏看见 4 个人"，也避免用户在 13 人会议里盲滚。 */
.seat.fx-tile.fx-off-page { display: none !important; }
.seat-pager[hidden] { display: none !important; }
.seat-pager {
  flex: none; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 2px 0 4px;
}
.seat-pager .ghost-btn { min-height: 36px; padding: 6px 12px; font-size: var(--fs-2); }
.seat-pager .ghost-btn:disabled { opacity: .45; cursor: default; }
.seat-pager-label { font-size: var(--fs-1); color: var(--muted); font-family: var(--mono); white-space: nowrap; }
@media (max-width: 460px) {
  /* 触控目标：窄屏上分页按钮也要点得中（≥44px） */
  .seat-pager .ghost-btn { min-height: 44px; }
}

/* ══════════════ 澄清卡：主按钮永远可见 + 稍后/恢复（审计 C02/C04）══════════════ */
#clarify-card {
  display: flex; flex-direction: column;
  max-height: calc(100dvh - 40px);
}
#clarify-card .clarify-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
#clarify-card .clarify-later { flex: none; min-height: 36px; font-size: var(--fs-2); }
#clarify-questions { overflow-y: auto; flex: 1 1 auto; min-height: 0; }
#clarify-card .clarify-actions,
#clarify-card [class*="clarify-foot"] { position: sticky; bottom: 0; background: inherit; }
.clarify-resume {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 8px 10px; padding: 10px 14px;
  border: 1px solid rgba(200,68,42,.35); border-radius: 10px;
  background: rgba(200,68,42,.08); font-size: var(--fs-2); color: var(--text-2);
}
.clarify-resume[hidden] { display: none !important; }
.clarify-resume .primary-btn { min-height: 36px; font-size: var(--fs-2); }
/* 投屏时发言流别被压成一条（审计 C05：374px 时气泡按钮竖排） */
#app[data-presenting="1"] .stage { grid-template-columns: minmax(0, 1fr) minmax(420px, .86fr); }

/* 375px：高度预算必须排在 ≤560 的 .stage 规则之后（同优先级后来者胜）。
   36vh 给宫格，剩下的给发言流；配合 ≤420 的 2 列 128px tile，一行参会者完整可见。 */
@media (max-width: 420px) {
  .stage { grid-template-rows: minmax(0, 36vh) minmax(0, 1fr); }
}

/* 430 窄屏：dock 控件只留图标 —— 「免提 / 视频」两个入口加进来后实测 286px，
   比验收线 260 高，会把发言流挤没。旧界面专属，v5 的 #dock-row 本就隐藏。 */
@media (max-width:520px){
  body:not(.v5) #dock .ctl .ctl-txt{display:none}
  body:not(.v5) #dock .ctl{min-width:34px;padding:0 8px;justify-content:center}
}
