* {
  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: #f5f7fa;
  min-height: 100vh;
  padding: 40px 20px;
  color: #333;
}

.container {
  max-width: 900px;
  margin: 0 auto;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 40px;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.subtitle {
  font-size: 1.125rem;
  color: #666;
  font-weight: 400;
}

/* Upload Area */
.upload-area {
  background: white;
  border: 2px dashed #d0d7de;
  border-radius: 16px;
  padding: 80px 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 40px;
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: #0969da;
  background: #f0f7ff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(9, 105, 218, 0.12);
}

.upload-content {
  pointer-events: none;
}

.upload-icon-wrapper {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background: #f0f7ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-icon {
  width: 40px;
  height: 40px;
  color: #0969da;
}

.upload-content h3 {
  font-size: 1.25rem;
  color: #1a1a1a;
  margin-bottom: 12px;
  font-weight: 500;
}

.file-info {
  color: #666;
  font-size: 0.9375rem;
  margin-bottom: 8px;
}

.hint {
  font-size: 0.8125rem;
  color: #999;
}

/* Loading Area */
.loading-area {
  background: white;
  border-radius: 16px;
  padding: 80px 40px;
  text-align: center;
  margin-bottom: 40px;
}

.loading-content h3 {
  font-size: 1.25rem;
  color: #1a1a1a;
  margin: 24px 0 8px;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid #e1e4e8;
  border-top-color: #0969da;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

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

.loading-area .hint {
  color: #999;
  font-size: 0.875rem;
}

/* Result Area */
.result-area {
  background: white;
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 40px;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e1e4e8;
}

.result-header h3 {
  color: #28a745;
  font-size: 1.25rem;
  font-weight: 600;
}

/* Comparison Container */
.comparison-container {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  justify-content: center;
}

.image-panel {
  flex: 1;
  max-width: 50%;
}

.panel-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #666;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
}

.image-wrapper {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  background: 
    linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
    linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
    linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
  border: 1px solid #e1e4e8;
}

.image-wrapper canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

#original-canvas,
#result-canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

.result-actions {
  display: flex;
  justify-content: center;
}

/* Error Area */
.error-area {
  background: white;
  border-radius: 16px;
  padding: 60px 40px;
  text-align: center;
  margin-bottom: 40px;
}

.error-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.error-area h3 {
  color: #dc3545;
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.error-area p {
  color: #666;
  margin-bottom: 24px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* Buttons */
.btn-primary,
.btn-secondary {
  padding: 12px 28px;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.btn-primary {
  background: #0969da;
  color: white;
}

.btn-primary:hover {
  background: #0860c4;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(9, 105, 218, 0.3);
}

.btn-secondary {
  background: #f6f8fa;
  color: #24292f;
  border: 1px solid #d0d7de;
}

.btn-secondary:hover {
  background: #f3f4f6;
  border-color: #b1b5bc;
}

/* Features Section */
.features-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid #e1e4e8;
}

.feature-item {
  text-align: center;
  padding: 24px;
  background: white;
  border-radius: 12px;
  transition: transform 0.2s ease;
}

.feature-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.feature-item h4 {
  font-size: 1rem;
  color: #1a1a1a;
  margin-bottom: 8px;
  font-weight: 600;
}

.feature-item p {
  font-size: 0.875rem;
  color: #666;
  line-height: 1.5;
}

/* Footer */
footer {
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 20px 16px;
  }

  header h1 {
    font-size: 1.75rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .upload-area {
    padding: 60px 24px;
  }

  .upload-icon-wrapper {
    width: 64px;
    height: 64px;
  }

  .upload-icon {
    width: 32px;
    height: 32px;
  }

  .comparison-container {
    flex-direction: column;
  }

  .image-panel {
    max-width: 100%;
  }

  .features-section {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .result-header {
    flex-direction: column;
    gap: 16px;
  }
}
