:root {
  --bg: #0e1116;
  --bg-soft: #151a21;
  --panel: #151b23;
  --line: #242c37;
  --text: #e8edf4;
  --muted: #8b97a8;
  --accent: #5b9dff;
  --accent-2: #39d3a3;
  --danger: #ff6b6b;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(1100px 700px at 8% -10%, #1b2740 0%, transparent 60%),
    radial-gradient(800px 600px at 108% 4%, #102a26 0%, transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

.app {
  display: flex;
  height: 100vh;
  height: 100dvh;
}

/* ---------------------------------------------------------------- 侧栏 */

.sidebar {
  width: 310px;
  flex: none;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: rgba(17, 22, 29, 0.75);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 16px 18px 12px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text);
}

.brand svg {
  color: var(--accent);
  flex: none;
}

.install {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin: 0 14px 12px;
  padding: 10px 13px;
  text-align: left;
  color: #08111f;
  background: linear-gradient(180deg, #8fc0ff, #5b9dff);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}

.install span {
  font-size: 13.5px;
  font-weight: 700;
}

.install small {
  font-size: 11px;
  opacity: 0.75;
}

.ios-tip {
  margin: 0 14px 12px;
  padding: 9px 12px;
  font-size: 11.5px;
  line-height: 1.6;
  color: #cfe0ff;
  background: rgba(91, 157, 255, 0.12);
  border: 1px solid rgba(91, 157, 255, 0.28);
  border-radius: 10px;
}

.me-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 14px 12px;
  padding: 11px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line);
  border-radius: 13px;
}

.avatar {
  width: 40px;
  height: 40px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  color: #08111f;
  background: linear-gradient(180deg, #8fc0ff, #5b9dff);
}

.me-info {
  flex: 1;
  min-width: 0;
}

.me-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.me-num {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
}

.me-num b {
  color: var(--accent-2);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  letter-spacing: 1px;
  font-size: 13px;
}

.me-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.me-actions button {
  padding: 4px 8px;
  font-size: 11px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
}

.me-actions button:hover {
  color: var(--text);
  border-color: #3a4553;
}

/* ---------------------------------------------------------------- 加入 */

.join {
  margin: 0 14px 12px;
}

.seg {
  display: flex;
  padding: 3px;
  margin-bottom: 8px;
  background: #0f141b;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.seg button {
  flex: 1;
  padding: 7px 4px;
  font-size: 12.5px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}

.seg button.on {
  color: #08111f;
  background: var(--accent);
  font-weight: 600;
}

#open-form {
  display: flex;
  gap: 6px;
}

#open-form input {
  flex: 1;
  min-width: 0;
  padding: 9px 11px;
  font-size: 14px;
  color: var(--text);
  background: #0f141b;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
}

#open-form input:focus {
  border-color: var(--accent);
}

#open-form button {
  padding: 0 13px;
  font-size: 13px;
  color: #08111f;
  background: var(--accent);
  border: 0;
  border-radius: 9px;
  cursor: pointer;
}

.err {
  min-height: 15px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--danger);
}

.create-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.create-row button {
  flex: 1;
  padding: 8px 6px;
  font-size: 12px;
  color: #9fb0c6;
  background: transparent;
  border: 1px dashed #33404f;
  border-radius: 9px;
  cursor: pointer;
}

.create-row button:hover {
  color: #dfe9f7;
  border-color: var(--accent);
}

#invite {
  color: #08111f;
  background: var(--accent-2);
  border-color: transparent;
  font-weight: 600;
}

/* ---------------------------------------------------------------- 弹窗 */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(6, 9, 13, 0.62);
  backdrop-filter: blur(4px);
}

.modal-card {
  width: min(400px, 100%);
  padding: 22px;
  background: #161d26;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.modal-card h3 {
  margin: 0 0 14px;
  font-size: 17px;
}

.modal-card .field {
  display: block;
  margin-bottom: 12px;
}

