/* 工地检测助手页面样式 */

.construction-detection-page {
  min-height: 100vh;
}

.construction-detection-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  font-family: 'Noto Sans SC', sans-serif;
}

/* 上传区域样式 */
.upload-section {
  margin-bottom: 30px;
}

.upload-area {
  border: 3px dashed #49b1f5;
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, #f8f9ff 0%, #e8f4fd 100%);
  position: relative;
  overflow: hidden;
}

.upload-area:hover {
  border-color: #0084ff;
  background: linear-gradient(135deg, #f0f7ff 0%, #e0f0ff 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(73, 177, 245, 0.15);
}

.upload-area.dragover {
  border-color: #0084ff;
  background: linear-gradient(135deg, #e8f4ff 0%, #d0ebff 100%);
  transform: scale(1.02);
}

.upload-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.8;
}

.upload-text p {
  margin: 8px 0;
  color: #666;
}

.upload-text p:first-child {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.upload-hint {
  font-size: 14px;
  color: #999;
}

/* 图片预览样式 */
.image-preview {
  margin-top: 20px;
  text-align: center;
  position: relative;
  display: inline-block;
}

.image-preview img {
  max-width: 100%;
  max-height: 400px;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.remove-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 77, 77, 0.9);
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
}

.remove-btn:hover {
  background: #ff4757;
  transform: scale(1.1);
}

/* 检测选项样式 */
.detection-options {
  margin-bottom: 30px;
  padding: 25px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.detection-options h3 {
  margin-bottom: 20px;
  color: #333;
  font-size: 20px;
  font-weight: 600;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
}

.option-item {
  display: flex;
  align-items: center;
  padding: 15px;
  border: 2px solid #f0f0f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #fafafa;
}

.option-item:hover {
  border-color: #49b1f5;
  background: #f8f9ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(73, 177, 245, 0.1);
}

.option-item input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 20px;
  height: 20px;
  border: 2px solid #ddd;
  border-radius: 4px;
  margin-right: 12px;
  position: relative;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.option-item input[type="checkbox"]:checked + .checkmark {
  background: #49b1f5;
  border-color: #49b1f5;
}

.option-item input[type="checkbox"]:checked + .checkmark::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.option-content {
  flex: 1;
}

.option-content strong {
  display: block;
  margin-bottom: 4px;
  color: #333;
  font-size: 16px;
}

.option-content small {
  color: #666;
  font-size: 13px;
  line-height: 1.4;
}

/* 自定义提示框样式 */
.custom-prompt {
  margin-bottom: 30px;
  padding: 25px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.custom-prompt h3 {
  margin-bottom: 15px;
  color: #333;
  font-size: 20px;
  font-weight: 600;
}

.custom-prompt textarea {
  width: 100%;
  padding: 15px;
  border: 2px solid #f0f0f0;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  min-height: 100px;
  font-family: 'Noto Sans SC', sans-serif;
  transition: all 0.3s ease;
}

.custom-prompt textarea:focus {
  outline: none;
  border-color: #49b1f5;
  box-shadow: 0 0 0 3px rgba(73, 177, 245, 0.1);
}

/* 操作按钮样式 */
.action-buttons {
  text-align: center;
  margin-bottom: 40px;
}

.detect-btn, .clear-btn {
  padding: 15px 30px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 0 10px;
  min-width: 140px;
}

.detect-btn {
  background: linear-gradient(135deg, #49b1f5 0%, #0084ff 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(73, 177, 245, 0.3);
}

.detect-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(73, 177, 245, 0.4);
}

.detect-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  box-shadow: none;
}

.clear-btn {
  background: #f8f9fa;
  color: #666;
  border: 2px solid #e9ecef;
}

.clear-btn:hover {
  background: #e9ecef;
  transform: translateY(-2px);
}

/* 结果区域样式 */
.results-section {
  margin-top: 40px;
  padding: 30px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.results-header {
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 20px;
  margin-bottom: 25px;
}

.results-header h3 {
  margin-bottom: 10px;
  color: #333;
  font-size: 24px;
  font-weight: 600;
}

.result-meta {
  display: flex;
  gap: 20px;
  font-size: 14px;
  color: #666;
}

.results-content {
  line-height: 1.8;
  color: #333;
}

.results-actions {
  margin-top: 25px;
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #f0f0f0;
}

.download-btn, .share-btn {
  padding: 10px 20px;
  margin: 0 10px;
  border: 2px solid #49b1f5;
  border-radius: 6px;
  background: transparent;
  color: #49b1f5;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.download-btn:hover, .share-btn:hover {
  background: #49b1f5;
  color: white;
  transform: translateY(-1px);
}

/* 加载动画 */
.btn-loading {
  display: inline-block;
  animation: spin 1s linear infinite;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
  .construction-detection-container {
    padding: 15px;
  }
  
  .option-grid {
    grid-template-columns: 1fr;
  }
  
  .action-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }
  
  .detect-btn, .clear-btn {
    margin: 0;
  }
  
  .result-meta {
    flex-direction: column;
    gap: 10px;
  }
}

/* 暗色主题适配 */
[data-theme="dark"] .construction-detection-container {
  color: #e1e1e1;
}

[data-theme="dark"] .upload-area {
  background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
  border-color: #555;
}

[data-theme="dark"] .upload-area:hover {
  background: linear-gradient(135deg, #333 0%, #222 100%);
  border-color: #49b1f5;
}

[data-theme="dark"] .detection-options,
[data-theme="dark"] .custom-prompt,
[data-theme="dark"] .results-section {
  background: #2a2a2a;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .option-item {
  background: #333;
  border-color: #444;
}

[data-theme="dark"] .option-item:hover {
  background: #3a3a3a;
  border-color: #49b1f5;
}

[data-theme="dark"] .custom-prompt textarea {
  background: #333;
  border-color: #444;
  color: #e1e1e1;
}

[data-theme="dark"] .clear-btn {
  background: #333;
  color: #e1e1e1;
  border-color: #444;
}

[data-theme="dark"] .clear-btn:hover {
  background: #444;
}

/* 页脚提示样式 */
.footer-note {
  margin-top: 40px;
  padding: 20px;
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  border-left: 4px solid #f39c12;
  border-radius: 8px;
  color: #856404;
}

[data-theme="dark"] .footer-note {
  background: linear-gradient(135deg, #3d3d1a 0%, #4d4d2a 100%);
  color: #f4d03f;
  border-left-color: #f4d03f;
}
