/* 全局样式 */
* {
  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: #f5f5f5;
  color: #333;
  min-height: 100vh;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 加载状态 */
.loading {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e0e0e0;
  border-top-color: #07c160;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading p {
  margin-top: 15px;
  color: #999;
}

/* 容器 */
.container {
  flex: 1;
  padding: 15px;
  padding-bottom: 60px;
}

/* 头部 */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: #fff;
  border-radius: 8px;
  margin-bottom: 15px;
}

.header h1 {
  font-size: 18px;
  font-weight: 600;
}

.user-info {
  font-size: 14px;
  color: #666;
}

.duration strong {
  color: #07c160;
  font-weight: 600;
}

/* 设备列表 */
.device-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.device-item {
  display: flex;
  align-items: center;
  padding: 15px;
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.device-item:active {
  transform: scale(0.98);
}

.device-icon {
  font-size: 28px;
  margin-right: 12px;
}

.device-info {
  flex: 1;
}

.device-name {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 4px;
}

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

.device-status.idle {
  color: #07c160;
}

.device-status.controlling {
  color: #ff6b6b;
}

.device-status.waiting {
  color: #faa500;
}

.device-arrow {
  font-size: 20px;
  color: #ccc;
}

/* 空状态 */
.empty {
  text-align: center;
  padding: 50px;
  color: #999;
}

/* 底部 */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 15px;
  background: #fff;
  border-top: 1px solid #e0e0e0;
  text-align: center;
  font-size: 12px;
  color: #999;
}

/* 弹窗 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  overflow: hidden;
}

.modal-header {
  padding: 15px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  font-size: 24px;
  color: #999;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 15px;
}

/* 视频播放器 */
.video-container {
  position: relative;
  background: #000;
  aspect-ratio: 16/9;
  border-radius: 8px;
  overflow: hidden;
}

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

/* 控制栏 */
.control-bar {
  padding: 15px;
  background: #fff;
}

.timer {
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
}

.timer.warning {
  color: #faa500;
}

.timer.danger {
  color: #ff6b6b;
}

.timer-text {
  font-size: 14px;
  color: #666;
  margin-bottom: 15px;
}

.btn-group {
  display: flex;
  gap: 10px;
}

.btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
}

.btn-primary {
  background: #07c160;
  color: #fff;
}

.btn-danger {
  background: #ff6b6b;
  color: #fff;
}

.btn-secondary {
  background: #e0e0e0;
  color: #666;
}

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

/* 排队状态 */
.queue-info {
  padding: 15px;
  background: #fff;
  border-radius: 8px;
  text-align: center;
}

.queue-position {
  font-size: 48px;
  font-weight: 600;
  color: #07c160;
}

.queue-label {
  font-size: 14px;
  color: #666;
  margin-top: 5px;
}

/* 提示 */
.hint {
  padding: 10px;
  background: #fff3cd;
  border-radius: 6px;
  font-size: 13px;
  color: #856404;
  margin-bottom: 15px;
}