/* 自定义样式 */

/* 选项卡按钮激活状态 */
.tab-btn.active {
  background-color: #4f46e5;
  color: white;
  border-color: #4f46e5;
}

/* 拖放区域悬停效果 */
.drop-zone.dragover {
  border-color: #4f46e5;
  background-color: #eef2ff;
}

/* 滚动条样式 */
#output-text::-webkit-scrollbar {
  width: 8px;
}

#output-text::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

#output-text::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

#output-text::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}

/* 图片预览网格 */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.image-grid-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.image-grid-item img {
  width: 100%;
  height: auto;
  display: block;
}

.image-grid-item .download-btn {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px;
  text-align: center;
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}

.image-grid-item:hover .download-btn {
  opacity: 1;
}

/* 文件列表项 */
.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.file-item .file-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-item .file-icon {
  width: 40px;
  height: 40px;
  background: #eef2ff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-item .file-name {
  font-size: 14px;
  color: #374151;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item .remove-btn {
  padding: 6px 12px;
  background: #fee2e2;
  color: #dc2626;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.2s;
}

.file-item .remove-btn:hover {
  background: #fecaca;
}

/* 进度条动画 */
@keyframes progress-shine {
  0% {
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(79, 70, 229, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
  }
}

#progress-bar-text,
#progress-bar-image {
  animation: progress-shine 2s infinite;
}

/* Toast通知 */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 24px;
  background: #1f2937;
  color: white;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  font-size: 14px;
  z-index: 1000;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  background: #059669;
}

.toast.error {
  background: #dc2626;
}

.toast.info {
  background: #3b82f6;
}