/* =========================================================
   咨询面板 · 设计系统
   深色克制风：细边框、低对比层次、单一强调色
   ========================================================= */

:root {
  --bg: #08090b;
  --bg-soft: #0c0e12;
  --panel: #101318;
  --panel-2: #151920;
  --panel-3: #1a1f28;

  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);

  --text: #e9ecf1;
  --text-dim: #8a909c;
  --text-faint: #565c68;

  --accent: #5b8cff;
  --accent-soft: rgba(91, 140, 255, 0.12);
  --accent-2: #7c5bff;
  --ok: #3dd68c;
  --warn: #f5a524;
  --danger: #f04438;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 24px 64px -16px rgba(0, 0, 0, 0.75);

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(720px 460px at 12% -8%, rgba(91, 140, 255, 0.10), transparent 68%),
    radial-gradient(680px 480px at 92% -4%, rgba(124, 91, 255, 0.08), transparent 68%);
}

::selection {
  background: rgba(91, 140, 255, 0.28);
}

/* ---------------- 滚动条 ---------------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.16);
  background-clip: content-box;
}

/* ---------------- 基础元素 ---------------- */
a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

input,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

svg {
  display: block;
  flex-shrink: 0;
}

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.1s ease;
  white-space: nowrap;
  user-select: none;
}

.btn:hover {
  background: var(--panel-3);
  border-color: var(--line-strong);
}

.btn:active {
  transform: translateY(0.5px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(180deg, #6a97ff 0%, #4f7cf0 100%);
  border-color: rgba(120, 160, 255, 0.5);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.16) inset,
    0 6px 18px -8px rgba(79, 124, 240, 0.9);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #7aa3ff 0%, #5b87f7 100%);
  border-color: rgba(140, 175, 255, 0.62);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-dim);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: transparent;
  color: var(--text);
}

.btn-danger {
  color: #ff8b82;
  border-color: rgba(240, 68, 56, 0.28);
  background: rgba(240, 68, 56, 0.09);
}

.btn-danger:hover {
  background: rgba(240, 68, 56, 0.16);
  border-color: rgba(240, 68, 56, 0.42);
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12.5px;
  gap: 5px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
}

.btn-icon.btn-sm {
  width: 30px;
  height: 30px;
}

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 9, 11, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: linear-gradient(140deg, #5b8cff 0%, #7c5bff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1) inset,
    0 4px 12px -4px rgba(91, 140, 255, 0.7);
}

.brand-mark svg {
  width: 14px;
  height: 14px;
  color: #fff;
}

.brand-sub {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-faint);
  letter-spacing: 0.02em;
  padding-left: 10px;
  margin-left: 2px;
  border-left: 1px solid var(--line);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------------- 大厅 ---------------- */
.lobby {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 26px 24px 72px;
}

.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

/* ---- 整卡状态：绿=在线 红=忙碌 灰=离线 ---- */
.room-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #12151b 0%, #0e1116 100%);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.3, 1),
    border-color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.room-card:hover {
  transform: translateY(-2px);
}

/* 顶部状态色带 */
.room-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.06);
  transition: background 0.2s ease;
}

.room-card[data-status='online'] {
  border-color: rgba(61, 214, 140, 0.42);
  box-shadow: 0 0 0 1px rgba(61, 214, 140, 0.09),
    0 14px 44px -20px rgba(61, 214, 140, 0.6);
}

.room-card[data-status='online']::before {
  background: linear-gradient(90deg, rgba(61, 214, 140, 0) 0%, #3dd68c 30%, #3dd68c 70%, rgba(61, 214, 140, 0) 100%);
}

.room-card[data-status='online']:hover {
  border-color: rgba(61, 214, 140, 0.68);
  box-shadow: 0 0 0 1px rgba(61, 214, 140, 0.16),
    0 20px 52px -18px rgba(61, 214, 140, 0.75);
}

.room-card[data-status='busy'] {
  border-color: rgba(240, 68, 56, 0.42);
  box-shadow: 0 0 0 1px rgba(240, 68, 56, 0.09),
    0 14px 44px -20px rgba(240, 68, 56, 0.55);
}

.room-card[data-status='busy']::before {
  background: linear-gradient(90deg, rgba(240, 68, 56, 0) 0%, #f04438 30%, #f04438 70%, rgba(240, 68, 56, 0) 100%);
}

.room-card[data-status='busy']:hover {
  border-color: rgba(240, 68, 56, 0.68);
  box-shadow: 0 0 0 1px rgba(240, 68, 56, 0.16),
    0 20px 52px -18px rgba(240, 68, 56, 0.7);
}

.room-card[data-status='offline'] {
  opacity: 0.5;
}

.room-card[data-status='offline']:hover {
  opacity: 0.8;
}

.room-cover {
  height: 88px;
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--line);
  flex: none;
}

.room-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 13px 15px 12px;
  flex: 1;
  min-width: 0;
}

