* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  margin: 0;
  padding: 20px;
  background: #fff;
  font-size: 14px;
  color: #333;
}

.image-tool-field {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.image-tool-field .image-tool-label {
  margin-bottom: 0;
  flex-shrink: 0;
}

.image-tool-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 14px;
  color: #333;
}

.image-tool-select {
  width: auto;
  min-width: 160px;
  max-width: 280px;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  background: #fff;
}

.image-tool-select:focus {
  outline: none;
  border-color: #F5A623;
}

.image-tool-upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.image-tool-size-info {
  flex-shrink: 0;
  font-size: 13px;
  color: #666;
  min-width: 4em;
}

.image-tool-input {
  flex: 1;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  background: #fff;
}

.image-tool-input:focus {
  outline: none;
  border-color: #F5A623;
  box-shadow: 0 0 0 2px rgba(245, 166, 35, 0.2);
}

.image-tool-btn {
  flex-shrink: 0;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: #F5A623;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.image-tool-btn:hover {
  opacity: 0.9;
}

.image-tool-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.image-tool-preview {
  min-height: 120px;
  padding: 16px;
  border: 1px dashed #d9d9d9;
  border-radius: 8px;
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-tool-preview-placeholder {
  color: #999;
  font-size: 14px;
}

.image-tool-preview img {
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
  display: block;
}

.image-tool-result {
  margin-top: 8px;
  margin-bottom: 8px;
  padding: 12px 0;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.image-tool-result.is-error {
  color: #cf1322;
}

.image-tool-result-loading {
  color: #666;
}

.image-tool-result-label {
  font-weight: 500;
}

.image-tool-result-url-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.image-tool-result-url {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.image-tool-result-url:hover {
  border-color: #F5A623;
}

.image-tool-btn-copy {
  flex-shrink: 0;
}
