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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* 头部 */
.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 0;
  border-bottom: 1px solid #e8e8e8;
  margin-bottom: 30px;
}

.logo h1 {
  font-size: 24px;
  color: #1a1a2e;
  font-weight: 600;
}

.subtitle {
  color: #666;
  font-size: 14px;
  margin-top: 4px;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #666;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #999;
  transition: background 0.3s;
}

.status-dot.online {
  background: #52c41a;
  box-shadow: 0 0 6px rgba(82, 196, 26, 0.5);
}

.status-dot.offline {
  background: #ff4d4f;
}

/* 介绍区 */
.intro {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 40px;
  border-radius: 12px;
  margin-bottom: 30px;
}

.intro h2 {
  font-size: 28px;
  margin-bottom: 12px;
  font-weight: 600;
}

.intro p {
  font-size: 15px;
  opacity: 0.9;
  margin-bottom: 24px;
  max-width: 700px;
}

.features {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.feature-item {
  background: rgba(255, 255, 255, 0.2);
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  backdrop-filter: blur(10px);
}

/* 会议入口 */
.meeting-entry {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  margin-bottom: 30px;
}

.meeting-entry h3 {
  font-size: 18px;
  margin-bottom: 20px;
  color: #1a1a2e;
}

.entry-form {
  display: flex;
  gap: 20px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.form-group {
  flex: 1;
  min-width: 200px;
}

.form-group label {
  display: block;
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  font-size: 15px;
  transition: all 0.3s;
}

.form-group input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.entry-buttons {
  display: flex;
  gap: 12px;
}

.hint {
  margin-top: 16px;
  font-size: 13px;
  color: #999;
}

/* 按钮 */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 500;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: #667eea;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #5a6fd6;
}

.btn-secondary {
  background: #f0f2f5;
  color: #333;
}

.btn-secondary:hover:not(:disabled) {
  background: #e4e6eb;
}

.btn-danger {
  background: #ff4d4f;
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #e64345;
}

.btn-small {
  padding: 6px 14px;
  font-size: 13px;
}

.btn-send {
  padding: 10px 20px;
  font-size: 14px;
}

/* 会议房间 */
.meeting-room {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  margin-bottom: 30px;
}

.hidden {
  display: none !important;
}

.room-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: #fafafa;
  border-bottom: 1px solid #eee;
}

.room-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.room-label {
  color: #666;
  font-size: 14px;
}

.room-id {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a2e;
}

.room-members {
  font-size: 14px;
  color: #667eea;
  background: #f0f2ff;
  padding: 4px 12px;
  border-radius: 12px;
}

.room-content {
  display: flex;
  gap: 20px;
  padding: 20px;
}

/* 屏幕共享区 */
.screen-area {
  flex: 1;
  min-width: 0;
}

.screen-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 15px;
  font-weight: 500;
  color: #333;
}

.screen-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #1a1a2e;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.screen-container video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
}

.screen-container video.active {
  display: block;
}

.screen-placeholder {
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  padding: 40px;
}

.placeholder-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.screen-placeholder p {
  font-size: 16px;
  margin-bottom: 8px;
}

.placeholder-hint {
  font-size: 13px !important;
  opacity: 0.6;
  max-width: 300px;
  margin: 0 auto;
}

.screen-controls {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  justify-content: center;
}

.control-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 20px;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: all 0.3s;
  min-width: 80px;
}

.control-btn:hover:not(:disabled) {
  border-color: #667eea;
  background: #f8f9ff;
}

.control-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.control-btn.active {
  background: #667eea;
  border-color: #667eea;
  color: white;
}

.control-btn.active:hover {
  background: #5a6fd6;
}

.control-icon {
  font-size: 24px;
}

.control-text {
  font-size: 12px;
}

/* 右侧面板 */
.side-panel {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.member-list,
.chat-area {
  background: #fafafa;
  border-radius: 8px;
  padding: 16px;
}

.member-list h4,
.chat-area h4 {
  font-size: 15px;
  margin-bottom: 12px;
  color: #333;
}

.members {
  max-height: 150px;
  overflow-y: auto;
}

.member-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 14px;
}

.member-item:hover {
  background: #f0f2f5;
}

.member-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #667eea;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
}

.member-name {
  flex: 1;
}

.member-status {
  font-size: 12px;
  color: #999;
}

.member-status.sharing {
  color: #52c41a;
}

.member-status.muted {
  color: #faad14;
}

.conn-icon {
  display: inline-block;
  margin-right: 6px;
  font-size: 10px;
  color: #ccc;
}

.conn-icon.connected {
  color: #52c41a;
}

.conn-icon.connecting {
  color: #faad14;
  animation: pulse 1s infinite;
}

.conn-icon.failed {
  color: #f5222d;
}

.conn-icon.disconnected {
  color: #8c8c8c;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* PWA 安装提示 */
.install-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding: 12px 16px;
  z-index: 1000;
  max-width: 360px;
  width: calc(100% - 40px);
  display: none;
}

.install-banner.show {
  display: block;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.install-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.install-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.install-text {
  flex: 1;
  min-width: 0;
}

.install-title {
  font-weight: 600;
  font-size: 14px;
  color: #333;
}

.install-desc {
  font-size: 12px;
  color: #999;
  margin-top: 2px;
}

.btn-install {
  padding: 8px 16px !important;
  font-size: 13px !important;
  flex-shrink: 0;
}

.install-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #ccc;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
  line-height: 1;
}

.install-close:hover {
  color: #999;
}

.empty-members,
.empty-chat {
  text-align: center;
  color: #999;
  font-size: 13px;
  padding: 20px 0;
}

/* 聊天区 */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 300px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 12px;
  min-height: 200px;
  max-height: 400px;
}

.chat-message {
  margin-bottom: 12px;
  font-size: 14px;
}

.chat-message .msg-header {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 12px;
}

.chat-message .msg-name {
  color: #667eea;
  font-weight: 500;
}

.chat-message .msg-time {
  color: #bbb;
}

.chat-message .msg-text {
  color: #333;
  word-break: break-word;
  line-height: 1.5;
}

.chat-message.self .msg-name {
  color: #52c41a;
}

.chat-input {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.chat-input textarea {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  font-size: 14px;
  resize: none;
  font-family: inherit;
  transition: border-color 0.3s;
}

.chat-input textarea:focus {
  outline: none;
  border-color: #667eea;
}

.chat-input textarea:disabled {
  background: #f5f5f5;
  cursor: not-allowed;
}

/* 底部 */
.footer {
  text-align: center;
  padding: 20px 0;
  color: #999;
  font-size: 13px;
  border-top: 1px solid #e8e8e8;
}

.footer-note {
  margin-top: 4px;
  font-size: 12px;
  color: #bbb;
}

/* 响应式 */
@media (max-width: 900px) {
  .room-content {
    flex-direction: column;
  }

  .side-panel {
    width: 100%;
  }

  .chat-area {
    min-height: 250px;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 12px;
  }

  .intro {
    padding: 24px;
  }

  .intro h2 {
    font-size: 22px;
  }

  .entry-form {
    flex-direction: column;
    align-items: stretch;
  }

  .entry-buttons {
    flex-direction: column;
  }

  .entry-buttons .btn {
    width: 100%;
  }

  .features {
    gap: 8px;
  }

  .feature-item {
    font-size: 13px;
    padding: 6px 14px;
  }
}