.room-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-desc {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.room-desc.placeholder {
  color: var(--text-faint);
}

.room-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-faint);
  letter-spacing: 0.01em;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
  flex: none;
}

.room-card[data-status='online'] .status-pill {
  color: var(--ok);
}

.room-card[data-status='online'] .status-dot {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(61, 214, 140, 0.16);
}

.room-card[data-status='busy'] .status-pill {
  color: var(--danger);
}

.room-card[data-status='busy'] .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(240, 68, 56, 0.16);
}

.room-meta {
  font-size: 11.5px;
  color: var(--text-faint);
  white-space: nowrap;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 72px 24px;
  border-radius: var(--radius);
  border: 1px dashed var(--line-strong);
  background: rgba(255, 255, 255, 0.012);
  text-align: center;
}

.empty-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text-faint);
}

.empty h3 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dim);
}

.empty p {
  font-size: 12.5px;
  color: var(--text-faint);
  max-width: 320px;
}

/* ---------------- 弹窗 ---------------- */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 5, 7, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.16s ease;
}

.modal-mask.show {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal {
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #161a21 0%, #101318 100%);
  box-shadow: var(--shadow-lg);
  animation: riseIn 0.2s cubic-bezier(0.2, 0.8, 0.3, 1);
  overflow: hidden;
}

/* 房间表单：加宽、两列，降低整体高度 */
.modal-room {
  max-width: 860px;
}

.modal-room .modal-head {
  padding: 18px 24px 0;
}

.modal-room .modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 24px;
  align-items: start;
  padding: 16px 24px;
}

.modal-room .modal-foot {
  padding: 12px 24px;
}

.form-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

@media (max-width: 760px) {
  .modal-room .modal-body {
    grid-template-columns: 1fr;
  }
}

.modal-head {
  padding: 22px 24px 0;
  flex: none;
}

.modal-head h2 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.modal-head p {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text-faint);
  line-height: 1.65;
}

.modal-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  min-height: 0;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  flex: none;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.16);
}

/* ---------------- 表单 ---------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.01em;
}

.field .hint {
  font-size: 11.5px;
  color: var(--text-faint);
  line-height: 1.5;
}

.input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  font-size: 13.5px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.input::placeholder {
  color: var(--text-faint);
}

.input:focus {
  border-color: rgba(91, 140, 255, 0.55);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.13);
}

textarea.input {
  height: auto;
  min-height: 76px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.6;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.switch-row:first-of-type {
  border-top: none;
  padding-top: 0;
}

.switch-label {
  font-size: 13px;
  color: var(--text);
}

.switch-desc {
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: 2px;
  line-height: 1.5;
}

.switch {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--line);
  transition: background 0.18s ease, border-color 0.18s ease;
  flex-shrink: 0;
}

.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #9aa1ad;
  transition: transform 0.18s cubic-bezier(0.3, 0.9, 0.4, 1), background 0.18s ease;
}

.switch.on {
  background: rgba(91, 140, 255, 0.85);
  border-color: rgba(120, 160, 255, 0.7);
}

.switch.on::after {
  transform: translateX(16px);
  background: #fff;
}

/* ---------------- 聊天页布局 ---------------- */
.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 244px;
  height: 100vh;
  height: 100dvh;
}

.chat-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  border-right: 1px solid var(--line);
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
  padding: 0 20px 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 9, 11, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  flex-shrink: 0;
}

.chat-head-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.chat-title {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.012em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-sub {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--text-faint);
  font-family: var(--mono);
}

.chat-head-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.conn-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.conn-dot.on {
  background: var(--ok);
  box-shadow: 0 0 8px rgba(61, 214, 140, 0.75);
}

.conn-dot.off {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(240, 68, 56, 0.6);
}

/* ---------------- 消息流 ---------------- */
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 24px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scroll-behavior: smooth;
}

.msg-group {
  display: flex;
  gap: 10px;
  padding: 6px 0;
  max-width: 720px;
}

.msg-group.self {
  flex-direction: row-reverse;
  margin-left: auto;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.01em;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.09) inset;
  user-select: none;
}

.msg-body {
  min-width: 0;
  max-width: calc(100% - 40px);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.msg-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 0 2px;
}

.msg-group.self .msg-meta {
  flex-direction: row-reverse;
}

.msg-author {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
}

.msg-time {
  font-size: 10.5px;
  color: var(--text-faint);
  font-family: var(--mono);
  opacity: 0.8;
}

.bubble {
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 13.8px;
  line-height: 1.62;
  word-break: break-word;
  white-space: pre-wrap;
  background: var(--panel-2);
  border: 1px solid var(--line);
  max-width: 100%;
}