.modal-card .field span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 5px;
}

.modal-card .field input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text);
  background: #0f141b;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
}

.modal-card .field input:focus {
  border-color: var(--accent);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.modal-actions .ghost {
  padding: 9px 14px;
}

.modal-actions .primary {
  width: auto;
  margin: 0;
  padding: 9px 18px;
}

.members-card {
  max-height: 76vh;
  overflow-y: auto;
}

.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
}

.member-row .m-name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-row .m-num {
  font-size: 12px;
  color: var(--muted);
}

.member-row .m-owner {
  padding: 2px 7px;
  font-size: 11px;
  color: #08111f;
  background: var(--accent-2);
  border-radius: 6px;
}

.member-row .m-kick {
  padding: 5px 10px;
  font-size: 12px;
  color: #ffb4b4;
  background: rgba(90, 26, 26, 0.4);
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: 8px;
  cursor: pointer;
}

.banned-title {
  margin: 16px 0 2px;
  font-size: 12px;
  color: var(--muted);
}

.member-empty {
  padding: 12px 0;
  font-size: 13px;
  color: var(--muted);
}

/* ---------------------------------------------------------------- 会话列表 */

.conv-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 8px 8px;
}

.conv-empty {
  margin: 20px 12px;
  font-size: 12.5px;
  line-height: 1.7;
  color: #6d7a8c;
  text-align: center;
}

.conv {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  margin-bottom: 3px;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  color: var(--text);
}

.conv:hover {
  background: var(--bg-soft);
}

.conv.active {
  background: #1a2330;
  border-color: #2b3a4d;
}

.conv-badge {
  width: 34px;
  height: 34px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
}

.conv-badge.group {
  color: #9cc8ff;
  background: rgba(91, 157, 255, 0.15);
}

.conv-badge.dm {
  color: #8ff0cf;
  background: rgba(57, 211, 163, 0.15);
}

.conv-badge.voice {
  color: #ffd08a;
  background: rgba(255, 180, 84, 0.15);
}

.conv-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.conv-text b {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-text small {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.foot {
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  font-size: 11px;
  line-height: 1.5;
  color: #6d7a8c;
  border-top: 1px solid var(--line);
}

.foot b {
  color: #9fb0c6;
}

.lock {
  color: var(--accent-2);
  font-size: 9px;
  vertical-align: middle;
}

.panic-link {
  display: block;
  margin-top: 7px;
  padding: 0;
  font-size: 11px;
  color: #7a8798;
  background: none;
  border: 0;
  text-decoration: underline;
  cursor: pointer;
}

.panic-link:hover {
  color: var(--danger);
}

/* ---------------------------------------------------------------- 主区 */

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.empty {
  margin: auto;
  max-width: 520px;
  padding: 32px 28px;
  text-align: center;
}

.empty h1 {
  margin: 0 0 12px;
  font-size: 24px;
}

.empty p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.9;
  color: var(--muted);
}

.empty-list {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 9px;
  text-align: left;
}

.empty-list li {
  padding: 10px 14px;
  font-size: 13px;
  color: #b9c5d4;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.empty-list b {
  color: var(--accent);
}

.chat {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(11px + env(safe-area-inset-top, 0px)) 16px 11px;
  border-bottom: 1px solid var(--line);
  background: rgba(14, 17, 22, 0.6);
  backdrop-filter: blur(8px);
}

.chat-title {
  flex: 1;
  min-width: 0;
}

.chat-title h2 {
  margin: 0;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-title p {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--muted);
}

.chat-tools {
  display: flex;
  gap: 6px;
  flex: none;
}

.chat-tools button {
  padding: 7px 11px;
  font-size: 12.5px;
  color: #cfd9e6;
  background: #1a222d;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
}

.chat-tools button:hover {
  border-color: #3a4553;
}

.chat-tools .danger {
  color: #ffb4b4;
  background: rgba(90, 26, 26, 0.4);
  border-color: rgba(255, 107, 107, 0.3);
}

.back {
  display: none;
  width: 30px;
  height: 30px;
  flex: none;
  font-size: 22px;
  line-height: 1;
  color: var(--text);
  background: transparent;
  border: 0;
  cursor: pointer;
}

/* ---------------------------------------------------------------- 通话画面 */

.call-stage {
  padding: 10px 12px 0;
  border-bottom: 1px solid var(--line);
  background: #0b0f14;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
  max-height: 42vh;
  overflow-y: auto;
}

.tile {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 40%, #1d2530, #10151c 70%);
  border: 1px solid #232b36;
}

.tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #0b0f14;
}

