/* 图片生成页面样式 - 完全参照视频生成页面 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
}

/* 主容器 */
.image-generation-container {
    min-height: 100vh;
    position: relative;
    background-color: #f5f7fa;
}

/* 图片预览区域 */
.image-preview-section {
    padding: 20px;
    padding-bottom: 280px;
    min-height: calc(100vh - 250px);
    margin-bottom: 0;
}

.image-records-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* 图片批次容器 - 同一批次放一排 */
.image-batch {
    display: flex;
    gap: 20px;
    width: 100%;
    flex-wrap: wrap;
}

/* 单个图片卡片 */
.image-card {
    flex: 0 0 calc(50% - 10px);
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

/* 如果只有一张图片，显示在左边 */
.image-batch > .image-card:only-child {
    flex: 0 0 calc(50% - 10px);
}

.image-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* 图片任务头部 */
.image-task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: #f9fafb;
    border-bottom: 1px solid #e1e5e9;
}

.image-batch-id {
    font-size: 12px;
    color: #999;
}

.image-status {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
}

.image-status.queued {
    background-color: rgba(255, 170, 0, 0.1);
    color: #ffaa00;
}

.image-status.generating {
    background-color: rgba(24, 144, 255, 0.1);
    color: #1890ff;
}

.image-status.completed {
    background-color: rgba(82, 196, 26, 0.1);
    color: #52c41a;
}

.image-status.failed {
    background-color: rgba(255, 77, 79, 0.1);
    color: #ff4d4f;
}

/* 图片播放器容器 */
.image-player-container {
    position: relative;
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 280px;
}

.image-player {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: pointer;
}

/* 16:9 宽屏比例 - 铺满容器 */
.image-player-container.ratio-16-9 .image-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 图片控制按钮 */
.image-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    opacity: 1;
    z-index: 10;
}

.image-control-btn {
    width: 36px;
    height: 36px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
}

.image-control-btn:hover {
    background-color: rgba(0, 0, 0, 0.9);
    transform: scale(1.05);
}

.image-control-btn:disabled {
    background-color: rgba(0, 0, 0, 0.3);
    cursor: not-allowed;
    transform: none;
}

/* 图片状态覆盖层 */
.image-status-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 5;
    pointer-events: none;
}

.image-status-overlay.queued {
    background-color: rgba(255, 170, 0, 0.2);
}

.image-status-overlay.generating {
    background-color: rgba(24, 144, 255, 0.2);
}

.image-status-overlay .status-text {
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    margin-top: 10px;
}

.image-status-overlay .progress-bar-container {
    width: 80%;
    max-width: 300px;
    margin-top: 20px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid #e1e5e9;
    border-top: 3px solid #1890ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.progress-bar-container {
    width: 80%;
    height: 6px;
    background-color: #e1e5e9;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: #1890ff;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* 图片提示词和原图链接 - 同一排 */
.image-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background-color: #f9fafb;
    border-top: 1px solid #e1e5e9;
}

/* 图片提示词 */
.image-prompt-preview {
    flex: 1;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 15px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.image-prompt-preview:hover {
    color: #1890ff;
    text-decoration: underline;
}

/* 原图链接容器 */
.original-image-link-container {
    flex-shrink: 0;
}

.original-image-link {
    font-size: 12px;
    color: #1890ff;
    text-decoration: none;
}

.original-image-link:hover {
    text-decoration: underline;
}

/* 底部漂浮控制框 */
.image-controls-section {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 1200px;
    background-color: #fff;
    border-radius: 16px 16px 0 0;
    padding: 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

/* 图片工具栏 */
.image-toolbar {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 20px;
}

.image-quantity-selector,
.image-ratio-selector,
.image-resolution-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.image-quantity-selector label,
.image-ratio-selector label,
.image-resolution-selector label {
    font-size: 14px;
    font-weight: 500;
    color: #666;
}

.image-quantity-selector select,
.image-ratio-selector select,
.image-resolution-selector select {
    padding: 8px 12px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-quantity-selector select:focus,
.image-ratio-selector select:focus,
.image-resolution-selector select:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

/* 提示词输入框 */
.image-prompt-section {
    position: relative;
    margin-bottom: 15px;
}

#prompt-input {
    width: 100%;
    height: 120px;
    padding: 12px 16px;
    padding-bottom: 45px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    resize: none;
    font-size: 14px;
    background-color: #fff;
    font-family: inherit;
    transition: all 0.3s ease;
}

#prompt-input:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

#prompt-input::placeholder {
    color: #999;
}

/* 提示词框内的上传按钮 */
.prompt-upload-btn {
    position: absolute;
    bottom: 10px;
    left: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    background-color: #f0f2f5;
    color: #666;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.prompt-upload-btn:hover {
    background-color: #e6f7ff;
    color: #1890ff;
    border-color: #91d5ff;
}

.prompt-upload-btn input[type="file"] {
    display: none;
}

.prompt-upload-btn i {
    font-size: 16px;
}

/* 提示词框内的生成按钮 */
#generate-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    padding: 8px 20px;
    background-color: #1890ff;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.3);
}

#generate-btn:hover {
    background-color: #40a9ff;
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.4);
    transform: translateY(-1px);
}

#generate-btn:disabled {
    background-color: #d9d9d9;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* 加载状态 */
#loading {
    position: absolute;
    bottom: 15px;
    right: 120px;
    display: none;
    align-items: center;
    gap: 8px;
    color: #1890ff;
    font-size: 14px;
}

#loading i {
    animation: spin 1s linear infinite;
}

/* 图片预览区域 */
.prompt-preview-section {
    margin-top: 10px;
    display: flex;
    justify-content: flex-start;
}

.multi-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 100%;
}

.preview-item {
    position: relative;
    width: 100px;
    height: 80px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f9fafb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-delete-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background-color: rgba(255, 77, 79, 0.9);
    color: #fff;
    border: none;
    border-radius: 50%;
    display: none; /* 默认隐藏 */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    z-index: 5;
    transition: all 0.2s ease;
}

.preview-item:hover .preview-delete-btn {
    display: flex;
}

.preview-delete-btn:hover {
    background-color: #ff4d4f;
    transform: scale(1.1);
}

/* 刷新按钮 */
.refresh-images-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 100;
    transition: all 0.3s ease;
}

.refresh-images-btn:hover {
    background-color: #f0f2f5;
    transform: scale(1.1);
}

.refresh-images-btn i {
    font-size: 18px;
    color: #666;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .image-controls-section {
        width: 100%;
        border-radius: 12px 12px 0 0;
        padding: 15px;
        left: 0;
        transform: none;
    }
    
    .image-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin-bottom: 15px;
    }
    
    .image-preview-section {
        padding: 15px;
        padding-bottom: 300px;
    }
    
    .image-batch {
        flex-direction: column;
        gap: 15px;
    }
    
    .image-card,
    .image-batch > .image-card:only-child {
        flex: 0 0 100%;
    }
}

@media (max-width: 480px) {
    .image-preview-section {
        padding: 12px;
        padding-bottom: 280px;
    }
    
    .image-controls-section {
        padding: 12px;
    }
    
    #prompt-input {
        height: 100px;
        padding: 10px 12px;
        padding-bottom: 45px;
        font-size: 13px;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f3f5;
}

::-webkit-scrollbar-thumb {
    background: #c1c7cd;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8b0b8;
}