.msg-group.self .bubble {
  background: linear-gradient(180deg, rgba(91, 140, 255, 0.22) 0%, rgba(91, 140, 255, 0.15) 100%);
  border-color: rgba(91, 140, 255, 0.32);
  color: #eef3ff;
}

.bubble img {
  display: block;
  max-width: 100%;
  max-height: 320px;
  width: auto;
  height: auto;
  border-radius: 8px;
  cursor: zoom-in;
  object-fit: contain;
}

.bubble-img {
  padding: 4px;
  background: var(--panel-2);
  align-self: flex-start;
  width: fit-content;
  max-width: min(320px, 100%);
}

.msg-group.self .bubble-img {
  align-self: flex-end;
}

.bubble-voice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 148px;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease;
}

.bubble-voice:hover {
  border-color: var(--line-strong);
}

.voice-play {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.09);
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.bubble-voice:hover .voice-play {
  background: rgba(255, 255, 255, 0.16);
}

.voice-bars {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 20px;
  flex: 1;
}

.voice-bars span {
  display: block;
  width: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.3);
  transition: background 0.12s ease;
}

.bubble-voice.playing .voice-bars span {
  background: rgba(140, 180, 255, 0.9);
}

.voice-dur {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  flex-shrink: 0;
}

/* ---------------- 系统消息 ---------------- */
.sys-msg {
  align-self: center;
  margin: 10px 0;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid var(--line);
}

/* ---------------- 正在输入 ---------------- */
.typing-bar {
  height: 20px;
  padding: 0 24px;
  font-size: 11.5px;
  color: var(--text-faint);
  opacity: 0;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

.typing-bar.show {
  opacity: 1;
}

/* ---------------- 输入区（微信式：空=加号，有字=发送） ---------------- */
.composer {
  position: relative;
  flex-shrink: 0;
  padding: 10px 20px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(8, 9, 11, 0.72);
  backdrop-filter: blur(12px);
}

.composer-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.composer-input {
  flex: 1;
  min-height: 40px;
  max-height: 132px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.32);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.5;
  resize: none;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.composer-input::placeholder {
  color: rgba(138, 144, 156, 0.65);
}

.composer-input:focus {
  border-color: rgba(91, 140, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.1);
}

.circle-btn {
  flex: none;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease,
    box-shadow 0.16s ease, transform 0.16s ease;
}

.circle-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.07);
}

.circle-btn:active {
  transform: scale(0.94);
}

.circle-btn[data-mode='send'] {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px -10px rgba(91, 140, 255, 0.95);
}

.circle-btn[data-mode='send']:hover {
  filter: brightness(1.08);
}

/* 功能面板 */
.attach-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-top: 0;
  transition: max-height 0.24s cubic-bezier(0.2, 0.8, 0.3, 1), opacity 0.18s ease,
    margin-top 0.24s ease;
}

.attach-panel.open {
  max-height: 132px;
  opacity: 1;
  margin-top: 12px;
}

.attach-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-dim);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease,
    transform 0.16s ease;
}

.attach-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line-strong);
  color: var(--text);
  transform: translateY(-1px);
}

.attach-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  flex: none;
}

.attach-icon.accent {
  background: rgba(91, 140, 255, 0.14);
  color: var(--accent);
}

.attach-item:hover .attach-icon {
  background: rgba(255, 255, 255, 0.09);
}

.attach-item:hover .attach-icon.accent {
  background: rgba(91, 140, 255, 0.22);
}

/* 录音条 */
.rec-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(240, 68, 56, 0.32);
  background: rgba(240, 68, 56, 0.07);
}

.rec-panel[hidden] {
  display: none;
}

.rec-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  flex: none;
  animation: recPulse 1.2s ease-in-out infinite;
}

@keyframes recPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.82); }
}

.rec-time {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--danger);
}

.rec-hint {
  flex: 1;
  font-size: 12px;
  color: var(--text-faint);
}

/* ---------------- 录音状态 ---------------- */
.recording-bar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(240, 68, 56, 0.3);
  background: rgba(240, 68, 56, 0.07);
}

.recording-bar.show {
  display: flex;
}

.rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(240, 68, 56, 0.6);
  }
  50% {
    opacity: 0.55;
    box-shadow: 0 0 0 6px rgba(240, 68, 56, 0);
  }
}

.rec-time {
  font-family: var(--mono);
  font-size: 13px;
  color: #ff9a92;
  flex: 1;
}

/* ---------------- 成员栏 ---------------- */
.side {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: rgba(10, 12, 15, 0.5);
}

