/**
 * 工具卡片通用样式
 * 用于多个页面的工具卡片显示
 */

/* 工具卡片基础样式 */
.dz-card-remove {
  transition: all 0.3s ease;
}

.dz-card-remove:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 图片样式 */
.dz-media img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  transition: transform 0.3s ease;
}

.dz-media a:hover img {
  transform: scale(1.05);
}

/* 按钮状态样式 */
.like-btn,
.favorite-btn,
.delete-btn {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.like-btn.loading,
.favorite-btn.loading,
.delete-btn.loading {
  opacity: 0.7;
  cursor: not-allowed;
}

.like-btn.liked {
  background-color: #4CAF50 !important;
  border-color: #4CAF50 !important;
  color: white !important;
}

.favorite-btn.favorited {
  background-color: #FFC107 !important;
  border-color: #FFC107 !important;
  color: #212529 !important;
}

.delete-btn.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* 淡入动画 */
.list-item.fade-in {
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 空状态样式 */
.dz-cart-about {
  text-align: center;
  padding: 40px 20px;
}

.dz-cart-about .dz-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 2rem;
}

.dz-cart-about .title {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: #333;
}

.dz-cart-about p {
  color: #666;
  margin-bottom: 20px;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .dz-media img {
    height: 100px;
  }
  
  .dz-card-remove {
    margin-bottom: 15px;
  }
}

@media (max-width: 576px) {
  .dz-media img {
    height: 80px;
  }
  
  .dz-cart-footer {
    flex-direction: column;
    gap: 10px;
  }
  
  .dz-cart-footer .dz-stepper,
  .dz-cart-footer .dz-remove {
    width: 100%;
    text-align: center;
  }
}

/* 工具分类标签 */
.dz-price {
  background: #e9ecef;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.85rem;
  color: #495057;
}

/* 收藏计数 */
.total-review {
  font-weight: bold;
  color: #ff6b6b;
}

/* 工具描述 */
.dz-status {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #666;
  line-height: 1.4;
  min-height: 2.8em;
}

/* 卡片移除动画 */
.dz-card-remove.removing {
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.3s ease;
}

/* 按钮悬停效果 */
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.btn-secondary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

/* 加载状态 */
.spinner-border {
  width: 3rem;
  height: 3rem;
}

/* 错误状态 */
.text-danger i {
  margin-bottom: 10px;
}

/* 工具卡片网格布局 */
.row.g-2 {
  margin-left: -4px;
  margin-right: -4px;
}

.row.g-2 > [class*="col-"] {
  padding-left: 4px;
  padding-right: 4px;
}

/* 卡片内容区域 */
.dz-content {
  padding: 15px;
}

.dz-content .title {
  margin-bottom: 8px;
}

.dz-content .title a {
  color: #333;
  text-decoration: none;
  transition: color 0.3s ease;
}

.dz-content .title a:hover {
  color: #0d6efd;
}

/* 元信息区域 */
.dz-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eee;
}

/* 卡片底部 */
.dz-cart-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  border-top: 1px solid #eee;
  background: #f8f9fa;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}