.container {
  width: 80%;
  margin: 0 auto;
}

.product-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 25px;
  /* padding: 50px; */
  flex-wrap: wrap;

}

.back-button {
  background-color: #ffffff;
  border: none;
  padding: 5px 20px;
  margin-bottom: 20px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  border: 1px solid #000000;
  transition: background-color 0.3s;
}

.product-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  width: 100%;
  /* 让卡片高度自适应 */
  /* 不设置固定高度，由内容撑开 */
}

.product-img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.product-content {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  /* 内容区域自动填充剩余空间 */
}

.product-title {
  font-size: 14px;
  margin: 0 0 8px 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-desc {
  font-size: 12px;
  color: #666;
  margin: 0 0 12px 0;
  flex-grow: 1;
  /* 描述区域自动扩展 */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  /* 最多显示3行 */
  line-clamp: 3;
  /* 标准属性，增强兼容性 */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  color: rgb(0, 0, 0);
  font-weight: bold;
  font-size: 16px;
  /* 价格始终在底部 */
}

/* 响应式调整 */
@media (max-width: 600px) {
  .product-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .product-container {
    grid-template-columns: repeat(4, 1fr);
  }
}