.tile.mirror video {
  transform: scaleX(-1);
}

.tile.no-video video {
  visibility: hidden;
}

.tile .avatar {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 600;
  color: #cfd9e6;
  background: radial-gradient(circle at 50% 45%, #26303d, #11161d 72%);
}

.tile.no-video .avatar {
  display: flex;
}

.tile .name {
  position: absolute;
  left: 8px;
  bottom: 8px;
  max-width: 65%;
  padding: 4px 8px;
  font-size: 11.5px;
  color: #e9eef6;
  background: rgba(8, 12, 17, 0.62);
  border-radius: 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile .badges {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: flex;
  gap: 4px;
}

.tile .badge {
  padding: 3px 6px;
  font-size: 10.5px;
  color: #ffd9d9;
  background: rgba(120, 22, 22, 0.68);
  border-radius: 6px;
}

.call-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 9px 0;
}

.call-bar button {
  padding: 7px 13px;
  font-size: 12.5px;
  color: #cfd9e6;
  background: #1a222d;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
}

.call-bar button.danger {
  color: #ffb4b4;
  background: rgba(90, 26, 26, 0.45);
  border-color: rgba(255, 107, 107, 0.35);
}

/* ---------------------------------------------------------------- 消息 */

.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg-empty {
  margin: auto;
  font-size: 13px;
  color: #6d7a8c;
}

.msg {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 74%;
  align-self: flex-start;
}

.msg-head {
  font-size: 11px;
  color: #7c8a9d;
  padding-left: 2px;
}

.msg p {
  margin: 0;
  padding: 9px 13px;
  font-size: 14px;
  line-height: 1.6;
  background: #1b232d;
  border-radius: 4px 12px 12px 12px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.msg.me {
  align-self: flex-end;
  align-items: flex-end;
}

.msg.me .msg-head {
  padding-right: 2px;
}

.msg.me p {
  color: #08111f;
  background: linear-gradient(180deg, #7db4ff, #5b9dff);
  border-radius: 12px 4px 12px 12px;
}

.file {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  background: #1b232d;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.file:hover {
  border-color: #3a4553;
}

.file-icon {
  padding: 4px 7px;
  font-size: 10.5px;
  color: #08111f;
  background: var(--accent-2);
  border-radius: 6px;
}

.file-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- 输入 */

.composer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(14, 17, 22, 0.75);
}

.composer .attach {
  width: 38px;
  height: 38px;
  flex: none;
  font-size: 20px;
  line-height: 1;
  color: #b9c5d4;
  background: #1a222d;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}

.composer input#msg-input {
  flex: 1;
  min-width: 0;
  padding: 11px 13px;
  font-size: 14px;
  color: var(--text);
  background: #0f141b;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
}

.composer input#msg-input:focus {
  border-color: var(--accent);
}

.composer .send {
  padding: 0 16px;
  height: 38px;
  font-size: 13.5px;
  color: #08111f;
  background: var(--accent);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}

/* ---------------------------------------------------------------- 提示 */

.toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%);
  max-width: min(440px, 88vw);
  padding: 10px 16px;
  font-size: 13px;
  color: #dfe9f7;
  background: rgba(28, 36, 48, 0.97);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 40;
}

/* ---------------------------------------------------------------- 移动端 */

