/* ============================================
   VoiceWave - 多人语音聊天平台样式
   ============================================ */

:root {
  /* 主色调 - 深海蓝绿 */
  --primary-h: 175;
  --primary-s: 80%;
  --primary-l: 50%;
  --primary: hsl(var(--primary-h), var(--primary-s), var(--primary-l));
  --primary-light: hsl(var(--primary-h), var(--primary-s), 65%);
  --primary-dark: hsl(var(--primary-h), var(--primary-s), 35%);
  --primary-glow: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.4);
  
  /* 强调色 - 珊瑚橙 */
  --accent: hsl(15, 90%, 60%);
  --accent-glow: hsla(15, 90%, 60%, 0.4);
  
  /* 背景色 */
  --bg-deep: #0a0e14;
  --bg-base: #0f1419;
  --bg-surface: #151b23;
  --bg-elevated: #1c242e;
  --bg-hover: #232d3a;
  
  /* 文字色 */
  --text-primary: #e6edf5;
  --text-secondary: #8899a6;
  --text-muted: #556677;
  
  /* 边框和分割线 */
  --border: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.12);
  
  /* 状态色 */
  --success: #2ecc71;
  --warning: #f1c40f;
  --danger: #e74c3c;
  
  /* 间距 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  
  /* 圆角 */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  /* 动画 */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
  
  /* 字体 */
  --font-main: 'Outfit', -apple-system, sans-serif;
  --font-mono: 'Fira Code', monospace;
}

/* ============================================
   基础重置
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-main);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

input, button, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* ============================================
   应用容器
   ============================================ */
.app-container {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

/* ============================================
   背景装饰
   ============================================ */
.bg-decoration {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: float 20s ease-in-out infinite;
}

.bg-orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  top: -150px;
  right: -100px;
  animation-delay: 0s;
}

.bg-orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, hsla(260, 70%, 50%, 0.3) 0%, transparent 70%);
  bottom: -100px;
  left: -100px;
  animation-delay: -7s;
}

.bg-orb-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
  opacity: 0.2;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -30px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(20px, 10px) scale(1.02); }
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
}

/* ============================================
   视图切换
   ============================================ */
.view {
  display: none;
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.view.active {
  display: flex;
  flex-direction: column;
  animation: viewEnter 0.5s ease-out;
}

@keyframes viewEnter {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   登录界面
   ============================================ */
#login-view {
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.login-card {
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow: 
    0 4px 6px rgba(0, 0, 0, 0.1),
    0 20px 40px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}

.logo-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 8px 24px var(--primary-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 8px 24px var(--primary-glow), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
  50% { box-shadow: 0 8px 40px var(--primary-glow), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
}

.logo-icon svg {
  width: 36px;
  height: 36px;
  color: white;
}

.logo h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  font-size: 1.05rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.input-group {
  text-align: left;
}

.input-group label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: var(--space-sm);
}

.input-group input,
.input-group select,
.input-group textarea {
  width: 100%;
  padding: var(--space-md);
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  transition: var(--transition-base);
  outline: none;
}

.input-group input::placeholder,
.input-group textarea::placeholder {
  color: var(--text-muted);
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.input-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%238899a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 44px;
}

/* ============================================
   按钮
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 1rem;
  transition: var(--transition-base);
  text-decoration: none;
}

.btn svg {
  width: 20px;
  height: 20px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
}

.btn-icon:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-light);
}

.btn-icon svg {
  width: 20px;
  height: 20px;
}

/* ============================================
   特性展示
   ============================================ */
.features {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
}

.feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}

.feature-icon {
  width: 28px;
  height: 28px;
  color: var(--primary);
}

.feature span {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============================================
   头部导航
   ============================================ */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: rgba(15, 20, 25, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.logo-small {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-small svg {
  width: 20px;
  height: 20px;
  color: white;
}

.brand {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.user-badge {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

.user-avatar {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
}

/* ============================================
   大厅界面
   ============================================ */
.lobby-main {
  flex: 1;
  padding: var(--space-xl);
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.lobby-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
}

.lobby-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
}

.room-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-lg);
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-muted);
}

.empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-md);
  opacity: 0.5;
}

/* ============================================
   房间卡片
   ============================================ */
.room-card {
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: var(--transition-base);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.room-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  opacity: 0;
  transition: var(--transition-base);
}

