/* 手机专属界面(≤680px)。由 index.html 以 media="(max-width: 680px)" 引入,桌面端不加载这份规则。
   结构自上而下:顶栏 → 作战通知横幅 → 内容区(频道 / 聊天 / 成员三个面板叠在同一格,只显示当前 Tab)→ 常驻语音条 → 底部 Tab 栏。
   整页不滚动,各面板在自己内部滚动。颜色只用 styles.css 里的变量,字号只用 var(--fs-*)。 */

/* ===== 一、整体骨架 ===== */
/* 手机上标题档沿用 16px:输入框也用这一档(不小于 16px 才不会触发 iOS 自动放大),再大就挤了 */
:root { --tab-h: 56px; --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px); --sheet-radius: 14px; --touch: 44px; --fs-lg: 16px; }
html, body { overflow: hidden; overscroll-behavior: none; }
/* 社区卡片:手机上侧栏占满屏宽,头图不按 16:9 撑那么高。标志与名称仍放在顶栏(切到聊天、成员页时也看得到),
   卡片里就不再重复,只留头图、频道号与资料入口 */
.gc-banner { aspect-ratio: auto; height: 132px; }
.gc-banner.gc-default { aspect-ratio: auto; height: 76px; }
.app.has-card .titlebar .guild-open { display: flex; }
.app.has-card .app-brand { display: none; }
.gc-logo, .gc-text strong { display: none; }
.app, .app.no-roster {
  height: var(--app-height, 100dvh);
  grid-template: calc(48px + var(--safe-t)) auto minmax(0, 1fr) auto auto / minmax(0, 1fr);
  grid-template-areas: 'bar' 'alert' 'view' 'voice' 'tabs';
}
/* 三个面板占同一格;不用 display: none,切回来时各自的滚动位置还在 */
.sidebar, .main, .roster, .app.show-roster .roster {
  grid-area: view; display: flex; position: static; width: auto; min-width: 0; min-height: 0; border: 0; box-shadow: none; visibility: hidden;
}
.app[data-tab='channels'] .sidebar, .app[data-tab='chat'] .main, .app[data-tab='members'] .roster { visibility: visible; }
/* 社区栏:只在频道页出现,窄条贴左与侧栏并排(参照 Discord / KOOK 手机端);聊天、成员页把整个宽度留给内容 */
.guild-rail { grid-area: view; justify-self: start; z-index: 1; width: 52px; visibility: hidden; }
.app[data-tab='channels'] .guild-rail { visibility: visible; }
.app.has-rail .sidebar { margin-left: 52px; }
/* 零社区引导页:盖住内容区、语音条与 Tab 栏;顶栏不显示别人的社区名 */
.empty-guild { grid-row: 3 / -1; grid-column: 1 / -1; }
.app.no-guild .titlebar .guild-open { display: none; }
.app.no-guild .app-brand { display: flex; }

/* ===== 二、顶栏:Logo + 名称,右侧只留手机上用得着的入口 ===== */
.titlebar { gap: 6px; padding: var(--safe-t) 6px 0 12px; }
.brand { flex: 1; gap: 8px; }
.guild-open { min-width: 0; }
.brand strong { overflow: hidden; text-overflow: ellipsis; }
/* 连接状态只留一个小圆点 */
.status { gap: 0; font-size: 0; }
#guild-number, #pip-toggle, #roster-toggle, #roster-open, #roster-close, #invites-open, .room-head .desc, .room-head .crumb { display: none; }
.title-actions { gap: 0; }
.title-actions .tb-button, #alerts-open { width: 36px; height: 38px; }
.title-actions .tb-button.lang-toggle { width: auto; }
.desktop-app .win-controls .tb-button { width: 32px; }
#m-settings { display: grid; }
#m-me { display: grid; place-items: center; width: 36px; height: 38px; padding: 0; border: 0; border-radius: 8px; background: transparent; }
#m-me .avatar { --size: 28px; box-shadow: 0 0 0 1.5px #ffffff8c; }

