* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}

.container {
  max-width: 1200px;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px;
  text-align: center;
}

.header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header p {
  font-size: 1.1rem;
  opacity: 0.9;
  font-weight: 300;
}

.player-section {
  padding: 40px;
  text-align: center;
}

.player-wrapper {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

#player-container-id {
  width: 100%;
  height: 450px;
  background: #000;
  border-radius: 15px;
}

.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  border-radius: 15px;
  z-index: 10;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.error-message {
  background: #ff6b6b;
  color: white;
  padding: 15px 20px;
  border-radius: 10px;
  margin: 20px 0;
  display: none;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.controls {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
}

.control-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.control-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.control-btn:active {
  transform: translateY(0);
}

.status {
  margin-top: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 10px;
  border-left: 4px solid #667eea;
}

.status h3 {
  color: #333;
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.status p {
  color: #666;
  line-height: 1.6;
}

/* 播放源切换控件样式 */
.source-controls {
  margin-top: 25px;
  padding: 20px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 15px;
  border: 2px solid #e9ecef;
  text-align: center;
}

.source-controls h4 {
  color: #495057;
  margin-bottom: 15px;
  font-size: 1.1rem;
  font-weight: 600;
}

.source-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

.source-btn {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
  min-width: 80px;
}

.source-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
  background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
}

.source-btn:active {
  transform: translateY(0);
}

.source-tip {
  color: #6c757d;
  font-size: 0.85rem;
  margin: 0;
  font-style: italic;
}

/* 设备信息显示样式 */
.device-info {
  margin-top: 20px;
  padding: 15px;
  background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
  border-radius: 10px;
  border-left: 4px solid #2196f3;
}

.device-info h4 {
  color: #1976d2;
  margin-bottom: 12px;
  font-size: 1rem;
  font-weight: 600;
}

.device-detail-item {
  margin-bottom: 8px;
  padding: 5px 0;
  color: #424242;
  font-size: 0.9rem;
  border-bottom: 1px dotted #e0e0e0;
}

.device-detail-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.device-detail-item strong {
  color: #1976d2;
  margin-right: 8px;
}

/* 开发版本提示样式 */
.dev-notice {
  margin-top: 15px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 235, 59, 0.1) 100%);
  border: 1px solid #ffc107;
  border-radius: 8px;
  color: #856404;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
}

/* HTML5播放器特殊样式 */
.html5-player {
  width: 100%;
  height: 450px;
  background: #000;
  border-radius: 15px;
  outline: none;
}

.html5-player:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

.footer {
  text-align: center;
  padding: 20px;
  color: #666;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .header h1 {
    font-size: 2rem;
  }
  
  .player-section {
    padding: 20px;
  }
  
  #player-container-id {
    height: 300px;
  }
  
  .controls {
    flex-direction: column;
    align-items: center;
  }
  
  .control-btn {
    width: 200px;
  }
  
  .source-controls {
    padding: 15px;
    margin-top: 20px;
  }
  
  .source-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .source-btn {
    width: 120px;
    margin: 5px 0;
  }
  
  .source-controls h4 {
    font-size: 1rem;
  }
  
  .source-tip {
    font-size: 0.8rem;
  }
}

/* 设备信息增强样式 */
.device-info {
  animation: fadeInUp 0.6s ease-out;
  border-left: 4px solid #4caf50;
  background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
}

.device-info h4 {
  color: #2e7d32;
}

/* 能力标识徽章 */
.capability-badges {
  margin-left: 10px;
}

.badge {
  display: inline-block;
  padding: 2px 6px;
  margin: 0 2px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-success {
  background: #4caf50;
  color: white;
}

.badge-error {
  background: #f44336;
  color: white;
}

/* 优先级徽章 */
.priority-badge {
  display: inline-block;
  padding: 4px 8px;
  margin: 0 4px;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
}

.priority-webrtc {
  background: linear-gradient(135deg, #ff5722 0%, #ff7043 100%);
}

.priority-hls {
  background: linear-gradient(135deg, #2196f3 0%, #42a5f5 100%);
}

.priority-flv {
  background: linear-gradient(135deg, #9c27b0 0%, #ba68c8 100%);
}

/* 置信度指示器 */
.confidence-high {
  color: #4caf50;
  font-weight: 700;
}

.confidence-medium {
  color: #ff9800;
  font-weight: 600;
}

.confidence-low {
  color: #f44336;
  font-weight: 500;
}

/* 网络速度显示 */
.network-speed {
  color: #666;
  font-size: 0.85rem;
  margin-left: 5px;
}

/* 播放源激活状态 */
.source-btn-active {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.5) !important;
  transform: translateY(-1px);
  border: 2px solid #0056b3;
}

/* 当前播放源状态指示器 */
.current-source-webrtc {
  color: #ff5722;
  font-weight: 700;
}

.current-source-hls {
  color: #2196f3;
  font-weight: 700;
}

.current-source-flv {
  color: #9c27b0;
  font-weight: 700;
}

/* 播放源图例 */
.source-info {
  margin-top: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 8px;
}

.source-legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
}

.legend-item {
  display: flex;
  align-items: center;
  font-size: 0.85rem;
  color: #555;
}

.legend-icon {
  margin-right: 5px;
  font-size: 1rem;
}

.webrtc-icon { color: #ff5722; }
.hls-icon { color: #2196f3; }
.flv-icon { color: #9c27b0; }

/* 页脚快捷键样式 */
.footer-hotkeys {
  margin-top: 8px;
  font-size: 0.8rem;
  color: #888;
}

kbd {
  display: inline-block;
  padding: 2px 6px;
  background: #f5f5f5;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-family: monospace;
  font-size: 0.75rem;
  color: #333;
  margin: 0 2px;
}

/* 动画效果 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 脉冲动画用于重要状态 */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.source-btn-active {
  animation: pulse 1.5s ease-in-out;
}

@media (max-width: 768px) {
  .device-info {
    padding: 12px;
    margin-top: 15px;
  }
  
  .capability-badges {
    margin-top: 8px;
    margin-left: 0;
  }
  
  .source-legend {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
  
  .priority-badge {
    font-size: 0.7rem;
    padding: 3px 6px;
    margin: 0 2px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 10px;
  }
  
  .header {
    padding: 20px;
  }
  
  .header h1 {
    font-size: 1.5rem;
  }
  
  #player-container-id {
    height: 250px;
  }
  
  .device-info {
    padding: 10px;
  }
  
  .device-detail-item {
    margin-bottom: 10px;
    font-size: 0.85rem;
  }
  
  .badge {
    font-size: 0.7rem;
    padding: 1px 4px;
  }
  
  .footer-hotkeys {
    font-size: 0.7rem;
  }
  
  kbd {
    padding: 1px 4px;
    font-size: 0.7rem;
  }
}