@media (max-width: 760px) {
  .sidebar {
    width: 100%;
    border-right: 0;
  }

  .main {
    position: fixed;
    inset: 0;
    z-index: 10;
    background: var(--bg);
    transform: translateX(100%);
    transition: transform 0.22s ease;
  }

  body.chat-open .main {
    transform: translateX(0);
  }

  body.chat-open .sidebar {
    visibility: hidden;
  }

  .back {
    display: block;
  }

  .tiles {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    max-height: 38vh;
  }

  .msg {
    max-width: 86%;
  }

  .chat-tools button {
    padding: 7px 9px;
  }
}

/* safe area for standalone app: keep content below the status bar */
@media (display-mode: standalone) {
  .topbar,
  .chat-head {
    padding-top: calc(12px + max(env(safe-area-inset-top, 0px), 24px));
  }
}
/* ---------------------------------------------------------------- 管理后台 */

.admin-body {
  min-height: 100vh;
  padding: 24px;
  overflow: auto;
}

.admin-gate {
  max-width: 380px;
  margin: 12vh auto 0;
  padding: 26px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.admin-gate h1 {
  margin: 0 0 6px;
  font-size: 22px;
}

.admin-gate p {
  color: var(--muted);
  font-size: 13px;
}

.admin-gate form {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.admin-gate input {
  flex: 1;
  min-width: 0;
  padding: 11px 12px;
  color: var(--text);
  background: #0f141b;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  outline: none;
}

.admin-gate input:focus {
  border-color: var(--accent);
}

.admin-gate button {
  padding: 0 16px;
  color: #08111f;
  background: var(--accent);
  border: 0;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.admin-hint {
  font-size: 11px;
  color: #6d7a8c;
}

.admin-panel {
  max-width: 900px;
  margin: 0 auto;
}

.admin-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.admin-head h1 {
  margin: 0;
  font-size: 22px;
}

.admin-count {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.admin-tools {
  display: flex;
  gap: 8px;
}

.admin-tools input {
  padding: 9px 12px;
  color: var(--text);
  background: #0f141b;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
}

.admin-tools button {
  padding: 0 14px;
  color: var(--text);
  background: #1a222d;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.admin-row.is-banned {
  opacity: 0.65;
  border-color: rgba(255, 107, 107, 0.35);
}

.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-main b {
  font-size: 14px;
}

.admin-main small {
  font-size: 12px;
  color: var(--muted);
}

.admin-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: #5b6472;
}

.admin-dot.on {
  background: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(57, 211, 163, 0.15);
}

.admin-badge {
  padding: 2px 7px;
  font-size: 11px;
  color: #ffb4b4;
  background: rgba(90, 26, 26, 0.5);
  border-radius: 6px;
}

.admin-badge.voice {
  color: #ffd08a;
  background: rgba(255, 180, 84, 0.15);
}

.admin-ban {
  padding: 7px 12px;
  font-size: 12px;
  color: #ffb4b4;
  background: rgba(90, 26, 26, 0.4);
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: 8px;
  cursor: pointer;
}

.admin-ban.restore {
  color: #8ff0cf;
  background: rgba(57, 211, 163, 0.12);
  border-color: rgba(57, 211, 163, 0.3);
}

.admin-note {
  margin-top: 14px;
  font-size: 12px;
  color: #6d7a8c;
}

.admin-empty {
  padding: 16px 0;
  font-size: 13px;
  color: var(--muted);
}

.admin-ipbans h2 {
  margin: 20px 0 8px;
  font-size: 15px;
  color: var(--muted);
}


.admin-link {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: #6f7c8e;
  text-decoration: none;
}
.admin-link:hover {
  color: var(--accent);
}


.share-help-text {
  margin: 0 0 4px;
  font-size: 14px;
  line-height: 1.9;
  color: var(--muted);
}


.member-row .m-muted {
  padding: 2px 7px;
  font-size: 11px;
  color: #ffd08a;
  background: rgba(255, 180, 84, 0.15);
  border-radius: 6px;
}


.composer.closed input,
.composer.closed .send {
  opacity: 0.5;
}


.msg .media {
  display: block;
  max-width: 280px;
  max-height: 340px;
  border-radius: 12px;
  background: #000;
  object-fit: contain;
}
.msg.me .media {
  margin-left: auto;
}


.avatar img,
.msg-avatar img,
.m-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

#me-avatar {
  cursor: pointer;
}

.msg-avatar {
  width: 20px;
  height: 20px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  background: #2a3442;
  color: #cfd9e6;
  font-size: 10px;
}

.msg-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.m-avatar {
  width: 28px;
  height: 28px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  background: #2a3442;
  color: #cfd9e6;
  font-size: 12px;
}


.tools-head {
  max-width: 900px;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tools-head h1 {
  margin: 0;
  font-size: 24px;
}
.tools-back {
  color: var(--accent);
  font-size: 14px;
  text-decoration: none;
}
.tools-intro {
  max-width: 900px;
  margin: 0 auto 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.tools-card {
  max-width: 900px;
  margin: 0 auto 22px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.tools-card h2 {
  margin: 0 0 12px;
  font-size: 17px;
}
.tools-card img {
  display: block;
  width: 100%;
  border-radius: 12px;
}
.tools-note {
  max-width: 900px;
  margin: 0 auto 40px;
  color: var(--muted);
  font-size: 12px;
}


/* ---------------------------------------------------------------- 手机聊天布局 */

.app {
  height: var(--app-h, 100dvh);
}

.more {
  display: none;
  width: 34px;
  height: 34px;
  flex: none;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #cfd9e6;
  background: #1a222d;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  background: rgba(0, 0, 0, 0.45);
}

.sheet-card {
  width: 100%;
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  background: #171d26;
  border-radius: 18px 18px 0 0;
}

.sheet-actions button,
.sheet-cancel {
  display: block;
  width: 100%;
  padding: 14px;
  margin-bottom: 8px;
  font-size: 15px;
  color: var(--text);
  background: #1f2733;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}

.sheet-actions button.danger {
  color: #ffb4b4;
  background: rgba(90, 26, 26, 0.45);
}

.sheet-cancel {
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
}

.install-bar {
  position: fixed;
  left: 50%;
  top: calc(10px + env(safe-area-inset-top));
  transform: translateX(-50%);
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 92vw;
  padding: 9px 10px 9px 14px;
  font-size: 12.5px;
  color: var(--text);
  background: #1b2532;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.install-bar button {
  padding: 5px 10px;
  font-size: 12.5px;
  color: #08111f;
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.install-bar button#install-bar-close {
  color: var(--muted);
  background: transparent;
  font-size: 16px;
  padding: 0 4px;
}

@media (max-width: 760px) {
  .chat-tools {
    display: none;
  }

  .more {
    display: flex;
  }

  .chat-title h2 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .chat-head {
    padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
    gap: 8px;
  }
}

@media (max-width: 760px) {
  .chat-tools {
    display: flex;
  }

  .chat-tools > button:not(.more) {
    display: none;
  }
}

/* 隐私遮罩：切后台/失去焦点时模糊内容，减少任务切换截图泄露 */
.app.privacy-blur .messages,
.app.privacy-blur .tiles,
.app.privacy-blur .chat-title {
  filter: blur(16px);
  pointer-events: none;
  user-select: none;
}

.messages {
  transition: filter 0.15s ease;
}

/* 视频全屏与画面比例 */
.tile .fs-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: #fff;
  background: rgba(8, 12, 17, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  cursor: pointer;
}

.tile .fs-btn:hover {
  background: rgba(8, 12, 17, 0.82);
}

.tile.screen video {
  object-fit: contain;
}

.tile:fullscreen {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  background: #000;
}

.tile:fullscreen video {
  object-fit: contain;
}

.tile:fullscreen .fs-btn {
  top: calc(12px + env(safe-area-inset-top));
  right: 12px;
  width: 40px;
  height: 40px;
  font-size: 22px;
}

/* 屏幕共享缩放 */
.tile .zoom-btn {
  position: absolute;
  top: 8px;
  right: 44px;
  z-index: 2;
  min-width: 34px;
  height: 30px;
  padding: 0 6px;
  font-size: 13px;
  color: #fff;
  background: rgba(8, 12, 17, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  cursor: pointer;
}

.tile .zoom-btn:hover {
  background: rgba(8, 12, 17, 0.82);
}

.tile.zoomed {
  overflow: hidden;
}

.tile.zoomed video {
  cursor: grab;
  will-change: transform;
}

.tile:fullscreen .zoom-btn {
  top: calc(12px + env(safe-area-inset-top));
  right: 60px;
  height: 40px;
  min-width: 44px;
  font-size: 15px;
}

@media (max-width: 760px) {
  .call-bar {
    flex-wrap: wrap;
  }

  .call-bar button {
    padding: 7px 10px;
  }
}

/* 通话按钮状态与状态提示 */
.call-bar button.on {
  color: #8ff0cf;
  border-color: rgba(57, 211, 163, 0.45);
  background: rgba(57, 211, 163, 0.12);
}

.call-bar button.off {
  color: #ff9a9a;
  border-color: rgba(255, 107, 107, 0.35);
  background: rgba(90, 26, 26, 0.4);
}

.call-status {
  padding: 6px 0 2px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* 图块连接状态 */
.tile .status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #9fb0c6;
  background: rgba(10, 14, 20, 0.55);
  backdrop-filter: blur(2px);
}

.tile.live .status {
  display: none;
}

/* 未读消息红点 */
.conv-unread {
  min-width: 18px;
  height: 18px;
  flex: none;
  padding: 0 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
  background: var(--danger);
  border-radius: 9px;
}

/* 强制开启通知的遮罩 */
.notify-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 11, 16, 0.94);
}

.notify-card {
  width: min(380px, 100%);
  padding: 26px;
  background: #161d26;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.notify-card h2 {
  margin: 0 0 10px;
  font-size: 20px;
}

.notify-card p {
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}

.notify-card .ghost {
  width: 100%;
  margin-top: 10px;
  padding: 11px;
}

/* 群内通话提示条 */
.call-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 16px;
  font-size: 13px;
  color: #8ff0cf;
  background: rgba(57, 211, 163, 0.12);
  border-bottom: 1px solid rgba(57, 211, 163, 0.25);
}

.call-banner button {
  padding: 6px 12px;
  font-size: 12.5px;
  color: #08111f;
  background: var(--accent-2);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.sheet-card {
  max-height: 82vh;
  overflow-y: auto;
}

/* 群聊解散按钮与版本号 */
.destroy-btn {
  flex: none;
  padding: 7px 10px;
  font-size: 12.5px;
  color: #ffb4b4;
  background: rgba(90, 26, 26, 0.45);
  border: 1px solid rgba(255, 107, 107, 0.35);
  border-radius: 9px;
  cursor: pointer;
}

.ver {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  color: #4d5866;
}

.admin-danger {
  padding: 0 12px;
  color: #ffb4b4;
  background: rgba(90, 26, 26, 0.45);
  border: 1px solid rgba(255, 107, 107, 0.35);
  border-radius: 9px;
  cursor: pointer;
}

/* 性能：去掉昂贵的毛玻璃，降低模糊强度 */
.sidebar {
  backdrop-filter: none;
  background: #11161d;
}

.chat-head {
  backdrop-filter: none;
  background: #0e1116;
}

.tile .status {
  backdrop-filter: none;
  background: rgba(10, 14, 20, 0.72);
}

.app.privacy-blur .messages,
.app.privacy-blur .tiles,
.app.privacy-blur .chat-title {
  filter: blur(10px);
}

.foot-note {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #5c6878;
}
