/* 基础重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans SC', sans-serif;
  background: #F9FAFB;
  color: #111827;
  line-height: 1.5;
  min-height: 100vh;
}

/* 容器 */
.container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.header {
  background: #FFFFFF;
  border-bottom: 1px solid #E5E7EB;
  padding: 20px 24px;
}

.logo {
  font-size: 24px;
  font-weight: 600;
  color: #111827;
}

.github-link {
  position: absolute;
  right: 24px;
  top: 20px;
  color: #4F46E5;
  text-decoration: none;
  border: 1px solid #4F46E5;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s;
}

.github-link:hover {
  background: #4F46E5;
  color: #FFFFFF;
}

/* Main */
.main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* Upload Area */
.upload-area {
  background: #FFFFFF;
  border: 2px dashed #E5E7EB;
  border-radius: 16px;
  padding: 64px 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  max-width: 512px;
  width: 100%;
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: #4F46E5;
  background: #EEF2FF;
}

.upload-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.upload-icon {
  font-size: 64px;
}

.upload-text {
  font-size: 18px;
  font-weight: 500;
  color: #6B7280;
}

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

.link-btn {
  background: none;
  border: none;
  color: #4F46E5;
  cursor: pointer;
  text-decoration: underline;
  font-size: 14px;
  padding: 0;
}

.link-btn:hover {
  color: #4338CA;
}

.upload-info {
  font-size: 12px;
  color: #D1D5DB;
}

/* State Containers */
.state-container,
.error-container {
  text-align: center;
  padding: 64px 32px;
  max-width: 512px;
  width: 100%;
}

.state-icon,
.error-icon {
  font-size: 64px;
  display: block;
  margin-bottom: 16px;
}

.state-text,
.error-text {
  font-size: 18px;
  font-weight: 500;
  color: #6B7280;
  margin-bottom: 8px;
}

.state-hint {
  font-size: 14px;
  color: #9CA3AF;
}

.error-text {
  color: #EF4444;
  line-height: 1.6;
}

/* Result */
.result-container {
  width: 100%;
  max-width: 1024px;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

@media (min-width: 768px) {
  .result-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.result-card {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.result-title {
  font-size: 14px;
  font-weight: 500;
  color: #9CA3AF;
  text-align: center;
  margin-bottom: 12px;
}

.image-wrapper {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: #FFFFFF;
}

.image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Checkerboard pattern for transparency */
.checkerboard {
  background-image: 
    linear-gradient(45deg, #E5E7EB 25%, transparent 25%),
    linear-gradient(-45deg, #E5E7EB 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #E5E7EB 75%),
    linear-gradient(-45deg, transparent 75%, #E5E7EB 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 448px;
  margin: 0 auto;
}

.btn {
  padding: 14px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: #4F46E5;
  color: #FFFFFF;
}

.btn-primary:hover {
  background: #4338CA;
}

.btn-secondary {
  background: #F3F4F6;
  color: #6B7280;
}

.btn-secondary:hover {
  background: #E5E7EB;
}

/* Footer */
.footer {
  background: #FFFFFF;
  border-top: 1px solid #E5E7EB;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #D1D5DB;
}

/* Animations */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-pulse {
  animation: pulse 1.5s ease-in-out infinite;
}
