* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: #f5f7fa;
  color: #333;
  line-height: 1.6;
  padding: 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 30px;
}

h1 {
  text-align: center;
  color: #2c3e50;
  margin-bottom: 20px;
  font-weight: 600;
}

.subtitle {
  text-align: center;
  color: #7f8c8d;
  margin-bottom: 30px;
}

.upload-section {
  border: 2px dashed #3498db;
  border-radius: 10px;
  padding: 30px;
  text-align: center;
  margin-bottom: 30px;
  background-color: #f8fafc;
  transition: all 0.3s ease;
}

.upload-section:hover {
  background-color: #e8f4fc;
  border-color: #2980b9;
}

.upload-btn {
  background-color: #3498db;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: background-color 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 5px;
}

.upload-btn:hover {
  background-color: #2980b9;
}

.upload-btn:disabled {
  background-color: #bdc3c7;
  cursor: not-allowed;
}

.analyze-btn {
  background-color: #2ecc71;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: background-color 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
}

.analyze-btn:hover {
  background-color: #27ae60;
}

.analyze-btn:disabled {
  background-color: #bdc3c7;
  cursor: not-allowed;
}

.image-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 20px;
}

.preview-item {
  position: relative;
  width: 150px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.preview-item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.preview-info {
  padding: 8px;
  background-color: white;
  font-size: 14px;
}

.status-badge {
  position: absolute;
  top: 5px;
  left: 5px;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: bold;
}

.status-uploading {
  background-color: #3498db;
  color: white;
}

.status-success {
  background-color: #2ecc71;
  color: white;
}

.status-error {
  background-color: #e74c3c;
  color: white;
}

.remove-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  background-color: rgba(231, 76, 60, 0.8);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
}

.results-section {
  margin-top: 40px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 30px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  overflow: hidden;
}

.data-table th {
  background-color: #3498db;
  color: white;
  padding: 12px 15px;
  text-align: left;
}

.data-table td {
  padding: 12px 15px;
  border-bottom: 1px solid #e0e0e0;
}

.data-table tr:nth-child(even) {
  background-color: #f8f9fa;
}

.data-table tr:hover {
  background-color: #e8f4fc;
}

.middle-value {
  background-color: #ffeaa7 !important;
  font-weight: bold;
}

.chart-container {
  height: 400px;
  margin: 30px 0;
  position: relative;
}

.question-section {
  background-color: #f8f9fa;
  border-left: 4px solid #3498db;
  padding: 20px;
  margin-top: 40px;
  border-radius: 0 8px 8px 0;
}

.question-section h3 {
  color: #2c3e50;
  margin-bottom: 15px;
}

.question {
  margin-bottom: 15px;
  font-weight: 500;
}

.status-message {
  padding: 12px;
  border-radius: 6px;
  margin: 15px 0;
  text-align: center;
}

.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.processing {
  background-color: #cce7ff;
  color: #004085;
  border: 1px solid #b3d7ff;
}

.progress-bar {
  height: 6px;
  background-color: #e0e0e0;
  border-radius: 3px;
  margin-top: 10px;
  overflow: hidden;
}

.progress {
  height: 100%;
  background-color: #3498db;
  transition: width 0.3s;
}

/* 弹窗样式 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background-color: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  max-width: 500px;
  width: 90%;
  text-align: center;
}

.modal-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 15px;
  color: #2c3e50;
}

.modal-message {
  margin-bottom: 20px;
  color: #7f8c8d;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.modal-progress {
  margin-top: 15px;
}

/* 摄像头弹窗样式 */
.camera-modal {
  max-width: 90%;
  width: 500px;
  padding: 20px;
}

.camera-container {
  width: 100%;
  height: 300px;
  margin: 15px 0;
  border-radius: 8px;
  overflow: hidden;
  background-color: #000;
  position: relative;
}

.camera-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin: 20px 0;
}

.camera-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.capture-btn {
  background-color: #e74c3c;
  color: white;
}

.capture-btn:hover {
  background-color: #c0392b;
  transform: scale(1.1);
}

.cancel-btn {
  background-color: #7f8c8d;
  color: white;
}

.cancel-btn:hover {
  background-color: #636e72;
  transform: scale(1.1);
}

.camera-help {
  text-align: center;
  color: #7f8c8d;
  font-size: 14px;
  margin-top: 10px;
}

/* 特殊按钮样式 */
.upload-btn[style*="background-color: #9b59b6"] {
  background-color: #9b59b6 !important;
}

.upload-btn[style*="background-color: #9b59b6"]:hover {
  background-color: #8e44ad !important;
}

.upload-btn[style*="background-color: #f39c12"] {
  background-color: #f39c12 !important;
}

.upload-btn[style*="background-color: #f39c12"]:hover {
  background-color: #e67e22 !important;
}