/* ========== 官机云聊 - 液态玻璃全局样式 (响应式 + 动画) ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-primary: #e8edf2;
  --bg-gradient: linear-gradient(135deg, #c3d5e8 0%, #dce6f0 30%, #e8edf2 50%, #d5e0eb 70%, #bed2e6 100%);
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.7);
  --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.12);
  --glass-hover: rgba(255, 255, 255, 0.75);
  --text-primary: #1a1a2e;
  --text-secondary: #5a6070;
  --text-muted: #9aa0b0;
  --accent: #12b7f5;
  --accent-hover: #0ea5de;
  --accent-light: rgba(18, 183, 245, 0.12);
  --danger: #f56c6c;
  --success: #67c23a;
  --radius: 16px;
  --radius-sm: 10px;
  --blur: 20px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-width: 280px;
}

html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  background: var(--bg-gradient);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========== 背景动态光斑 ========== */
body::before {
  content: '';
  position: fixed;
  top: -15%;
  left: -10%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(18, 183, 245, 0.15) 0%, transparent 70%);
  pointer-events: none;
  -webkit-animation: float1 8s ease-in-out infinite;
  -moz-animation: float1 8s ease-in-out infinite;
  animation: float1 8s ease-in-out infinite;
  will-change: transform;
}

body::after {
  content: '';
  position: fixed;
  bottom: -10%;
  right: -5%;
  width: 50%;
  height: 50%;
  background: radial-gradient(circle, rgba(120, 100, 255, 0.1) 0%, transparent 70%);
  pointer-events: none;
  -webkit-animation: float2 10s ease-in-out infinite;
  -moz-animation: float2 10s ease-in-out infinite;
  animation: float2 10s ease-in-out infinite;
  will-change: transform;
}

@-webkit-keyframes float1 {
  0%, 100% { -webkit-transform: translate(0, 0) scale(1); transform: translate(0, 0) scale(1); }
  50% { -webkit-transform: translate(30px, -20px) scale(1.1); transform: translate(30px, -20px) scale(1.1); }
}
@-moz-keyframes float1 {
  0%, 100% { -moz-transform: translate(0, 0) scale(1); transform: translate(0, 0) scale(1); }
  50% { -moz-transform: translate(30px, -20px) scale(1.1); transform: translate(30px, -20px) scale(1.1); }
}
@keyframes float1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -20px) scale(1.1); }
}

@-webkit-keyframes float2 {
  0%, 100% { -webkit-transform: translate(0, 0) scale(1); transform: translate(0, 0) scale(1); }
  50% { -webkit-transform: translate(-20px, 30px) scale(1.08); transform: translate(-20px, 30px) scale(1.08); }
}
@-moz-keyframes float2 {
  0%, 100% { -moz-transform: translate(0, 0) scale(1); transform: translate(0, 0) scale(1); }
  50% { -moz-transform: translate(-20px, 30px) scale(1.08); transform: translate(-20px, 30px) scale(1.08); }
}
@keyframes float2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-20px, 30px) scale(1.08); }
}

/* ========== 页面切换过渡 ========== */
.page-enter {
  -webkit-animation: pageIn 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
  -moz-animation: pageIn 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
  animation: pageIn 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.page-exit {
  -webkit-animation: pageOut 0.25s cubic-bezier(0.55, 0.06, 0.68, 0.19);
  -moz-animation: pageOut 0.25s cubic-bezier(0.55, 0.06, 0.68, 0.19);
  animation: pageOut 0.25s cubic-bezier(0.55, 0.06, 0.68, 0.19);
}

@-webkit-keyframes pageIn {
  from { opacity: 0; -webkit-transform: scale(0.97) translateY(6px); transform: scale(0.97) translateY(6px); }
  to { opacity: 1; -webkit-transform: scale(1) translateY(0); transform: scale(1) translateY(0); }
}
@-moz-keyframes pageIn {
  from { opacity: 0; -moz-transform: scale(0.97) translateY(6px); transform: scale(0.97) translateY(6px); }
  to { opacity: 1; -moz-transform: scale(1) translateY(0); transform: scale(1) translateY(0); }
}
@keyframes pageIn {
  from { opacity: 0; transform: scale(0.97) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@-webkit-keyframes pageOut {
  from { opacity: 1; -webkit-transform: scale(1); transform: scale(1); }
  to { opacity: 0; -webkit-transform: scale(0.97); transform: scale(0.97); }
}
@-moz-keyframes pageOut {
  from { opacity: 1; -moz-transform: scale(1); transform: scale(1); }
  to { opacity: 0; -moz-transform: scale(0.97); transform: scale(0.97); }
}
@keyframes pageOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.97); }
}

/* ========== 液态玻璃卡片 ========== */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
  -webkit-transition: all var(--transition);
  -moz-transition: all var(--transition);
  transition: all var(--transition);
  will-change: transform, box-shadow;
}

.glass-card:hover {
  background: var(--glass-hover);
  box-shadow: 0 12px 40px rgba(31, 38, 135, 0.18);
}

/* ========== 输入框 ========== */
.glass-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  -webkit-transition: all var(--transition);
  -moz-transition: all var(--transition);
  transition: all var(--transition);
  font-family: inherit;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.glass-input::placeholder {
  color: var(--text-muted);
  opacity: 1;
}
.glass-input::-webkit-input-placeholder { color: var(--text-muted); }
.glass-input::-moz-placeholder { color: var(--text-muted); opacity: 1; }
.glass-input:-ms-input-placeholder { color: var(--text-muted); }

.glass-input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.65);
  box-shadow: 0 0 0 3px var(--accent-light);
  -webkit-transform: translateY(-1px);
  -moz-transform: translateY(-1px);
  transform: translateY(-1px);
}

/* ========== 按钮系统 ========== */
.glass-btn {
  padding: 12px 28px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  -webkit-transition: all var(--transition);
  -moz-transition: all var(--transition);
  transition: all var(--transition);
  font-family: inherit;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* 按钮波纹 */
.glass-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 10%, transparent 10%);
  background-position: center;
  -webkit-transform: scale(10);
  -moz-transform: scale(10);
  transform: scale(10);
  opacity: 0;
  -webkit-transition: transform 0.5s, opacity 0.6s;
  -moz-transition: transform 0.5s, opacity 0.6s;
  transition: transform 0.5s, opacity 0.6s;
  pointer-events: none;
}
.glass-btn:active::after {
  -webkit-transform: scale(0);
  -moz-transform: scale(0);
  transform: scale(0);
  opacity: 0.4;
  -webkit-transition: 0s;
  -moz-transition: 0s;
  transition: 0s;
}

/* 按钮光泽扫过 */
.glass-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  -webkit-transition: left 0.5s;
  -moz-transition: left 0.5s;
  transition: left 0.5s;
}
.glass-btn:hover::before { left: 100%; }
.glass-btn:hover {
  background: var(--accent-hover);
  -webkit-transform: translateY(-1px);
  -moz-transform: translateY(-1px);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(18, 183, 245, 0.35);
}
.glass-btn:active {
  -webkit-transform: translateY(0) scale(0.98);
  -moz-transform: translateY(0) scale(0.98);
  transform: translateY(0) scale(0.98);
}
.glass-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  -webkit-transform: none;
  -moz-transform: none;
  transform: none;
  box-shadow: none;
}