.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.side-title {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.side-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.member {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: 8px;
  transition: background 0.14s ease;
  position: relative;
}

.member:hover {
  background: rgba(255, 255, 255, 0.04);
}

.member .avatar {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  font-size: 11px;
  position: relative;
}

.member-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.member-status {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  border: 2px solid #0c0e12;
  box-sizing: content-box;
}

.member-status.muted {
  background: var(--warn);
}

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

.member-name {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

.member-tag {
  font-size: 10.5px;
  color: var(--text-faint);
  font-family: var(--mono);
}

.member-call {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  opacity: 0;
  transition: opacity 0.14s ease, background 0.14s ease, color 0.14s ease;
  flex-shrink: 0;
}

.member:hover .member-call {
  opacity: 1;
}

.member-call:hover {
  background: rgba(61, 214, 140, 0.14);
  color: #6fe0ac;
}

.member-call svg {
  width: 15px;
  height: 15px;
}

.member.speaking {
  background: rgba(61, 214, 140, 0.09);
}

.member.speaking .member-status {
  box-shadow: 0 0 0 3px rgba(61, 214, 140, 0.22);
}

/* ---------------- 通话浮层 ---------------- */
.call-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(4, 5, 7, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.call-overlay.show {
  display: flex;
}

.call-panel {
  width: 100%;
  max-width: 340px;
  padding: 32px 28px 24px;
  border-radius: 20px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #171b22 0%, #0f1216 100%);
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: riseIn 0.24s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.call-avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  position: relative;
}

.call-avatar.ringing::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 26px;
  border: 1px solid rgba(91, 140, 255, 0.5);
  animation: ring 1.8s ease-out infinite;
}

@keyframes ring {
  0% {
    opacity: 0.9;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.28);
  }
}

.call-name {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.call-status {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text-dim);
  font-family: var(--mono);
  min-height: 20px;
}

.call-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 26px;
}

.call-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.16s ease, transform 0.1s ease;
  color: #fff;
}

.call-btn:active {
  transform: scale(0.94);
}

.call-btn svg {
  width: 21px;
  height: 21px;
}

.call-btn.mute {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.call-btn.mute:hover {
  background: rgba(255, 255, 255, 0.14);
}

.call-btn.mute.on {
  background: rgba(245, 165, 36, 0.2);
  color: #f5c77a;
}

.call-btn.hang {
  background: linear-gradient(180deg, #ff5f54 0%, #e03a2f 100%);
  box-shadow: 0 8px 20px -8px rgba(224, 58, 47, 0.9);
}

.call-btn.hang:hover {
  background: linear-gradient(180deg, #ff7167 0%, #ec4438 100%);
}

.call-btn.accept {
  background: linear-gradient(180deg, #4ee0a0 0%, #2bbd80 100%);
  box-shadow: 0 8px 20px -8px rgba(43, 189, 128, 0.9);
}

/* ---------------- Toast ---------------- */
.toast-wrap {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(22, 26, 33, 0.96);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  color: var(--text);
  animation: toastIn 0.22s cubic-bezier(0.2, 0.8, 0.3, 1);
  max-width: 420px;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast.out {
  animation: toastOut 0.2s ease forwards;
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.toast-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.toast.err .toast-dot {
  background: var(--danger);
}

.toast.ok .toast-dot {
  background: var(--ok);
}

/* ---------------- 图片查看 ---------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: rgba(0, 0, 0, 0.9);
  cursor: zoom-out;
}

.lightbox.show {
  display: flex;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
}

/* ---------------- 管理后台 ---------------- */
.admin-wrap {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 28px 80px;
}

.gate {
  max-width: 380px;
  margin: 12vh auto 0;
  padding: 32px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #161a21 0%, #101318 100%);
  box-shadow: var(--shadow-lg);
}

.gate h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 6px;
}

.gate p {
  font-size: 12.5px;
  color: var(--text-faint);
  margin-bottom: 22px;
  line-height: 1.65;
}

.gate form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.admin-head h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.admin-head p {
  font-size: 12.5px;
  color: var(--text-faint);
  margin-top: 4px;
}

.table-wrap {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  text-align: left;
  padding: 11px 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.018);
}

.td-name {
  font-weight: 500;
}

.td-id {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: 2px;
}

.td-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
}

.state .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
}

.state.locked .dot {
  background: var(--warn);
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
  }

  .side {
    display: none;
  }

  .page {
    padding: 40px 18px 72px;
  }

  .hero h1 {
    font-size: 28px;
  }

  .topbar {
    padding: 0 16px;
  }

  .messages {
    padding: 16px 14px 8px;
  }

  .composer {
    padding: 10px 12px 14px;
  }

  .chat-head {
    padding: 0 12px 0 16px;
  }
}

@media (max-width: 560px) {
  .room-grid {
    grid-template-columns: 1fr;
  }

  .brand-sub {
    display: none;
  }

  .bubble-img {
    max-width: min(220px, 100%);
  }

  .bubble img {
    max-height: 220px;
  }
}

/* =========================================================
   细节打磨
   ========================================================= */

/* 新消息进场 */
.msg-group.anim {
  animation: msgIn 0.24s cubic-bezier(0.2, 0.8, 0.3, 1);
}

@keyframes msgIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 键盘可访问性 */
:focus-visible {
  outline: 2px solid rgba(91, 140, 255, 0.55);
  outline-offset: 2px;
}

.btn:focus-visible,
.tool-btn:focus-visible,
.send-btn:focus-visible,
.member-call:focus-visible {
  outline-offset: 1px;
}

/* 消息区顶部渐隐，滚动时内容不会硬切 */
.chat-col {
  position: relative;
}

.chat-col::before {
  content: '';
  position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  height: 18px;
  background: linear-gradient(180deg, #08090b 0%, rgba(8, 9, 11, 0) 100%);
  pointer-events: none;
  z-index: 2;
}

/* 通话浮层背景光 */
.call-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(420px 320px at 50% 42%, rgba(91, 140, 255, 0.14), transparent 70%);
}

.call-panel {
  position: relative;
}

/* 输入框占位符更克制 */
.composer-input::placeholder {
  color: rgba(138, 144, 156, 0.65);
}

/* 侧栏底部渐隐 */
.side-list::after {
  content: '';
  display: block;
  height: 12px;
}

/* 表格空行 */
tbody tr {
  transition: background 0.14s ease;
}

/* 小屏时输入区更紧凑 */
@media (max-width: 560px) {

  .composer-hint {
    display: none;
  }
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* =========================================================
   聊天页顶栏 / 设置 / 通话 / 成员
   ========================================================= */

.chat-back {
  width: 32px;
  height: 32px;
  margin-right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  color: var(--text-dim);
  text-decoration: none;
  flex: none;
  transition: background 0.16s ease, color 0.16s ease;
}

.chat-back:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

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

.chat-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-color: var(--line);
}

/* 设置面板动作 */
.set-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
}