.room-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.room-card:hover::before {
  opacity: 1;
}

.room-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.room-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.room-card-badge {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-base);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.room-card-badge .dot {
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.room-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.room-card-users {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.room-card-users svg {
  width: 16px;
  height: 16px;
}

.room-card-join {
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition-base);
}

.room-card:hover .room-card-join {
  background: var(--primary);
  color: white;
}

/* ============================================
   弹窗
   ============================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.modal.active {
  display: flex;
  animation: modalEnter 0.3s ease-out;
}

@keyframes modalEnter {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
  animation: modalSlide 0.3s ease-out;
}

@keyframes modalSlide {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-close svg {
  width: 18px;
  height: 18px;
}

.modal-body {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.modal-footer {
  padding: var(--space-lg);
  border-top: 1px solid var(--border);
}

.modal-footer .btn {
  width: 100%;
}

/* ============================================
   房间界面
   ============================================ */
#room-view {
  height: 100vh;
}

.room-header .room-info {
  display: flex;
  flex-direction: column;
}

.room-header .room-info h3 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
}

.room-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.connection-status {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
}

.connection-status .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
  animation: blink 1.5s ease-in-out infinite;
}

.connection-status.connected .status-dot {
  background: var(--success);
  animation: none;
}

.connection-status .status-text {
  color: var(--text-secondary);
}

/* ============================================
   房间主体布局
   ============================================ */
.room-main {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* 参与者面板 */
.participants-panel {
  width: 240px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
}

.panel-header svg {
  width: 18px;
  height: 18px;
}

.participants-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-sm);
}

.participant-card {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  transition: var(--transition-base);
  position: relative;
}

.participant-card:hover {
  background: var(--bg-elevated);
}

.participant-card.speaking {
  background: rgba(20, 184, 166, 0.1);
}

.participant-card.is-me {
  background: rgba(20, 184, 166, 0.05);
}

.participant-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
  position: relative;
}

.participant-card.speaking .participant-avatar {
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.participant-info {
  flex: 1;
  min-width: 0;
}

.participant-name {
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.participant-status {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.participant-status svg {
  width: 12px;
  height: 12px;
}

.me-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-full);
  margin-left: var(--space-xs);
}

.participant-card.muted .participant-status {
  color: var(--danger);
}

/* ============================================
   聊天面板
   ============================================ */
.chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-base);
  position: relative;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* 消息样式 */
.message {
  max-width: 70%;
  animation: messageIn 0.2s ease-out;
}

@keyframes messageIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.message.own {
  align-self: flex-end;
}

.message.other {
  align-self: flex-start;
}

.message-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
  font-size: 0.8rem;
}

.message-author {
  font-weight: 500;
  color: var(--text-secondary);
}

.message-time {
  color: var(--text-muted);
}

.message-content {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-lg);
  word-wrap: break-word;
  line-height: 1.5;
}

.message.own .message-content {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border-bottom-right-radius: var(--radius-sm);
}

.message.other .message-content {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-bottom-left-radius: var(--radius-sm);
}

/* 系统消息 */
.message.system {
  align-self: center;
  max-width: 100%;
}

.message.system .message-content {
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: var(--space-xs) var(--space-md);
}

/* 图片消息 */
.message-image {
  max-width: 300px;
  max-height: 300px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-base);
}

.message-image:hover {
  opacity: 0.9;
}

/* 文件消息 */
.message-file {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  background: var(--bg-base);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: var(--transition-base);
}

.message-file:hover {
  background: var(--bg-hover);
}

.message-file-icon {
  width: 40px;
  height: 40px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.message-file-icon svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.message-file-info {
  flex: 1;
  min-width: 0;
}

.message-file-name {
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-file-size {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* 聊天输入区域 */
.chat-input-area {
  padding: var(--space-md);
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
}

.chat-toolbar {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

.toolbar-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  transition: var(--transition-base);
}

.toolbar-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.toolbar-btn svg {
  width: 20px;
  height: 20px;
}

.chat-input-wrapper {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-end;
}

#chat-input {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  resize: none;
  min-height: 44px;
  max-height: 120px;
  outline: none;
  transition: var(--transition-base);
}

#chat-input:focus {
  border-color: var(--primary);
}

.send-btn {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: var(--transition-base);
  flex-shrink: 0;
}

.send-btn:hover {
  transform: scale(1.05);
}

.send-btn svg {
  width: 20px;
  height: 20px;
}

/* Emoji 选择器 */
.emoji-picker {
  position: fixed;
  bottom: auto;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 1000;
  max-width: 90vw;
  max-height: 80vh;
}

.emoji-picker.active {
  display: block;
  animation: modalSlide 0.2s ease-out;
}

.emoji-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border);
}