.glass-btn-outline {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}
.glass-btn-outline:hover {
  background: var(--accent-light);
  color: var(--accent-hover);
}

/* ========== 登录页 ========== */
.login-container {
  width: 420px;
  max-width: 92vw;
  padding: 40px 36px;
  z-index: 1;
  -webkit-animation: loginSlideUp 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
  -moz-animation: loginSlideUp 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
  animation: loginSlideUp 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}

@-webkit-keyframes loginSlideUp {
  from { opacity: 0; -webkit-transform: translateY(24px) scale(0.96); transform: translateY(24px) scale(0.96); }
  to { opacity: 1; -webkit-transform: translateY(0) scale(1); transform: translateY(0) scale(1); }
}
@-moz-keyframes loginSlideUp {
  from { opacity: 0; -moz-transform: translateY(24px) scale(0.96); transform: translateY(24px) scale(0.96); }
  to { opacity: 1; -moz-transform: translateY(0) scale(1); transform: translateY(0) scale(1); }
}
@keyframes loginSlideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo {
  width: 64px;
  height: 64px;
  background: var(--accent);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 8px 24px rgba(18, 183, 245, 0.3);
  -webkit-animation: logoPulse 3s ease-in-out infinite;
  -moz-animation: logoPulse 3s ease-in-out infinite;
  animation: logoPulse 3s ease-in-out infinite;
}

@-webkit-keyframes logoPulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(18, 183, 245, 0.3); }
  50% { box-shadow: 0 8px 36px rgba(18, 183, 245, 0.45); }
}
@-moz-keyframes logoPulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(18, 183, 245, 0.3); }
  50% { box-shadow: 0 8px 36px rgba(18, 183, 245, 0.45); }
}
@keyframes logoPulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(18, 183, 245, 0.3); }
  50% { box-shadow: 0 8px 36px rgba(18, 183, 245, 0.45); }
}

.login-logo svg {
  width: 36px;
  height: 36px;
  fill: #fff;
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

.form-group {
  margin-bottom: 18px;
  -webkit-animation: formFadeIn 0.4s ease-out backwards;
  -moz-animation: formFadeIn 0.4s ease-out backwards;
  animation: formFadeIn 0.4s ease-out backwards;
}
.form-group:nth-child(1) { -webkit-animation-delay: 0.1s; -moz-animation-delay: 0.1s; animation-delay: 0.1s; }
.form-group:nth-child(2) { -webkit-animation-delay: 0.2s; -moz-animation-delay: 0.2s; animation-delay: 0.2s; }
.form-group:nth-child(3) { -webkit-animation-delay: 0.3s; -moz-animation-delay: 0.3s; animation-delay: 0.3s; }

@-webkit-keyframes formFadeIn {
  from { opacity: 0; -webkit-transform: translateX(-8px); transform: translateX(-8px); }
  to { opacity: 1; -webkit-transform: translateX(0); transform: translateX(0); }
}
@-moz-keyframes formFadeIn {
  from { opacity: 0; -moz-transform: translateX(-8px); transform: translateX(-8px); }
  to { opacity: 1; -moz-transform: translateX(0); transform: translateX(0); }
}
@keyframes formFadeIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
  display: none;
  -webkit-animation: errorShake 0.4s ease;
  -moz-animation: errorShake 0.4s ease;
  animation: errorShake 0.4s ease;
}
.form-error.show { display: block; }

@-webkit-keyframes errorShake {
  0%, 100% { -webkit-transform: translateX(0); transform: translateX(0); }
  25% { -webkit-transform: translateX(-4px); transform: translateX(-4px); }
  75% { -webkit-transform: translateX(4px); transform: translateX(4px); }
}
@-moz-keyframes errorShake {
  0%, 100% { -moz-transform: translateX(0); transform: translateX(0); }
  25% { -moz-transform: translateX(-4px); transform: translateX(-4px); }
  75% { -moz-transform: translateX(4px); transform: translateX(4px); }
}
@keyframes errorShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.login-btn {
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  font-size: 16px;
}

.login-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-muted);
}
.login-footer a {
  color: var(--accent);
  text-decoration: none;
  -webkit-transition: color 0.2s;
  -moz-transition: color 0.2s;
  transition: color 0.2s;
}
.login-footer a:hover {
  text-decoration: underline;
}

/* ========== 聊天页布局 ========== */
.chat-body {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  width: 100vw;
  height: 100vh;
  height: -webkit-fill-available;
  height: 100dvh;
  padding: 0;
  overflow: hidden;
}

.chat-container {
  display: flex;
  width: 100%;
  height: 100%;
  padding: 12px;
  gap: 12px;
}

/* ========== 侧边栏 ========== */
.chat-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  -moz-transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), -moz-transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 10;
}

/* 侧边栏遮罩（移动端） */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 9;
  -webkit-animation: overlayIn 0.3s ease;
  -moz-animation: overlayIn 0.3s ease;
  animation: overlayIn 0.3s ease;
}

@-webkit-keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@-moz-keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.sidebar-header {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.sidebar-avatar {
  width: 40px;
  height: 40px;
  background: var(--accent);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar-avatar svg {
  width: 22px;
  height: 22px;
  fill: #fff;
}

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

.sidebar-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-status {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  -webkit-transition: background 0.3s;
  -moz-transition: background 0.3s;
  transition: background 0.3s;
}
.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 6px rgba(103, 194, 58, 0.5);
  -webkit-animation: dotPulse 2s ease-in-out infinite;
  -moz-animation: dotPulse 2s ease-in-out infinite;
  animation: dotPulse 2s ease-in-out infinite;
}
.status-dot.offline { background: var(--text-muted); }
.status-dot.error { background: var(--danger); }

@-webkit-keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 4px rgba(103, 194, 58, 0.4); }
  50% { box-shadow: 0 0 10px rgba(103, 194, 58, 0.7); }
}
@-moz-keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 4px rgba(103, 194, 58, 0.4); }
  50% { box-shadow: 0 0 10px rgba(103, 194, 58, 0.7); }
}
@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 4px rgba(103, 194, 58, 0.4); }
  50% { box-shadow: 0 0 10px rgba(103, 194, 58, 0.7); }
}

.sidebar-search {
  padding: 10px 14px;
}
.sidebar-search .glass-input {
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 8px;
}

.group-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 8px;
  -webkit-overflow-scrolling: touch;
}
.group-list::-webkit-scrollbar { width: 4px; }
.group-list::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.1);
  border-radius: 2px;
}
.group-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.1) transparent;
}