.set-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.set-action:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--line-strong);
}

.set-action.danger {
  color: #ff8a80;
}

.set-action.danger:hover {
  border-color: rgba(240, 68, 56, 0.4);
  background: rgba(240, 68, 56, 0.08);
}

/* 选择通话对象 */
.peer-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.peer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.peer-item:hover {
  background: rgba(91, 140, 255, 0.1);
  border-color: rgba(91, 140, 255, 0.35);
}

/* 通话按钮变体 */
.call-btn.danger {
  background: rgba(240, 68, 56, 0.16);
  border-color: rgba(240, 68, 56, 0.42);
  color: #ff8a80;
}

.call-btn.danger:hover {
  background: rgba(240, 68, 56, 0.26);
}

.call-btn.accept {
  background: linear-gradient(135deg, #3dd68c, #22b573);
  border-color: transparent;
  color: #04150d;
}

.call-btn.accept:hover {
  filter: brightness(1.06);
}

.call-btn.plain {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
  color: var(--text);
}

.call-btn.plain:hover {
  background: rgba(255, 255, 255, 0.1);
}

.call-btn-icon {
  display: inline-flex;
  align-items: center;
}

.call-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 28px;
}

/* 成员状态 */
.member.is-self {
  opacity: 0.72;
}

.member.talking {
  background: rgba(61, 214, 140, 0.08);
  border-radius: 10px;
}

.member.talking .member-status {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(61, 214, 140, 0.2);
}

.member.talking .member-tag {
  color: var(--ok);
}

.msg-group.grouped {
  margin-top: -6px;
}

/* =========================================================
   管理后台
   ========================================================= */

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

.admin-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
}

.admin-table { font-size: 12.5px; }

.admin-table thead th {
  padding: 9px 14px;
}

.admin-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tbody tr {
  transition: background 0.14s ease;
}

.admin-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.cell-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.cell-sub {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 1px;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-dim {
  font-size: 12px;
  color: var(--text-faint);
}

.tag {
  display: inline-block;
  padding: 2px 7px;
  margin-right: 4px;
  border-radius: 5px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  white-space: nowrap;
}

.tag-warn {
  background: rgba(245, 165, 36, 0.14);
  color: var(--warn);
}

.row-actions {
  display: flex;
  gap: 3px;
  justify-content: flex-end;
}

.btn-ghost-danger {
  color: #ff8a80;
}

.btn-ghost-danger:hover {
  background: rgba(240, 68, 56, 0.1);
  border-color: rgba(240, 68, 56, 0.32);
  color: #ff9a90;
}

.status-pill[data-status='online'] {
  color: var(--ok);
}

.status-pill[data-status='online'] .status-dot {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(61, 214, 140, 0.16);
}

.status-pill[data-status='busy'] {
  color: var(--danger);
}

.status-pill[data-status='busy'] .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(240, 68, 56, 0.16);
}

