.image_container {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap; /* PC 端禁止换行，避免 pane 因高度限制换到右侧挡住标签 */
  flex: 1;
  max-height: 100%;
  min-width: 0; /* 允许在 flex 布局中收缩，避免撑出水平滚动条 */
  overflow: hidden;
}

/* 标签页（PC）：与语音模块统一样式 */
.image_container .nav.nav-tabs.image-tabs {
  border-bottom: 2px solid #dee2e6;
  flex-shrink: 0;
}
.image_container .nav.nav-tabs.image-tabs .image-tab {
  cursor: pointer;
  color: #6c757d;
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 0.6rem 0.6rem 0 0;
  padding: 0.65rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  background: #f8f9fa;
  min-height: 44px;
  transition: color 0.2s, border-color 0.2s;
}
.image_container .nav.nav-tabs.image-tabs .image-tab:hover {
  color: #0d6efd;
  border-bottom-color: rgba(13, 110, 253, 0.3);
}
.image_container .nav.nav-tabs.image-tabs .image-tab.active {
  color: #0d6efd;
  background: #fff;
  border-bottom-color: #0d6efd;
}
.image-tab-pane {
  padding-top: 0.5rem;
  flex: 1;
  min-height: 0;
  min-width: 0; /* 允许收缩，避免内容撑出水平滚动条 */
  overflow-x: hidden; /* 不出现水平滚动条 */
  overflow-y: auto; /* 仅内容区滚动，标签页固定不随滚动 */
}

#edit_prompt {
    width: 100%;
    min-height: 80px;
    resize: none;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

#image_text {
    width: 100%;
    min-height: 80px;
    resize: none;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

/* 图片生成：图片区域不单独出现滚动条，随 pane 整体滚动 */
#image-container.image-result-list {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    overflow: visible;
}

/* 图片修改：图片区域不单独出现滚动条，随 pane 整体滚动 */
#image-container-edit.image-result-list {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    overflow: visible;
}

/* 图片修改：上传区域、修改描述区域上下分块，不在一排 */
.image-edit-form .image-edit-upload-section .form-control {
  max-width: 100%;
}
.image-edit-form #edit_original_preview {
  margin-top: 0.75rem;
}
/* 固定尺寸预览框，可点击放大 */
.image-edit-preview-box {
  width: 100%;
  max-width: 320px;
  height: 240px;
  margin-top: 0.35rem;
  border-radius: 8px;
  border: 1px solid #dee2e6;
  background: #f8f9fa;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.image-edit-preview-box .image-edit-preview-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
}
.image-edit-form .image-edit-desc-section #edit_prompt {
  min-height: 120px;
}
.image-edit-preview-img {
  border-radius: 8px;
}

/* 图片修改：修改前 / 修改后 左右平均分显示，点击图片可全屏放大（与图片生成一致） */
.image-edit-compare-wrap {
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
  margin-bottom: 1rem;
  min-width: 0;
  max-width: 100%;
}
.image-edit-compare-wrap > div {
  flex: 1 1 50%;
  min-width: 0;
  max-width: 50%;
  overflow: hidden;
}
.image-edit-compare-wrap .image-result-card {
  width: 100%;
}
.image-edit-compare-wrap .image-result-item {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  cursor: pointer;
}

.image-result-card {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: visible;
    border: 1px solid #eee;
    max-width: 100%;
}

#image-container .image-result-item,
#image-container-edit .image-result-item {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    border-radius: 0 0 8px 8px;
    object-fit: contain;
}

.image-download-btn {
    margin: 0.5rem;
    align-self: flex-start;
    border-radius: 8px 8px 0 0;
}

/* 进度条与生成中占位 */
.image-progress-wrap {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.image-progress-wrap .progress {
    height: 6px;
    margin-bottom: 0.75rem;
}

.image-generating-placeholder {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px dashed #dee2e6;
    padding: 1.5rem;
}

.image-generating-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #dee2e6;
    border-top-color: #0d6efd;
    border-radius: 50%;
    animation: image-spin 0.8s linear infinite;
}

.image-generating-text {
    margin: 1rem 0 0.25rem;
    color: #495057;
    font-size: 0.95rem;
}

.image-generating-dots {
    color: #0d6efd;
    font-weight: 600;
    animation: image-dots 1.2s steps(4, end) infinite;
}

@keyframes image-spin {
    to { transform: rotate(360deg); }
}

@keyframes image-dots {
    0%, 20% { opacity: 0; }
    40% { opacity: 1; }
    100% { opacity: 1; }
}