.group-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  -webkit-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  -moz-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  gap: 10px;
  margin-bottom: 2px;
  position: relative;
  -webkit-animation: groupItemIn 0.35s ease-out backwards;
  -moz-animation: groupItemIn 0.35s ease-out backwards;
  animation: groupItemIn 0.35s ease-out backwards;
}
.group-item:hover {
  background: rgba(18, 183, 245, 0.08);
  -webkit-transform: translateX(2px);
  -moz-transform: translateX(2px);
  transform: translateX(2px);
}
.group-item.active {
  background: var(--accent-light);
  -webkit-transform: translateX(3px);
  -moz-transform: translateX(3px);
  transform: translateX(3px);
}

@-webkit-keyframes groupItemIn {
  from { opacity: 0; -webkit-transform: translateX(-12px); transform: translateX(-12px); }
  to { opacity: 1; -webkit-transform: translateX(0); transform: translateX(0); }
}
@-moz-keyframes groupItemIn {
  from { opacity: 0; -moz-transform: translateX(-12px); transform: translateX(-12px); }
  to { opacity: 1; -moz-transform: translateX(0); transform: translateX(0); }
}
@keyframes groupItemIn {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

.group-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

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

.group-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========== 聊天主区域 ========== */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  -webkit-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  -moz-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-header {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  -webkit-transition: padding 0.3s;
  -moz-transition: padding 0.3s;
  transition: padding 0.3s;
}

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

/* 返回按钮（移动端） */
.back-btn {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.04);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  -webkit-transition: background 0.2s;
  -moz-transition: background 0.2s;
  transition: background 0.2s;
  color: var(--text-secondary);
}
.back-btn:active { background: rgba(0,0,0,0.1); }
.back-btn svg { width: 20px; height: 20px; }

.chat-header-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-header-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-header-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.chat-header-actions .glass-btn {
  padding: 8px 16px;
  font-size: 13px;
}

/* ========== 消息区域 ========== */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  -webkit-overflow-scrolling: touch;
}
.chat-messages::-webkit-scrollbar { width: 5px; }
.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.08);
  border-radius: 3px;
}
.chat-messages {
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.08) transparent;
}

/* 消息气泡 */
.message-row {
  display: flex;
  gap: 10px;
  max-width: 75%;
  -webkit-animation: msgIn 0.35s cubic-bezier(0.22, 0.61, 0.36, 1) backwards;
  -moz-animation: msgIn 0.35s cubic-bezier(0.22, 0.61, 0.36, 1) backwards;
  animation: msgIn 0.35s cubic-bezier(0.22, 0.61, 0.36, 1) backwards;
}

@-webkit-keyframes msgIn {
  from { opacity: 0; -webkit-transform: translateY(12px) scale(0.95); transform: translateY(12px) scale(0.95); }
  to { opacity: 1; -webkit-transform: translateY(0) scale(1); transform: translateY(0) scale(1); }
}
@-moz-keyframes msgIn {
  from { opacity: 0; -moz-transform: translateY(12px) scale(0.95); transform: translateY(12px) scale(0.95); }
  to { opacity: 1; -moz-transform: translateY(0) scale(1); transform: translateY(0) scale(1); }
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.message-row.self {
  align-self: flex-end;
  flex-direction: row-reverse;
  -webkit-animation-name: msgInSelf;
  -moz-animation-name: msgInSelf;
  animation-name: msgInSelf;
}

@-webkit-keyframes msgInSelf {
  from { opacity: 0; -webkit-transform: translateY(12px) scale(0.95); transform: translateY(12px) scale(0.95); }
  to { opacity: 1; -webkit-transform: translateY(0) scale(1); transform: translateY(0) scale(1); }
}
@-moz-keyframes msgInSelf {
  from { opacity: 0; -moz-transform: translateY(12px) scale(0.95); transform: translateY(12px) scale(0.95); }
  to { opacity: 1; -moz-transform: translateY(0) scale(1); transform: translateY(0) scale(1); }
}
@keyframes msgInSelf {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
  font-weight: 500;
}

.message-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.message-sender {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 3px;
  padding: 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.message-row.self .message-sender { text-align: right; }

.message-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  position: relative;
  -webkit-transition: all 0.2s;
  -moz-transition: all 0.2s;
  transition: all 0.2s;
}

.message-row:not(.self) .message-bubble {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-top-left-radius: 4px;
}
.message-row.self .message-bubble {
  background: var(--accent);
  color: #fff;
  border-top-right-radius: 4px;
}

.message-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  padding: 0 4px;
}
.message-row.self .message-time { text-align: right; }

/* 系统消息 */
.system-msg {
  text-align: center;
  padding: 8px;
  font-size: 12px;
  color: var(--text-muted);
  max-width: 100%;
  -webkit-animation: sysMsgIn 0.3s ease-out;
  -moz-animation: sysMsgIn 0.3s ease-out;
  animation: sysMsgIn 0.3s ease-out;
}
@-webkit-keyframes sysMsgIn {
  from { opacity: 0; -webkit-transform: scale(0.9); transform: scale(0.9); }
  to { opacity: 1; -webkit-transform: scale(1); transform: scale(1); }
}
@-moz-keyframes sysMsgIn {
  from { opacity: 0; -moz-transform: scale(0.9); transform: scale(0.9); }
  to { opacity: 1; -moz-transform: scale(1); transform: scale(1); }
}
@keyframes sysMsgIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
.system-msg span {
  background: rgba(0,0,0,0.04);
  padding: 4px 12px;
  border-radius: 10px;
}

/* ========== 消息输入区域 ========== */
.chat-input-area {
  padding: 12px 16px;
  border-top: 1px solid rgba(0,0,0,0.06);
  flex-shrink: 0;
  -webkit-transition: padding 0.3s;
  -moz-transition: padding 0.3s;
  transition: padding 0.3s;
}

.input-toolbar {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.toolbar-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  -webkit-transition: all 0.2s;
  -moz-transition: all 0.2s;
  transition: all 0.2s;
}
.toolbar-btn:hover {
  background: rgba(0,0,0,0.05);
  color: var(--accent);
}
.toolbar-btn svg { width: 18px; height: 18px; }

.input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.message-input {
  flex: 1;
  resize: none;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
  line-height: 1.5;
  min-height: 42px;
  max-height: 120px;
  -webkit-transition: all var(--transition);
  -moz-transition: all var(--transition);
  transition: all var(--transition);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
.message-input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.65);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.message-input::placeholder {
  color: var(--text-muted);
  opacity: 1;
}
.message-input::-webkit-input-placeholder { color: var(--text-muted); }
.message-input::-moz-placeholder { color: var(--text-muted); opacity: 1; }
.message-input:-ms-input-placeholder { color: var(--text-muted); }

.send-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  -webkit-transition: all 0.2s;
  -moz-transition: all 0.2s;
  transition: all 0.2s;
}
.send-btn:hover {
  background: var(--accent-hover);
  -webkit-transform: scale(1.08);
  -moz-transform: scale(1.08);
  transform: scale(1.08);
}
.send-btn:active {
  -webkit-transform: scale(0.93);
  -moz-transform: scale(0.93);
  transform: scale(0.93);
}
.send-btn svg { width: 20px; height: 20px; }

