.bgtrans-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}

@media (max-width: 1024px) {
  .bgtrans-layout {
    grid-template-columns: 1fr;
  }
}

.bgtrans-left,
.bgtrans-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.upload-zone {
  border: 2px dashed #c9cdd4;
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #fafafa;
  position: relative;
  min-height: 350px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-zone:hover {
  border-color: #165DFF;
  background: #f0f5ff;
}

.upload-zone.dragover {
  border-color: #165DFF;
  background: #e8f3ff;
  transform: scale(1.01);
}

.upload-content {
  pointer-events: none;
}

.upload-icon {
  margin-bottom: 16px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.upload-title {
  font-size: 16px;
  font-weight: 600;
  color: #1d2129;
  margin-bottom: 8px;
}

.upload-subtitle {
  font-size: 14px;
  color: #4e5969;
  margin-bottom: 8px;
}

.upload-hint {
  font-size: 12px;
  color: #86909c;
}

.image-preview-container {
  border: 2px solid #e5e6eb;
  border-radius: 12px;
  padding: 16px;
  background: #fff;
}

.preview-wrapper {
  position: relative;
  text-align: center;
  max-height: 400px;
  overflow: hidden;
  border-radius: 8px;
  background: #f7f8fa;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  cursor: default;
}

.preview-wrapper.eyedropper-mode {
  cursor: crosshair;
}

.preview-wrapper canvas {
  max-width: 100%;
  max-height: 350px;
  object-fit: contain;
  border-radius: 4px;
}

.preview-info {
  margin-top: 12px;
  padding: 12px;
  background: #f7f8fa;
  border-radius: 6px;
  font-size: 13px;
  color: #4e5969;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.preview-info span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.preview-info .info-label {
  color: #86909c;
}

.eyedropper-hint {
  margin-top: 8px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #e8f3ff 0%, #f0f5ff 100%);
  border: 1px solid #bedaff;
  border-radius: 6px;
  font-size: 13px;
  color: #165DFF;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: pulseHint 2s ease-in-out infinite;
}

@keyframes pulseHint {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.eyedropper-icon {
  font-size: 16px;
}

.eyedropper-cursor {
  position: absolute;
  pointer-events: none;
  z-index: 20;
  width: 40px;
  height: 40px;
  transform: translate(-50%, -50%);
}

.eyedropper-ring {
  width: 40px;
  height: 40px;
  border: 3px solid #165DFF;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #fff, 0 2px 8px rgba(22, 93, 255, 0.3);
}

.eyedropper-color-preview {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.panel-options {
  background: #fff;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  padding: 20px;
}

.option-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option-item label {
  font-size: 14px;
  font-weight: 500;
  color: #4e5969;
}

.param-value {
  color: #165DFF;
  font-weight: 600;
}

.option-color {
  grid-column: 1 / -1;
}

.color-pick-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-eyedropper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #fff;
  border: 2px solid #c9cdd4;
  border-radius: 8px;
  color: #4e5969;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-eyedropper:hover {
  border-color: #165DFF;
  color: #165DFF;
  background: #f0f5ff;
}

.btn-eyedropper.active {
  border-color: #165DFF;
  background: #165DFF;
  color: #fff;
  box-shadow: 0 2px 8px rgba(22, 93, 255, 0.3);
}

.color-pick-row input[type="color"] {
  width: 42px;
  height: 42px;
  padding: 4px;
  border: 2px solid #c9cdd4;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.color-pick-row input[type="color"]:hover {
  border-color: #165DFF;
}

.color-hex {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  font-weight: 600;
  color: #1d2129;
  background: #f7f8fa;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #e5e6eb;
  min-width: 80px;
  text-align: center;
}

.option-item select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #c9cdd4;
  border-radius: 6px;
  font-size: 14px;
  color: #1d2129;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.option-item select:focus {
  outline: none;
  border-color: #165DFF;
  box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.1);
}

.option-item input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #e5e6eb;
  outline: none;
  -webkit-appearance: none;
}

.option-item input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #165DFF;
  cursor: pointer;
  transition: all 0.2s ease;
}

.option-item input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 2px 8px rgba(22, 93, 255, 0.3);
}

.option-item input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #165DFF;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.option-item input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 2px 8px rgba(22, 93, 255, 0.3);
}

