/* 图片预览样式 */
.file-preview {
  display: none;
  margin-top: var(--spacing-md);
  position: relative;
}
.file-preview.show {
  display: block;
}
.file-preview img {
  max-width: 100%;
  max-height: 300px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
}
.clear-image {
  position: absolute;
  top: -10px;
  right: -10px;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.clear-image:hover {
  background-color: #e74c3c;
}

/* 图片上传进度样式 */
.upload-progress {
  height: 5px;
  background-color: #f1f1f1;
  border-radius: 3px;
  margin-top: 10px;
  overflow: hidden;
  display: none;
}
.upload-progress.show {
  display: block;
}
.progress-bar {
  height: 100%;
  background-color: #FF6B8B;
  width: 0%;
  transition: width 0.3s ease;
}

/* 兜底：强制隐藏所有无效图片，防止占位 */
.moment-image[src=""],
.moment-image[src="data:"],
.moment-image[src="data:,"],
.moment-image:not([src]),
.moment-image[src^="http://127.0.0.1"],
.moment-image[src*="index.html"] {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

/* 图片预览模态框 */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.image-modal.show {
  opacity: 1;
  visibility: visible;
}
.modal-content {
  position: relative;
  max-width: 90%;
  max-height: 80vh;
}
.modal-image {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 8px;
}
.close-modal {
  position: absolute;
  top: -40px;
  right: 0;
  color: white;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
}