/* ========== 空白状态 ========== */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  gap: 12px;
  -webkit-animation: emptyIn 0.5s ease-out;
  -moz-animation: emptyIn 0.5s ease-out;
  animation: emptyIn 0.5s ease-out;
}
@-webkit-keyframes emptyIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@-moz-keyframes emptyIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes emptyIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.empty-state svg {
  width: 80px;
  height: 80px;
  opacity: 0.3;
  -webkit-animation: emptyFloat 3s ease-in-out infinite;
  -moz-animation: emptyFloat 3s ease-in-out infinite;
  animation: emptyFloat 3s ease-in-out infinite;
}
@-webkit-keyframes emptyFloat {
  0%, 100% { -webkit-transform: translateY(0); transform: translateY(0); }
  50% { -webkit-transform: translateY(-6px); transform: translateY(-6px); }
}
@-moz-keyframes emptyFloat {
  0%, 100% { -moz-transform: translateY(0); transform: translateY(0); }
  50% { -moz-transform: translateY(-6px); transform: translateY(-6px); }
}
@keyframes emptyFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.empty-state p { font-size: 14px; }

/* ========== Toast ========== */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  -webkit-transform: translateX(-50%);
  -moz-transform: translateX(-50%);
  transform: translateX(-50%);
  padding: 10px 24px;
  border-radius: 10px;
  font-size: 14px;
  color: #fff;
  z-index: 1000;
  -webkit-animation: toastIn 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
  -moz-animation: toastIn 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
  animation: toastIn 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
  pointer-events: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.toast.success { background: rgba(103, 194, 58, 0.9); }
.toast.error { background: rgba(245, 108, 108, 0.9); }
.toast.info { background: rgba(18, 183, 245, 0.9); }

@-webkit-keyframes toastIn {
  from { opacity: 0; -webkit-transform: translateX(-50%) translateY(-12px) scale(0.95); transform: translateX(-50%) translateY(-12px) scale(0.95); }
  to { opacity: 1; -webkit-transform: translateX(-50%) translateY(0) scale(1); transform: translateX(-50%) translateY(0) scale(1); }
}
@-moz-keyframes toastIn {
  from { opacity: 0; -moz-transform: translateX(-50%) translateY(-12px) scale(0.95); transform: translateX(-50%) translateY(-12px) scale(0.95); }
  to { opacity: 1; -moz-transform: translateX(-50%) translateY(0) scale(1); transform: translateX(-50%) translateY(0) scale(1); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px) scale(0.95); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* ================================================ */
/* ========== 响应式 - 平板 (640px - 1024px) ========== */
/* ================================================ */
@media (max-width: 1024px) {
  :root { --sidebar-width: 220px; }

  .chat-container { padding: 8px; gap: 8px; }

  .group-item { padding: 8px 10px; }
  .group-avatar { width: 36px; height: 36px; font-size: 14px; }
  .group-name { font-size: 13px; }

  .chat-header { padding: 12px 16px; }
  .chat-messages { padding: 12px 16px; }
  .chat-input-area { padding: 10px 12px; }

  .message-row { max-width: 82%; }
  .message-avatar { width: 32px; height: 32px; font-size: 12px; }
  .message-bubble { font-size: 13px; padding: 8px 12px; }
}

/* ================================================ */
/* ========== 响应式 - 手机 (< 640px) ========== */
/* ================================================ */
@media (max-width: 640px) {
  :root { --sidebar-width: 85vw; }

  body {
    align-items: stretch;
    overflow: hidden;
  }

  .chat-container {
    padding: 0;
    gap: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
  }

  /* 侧边栏变为抽屉式 */
  .chat-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 85vw;
    max-width: 320px;
    -webkit-transform: translateX(-100%);
    -moz-transform: translateX(-100%);
    transform: translateX(-100%);
    border-radius: 0 var(--radius) var(--radius) 0;
    z-index: 20;
    box-shadow: 4px 0 32px rgba(0,0,0,0.12);
  }
  .chat-sidebar.open {
    -webkit-transform: translateX(0);
    -moz-transform: translateX(0);
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: block;
  }

  .chat-main {
    border-radius: 0;
    border: none;
    box-shadow: none;
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  /* 聊天头部 */
  .chat-header {
    padding: 10px 12px;
    border-radius: 0;
    flex-shrink: 0;
  }
  .chat-header-left {
    gap: 8px;
  }

  /* 返回按钮 */
  .back-btn {
    display: flex;
  }

  .chat-header-name { font-size: 15px; }
  .chat-header-desc { font-size: 11px; max-width: 160px; }
  .chat-header-actions .glass-btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  /* 消息区域 */
  .chat-messages {
    padding: 10px 12px;
    gap: 2px;
    flex: 1;
  }

  .message-row {
    max-width: 88%;
    gap: 8px;
  }
  .message-avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .message-avatar:active {
    -webkit-transform: scale(0.92);
    transform: scale(0.92);
  }
  .message-bubble {
    font-size: 14px;
    padding: 9px 12px;
    border-radius: 14px;
    line-height: 1.5;
  }
  .message-row:not(.self) .message-bubble {
    border-top-left-radius: 4px;
  }
  .message-row.self .message-bubble {
    border-top-right-radius: 4px;
  }
  .message-sender { font-size: 11px; }
  .message-time { font-size: 10px; }

  /* 输入区域 */
  .chat-input-area {
    padding: 8px 10px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    flex-shrink: 0;
    border-top: 1px solid rgba(0,0,0,0.06);
    background: rgba(255,255,255,0.5);
  }
  .message-input {
    font-size: 15px;
    min-height: 40px;
    padding: 9px 12px;
    border-radius: 20px;
  }
  .send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
  }
  .send-btn svg { width: 20px; height: 20px; }

  /* 消息类型工具栏 - 横向滚动 */
  .msg-type-bar {
    gap: 4px;
    padding-bottom: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .msg-type-bar::-webkit-scrollbar { display: none; }
  .msg-type-btn {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 16px;
    flex-shrink: 0;
    white-space: nowrap;
  }
  .msg-type-btn svg { width: 14px; height: 14px; }
  .msg-type-btn span { display: none; }

  .msg-type-panel .input-row { gap: 6px; }
  .msg-type-panel .media-url-input,
  .msg-type-panel .md-content-input,
  .msg-type-panel .md-template-input,
  .msg-type-panel .md-params-input,
  .msg-type-panel .ark-title-input,
  .msg-type-panel .ark-desc-input,
  .msg-type-panel .ark-url-input,
  .msg-type-panel .ark-img-input {
    font-size: 13px;
    padding: 8px 10px;
  }
  .msg-type-panel .md-template-input { max-width: 60px; }

  .file-upload-btn { padding: 6px 10px; font-size: 12px; }
  .file-upload-btn span { display: none; }

  .voice-record-btn { width: 36px; height: 36px; }
  .voice-record-status { font-size: 10px; min-width: 50px; }

  .user-modal { width: 92vw; }
  .user-modal-header { padding: 16px; }
  .user-modal-actions { padding: 12px; gap: 8px; }
  .user-modal-btn { padding: 12px 8px; font-size: 13px; }
  .user-modal-btn svg { width: 20px; height: 20px; }

  .note-modal { width: 92vw; }
  .note-modal-body { padding: 12px 16px; }
  .note-modal-footer { padding: 10px 16px 14px; }

  .msg-image img { max-width: 180px; max-height: 180px; }

  .reply-bar { padding: 6px 10px; margin-bottom: 6px; }
  .reply-bar-content { font-size: 11px; }

  /* 群列表 */
  .group-item { padding: 10px 12px; }
  .group-avatar { width: 42px; height: 42px; }

  /* 登录页 */
  .login-container {
    width: 94vw;
    padding: 32px 20px;
    border-radius: var(--radius);
  }
  .login-title { font-size: 22px; }
  .login-logo { width: 56px; height: 56px; }
  .login-logo svg { width: 30px; height: 30px; }
  .glass-input { padding: 12px 14px; font-size: 15px; }
  .login-btn { padding: 14px; font-size: 16px; }

  /* 发送模式按钮 */
  .send-mode-btn {
    width: 34px;
    height: 34px;
  }

  /* 引用消息 */
  .msg-quote {
    font-size: 11px;
    padding: 4px 8px;
    margin-bottom: 4px;
  }

  /* 系统消息 */
  .system-msg { font-size: 11px; padding: 3px 10px; }
}

/* ================================================ */
/* ========== 响应式 - 小屏手机 (< 380px) ========== */
/* ================================================ */
@media (max-width: 380px) {
  .chat-sidebar { width: 88vw; max-width: 300px; }

  .chat-header { padding: 8px 10px; }
  .chat-header-name { font-size: 14px; }
  .chat-header-actions .glass-btn { padding: 5px 8px; font-size: 11px; }

  .chat-messages { padding: 8px 10px; }
  .message-row { max-width: 92%; gap: 6px; }
  .message-avatar { width: 28px; height: 28px; }
  .message-bubble { font-size: 13px; padding: 7px 10px; }

  .chat-input-area { padding: 6px 8px; }
  .message-input { font-size: 14px; min-height: 36px; }
  .send-btn { width: 36px; height: 36px; }
  .send-btn svg { width: 18px; height: 18px; }

  .msg-type-btn { padding: 4px 8px; font-size: 11px; }
  .msg-type-btn svg { width: 12px; height: 12px; }

  .user-modal { width: 92vw; }
  .user-modal-btn { padding: 10px 6px; font-size: 11px; }
  .user-modal-btn svg { width: 18px; height: 18px; }
  .mute-btn { padding: 6px 12px; font-size: 12px; }

  .login-container {
    width: 96vw;
    padding: 24px 16px;
  }
  .login-title { font-size: 20px; }
  .login-logo { width: 48px; height: 48px; border-radius: 14px; }
  .login-logo svg { width: 26px; height: 26px; }
}

/* ================================================ */
/* ========== 响应式 - 大屏 PC (> 1400px) ========== */
/* ================================================ */
@media (min-width: 1400px) {
  :root { --sidebar-width: 320px; }

  .chat-container { padding: 16px; gap: 16px; }
  .chat-messages { padding: 20px 28px; }
  .message-row { max-width: 65%; }

  .login-container { width: 460px; padding: 48px 44px; }
}

/* ================================================ */
/* ========== Firefox 特定修复 ========== */
/* ================================================ */
@-moz-document url-prefix() {
  .glass-card {
    background: rgba(255, 255, 255, 0.65);
  }
  .glass-input {
    background: rgba(255, 255, 255, 0.5);
  }
  .message-row:not(.self) .message-bubble {
    background: rgba(255, 255, 255, 0.65);
  }
}

/* ================================================ */
/* ========== 暗色模式支持 (可选) ========== */
/* ================================================ */
@media (prefers-color-scheme: dark) {
  /* 保留亮色主题，暗色模式后续可扩展 */
}

/* ================================================ */
/* ================================================ */
/* ========== 账号管理面板 ========== */
/* ================================================ */
.account-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-animation: overlayIn 0.25s ease;
  -moz-animation: overlayIn 0.25s ease;
  animation: overlayIn 0.25s ease;
}

