/* ========== 上传与教程按钮 ========== */
.upload-section {
  display: flex; justify-content: center; align-items: center; gap: 10px;
  margin: 0 0 15px 0; flex-wrap: wrap;
}
.upload-btn, .guide-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 24px;
  background: #f8faff; color: #4f8cff; border: 1.5px dashed #4f8cff;
  border-radius: 20px; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s ease;
}
.upload-btn:hover { background: #4f8cff; color: #fff; border-style: solid; }
.guide-btn { color: #666; border-color: #aaa; }
.guide-btn:hover { border-color: #4f8cff; color: #4f8cff; background: #eef2ff; }

.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; }

/* 分类筛选 */
.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; }

/* 图片列表 */
.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%; transition: transform 0.2s; cursor: pointer;
}
.fav-grid-item:hover { transform: scale(1.02); }
.fav-grid-item .pro_title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 100%; }
.fav-actions { margin-top: 8px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
/* 删除或注释掉原来的蓝边框 */
/* .fav-grid-item.selected { outline: 3px solid #4f8cff; outline-offset: -3px; border-radius: 6px; } */


/* 垃圾桶按钮 */
.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; }
.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; }

/* 选择按钮 */
.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; }

/* 上传浮动标签 */
.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; }

.apply-btn {
  background-color: #4f8cff; color: #fff; border: none; padding: 8px 18px;
  border-radius: 4px; font-size: 14px; cursor: pointer; transition: background 0.2s;
}
.apply-btn:hover { background-color: #3a6fd8; }

/* 比例按钮 */
.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; }

/* ========== 画布样式（参考 Image Editor，限制最大高度） ========== */
#compose-canvas {
  max-width: 100%;
  max-height: 70vh;      /* 关键：高度不超过视口70% */
  width: auto;
  height: auto;
  display: block;
  margin: 0 auto;        /* 水平居中 */
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* 手机端微调：高度上限85vh，保证纵向空间 */
@media (max-width: 768px) {
  #compose-canvas {
    max-height: 85vh !important;
  }
  .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%; }
}

/* 删除按钮（浮动在组边框右上角） */
.group-delete-btn {
  position: absolute;
  width: 24px;
  height: 24px;
  background: #ff4444;
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  line-height: 24px;
  text-align: center;
  z-index: 20;
  display: none;          /* 默认隐藏，激活时显示 */
}
.group-delete-btn:hover {
  background: #cc0000;
}

.filter-select {
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  background: #fff;
}


canvas {
  touch-action: none;  /* 防止浏览器捕获手势 */
}
.control-point {
  touch-action: none;
}


/* 手机端控制点与删除按钮加大 */
@media (max-width: 768px) {
  .control-point {
    width: 28px !important;
    height: 28px !important;
    border-width: 3px;
    touch-action: none;
  }
  /* 删除按钮使用 Canvas 绘制，无法用 CSS 放大，但可以通过 JS 调整尺寸（见下文） */
}

#compose-canvas {
  touch-action: none;
}


/* 加载提示 */
.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); }
}


.compose-btn {
  background-color: #4f8cff;
  color: #fff;
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;          /* 关键：禁止换行 */
  min-width: 90px;              /* 可选：保持宽度稳定 */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.compose-btn:hover { background-color: #3a6fd8; }