/* ===== 主题变量:默认浅色星际青蓝(变量名沿用 --green*,只是主色的代号) ===== */
:root {
  color-scheme: light;
  /* 字号取中间档:辅助信息 12、按钮与标签 13、消息正文与频道名 15、标题 17。
     最初是 11 / 12 / 14 / 16(偏小),KOOK 是 12 / 14 / 16(试过,在这套紧凑布局里显得太大) */
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 15px;
  --fs-lg: 17px;
  --green: #0284c7;
  --green-strong: #0369a1;
  --green-soft: #e0f2fe;
  --green-line: #bae6fd;
  --bar-from: #0ea5e9;
  --bar-to: #0284c7;
  --bg: #eef2f6;
  --main: #ffffff; /* 中间主区(公屏)底色:浅色用纯白,靠细线与两侧分区 */
  --panel: #ffffff;
  --panel-2: #f5f7fa;
  --hover: #edf4fa;
  --line: #dce4ec;
  --text: #18222c;
  --muted: #64748b;
  --ink-base: #000;      /* 马甲文字与黑色混合,保证浅色下对比度 */
  --ink-mix: 58%;
  --shadow: 0 1px 2px #0000000d, 0 4px 14px #0000000a;
  /* 说话绿与喊话橙:固定色,不随主色变化,选暗主色时也能一眼看出谁在说话 */
  --speak: #16a34a;
  --shout: #ea580c;
  --danger: #e5484d;
  --status-online: #a7f3c0;
  --status-connecting: #fcd34d;
  font: var(--fs-md)/1.5 'Segoe UI Variable', 'Segoe UI', 'Microsoft YaHei UI', 'PingFang SC', system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}
[data-theme='dark'] {
  color-scheme: dark;
  --green: #0ea5e9;
  --green-strong: #38bdf8;
  --green-soft: #0c2d42;
  --green-line: #164e63;
  --bar-from: #0c4a6e;
  --bar-to: #082f49;
  --bg: #1a1c1f;
  --main: var(--bg);
  --panel: #232528;
  --panel-2: #1e2023;
  --hover: #2c2f33;
  --line: #34373c;
  --text: #e6e9e7;
  --muted: #9aa39e;
  --ink-base: #fff;
  --ink-mix: 100%;
  --shadow: 0 1px 2px #0005;
  --speak: #4ade80;
  --shout: #fb923c;
}

/* ===== 基础 ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; overflow: hidden; }
h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
[hidden] { display: none !important; }
/* 手机专属节点(底部 Tab、语音控制台等):桌面端一律不显示。要带 !important——这些节点有的同时带 .tb-button、.ghost-icon 这类自己写了 display 的类;
   条件正好是 mobile.css 生效条件的反面,所以 ≤680px 时这条不存在,显示与否全由 mobile.css 决定 */