/* ===== 三、作战通知横幅:顶栏下面,任何 Tab 都看得到 ===== */
#alert-banner { grid-area: alert; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px 10px; padding: 8px 12px; }
.ab-main { min-width: 0; }
.ab-main small + small { display: none; }
.ab-actions { grid-area: 2 / 1 / auto / -1; min-width: 0; gap: 6px; flex-wrap: wrap; }
.ab-actions .button { flex: 1 0 auto; height: 34px; min-height: 34px; padding: 0 12px; }
.ab-close { grid-area: 1 / 3; width: 34px; height: 34px; margin: 0; }
/* 第一波(.big):手机上仍是这套网格,只把留白、图标、标题放大,备注完整显示 */
#alert-banner.big { min-height: 0; padding: 22px 14px; gap: 12px 12px; text-align: left; }
#alert-banner.big > svg { width: 40px; height: 40px; }
#alert-banner.big .ab-main { justify-items: start; }
#alert-banner.big .ab-main strong { font-size: 22px; }
#alert-banner.big .ab-main small + small { display: block; }
#alert-banner.big .ab-actions .button { height: 44px; min-height: 44px; padding: 0 12px; }
#alert-banner.big .ab-close { position: static; }

/* ===== 四、底部 Tab 栏 ===== */
.tabbar {
  grid-area: tabs; display: grid; grid-template-columns: repeat(3, 1fr);
  height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--panel); border-top: 1px solid var(--line);
}
.tabbar button {
  position: relative; display: grid; justify-items: center; align-content: center; gap: 2px;
  border: 0; background: transparent; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; -webkit-tap-highlight-color: transparent;
}
.tabbar svg { width: 22px; height: 22px; }
.tabbar button:active { background: var(--hover); }
.tabbar button[aria-current] { color: var(--green-strong); }
.tabbar button[aria-current] svg { color: var(--green); }
/* 当前 Tab 顶上一小段主色 */
.tabbar button[aria-current]::before { content: ''; position: absolute; top: -1px; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--green); }
.tab-badge {
  position: absolute; top: 4px; left: calc(50% + 9px); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 99px;
  background: var(--green); color: #fff; font-size: var(--fs-xs); line-height: 17px; font-weight: 700; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 2px var(--panel);
}
.tab-badge.mention { background: var(--danger); }
.tab-badge.quiet { background: var(--panel-2); color: var(--muted); font-weight: 600; }
/* 软键盘弹出时把位置让给输入框 */
.app.keyboard .tabbar, .app.keyboard .statusbar { display: none; }

/* ===== 五、频道 Tab:YY 频道树是首屏。保留树(一眼看到每个频道里有谁、谁在说话),按手机收紧:
   不画每行的喇叭;顶层频道加重;子频道与频道里的人挂在左侧引导线上;频道行 46px 且上下留缝,手指粗也不容易点到隔壁 ===== */