.col-status { width: 84px; }
.col-num { width: 70px; }
.col-flag { width: 132px; }
.col-act { width: 244px; text-align: right; }

/* 封面设置 */
.cover-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.cover-preview {
  width: 106px;
  height: 64px;
  flex: none;
  border-radius: 8px;
  border: 1px dashed var(--line-strong);
  background: rgba(255, 255, 255, 0.02) center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-faint);
}

.cover-preview.has-image {
  border-style: solid;
  border-color: var(--line);
}

.cover-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.link-row {
  display: flex;
  gap: 8px;
}

.link-row .input {
  flex: 1;
  font-family: var(--mono);
  font-size: 12px;
}

.textarea {
  resize: vertical;
  min-height: 74px;
  line-height: 1.6;
  padding-top: 10px;
}

/* 小屏隐藏侧栏，顶部显示人数 */
@media (max-width: 820px) {
  .side {
    display: none;
  }
}


/* =========================================================
   房主 / 资料 / 分享
   ========================================================= */
.avatar.has-img {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: transparent;
}

.avatar-lg {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  font-size: 18px;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-actions {
  min-width: 0;
}

.profile-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 5px;
}

.owner-box {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.owner-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tag-owner {
  background: rgba(245, 165, 36, 0.16);
  color: var(--warn);
}

.owner-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 2px;
}

/* 成员行里的房主操作 */
.member-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.member-mod {
  font-size: 10.5px;
  line-height: 1;
  padding: 5px 6px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-faint);
  opacity: 0;
  transition: opacity 0.14s ease, background 0.14s ease, color 0.14s ease;
}

.member:hover .member-mod {
  opacity: 1;
}

.member-mod:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.member-mod.danger {
  color: #ff8a80;
}

.member-mod.danger:hover {
  background: rgba(240, 68, 56, 0.1);
}

.member-name .tag {
  margin-left: 4px;
  padding: 1px 5px;
  font-size: 10px;
  vertical-align: middle;
}

@media (hover: none) {
  .member-call,
  .member-mod {
    opacity: 1;
  }
}

/* 分享弹窗 */
.modal-share {
  max-width: 760px;
}

.share-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 22px;
  align-items: start;
}

.share-qr {
  width: 220px;
  height: 220px;
  padding: 10px;
  border-radius: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111;
  font-size: 12px;
  text-align: center;
}

.qr-canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.share-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 640px) {
  .share-body {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .share-info {
    width: 100%;
  }

  .share-qr {
    width: 200px;
    height: 200px;
  }
}


/* 隐藏数字输入框的白色原生步进按钮，避免在深色主题里突兀 */
input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type='number'] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.call-avatar.has-img {
  background-size: cover;
  background-position: center;
}


.gate-owner {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#gateOwnerToggle {
  align-self: flex-start;
  color: var(--text-faint);
  padding-left: 0;
}

#gateOwnerToggle:hover {
  color: var(--text);
}

/* 历史消息下拉 */
select.input {
  color-scheme: dark;
  cursor: pointer;
  padding-right: 32px;
}

select.input option {
  background: #161a21;
  color: var(--text);
}

/* 站点品牌设置 */
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 7px;
  display: block;
}

.brand-setting-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-preview {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(140deg, #5b8cff 0%, #7c5bff 100%);
  color: #fff;
}

.brand-preview svg {
  width: 24px;
  height: 24px;
}

.brand-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-preview .cell-dim {
  background: rgba(0, 0, 0, 0.18);
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.brand-setting-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}


/* 房间卡片：图片改成左侧固定缩略图，不再由封面决定卡片高度 */
.room-card {
  flex-direction: row;
  align-items: stretch;
  min-height: 96px;
}

.room-thumb {
  width: 92px;
  flex: none;
  border-right: 1px solid var(--line);
  background-color: rgba(255, 255, 255, 0.025);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 10.5px;
}

.room-thumb span {
  opacity: 0.55;
}

.room-body {
  justify-content: center;
  padding: 12px 14px;
}

.room-desc {
  -webkit-line-clamp: 2;
}


/* 房主黑名单 */
.owner-banned {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.banned-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 130px;
  overflow-y: auto;
}

.banned-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 12px;
  color: var(--text-dim);
}

.banned-item .btn {
  height: 22px;
  padding: 0 7px;
  font-size: 11px;
}

/* 房主在成员列表里始终显示操作按钮 */
.member.owner-view .member-mod {
  opacity: 1;
}

/* 房主视角成员行：操作按钮放到第二行，避免昵称被挤掉 */
.member.owner-view {
  flex-wrap: wrap;
  row-gap: 4px;
}

.member.owner-view .member-actions {
  width: 100%;
  justify-content: flex-end;
  margin-top: 2px;
}


.admin-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 房间卡片右侧进入按钮 + 满员/锁定状态 */
.room-body {
  padding-right: 52px;
}

