/* 公屏频道右键菜单 + 频道行（对齐主流语音房 频道右键） */
.rm-tree-chan {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  background: #f5f6f8;
  border-bottom: 1px solid #eef1f6;
  cursor: default;
  user-select: none;
}
.rm-tree-chan.on { background: #eef0f3; }
.rm-chan-ico {
  width: 18px; height: 18px; flex: 0 0 18px; border-radius: 4px;
  background: #f0742c; color: #fff; font-size: 10px;
  display: inline-flex; align-items: center; justify-content: center;
}
.rm-chan-name { font-size: 12.5px; color: #2f3948; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-chan-count { font-size: 11px; color: #98a3b5; }

.rm-ctx {
  position: fixed; z-index: 4000; min-width: 168px; padding: 5px 0;
  background: #fff; border: 1px solid #e3e8f1; border-radius: 6px;
  box-shadow: 0 8px 26px rgba(24, 40, 72, .16);
  font-size: 12.5px; color: #3d4759;
}
.rm-ctx-item {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  width: 100%; height: 30px; padding: 0 14px; border: 0; background: transparent;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.rm-ctx-item:hover { background: #f3f6fc; color: #2b45b0; }
.rm-ctx-sep { height: 1px; margin: 4px 0; background: #eef1f6; }
.rm-ctx-item.has-sub .rm-ctx-arrow { font-style: normal; color: #a5b0c2; font-size: 13px; }
.rm-ctx-sub {
  display: none; position: absolute; left: 100%; top: -5px; min-width: 132px; padding: 5px 0;
  background: #fff; border: 1px solid #e3e8f1; border-radius: 6px;
  box-shadow: 0 8px 26px rgba(24, 40, 72, .16);
}
.rm-ctx-item.has-sub:hover .rm-ctx-sub { display: block; }

.rm-toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(6px);
  padding: 7px 14px; border-radius: 16px; background: rgba(28, 34, 48, .9); color: #fff;
  font-size: 12.5px; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 4100;
}
.rm-toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

body.narrow .rm-tree { display: none; }

/* 收起分组 */
#member-list .member-group.folded .member-row { display: none; }
#member-list .member-group.folded .group-title::before {
  border-left-color: #b3bccb; transform: rotate(-90deg);
}

/* 子频道树 */
.rm-tree-sub { background: #fff; }
.rm-sub-row {
  display: flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px 0 14px;
  border-bottom: 1px solid #f6f8fb; font-size: 12.5px; color: #3d4759;
  cursor: default; user-select: none;
}
.rm-sub-row.chan { cursor: pointer; }
.rm-sub-row.chan:hover { background: #f5f8ff; }
.rm-sub-tri {
  width: 0; height: 0; flex: 0 0 auto;
  border-left: 4px solid #b9c2d0; border-top: 3.5px solid transparent; border-bottom: 3.5px solid transparent;
}
.rm-sub-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-sub-count { color: #98a3b5; font-size: 11px; }
.rm-sub-chico {
  width: 16px; height: 16px; flex: 0 0 16px; border-radius: 3px;
  background: #f0742c; color: #fff; font-size: 9px;
  display: inline-flex; align-items: center; justify-content: center;
}
.rm-owner-crown {
  width: 16px; height: 16px; flex: 0 0 16px; border-radius: 3px;
  background: #f5b93a; color: #7a4a00; font-size: 9px;
  display: inline-flex; align-items: center; justify-content: center;
}
.rm-sub-vip { color: #8f6be0; font-size: 10.5px; font-weight: 600; }
.rm-sub-row.notice .rm-sub-name { color: #8b97a9; font-size: 12px; }

/* 子频道/公告行前的「+」小方块（语音房 样式） */
.rm-sub-plus {
  width: 13px; height: 13px; flex: 0 0 13px; border-radius: 2px;
  background: #eef1f6; color: #9aa5b6; font-size: 11px; line-height: 13px;
  text-align: center; font-weight: 600;
}
.rm-sub-plus-chan { background: #e8eef7; color: #6f7f96; }
.rm-sub-row.chan .rm-sub-name { color: #3d4759; }
.rm-sub-row.chan:hover .rm-sub-plus-chan { background: #3554d1; color: #fff; }

/* 房主行的小徽章（房主/管理/官方/职务） */
.rm-sub-badge {
  height: 14px; padding: 0 4px; border-radius: 3px; flex: 0 0 auto;
  font-size: 9.5px; line-height: 14px; color: #fff; font-weight: 600;
  background: #98a3b5;
}
.rm-sub-badge.owner { background: #f0a92a; }
.rm-sub-badge.admin { background: #4a86e8; }
.rm-sub-badge.official { background: #2e9c7d; }
.rm-sub-badge.meta { background: #8f6be0; }

/* ===== 站内小对话框（新建/重命名/删除子频道） ===== */
.rm-dlg-mask {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(17, 24, 39, .36);
  display: flex; align-items: center; justify-content: center;
}
.rm-dlg {
  width: 320px; background: #fff; border-radius: 8px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .28);
  overflow: hidden; font-size: 13px; color: #2b3340;
}
.rm-dlg-hd {
  padding: 12px 14px 8px; font-size: 14px; font-weight: 600; color: #1f2733;
}
.rm-dlg-bd { padding: 0 14px 6px; }
.rm-dlg-text { color: #5a6577; line-height: 1.6; padding-bottom: 6px; }
.rm-dlg-in {
  width: 100%; height: 32px; box-sizing: border-box;
  padding: 0 10px; border: 1px solid #d6dbe6; border-radius: 4px;
  font-size: 13px; color: #2b3340; outline: none;
}
.rm-dlg-in:focus { border-color: #3554d1; box-shadow: 0 0 0 2px rgba(53, 84, 209, .12); }
.rm-dlg-err { min-height: 16px; padding-top: 4px; color: #e5484d; font-size: 11.5px; }
.rm-dlg-ft { display: flex; justify-content: flex-end; gap: 8px; padding: 4px 14px 14px; }
.rm-dlg-btn {
  height: 30px; padding: 0 16px; border-radius: 4px; font-size: 13px;
  border: 1px solid #d6dbe6; background: #f7f8fa; color: #3d4759; cursor: pointer;
}
.rm-dlg-btn:hover { background: #eef1f6; }
.rm-dlg-btn.primary { background: #3554d1; border-color: #3554d1; color: #fff; }
.rm-dlg-btn.primary:hover { background: #2b45b0; }
.rm-dlg-btn.danger { background: #e5484d; border-color: #e5484d; color: #fff; }
.rm-dlg-btn.danger:hover { background: #cf3b40; }

/* 全员禁言 / 禁止自由上麦 提示行 */
.rm-lock-row {
  display: flex; align-items: center; gap: 6px;
  margin: 2px 6px 4px; padding: 3px 8px;
  border-radius: 4px; background: #fff5f5; color: #c2413f;
  font-size: 11px; line-height: 16px;
}
.rm-lock-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #e5484d; flex: 0 0 6px;
}

/* 官方认证频道的树内小标 */
.rm-sub-official {
  flex: 0 0 auto; height: 14px; line-height: 14px; padding: 0 5px;
  border-radius: 3px; font-size: 9.5px; font-weight: 600;
  color: #7a4e00; background: linear-gradient(135deg, #ffe9b0, #f2c14e);
}

/* 频道模板选择 */
.rm-tpl-list { display: flex; flex-direction: column; gap: 8px; padding: 2px 0 6px; }
.rm-tpl {
  display: grid; grid-template-columns: 18px 1fr; grid-template-rows: auto auto;
  column-gap: 8px; align-items: center; cursor: pointer;
  border: 1px solid #e3e8f1; border-radius: 8px; padding: 8px 10px; background: #fff;
}
.rm-tpl.on { border-color: #3554d1; box-shadow: 0 0 0 2px rgba(53,84,209,.12); background: #f7f9ff; }
.rm-tpl input { grid-row: 1 / span 2; margin: 0; }
.rm-tpl-t { font-size: 13px; font-weight: 600; color: #26303f; }
.rm-tpl-d { font-size: 11.5px; color: #7b8598; }

/* 右键菜单：卡片式（大圆角、白底、细边、柔和阴影、分组留白） */
.rm-ctx {
  min-width: 168px; padding: 6px;
  border: 1px solid #e5eaf3; border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(22, 38, 72, .16), 0 2px 6px rgba(22, 38, 72, .06);
  font-size: 13px; color: #2f3a4d;
}
.rm-ctx-item { height: 32px; padding: 0 12px; border-radius: 8px; }
.rm-ctx-item:hover { background: #eef4ff; color: #2b45b0; }
.rm-ctx-sep { height: 1px; margin: 6px 8px; background: #eef1f6; }
.rm-ctx-item.has-sub .rm-ctx-arrow { font-size: 12px; color: #9aa5b6; }
.rm-ctx-sub {
  min-width: 148px; padding: 6px;
  border: 1px solid #e5eaf3; border-radius: 12px;
  box-shadow: 0 12px 34px rgba(22, 38, 72, .16), 0 2px 6px rgba(22, 38, 72, .06);
}

/* 弹层：按钮不换行、模板弹层更宽 */
.rm-dlg { width: 320px; }
.rm-dlg.has-tpl { width: 380px; max-width: calc(100vw - 32px); }
.rm-dlg-ft { flex-wrap: nowrap; }
.rm-dlg-btn { white-space: nowrap; padding: 0 14px; flex: 0 0 auto; }
.rm-tpl-t, .rm-tpl-d { white-space: normal; }

/* 频道模板 · 经典式小菜单（贴在底栏按钮上方） */
.rm-tpl-pop {
  position: fixed; z-index: 9100; width: 168px; padding: 4px;
  background: #fff; border: 1px solid #d9dee6; border-radius: 6px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, .18);
  display: flex; flex-direction: column; gap: 2px;
}
.rm-tp-item {
  display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px;
  border: 0; background: none; border-radius: 4px; cursor: pointer;
  font-size: 13px; color: #333; text-align: left;
}
.rm-tp-item:hover { background: #f2f5fa; }
.rm-tp-ico {
  width: 20px; height: 20px; flex: 0 0 20px; border-radius: 4px;
  background: #eef1f6; color: #6b7688; font-style: normal;
  font-size: 12px; line-height: 20px; text-align: center;
}
.rm-tp-chair .rm-tp-ico { background: #e8eef7; color: #3554d1; }
.rm-tp-tx { flex: 1 1 auto; }
.rm-tp-ok { color: #22b573; font-style: normal; font-size: 13px; }
.rm-tp-arrow { color: #9aa5b6; font-style: normal; font-size: 12px; }
.rm-tp-more { border-top: 1px solid #eef1f6; margin-top: 2px; padding-top: 2px; height: 34px; }
.rm-tpl-pop { z-index: 9700; }

/* 经典式两层树：子频道缩进 + 当前频道高亮 + 父频道可点回 */
.rm-sub-row.chan.parent { cursor: pointer; }
.rm-sub-row.chan.parent:hover { background: #eef3ff; }
.rm-sub-row.chan.sub1 { padding-left: 20px; }
.rm-sub-row.chan.active { background: #f2f6ff; cursor: default; }
.rm-sub-row.chan.active .rm-sub-name { color: #3554d1; font-weight: 600; }

/* 左栏房间树：展开三角 + 成员行（经典式） */
.rm-sub-tri {
  width: 0; height: 0; flex: 0 0 0; margin-right: 5px;
  border-left: 5px solid #98a3b5;
  border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  transition: transform .15s;
}
.rm-sub-tri.open { transform: rotate(90deg); }
.rm-sub-row.chan { display: flex; align-items: center; height: 28px; padding: 0 8px 0 6px; }
.rm-sub-row.chan .rm-sub-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.rm-sub-member {
  display: flex; align-items: center; gap: 4px;
  height: 24px; padding: 0 8px 0 30px; font-size: 12px; color: #5d6a7e;
}
.rm-sub-member.hint { color: #a2acbb; padding-left: 30px; }
.rm-sub-member:hover { background: #f4f7fd; }
.rm-sub-mdot { width: 5px; height: 5px; border-radius: 50%; background: #c9d2de; flex: 0 0 5px; transition: background .18s; }
/* 在麦：常亮绿点（不发散） */
.rm-sub-mdot.on { background: #34c26b; box-shadow: 0 0 0 2px rgba(52, 194, 107, .14); }
/* 说话：绿点外圈呼吸扩散 */
.rm-sub-mdot.speaking {
  background: #22d06c;
  animation: rmDotBreath 1s ease-in-out infinite;
}
@keyframes rmDotBreath {
  0%, 100% { box-shadow: 0 0 0 1px rgba(34, 208, 108, .55); transform: scale(1); }
  50%      { box-shadow: 0 0 0 4px rgba(34, 208, 108, 0);  transform: scale(1.3); }
}
@media (prefers-reduced-motion: reduce) {
  .rm-sub-mdot.speaking { animation: none; box-shadow: 0 0 0 2px rgba(34, 208, 108, .35); }
}
.rm-sub-mbadge { font-size: 9px; line-height: 12px; padding: 0 3px; border-radius: 2px; color: #fff; }
.rm-sub-mbadge.owner { background: #f0a92a; }
.rm-sub-mbadge.admin { background: #4a86e8; }
.rm-sub-mbadge.off { background: #2e9c7d; }
.rm-sub-mname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 110px; }

/* 分组标题：默认可点折叠，三角转向 */
#member-list .member-group > .group-title { cursor: pointer; user-select: none; }
#member-list .member-group.folded > .group-title { color: #8a94a6; }
#member-list .member-group.folded > .group-title::before { transform: rotate(-90deg); }

/* 左栏面包屑：岛 › 频道 › 子频道 */
.rm-crumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: 2px;
  padding: 4px 10px 5px; font-size: 11px; color: #8a94a6;
  border-bottom: 1px solid #eef1f6; background: #fbfcfe;
}
.rm-crumb-i { cursor: pointer; max-width: 88px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-crumb-i:hover { color: #3554d1; }
.rm-crumb-i.cur { color: #3554d1; font-weight: 600; cursor: default; }
.rm-crumb-sep { color: #c3cbd8; }

/* 成员分组（管理/成员/游客…）已由左栏频道树承载，宽版不再重复显示 */
body:not(.narrow) #screen-room #member-list { display: none !important; }

/* 左栏成员行：复用公屏聊天行的徽章体系，但压缩到 232px 栏宽里 */
.rm-sub-member { overflow: hidden; height: 24px; gap: 0; }
.rm-sub-member .rm-sub-mdot { margin-right: 4px; flex: 0 0 5px; }
.rm-sub-member .rm-sub-mbody {
  display: flex; align-items: center; gap: 2px;
  min-width: 0; overflow: hidden; white-space: nowrap;
  transform: scale(.86); transform-origin: left center;
  width: 116%;            /* 缩放后仍占满可视宽度 */
}
.rm-sub-member .rm-sub-mbody .from { font-size: 13px; max-width: 128px; overflow: hidden; text-overflow: ellipsis; }
.rm-sub-member .rm-sub-mbody .chat-no { font-size: 11px; color: #97a2b4; }
.rm-sub-member .rm-sub-mbody .b-tile,
.rm-sub-member .rm-sub-mbody .vip-tile { transform: scale(.82); transform-origin: left center; margin-right: -1px; }
.rm-sub-member .rm-sub-mbody .name-prefix { font-size: 10px; padding: 0 3px; }
.rm-sub-member .rm-sub-mbody .badge { height: 14px; line-height: 14px; font-size: 9px; padding: 0 3px; }

/* 创建子频道表单（仿 语音房）：父频道只读 + 名称 + 密码 + 模板单选 */
.rm-dlg.rm-dlg-wide { width: 476px; max-width: calc(100vw - 40px); }
.rm-fld { display: grid; grid-template-columns: 74px 1fr; align-items: center; gap: 8px; margin-bottom: 10px; }
.rm-fld > label { font-size: 12.5px; color: #55617a; text-align: right; }
.rm-fld .rm-dlg-in { width: 100%; }
.rm-fld .rm-dlg-in.ro { background: #f2f4f8; color: #6b7488; }
.rm-tpl-hd { margin: 14px 0 8px; font-size: 12.5px; color: #55617a; }
.rm-tpl-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.rm-tpl-opt {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 8px 4px; border: 1px solid #e2e7f0; border-radius: 8px; cursor: pointer;
  background: #fff;
}
.rm-tpl-opt input { position: absolute; opacity: 0; pointer-events: none; }
.rm-tpl-opt.on { border-color: #3554d1; box-shadow: 0 0 0 2px rgba(53,84,209,.14); }
.rm-tpl-ico {
  width: 100%; height: 52px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px; font-weight: 700;
}
.rm-tpl-ico.t-free { background: linear-gradient(135deg,#8fb3ff,#5f86f0); }
.rm-tpl-ico.t-chair { background: linear-gradient(135deg,#c084fc,#7c3aed); }
.rm-tpl-t { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.rm-tpl-t b { font-size: 12px; color: #26303f; font-weight: 600; }
.rm-tpl-t i { font-size: 10.5px; color: #93a0b4; font-style: normal; }

/* 顶级频道：金色小房子；子频道：低调气泡（不再显示文字方块） */
.rm-sub-chico.house {
  background: linear-gradient(160deg, #ffd15c, #f0a92a);
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(190, 120, 10, .35);
}
.rm-sub-chico.house svg { width: 11px; height: 11px; fill: #6a4400; }
.rm-sub-chico.chat {
  background: transparent; border-radius: 0; box-shadow: none;
}
.rm-sub-chico.chat svg { width: 12px; height: 12px; fill: #9aa6ba; }
.rm-sub-row.chan.active .rm-sub-chico.chat svg { fill: #4a5fc4; }

/* 创建频道窗体（经典风：标签 + 控件 + 行内小按钮） */
.rm-dlg.wide { width: 420px; }
.rm-dlg-fields { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.rm-dlg-row { display: flex; align-items: center; gap: 8px; }
.rm-dlg-lab { flex: 0 0 68px; text-align: right; font-size: 12.5px; color: #4b5568; }
.rm-dlg-ctl { flex: 1 1 auto; display: flex; align-items: center; gap: 6px; min-width: 0; }
.rm-dlg-in2, .rm-dlg-sel {
  flex: 1 1 auto; min-width: 0; height: 30px; padding: 0 8px;
  border: 1px solid #d6dbe6; border-radius: 4px; font-size: 12.5px; color: #26303f;
  background: #fff;
}
.rm-dlg-in2:focus, .rm-dlg-sel:focus { outline: none; border-color: #7aa2ff; box-shadow: 0 0 0 2px rgba(122,162,255,.18); }
.rm-dlg-mini {
  flex: 0 0 auto; height: 30px; padding: 0 10px; border-radius: 4px;
  border: 1px solid #d6dbe6; background: #f7f8fa; color: #3554d1; font-size: 12px; cursor: pointer;
}
.rm-dlg-mini:hover { background: #eef3ff; border-color: #b9cdff; }

/* 左栏是浅色底：流光渐变直接用会偏淡，加一层深描边让它和公屏一样看得清 */
.rm-sub-member .from.nick-shimmer {
  -webkit-text-stroke: .3px rgba(24, 32, 52, .38);
  font-weight: 800;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .55);
}

/* ── 公屏底栏：图标 + 短词，自有分组 ───────────────────────── */
.rm-foot-cap {
  font-size: 11px; color: #9aa3b2; letter-spacing: .12em;
  margin-right: 2px; user-select: none;
}
.rm-foot-item {
  display: inline-flex; align-items: center; gap: 5px;
  height: 30px; padding: 0 12px; border-radius: 15px;
  border: 1px solid #e2e7f0; background: #fff; color: #41485a;
  font-size: 12.5px; line-height: 1; transition: all .15s;
}
.rm-foot-item .rf-ic {
  font-style: normal; font-size: 13px; color: #5b7cfa; opacity: .9;
}
.rm-foot-item:hover:not(:disabled) {
  border-color: #b9c8f5; background: #f4f7ff; color: #26407e;
}
.rm-foot-item:disabled { opacity: .55; }
.rm-foot-item.is-soon { position: relative; }
.rm-foot-item.is-soon::after {
  content: ""; position: absolute; top: 3px; right: 4px;
  width: 4px; height: 4px; border-radius: 50%; background: #ffb64d;
}
#btn-tpl, #btn-store { border-color: #cdd9ff; color: #2b4ea8; background: #f6f9ff; }

/* 方案卡片（弹层） */
.rm-tpl { align-items: flex-start; }
.rm-tpl-t { display: flex; align-items: center; gap: 6px; }
.rm-tpl-tag {
  font-style: normal; font-size: 10.5px; font-weight: 500;
  color: #5b7cfa; background: #eef3ff; border-radius: 8px;
  padding: 1px 7px; line-height: 16px;
}

.rm-tpl .rm-tpl-t { display: flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.rm-tpl .rm-tpl-tag { flex: 0 0 auto; }

.rm-tpl-d { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.rm-tpl-d .rm-tpl-tag { flex: 0 0 auto; }

.rm-tpl { position: relative; }
.rm-tpl > .rm-tpl-tag {
  position: absolute; right: 10px; top: 9px; flex: none;
}