.account-panel {
  width: 400px;
  max-width: 90vw;
  max-height: 80vh;
  padding: 0;
  overflow: hidden;
  -webkit-animation: panelIn 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
  -moz-animation: panelIn 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
  animation: panelIn 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
  display: flex;
  flex-direction: column;
}

@-webkit-keyframes panelIn {
  from { opacity: 0; -webkit-transform: scale(0.95) translateY(-12px); transform: scale(0.95) translateY(-12px); }
  to { opacity: 1; -webkit-transform: scale(1) translateY(0); transform: scale(1) translateY(0); }
}
@-moz-keyframes panelIn {
  from { opacity: 0; -moz-transform: scale(0.95) translateY(-12px); transform: scale(0.95) translateY(-12px); }
  to { opacity: 1; -moz-transform: scale(1) translateY(0); transform: scale(1) translateY(0); }
}
@keyframes panelIn {
  from { opacity: 0; transform: scale(0.95) translateY(-12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.account-panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.account-panel-header h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}

.account-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: rgba(0,0,0,0.04);
  cursor: pointer;
  font-size: 20px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-transition: all 0.2s;
  -moz-transition: all 0.2s;
  transition: all 0.2s;
}
.account-close-btn:hover {
  background: rgba(0,0,0,0.1);
  color: var(--text-primary);
}

.account-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  max-height: 50vh;
}
.account-list::-webkit-scrollbar { width: 4px; }
.account-list::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.1);
  border-radius: 2px;
}

.account-item {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  -webkit-transition: all 0.2s;
  -moz-transition: all 0.2s;
  transition: all 0.2s;
  gap: 12px;
  margin-bottom: 4px;
  position: relative;
}
.account-item:hover {
  background: rgba(18, 183, 245, 0.06);
}
.account-item.active {
  background: var(--accent-light);
}
.account-item-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  background: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.account-item-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.account-item-avatar svg {
  width: 20px;
  height: 20px;
  fill: #999;
}
.account-item-info {
  flex: 1;
  min-width: 0;
}
.account-item-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}
.account-item-id {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.account-item-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.account-item-check svg {
  width: 14px;
  height: 14px;
  fill: #fff;
}
.account-item-delete {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-transition: all 0.2s;
  -moz-transition: all 0.2s;
  transition: all 0.2s;
  flex-shrink: 0;
}
.account-item-delete:hover {
  background: rgba(245, 108, 108, 0.1);
  color: var(--danger);
}

.account-panel-footer {
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(0,0,0,0.06);
  flex-shrink: 0;
}

/* ========== 账号面板 - 设置区域 ========== */
.account-section {
  padding: 0 16px;
  margin-bottom: 4px;
}
.account-section-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* 模式切换 */
.mode-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}
.mode-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.3);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  -webkit-transition: all 0.25s;
  -moz-transition: all 0.25s;
  transition: all 0.25s;
  font-family: inherit;
}
.mode-btn svg {
  width: 16px;
  height: 16px;
}
.mode-btn:hover {
  background: rgba(18, 183, 245, 0.06);
  border-color: var(--accent);
}
.mode-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(18, 183, 245, 0.3);
}