.room-enter {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  z-index: 2;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    box-shadow 0.15s ease, transform 0.15s ease;
}

.room-enter:hover {
  transform: translateY(-50%) scale(1.08);
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
}

.room-card[data-status='online'] .room-enter {
  color: #78e8b4;
  border-color: rgba(61, 214, 140, 0.42);
  background: rgba(61, 214, 140, 0.13);
  box-shadow: 0 0 14px -2px rgba(61, 214, 140, 0.65);
}

.room-card[data-status='online'] .room-enter:hover {
  background: rgba(61, 214, 140, 0.22);
  color: #b8ffdc;
}

.room-card[data-status='busy'] .room-enter,
.room-card[data-status='full'] .room-enter,
.room-card[data-status='locked'] .room-enter {
  color: #ff9a90;
  border-color: rgba(240, 68, 56, 0.45);
  background: rgba(240, 68, 56, 0.13);
  box-shadow: 0 0 14px -2px rgba(240, 68, 56, 0.55);
}

.room-card[data-status='busy'] .room-enter:hover,
.room-card[data-status='full'] .room-enter:hover,
.room-card[data-status='locked'] .room-enter:hover {
  background: rgba(240, 68, 56, 0.22);
  color: #ffc2bc;
}

.room-card[data-status='offline'] .room-enter {
  color: var(--text-faint);
  opacity: 0.7;
}

.room-card[data-status='full'],
.room-card[data-status='locked'] {
  border-color: rgba(240, 68, 56, 0.42);
  box-shadow: 0 0 0 1px rgba(240, 68, 56, 0.09),
    0 14px 44px -20px rgba(240, 68, 56, 0.55);
}

.room-card[data-status='full']::before,
.room-card[data-status='locked']::before {
  background: linear-gradient(90deg, rgba(240, 68, 56, 0) 0%, #f04438 30%, #f04438 70%, rgba(240, 68, 56, 0) 100%);
}

.room-card[data-status='full']:hover,
.room-card[data-status='locked']:hover {
  border-color: rgba(240, 68, 56, 0.68);
  box-shadow: 0 0 0 1px rgba(240, 68, 56, 0.16),
    0 20px 52px -18px rgba(240, 68, 56, 0.7);
}

.room-card[data-status='full'] .status-pill,
.room-card[data-status='locked'] .status-pill {
  color: var(--danger);
}

.room-card[data-status='full'] .status-dot,
.room-card[data-status='locked'] .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(240, 68, 56, 0.16);
}

/* 大厅卡片描述只占一行，保持卡片紧凑 */
.room-body .room-desc {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: unset;
  min-height: 0;
}


/* =========================================================
   通话悬浮窗：不遮挡聊天，可最小化
   ========================================================= */
.call-overlay {
  inset: auto 18px 86px auto;
  width: 300px;
  max-width: calc(100vw - 24px);
  height: auto;
  z-index: 90;
  display: none;
  align-items: flex-end;
  justify-content: flex-end;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  pointer-events: none;
}

.call-overlay.show {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.call-overlay::before {
  display: none;
}

.call-panel {
  width: 100%;
  max-width: none;
  padding: 20px 18px 16px;
  border-radius: 16px;
  pointer-events: auto;
  text-align: center;
  transition: width 0.18s ease, padding 0.18s ease, border-radius 0.18s ease;
}

.call-panel .call-avatar {
  width: 54px;
  height: 54px;
  margin: 0 auto 10px;
  border-radius: 15px;
  font-size: 20px;
}

.call-panel .call-name {
  font-size: 15px;
}

.call-state {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-dim);
}

.call-timer {
  margin-top: 2px;
  font-size: 15px;
  font-family: var(--mono);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.call-overlay .call-actions {
  margin-top: 16px;
  gap: 10px;
}

.call-overlay .call-btn {
  width: 42px;
  height: 42px;
}

.call-min {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  background: transparent;
  transition: background 0.14s ease, color 0.14s ease;
  z-index: 2;
}

.call-min:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

/* 最小化后变成一条小悬浮条 */
.call-panel.minimized {
  width: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 999px;
}

.call-panel.minimized .call-avatar,
.call-panel.minimized .call-name,
.call-panel.minimized .call-state {
  display: none;
}

.call-panel.minimized .call-timer {
  margin: 0;
  font-size: 12px;
  color: var(--text-dim);
}

.call-panel.minimized .call-actions {
  margin: 0;
  gap: 6px;
}

.call-panel.minimized .call-btn {
  width: 32px;
  height: 32px;
}

.call-panel.minimized .call-btn svg {
  width: 16px;
  height: 16px;
}

.call-panel.minimized .call-min {
  position: static;
  width: 22px;
  height: 22px;
}

@media (max-width: 560px) {
  .call-overlay {
    right: 10px;
    bottom: 78px;
    width: calc(100vw - 20px);
  }
}

/* 通话按钮：图标在上、文字在下，避免窄面板里文字竖排 */
.call-overlay .call-btn {
  width: 48px;
  height: 48px;
  flex-direction: column;
  gap: 2px;
  font-size: 10px;
  line-height: 1;
}

.call-overlay .call-btn span:last-child {
  white-space: nowrap;
}

.call-panel.minimized .call-btn {
  width: 32px;
  height: 32px;
}

.call-panel.minimized .call-btn span:last-child {
  display: none;
}

.call-panel.minimized .call-btn svg {
  width: 16px;
  height: 16px;
}


/* 画中画按钮 */
.call-pip {
  position: absolute;
  top: 8px;
  right: 36px;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  background: transparent;
  transition: background 0.14s ease, color 0.14s ease;
  z-index: 2;
}

.call-pip:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.call-panel.minimized .call-pip {
  display: none !important;
}


/* 访问日志弹窗 */
.modal-log {
  max-width: 960px;
}

.log-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.log-toolbar .input {
  width: 160px;
  height: 32px;
  font-size: 12.5px;
}

.log-list {
  max-height: 58vh;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.18);
}

