.container {
    max-width: 800px;
    margin: auto;
    padding: 16px;
}

.image-sections-wrapper {
    display: flex;
    justify-content: space-between;
    gap: 18px;
}

.image-section {
    width: 48%;
}

/* 图片行布局 */
.image-row {
    flex-direction: column;
    gap: 5px;
    display: flex;
    /*align-items: flex-start;*/
}

.sample-list {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 4%;
    padding: 2px;
}

/* 上传方框 Box */
.upload-box {
    width: 100%;
    height: 230px;
    min-height: 160px; /* ↑ 略微加高更稳 */
    max-height: 230px;
    border: 2px dashed #bbb;
    border-radius: 12px;
    position: relative;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: 0.2s ease; /* ↑ 微动画 */

    box-sizing: border-box;
}

.upload-box:hover {
    border-color: #409eff;
}

.hidden-input {
    display: none;
}

.upload-placeholder {
    text-align: center;
    color: #888;
}

.upload-icon {
    font-size: 42px;
    line-height: 42px;
}

.preview-img {
    width: 100%;
    height: 230px;
    object-fit: contain;
    max-width: 100%;
}


/* 示例图片 */
.sample-img {
    width: 48%; /* 两列刚好 48% + gap */
    height: 160px;
    border-radius: 10px; /* 圆角略微加大更柔和 */
    object-fit: cover;
    cursor: pointer;
    box-sizing: border-box;
    background: #fafafa;
    transition: transform 0.2s, box-shadow 0.25s;
}

.sample-img:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 4px 12px rgba(64, 158, 255, 0.35);
}

.under-image-sections-wrapper {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    flex-direction: row;
}

.prompt_and_btn_wrapper {
    width: 48%;
    height: 230px;
    gap: 5px;
}

.output_wrapper {
    width: 48%;
    height: 230px;
}

/* 提示词输入框 */
.prompt-section {
    width: 100%;
    height: 70%;
}

#prompt_label {
    height: 10%;
}

#promptInput {
    margin-top: 5px;
    width: 100%;
    height: 75%;
    box-sizing: border-box;
    padding: 14px 16px;
    font-size: 15px;
    line-height: 1.6;
    border: 1.8px solid #dcdfe6;
    border-radius: 12px;
    outline: none;
    transition: all 0.2s;
    background: #fafafa;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03) inset;
    resize: none;
}

#promptInput:focus {
    border-color: #409eff;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.12);
}

/* 生成按钮 */
.generate-btn {
    width: 100%;
    height: 20%;
    /*padding: 14px 0;*/
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #409eff, #66b1ff);
    color: white;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(64, 158, 255, 0.25);
}

.generate-btn:hover {
    box-shadow: 0 6px 18px rgba(64, 158, 255, 0.32);
    transform: translateY(-2px);
}

.generate-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(64, 158, 255, 0.25);
    background: linear-gradient(135deg, #2f89dc, #5ca4f0);
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

#result_label {
    width: 100%;
    height: 7%;
}

.result-area {
    width: 100%;
    height: 75%;
}

/* 生成图容器 */
.output-img {
    width: 100%;
    max-width: 100%;
    max-height: 100%; /* 确保图片不会超出容器的高度 */
    border-radius: 12px;
    object-fit: contain; /* 保证图片按照比例缩放 */
    cursor: zoom-in;
    transition: 0.2s;
    padding: 3px;
}

.output-img:hover {
    transform: scale(1.02);
}

/* 🔍 大图预览层（Modal） */
#imgPreviewModal {
    display: none; /* 默认隐藏 */
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#imgPreviewModal img {
    max-width: 92%;
    max-height: 92%;
    border-radius: 12px;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.4);
}

#imgPreviewModal:active {
    display: none;
}

/* ==========  加载中转圈  ========== */
.loading-spinner {
    width: 42px;
    height: 42px;
    border: 4px solid rgba(64, 158, 255, 0.25);
    border-top-color: #409eff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 16px auto;
    display: none; /* 默认隐藏 */
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.label {
    margin: 5px;
}


/* 移动端适应 */
@media (max-width: 600px) {
    .image-sections-wrapper {
        flex-direction: column;
    }

    .image-section {
        width: 100%;
    }

    .image-row {
        flex-direction: column;
    }

    .upload-box {
        width: 100%;
    }

    .sample-list {
        width: 100%;
    }

    .sample-img {
        width: 48%;
        height: 130px;
    }

    .preview-img {
        max-height: 240px;
    }
}