/* 复制行 */
.copy-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.03);
  border-radius: 8px;
  padding: 4px;
  border: 1px solid rgba(0,0,0,0.06);
  -webkit-transition: all 0.2s;
  -moz-transition: all 0.2s;
  transition: all 0.2s;
}
.copy-row:hover {
  border-color: var(--accent);
  background: rgba(18, 183, 245, 0.04);
}
.copy-text {
  flex: 1;
  font-size: 12px;
  color: var(--text-primary);
  padding: 8px 10px;
  background: transparent;
  border: none;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  word-break: break-all;
  cursor: pointer;
  -webkit-user-select: all;
  -moz-user-select: all;
  -ms-user-select: all;
  user-select: all;
}
.copy-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  background: rgba(0,0,0,0.04);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-secondary);
  -webkit-transition: all 0.2s;
  -moz-transition: all 0.2s;
  transition: all 0.2s;
}
.copy-btn:hover {
  background: var(--accent);
  color: #fff;
}
.copy-btn.copied {
  background: var(--success);
  color: #fff;
}
.copy-btn svg {
  width: 14px;
  height: 14px;
}

/* ========== 群列表 - 未读标记 ========== */
.group-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.group-time {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 8px;
}
.unread-badge {
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  flex-shrink: 0;
  margin-left: 8px;
  -webkit-animation: badgePop 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
  -moz-animation: badgePop 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
  animation: badgePop 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}
@-webkit-keyframes badgePop {
  from { -webkit-transform: scale(0); transform: scale(0); }
  to { -webkit-transform: scale(1); transform: scale(1); }
}
@-moz-keyframes badgePop {
  from { -moz-transform: scale(0); transform: scale(0); }
  to { -moz-transform: scale(1); transform: scale(1); }
}
@keyframes badgePop {
  from { transform: scale(0); }
  to { transform: scale(1); }
}
.group-lastmsg {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.group-lastmsg.unread {
  color: var(--text-primary);
  font-weight: 500;
}

/* ========== 登录页已保存账号 ========== */
.saved-accounts {
  margin-top: 16px;
  border-top: 1px solid rgba(0,0,0,0.06);
  padding-top: 12px;
}

.saved-accounts-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding: 0 4px;
}

.saved-account-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  -webkit-transition: all 0.2s;
  -moz-transition: all 0.2s;
  transition: all 0.2s;
  gap: 10px;
  margin-bottom: 4px;
}
.saved-account-item:hover {
  background: rgba(18, 183, 245, 0.06);
  -webkit-transform: translateX(2px);
  -moz-transform: translateX(2px);
  transform: translateX(2px);
}

.saved-account-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  background: #e0e0e0;
}

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

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

.saved-account-appid {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.saved-account-current {
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-light);
  padding: 2px 8px;
  border-radius: 10px;
  flex-shrink: 0;
}

/* ========== 减少动画偏好 ========== */
/* ================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    -webkit-animation-duration: 0.01ms !important;
    -moz-animation-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    -webkit-animation-iteration-count: 1 !important;
    -moz-animation-iteration-count: 1 !important;
    animation-iteration-count: 1 !important;
    -webkit-transition-duration: 0.01ms !important;
    -moz-transition-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ================================================ */
/* ========== 消息类型工具栏 ========== */
/* ================================================ */
.msg-type-bar {
  display: flex;
  gap: 4px;
  padding: 0 0 8px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.msg-type-bar::-webkit-scrollbar { display: none; }

.msg-type-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.35);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  -webkit-transition: all 0.2s;
  -moz-transition: all 0.2s;
  transition: all 0.2s;
  font-family: inherit;
  flex-shrink: 0;
}
.msg-type-btn svg {
  width: 15px;
  height: 15px;
}
.msg-type-btn:hover {
  background: rgba(18, 183, 245, 0.08);
  border-color: var(--accent);
  color: var(--accent);
}
.msg-type-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(18, 183, 245, 0.3);
}

/* ================================================ */
/* ========== 消息类型面板 ========== */
/* ================================================ */
.msg-type-panel { -webkit-animation: panelSlideIn 0.2s ease; animation: panelSlideIn 0.2s ease; }
@keyframes panelSlideIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.msg-type-panel .input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.msg-type-panel .media-url-input,
.msg-type-panel .md-template-input,
.msg-type-panel .ark-title-input,
.msg-type-panel .ark-desc-input,
.msg-type-panel .ark-url-input,
.msg-type-panel .ark-img-input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  background: rgba(255,255,255,0.4);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
  -webkit-transition: all var(--transition);
  transition: all var(--transition);
}
.msg-type-panel .media-url-input:focus,
.msg-type-panel .md-template-input:focus,
.msg-type-panel .ark-title-input:focus,
.msg-type-panel .ark-desc-input:focus,
.msg-type-panel .ark-url-input:focus,
.msg-type-panel .ark-img-input:focus {
  border-color: var(--accent);
  background: rgba(255,255,255,0.65);
  box-shadow: 0 0 0 2px var(--accent-light);
}
.msg-type-panel .media-url-input::placeholder { color: var(--text-muted); }
.msg-type-panel .md-template-input { max-width: 80px; }
.msg-type-panel .md-params-input {
  flex: 3;
  padding: 8px 12px;
  background: rgba(255,255,255,0.4);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
  -webkit-transition: all var(--transition);
  transition: all var(--transition);
}
.msg-type-panel .md-params-input:focus {
  border-color: var(--accent);
  background: rgba(255,255,255,0.65);
  box-shadow: 0 0 0 2px var(--accent-light);
}

/* ================================================ */
/* ========== 文件上传按钮 ========== */
/* ================================================ */
.file-upload-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.35);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  -webkit-transition: all 0.2s;
  transition: all 0.2s;
  flex-shrink: 0;
}
.file-upload-btn:hover {
  background: rgba(18, 183, 245, 0.08);
  border-color: var(--accent);
  color: var(--accent);
}
.file-upload-btn svg {
  width: 16px;
  height: 16px;
}

/* ================================================ */
/* ========== 语音录制按钮 ========== */
/* ================================================ */
.voice-record-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-secondary);
  -webkit-transition: all 0.2s;
  transition: all 0.2s;
}
.voice-record-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.voice-record-btn svg {
  width: 18px;
  height: 18px;
}
.voice-record-btn.recording {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
  -webkit-animation: recordPulse 1.5s ease-in-out infinite;
  animation: recordPulse 1.5s ease-in-out infinite;
}
@keyframes recordPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 108, 108, 0.5); }
  50% { box-shadow: 0 0 0 8px rgba(245, 108, 108, 0); }
}
.voice-record-status {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 60px;
}

/* ================================================ */
/* ========== 引用回复条 ========== */
/* ================================================ */
.reply-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: rgba(18, 183, 245, 0.08);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  -webkit-animation: replySlideIn 0.2s ease;
  animation: replySlideIn 0.2s ease;
}
@keyframes replySlideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.reply-bar-content {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--accent);
  overflow: hidden;
}
.reply-bar-content svg {
  flex-shrink: 0;
  color: var(--accent);
}
.reply-bar-content span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reply-bar-close {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.06);
  cursor: pointer;
  font-size: 16px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  -webkit-transition: all 0.2s;
  transition: all 0.2s;
}
.reply-bar-close:hover {
  background: rgba(0,0,0,0.12);
  color: var(--text-primary);
}

