/**
 * 图片展示组件样式
 * @Author: kele  
 * @Date: 2025-10-01
 * @Description: 图片展示相关的所有样式
 */

/* 结果网格布局 */
.result-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* 图片项目 */
.image-item {
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    background: white;
    position: relative;
    min-height: 350px;
    display: flex;
    flex-direction: column;
}

.image-item.completed {
    border-color: #27ae60;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.2);
}

.image-item.failed {
    border-color: #e74c3c;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.2);
}

.image-item.animate-in {
    animation: slideInScale 0.5s ease;
}

.image-item.completion-effect {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
}

/* 动画效果 */
@keyframes slideInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes imagespin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 样式标题 */
.style-title {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 14px;
}

/* 图片容器 */
.image-container {
    position: relative;
    cursor: pointer;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
    flex: 1;
}

.image-container.selected {
    box-shadow: 
        inset 0 0 0 3px #3498db, /* 内部阴影模拟边框 */
        0 0 10px rgba(11, 142, 230, 0.3); /* 外部发光效果 */
}

/* 生成的图片 */
.generated-image {
    width: 100%;
    height: 390px;
    object-fit: cover;
    border-radius: 3px;
    transition: transform 0.2s;
}

.image-container:hover .generated-image {
    transform: scale(1.02);
}

/* 图片覆盖层 - 悬停时显示在下半部分 */
.imagelist-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 20px 15px 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    justify-content: end;
    backdrop-filter: blur(2px);
}

.image-container:hover .imagelist-overlay {
    opacity: 1;
}

/* 覆盖层操作按钮 */
.overlay-actions {
    display: flex;
    justify-content: center;
    width: 100%;
}

.btn-zoom {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 8px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-zoom:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-zoom svg {
    width: 20px;
    height: 20px;
    color: #2c3e50;
}

/* 选择指示器 */
.selection-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: #3498db;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s ease;
}

.image-container.selected .selection-indicator {
    opacity: 1;
    transform: scale(1);
}

.selection-indicator svg {
    fill: white;
}

/* 占位符样式 */
.image-placeholder, .error-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 390px;
    color: #7f8c8d;
    background: #f8f9fa;
    border-radius: 6px;
    margin: 5px 0;
}

/* 加载动画 */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: imagespin 1s linear infinite;
    margin-bottom: 10px;
}

/* 错误图标 */
.error-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.error-message {
    font-size: 12px;
    color: #e74c3c;
    margin-top: 5px;
}

/* 生成时间显示 */
.generation-time {
    color: #7f8c8d;
    font-size: 12px;
    margin-top: 5px;
}

/* 下载按钮区域 */
.download-section {
    margin-right: 10px;
}

.btn-download {
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-download:hover {
    background-color: #229954;
}

.icon-download {
    width: 16px;
    height: 16px;
}

/* 下载付费弹窗样式 */
.download-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.download-modal-overlay.show {
    opacity: 1;
}

.download-modal {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 420px;
    color: white;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.download-modal-overlay.show .download-modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 24px 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 24px;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #ecf0f1;
}

.modal-close {
    background: none;
    border: none;
    color: #bdc3c7;
    font-size: 28px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.modal-body {
    padding: 0 24px 24px;
}

.price-section {
    text-align: center;
    margin-bottom: 32px;
}

.price-amount {
    font-size: 48px;
    font-weight: 700;
    color: #3498db;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.price-subtitle {
    font-size: 14px;
    color: #bdc3c7;
    opacity: 0.9;
}

.features-section {
    margin-bottom: 32px;
}

.feature-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 0;
}

.feature-dot {
    width: 8px;
    height: 8px;
    background: #3498db;
    border-radius: 50%;
    margin-right: 16px;
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.5);
}

.feature-text {
    font-size: 15px;
    color: #ecf0f1;
    line-height: 1.4;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-purchase {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-purchase:hover {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.btn-cancel {
    background: transparent;
    color: #bdc3c7;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

.purchase-icon {
    width: 16px;
    height: 16px;
}

/* 防止页面滚动 */
body.modal-open {
    overflow: hidden;
}