:root {
  --primary-color: #1890ff;
  --error-color: #ff4d4f;
  --text-color: #fff;
  --bg-overlay: rgba(0, 0, 0, 0.3);
  --control-size: 50px;
}

body,
html {
  margin: 0;
  padding: 0;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background-color: #000;
  color: var(--text-color);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.video-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#localPreview {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: rotateY(180deg); /* 镜像效果 */
  background-color: #000;
}

/* 控制按钮样式 */
.controls {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom, 0)); /* 基础间距 + 安全距离 */
  left: 80%;
  height: 90px;
}

.control-btn {
  width: var(--control-size);
  height: var(--control-size);
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  border: none;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
  pointer-events: auto;
  margin-bottom: 10px;
  display: block;
}

.control-btn:active {
  transform: scale(0.95);
}

/* 状态信息 */
.status-overlay {
  position: absolute;
  top: 50px;
  left: 0;
  right: 0;
  text-align: center;
  padding: 8px 15px;
  background-color: var(--bg-overlay);
  z-index: 5;
}

.status-text {
  font-size: 14px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* 错误面板 */
.error-panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  display: none;
  z-index: 20;
}

.error-content {
  max-width: 90%;
}

.error-content h2 {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.error-content p {
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.btn {
  padding: 10px 20px;
  border-radius: 20px;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.retry-btn {
  background-color: white;
  color: #333;
}

#toggleAudioBtn,
#switchCameraBtn {
  display: none;
}