/* ================================================ */
/* ========== 模态弹窗通用 ========== */
/* ================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-animation: overlayIn 0.25s ease;
  animation: overlayIn 0.25s ease;
}

/* ================================================ */
/* ========== 用户操作弹窗 ========== */
/* ================================================ */
.user-modal {
  width: 340px;
  max-width: 90vw;
  padding: 0;
  overflow: hidden;
  -webkit-animation: panelIn 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
  animation: panelIn 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.user-modal-header {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.user-modal-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #e0e0e0;
  background-size: cover;
  background-position: center;
}
.user-modal-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}
.user-modal-id {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  word-break: break-all;
}
.user-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: rgba(0,0,0,0.04);
  cursor: pointer;
  font-size: 20px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: auto;
  -webkit-transition: all 0.2s;
  transition: all 0.2s;
}
.user-modal-close:hover {
  background: rgba(0,0,0,0.1);
  color: var(--text-primary);
}
.user-modal-actions {
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.user-modal-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.35);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  -webkit-transition: all 0.2s;
  transition: all 0.2s;
  font-family: inherit;
}
.user-modal-btn:hover {
  background: rgba(18, 183, 245, 0.08);
  border-color: var(--accent);
  color: var(--accent);
  -webkit-transform: translateY(-1px);
  transform: translateY(-1px);
}
.user-modal-btn svg {
  width: 22px;
  height: 22px;
}

/* ================================================ */
/* ========== 禁言选项 ========== */
/* ================================================ */
.mute-options {
  padding: 0 16px 16px;
  -webkit-animation: muteSlideIn 0.25s ease;
  animation: muteSlideIn 0.25s ease;
}
@keyframes muteSlideIn {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 200px; }
}
.mute-title {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 500;
}
.mute-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.mute-btn {
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid rgba(0,0,0,0.1);
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  -webkit-transition: all 0.2s;
  transition: all 0.2s;
  font-family: inherit;
}
.mute-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.mute-btn-unmute {
  border-color: #e74c3c;
  color: #e74c3c;
}
.mute-btn-unmute:hover {
  background: #e74c3c;
  color: #fff;
  border-color: #e74c3c;
}

/* ================================================ */
/* ========== 备注弹窗 ========== */
/* ================================================ */
.note-modal {
  width: 380px;
  max-width: 90vw;
  padding: 0;
  overflow: hidden;
  -webkit-animation: panelIn 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
  animation: panelIn 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.note-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.note-modal-header h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}
.note-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: rgba(0,0,0,0.04);
  cursor: pointer;
  font-size: 20px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-transition: all 0.2s;
  transition: all 0.2s;
}
.note-modal-close:hover {
  background: rgba(0,0,0,0.1);
  color: var(--text-primary);
}
.note-modal-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.note-modal-body label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}
.note-modal-body .glass-input {
  font-size: 14px;
}
.note-textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
  padding: 10px 14px;
}
.note-modal-footer {
  padding: 12px 20px 16px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid rgba(0,0,0,0.06);
}
.note-modal-footer .glass-btn {
  padding: 8px 20px;
  font-size: 14px;
}

/* ================================================ */
/* ========== 消息内容富文本样式 ========== */
/* ================================================ */
/* @提及 */
.msg-mention {
  color: var(--accent);
  font-weight: 500;
  background: var(--accent-light);
  padding: 1px 4px;
  border-radius: 3px;
  display: inline;
}

/* 图片附件 */
.msg-image {
  margin-top: 6px;
}
.msg-image img {
  max-width: 240px;
  max-height: 240px;
  border-radius: 8px;
  cursor: pointer;
  object-fit: cover;
  -webkit-transition: transform 0.2s;
  transition: transform 0.2s;
}
.msg-image img:hover {
  -webkit-transform: scale(1.02);
  transform: scale(1.02);
}

/* 引用回复 */
.msg-quote {
  margin-bottom: 6px;
  padding: 6px 10px;
  background: rgba(0,0,0,0.04);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
}
.msg-quote span {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 消息气泡中的链接 */
.message-bubble a {
  color: var(--accent);
  text-decoration: underline;
}
.message-row.self .message-bubble a {
  color: rgba(255,255,255,0.9);
}

/* ================================================ */
/* ========== 响应式 - 新组件 (已合并至主响应式区块) ========== */
/* ================================================ */
@media (max-width: 1024px) {
  .msg-type-btn { padding: 5px 8px; font-size: 11px; }
  .msg-type-btn svg { width: 13px; height: 13px; }
  .msg-type-btn span { display: none; }
  .user-modal { width: 320px; }
  .note-modal { width: 340px; }
}

@media (max-width: 380px) {
  .msg-type-btn { padding: 4px 6px; }
  .msg-type-btn svg { width: 12px; height: 12px; }
  .user-modal-btn { padding: 10px 6px; font-size: 11px; }
  .user-modal-btn svg { width: 18px; height: 18px; }
  .mute-btn { padding: 6px 12px; font-size: 12px; }
}

/* ================================================ */
/* ========== 角色徽章 ========== */
/* ================================================ */
.role-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 4px;
  vertical-align: middle;
  line-height: 1.4;
}
.role-badge.role-owner {
  background: linear-gradient(135deg, #f5a623, #f7b84e);
  color: #fff;
}
.role-badge.role-admin {
  background: linear-gradient(135deg, #12b7f5, #4ec9f5);
  color: #fff;
}

/* ================================================ */
/* ========== 置顶消息区域 ========== */
/* ================================================ */
.pinned-section {
  background: rgba(18, 183, 245, 0.06);
  border: 1px solid rgba(18, 183, 245, 0.15);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 8px;
  -webkit-animation: pinnedIn 0.3s ease;
  animation: pinnedIn 0.3s ease;
}
@keyframes pinnedIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.pinned-msg {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
  color: var(--text-secondary);
}
.pinned-msg + .pinned-msg {
  border-top: 1px solid rgba(0,0,0,0.04);
  padding-top: 6px;
  margin-top: 2px;
}
.pinned-msg-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}
.pinned-msg-content {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.pinned-msg-author {
  font-weight: 500;
  color: var(--text-primary);
}
.pinned-msg-unpin {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.06);
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  -webkit-transition: all 0.2s;
  transition: all 0.2s;
}
.pinned-msg-unpin:hover {
  background: rgba(245, 108, 108, 0.15);
  color: var(--danger);
}

/* ================================================ */
/* ========== 消息置顶按钮 ========== */
/* ================================================ */
.msg-pin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: none;
  background: rgba(0,0,0,0.05);
  cursor: pointer;
  color: var(--text-muted);
  vertical-align: middle;
  margin-left: 6px;
  -webkit-transition: all 0.2s;
  transition: all 0.2s;
}
.msg-pin-btn:hover {
  background: var(--accent-light);
  color: var(--accent);
}

