/* ========== 合成页基础布局 ========== */
.scene-flex-row {
  display: flex;
  justify-content: space-between;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 10px;
  margin: 20px 0;
}
.scene-item {
  flex: 0 0 calc((100% - 20px) / 3);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.scene-item canvas {
  width: 100%;
  height: auto;
  border: 1px solid #eee;
  display: block;
  cursor: pointer;
}
.scene-download-btn,
.scene-download-btn:link,
.scene-download-btn:visited,
.scene-download-btn:hover,
.scene-download-btn:active {
  text-decoration: none !important;
  color: #fff !important;
}
.scene-download-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 12px;
  background: #4CAF50;
  border-radius: 4px;
  font-size: 14px;
  transition: background 0.2s;
}
.scene-download-btn:hover {
  background: #45a049;
}

/* 收藏列表按钮容器 */
.fav-actions {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

/* 合成按钮（右侧） */
.compose-btn {
  background-color: #4f8cff;
  color: #fff;
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}
.compose-btn:hover {
  background-color: #3a6fd8;
}

/* 垃圾桶删除按钮（左侧，复刻收藏页样式） */
.fav-remove-btn {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 13px;
  padding: 2px 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  position: relative;
  transition: color 0.2s ease;
}
.fav-remove-btn::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: #ff6b6b;
  transition: width 0.25s ease;
}
.fav-remove-btn:hover {
  color: #ff6b6b;
}
.fav-remove-btn:hover::after {
  width: 100%;
}
.fav-remove-icon {
  width: 14px;
  height: 14px;
  stroke: #999;
  transition: stroke 0.2s ease;
}
.fav-remove-btn:hover .fav-remove-icon {
  stroke: #ff6b6b;
}

/* 标题不换行，溢出省略号 */
.fav-grid-item .pro_title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  max-width: 100%;
}

/* Change Scene Style 按钮 */
#refresh-scenes-btn {
  display: inline-block;
  padding: 6px 16px;
  background-color: #4f8cff;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  letter-spacing: 0.3px;
  outline: none;
}
#refresh-scenes-btn:hover {
  background-color: #3a6fd8;
  color: #fff;
}
#refresh-scenes-btn:active {
  background-color: #2d5bb5;
}
#refresh-scenes-btn:focus {
  outline: none;
  box-shadow: none;
}

/* 卡片悬浮效果 */
.fav-grid-item {
  cursor: pointer;
  transition: transform 0.2s;
}
.fav-grid-item:hover {
  transform: scale(1.02);
}

/* 比例选择按钮 */
.ratio-btn {
  display: inline-block;
  margin: 0 4px;
  padding: 5px 12px;
  background: #f0f2f5;
  color: #555;
  border: 1px solid #d0d5e0;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  outline: none;
}
.ratio-btn:hover {
  background: #e0e5f0;
  border-color: #4f8cff;
}
.ratio-btn.active {
  background: #4f8cff;
  color: #fff;
  border-color: #4f8cff;
}

#ratio-selector {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
#refresh-scenes-btn {
  margin-top: 10px;
}

/* 确保容器清除浮动 */
.productList {
  overflow: hidden;
  clear: both;
}

/* ========== 收藏网格系统 ========== */
.fav-grid-item.pro_list {
  float: left;
  min-height: 1px;
  padding-left: 5px;
  padding-right: 5px;
  box-sizing: border-box;
  margin: 10px 0;
  width: 100%;
}

/* 手机端：两列 */
@media (max-width: 767px) {
  .fav-grid-item.pro_list {
    width: 50%;
  }
}

/* 平板端：三列 */
@media (min-width: 768px) and (max-width: 991px) {
  .fav-grid-item.pro_list {
    width: 33.333%;
  }
}

/* PC端：五列 */
@media (min-width: 992px) {
  .fav-grid-item.pro_list {
    width: 20%;
  }
}

/* ========== 分类筛选样式 ========== */
.fav-filter-bar {
  margin-bottom: 20px;
  overflow: hidden;
}
.fav-filter-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
  padding-bottom: 4px;
}
.fav-filter-btn {
  display: inline-block;
  margin: 4px 6px;
  padding: 8px 18px;
  background: #f5f6fa;
  color: #666;
  border: 1px solid #e0e4e8;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}
.fav-filter-btn:hover {
  background: #eef2ff;
  border-color: #4f8cff;
  color: #4f8cff;
}
.fav-filter-btn.active {
  background: #4f8cff;
  color: #fff;
  border-color: #4f8cff;
}

/* ========== 上传按钮区域 ========== */
.upload-section {
  text-align: center;
  margin: 0 0 15px 0;
}
.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 24px;
  background: #fff;
  color: #4f8cff;
  border: 1.5px dashed #4f8cff;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #f8faff;
}
.upload-btn:hover {
  background: #4f8cff;
  color: #fff;
  border-style: solid;
}
.upload-btn:active {
  background: #3a6fd8;
  border-color: #3a6fd8;
}

/* 上传图片浮动标签 */
.custom-badge {
  position: absolute;
  top: 0;
  left: 0;
  background: #ff9800;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 7px 3px 5px;
  border-radius: 0 6px 6px 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: 0.3px;
}
.custom-badge::before {
  content: "⬆";
  font-size: 11px;
  flex-shrink: 0;
}

/* 教程按钮样式 */
.guide-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 24px;
  background: #f8faff;
  color: #666;
  border: 1.5px dashed #aaa;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.guide-btn:hover {
  border-color: #4f8cff;
  color: #4f8cff;
  background: #eef2ff;
}
.guide-btn:active {
  background: #dce6ff;
}

/* 教程面板样式 */
.guide-panel {
  background: #f9fafb;
  border: 1px solid #e0e4e8;
  border-radius: 8px;
  padding: 15px 20px;
  margin-bottom: 20px;
  text-align: left;
  font-size: 14px;
  line-height: 1.6;
  color: #333;
}
.guide-panel h4 {
  margin: 0 0 8px 0;
  color: #2764b3;
}
.guide-panel ol, .guide-panel ul {
  padding-left: 20px;
  margin: 5px 0;
}

/* 加载提示 */
.scene-loading {
  text-align: center;
  padding: 40px 20px;
  font-size: 16px;
  color: #666;
}
.scene-loading::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 8px;
  border: 2px solid #ccc;
  border-top-color: #4f8cff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 手机端优化：两张合成图占满宽度 */
@media (max-width: 768px) {
  .scene-item {
    flex: 0 0 calc((100% - 10px) / 2); /* 两个item，gap 10px */
    max-width: calc((100% - 10px) / 2);
  }
  #compose-area h2 {
    font-size: 18px;
    margin-bottom: 12px;
  }
  .download-scene-text {
    display: none; /* 移动端隐藏“Scene”字样，只显示Download */
  }
}