/* 物体检测页面样式 */
.detection-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  font-family: system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
}

.detection-title {
  text-align: center;
  margin: 10px 0 30px;
  color: #fff;
  font-size: 2.5em;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.detection-pill {
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  color: #fff;
  margin-left: 10px;
  font-size: 14px;
  font-weight: normal;
}

.detection-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  margin: 20px 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.detection-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
}

.detection-card h3 {
  margin: 0 0 20px;
  color: #333;
  font-size: 1.5em;
  font-weight: 600;
}

.detection-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

.param-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 200px;
}

.param-group label {
  font-weight: 500;
  color: #555;
  min-width: 80px;
}

.detection-select {
  padding: 8px 12px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  transition: border-color 0.3s;
}

.detection-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.detection-slider {
  width: 120px;
  height: 6px;
  border-radius: 3px;
  background: #ddd;
  outline: none;
  transition: background 0.3s;
}

.detection-slider::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #667eea;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.3s;
}

.detection-slider::-webkit-slider-thumb:hover {
  background: #5a6fd8;
  transform: scale(1.2);
}

.detection-btn {
  padding: 12px 20px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detection-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.detection-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.detection-btn-green {
  background: linear-gradient(135deg, #2da44e, #28a745);
}

.detection-btn-blue {
  background: linear-gradient(135deg, #1f6feb, #0366d6);
}

.detection-btn-red {
  background: linear-gradient(135deg, #d73a49, #dc3545);
}

.detection-progress-container {
  margin: 20px 0;
  text-align: center;
}

.detection-bar {
  height: 12px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  overflow: hidden;
  margin: 8px 0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.detection-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  width: 0;
  transition: width 0.3s ease;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.detection-bar > span::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

#progress-text {
  font-size: 14px;
  color: #666;
  margin-top: 10px;
  font-weight: 500;
}

.detection-stage {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

#detection-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  width: 100%;
  max-width: 1200px;
}

.image-container {
  text-align: center;
}

.image-container h4 {
  margin: 0 0 15px;
  color: #333;
  font-size: 1.2em;
  font-weight: 600;
}

.image-placeholder {
  width: 100%;
  height: 300px;
  border: 2px dashed #ddd;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.02);
  transition: all 0.3s ease;
}

.image-placeholder:hover {
  border-color: #667eea;
  background: rgba(102, 126, 234, 0.05);
}

.placeholder-text {
  text-align: center;
  color: #999;
}

.placeholder-text i {
  font-size: 3em;
  display: block;
  margin-bottom: 15px;
  opacity: 0.5;
}

.placeholder-text p {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

.image-container img {
  max-width: 100%;
  max-height: 400px;
  border-radius: 15px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
}

.image-container img:hover {
  transform: scale(1.02);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.stat-item {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
}

.stat-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-label {
  display: block;
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
  font-weight: 500;
}

.stat-value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: #333;
}

.results-container {
  background: #f8f9fa;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e9ecef;
}

.results-header {
  display: grid;
  grid-template-columns: 2fr 1fr 2fr 1fr;
  gap: 15px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 15px 20px;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.results-list {
  max-height: 300px;
  overflow-y: auto;
}

.result-item {
  display: grid;
  grid-template-columns: 2fr 1fr 2fr 1fr;
  gap: 15px;
  padding: 15px 20px;
  border-bottom: 1px solid #e9ecef;
  transition: background-color 0.2s ease;
}

.result-item:hover {
  background-color: rgba(102, 126, 234, 0.05);
}

.result-item:last-child {
  border-bottom: none;
}

.class-name {
  font-weight: 600;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}

.class-icon {
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 50%;
  display: inline-block;
}

.confidence {
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  text-align: center;
  color: white;
  font-size: 12px;
}

.confidence.high { background: #28a745; }
.confidence.medium { background: #ffc107; color: #000; }
.confidence.low { background: #dc3545; }

.coordinates {
  font-family: monospace;
  font-size: 12px;
  color: #666;
  line-height: 1.4;
}

.dimensions {
  font-weight: 500;
  color: #495057;
  font-size: 14px;
}

.system-info {
  color: #555;
  line-height: 1.6;
}

.system-info p {
  margin: 10px 0;
}

.system-info ul {
  margin: 10px 0;
  padding-left: 20px;
}

.system-info li {
  margin: 5px 0;
  padding: 8px 12px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 8px;
  border-left: 4px solid #667eea;
}

#detection-file {
  padding: 10px 15px;
  border: 2px solid #e1e5e9;
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  transition: all 0.3s ease;
  flex: 1;
  max-width: 300px;
}

#detection-file:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .detection-container {
    padding: 15px;
  }
  
  .detection-title {
    font-size: 2em;
  }
  
  .detection-pill {
    display: block;
    margin: 10px 0 0;
    text-align: center;
  }
  
  #detection-wrap {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .detection-row {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }
  
  .param-group {
    justify-content: space-between;
    min-width: auto;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .results-header,
  .result-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .results-header {
    text-align: center;
  }
  
  .result-item {
    text-align: center;
    padding: 15px;
  }
}

/* 动画效果 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.detection-card {
  animation: fadeIn 0.6s ease forwards;
}

.detection-card:nth-child(2) { animation-delay: 0.1s; }
.detection-card:nth-child(3) { animation-delay: 0.2s; }
.detection-card:nth-child(4) { animation-delay: 0.3s; }
.detection-card:nth-child(5) { animation-delay: 0.4s; }

/* 滚动条样式 */
.results-list::-webkit-scrollbar {
  width: 8px;
}

.results-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.results-list::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 4px;
}

.results-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #5a6fd8, #6a4c93);
}