@media not all and (max-width: 680px) { .m-only { display: none !important; } }
svg { width: 18px; height: 18px; flex: none; }
small { color: var(--muted); font-size: var(--fs-sm); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ===== 整体布局:标题栏 + 三栏 ===== */
/* 最左一列是社区栏(登录后才有,.has-rail;未登录时这一列宽 0) */
.app {
  --rail-w: 0px;
  height: 100dvh;
  display: grid;
  grid-template: 48px minmax(0, 1fr) / var(--rail-w) 248px minmax(0, 1fr) 232px;
  grid-template-areas: 'bar bar bar bar' 'rail side main roster';
}
.app.has-rail { --rail-w: 56px; }
.app.no-roster { grid-template-columns: var(--rail-w) 248px minmax(0, 1fr) 0; }
.app.no-roster .roster { display: none; }

/* ===== 标题栏 ===== */
.titlebar {
  grid-area: bar; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 12px 0 14px; color: #fff;
  background: linear-gradient(180deg, var(--bar-from), var(--bar-to));
  box-shadow: 0 1px 0 #0000001f;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand strong { font-size: var(--fs-lg); letter-spacing: .04em; white-space: nowrap; }
.logo { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; gap: 2px; border-radius: 8px; background: #ffffff2b; }
.logo i { width: 3px; height: 8px; border-radius: 2px; background: #fff; }
.logo i:nth-child(2) { height: 16px; } .logo i:nth-child(3) { height: 12px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); white-space: nowrap; }
.status::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--status-connecting); }
.status.online::before { background: var(--status-online); }
.title-actions { display: flex; align-items: center; gap: 6px; }
.tb-button { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: #fff; }
.tb-button:hover, .tb-button[aria-pressed='true'] { background: #ffffff2e; }
#dm-open, #alerts-open { position: relative; }
.tb-button .dot { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 99px; background: var(--danger); }
.titlebar .button.primary { background: #fff; color: var(--green-strong); }
.titlebar .button.primary:hover { background: color-mix(in srgb, var(--green) 8%, #fff); }
.desktop-app .titlebar { padding-right: 0; }
.desktop-app .auth { top: 48px; }
.desktop-app:has(.auth:not([hidden])) .titlebar :is(.brand, .title-actions > .tb-button) { visibility: hidden; }
.guild-open { min-width: 0; }
.guild-open strong { overflow: hidden; text-overflow: ellipsis; }
.guild-open .logo { flex: none; }
.desktop-app .title-actions { align-self: stretch; flex: none; }
.desktop-app .win-controls { --close-hover: #e81123; display: flex; align-self: stretch; margin-left: 4px; }
.desktop-app .win-controls .tb-button { width: 46px; height: 100%; border-radius: 0; }
.desktop-app .win-controls svg { width: 16px; height: 16px; }
.desktop-app #win-close:hover { background: var(--close-hover); }

/* ===== 通用按钮 ===== */
.button { min-height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font-weight: 600; white-space: nowrap; }
.button:hover:not(:disabled) { background: var(--hover); }
.button.primary { border-color: transparent; background: var(--green); color: #fff; }
.button.primary:hover:not(:disabled) { background: var(--green-strong); }
[data-theme='dark'] .button.primary { color: color-mix(in srgb, var(--green) 20%, #000); }
.button.block { width: 100%; min-height: 40px; }
/* 链接当按钮用(EVE 登录、添加角色):去掉链接自带的蓝色与下划线,文字居中,与 <button> 外观一致 */
a.button { display: inline-flex; align-items: center; justify-content: center; color: inherit; text-decoration: none; }
a.button.block { display: flex; }
.ghost-icon { width: 26px; height: 26px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: var(--fs-lg); }
.ghost-icon:hover { background: var(--hover); color: var(--text); }
.ghost-icon svg { width: 16px; height: 16px; }

/* ===== 最左侧社区栏(单服多社区):已加入的社区一个一枚图标,底部「+」加入或新建 =====
   选中:左侧一条高的主色指示条 + 图标圆角收小;有未读:左侧一小段低调的点;被 @:右下角红底数字;在语音里:右上角绿色小喇叭 */
.guild-rail { grid-area: rail; min-width: 0; min-height: 0; display: flex; flex-direction: column; align-items: center; background: var(--panel-2); border-right: 1px solid var(--line); }
.guild-list { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 0; overflow-y: auto; }
.guild-icon { position: relative; flex: none; width: 40px; height: 40px; padding: 0; border: 0; background: transparent; color: #fff; }
.gi-face { width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden; border-radius: 14px; background: var(--gc, #0284c7); font-size: var(--fs-md); font-weight: 700; transition: border-radius .12s; }
.gi-face img { width: 100%; height: 100%; object-fit: cover; }
.guild-icon:hover .gi-face, .guild-icon.current .gi-face { border-radius: 10px; }
.gi-pill { position: absolute; top: 50%; left: -8px; width: 3px; height: 0; border-radius: 0 3px 3px 0; background: var(--muted); transform: translateY(-50%); transition: height .12s; }
.guild-icon.unread .gi-pill { height: 8px; }
.guild-icon.current .gi-pill { height: 28px; background: var(--green); }
.gi-voice { position: absolute; top: -4px; right: -4px; width: 16px; height: 16px; display: grid; place-items: center; border-radius: 50%; background: var(--speak); color: #fff; box-shadow: 0 0 0 2px var(--panel-2); }
.gi-voice svg { width: 10px; height: 10px; }
.gi-badge { position: absolute; right: -5px; bottom: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px; background: var(--danger); color: #fff; font-size: var(--fs-xs); font-weight: 700; line-height: 18px; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 2px var(--panel-2); }
.guild-add { position: relative; flex: none; width: 40px; height: 40px; margin: 11px 0 10px; display: grid; place-items: center; padding: 0; border: 1px dashed var(--line); border-radius: 14px; background: transparent; color: var(--muted); }
.guild-add::before { content: ''; position: absolute; top: -11px; left: 4px; right: 4px; border-top: 1px solid var(--line); }
.guild-add:hover { border-color: var(--green); color: var(--green-strong); background: var(--hover); }
/* 站长入口:在「+」上方,实线框;它在时分隔线画在它上面,「+」不再重复 */
.guild-admin { margin-bottom: 0; border-style: solid; }
.guild-admin:not([hidden]) + .guild-add { margin-top: 8px; }
.guild-admin:not([hidden]) + .guild-add::before { content: none; }
/* 零社区引导页:盖住社区栏右侧的整个工作区(含状态栏) */
.empty-guild { grid-row: 2 / -1; grid-column: 2 / -1; z-index: 5; min-width: 0; min-height: 0; display: grid; place-items: center; padding: 16px; overflow: auto; background: var(--bg); }
.eg-card { width: min(400px, 100%); display: grid; justify-items: center; gap: 12px; padding: 28px 24px; border-radius: 16px; background: var(--panel); box-shadow: var(--shadow); text-align: center; }
.eg-logo { width: 48px; height: 48px; border-radius: 14px; background: var(--green); }
.eg-card h2 { font-size: var(--fs-lg); }
.eg-who { max-width: 100%; display: flex; gap: 6px; color: var(--muted); font-size: var(--fs-sm); }
.eg-hint { color: var(--muted); font-size: var(--fs-sm); }
.eg-join { width: 100%; display: flex; gap: 8px; }
.eg-join .button { flex: none; min-height: 38px; }
/* 零社区时没有语音:状态栏不显示,社区栏一直铺到底;顶栏的连接状态点也不显示(没连实时推送,不是「连接中」) */
.app.no-guild .statusbar, .app.no-guild .titlebar .status { display: none; }
.app.no-guild .guild-rail { grid-row: 2 / -1; }
/* 加入或新建社区弹窗 */
.guild-add-form { display: grid; gap: 12px; }
.guild-add-form small { font-size: var(--fs-xs); }
/* 社区资料底部的危险操作:与「保存」分开,一个都没有时整块不占位 */
.guild-danger { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.guild-danger:not(:has(> :not([hidden]))) { display: none; }
/* 提示条里的快捷按钮(别的社区来了作战通知时「去看看」) */
.notice-action { margin-left: 12px; padding: 0; border: 0; background: transparent; color: inherit; font-weight: 700; text-decoration: underline; }
/* 状态栏:跨社区浏览时「社区名 · 频道名」,点一下回到语音所在的社区 */
.sb-home { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; }
.sb-room.sb-home { max-width: 220px; }
.sb-home:hover .truncate { text-decoration: underline; }

/* ===== 左侧:YY 式频道树 ===== */
.sidebar, .roster { display: flex; flex-direction: column; min-height: 0; background: var(--panel); }
.sidebar { grid-area: side; border-right: 1px solid var(--line); }
/* ===== 侧栏顶部的社区卡片(参照 KOOK):头图 + 标志 + 名称 + 频道号,点一下打开社区资料。没上传头图时用下面的默认头图 ===== */
.guild-card { flex: none; border-bottom: 1px solid var(--line); cursor: pointer; }
.gc-banner { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--panel-2); }
/* 默认头图(没上传时):不用图片文件,拿社区主色画一张——深到浅的斜向渐变,上面叠一排淡淡的声波竖条;比上传的头图矮一些,少占频道列表的地方 */
.gc-banner.gc-default { aspect-ratio: 5 / 2; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 180' preserveAspectRatio='xMidYMid slice'%3E%3Cg fill='%23fff' fill-opacity='.2'%3E%3Crect x='12' y='85' width='5' height='10' rx='2.5'/%3E%3Crect x='22.7' y='81' width='5' height='18' rx='2.5'/%3E%3Crect x='33.4' y='75' width='5' height='30' rx='2.5'/%3E%3Crect x='44.099999999999994' y='80' width='5' height='20' rx='2.5'/%3E%3Crect x='54.8' y='68' width='5' height='44' rx='2.5'/%3E%3Crect x='65.5' y='59' width='5' height='62' rx='2.5'/%3E%3Crect x='76.19999999999999' y='72' width='5' height='36' rx='2.5'/%3E%3Crect x='86.89999999999999' y='51' width='5' height='78' rx='2.5'/%3E%3Crect x='97.6' y='63' width='5' height='54' rx='2.5'/%3E%3Crect x='108.3' y='42' width='5' height='96' rx='2.5'/%3E%3Crect x='119' y='55' width='5' height='70' rx='2.5'/%3E%3Crect x='129.7' y='34' width='5' height='112' rx='2.5'/%3E%3Crect x='140.39999999999998' y='47' width='5' height='86' rx='2.5'/%3E%3Crect x='151.1' y='28' width='5' height='124' rx='2.5'/%3E%3Crect x='161.79999999999998' y='40' width='5' height='100' rx='2.5'/%3E%3Crect x='172.5' y='32' width='5' height='116' rx='2.5'/%3E%3Crect x='183.2' y='50' width='5' height='80' rx='2.5'/%3E%3Crect x='193.89999999999998' y='38' width='5' height='104' rx='2.5'/%3E%3Crect x='204.6' y='59' width='5' height='62' rx='2.5'/%3E%3Crect x='215.29999999999998' y='45' width='5' height='90' rx='2.5'/%3E%3Crect x='226' y='67' width='5' height='46' rx='2.5'/%3E%3Crect x='236.7' y='54' width='5' height='72' rx='2.5'/%3E%3Crect x='247.39999999999998' y='74' width='5' height='32' rx='2.5'/%3E%3Crect x='258.1' y='63' width='5' height='54' rx='2.5'/%3E%3Crect x='268.79999999999995' y='79' width='5' height='22' rx='2.5'/%3E%3Crect x='279.5' y='71' width='5' height='38' rx='2.5'/%3E%3Crect x='290.2' y='82' width='5' height='16' rx='2.5'/%3E%3Crect x='300.9' y='85' width='5' height='10' rx='2.5'/%3E%3C/g%3E%3C/svg%3E") center / cover no-repeat, linear-gradient(135deg, color-mix(in srgb, var(--green) 45%, #0b1220), var(--green) 62%, color-mix(in srgb, var(--green) 72%, #fff)); }
.gc-body { display: flex; align-items: center; gap: 10px; padding: 8px 8px 10px 12px; }
/* 标志压在头图下沿上;没上传标志时是主色底的默认声波图形 */
.gc-logo { flex: none; width: 44px; height: 44px; margin-top: -30px; border: 3px solid var(--panel); border-radius: 13px; background: var(--green); box-sizing: content-box; gap: 3px; }
.gc-logo i { width: 4px; height: 12px; }
.gc-logo i:nth-child(2) { height: 24px; } .gc-logo i:nth-child(3) { height: 18px; }
.gc-text { flex: 1; min-width: 0; display: grid; justify-items: start; gap: 3px; }
.gc-text strong { max-width: 100%; font-size: var(--fs-md); line-height: 1.3; }
.gc-chip { padding: 0 8px; border: 0; border-radius: 99px; background: var(--panel-2); color: var(--muted); font: var(--fs-xs)/20px ui-monospace, Consolas, monospace; white-space: nowrap; }
.gc-chip:hover { background: var(--hover); color: var(--text); }
.guild-card .ghost-icon { flex: none; }
/* 卡片里已经有社区的标志、名称与频道号,顶栏不再重复:左侧换成产品标识,在线状态缩成它旁边的小圆点(文字在悬停提示里)。
   手机上卡片只在频道页出现,顶栏照旧,见 mobile.css */
.app-brand { display: none; align-items: center; gap: 10px; min-width: 0; padding: 2px; }
.app.has-card .app-brand { display: flex; }
/* 产品口号:名字后面一条细竖线隔开,字淡一些;窗口窄时先让它消失 */
.app-brand small { min-width: 0; padding-left: 12px; border-left: 1px solid #ffffff59; overflow: hidden; color: #ffffffd9; font-size: var(--fs-sm); letter-spacing: .06em; white-space: nowrap; text-overflow: ellipsis; }
@media (max-width: 900px) { .app-brand small { display: none; } }
.app.has-card .titlebar .guild-open, .app.has-card .titlebar .guild-no { display: none; }
.app.has-card .titlebar .status { gap: 0; font-size: 0; }
.app.has-card .titlebar .status::before { width: 9px; height: 9px; }
/* 社区资料里的头图预览与操作 */
.banner-edit { display: grid; gap: 6px; }
.banner-edit small { color: var(--muted); font-size: var(--fs-xs); }
.banner-preview { width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 10px; background: var(--panel-2); }
.banner-preview:empty { display: none; }
.banner-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.banner-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
#sidebar-invite { flex: none; display: flex; align-items: center; justify-content: center; gap: 8px; margin: 8px 10px 0; border-color: var(--green); color: var(--green-strong); }
#sidebar-invite:hover { background: var(--green-soft); }
#sidebar-invite svg { width: 16px; height: 16px; }
.roster { grid-area: roster; border-left: 1px solid var(--line); }
.side-head { height: 40px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 10px 0 14px; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; letter-spacing: .06em; border-bottom: 1px solid var(--line); }
.roster .side-head .ghost-icon { flex: none; }
.roster .side-head { justify-content: flex-start; gap: 4px; white-space: nowrap; }
.count { margin-right: auto; white-space: nowrap; font-weight: 500; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.channels { flex: 1; overflow: auto; padding: 6px 6px 12px; }
.group-toggle { width: 100%; display: flex; align-items: center; gap: 6px; margin-top: 8px; padding: 4px 6px; border: 0; background: transparent; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; text-align: left; }
.group-toggle:hover { color: var(--text); }
.chevron { width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
.chevron.open, .legend[open] .chevron { transform: rotate(45deg); }
.room-link { width: 100%; display: flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 8px 0 calc(4px + var(--depth, 0) * 16px); border: 0; border-radius: 6px; background: transparent; color: var(--text); text-align: left; }
.room-link svg { width: 16px; height: 16px; color: var(--muted); }
.room-link:hover { background: var(--hover); }
.room-link.selected { background: var(--green-soft); color: var(--green-strong); font-weight: 600; }
.room-link.drop-target { background: var(--green-soft); outline: 2px solid var(--green); outline-offset: -2px; }
.room-link.selected svg { color: var(--green); }
.room-link.joined svg { color: var(--green); }
.room-link .name { flex: 1; }
.room-count { min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--panel-2); color: var(--muted); font-size: var(--fs-xs); text-align: center; font-variant-numeric: tabular-nums; }
.tree-member { display: flex; align-items: center; gap: 7px; min-height: 26px; padding: 0 8px 0 calc(40px + var(--depth, 0) * 16px); color: var(--muted); font-size: var(--fs-sm); }
.tree-member .name { flex: 1; }
.tree-member.self .name { color: var(--text); font-weight: 600; }
.tree-member .avatar { --size: 18px; font-size: var(--fs-xs); }
/* 说话的人:名字变绿加粗 + 声波图标;跨频道喊话 / 广播改用橙色。昵称自带颜色或彩虹时不受影响 */
.tree-member.speaking .name { color: var(--speak); font-weight: 600; }
.tree-member.speaking.shouting .name { color: var(--shout); }
.speak-wave { flex: none; display: grid; color: var(--speak); }
.speak-wave svg { width: 13px; height: 13px; }
.shouting .speak-wave { color: var(--shout); }
/* 开着优先发言但没在说话:名字旁一个小标识,提醒别忘了关 */
.priority-mark { flex: none; display: grid; color: var(--shout); }
.priority-mark svg { width: 13px; height: 13px; }

/* ===== 马甲与头像 ===== */
.badge { display: inline-flex; align-items: center; gap: 4px; flex: none; padding: 0 6px; height: 18px; border-radius: 4px; font-size: var(--fs-xs); font-weight: 600; white-space: nowrap;
  color: color-mix(in srgb, var(--badge) var(--ink-mix), var(--ink-base));
  background: color-mix(in srgb, var(--badge) 18%, transparent); }
.diamond { width: 5px; height: 5px; border-radius: 1px; background: var(--badge); transform: rotate(45deg); }
.badge svg, .role-icon svg { width: 11px; height: 11px; color: var(--badge); }
/* 频道树与成员列表共用的身份小图标 */
.role-icon { flex: none; width: 16px; height: 16px; display: grid; place-items: center; border-radius: 4px; background: color-mix(in srgb, var(--badge) 22%, transparent); }
.role-icon .diamond { width: 6px; height: 6px; }
.muted-mark { flex: none; color: var(--danger); }
.muted-mark svg { width: 13px; height: 13px; }
.room-link .lock { width: 13px; height: 13px; color: var(--muted); }
.room-link .listen-mark { color: var(--green); }
.avatar { --size: 32px; position: relative; width: var(--size); height: var(--size); flex: none; display: grid; place-items: center; border-radius: 50%; font-size: calc(var(--size) * .42); font-weight: 700;
  color: var(--avatar-ink); background: var(--avatar-bg); }
.avatar.speaking { --ring: var(--speak); box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--ring); }
.avatar.speaking.shouting { --ring: var(--shout); }
/* 频道树与舞台里人挨着人,外环收成紧贴头像的 2px,不挤到相邻的人 */
.tree-member .avatar.speaking, .tile .avatar.speaking { box-shadow: 0 0 0 2px var(--ring); }
.avatar.offline img { filter: grayscale(1); opacity: .55; }
.visitor { --avatar-ink: var(--muted); --avatar-bg: var(--panel-2); }

/* ===== 左下:Discord 式个人面板 ===== */
.user-panel { flex: none; display: flex; flex-direction: column; gap: 6px; padding: 8px; border-top: 1px solid var(--line); background: var(--panel-2); }
.voice-link { display: flex; align-items: center; gap: 8px; padding: 2px 4px 6px; border-bottom: 1px solid var(--line); }
.voice-link > div { flex: 1; min-width: 0; }
.voice-link strong { display: block; color: var(--green-strong); font-size: var(--fs-sm); }
.voice-link small { display: block; }
.panel-buttons { display: flex; gap: 2px; }
.panel-btn { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--muted); }
.panel-btn:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.panel-btn.off { color: var(--danger); }
.panel-btn.hang { color: var(--danger); }

/* ===== 中间主区 ===== */
.main { grid-area: main; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--main); }
.room-head { height: 48px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.room-head svg { color: var(--green); }
.room-head strong { font-size: var(--fs-lg); }
.room-head .crumb { color: var(--muted); font-size: var(--fs-sm); }
.room-head .desc { max-width: 40%; color: var(--muted); font-size: var(--fs-sm); }
.room-head .spacer { flex: 1; }
.room-notice { flex: none; display: flex; align-items: flex-start; gap: 8px; padding: 4px 16px; background: var(--green-soft); font-size: var(--fs-sm); }
.room-notice .text-button { flex: 1; min-width: 0; min-height: 26px; display: flex; align-items: center; gap: 8px; padding: 0; color: var(--text); text-align: left; }
.room-notice svg, .room-notice .ghost-icon { flex: none; }
.room-notice .text-button svg { width: 16px; height: 16px; color: var(--green); }
/* 监听 / 旁听的透明标识:频道头下面一条轻提示(本频道在听谁、谁在听本频道) */
.listen-bar { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 4px 16px; border-bottom: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font-size: var(--fs-sm); }
.lb-from, .lb-by { min-width: 0; max-width: 100%; display: flex; align-items: center; gap: 6px; }
.listen-bar svg { flex: none; width: 14px; height: 14px; color: var(--green); }
.listen-bar .text-button { padding: 0; }
.lb-from .text-button { color: var(--text); }
.lb-from .text-button:hover { color: var(--green-strong); }
.listen-bar .lb-by { color: var(--text); font-weight: 600; }
.room-notice [aria-expanded='true'] .truncate { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 30dvh; overflow-y: auto; }

/* 频道内成员舞台:语音状态一眼可见 */
.stage { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.stage-empty { flex: 1 1 14em; min-width: 0; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: var(--fs-sm); }
.stage-empty .grow { flex: 1; }
.stage-empty .button { flex: none; }
.tile { min-width: 0; display: flex; align-items: center; gap: 6px; padding: 0 4px; border: 0; border-radius: 6px; background: transparent; }
.tile:hover { background: var(--hover); }
.tile .who { max-width: min(12em, 45vw); font-size: var(--fs-sm); font-weight: 600; }
.volume { width: 100%; display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: var(--fs-xs); }
.volume input { flex: 1; min-width: 0; height: 4px; accent-color: var(--green); }
.volume span { min-width: 38px; flex: none; text-align: right; font-variant-numeric: tabular-nums; }
/* 语音设置里的音量滑块:标题与滑块排在同一行(各占一整行的话,弹窗在 768px 高的窗口里放不下) */
.modal label.volume-row { display: flex; align-items: center; gap: 10px; }
.volume-row > span:first-child { flex: none; white-space: nowrap; }
.volume-row .volume { flex: 1; width: auto; min-width: 0; }
.modal .volume input { min-height: 0; padding: 0; border: 0; }

/* 公屏 */
.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.messages { flex: 1; overflow: auto; padding: 12px 16px 4px; }
.message { --avatar-width: 36px; position: relative; display: flex; gap: 10px; padding: 0 36px 0 8px; border-radius: 8px; font-size: var(--fs-md); line-height: 22px; }
.message + .message { margin-top: 16px; }
.message:hover { background: var(--hover); }
.message.mention { background: var(--green-soft); border-left: 3px solid var(--green); }
.message .avatar { --size: var(--avatar-width); margin-top: 2px; }
.message > div { min-width: 0; }
.message header { display: flex; align-items: center; gap: 6px; }
.message header strong { font-size: var(--fs-md); }
.message time { flex: none; color: var(--muted); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.message p { margin-top: 2px; overflow-wrap: anywhere; white-space: pre-wrap; }
.message.continued { margin-top: 2px; }
.message.continued p { margin: 0; }
.message.continued > time { flex: 0 0 var(--avatar-width); text-align: center; opacity: 0; }
.message.continued:hover > time { opacity: 1; }
.message-actions { position: absolute; top: 0; right: 4px; z-index: 1; display: flex; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); box-shadow: var(--shadow); opacity: 0; pointer-events: none; }
.message:hover .message-actions, .message:focus-within .message-actions { opacity: 1; pointer-events: auto; }
.empty { margin: 32px auto; color: var(--muted); text-align: center; font-size: var(--fs-sm); }
.invite-card { display: grid; justify-items: center; gap: 8px; width: fit-content; max-width: 100%; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.invite-card h3 { color: var(--text); font-size: var(--fs-md); }
.composer { flex: none; display: flex; gap: 8px; padding: 8px 16px 12px; }
.composer input, .modal input, .modal select, .eg-join input, .guild-discover input { width: 100%; min-width: 0; min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.composer input:focus, .modal input:focus, .modal select:focus, .eg-join input:focus, .guild-discover input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 20%, transparent); }

/* 底部按住说话栏 */
/* 用网格固定比例 + 容器查询,按钮文字不换行、不被挤变形 */
.ptt-bar { flex: none; container-type: inline-size; padding: 6px 16px; background: var(--panel); border-top: 1px solid var(--line); }
.ptt-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.5fr) minmax(0, 1fr); gap: 8px; }
.talk-button { min-width: 0; height: 32px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; overflow: hidden; touch-action: none; user-select: none; transition: background .12s, border-color .12s, transform .06s; }
.talk-button .label { overflow: hidden; text-overflow: ellipsis; }
.talk-button svg { width: 15px; height: 15px; color: var(--green); }
.talk-button:hover:not(:disabled) { border-color: var(--green-line); background: var(--green-soft); }
.talk-button.active { border-color: var(--green); background: var(--green); color: #fff; transform: scale(.98); }
.talk-button.active svg { color: #fff; }
.talk-group { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(72px, 40%); }
.talk-group .talk-button { border-radius: 8px 0 0 8px; }
.talk-group select { min-width: 0; height: 32px; padding: 0 4px 0 8px; border: 1px solid var(--line); border-left: 0; border-radius: 0 8px 8px 0; background: var(--panel); font-size: var(--fs-sm); text-overflow: ellipsis; }
kbd { flex: none; padding: 0 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: var(--panel); color: var(--muted); font: var(--fs-xs)/16px ui-monospace, Consolas, monospace; }
@container (max-width: 560px) { .talk-button kbd { display: none; } .talk-button { padding: 0 6px; font-size: var(--fs-sm); } }
@container (max-width: 400px) { .ptt-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); } .talk-button.wide { grid-column: 1 / -1; } }
.talk-button.active kbd { color: var(--green-strong); }

/* ===== 右侧成员列表(按马甲分组) ===== */
.members { flex: 1; overflow: auto; padding: 4px 6px 12px; }
.role-group { margin: 12px 8px 4px; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; letter-spacing: .04em; }
.member-row { width: 100%; display: flex; align-items: center; gap: 9px; padding: 5px 8px; border: 0; border-radius: 6px; background: transparent; text-align: left; }
button.member-row:hover { background: var(--hover); }
.member-row.offline .member-name { color: var(--muted); }
.member-row .avatar { --size: 32px; }
.member-name { flex: 1; min-width: 0; }
.member-name strong, .member-name small { display: block; }
.member-name strong { font-size: calc(var(--fs-sm) + 1px); font-weight: 600; }
.member-name small { font-size: var(--fs-xs); }
.legend { flex: none; margin: 0 8px 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); font-size: var(--fs-sm); }
.legend summary { display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; color: var(--muted); font-weight: 600; }
.legend summary::-webkit-details-marker { display: none; }
.legend summary:hover { color: var(--text); }
#legend-roles { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: start; gap: 6px; margin-top: 8px; }
#legend-roles .badge { justify-self: start; }
#legend-roles small { color: var(--muted); font-size: var(--fs-xs); line-height: 1.45; }

/* ===== 弹窗与提示 ===== */
dialog { width: min(400px, calc(100% - 32px)); padding: 20px; border: 0; border-radius: 14px; background: var(--panel); color: var(--text); box-shadow: 0 20px 60px #0000004d; }
dialog:modal { max-height: calc(100dvh - 64px); margin: auto; overflow: auto; overscroll-behavior: contain; }
#room-dialog { width: min(720px, calc(100% - 32px)); }
/* ===== 两座分栏设置中心(社区设置 / 个人设置):吸顶标题栏下,左侧分区导航 + 右侧独立纵向滚动的内容区 ===== */
#settings-dialog, #guild-dialog, #admin-dialog { width: min(840px, calc(100% - 32px)); height: min(620px, calc(100dvh - 64px)); }
/* 普通成员只有只读概览:窄一些,高度随内容 */
#guild-dialog:has(.guild-edit.readonly) { width: min(480px, calc(100% - 32px)); height: fit-content; }
dialog:modal:has(.modal-title) > .hub-modal { height: 100%; grid-template-rows: auto minmax(0, 1fr); gap: 0; padding-bottom: 0; }
.hub { display: grid; grid-template-columns: 180px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); min-height: 0; margin: 0 -20px; }
.hub-nav { display: grid; align-content: start; gap: 4px; padding: 12px 10px; border-right: 1px solid var(--line); overflow-y: auto; }
.hub-nav button { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; text-align: left; }
.hub-nav button:hover { background: var(--hover); color: var(--text); }
.hub-nav button[aria-current] { background: var(--green-soft); color: var(--green-strong); }
.hub-nav svg { flex: none; width: 18px; height: 18px; }
.guild-edit.readonly .hub-nav { display: none; }
.hub-body { min-width: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 20px 20px; }
.hub-pane, .hub-form, .hub-section { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 14px; min-width: 0; }
/* 个人设置的偏好表单横跨 4 个分区,本身不占版面 */
.hub-prefs { display: contents; }
.hub-pane h3 { font-size: var(--fs-md); }
/* 同一分区里上下两块:一条分隔线隔开 */
.hub-section + .hub-section, .hub-form + .hub-section { padding-top: 16px; border-top: 1px solid var(--line); }
.hub-form > .button.primary { justify-self: start; min-width: 96px; }
.hub-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.hub-back { justify-self: start; display: inline-flex; align-items: center; gap: 6px; }
.hub-back svg { flex: none; width: 16px; height: 16px; }
/* 游戏集成:每款游戏一张卡片 */
.game-list { display: grid; gap: 10px; }
.game-card { display: grid; gap: 6px; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.game-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.game-head .badge { flex: none; }
.game-card .button { justify-self: start; margin-top: 4px; }
.alerts-webhooks { justify-self: start; }
/* 安全与审计:四段切换排成一行,放不下(手机)时横向滑动,不折行不挤压 */
.hub-tabs { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(max-content, 1fr); overflow-x: auto; }
.hub-tabs button { padding: 0 12px; white-space: nowrap; }
/* 四段子页是互斥显示的兄弟 .hub-section:不吃「上下两块之间加分隔线」那条,免得切换条下面再多一条线 */
.hub-section[data-mod-panel] { padding-top: 0; border-top: 0; }
/* 语音日志:成员、频道两个筛选下拉 + 刷新;多号关联:每组一张卡片 */
.audit-filter { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; }
.audit-more { justify-self: center; }
.audit-hint, .alt-card > small { color: var(--muted); font-size: var(--fs-sm); }
/* 资料卡里的同设备关联提示(只有 MA+ 看得到) */
.pc-alts { justify-self: start; text-align: left; }
/* 内容区自己会滚动:里面的列表不再另设高度上限,免得滚动套滚动;头图预览不铺满宽内容区 */
.hub-body .ban-list { max-height: none; overflow: visible; }
.guild-edit:not(.readonly) #guild-banner-preview { max-width: 400px; }
.bot-token-form > .button { justify-self: start; min-width: 96px; }
/* 站长管理:4 格统计(手机上 2×2)、说明小字;全部社区每行左侧的首字 / 标志图标(与社区栏同色:没设主色用默认星际青蓝) */
.admin-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.admin-stat { display: grid; gap: 4px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.admin-stat strong { font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
.admin-stat small, .admin-hint { color: var(--muted); font-size: var(--fs-xs); }
.admin-face { flex: none; width: 32px; height: 32px; display: grid; place-items: center; overflow: hidden; border-radius: 10px; background: var(--gc); color: #fff; font-weight: 700; }
.admin-face img { width: 100%; height: 100%; object-fit: cover; }
.admin-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
/* 社区行里是不折行的截断文字:列宽限定为内容区宽,免得网格列被最长的一行撑开 */
#admin-guild-list, #admin-errors { grid-template-columns: minmax(0, 1fr); }
.admin-counts { font-variant-numeric: tabular-nums; }
/* 概览与运维:键值行(左键名右值;整行说明用 small,告警用 --danger);网络与发信:标题 + 状态徽标、发信预设、按钮行 */
.admin-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 12px; font-size: var(--fs-sm); }
.admin-kv > span { color: var(--muted); }
.admin-kv > strong { min-width: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.admin-kv > small { grid-column: 1 / -1; color: var(--muted); font-size: var(--fs-xs); }
.admin-kv .admin-warn { color: var(--danger); }
.admin-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.admin-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.admin-presets small { color: var(--muted); font-size: var(--fs-xs); }
/* 发信预设按界面语言给:中文 QQ 邮箱 / 163 邮箱,英文 Gmail / Zoho Mail,Resend 两边都有 */
:root:lang(en) [data-preset-lang='zh-CN'], :root:not(:lang(en)) [data-preset-lang='en'] { display: none; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-actions .button.primary { min-width: 96px; }
#admin-errors .empty, .discover-list .empty { margin: 12px auto; }
/* 发现公开社区:标题 + 搜索框 + 限高滚动的列表(「加入社区」弹窗与零社区引导页共用) */
.guild-discover { width: 100%; display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); text-align: left; }
.guild-discover h3 { font-size: var(--fs-md); }
.discover-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; max-height: 240px; overflow-y: auto; }
dialog::backdrop { background: #0b1a1166; backdrop-filter: blur(2px); }
.dm-window { position: fixed; inset: auto 0 var(--statusbar-height, 36px) auto; z-index: 4; margin: 0; width: 360px; height: 460px; max-height: calc(100dvh - var(--statusbar-height, 36px)); padding: 8px; }
.dm-window[open] { display: flex; flex-direction: column; }
.dm-window .modal-title { gap: 8px; cursor: move; user-select: none; touch-action: none; }
.dm-window .modal-title button { cursor: pointer; }
.dm-window.dragging { box-shadow: 0 24px 70px #00000066; }
.dm-window .modal-title > :not(h2) { flex: none; }
.dm-window .modal-title h2 { flex: 1; }
.modal { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; overflow-wrap: anywhere; }
.modal-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
/* 模态弹窗的标题栏吸顶:内容滚动时标题与关闭按钮始终可见。内边距从弹窗挪到 .modal 上(顶部由标题栏自己的内边距承担),这样吸顶位置不取决于浏览器把滚动容器的内边距算在哪一侧;标题栏左右用负外边距贴到弹窗边缘不露缝,仍在 .modal 的内边距之内,不算溢出 */
dialog:modal:has(.modal-title) { padding: 0; }
dialog:modal:has(.modal-title) > .modal { padding: 0 20px 20px; }
dialog:modal .modal-title { position: sticky; top: 0; z-index: 1; margin: 0 -20px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--panel); }
.modal-title .close { flex: none; width: 28px; height: 28px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); }
.modal-title .close:hover { background: var(--hover); }
.modal-title h2 { font-size: var(--fs-lg); }
.modal label { display: grid; gap: 6px; font-size: var(--fs-sm); font-weight: 600; }
.modal p { color: var(--muted); font-size: var(--fs-sm); }
.dialog-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 16px; }
.dialog-column { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 12px; min-width: 0; }
.dialog-column fieldset { min-inline-size: 0; }
.dialog-column h3 { font-size: var(--fs-md); }
.dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
/* 共用确认框(代替原生 confirm / prompt):危险操作的主按钮用红色 */
#confirm-text { color: var(--text); font-size: var(--fs-md); white-space: pre-line; }
#confirm-dialog .dialog-actions .button { flex: 1; }
.button.primary.danger { background: var(--danger); color: #fff; }
.button.primary.danger:hover:not(:disabled) { border-color: transparent; background: color-mix(in srgb, var(--danger) 86%, #000); }
@media (width < 720px) { .dialog-columns { grid-template-columns: minmax(0, 1fr); } }
.notice { position: fixed; z-index: 25; inset: auto auto 84px 50%; transform: translateX(-50%); width: auto; max-width: calc(100vw - 32px); margin: 0; padding: 9px 16px; border: 0; border-radius: 99px; background: var(--text); color: var(--panel); font-size: var(--fs-sm); box-shadow: 0 8px 24px #0004; }
audio { display: none; }

/* ===== 响应式 ===== */
@media (max-width: 1080px) {
  .app, .app.no-roster { grid-template-columns: var(--rail-w) 220px minmax(0, 1fr) 0; }
  .roster { display: none; }
  .app.show-roster .roster { display: flex; position: fixed; z-index: 4; top: 48px; right: 0; bottom: var(--statusbar-height); width: 260px; box-shadow: -8px 0 24px #0003; }
}


/* ===== 右键菜单 ===== */
.context-menu { position: fixed; z-index: 10; min-width: 168px; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: 0 10px 30px #0003; }
.context-menu header { padding: 4px 8px 6px; margin-bottom: 4px; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); color: var(--muted); }
.context-menu header strong { color: var(--text); }
.context-menu:has([data-menu^='move-']) { max-height: calc(100dvh - 16px); overflow-y: auto; }
.context-menu button { width: 100%; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 0; border-radius: 6px; background: transparent; text-align: left; font-size: var(--fs-sm); }
.context-menu button:hover, .context-menu button:focus-visible { background: var(--green-soft); color: var(--green-strong); outline: none; }
.context-menu button.danger { color: var(--danger); }
.context-menu button.danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.context-menu hr { margin: 4px 0; border: 0; border-top: 1px solid var(--line); }
/* 成员菜单最上面一行:调节听到这位成员的音量 */
.menu-volume { padding: 2px 8px 6px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.menu-volume svg { flex: none; width: 14px; height: 14px; }
.menu-volume input.bar-slider { min-width: 110px; }
.roster-tip { flex: none; margin: 0 14px 6px; color: var(--muted); font-size: var(--fs-xs); }

/* ===== 频道层级、模式、麦序 ===== */
.room-link .chevron { width: 12px; height: 12px; flex: none; display: grid; place-items: center; border: 0; transform: none; color: var(--muted); }
.room-link .chevron::before { content: ''; width: 5px; height: 5px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
.room-link .chevron.open::before { transform: rotate(45deg); }
.chevron-space { width: 12px; flex: none; }
.mode-tag { flex: none; padding: 0 5px; border-radius: 4px; font-size: var(--fs-xs); font-weight: 600; line-height: 16px; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); }
.mode-tag.chair { color: #c2410c; background: #fff1e6; border-color: #fed7aa; }
.mode-tag.queue { color: #1d4ed8; background: #e8efff; border-color: #c7d6fe; }
[data-theme='dark'] .mode-tag.chair { color: #fdba74; background: #3a2618; border-color: #5c3a1e; }
[data-theme='dark'] .mode-tag.queue { color: #93b4ff; background: #1c2742; border-color: #2c3d66; }
.room-head .mode-tag { font-size: var(--fs-xs); }
.room-link .mode-tag { padding: 0 4px; }
.queue-no { flex: none; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #2563eb; color: #fff; font-size: var(--fs-xs); line-height: 16px; text-align: center; }

.queue-panel { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.queue-head { display: flex; align-items: center; gap: 8px; }
.queue-head .grow { flex: 1; }
.queue-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.queue-list li { display: flex; align-items: center; gap: 6px; max-width: 200px; padding: 3px 8px 3px 4px; border: 1px solid var(--line); border-radius: 99px; background: var(--panel-2); font-size: var(--fs-sm); }
.queue-list li.head { border-color: var(--green); background: var(--green-soft); color: var(--green-strong); font-weight: 600; }
.queue-list .no { width: 18px; height: 18px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--line); font-size: var(--fs-xs); }
.queue-list li.head .no { background: var(--green); color: #fff; }
.mic-time { font-variant-numeric: tabular-nums; font-size: var(--fs-sm); }
.mic-time.locked { color: var(--danger); }
.queue-empty { margin-top: 6px; color: var(--muted); font-size: var(--fs-sm); }
.queue-admin { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.chip { height: 26px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); font-size: var(--fs-sm); font-weight: 600; }
.chip:hover { border-color: var(--green-line); background: var(--green-soft); }
.chip.primary { border-color: transparent; background: var(--green); color: #fff; }
.chip.danger { color: var(--danger); }

/* ===== 语音设置弹窗 ===== */
.seg { display: flex; gap: 6px; margin: 0; padding: 0; border: 0; }
.seg legend { margin-bottom: 6px; font-size: var(--fs-sm); font-weight: 600; }
.seg label { position: relative; flex: 1; display: grid; place-items: center; min-height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 99px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.seg label:has(input:checked) { border-color: var(--green); background: var(--green-soft); color: var(--green-strong); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--green); outline-offset: 2px; }
.seg input { position: absolute; top: 50%; left: 0; width: 1px; height: 1px; min-height: 0; margin: 0; padding: 0; border: 0; opacity: 0; }
.vad-row { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; font-size: var(--fs-sm); }
.vad-row input { grid-column: 1 / -1; margin: 0; accent-color: var(--green); }
.meter { position: relative; height: 8px; border-radius: 4px; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; }
.meter i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--green); transition: width .05s; }
.meter b { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); }
.keys { display: grid; gap: 6px; }
.key-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px auto; align-items: center; gap: 8px; font-size: var(--fs-sm); }
.key-capture { height: 30px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); font: var(--fs-sm) ui-monospace, Consolas, monospace; }
.key-capture.waiting { border-color: var(--green); color: var(--green-strong); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .5; } }
.text-button { border: 0; background: transparent; color: var(--muted); font-size: var(--fs-sm); }
.text-button:hover { color: var(--green-strong); }
.room-head .ghost-icon { flex: none; }
.room-head .desc, #room-status { min-width: 0; }
.obs-row { display: grid; gap: 4px; }

/* ===== 黑名单 ===== */
.ban-list { display: grid; gap: 6px; max-height: 50vh; overflow: auto; }
.ban-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.ban-row > div { flex: 1; min-width: 0; }
.ban-row strong, .ban-row small { display: block; }

/* ===== 连接质量信号格 ===== */
.quality { display: flex; align-items: center; gap: 4px; min-height: 14px; color: var(--muted); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.quality:empty { display: none; }
.signal { display: inline-flex; align-items: flex-end; gap: 1px; height: 10px; }
.signal i { width: 3px; border-radius: 1px; background: var(--line); }
.signal i:nth-child(1) { height: 4px; } .signal i:nth-child(2) { height: 7px; } .signal i:nth-child(3) { height: 10px; }
.signal.s3 i { background: var(--green); }
.signal.s2 i:nth-child(-n+2) { background: #f59e0b; }
.signal.s1 i:nth-child(1) { background: var(--danger); }
.checks { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; font-size: var(--fs-sm); }
.checks legend { margin-bottom: 6px; font-weight: 600; }
.checks label { display: flex !important; align-items: center; gap: 8px; font-weight: 500 !important; }
.checks input, .guild-edit input[type=checkbox], .admin-hub input[type=checkbox], .alert-form input[type=checkbox], .eve-modal input[type=checkbox], #admin-domain-form input[type=checkbox] { flex: none; width: auto; min-height: 0; accent-color: var(--green); }

/* ===== 登录窗口 ===== */
.auth { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(6px); }
.auth-card { width: min(380px, 100%); max-height: 100%; overflow: auto; border-radius: 16px; background: var(--panel); box-shadow: 0 24px 70px #0003; }
.auth-brand { display: flex; align-items: center; gap: 12px; padding: 22px 22px 18px; color: #fff; background: linear-gradient(160deg, var(--bar-from), var(--bar-to)); }
.auth-brand .logo { width: 40px; height: 40px; border-radius: 12px; }
.auth-brand strong { display: block; font-size: var(--fs-lg); letter-spacing: .04em; }
.auth-brand small { color: #ffffffcc; }
.auth-card footer { padding: 0 16px 16px; text-align: center; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.auth-tabs button { height: 42px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-weight: 600; }
.auth-tabs button[aria-selected='true'] { color: var(--green-strong); border-bottom-color: var(--green); }
.auth-form { display: grid; gap: 12px; padding: 18px 22px 22px; }
.auth-form label { display: grid; gap: 5px; font-size: var(--fs-sm); font-weight: 600; }
.auth-form label.inline, .guild-edit label.inline, .admin-hub label.inline, .alert-form label.inline, .eve-modal label.inline, #room-form label.inline, #admin-domain-form label.inline { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.auth-form input:not([type=checkbox]) { width: 100%; min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.auth-form input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 20%, transparent); }
.auth-form input[type=checkbox] { accent-color: var(--green); }
.auth-form p { color: var(--muted); font-size: var(--fs-sm); }
.auth-form .text-button { justify-self: center; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; }
/* 首次开服向导:沿用登录窗口的遮罩与卡片,卡片加宽;步骤条 4 格(手机 2×2) */
.setup-card { width: min(560px, 100%); }
.setup-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 14px 22px 0; list-style: none; }
.setup-steps button { width: 100%; display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.setup-steps b { flex: none; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 99px; background: var(--panel-2); font-size: var(--fs-xs); }
.setup-steps button.done { color: var(--text); }
.setup-steps button[aria-current] { border-color: var(--green); background: var(--green-soft); color: var(--green-strong); }
.setup-steps button[aria-current] b, .setup-steps button.done b { background: var(--green); color: #fff; }
.setup-steps button:disabled { opacity: 1; }
.setup-panel, .setup-guild, .setup-solo, .setup-smtp, .setup-done-guild, .setup-done-solo { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; }
.setup-panel[hidden], .setup-guild[hidden], .setup-solo[hidden], .setup-smtp[hidden], .setup-done-guild[hidden], .setup-done-solo[hidden] { display: none; }
.setup-key-ok, .setup-done-title { display: flex; align-items: center; gap: 6px; color: var(--green-strong); font-weight: 600; }
.setup-key-ok svg, .setup-done-title svg { flex: none; width: 16px; height: 16px; }
.setup-done-title { font-size: var(--fs-md); }
.setup-checks { display: grid; gap: 8px; }
.setup-check { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.setup-check > div { display: grid; justify-items: start; gap: 4px; min-width: 0; }
.setup-check small { color: var(--muted); font-size: var(--fs-xs); }
.setup-check .button { margin-top: 4px; }
.setup-dot { flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 99px; background: var(--green); }
.setup-check.warn .setup-dot { background: var(--danger); }
.setup-probe, .setup-hint { font-size: var(--fs-xs); font-weight: 500; color: var(--muted); }
.setup-probe.ok, .setup-hint.ok { color: var(--green-strong); }
.setup-probe.fail, .setup-hint.fail, .setup-check small.admin-warn { color: var(--danger); }
.setup-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.setup-actions .button.primary { min-width: 96px; }
.auth-form .seg input[type=radio] { width: 1px; min-height: 0; padding: 0; border: 0; }
.setup-mode label { min-width: 0; }
.setup-terms { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; border: 0; }
.setup-terms legend { margin-bottom: 6px; font-size: var(--fs-sm); font-weight: 600; }
.setup-preview { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.setup-preview > div { display: grid; gap: 4px; min-width: 0; }
.setup-preview small { color: var(--muted); font-size: var(--fs-xs); }
.setup-form select { width: 100%; min-height: 38px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.setup-done .eg-join input { min-width: 0; }
.invite-form { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 8px; align-items: end; }
.invite-form label { display: grid; gap: 4px; font-size: var(--fs-sm); font-weight: 600; }
.invite-form select { min-height: 34px; padding: 0 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
@media (max-width: 400px) { .invite-form { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ban-row .button + .button { margin-left: -4px; }

/* ===== 隐藏程序内滚动条(仍可用滚轮或触控板滚动) ===== */
* { scrollbar-width: none; }
*::-webkit-scrollbar { display: none; }

/* ===== 头像、昵称、等级、活跃 ===== */
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.avatar.big { --size: 64px; }
.uname { font-weight: inherit; }
.uname.rainbow { background: linear-gradient(90deg, #f43f5e, #f59e0b, #22c55e, #3b82f6, #a855f7); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 700; }
.lv { display: inline-flex; align-items: center; gap: 1px; margin-right: 4px; font-size: var(--fs-xs); font-style: normal; line-height: 1; white-space: nowrap; color: var(--muted); }
.lv i { font-style: normal; letter-spacing: -1px; }
.lv-crown { color: #e11d48; } .lv-sun { color: #f59e0b; } .lv-moon { color: #eab308; } .lv-star { color: #facc15; text-shadow: 0 0 1px #a16207; }
.active-dot { display: inline-block; flex: none; width: 7px; height: 7px; margin-left: 4px; border-radius: 50%; background: #facc15; box-shadow: 0 0 0 2px color-mix(in srgb, #facc15 30%, transparent); vertical-align: middle; }
.member-name strong { display: flex; align-items: center; }
.member-name small { display: flex; align-items: center; }

/* 自己的面板:点击头像和名字查看资料 */
.me-card { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 2px; border: 0; border-radius: 8px; background: transparent; text-align: left; }
.me-card:hover { background: var(--hover); }
.me-card > span:last-child { min-width: 0; }
.me-card strong { display: block; font-size: var(--fs-sm); }

/* ===== 资料卡 ===== */
.profile-card { position: fixed; z-index: 11; width: min(280px, calc(100% - 16px)); overflow: hidden auto; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: 0 16px 40px #0003; }
.pc-banner { height: 56px; background: linear-gradient(120deg, var(--green), var(--green-strong)); }
[data-theme='dark'] .pc-banner { background: linear-gradient(120deg, color-mix(in srgb, var(--green) 65%, var(--bg)), color-mix(in srgb, var(--green) 32%, var(--bg))); }
.pc-head { display: flex; align-items: flex-start; gap: 10px; padding: 0 14px; }
.pc-head .avatar { margin-top: calc(var(--size) / -2); border: 3px solid var(--panel); }
.pc-head > div { min-width: 0; padding-top: 4px; }
.pc-head strong { display: flex; align-items: center; font-size: var(--fs-lg); }
.pc-head .uname { min-width: 0; overflow-wrap: anywhere; }
.pc-nick { display: block; overflow-wrap: anywhere; }
.pc-role { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.pc-body { display: grid; gap: 8px; padding: 10px 14px 14px; }
.pc-level { display: flex; align-items: center; gap: 6px; }
.pc-level .lv { font-size: var(--fs-sm); color: var(--text); font-weight: 600; }
.pc-bio { padding: 8px 10px; border-radius: 8px; background: var(--panel-2); font-size: var(--fs-sm); white-space: pre-wrap; overflow-wrap: anywhere; }
.pc-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.pc-tags span { padding: 1px 8px; border-radius: 99px; background: var(--green-soft); color: var(--green-strong); font-size: var(--fs-sm); }
.pc-actions { display: flex; gap: 6px; }
.pc-actions:empty { display: none; }

/* ===== 编辑资料 ===== */
.avatar-edit { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.avatar-edit .button { display: inline-flex; align-items: center; cursor: pointer; }
.modal textarea { width: 100%; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font: inherit; font-weight: 400; resize: vertical; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.swatches legend { max-width: 100%; margin-bottom: 6px; font-size: var(--fs-sm); font-weight: 600; }
.swatch { position: relative; cursor: pointer; }
.swatch input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; opacity: 0; }
.swatch span { display: block; width: 26px; height: 26px; border-radius: 50%; background: var(--c, var(--text)); border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--line); }
.swatch.rainbow-swatch span { background: linear-gradient(135deg, #f43f5e, #f59e0b, #22c55e, #3b82f6, #a855f7); }
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--green); }
.swatch input:disabled + span { opacity: .3; cursor: not-allowed; }
.swatch > svg { position: absolute; inset: 0; margin: auto; width: 14px; height: 14px; pointer-events: none; }
.swatch input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 2px; }

/* ===== 界面主色:设置 --accent 后,整套配色由它推导 ===== */
:root[style*="--accent"] {
  --green: var(--accent);
  --green-strong: color-mix(in srgb, var(--accent) 78%, #000);
  --green-soft: color-mix(in srgb, var(--accent) 12%, #fff);
  --green-line: color-mix(in srgb, var(--accent) 35%, #fff);
  --bar-from: color-mix(in srgb, var(--accent) 90%, #fff);
  --bar-to: color-mix(in srgb, var(--accent) 80%, #000);
}
[data-theme='dark'][style*="--accent"] {
  --green-strong: color-mix(in srgb, var(--accent) 65%, #fff);
  --green-soft: color-mix(in srgb, var(--accent) 22%, #232528);
  --green-line: color-mix(in srgb, var(--accent) 45%, #232528);
  --bar-from: color-mix(in srgb, var(--accent) 60%, #000);
  --bar-to: color-mix(in srgb, var(--accent) 42%, #000);
}
.accent-row { display: flex; flex-wrap: wrap; align-items: center; min-width: 0; gap: 8px; }
.accent-row .follow-swatch { display: flex; align-items: center; max-width: 100%; }
.follow-swatch span { flex: none; }
.accent-row .follow { color: var(--text); font-size: var(--fs-sm); font-weight: 500; }
.custom-swatch span { background: var(--panel-2); }
.custom-swatch.selected span { background: var(--c); outline: 2px solid var(--green); }

/* ===== 公会资料、频道号、频道图片、分享 ===== */
.guild-open { display: flex; align-items: center; gap: 10px; padding: 2px 6px 2px 2px; border: 0; border-radius: 10px; background: transparent; color: #fff; }
.guild-open:hover { background: #ffffff22; }
.guild-open strong { font-size: var(--fs-lg); letter-spacing: .04em; white-space: nowrap; }
.logo { overflow: hidden; }
.logo img { width: 100%; height: 100%; object-fit: cover; }
.guild-no { padding: 1px 8px; border: 1px solid #ffffff55; border-radius: 6px; background: #00000022; color: #fff; font: var(--fs-sm)/18px ui-monospace, Consolas, monospace; white-space: nowrap; }
.guild-no:hover { background: #00000040; }
.modal .guild-no { border-color: var(--line); background: var(--panel-2); color: var(--muted); }
.room-thumb { width: 22px; height: 22px; flex: none; display: inline-grid; place-items: center; overflow: hidden; border-radius: 6px; background: var(--green-soft); }
.room-thumb img { width: 100%; height: 100%; object-fit: cover; }
.room-thumb.big { width: 64px; height: 64px; border-radius: 14px; }
/* 无图空态:社区标志预览用默认的 4 竖条声波(同应用图标),频道图片预览用喇叭图标 */
.room-thumb.big .logo { width: 100%; height: 100%; gap: 4px; border-radius: 0; background: var(--green); }
.room-thumb.big .logo i { width: 6px; height: 16px; border-radius: 99px; }
.room-thumb.big .logo i:nth-child(2) { height: 32px; } .room-thumb.big .logo i:nth-child(3) { height: 24px; }
.room-thumb.big > svg { width: 28px; height: 28px; color: var(--green); }
.guild-head { display: flex; align-items: center; gap: 12px; }
.guild-head > div { min-width: 0; }
.guild-head strong { display: block; margin-bottom: 4px; font-size: var(--fs-lg); }
.guild-intro { padding: 10px 12px; border-radius: 8px; background: var(--panel-2); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text) !important; font-size: var(--fs-sm) !important; }
.guild-edit.readonly { grid-template-columns: minmax(0, 1fr); }
.guild-edit.readonly .edit-fields { display: none; }
.guild-edit label.button { justify-self: start; max-width: 100%; display: inline-flex; align-items: center; cursor: pointer; }
.guild-edit > button, .term-row small { grid-column: 1 / -1; }
.term-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 8px; }
.share-text { margin: 0; padding: 12px; border-radius: 8px; background: var(--panel-2); font-size: var(--fs-sm); line-height: 1.6; font-family: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ===== 原生质感:界面文字不可选、默认箭头、图片不可拖 ===== */
body { -webkit-user-select: none; user-select: none; cursor: default; }
input, textarea, [contenteditable], .message p, .pc-bio, .guild-intro, .share-text { -webkit-user-select: text; user-select: text; }
input, textarea { cursor: text; }
img { -webkit-user-drag: none; }

.tooltip { position: fixed; z-index: 30; max-width: 240px; padding: 4px 8px; border-radius: 6px; background: var(--text); color: var(--panel); font-size: var(--fs-sm); line-height: 1.5; pointer-events: none; box-shadow: var(--shadow); animation: fade-in .12s ease-out; right: 8px; width: fit-content; overflow-wrap: anywhere; }

@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: scale(.97); } }
dialog[open] { animation: pop-in .14s ease-out; }
dialog[open]::backdrop { animation: fade-in .14s ease-out; }
.context-menu:not([hidden]), .profile-card:not([hidden]) { animation: pop-in .12s ease-out; transform-origin: top left; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after, ::backdrop { animation: none !important; transition: none !important; } }

/* ===== YY 式左下角「我的语音」与喊话栏 ===== */
.me-card > span:last-child { min-width: 0; overflow: hidden; }
.me-sub { display: flex; align-items: center; gap: 4px; min-width: 0; }
.voice-controls { display: flex; align-items: center; gap: 4px; }
.voice-controls .panel-btn { width: 30px; height: 30px; flex: none; }
.mic-btn { flex: 1; min-width: 0; height: 30px; display: flex; align-items: center; gap: 6px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--green); }
.mic-btn svg { width: 16px; height: 16px; }
.mic-btn:hover:not(:disabled) { border-color: var(--green-line); }
.mic-btn.off { color: var(--danger); }
.mic-btn.talking { border-color: var(--speak); background: var(--green-soft); }
.mic-meter { flex: 1; min-width: 12px; height: 4px; overflow: hidden; border-radius: 4px; background: var(--line); }
.mic-meter i { display: block; width: 0; height: 100%; background: var(--speak); transition: width .05s linear; }
.mic-btn.off .mic-meter { background: var(--muted); }
.mic-btn.off .mic-meter i { visibility: hidden; }
.shout-bar { display: flex; align-items: center; gap: 8px; padding: 0 16px 6px; }
.shout-bar[hidden] { display: none; }
.shout-label { flex: none; display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: var(--fs-sm); }
.shout-label svg { width: 14px; height: 14px; }
.shout-bar .talk-group { flex: none; display: flex; }
.shout-bar .talk-button { padding: 0 10px; }
.shout-bar .talk-group select { width: 110px; }

/* ===== 底部状态栏(参照 YY) ===== */
.app { grid-template-rows: 48px minmax(0, 1fr) 36px; grid-template-areas: 'bar bar bar bar' 'rail side main roster' 'foot foot foot foot'; }
.statusbar { grid-area: foot; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 0 10px; background: var(--panel); border-top: 1px solid var(--line); }
.sb-main { flex: 1 0 auto; min-width: 0; display: flex; align-items: center; gap: 2px; }
.sb-avatar { flex: none; padding: 2px; border: 0; border-radius: 50%; background: transparent; }
.sb-avatar .avatar { --size: 24px; }
.statusbar .panel-btn { flex: none; }
.statusbar .mic-btn { flex: none; }
.sb-status { flex: 1; width: 0; overflow: hidden; display: flex; align-items: center; gap: 4px; margin-left: 4px; color: var(--muted); font-size: var(--fs-sm); }
.sb-status svg { width: 14px; height: 14px; flex: none; }
.sb-status.talking { color: var(--green-strong); }
.sb-status.talking.shouting { color: var(--shout); }
.sb-status.blocked svg { color: var(--danger); }
.sb-shout { min-width: 0; display: flex; align-items: center; gap: 6px; }
.sb-shout[hidden] { display: none; }
.sb-shout .talk-group { display: flex; min-width: 0; }
.sb-shout .target { max-width: 110px; background: var(--hover); color: var(--text); }
/* 分层喊话的目标名带「(含子频道)」后缀,放宽一些,免得后缀被截掉后与单频道分不清 */
.sb-shout .target.branch { max-width: 170px; }
.sb-shout .target:hover:not(:disabled) { background: color-mix(in srgb, var(--text) 12%, var(--hover)); }
.sb-link { min-width: 0; display: flex; align-items: center; gap: 4px; color: var(--green-strong); font-size: var(--fs-sm); }
.sb-link:empty { display: none; }
.sb-room { min-width: 0; display: flex; align-items: center; gap: 4px; max-width: 140px; }
.sb-room svg { width: 14px; height: 14px; flex: none; }
/* 转发模式:状态栏里本机到语音服务器的信号格与延迟 */
.sb-quality { display: flex; align-items: center; gap: 4px; flex: none; white-space: nowrap; }
/* 模式标识与信号格的外壳:桌面与手机语音条上不参与排版,只在手机的语音控制台里排成一行(见 mobile.css) */
.sb-net { display: contents; }
@media (max-width: 1080px) { .sb-shout kbd { display: none; } }

/* 我正在旁听别的频道:状态栏里一颗胶囊,点一下全部停止 */
.listen-pill { flex: none; display: inline-flex; align-items: center; gap: 4px; color: var(--text); white-space: nowrap; }
.listen-pill svg { flex: none; width: 13px; height: 13px; color: var(--green); }

/* ===== YY 式工具栏按钮:无边框、透明底、16px 图标 + 12px 文字;悬停浅底,按下加深并下移 1px ===== */
.tool, .statusbar .panel-btn, .statusbar .mic-btn, .sb-shout .talk-button, .room-head .ghost-icon {
  height: 26px; min-width: 26px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 0 6px;
  border: 0; border-radius: 4px; background: transparent; color: var(--text); font-size: var(--fs-sm); font-weight: 400; white-space: nowrap; transition: background .1s; }
.statusbar .panel-btn, .room-head .ghost-icon { width: 26px; padding: 0; color: var(--muted); }
.tool svg, .statusbar .panel-btn svg, .statusbar .mic-btn svg, .room-head .ghost-icon svg { width: 16px; height: 16px; flex: none; }
.tool:hover:not(:disabled), .statusbar .panel-btn:hover:not(:disabled), .statusbar .mic-btn:hover:not(:disabled), .sb-shout .talk-button:hover:not(:disabled), .room-head .ghost-icon:hover { background: var(--hover); color: var(--text); }
.tool:active:not(:disabled), .statusbar .panel-btn:active:not(:disabled), .statusbar .mic-btn:active:not(:disabled), .sb-shout .talk-button:active:not(:disabled), .room-head .ghost-icon:active {
  background: color-mix(in srgb, var(--text) 13%, transparent); transform: translateY(1px); }
.statusbar .mic-btn { width: 26px; padding: 0; color: var(--green); }
/* 麦克风按钮里的实时音量条只在手机的语音条上显示(mobile.css);桌面端改用右侧的音量滑块 */
.statusbar .mic-meter { display: none; }
/* 音量滑块:耳机右侧调听到的音量,麦克风右侧调麦克风音量;悬停或拖动时上方气泡显示数值 */
.sb-vol { position: relative; flex: none; display: flex; align-items: center; width: 68px; height: 26px; margin-right: 6px; }
/* 滑块本体(状态栏与成员右键菜单共用):细轨道 + 矩形手柄,已填充部分用主色(--fill 由脚本按当前值设置) */
input.bar-slider { flex: 1; min-width: 0; width: 100%; height: 16px; margin: 0; padding: 0; border: 0; background: transparent; appearance: none; -webkit-appearance: none; cursor: pointer; }
input.bar-slider::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--green) var(--fill, 0%), var(--line) var(--fill, 0%)); }
input.bar-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 6px; height: 14px; margin-top: -5px; border: 0; border-radius: 2px; background: var(--green); box-shadow: 0 0 0 1.5px var(--panel); }
input.bar-slider::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line); }
input.bar-slider::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--green); }
input.bar-slider::-moz-range-thumb { width: 6px; height: 14px; border: 0; border-radius: 2px; background: var(--green); box-shadow: 0 0 0 1.5px var(--panel); }
input.bar-slider:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 4px; }
/* 禁用(耳机关着 / 麦克风没开):整条变灰,不可拖 */
input.bar-slider:disabled { cursor: default; }
input.bar-slider:disabled::-webkit-slider-runnable-track { background: linear-gradient(to right, var(--muted) var(--fill, 0%), var(--line) var(--fill, 0%)); }
/* 两种内核的伪元素必须各写一条:写在同一条规则里,浏览器遇到不认识的那个会把整条作废 */
input.bar-slider:disabled::-webkit-slider-thumb { background: var(--muted); }
input.bar-slider:disabled::-moz-range-thumb { background: var(--muted); }
input.bar-slider:disabled::-moz-range-progress { background: var(--muted); }
.sb-vol::after { content: attr(data-value); position: absolute; left: 50%; bottom: calc(100% + 4px); z-index: 5; transform: translateX(-50%); padding: 3px 8px; border-radius: 6px; background: var(--text); color: var(--panel); font-size: var(--fs-xs); white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .1s; }
.sb-vol:hover::after, .sb-vol:active::after, .sb-vol:has(input:focus-visible)::after { opacity: 1; }
.statusbar .mic-btn.off, .statusbar .panel-btn.off, .statusbar .panel-btn.hang { color: var(--danger); }
/* 优先发言开关:开着时用喊话橙;文字标签只在手机的语音控制台里显示 */
.statusbar .panel-btn.priority[aria-pressed='true'], .statusbar .panel-btn.priority[aria-pressed='true']:hover { color: var(--shout); }
.panel-btn.priority .label { display: none; }
.statusbar .mic-btn.talking { background: var(--green-soft); }
.sb-shout .talk-button.active { background: var(--shout); color: #fff; transform: translateY(1px); }
.sb-shout .talk-button kbd { padding: 0 4px; font-size: var(--fs-xs); line-height: 14px; }
.statusbar :disabled { opacity: .45; }
/* 下拉按钮:文字后带小三角 */
.tool.drop::after { content: ''; flex: none; margin-top: 3px; border: 3.5px solid transparent; border-top-color: currentColor; opacity: .6; }
.tool.drop .truncate { min-width: 0; }
.talk-mode { flex: none; color: var(--muted); }
/* 触屏上的「点击说话」:按住说话的实体按钮;手指按下与说话中用说话绿描边 */
.statusbar .tap-talk { flex: none; height: 30px; padding: 0 12px; }
.statusbar .tap-talk.active, .statusbar .tap-talk:active:not(:disabled) { border-color: var(--speak); background: color-mix(in srgb, var(--speak) 18%, transparent); color: var(--speak); transform: none; }
/* 按钮组之间的短细竖线 */
.sb-sep, .sb-shout::before, .sb-link::before { content: ''; flex: none; width: 1px; height: 16px; margin: 0 4px; background: var(--line); }
/* 主按钮保持实心,更矮、圆角更小 */
.composer .button.primary, .stage .button.primary { min-height: 30px; height: 30px; padding: 0 14px; border-radius: 4px; font-size: var(--fs-sm); }
.composer input { min-height: 30px; border-radius: 4px; font-size: var(--fs-sm); }
/* 列表:频道名与消息正文同一档(15px);频道下的成员、右侧成员名小一号(14px) */
.room-link { min-height: 32px; gap: 6px; font-size: var(--fs-md); }
.tree-member { min-height: 28px; font-size: calc(var(--fs-sm) + 1px); }
.member-row { padding: 3px 8px; }
.member-name strong { font-size: calc(var(--fs-sm) + 1px); }

/* 任务 19:频道未读、新消息分隔线、跳到最新、正在输入 */
.room-link.unread .name { color: var(--text); font-weight: 700; }
.unread-count { flex: none; min-width: 18px; padding: 0 5px; border-radius: 99px; background: var(--green); color: #fff; font-size: var(--fs-xs); font-weight: 600; line-height: 16px; text-align: center; font-variant-numeric: tabular-nums; }
.unread-count.mention { background: var(--danger, #e5484d); }
.new-divider { display: flex; align-items: center; gap: 8px; margin: 12px 0; color: var(--green); font-size: var(--fs-xs); font-weight: 600; }
.new-divider::before { content: ''; flex: 1; border-top: 1px solid var(--green); }
.new-divider + .message { margin-top: 0; }
.composer { position: relative; }
/* 给「正在输入」留出一行,不压住最后一条消息 */
.messages { padding-bottom: 22px; }
.composer .typing { position: absolute; bottom: 100%; left: 16px; max-width: calc(100% - 32px); padding: 0 6px; border-radius: 4px; background: var(--main); color: var(--muted); font-size: var(--fs-xs); line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.composer .jump-latest { position: absolute; bottom: calc(100% + 4px); right: 16px; padding: 2px 10px; border: 1px solid var(--line); border-radius: 99px; background: var(--panel); box-shadow: var(--shadow); color: var(--green); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.composer .jump-latest:hover { background: var(--green-soft); }

/* 任务 20:作战通知 */
.tb-button .count-badge { position: absolute; top: 1px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--danger); color: #fff; font-size: var(--fs-xs); font-weight: 700; line-height: 16px; text-align: center; }
/* 横幅要一眼看得到:实色底(普通用主色,紧急用红)、白字、大标题,图标一直闪;新通知到达或被催促时整条再闪几下(.flash,见 alerts.js) */
.alert-banner { --ab: var(--green); position: relative; z-index: 1; flex: none; display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--ab); color: #fff; box-shadow: 0 2px 12px color-mix(in srgb, var(--ab) 45%, transparent); }
.alert-banner.urgent { --ab: var(--danger); }
.alert-banner > svg { flex: none; width: 32px; height: 32px; color: #fff; animation: alert-pulse 1s ease-in-out infinite; }
.alert-banner.flash { animation: alert-flash .45s ease-in-out 5; }
@keyframes alert-pulse { 50% { opacity: 0.35; } }
@keyframes alert-flash { 50% { filter: brightness(1.4); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ab) 55%, transparent), 0 2px 20px var(--ab); } }
@media (prefers-reduced-motion: reduce) { .alert-banner > svg, .alert-banner.flash { animation: none; } }
.alert-banner .button { border-color: #ffffff73; background: #ffffff26; color: #fff; }
.alert-banner .button:hover { border-color: #fff; background: #ffffff40; color: #fff; }
.alert-banner .button.primary, .alert-banner .button.primary:hover { border-color: #fff; background: #fff; color: var(--ab); font-weight: 700; }
.alert-banner .ab-close, .alert-banner .ab-close:hover { color: #fff; }
.alert-banner .ab-close:hover { background: #ffffff33; }
/* 第一波(.big):通知刚到或被催促时先铺成一大块——居中、特大标题、备注完整显示、按钮加大;在眼前停留够时间后由 alerts.js 摘掉类名,收成上面那一条 */
.alert-banner.big { flex-direction: column; justify-content: center; gap: 10px; min-height: min(220px, 34vh); padding: 22px 44px; text-align: center; }
.alert-banner.big > svg { width: 42px; height: 42px; }
.alert-banner.big .ab-main { flex: none; justify-items: center; gap: 4px; max-width: 100%; }
.alert-banner.big .ab-main .ab-more { justify-self: center; }
.alert-banner.big .truncate { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.alert-banner.big .ab-main strong { font-size: 24px; line-height: 1.3; }
.alert-banner.big .ab-main small { font-size: var(--fs-md); }
.alert-banner.big .ab-actions { gap: 10px; flex-wrap: wrap; justify-content: center; }
.alert-banner.big .ab-actions .button { height: 36px; min-height: 36px; padding: 0 18px; border-radius: 9px; font-size: var(--fs-md); }
.alert-banner.big .ab-close { position: absolute; top: 10px; right: 10px; margin: 0; }
.ab-main { flex: 1; min-width: 0; display: grid; }
.ab-main strong { font-size: 20px; line-height: 1.35; }
.ab-main small { color: #ffffffe0; font-size: var(--fs-sm); }
.ab-actions { flex: none; display: flex; align-items: center; gap: 6px; }
.ab-actions .button { height: 32px; min-height: 32px; padding: 0 14px; font-size: var(--fs-sm); white-space: nowrap; }
.ab-close { flex: none; margin-left: -4px; }
#alerts-dialog { width: min(640px, calc(100vw - 32px)); }
.alerts-modal .modal-title h2 { flex: 1; }
.alert-form { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.alert-form textarea { resize: vertical; }
.alert-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: end; }
.alert-checks { display: flex; flex-wrap: wrap; gap: 4px 14px; padding-bottom: 6px; }
.alert-pick { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; border: 0; }
.alert-pick legend { width: 100%; margin-bottom: 6px; padding: 0; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
/* 胶囊式多选:隐藏原生勾选框,选中后主色填充 */
.alert-form .alert-pick label.inline, #room-form .alert-pick label.inline { position: relative; max-width: 12em; height: 28px; padding: 0 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--panel); color: var(--text); font-size: var(--fs-sm); cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.alert-form .alert-pick label.inline:hover, #room-form .alert-pick label.inline:hover { border-color: var(--green-line); background: var(--green-soft); }
.alert-form .alert-pick input[type=checkbox], #room-form .alert-pick input[type=checkbox] { position: absolute; opacity: 0; pointer-events: none; }
.alert-form .alert-pick label.inline:has(input:checked), #room-form .alert-pick label.inline:has(input:checked) { border-color: var(--green); background: var(--green); color: #fff; }
.alert-form .alert-pick label.inline:has(input:focus-visible), #room-form .alert-pick label.inline:has(input:focus-visible) { outline: 2px solid var(--green); outline-offset: 2px; }
/* 频道设置里的监听来源也用这组胶囊;说明文字另起一行 */
.alert-pick small { width: 100%; color: var(--muted); font-size: var(--fs-xs); font-weight: 500; }
.alert-form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.alert-list { display: grid; gap: 8px; max-height: 55vh; overflow: auto; }
.alert-card { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--green); border-radius: 8px; }
.alert-card.urgent { border-left-color: var(--danger); }
.alert-card.ended { opacity: 0.6; }
.alert-card header { display: flex; align-items: center; gap: 8px; min-width: 0; }
.alert-card header small { flex: none; color: var(--muted); font-size: var(--fs-xs); }
.mode-tag.urgent { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.ac-meta, .ac-roster p { color: var(--muted); font-size: var(--fs-xs); }
.ac-note { font-size: var(--fs-sm); white-space: pre-wrap; }
.ac-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.ac-stats .stat { padding: 1px 8px; border-radius: 99px; background: var(--panel-2); font-size: var(--fs-xs); font-weight: 600; font-variant-numeric: tabular-nums; }
.ac-stats .stat.ack { background: var(--green-soft); color: var(--green); }
.ac-stats .stat.omw { background: color-mix(in srgb, #3b82f6 14%, transparent); color: #3b82f6; }
.ac-stats .stat.no { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.ac-roster summary { cursor: pointer; color: var(--muted); font-size: var(--fs-xs); }
.ac-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.webhooks { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.webhooks h3 { font-size: var(--fs-md); }
.webhooks small { color: var(--muted); }
.webhooks small.error { color: var(--danger); }
.webhook-form { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; }
.webhook-form input, .webhook-form select { min-height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
/* 窄屏下标题栏按钮收窄,给作战通知按钮让出空间 */
@media (max-width: 480px) { .tb-button { width: 28px; } }
/* 自己的资料卡:编辑资料、退出登录并排 */
.pc-actions.self { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pc-actions .button { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.button.danger { color: var(--danger); }
.button.danger:hover { border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: color-mix(in srgb, var(--danger) 10%, transparent); }
/* 注册页说明:没有邀请链接时提示,并给出回到登录的入口 */
.auth-note { padding: 8px 10px; border-radius: 8px; background: var(--green-soft); color: var(--text); font-size: var(--fs-sm); line-height: 1.5; }
.auth-note .text-button { display: inline; padding: 0; color: var(--green); font-size: var(--fs-sm); font-weight: 600; }
/* 多条作战通知:横幅「还有 N 条」、列表分组 */
.ab-main .ab-more { justify-self: start; padding: 0; color: #fff; font-size: var(--fs-xs); font-weight: 600; text-decoration: underline; }
.alert-group { color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.alert-ended { display: grid; gap: 8px; }
.alert-ended > summary { cursor: pointer; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.alert-ended[open] > summary { margin-bottom: 0; }
/* 作战通知按钮带文字,窄屏只留图标 */
#alerts-open { width: auto; grid-auto-flow: column; gap: 4px; padding: 0 8px; }
#alerts-open .tb-label { font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
#alerts-open .count-badge { position: static; }
@media (max-width: 900px) { #alerts-open { width: 32px; padding: 0; } #alerts-open .tb-label { display: none; } #alerts-open .count-badge { position: absolute; } }
@media (max-width: 480px) { #alerts-open { width: 28px; } }

/* 任务 21:聊天升级 */
.message-actions .ghost-icon { width: 28px; height: 28px; }
.reply-quote { display: flex; align-items: center; gap: 4px; max-width: 100%; margin: 2px 0; padding: 0; border: 0; background: none; color: var(--muted); font-size: var(--fs-xs); text-align: left; cursor: pointer; }
.reply-quote svg { flex: none; width: 13px; height: 13px; }
.reply-quote b { flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 600; }
.reply-quote:hover span { color: var(--text); }
.reply-quote.deleted { cursor: default; font-style: italic; }
.reply-quote.deleted:hover span { color: var(--muted); }
.msg-image { display: block; margin-top: 4px; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel-2); cursor: zoom-in; }
.msg-image img { display: block; width: auto; height: auto; max-width: 100%; max-height: 280px; }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.reaction { height: 24px; padding: 0 8px; border: 1px solid var(--line); border-radius: 99px; background: var(--panel); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.reaction span { color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.reaction:hover { border-color: var(--green-line); }
.reaction.mine { border-color: var(--green); background: var(--green-soft); }
.reaction.mine span { color: var(--green); }
.mention-tag { padding: 0 2px; border-radius: 3px; background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); font-weight: 600; }
.mention-tag.me { background: color-mix(in srgb, var(--green) 24%, transparent); }
@keyframes msg-flash { from { background: color-mix(in srgb, var(--green) 25%, transparent); } }
.message.flash { animation: msg-flash 1.6s ease-out; }
@media (prefers-reduced-motion: reduce) { .message.flash { animation: none; outline: 2px solid var(--green); } }
.composer { flex-wrap: wrap; }
.composer .attach { flex: none; align-self: center; }
.draft-bar { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; }
.draft-reply, .draft-image { display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; padding: 2px 4px 2px 8px; border-radius: 6px; background: var(--panel-2); color: var(--muted); font-size: var(--fs-xs); }
.draft-reply > svg { flex: none; width: 13px; height: 13px; }
.draft-image img { width: 36px; height: 36px; border-radius: 4px; object-fit: cover; }
.draft-image.uploading img { opacity: 0.5; }
.draft-bar .ghost-icon { width: 22px; height: 22px; }
.mention-picker { position: absolute; bottom: calc(100% + 4px); left: 16px; z-index: 5; display: grid; width: min(280px, calc(100% - 32px)); max-height: 260px; overflow: auto; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: var(--shadow); }
.mention-picker button { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 4px 8px; border: 0; border-radius: 6px; background: none; color: var(--text); font-size: var(--fs-sm); text-align: left; }
.mention-picker button .avatar { --size: 22px; }
.mention-picker button.active, .mention-picker button:hover { background: var(--hover); }
.mention-all { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: #fff; font-weight: 700; }
.react-picker { position: fixed; z-index: 12; display: flex; gap: 2px; padding: 4px; border: 1px solid var(--line); border-radius: 99px; background: var(--panel); box-shadow: var(--shadow); }
.react-picker button { width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; font-size: var(--fs-lg); }
.react-picker button:hover { background: var(--hover); }
/* 看图弹窗:选择器带上 dialog,才压得过通用的 dialog(宽 400px)与 dialog:modal(overflow: auto、max-height) */
dialog.image-dialog { width: fit-content; max-width: 92vw; max-height: calc(100dvh - 80px); padding: 0; border: 0; background: transparent; box-shadow: none; overflow: visible; }
.image-dialog::backdrop { background: rgb(0 0 0 / 75%); }
dialog.image-dialog img { display: block; width: auto; height: auto; max-width: 92vw; max-height: calc(100dvh - 80px); border-radius: 8px; cursor: zoom-out; }
dialog.image-dialog .close { position: absolute; top: -36px; right: 0; background: rgb(0 0 0 / 45%); color: #fff; }
.draft-bar[hidden], .mention-picker[hidden], .react-picker[hidden] { display: none; }
.composer textarea[name=text] { flex: 1; min-width: 0; height: 36px; max-height: 120px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); color: inherit; font: inherit; font-size: var(--fs-md); line-height: 22px; resize: none; }
.composer textarea[name=text]:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 20%, transparent); }
.composer textarea[name=text]:disabled { opacity: .6; }
.composer .attach, .composer [type=submit] { align-self: flex-end; }
.msg-link { color: var(--green); text-decoration: underline; overflow-wrap: anywhere; }
/* 缩略图跟着消息正文的可用宽度等比缩小(公屏最宽 360px,私聊小窗与手机更窄),不靠 overflow 切边 */
.msg-image { width: fit-content; max-width: min(360px, 100%); }
/* EVE 集成 */
.eve-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.eve-row > input, .eve-row > select { flex: 1; min-width: 0; }
.eve-row .button { flex: none; }
.eve-row label.inline { flex: 1; min-width: 0; }
.eve-name { flex: 1; min-width: 0; font-weight: 600; }
.eve-list, .eve-section, #eve-policy { display: grid; gap: 8px; min-width: 0; }
.eve-item { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; }
.eve-item > .truncate { flex: 1; min-width: 0; }
.eve-item select { flex: none; width: auto; max-width: 40%; min-height: 30px; }
.eve-item .text-button, .eve-item .ghost-icon { flex: none; }
/* 规则行同时有身份与管辖频道两个下拉时一行放不下:名称独占上行,下拉与移除按钮排在下行 */
.eve-item.scoped { flex-wrap: wrap; }
.eve-item.scoped > .truncate { flex-basis: 100%; }
.eve-item.scoped select { flex: 1; min-width: 0; max-width: none; }
.eve-main { flex: none; padding: 0 6px; border-radius: 4px; background: var(--green-soft); color: var(--green); font-size: var(--fs-xs); }
.pc-eve { display: grid; gap: 4px; font-size: var(--fs-sm); }
.pc-eve summary { color: var(--muted); cursor: pointer; }
.pc-eve .eve-item { padding: 4px 8px; }
/* 任务 27:游戏身份 + 昵称、外部接口令牌 */
.name-nick { color: var(--muted); font-weight: 400; }
.uname.truncate { min-width: 0; }
.bot-token-form { display: grid; gap: 10px; }
.bot-token-form > label { display: grid; gap: 4px; font-size: var(--fs-sm); font-weight: 600; }
.bot-token-new { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--green-line); border-radius: 8px; background: var(--green-soft); font-size: var(--fs-sm); }
.bot-token-new[hidden] { display: none; }
.ban-row small.bot-scopes { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }

/* ===== 同主域多频道切换(配了 HUB_DOMAIN 才出现):顶栏入口、列表行、登录窗口里的芯片 ===== */
#hub-open { flex: none; width: 24px; margin-left: -6px; }
.hub-dot { flex: none; width: 10px; height: 10px; border-radius: 99px; background: var(--c); }
.hub-row { display: flex; align-items: center; gap: 4px; }
.hub-row > [data-menu='hub-go'] { flex: 1; min-width: 0; }
.hub-row > [aria-current] { color: var(--green-strong); font-weight: 600; }
.hub-text { flex: 1; min-width: 0; display: grid; }
.hub-text small { font-size: var(--fs-xs); font-weight: 400; }
.context-menu .hub-row .ghost-icon { flex: none; width: 26px; height: 26px; justify-content: center; padding: 0; color: var(--muted); }
.auth-hub { display: grid; gap: 6px; padding: 0 22px 16px; }
.auth-hub > div { display: flex; flex-wrap: wrap; gap: 6px; }
.auth-hub .chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; color: inherit; text-decoration: none; }
/* 任务 40i:一键中 / 英切换(顶栏、登录页与开服向导的卡片顶部)、站长「全部社区」的专属网址 */
.tb-button.lang-toggle { width: auto; min-width: 32px; padding: 0 8px; font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.auth-brand > div { min-width: 0; }
.auth-brand .lang-switch { flex: none; margin-left: auto; min-height: 28px; padding: 0 10px; border: 0; border-radius: 99px; background: #ffffff2b; color: #fff; font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.admin-url { display: block; max-width: 100%; padding: 0; color: var(--green-strong); font-size: var(--fs-xs); text-align: left; }
