/* ==========================================================
   group-admin.css — 三色 toast、离线横幅、浮层 / 底部抽屉、群管理（信息面板分页、成员角色、权限矩阵、邀请审批、公告、Bot、TG 桥接、慢速模式）
   ========================================================== */

/* ---------- toast：三色，PC 右上 / 手机底部 ---------- */
.toasts { position: fixed; top: 16px; right: 16px; z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast-item {
  display: flex; align-items: center; gap: 8px;
  max-width: 360px; padding: 10px 14px;
  border-radius: var(--radius-sm); color: #fff; font-size: 14px;
  box-shadow: var(--shadow);
  opacity: 0; transform: translateY(-6px); transition: opacity .2s, transform .2s;
}
.toast-item.show { opacity: 1; transform: none; }
.toast-item .ti { font-size: 18px; flex-shrink: 0; }
.t-success { background: #23864f; }
.t-error { background: #c8394f; }
.t-info { background: #2c3a48; }

/* ---------- 离线横幅 ---------- */
.offline-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: calc(6px + env(safe-area-inset-top)) 12px 6px;
  background: #f0b429; color: #3a2a00; font-size: 14px; font-weight: 500;
}
.offline-bar .ti { font-size: 18px; }
body.offline .app { padding-top: 34px; }
.spin { animation: spin 1.2s linear infinite; }

/* ---------- 浮层 / 底部抽屉 ---------- */
.asheet { position: fixed; z-index: 130; min-width: 240px; max-width: 320px; padding: 6px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.sheet-backdrop { position: fixed; inset: 0; z-index: 129; background: var(--overlay); }
.msheet button { width: 100%; min-height: 42px; padding: 6px 12px; display: flex; align-items: center; gap: 12px; border-radius: var(--radius-sm); font-size: 14px; text-align: left; }
.msheet button .ti { font-size: 19px; color: var(--text-2); }
.msheet button:hover { background: var(--bg-hover); }
.msheet button.danger, .msheet button.danger .ti { color: var(--danger); }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 6px 8px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.sheet-head .m-body { display: flex; flex-direction: column; }
.mute-opts { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 12px 8px 44px; }
.btn.danger-fill { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.wide { width: 100%; height: 44px; }

/* ---------- 信息面板：分页 / 编辑 / 角色可见性 ---------- */
.ip-page { display: none; flex: 1; min-height: 0; flex-direction: column; }
.ip-page.active { display: flex; }
.ip-pad { padding: 12px 16px 32px; }
.ip-av-wrap { position: relative; display: inline-flex; border-radius: 50%; }
.ip-av-wrap.editable { cursor: pointer; }
.ip-av-edit { position: absolute; right: -2px; bottom: -2px; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: none; align-items: center; justify-content: center; border: 2px solid var(--bg); }
.ip-av-wrap.editable .ip-av-edit, .my-av .ip-av-edit { display: inline-flex; }
.ip-av-edit .ti { font-size: 16px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.ip-edit { width: 100%; text-align: left; margin-top: 12px; }
.ip-edit-actions { display: flex; justify-content: flex-end; gap: 8px; }
.ip-user { padding: 0 20px 12px; }
.link-row { width: 100%; text-align: left; cursor: pointer; }
.link-row:hover { background: var(--bg-hover); }
.ir-chev { color: var(--text-3); font-size: 18px !important; }
.info-row .dd, .info-row .seg { flex-shrink: 0; }
#info:not(.is-admin) .admin-only, #info:not(.is-owner) .owner-only, #info.is-admin .member-only, #info.is-channel .group-only { display: none !important; }
.danger-zone { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-top: 8px solid var(--bg-soft); }
.mem-search { margin: 4px 4px 2px; height: 36px; }
.mem-group { margin: 10px 10px 2px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.mem-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 10px; border-radius: var(--radius); cursor: pointer; }
.mem-row:hover { background: var(--bg-hover); }
.mem-row .m-sub .ti { font-size: 14px; color: var(--danger); vertical-align: -2px; }
.role-tag { flex-shrink: 0; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 500; background: var(--bg-soft); color: var(--text-2); }
.role-tag.r-owner { background: color-mix(in srgb, #e0a030 18%, transparent); color: #a86f00; }
.role-tag.r-admin { background: var(--accent-soft); color: var(--accent); }
.role-tag.r-readonly { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); }
:root[data-theme="dark"] .role-tag.r-owner { color: #f0c66a; }

/* 权限矩阵 */
.perm-wrap { overflow-x: auto; margin: 8px -4px 0; }
.perm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.perm-table th, .perm-table td { padding: 10px 6px; border-bottom: 1px solid var(--border); text-align: center; }
.perm-table thead th { font-size: 12px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.perm-table tbody th { text-align: left; font-weight: 500; }
.perm-table .switch { vertical-align: middle; }

/* 邀请 / 审批 */
.invite-card { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: var(--radius); }
.invite-link { font-size: 13px; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--bg-soft); overflow-wrap: anywhere; text-align: center; }
.invite-link.off { color: var(--text-3); text-decoration: line-through; }
.invite-actions { display: flex; gap: 8px; }
.sub-title { margin: 18px 2px 6px; font-size: 13px; font-weight: 600; color: var(--accent); }
.req-item { display: flex; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--border); }
.req-item .m-body { flex: 1; min-width: 0; }
.req-time { margin-left: 8px; font-size: 12px; font-weight: 400; color: var(--text-3); }
.req-actions { display: flex; gap: 8px; margin-top: 8px; justify-content: flex-end; }

/* 公告 */
.ann-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.announce-bar {
  flex-shrink: 0; display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 6px 8px 14px;
  background: color-mix(in srgb, #f0b429 14%, var(--bg)); border-bottom: 1px solid var(--border);
}
.announce-bar > .ti { color: #c98a00; margin-top: 2px; }
.ab-text { flex: 1; min-width: 0; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.announce-bar.expanded .ab-text { -webkit-line-clamp: 6; }
.ab-text b { margin-right: 6px; }
.announce-bar.expanded #announceToggle .ti { transform: rotate(180deg); }

/* Bot / 桥接 */
.bot-item { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--border); }
.bot-item .m-body { flex: 1; min-width: 0; }
.bridge-body { padding-top: 6px; }
.bridge-body[hidden] { display: none; }
.bridge-status { display: flex; align-items: center; gap: 10px; }
.bridge-status .dd { flex: 1; }
.st-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; display: inline-block; background: var(--badge-muted); }
.st-dot.s-ok, .st-dot.s-online { background: var(--online); }
.st-dot.s-down, .st-dot.s-busy { background: var(--danger); }
.st-dot.s-away { background: #e0a030; }
.st-dot.s-invisible, .st-dot.s-none { background: transparent; box-shadow: inset 0 0 0 2px var(--badge-muted); }
.bridge-sync { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-2); margin: 4px 0 12px; }
.bridge-sync b { color: var(--text); font-weight: 500; }
.bridge-note, .bridge-warn { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; padding: 10px 12px; border-radius: var(--radius-sm); margin: 0 0 8px; }
.bridge-note { background: var(--accent-soft); color: var(--text); }
.bridge-warn { background: color-mix(in srgb, #f0b429 16%, var(--bg)); color: var(--text); }
.bridge-note .ti { color: var(--accent); font-size: 18px; } .bridge-warn .ti { color: #c98a00; font-size: 18px; }

/* 慢速模式 */
.slow-hint { display: flex; align-items: center; gap: 6px; justify-content: center; font-size: 12px; color: var(--text-2); padding: 0 16px 4px; margin-top: -6px; }
.slow-hint[hidden] { display: none; }
.slow-hint .ti { font-size: 14px; }
.slow-hint.waiting { color: var(--danger); font-weight: 500; }