.log-item {
  display: grid;
  grid-template-columns: 138px 150px 1fr 120px;
  gap: 6px 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  align-items: start;
}

.log-item:last-child {
  border-bottom: none;
}

.log-time {
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 11px;
  white-space: nowrap;
}

.log-type {
  color: var(--text-dim);
  font-weight: 500;
}

.log-item.fail .log-type {
  color: var(--danger);
}

.log-main {
  min-width: 0;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-main .log-room {
  color: var(--text-faint);
  margin-left: 6px;
}

.log-ip {
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.log-reason {
  grid-column: 1 / -1;
  color: var(--danger);
  font-size: 11.5px;
}

.log-detail {
  grid-column: 1 / -1;
  color: var(--text-faint);
  font-size: 11px;
}

.log-ua {
  grid-column: 1 / -1;
  color: var(--text-faint);
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.85;
}

.log-empty {
  padding: 28px;
  text-align: center;
  color: var(--text-faint);
  font-size: 12.5px;
}

@media (max-width: 720px) {
  .log-item {
    grid-template-columns: 1fr;
  }

  .log-main,
  .log-ip {
    white-space: normal;
  }
}

.col-act {
  width: 280px;
}

/* =========================================================
   iOS Safari / Android 兼容性
   ========================================================= */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overscroll-behavior-y: none;
}

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

.messages,
.side-list {
  -webkit-overflow-scrolling: touch;
}

button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}

button,
[role='button'] {
  touch-action: manipulation;
}

@media (max-width: 560px) {
  /* iOS 聚焦小于 16px 的输入框会自动放大页面，这里统一到 16px */
  input,
  textarea,
  select {
    font-size: 16px;
  }
}

/* 表格在窄屏可横向滚动，避免操作按钮被裁掉 */
.table-wrap {
  overflow-x: auto;
}


/* IP 黑名单 */
.admin-bar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.log-ip {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.log-ip > span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.log-ip-ban {
  flex: none;
  font-size: 10px;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 4px;
  border: 1px solid rgba(240, 68, 56, 0.3);
  color: #ff9a90;
  background: rgba(240, 68, 56, 0.08);
  cursor: pointer;
}

.log-ip-ban:hover {
  background: rgba(240, 68, 56, 0.16);
}

.log-item {
  grid-template-columns: 138px 150px 1fr 190px;
}

.ip-ban-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 50vh;
  overflow-y: auto;
}

.ip-ban-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.ip-ban-info {
  min-width: 0;
}

.ip-ban-ip {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
}

.ip-ban-meta {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-faint);
}

.ip-ban-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-faint);
  font-size: 12.5px;
}

/* 小黑屋 */
.blackhole {
  margin-top: 26px;
}

.blackhole .admin-bar {
  margin-bottom: 10px;
}

.blackhole-table .col-act {
  width: 110px;
  text-align: right;
}

.blackhole-table .ban-ip {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text);
}

.blackhole-table .ban-time,
.blackhole-table .ban-by {
  font-size: 11.5px;
  color: var(--text-faint);
  white-space: nowrap;
}

.blackhole-table .ban-source {
  font-size: 12px;
  color: var(--text-dim);
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blackhole-empty {
  padding: 26px;
  text-align: center;
  color: var(--text-faint);
  font-size: 12.5px;
}

#ipBanCount {
  display: inline-block;
  min-width: 16px;
  padding: 0 4px;
  margin-left: 2px;
  border-radius: 8px;
  background: rgba(240, 68, 56, 0.14);
  color: #ff9a90;
  font-size: 10.5px;
  line-height: 16px;
  text-align: center;
}