/* ================================================ */
/* ========== Markdown 渲染样式 ========== */
/* ================================================ */
.md-code-block {
  background: rgba(0,0,0,0.06);
  border-radius: 6px;
  padding: 8px 12px;
  margin: 6px 0;
  font-size: 12px;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
.md-inline-code {
  background: rgba(0,0,0,0.06);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.9em;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}
.md-h2, .md-h3, .md-h4 {
  font-weight: 600;
  margin: 4px 0;
  line-height: 1.3;
}
.md-h2 { font-size: 1.2em; }
.md-h3 { font-size: 1.1em; }
.md-h4 { font-size: 1em; }
.md-li {
  display: list-item;
  list-style: disc;
  margin-left: 16px;
  margin-bottom: 2px;
}
.md-quote {
  border-left: 3px solid var(--accent);
  padding: 4px 10px;
  margin: 4px 0;
  color: var(--text-muted);
  font-style: italic;
  background: rgba(0,0,0,0.02);
  border-radius: 0 4px 4px 0;
}
.message-row.self .md-code-block {
  background: rgba(255,255,255,0.2);
}
.message-row.self .md-inline-code {
  background: rgba(255,255,255,0.2);
}
.message-row.self .md-quote {
  border-left-color: rgba(255,255,255,0.5);
  color: rgba(255,255,255,0.8);
}

/* ================================================ */
/* ========== 键盘/按钮消息 ========== */
/* ================================================ */
.msg-keyboard {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(0,0,0,0.06);
}
.msg-keyboard-row {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.msg-kb-btn {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  cursor: default;
  -webkit-user-select: none;
  user-select: none;
}
.msg-kb-btn-default {
  background: rgba(0,0,0,0.06);
  color: var(--text-secondary);
  border: 1px solid rgba(0,0,0,0.08);
}
.msg-kb-btn-primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}
.message-row.self .msg-keyboard {
  border-top-color: rgba(255,255,255,0.2);
}
.message-row.self .msg-kb-btn-default {
  background: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.9);
  border-color: rgba(255,255,255,0.3);
}

/* ================================================ */
/* ========== 用户弹窗角色标识 ========== */
/* ================================================ */
.user-modal-role {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 8px;
  display: inline-block;
  margin-top: 4px;
}
.user-modal-role.role-owner {
  background: rgba(245, 166, 35, 0.15);
  color: #d4890a;
}
.user-modal-role.role-admin {
  background: rgba(18, 183, 245, 0.15);
  color: #0a9fd5;
}

/* ================================================ */
/* ========== 群头像列表优化 ========== */
/* ================================================ */
.group-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* ================================================ */
/* ========== 无活动群聊样式 ========== */
/* ================================================ */
.group-item-inactive {
  opacity: 0.55;
}
.group-item-inactive:hover {
  opacity: 0.85;
}

/* ================================================ */
/* ========== MD 模式切换按钮 ========== */
/* ================================================ */
.md-mode-toggle {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
}
.md-mode-btn {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.35);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  -webkit-transition: all 0.2s;
  transition: all 0.2s;
  font-family: inherit;
}
.md-mode-btn:hover {
  background: rgba(18, 183, 245, 0.08);
  border-color: var(--accent);
}
.md-mode-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* MD 内容输入框 */
.md-content-input {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace !important;
  font-size: 13px !important;
}

/* ================================================ */
/* ========== Markdown 渲染补充样式 ========== */
/* ================================================ */
.md-hr {
  border: none;
  border-top: 1px solid rgba(0,0,0,0.1);
  margin: 8px 0;
}
.message-row.self .md-hr {
  border-top-color: rgba(255,255,255,0.3);
}
.md-img {
  max-width: 200px;
  max-height: 200px;
  border-radius: 6px;
  margin: 4px 0;
  display: block;
}

/* ================================================ */
/* ========== Ark 消息渲染 ========== */
/* ================================================ */
.msg-ark {
  padding: 8px 12px;
  background: rgba(0,0,0,0.04);
  border-radius: 8px;
  border: 1px dashed rgba(0,0,0,0.1);
  font-size: 13px;
  color: var(--text-secondary);
}
.msg-ark-label {
  font-weight: 600;
  font-size: 11px;
  background: rgba(245, 166, 35, 0.15);
  color: #d4890a;
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 6px;
}
.message-row.self .msg-ark {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.2);
}

/* ================================================ */
/* ========== Markdown 链接样式 ========== */
/* ================================================ */
.md-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(18, 183, 245, 0.3);
}
.md-link:hover {
  border-bottom-color: var(--accent);
}
.message-row.self .md-link {
  color: rgba(255,255,255,0.9);
  border-bottom-color: rgba(255,255,255,0.4);
}

/* ================================================ */
/* ========== 群头像回退样式 ========== */
/* ================================================ */
.group-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

/* ================================================ */
/* ========== 引用回复高亮 ========== */
/* ================================================ */
.msg-quote {
  cursor: pointer;
  -webkit-transition: background 0.2s;
  transition: background 0.2s;
}
.msg-quote:hover {
  background: rgba(18, 183, 245, 0.08);
}

/* ================================================ */
/* ========== 发送模式切换按钮 ========== */
/* ================================================ */
.send-mode-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-secondary);
  -webkit-transition: all 0.2s;
  transition: all 0.2s;
  font-family: inherit;
}
.send-mode-btn:hover {
  background: rgba(18, 183, 245, 0.08);
  border-color: var(--accent);
  color: var(--accent);
}
.send-mode-btn.mode-enter-send {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(18, 183, 245, 0.3);
}
.send-mode-btn svg {
  width: 18px;
  height: 18px;
}

/* ================================================ */
/* ========== 群聊右键菜单 ========== */
/* ================================================ */
.group-context-menu {
  padding: 6px 0;
  min-width: 160px;
  -webkit-animation: menuIn 0.2s cubic-bezier(0.22, 0.61, 0.36, 1);
  animation: menuIn 0.2s cubic-bezier(0.22, 0.61, 0.36, 1);
}
@keyframes menuIn {
  from { opacity: 0; transform: scale(0.95) translateY(-4px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.group-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  -webkit-transition: background 0.15s;
  transition: background 0.15s;
  white-space: nowrap;
}
.group-menu-item:hover {
  background: rgba(18, 183, 245, 0.08);
}
.group-menu-item svg {
  flex-shrink: 0;
  color: var(--text-secondary);
}
.group-menu-item-danger {
  color: var(--danger);
}
.group-menu-item-danger:hover {
  background: rgba(245, 108, 108, 0.08);
}
.group-menu-item-danger svg {
  color: var(--danger);
}
.group-menu-divider {
  height: 1px;
  background: rgba(0,0,0,0.06);
  margin: 4px 0;
}

/* ================================================ */
/* ========== 响应式 - 群聊菜单 ========== */
/* ================================================ */
@media (max-width: 640px) {
  .group-context-menu {
    min-width: 140px;
  }
  .group-menu-item {
    padding: 9px 14px;
    font-size: 13px;
  }
}