.side-head { height: 44px; padding: 0 8px 0 16px; font-size: var(--fs-sm); }
.side-head .ghost-icon { width: 36px; height: 36px; }
#sidebar-invite { min-height: 40px; margin: 10px 12px 0; }
.channels { max-height: none; padding: 8px 10px calc(16px + var(--safe-b)); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.branch { position: relative; }
/* 子频道整组缩进并画引导线(层级靠线,不靠每行各自的缩进) */
.branch .branch { margin-left: 20px; border-left: 1.5px solid var(--line); }
.room-link { min-height: 46px; margin-top: 3px; gap: 9px; padding: 0 10px 0 8px; border-radius: 10px; font-size: var(--fs-md); font-weight: 600; -webkit-tap-highlight-color: transparent; }
.branch .branch .room-link { font-weight: 500; }
.room-link > svg:not(.lock) { display: none; }
/* 喇叭不画了:我所在的语音频道改用名字的颜色标出来 */
.room-link.joined .name { color: var(--green-strong); }
.room-link:active { background: var(--hover); }
/* 折叠箭头本身只有 6px:用一块看不见的区域把点按范围放大 */
.room-link .chevron { position: relative; }
.room-link .chevron::after { content: ''; position: absolute; inset: -14px; }
.room-count { min-width: 22px; height: 20px; line-height: 20px; }
/* 行右侧的「进语音」按钮:压在频道行上,行自己把右边让出来 */
.room-join { position: absolute; top: 4px; right: 2px; display: grid; place-items: center; width: var(--touch); height: var(--touch); border: 0; border-radius: 50%; background: transparent; color: var(--muted); -webkit-tap-highlight-color: transparent; }
.room-join svg { width: 18px; height: 18px; }
.room-join { opacity: .6; }
.room-join:active { background: var(--green-soft); color: var(--green-strong); opacity: 1; }
.branch:has(> .room-join) > .room-link { padding-right: 46px; }
.tree-member { min-height: 32px; gap: 9px; margin-left: 20px; padding: 0 12px 0 14px; border-left: 1.5px solid var(--line); font-size: var(--fs-sm); }
.tree-member .avatar { --size: 20px; }
.speak-wave svg { width: 16px; height: 16px; }

/* ===== 七、成员 Tab ===== */
.members { padding-bottom: calc(12px + var(--safe-b)); overscroll-behavior: contain; }
.member-row { min-height: 52px; }
.roster .side-head .ghost-icon { width: 38px; height: 38px; }
/* 「右键成员可管理」是给鼠标看的;手机上点成员就是底部资料抽屉 */
.roster-tip { display: none; }

/* ===== 八、常驻语音条:进了语音才出现,贴在 Tab 栏上面 =====
   状态栏原有的节点不动,只是重排:左边两行(频道名 / 转发或直连 + 信号格 + 延迟数字),右边闭听、麦克风、按住说话、展开 */
.statusbar {
  grid-area: voice; position: relative; z-index: 6; display: grid; align-items: center;
  grid-template-columns: auto auto minmax(0, 1fr) repeat(4, auto); grid-template-rows: auto auto; gap: 2px 6px;
  min-height: 60px; padding: 8px 6px 8px 14px; border-top: 1px solid var(--line); background: var(--panel); box-shadow: 0 -6px 16px #0000000f;
}
/* 没进语音:不占位,把屏幕留给内容 */
.statusbar:not(:has(#voice-link > *)) { display: none; }
#identity, #voice-link { display: contents; }
.statusbar .sb-avatar, .statusbar .talk-mode, .statusbar .panel-btn.priority, .sb-sep, .sb-status, .sb-link::before, #voice-card, #voice-console { display: none; }
.sb-room { grid-area: 1 / 1 / 2 / 4; max-width: none; align-self: end; color: var(--text); font-size: var(--fs-md); font-weight: 600; }
.sb-room svg { width: 16px; height: 16px; color: var(--green); }
.voice-mode { grid-area: 2 / 1; align-self: start; white-space: nowrap; }
.sb-quality { grid-area: 2 / 2; align-self: start; font-size: var(--fs-xs); color: var(--muted); }
/* 圆形的触控按钮:闭听、麦克风 */
.statusbar .panel-btn, .statusbar .mic-btn, #voice-expand {
  grid-row: 1 / 3; display: grid; place-items: center; width: var(--touch); height: var(--touch); padding: 0; border: 0; border-radius: 50%; background: var(--panel-2); -webkit-tap-highlight-color: transparent;
}
.statusbar .panel-btn svg, .statusbar .mic-btn svg { width: 20px; height: 20px; }
.statusbar [data-action='deafen'] { grid-column: 4; }
.statusbar .mic-btn { grid-column: 5; justify-content: center; }
.statusbar .mic-btn .mic-meter { display: none; }
/* 音量滑块只在桌面端的状态栏上;手机上在设置里调 */
.statusbar .sb-vol { display: none; }
/* 自由说话时没有「按住说话」按钮:麦克风按钮加宽,里面显示实时音量条 */
.statusbar:not(:has(.tap-talk)) .mic-btn:not(.off) { grid-column: 5 / 7; display: flex; gap: 6px; width: 104px; padding: 0 12px; border-radius: 22px; justify-content: flex-start; }
.statusbar:not(:has(.tap-talk)) .mic-btn:not(.off) .mic-meter { display: block; flex: 1; }
/* 按住说话:拇指最顺手的一颗,主色实心;按下变说话绿并外扩一圈 */
.statusbar .tap-talk {
  grid-column: 6; grid-row: 1 / 3; height: var(--touch); min-width: 96px; padding: 0 14px; border: 0; border-radius: 22px;
  background: var(--green); color: #fff; font-size: var(--fs-md); font-weight: 700; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.statusbar .tap-talk.active, .statusbar .tap-talk:active:not(:disabled) { background: var(--speak); color: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--speak) 28%, transparent); }
.statusbar .panel-btn[data-action='settings'], .statusbar .panel-btn.hang { display: none; }
#voice-expand { grid-column: 7; width: 36px; background: transparent; color: var(--muted); }
#voice-expand svg { width: 20px; height: 20px; }
/* 「旁听中」胶囊:语音条上放不下,只在展开的语音控制台里出现(模式标识那一行的右端) */
.statusbar .listen-pill { display: none; }
.statusbar.expanded .listen-pill { display: inline-flex; min-height: 34px; margin-left: auto; padding: 0 12px; }

/* ===== 六、聊天 Tab ===== */
.room-head { gap: 6px; padding: 0 6px 0 4px; }
.room-head .ghost-icon { display: grid; place-items: center; width: 38px; height: 38px; }
.room-head .ghost-icon svg { width: 20px; height: 20px; }
.room-head strong { min-width: 0; }
.listen-bar { padding: 6px 12px; }
/* 人数按钮:图标 + 数字,点了收起 / 展开下面的头像条 */
.room-head .stage-toggle { display: flex; gap: 3px; width: auto; padding: 0 8px; color: var(--muted); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.room-head .stage-toggle[aria-pressed='true'] { color: var(--green-strong); }
/* 频道里的人:一行横向滑动的头像条,不挤公屏 */
.stage { flex-wrap: nowrap; gap: 4px; padding: 6px 10px; overflow-x: auto; overscroll-behavior-x: contain; }
.stage .tile { flex: none; min-height: 36px; padding: 0 8px 0 4px; border-radius: 18px; }
.stage .tile .avatar { --size: 28px; }
.stage .tile .who { max-width: 8em; }
.stage-empty { flex: 1 0 auto; }
.stage .tile ~ .stage-empty { position: sticky; right: 0; flex: none; margin-left: auto; padding-left: 12px; background: linear-gradient(90deg, transparent, var(--panel-2) 12px); }
.stage .tile ~ .stage-empty .grow { display: none; }
.stage .button.primary { height: 34px; min-height: 34px; border-radius: 17px; }
/* 麦序频道:排麦面板单独占一行,下面的头像改为折行 */
.stage:has(.queue-panel) { flex-wrap: wrap; overflow-x: visible; }
.app.stage-off .stage > .tile, .app.stage-off .stage > .queue-panel { display: none; }
.app.stage-off .stage:not(:has(.stage-empty)) { display: none; }
.messages { padding: 10px 10px 22px; overscroll-behavior: contain; }
.message { padding-right: 8px; font-size: var(--fs-md); }
/* 输入框用 16px:小于这个字号,iOS 聚焦时会把整页放大 */
.composer { gap: 6px; padding: 8px 10px calc(8px + var(--safe-b)); }
.app .composer { padding-bottom: 8px; }
.composer textarea[name=text] { min-height: 40px; height: 40px; padding: 9px 12px; border-radius: 20px; font-size: var(--fs-lg); line-height: 20px; }
.composer .button.primary { height: 40px; min-height: 40px; padding: 0 16px; border-radius: 20px; }
.composer .attach { width: 40px; height: 40px; }
.composer .typing, .composer .jump-latest { left: 12px; }
.composer .jump-latest { left: auto; right: 12px; padding: 6px 12px; }

/* ===== 九、语音控制台:语音条展开成底部抽屉(还是同一批节点,换一种排法)===== */
.statusbar.expanded {
  position: fixed; inset: auto 0 0 0; z-index: 30; max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain;
  grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: none; gap: 12px 8px; align-items: center;
  grid-template-areas: 'grip grip grip grip' 'room room room fold' 'tag tag tag tag' 'crew crew crew crew' 'state state state state' 'talk talk talk talk' 'mode mode mode mode' 'shout shout shout shout' 'deaf mic gear hang';
  padding: 14px 16px calc(16px + var(--safe-b)); border: 0; border-radius: var(--sheet-radius) var(--sheet-radius) 0 0; box-shadow: 0 -12px 40px #00000040;
  animation: sheet-up .2s ease-out;
}
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } }
.statusbar.expanded .sb-room { grid-area: room; align-self: center; font-size: var(--fs-lg); }
.statusbar.expanded #voice-expand { grid-area: fold; justify-self: end; }
/* 模式标识与信号格并排放在第二行:同一个横排容器,间距随标识长短自适应 */
.statusbar.expanded .sb-net { grid-area: tag; display: flex; align-items: center; gap: 8px; min-width: 0; }
.statusbar.expanded .sb-net > * { align-self: center; }
.statusbar.expanded #voice-console { grid-area: crew; display: grid; gap: 10px; min-width: 0; }
.statusbar.expanded #voice-console:empty { display: none; }
.vc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 10px 4px; max-height: 34dvh; overflow-y: auto; padding: 4px 0; }
.vc-grid .tile { display: grid; justify-items: center; gap: 4px; padding: 4px 2px; border-radius: 10px; min-width: 0; }
.vc-grid .tile .avatar { --size: 44px; }
.vc-grid .tile .avatar.speaking { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--ring); }
.vc-grid .tile .who { max-width: 100%; font-size: var(--fs-xs); font-weight: 500; }
#voice-console .queue-panel { width: auto; }
#voice-console .chip { min-height: 34px; padding: 0 12px; }
/* 当前说话状态一行字 */
.statusbar.expanded .sb-status { grid-area: state; display: flex; justify-content: center; width: auto; margin: 0; font-size: var(--fs-sm); }
/* 大号按住说话:整行宽,拇指区 */
.statusbar.expanded .tap-talk { grid-area: talk; width: 100%; height: 64px; border-radius: 32px; font-size: var(--fs-lg); }
/* 自由说话时:这一行是麦克风按钮 + 实时音量条 */
.statusbar.expanded:not(:has(.tap-talk)) .mic-btn:not(.off) { grid-area: talk; width: 100%; height: 52px; border-radius: 26px; justify-content: center; }
/* 说话方式:两段式切换(桌面端的下拉在这里不出现) */
.vc-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--panel-2); }
.vc-mode button { min-height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.vc-mode button[aria-pressed='true'] { background: var(--panel); color: var(--green-strong); box-shadow: var(--shadow); }
/* 优先发言开关(只有本频道的管理者有):整行宽,图标 + 文字 */
.statusbar.expanded .panel-btn.priority { grid-area: mode; justify-self: stretch; display: flex; align-items: center; justify-content: center; gap: 8px; width: auto; height: var(--touch); border-radius: 10px; font-size: var(--fs-sm); font-weight: 600; }
.statusbar.expanded .panel-btn.priority .label { display: inline; }
.statusbar.expanded #voice-card:not([hidden]) { grid-area: shout; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.statusbar.expanded #voice-card::before { display: none; }
/* 定向喊话一行(按钮至少放得下自己的文字,目标名占其余宽度、过长截断),全员广播另起一行:英文标签与「含子频道」的目标名在 375px 下并排放不下 */
.statusbar.expanded #voice-card .talk-group { display: grid; grid-template-columns: minmax(max-content, 1fr) minmax(0, auto); }
.statusbar.expanded #voice-card .talk-button, .statusbar.expanded #voice-card .target { min-height: var(--touch); justify-content: center; border-radius: 10px; background: var(--panel-2); touch-action: none; }
.statusbar.expanded #voice-card .talk-group { gap: 4px; }
.statusbar.expanded #voice-card .target { max-width: none; }
.statusbar.expanded #voice-card kbd { display: none; }
/* 底部一排:闭听、麦克风、设置、断开(红色) */
.statusbar.expanded .panel-btn, .statusbar.expanded .mic-btn { grid-row: auto; grid-column: auto; justify-self: center; width: 52px; height: 52px; }
.statusbar.expanded .panel-btn[data-action='deafen'] { grid-area: deaf; }
.statusbar.expanded .mic-btn { grid-area: mic; }
.statusbar.expanded .panel-btn[data-action='settings'] { grid-area: gear; display: grid; }
.statusbar.expanded .panel-btn.hang { grid-area: hang; display: grid; background: var(--danger); color: #fff; }

/* ===== 十、底部抽屉:操作菜单与资料卡从底部滑出(桌面端是跟着鼠标的浮层)===== */
#sheet-backdrop { display: none; position: fixed; inset: 0; z-index: 28; background: #0b1a1166; }
body:has(#context-menu:not([hidden])) #sheet-backdrop, body:has(#profile-card:not([hidden])) #sheet-backdrop, body:has(.statusbar.expanded) #sheet-backdrop { display: block; }
/* 主文件按鼠标位置写了行内的 left / top,这里一律改成贴底 */
#context-menu, #profile-card {
  inset: auto 0 0 0 !important; z-index: 40; width: auto; min-width: 0; max-width: none; max-height: 82dvh; overflow-y: auto; overscroll-behavior: contain;
  border: 0; border-radius: var(--sheet-radius) var(--sheet-radius) 0 0; box-shadow: 0 -12px 40px #00000040; transform-origin: bottom center !important;
}
#context-menu:not([hidden]), #profile-card:not([hidden]) { animation: sheet-up .2s ease-out; }
#context-menu { padding: 8px 10px calc(12px + var(--safe-b)); }
/* 顶上一小段拖拽指示条 */
#context-menu::before, .statusbar.expanded::before { content: ''; display: block; width: 36px; height: 4px; margin: 0 auto 8px; border-radius: 2px; background: var(--line); }
.statusbar.expanded::before { grid-area: grip; margin-bottom: -4px; }
#context-menu header { padding: 6px 10px 10px; font-size: var(--fs-md); }
#context-menu button { min-height: 46px; gap: 12px; padding: 0 12px; border-radius: 10px; font-size: var(--fs-md); }
#context-menu button svg { width: 20px; height: 20px; }
#profile-card { padding-bottom: var(--safe-b); }
.pc-banner { height: 64px; }
.pc-head { padding: 0 18px; }
.pc-body { gap: 12px; padding: 12px 18px 18px; }
.pc-actions .button { flex: 1; min-height: var(--touch); }
/* 资料卡里的音量滑块:轨道加粗、整行加高,手指好拖 */
#profile-card .volume { min-height: var(--touch); gap: 10px; font-size: var(--fs-sm); }
#profile-card .volume svg { width: 20px; height: 20px; flex: none; }
#profile-card .volume input { height: 28px; }

/* 提示条:手机上放到顶栏下面。屏幕底部是拇指区(按住说话、输入框、贴底的弹窗与登录卡片的按钮都在那儿),软键盘弹出时底部还会被挡住 */
.notice { top: calc(var(--safe-t) + 56px); bottom: auto; }

/* ===== 十一、弹窗:贴底的近全屏卡片;私聊铺满全屏 ===== */
dialog:modal { width: 100% !important; max-width: 100% !important; max-height: calc(100dvh - 24px - var(--safe-t)); margin: auto 0 0; border-radius: var(--sheet-radius) var(--sheet-radius) 0 0; }
dialog:modal:has(.modal-title) > .modal { padding-bottom: calc(20px + var(--safe-b)); }
dialog[open] { animation: sheet-up .2s ease-out; }
.modal input, .modal select, .modal textarea, .auth-form input:not([type=checkbox]) { min-height: var(--touch); font-size: var(--fs-lg); font-weight: 500; }
.modal input[type=checkbox], .modal input[type=radio] { width: 20px; height: 20px; min-height: 0; }
/* 主色 / 昵称颜色的色块:里面的输入框是铺满色块的透明点按区,不吃上面两条的尺寸 */
.modal .swatch input { width: 100%; height: 100%; min-height: 0; }
.checks label { min-height: 38px; }
.modal .volume input, .vad-row input { min-height: 0; height: 28px; }
.seg label { min-height: 40px; }
.modal .button, .dialog-actions .button { min-height: var(--touch); }
.modal-title .close { width: 36px; height: 36px; }
/* 手机上没有键盘快捷键:语音设置里不显示按键绑定与说明 */
#key-list, #key-list + p { display: none; }
/* 手机上也没有游戏内展示(悬浮窗、OBS 叠加页)的场景 */
#settings-form fieldset:has([name=overlay]), #settings-form .obs-row { display: none; }
/* 两座设置中心:贴底抽屉铺满高度;左侧导航变成标题栏下的单行横滑分段条,下面是内容区。
   个人设置里「快捷键」「游戏内叠加」两个分区的内容手机上都不显示(见上面两条),导航里也不出现 */
#settings-dialog, #guild-dialog, #admin-dialog { height: calc(100dvh - 24px - var(--safe-t)); }
#guild-dialog:has(.guild-edit.readonly) { height: fit-content; }
dialog:modal:has(.modal-title) > .hub-modal { padding-bottom: 0; }
.hub { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
.hub-nav { display: flex; gap: 6px; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; white-space: nowrap; }
.hub-nav button { flex: none; min-height: 36px; padding: 0 12px; border-radius: 99px; }
.hub-body { padding: 14px 16px calc(20px + var(--safe-b)); }
.hub-pair { grid-template-columns: minmax(0, 1fr); }
#settings-nav :is([data-section=keys], [data-section=overlay]) { display: none; }
/* 语音日志筛选:成员下拉独占一行,频道下拉与刷新并排(三个挤一行时下拉里的字被截断) */
.audit-filter { grid-template-columns: minmax(0, 1fr) auto; }
.audit-filter [name=member] { grid-column: 1 / -1; }
/* 站长管理统计排成 2×2;注册页「获取验证码」与旁边的输入框一样高 */
.admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* 站长「全部社区」行:按钮(前往 / 移交紫马 / 解散)整体折到标志与文字下面,文字列占满首行(标志 32px + 间距 10px 之外的宽度),不被按钮挤没 */
#admin-guild-list .ban-row { flex-wrap: wrap; }
#admin-guild-list .ban-row > div { flex-basis: calc(100% - 42px); }
#register-email .button { min-height: var(--touch); }
dialog.image-dialog { margin: auto; border-radius: 0; }
.dm-window { inset: 0; z-index: 8; width: 100%; max-width: 100%; height: var(--app-height, 100dvh); max-height: none; padding: var(--safe-t) 0 0; border: 0; border-radius: 0; }
.dm-window .modal-title { margin: 0; padding: 8px 10px; cursor: auto; touch-action: auto; }
.dm-window .composer { padding-bottom: calc(8px + var(--safe-b)); }

/* ===== 十二、登录页 ===== */
.auth { place-items: end center; padding: var(--safe-t) 0 0; }
.auth-card { width: 100%; max-height: calc(100dvh - var(--safe-t) - 16px); border-radius: var(--sheet-radius) var(--sheet-radius) 0 0; }
.auth-brand { padding: 20px 20px 16px; }
.auth-form { gap: 14px; padding: 18px 20px calc(22px + var(--safe-b)); }
.auth-tabs button { height: 46px; }
/* 首次开服向导:步骤条 2×2,两种模式上下排,选项文字不截断 */
.setup-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px 20px 0; }
.setup-steps button { min-height: 40px; }
.setup-mode { flex-direction: column; }
.setup-form select { min-height: var(--touch); font-size: var(--fs-lg); }

/* ===== 同主域多频道切换:入口与移除按钮放大到好点的尺寸 ===== */
#hub-open { width: 32px; height: 38px; margin-left: -4px; }
#context-menu .hub-row .ghost-icon { width: 46px; padding: 0; }
.auth-hub { padding: 0 20px 16px; }

/* 回复引用:手机上一行很窄,昵称再收到 35%,把位置留给被回复的正文 */
.reply-quote b { max-width: 35%; }
