/* 盲水印工具样式 */

/* 确保中文字体支持 */
body, .container, .tool-section {
  font-family: 'Microsoft YaHei', '微软雅黑', Arial, Helvetica, sans-serif;
}

/* 主要容器样式 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* 工具部分样式 */
.tool-section {
  margin-bottom: 40px;
  padding: 25px;
  background-color: #ffffff;
  border-radius: 10px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tool-section:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* 标题样式 */
.tool-section h3 {
  margin-top: 0;
  margin-bottom: 20px;
  color: #030303;
  font-size: 24px;
  font-weight: 600;
  border-bottom: 2px solid #4CAF50;
  padding-bottom: 10px;
}

/* 表单组样式 */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #555;
  font-size: 14px;
}

/* 输入字段样式 */
.form-group input[type="file"],
.form-group input[type="text"],
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
}

.form-group input[type="file"]:focus,
.form-group input[type="text"]:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #4CAF50;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

/* 文本区域样式 */
.form-group textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

/* 单选按钮组样式 */
.radio-group {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.radio-group label {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  font-weight: normal;
  cursor: pointer;
  transition: color 0.3s ease;
}

.radio-group label:hover {
  color: #4CAF50;
}

.radio-group input[type="radio"] {
  cursor: pointer;
  margin: 0;
}

/* 工具按钮样式 - 基于全局按钮样式的增强 */
.btn {
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 120px;
}

.btn-primary {
  background-color: #4CAF50;
  color: white;
}

.btn-primary:hover {
  background-color: #45a049;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-secondary {
  background-color: #f5f5f5;
  color: #666;
  border: 1px solid #ddd;
}

.btn-secondary:hover {
  background-color: #e0e0e0;
  color: #333;
}

/* 图像预览样式 */
.image-preview {
  margin-top: 12px;
  min-height: 120px;
  border: 2px dashed #ccc;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: #f9f9f9;
  transition: all 0.3s ease;
  position: relative;
}

.image-preview:hover {
  border-color: #4CAF50;
  background-color: #f1f8e9;
}

.image-preview img {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 4px;
}

.image-preview::before {
  content: '预览区域';
  position: absolute;
  color: #999;
  font-style: italic;
  pointer-events: none;
}

.image-preview:has(img)::before {
  display: none;
}

/* 结果部分样式 */
.result-section {
  margin-top: 25px;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  display: none;
}

.result-section h4 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #333;
  font-size: 18px;
}

/* 文本结果样式 */
.text-result {
  padding: 15px;
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  min-height: 60px;
  font-family: 'Courier New', monospace;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.5;
}

/* 滑块样式 */
input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #ddd;
  outline: none;
  -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #4CAF50;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

input[type="range"]::-webkit-slider-thumb:hover {
  background: #45a049;
  transform: scale(1.1);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #4CAF50;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

input[type="range"]::-moz-range-thumb:hover {
  background: #45a049;
  transform: scale(1.1);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

/* 滑块值显示 */
#embedStrengthValue {
  display: inline-block;
  margin-left: 10px;
  padding: 4px 8px;
  background-color: #4CAF50;
  color: white;
  border-radius: 4px;
  font-size: 12px;
  min-width: 40px;
  text-align: center;
}

/* 加载指示器样式 */
#loadingIndicator {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.3s ease;
}

/* 进度条容器样式 */
.progress-container {
  width: 100%;
  height: 12px;
  background-color: #f3f3f3;
  border-radius: 6px;
  margin: 15px 0;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 进度条样式 */
.progress-bar {
  height: 100%;
  background-color: #4CAF50;
  border-radius: 6px;
  transition: width 0.3s ease;
  background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent);
  background-size: 20px 20px;
  animation: progressAnimation 1s linear infinite;
}

/* 进度条动画 */
@keyframes progressAnimation {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 20px 0;
  }
}

.loading-content {
  text-align: center;
  background: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  max-width: 300px;
  width: 90%;
}

.loading-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #4CAF50;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

/* 使用全局定义的spin动画 */

#loadingText {
  color: #555;
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 10px;
}

.progress-status {
  color: #4CAF50;
  font-size: 14px;
  font-weight: 500;
  margin-top: 10px;
  min-height: 20px;
}

/* 调试部分样式 */
.debug-section {
  margin-top: 40px;
  padding: 25px;
  background-color: #2d2d2d;
  border-radius: 10px;
  color: #f8f8f2;
}

.debug-section h3 {
  color: #f8f8f2;
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 18px;
  font-weight: 600;
}

.debug-console {
  width: 100%;
  height: 300px;
  overflow-y: auto;
  padding: 15px;
  background-color: #1e1e1e;
  border: 1px solid #444;
  border-radius: 6px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-all;
  scrollbar-width: thin;
  scrollbar-color: #666 #2d2d2d;
}

.debug-console::-webkit-scrollbar {
  width: 8px;
}

.debug-console::-webkit-scrollbar-track {
  background: #2d2d2d;
  border-radius: 4px;
}

.debug-console::-webkit-scrollbar-thumb {
  background: #666;
  border-radius: 4px;
}

.debug-console::-webkit-scrollbar-thumb:hover {
  background: #888;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }
  
  .tool-section {
    padding: 20px;
  }
  
  .tool-section h3 {
    font-size: 20px;
  }
  
  .radio-group {
    flex-direction: column;
    gap: 10px;
  }
  
  .btn {
    width: 100%;
    margin-bottom: 10px;
  }
  
  .image-preview {
    min-height: 100px;
  }
  
  .debug-console {
    height: 200px;
  }
}

/* 工具提示样式 */
.form-text.text-muted {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: #6c757d;
  font-style: italic;
}

/* 加载状态的按钮样式 */
.btn.loading {
  opacity: 0.7;
  cursor: not-allowed;
  position: relative;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  right: 12px;
  top: 50%;
  margin-top: -8px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* 水平分隔线 */
hr {
  margin: 30px 0;
  border: 0;
  border-top: 1px solid #e0e0e0;
}

/* 工具标题样式 */
h2 {
  color: #2c3e50;
  font-size: 32px;
  margin-bottom: 15px;
  text-align: center;
}

p {
  color: #030303;
  font-size: 16px;
  text-align: center;
  margin-bottom: 30px;
  line-height: 1.6;
}

/* 辅助类 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-section {
  animation: fadeIn 0.5s ease-out;
}