.upload-container {
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  transition: all 0.3s ease;
  background-color: #f9fafb;

  &.drag-over {
    border-color: #3b82f6;
    background-color: #eff6ff;
    transform: scale(1.02);
  }

  &.disabled {
    opacity: 0.6;
    cursor: not-allowed;

    .upload-area {
      cursor: not-allowed;
    }
  }

  &.uploading {
    border-color: #6b7280;
    background-color: #f3f4f6;
  }
}

.upload-area {
  cursor: pointer;
  transition: all 0.3s ease;

  &:hover {
    .upload-icon {
      color: #3b82f6;
    }
  }
}

.upload-icon {
  color: #6b7280;
  margin-bottom: 16px;
  transition: color 0.3s ease;
}

.upload-text {
  color: #374151;

  .upload-title {
    font-size: 16px;
    font-weight: 500;
    margin: 0 0 8px 0;

    .upload-link {
      color: #3b82f6;
      text-decoration: underline;
      cursor: pointer;

      &:hover {
        color: #2563eb;
      }
    }
  }

  .upload-hint {
    font-size: 14px;
    color: #6b7280;
    margin: 4px 0;
  }
}

.file-input {
  display: none;
}

.upload-progress {
  display: flex;
  align-items: center;
  gap: 16px;
}

.progress-icon {
  color: #3b82f6;

  .spin {
    animation: spin 1s linear infinite;
  }
}

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

.progress-content {
  flex: 1;

  .progress-title {
    font-size: 16px;
    font-weight: 500;
    margin: 0 0 12px 0;
    color: #374151;
  }

  .progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
  }

  .progress-fill {
    height: 100%;
    background-color: #3b82f6;
    transition: width 0.3s ease;
    border-radius: 4px;
  }

  .progress-text {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
  }
}

.upload-results {
  margin-top: 24px;
  text-align: left;

  .results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;

    h4 {
      margin: 0;
      font-size: 16px;
      font-weight: 500;
      color: #374151;
    }

    .clear-btn {
      background: none;
      border: none;
      color: #6b7280;
      cursor: pointer;
      font-size: 14px;
      padding: 4px 8px;
      border-radius: 4px;
      transition: all 0.2s ease;

      &:hover {
        background-color: #f3f4f6;
        color: #374151;
      }
    }
  }

  .file-list {
    .file-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px;
      border-radius: 6px;
      margin-bottom: 8px;
      background-color: #f9fafb;
      border: 1px solid #e5e7eb;
      transition: all 0.2s ease;

      &.success {
        border-color: #d1fae5;
        background-color: #ecfdf5;
      }

      &.error {
        border-color: #fee2e2;
        background-color: #fef2f2;
      }

      &:hover {
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
      }
    }

    .file-icon {
      flex-shrink: 0;
      width: 32px;
      height: 32px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 4px;
      background-color: #f3f4f6;

      .file-item.success & {
        background-color: #d1fae5;
        color: #065f46;
      }

      .file-item.error & {
        background-color: #fee2e2;
        color: #991b1b;
      }
    }

    .file-info {
      flex: 1;
      min-width: 0;

      .file-name {
        font-size: 14px;
        font-weight: 500;
        margin: 0 0 4px 0;
        color: #374151;
      }

      .file-error {
        font-size: 12px;
        color: #dc2626;
        margin: 0 0 4px 0;
      }

      .file-url {
        margin: 0;

        a {
          font-size: 12px;
          color: #3b82f6;
          text-decoration: none;

          &:hover {
            text-decoration: underline;
          }
        }
      }
    }

    .file-actions {
      flex-shrink: 0;

      .remove-btn {
        background: none;
        border: none;
        color: #6b7280;
        cursor: pointer;
        padding: 4px;
        border-radius: 4px;
        transition: all 0.2s ease;

        &:hover {
          background-color: #fee2e2;
          color: #dc2626;
        }
      }
    }
  }
}

.preview-area {
  margin-top: 24px;

  .preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
  }

  .preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;

    .preview-image {
      width: 100%;
      height: 120px;
      object-fit: cover;
      display: block;
    }

    .preview-remove {
      position: absolute;
      top: 4px;
      right: 4px;
      background-color: rgba(239, 68, 68, 0.9);
      border: none;
      border-radius: 4px;
      color: white;
      cursor: pointer;
      padding: 4px;
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0;
      transition: opacity 0.2s ease;

      &:hover {
        background-color: rgba(220, 38, 38, 1);
      }
    }

    &:hover {
      .preview-remove {
        opacity: 1;
      }
    }
  }
}

// 响应式设计
@media (max-width: 640px) {
  .upload-container {
    padding: 16px;
  }

  .upload-text .upload-title {
    font-size: 14px;
  }

  .upload-text .upload-hint {
    font-size: 12px;
  }

  .upload-progress {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .preview-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
  }

  .preview-item .preview-image {
    height: 80px;
  }
}