.option-item input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: #e5e6eb;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #86909c;
}

#custom-bg-color {
  width: 100%;
  height: 42px;
  padding: 4px;
  border: 1px solid #c9cdd4;
  border-radius: 6px;
  cursor: pointer;
}

.bgtrans-actions {
  display: flex;
  gap: 12px;
}

.bgtrans-actions .btn-lg {
  flex: 1;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
}

.result-container {
  min-height: 400px;
  position: relative;
  background: #fafafa;
  border-radius: 8px;
}

.result-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #c9cdd4;
  width: 80%;
}

.result-empty svg {
  margin-bottom: 16px;
  opacity: 0.5;
}

.result-empty p {
  font-size: 14px;
  color: #86909c;
  margin-bottom: 4px;
}

.result-hint {
  font-size: 12px !important;
  color: #c9cdd4 !important;
}

.result-preview {
  padding: 20px;
}

.result-image-wrapper {
  position: relative;
  text-align: center;
  min-height: 300px;
  background-image:
    linear-gradient(45deg, #eee 25%, transparent 25%),
    linear-gradient(-45deg, #eee 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eee 75%),
    linear-gradient(-45deg, transparent 75%, #eee 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#result-canvas {
  max-width: 100%;
  max-height: 350px;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.result-info {
  margin-top: 16px;
  padding: 12px;
  background: #fff;
  border-radius: 6px;
  font-size: 13px;
  color: #4e5969;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.processing-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.98);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: 8px;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e5e6eb;
  border-top-color: #165DFF;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 20px;
}

.loading-spinner.large {
  width: 64px;
  height: 64px;
  border-width: 5px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.processing-text {
  font-size: 16px;
  color: #1d2129;
  font-weight: 600;
  margin-bottom: 8px;
}

.progress-bar {
  width: 200px;
  height: 6px;
  background: #e5e6eb;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 16px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #165DFF, #36bfff);
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}

.panel-batch {
  background: #fff;
}

.batch-summary {
  font-size: 12px;
  color: #86909c;
}

.batch-list {
  max-height: 300px;
  overflow-y: auto;
  padding: 0 4px;
}

.batch-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #f2f3f5;
  transition: background 0.2s;
}

.batch-item:hover {
  background: #f7f9ff;
}

.batch-item:last-child {
  border-bottom: none;
}

.batch-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid #e5e6eb;
  background-image:
    linear-gradient(45deg, #eee 25%, transparent 25%),
    linear-gradient(-45deg, #eee 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eee 75%),
    linear-gradient(-45deg, transparent 75%, #eee 75%);
  background-size: 8px 8px;
  background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
  flex-shrink: 0;
}

.batch-info {
  flex: 1;
  min-width: 0;
}

.batch-name {
  font-size: 13px;
  font-weight: 500;
  color: #1d2129;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-size {
  font-size: 12px;
  color: #86909c;
}

.batch-dl {
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid #c9cdd4;
  background: #fff;
  color: #4e5969;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.batch-dl:hover {
  border-color: #165DFF;
  color: #165DFF;
}

.panel-tips {
  background: #fff;
}

.tips-content {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tip-item {
  font-size: 13px;
  color: #4e5969;
  line-height: 1.6;
  padding-left: 12px;
  border-left: 3px solid #e5e6eb;
}

.tip-item strong {
  color: #1d2129;
}

.btn-tiny {
  padding: 6px 12px;
  font-size: 12px;
  border: 1px solid #c9cdd4;
  background: #fff;
  color: #4e5969;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-tiny:hover:not(:disabled) {
  border-color: #165DFF;
  color: #165DFF;
}

.btn-tiny:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .upload-zone {
    padding: 32px 16px;
    min-height: 250px;
  }

  .upload-icon svg {
    width: 48px;
    height: 48px;
  }

  .bgtrans-actions {
    flex-direction: column;
  }

  .bgtrans-actions .btn-lg {
    min-width: auto;
    flex: 1 1 100%;
  }

  .options-grid {
    grid-template-columns: 1fr;
  }

  .option-color {
    grid-column: 1;
  }

  .color-pick-row {
    flex-wrap: wrap;
  }

  .result-container {
    min-height: 300px;
  }

  .result-image-wrapper {
    min-height: 200px;
  }
}