* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #1e90ff;
  --danger: #ff4d4f;
  --success: #52c41a;
  --warning: #faad14;
  --bg-dark: #1a1a1a;
  --panel-bg: #2a2a2a;
  --control-bg: #3a3a3a;
  --text-light: #ffffff;
  --text-muted: #aaaaaa;
  --border: #444444;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-dark);
  color: var(--text-light);
  height: 100vh;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

/* ================= 登录界面 ================= */
.login-section {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.login-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.login-card h1 {
  font-size: 28px;
  margin-bottom: 8px;
}

.subtitle {
  color: var(--text-muted);
  margin-bottom: 30px;
}

.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text-muted);
}

.form-group input {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-light);
  font-size: 16px;
  outline: none;
}

.form-group input:focus {
  border-color: var(--primary);
}

.btn {
  padding: 14px 24px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: white;
  width: 100%;
}

.btn-primary:hover {
  background: #1873cc;
}

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  width: 100%;
}

.btn-secondary:hover {
  background: rgba(74, 144, 226, 0.1);
}

.button-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.tip {
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ================= 会议界面 ================= */
.meeting-section {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--bg-dark);
}

/* 顶部栏 */
.meeting-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.meeting-title {
  font-size: 18px;
  font-weight: 600;
}

.room-id {
  color: var(--text-muted);
  font-size: 14px;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 12px;
  border-radius: 20px;
}

.timer {
  color: var(--text-muted);
  font-size: 14px;
  font-family: monospace;
}

.connection-status {
  color: var(--warning);
  font-size: 13px;
  margin-right: 12px;
}

.connection-status.connected {
  color: var(--success);
}

.member-count {
  color: var(--text-muted);
  font-size: 13px;
  margin-right: 12px;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 20px;
}

/* 主内容区 */
.meeting-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.video-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 16px;
  min-width: 0;
}

/* 主视频区 */
.main-video {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 0;
}

.video-wrapper.featured {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}

.video-wrapper.featured video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.video-status {
  position: absolute;
  bottom: 16px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.6);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 14px;
}

.video-name {
  color: white;
}

.mic-icon {
  font-size: 12px;
}

.mic-icon.off {
  opacity: 0.5;
  text-decoration: line-through;
}

/* 底部缩略图条 */
.video-strip-container {
  flex-shrink: 0;
  height: 130px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 12px;
  overflow-x: auto;
  overflow-y: hidden;
}

.video-strip {
  display: flex;
  gap: 12px;
  height: 100%;
}

.thumb-wrapper {
  position: relative;
  flex-shrink: 0;
  width: 180px;
  height: 100%;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}

.thumb-wrapper:hover {
  border-color: var(--primary);
}

.thumb-wrapper.active {
  border-color: var(--primary);
}

.thumb-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-info {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.6);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.thumb-mic {
  font-size: 10px;
}

.thumb-mic.off {
  opacity: 0.5;
  text-decoration: line-through;
}

.thumb-placeholder {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  background: var(--panel-bg);
  color: var(--text-muted);
  font-size: 14px;
}

/* 右侧边栏 */
.sidebar {
  width: 320px;
  background: var(--panel-bg);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}

.sidebar-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  font-size: 14px;
}

.sidebar-tab.active {
  background: var(--primary);
  color: white;
}

.close-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  border-radius: 50%;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-title {
  padding: 16px;
  font-size: 16px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.members-list {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  padding: 8px;
}

.member-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 4px;
  background: rgba(255, 255, 255, 0.05);
}

.member-name {
  font-size: 14px;
}

.member-status {
  display: flex;
  gap: 8px;
  font-size: 14px;
}

.member-status .off {
  opacity: 0.4;
  text-decoration: line-through;
}

/* 聊天面板 */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.chat-message {
  margin-bottom: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

.chat-message .meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.chat-message .text {
  font-size: 14px;
  word-break: break-all;
}

.chat-input-area {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-input-area input {
  flex: 1;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-light);
  font-size: 14px;
  outline: none;
}

.chat-input-area .btn {
  padding: 10px 16px;
  font-size: 14px;
}

/* 底部控制栏 */
.meeting-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--panel-bg);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.control-left,
.control-right {
  display: flex;
  align-items: center;
  min-width: 140px;
}

.control-right {
  justify-content: flex-end;
}

.control-center {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.control-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  background: var(--control-bg);
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
  min-width: 64px;
}

.control-btn:hover {
  background: #4a4a4a;
}

.control-btn.active {
  background: var(--primary);
}

.control-btn.active:hover {
  background: #1873cc;
}

.control-btn .icon {
  font-size: 20px;
}

.control-btn .label {
  font-size: 12px;
}

.btn-leave {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  background: var(--danger);
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-leave:hover {
  background: #d9363e;
}

.network-status {
  color: var(--success);
  font-size: 13px;
}

.network-status.warning {
  color: var(--warning);
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* 响应式 */
@media (max-width: 768px) {
  .meeting-controls {
    flex-direction: column;
    gap: 12px;
    padding: 12px;
  }

  .control-center {
    flex-wrap: wrap;
    gap: 8px;
  }

  .control-btn {
    min-width: 56px;
    padding: 8px 10px;
  }

  .control-btn .label {
    font-size: 10px;
  }

  .sidebar {
    position: absolute;
    right: 0;
    top: 60px;
    bottom: 120px;
    width: 100%;
    max-width: 320px;
    z-index: 100;
  }

  .video-strip-container {
    height: 100px;
  }

  .thumb-wrapper {
    width: 140px;
  }
}