.emoji-picker-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.emoji-picker-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.emoji-picker-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.emoji-picker-close svg {
  width: 16px;
  height: 16px;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: var(--space-xs);
  max-height: 50vh;
  overflow-y: auto;
  padding-right: var(--space-xs);
}

.emoji-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.emoji-btn:hover {
  background: var(--bg-hover);
  transform: scale(1.1);
}

/* Emoji 背景遮罩 */
.emoji-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: none;
}

.emoji-backdrop.active {
  display: block;
}

/* ============================================
   房间控制栏
   ============================================ */
.room-controls {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: var(--space-md);
}

.controls-center {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-lg);
}

/* 音量控制 */
.volume-control {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  min-width: 140px;
}

.volume-label {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.volume-label svg {
  width: 14px;
  height: 14px;
}

.volume-slider-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.volume-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--bg-base);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 8px var(--primary-glow);
}

.volume-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  transition: var(--transition-fast);
}

.volume-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
}

.volume-slider::-moz-range-track {
  height: 4px;
  background: var(--bg-base);
  border-radius: 2px;
}

.volume-value {
  font-size: 0.7rem;
  color: var(--text-muted);
  min-width: 36px;
  text-align: right;
  font-family: var(--font-mono);
}

.control-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  transition: var(--transition-base);
  min-width: 80px;
}

.control-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
}

.control-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.control-icon svg {
  width: 22px;
  height: 22px;
}

.control-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.control-btn .mic-off {
  display: none;
}

.control-btn.muted {
  background: rgba(231, 76, 60, 0.15);
  border-color: var(--danger);
  color: var(--danger);
}

.control-btn.muted .mic-on {
  display: none;
}

.control-btn.muted .mic-off {
  display: flex;
}

.control-btn-danger {
  background: rgba(231, 76, 60, 0.1);
  border-color: rgba(231, 76, 60, 0.3);
  color: var(--danger);
}

.control-btn-danger:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

/* ============================================
   Toast 通知
   ============================================ */
.toast-container {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  animation: toastEnter 0.3s ease-out;
  max-width: 320px;
}

.toast.toast-exit {
  animation: toastExit 0.3s ease-out forwards;
}

@keyframes toastEnter {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes toastExit {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

.toast-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.toast-message {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.toast.success {
  border-left: 3px solid var(--success);
}

.toast.error {
  border-left: 3px solid var(--danger);
}

.toast.info {
  border-left: 3px solid var(--primary);
}

/* ============================================
   滚动条样式
   ============================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ============================================
   响应式
   ============================================ */
@media (max-width: 900px) {
  .participants-panel {
    width: 200px;
  }
}

@media (max-width: 768px) {
  .login-card {
    padding: var(--space-xl);
  }
  
  .logo-icon {
    width: 60px;
    height: 60px;
  }
  
  .logo h1 {
    font-size: 1.75rem;
  }
  
  .features {
    gap: var(--space-lg);
  }
  
  .lobby-main {
    padding: var(--space-lg);
  }
  
  .lobby-header {
    flex-direction: column;
    gap: var(--space-md);
    align-items: stretch;
  }
  
  .room-list {
    grid-template-columns: 1fr;
  }
  
  .room-main {
    flex-direction: column;
  }
  
  .participants-panel {
    width: 100%;
    max-height: 150px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  
  .participants-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
  }
  
  .participant-card {
    padding: var(--space-xs) var(--space-sm);
  }
  
  .message {
    max-width: 85%;
  }
  
  .control-btn {
    padding: var(--space-sm);
    min-width: 70px;
  }
  
  .volume-control {
    min-width: 100px;
  }
  
  .controls-center {
    flex-wrap: wrap;
    gap: var(--space-md);
  }
  
  .toast-container {
    left: var(--space-md);
    right: var(--space-md);
    bottom: var(--space-md);
  }
  
  .toast {
    max-width: none;
  }
}
