﻿
/* 全屏容器 */
.ai-image-container {
    height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    padding: 20px;
}

/* 头部区域 */
.image-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-radius: 8px 8px 0 0;
}

/* 生成模式选择器 */
.generation-mode-selector {
    display: flex;
    gap: 8px;
    margin-right: 16px;
}

.mode-option {
    padding: 8px 16px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 13px;
    font-weight: 500;
    background-color: white;
    color: #495057;
}

    .mode-option:hover {
        border-color: #007bff;
        background-color: #f8f9fa;
    }

    .mode-option.selected {
        border-color: #007bff;
        background-color: #007bff;
        color: white;
    }

/* 自定义下拉框 */
.custom-dropdown {
    position: relative;
    min-width: 350px;
}

.dropdown-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background-color: white;
    border: 1px solid #ced4da;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
}

    .dropdown-button:hover {
        border-color: #007bff;
    }

    .dropdown-button.active {
        border-color: #007bff;
        box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
    }

.dropdown-button-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #212529;
}

.dropdown-button-icon {
    color: #6c757d;
    transition: transform 0.3s;
}

.dropdown-button.active .dropdown-button-icon {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    max-height: 400px;
    overflow-y: auto;
}

    .dropdown-menu.show {
        display: block;
    }

.dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #f8f9fa;
}

    .dropdown-item:last-child {
        border-bottom: none;
    }

    .dropdown-item:hover {
        background-color: #f8f9fa;
    }

    .dropdown-item.selected {
        background-color: #e7f1ff;
        color: #007bff;
    }

.dropdown-item-icon {
    min-width: 32px;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.dropdown-item-content {
    flex: 1;
}

.dropdown-item-title {
    font-weight: 500;
    color: #212529;
    margin-bottom: 2px;
}

.dropdown-item-desc {
    font-size: 12px;
    color: #6c757d;
    white-space: nowrap; /* 禁止换行 */
    overflow: hidden; /* 隐藏溢出内容 */
    text-overflow: ellipsis; /* 溢出显示省略号 */
    width: 270px; /* 必须指定宽度或受父容器宽度限制 */
    word-break: break-all; /* 允许在单词内任意位置换行，适用于中英文混合 */
    /* 或者使用 overflow-wrap: break-word; 仅在必要时断行，保持单词完整性优先 */
}

.dropdown-item.selected .dropdown-item-title {
    color: #007bff;
}


/* 配置按钮 */
.config-btn {
    background-color: white;
    border: 1px solid #dee2e6;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

    .config-btn:hover {
        background-color: #f8f9fa;
        border-color: #007bff;
        color: #007bff;
    }

    .config-btn.active {
        background-color: #007bff;
        border-color: #007bff;
        color: white;
    }



/* 图像展示区域 */
.image-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: white;
    border-left: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.image-generation-item {
    display: flex;
    gap: 16px;
    max-width: 100%;
    animation: slideIn 0.4s ease-out;
}

    .image-generation-item.user {
        align-self: flex-end;
        flex-direction: row-reverse;
    }

    .image-generation-item.ai {
        align-self: flex-start;
    }

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #007bff;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
    font-size: 14px;
}

.image-generation-item.user .avatar {
    background-color: #28a745;
}

.image-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 600px;
}

.prompt-text {
    padding: 12px 16px;
    border-radius: 8px;
    background-color: #f8f9fa;
    word-wrap: break-word;
    line-height: 1.6;
    color: #212529;
    font-size: 14px;
}

.image-generation-item.user .prompt-text {
    background-color: #007bff;
    color: white;
}

/* 图像结果展示 */
.image-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.image-result-item {
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s;
}

    .image-result-item:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        transform: translateY(-2px);
    }

.image-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background-color: #f8f9fa;
    overflow: hidden;
}

    .image-preview img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.3s;
    }

.image-result-item:hover .image-preview img {
    transform: scale(1.05);
}

.image-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.image-action-btn {
    padding: 6px 12px;
    background-color: white;
    border: 1px solid #ced4da;
    border-radius: 6px;
    color: #495057;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

    .image-action-btn:hover {
        background-color: #e9ecef;
        border-color: #007bff;
        color: #007bff;
    }

.image-info {
    font-size: 12px;
    color: #6c757d;
}

.generation-time {
    font-size: 12px;
    color: #6c757d;
    margin-top: 8px;
    text-align: right;
}

.image-generation-item.user .generation-time {
    text-align: left;
}

/* 输入区域 */
.image-footer {
    background-color: white;
    padding: 20px;
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 8px 8px;
}

/* 参考图片区域 */
.reference-image-section {
    display: none;
    margin-bottom: 16px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 16px;
    background-color: #f8f9fa;
}

    .reference-image-section.show {
        display: block;
    }

.reference-image-header {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 12px;
}

.reference-image-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.reference-image-tab {
    padding: 6px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
    background-color: white;
}

    .reference-image-tab:hover {
        border-color: #007bff;
        background-color: #f8f9fa;
    }

    .reference-image-tab.active {
        border-color: #007bff;
        background-color: #007bff;
        color: white;
    }

.reference-image-content {
    display: none;
}

    .reference-image-content.active {
        display: block;
    }

.url-input-container {
    display: flex;
    gap: 8px;
}

.url-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
}

    .url-input:focus {
        outline: none;
        border-color: #007bff;
        box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
    }

.add-url-btn {
    padding: 8px 16px;
    background-color: #007bff;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.3s;
}

    .add-url-btn:hover {
        background-color: #0056b3;
    }

/* 拖拽上传区域 */
.drag-drop-zone {
    border: 2px dashed #ced4da;
    border-radius: 8px;
    padding: 32px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

    .drag-drop-zone:hover,
    .drag-drop-zone.drag-over {
        border-color: #007bff;
        background-color: #f8f9fa;
    }

    .drag-drop-zone i {
        font-size: 32px;
        color: #6c757d;
        margin-bottom: 12px;
    }

    .drag-drop-zone p {
        font-size: 14px;
        color: #6c757d;
        margin-bottom: 8px;
    }

    .drag-drop-zone .hint {
        font-size: 12px;
        color: #adb5bd;
    }

    .drag-drop-zone input[type="file"] {
        display: none;
    }

/* 参考图片预览 */
.reference-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.reference-image-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #dee2e6;
}

    .reference-image-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .reference-image-item .remove-btn {
        position: absolute;
        top: 4px;
        right: 4px;
        width: 20px;
        height: 20px;
        background-color: rgba(220, 53, 69, 0.9);
        color: white;
        border: none;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        transition: all 0.3s;
    }

        .reference-image-item .remove-btn:hover {
            background-color: rgba(220, 53, 69, 1);
        }

.input-group {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.prompt-input {
    flex: 1;
    min-height: 48px;
    max-height: 120px;
    resize: none;
    border: 1px solid #ced4da;
    border-radius: 8px;
    padding: 12px;
    font-size: 15px;
    line-height: 1.5;
    transition: border-color 0.3s;
    font-family: inherit;
}

    .prompt-input:focus {
        outline: none;
        border-color: #007bff;
        box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    }

    .prompt-input::placeholder {
        color: #6c757d;
    }

.generate-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    height: 48px;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .generate-btn:hover {
        background-color: #0056b3;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
    }

    .generate-btn:disabled {
        background-color: #6c757d;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

/* 生成指示器 */
.generating-indicator {
    display: none;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 16px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

    .generating-indicator.active {
        display: flex;
    }

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e9ecef;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}


.generating-text {
    color: #6c757d;
    font-size: 14px;
}

.generating-progress {
    flex: 1;
    height: 6px;
    background-color: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.generating-progress-bar {
    height: 100%;
    background-color: #007bff;
    border-radius: 3px;
    transition: width 0.3s;
}

/* 动画效果 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 滚动条美化 */
.image-body::-webkit-scrollbar,
.dropdown-menu::-webkit-scrollbar,
.config-sidebar-body::-webkit-scrollbar {
    width: 6px;
}

.image-body::-webkit-scrollbar-track,
.dropdown-menu::-webkit-scrollbar-track,
.config-sidebar-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.image-body::-webkit-scrollbar-thumb,
.dropdown-menu::-webkit-scrollbar-thumb,
.config-sidebar-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

    .image-body::-webkit-scrollbar-thumb:hover,
    .dropdown-menu::-webkit-scrollbar-thumb:hover,
    .config-sidebar-body::-webkit-scrollbar-thumb:hover {
        background: #555;
    }

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6c757d;
    text-align: center;
}

    .empty-state i {
        font-size: 64px;
        margin-bottom: 20px;
        color: #dee2e6;
    }

    .empty-state h3 {
        font-size: 20px;
        font-weight: 600;
        margin-bottom: 8px;
        color: #495057;
    }

    .empty-state p {
        font-size: 14px;
        color: #6c757d;
    }

/* 尺寸选择器 */
.size-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.size-option {
    padding: 8px 16px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 13px;
}

    .size-option:hover {
        border-color: #007bff;
        background-color: #f8f9fa;
    }

    .size-option.selected {
        border-color: #007bff;
        background-color: #007bff;
        color: white;
    }



/* 响应式适配 */
@media (max-width: 768px) {
    .ai-image-container {
        height: calc(100vh - 100px);
        padding: 10px;
    }

    .image-content {
        max-width: 100%;
    }

    .image-body {
        padding: 15px;
    }

    .config-sidebar {
        width: 100%;
        right: -100%;
    }

    .custom-dropdown {
        min-width: 150px;
    }

    .image-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .generation-mode-selector {
        justify-content: center;
    }

    .image-results {
        grid-template-columns: 1fr;
    }

    .url-input-container {
        flex-direction: column;
    }
}


/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1060;
}

    .modal.show {
        display: flex;
    }

.modal-dialog {
    background-color: white;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .modal-close:hover {
        color: #212529;
    }

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

    .btn-primary:hover {
        background-color: #0056b3;
    }

.btn-default {
    background-color: white;
    border-color: #ced4da;
    color: #495057;
}

    .btn-default:hover {
        background-color: #e9ecef;
    }

.text-text-indent {
    text-indent: 2em;
}

.text-danger {
    color: #dc3545;
}

.text-muted {
    color: #6c757d;
}




/* 参考图片区域 */
.reference-image-section {
    display: none;
    margin-bottom: 16px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 16px;
    background-color: #f8f9fa;
}

    .reference-image-section.show {
        display: block;
    }

.reference-image-header {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 12px;
}

.reference-image-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.reference-image-tab {
    padding: 6px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
    background-color: white;
}

    .reference-image-tab:hover {
        border-color: #007bff;
        background-color: #f8f9fa;
    }

    .reference-image-tab.active {
        border-color: #007bff;
        background-color: #007bff;
        color: white;
    }

.reference-image-content {
    display: none;
}

    .reference-image-content.active {
        display: block;
    }

.url-input-container {
    display: flex;
    gap: 8px;
}

.url-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
}

    .url-input:focus {
        outline: none;
        border-color: #007bff;
        box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
    }

.add-url-btn {
    padding: 8px 16px;
    background-color: #007bff;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.3s;
}

    .add-url-btn:hover {
        background-color: #0056b3;
    }

/* 拖拽上传区域 */
.drag-drop-zone {
    border: 2px dashed #ced4da;
    border-radius: 8px;
    padding: 32px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

    .drag-drop-zone:hover,
    .drag-drop-zone.drag-over {
        border-color: #007bff;
        background-color: #f8f9fa;
    }

    .drag-drop-zone i {
        font-size: 32px;
        color: #6c757d;
        margin-bottom: 12px;
    }

    .drag-drop-zone p {
        font-size: 14px;
        color: #6c757d;
        margin-bottom: 8px;
    }

    .drag-drop-zone .hint {
        font-size: 12px;
        color: #adb5bd;
    }

    .drag-drop-zone input[type="file"] {
        display: none;
    }

/* 参考图片预览 */
.reference-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.reference-image-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #dee2e6;
}

    .reference-image-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .reference-image-item .remove-btn {
        position: absolute;
        top: 4px;
        right: 4px;
        width: 20px;
        height: 20px;
        background-color: rgba(220, 53, 69, 0.9);
        color: white;
        border: none;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        transition: all 0.3s;
    }

        .reference-image-item .remove-btn:hover {
            background-color: rgba(220, 53, 69, 1);
        }



/* 视频结果展示 */
.video-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.video-result-item {
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s;
}

    .video-result-item:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        transform: translateY(-2px);
    }

.video-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background-color: #f8f9fa;
    overflow: hidden;
}

    .video-preview video {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

/* 播放按钮覆盖层 */
.video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

.video-result-item:hover .video-play-overlay {
    background: rgba(0, 0, 0, 0.2);
}

.video-play-button {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

    .video-play-button::before {
        content: '';
        width: 0;
        height: 0;
        border-left: 20px solid #007bff;
        border-top: 12px solid transparent;
        border-bottom: 12px solid transparent;
        margin-left: 4px;
    }

.video-play-overlay:hover .video-play-button {
    background: white;
    transform: scale(1.1);
}

.video-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.video-action-btn {
    padding: 6px 12px;
    background-color: white;
    border: 1px solid #ced4da;
    border-radius: 6px;
    color: #495057;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

    .video-action-btn:hover {
        background-color: #e9ecef;
        border-color: #007bff;
        color: #007bff;
    }

.video-info {
    font-size: 12px;
    color: #6c757d;
    display: flex;
    gap: 12px;
    align-items: center;
}

.video-info-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.generation-time {
    font-size: 12px;
    color: #6c757d;
    margin-top: 8px;
    text-align: right;
}

.video-generation-item.user .generation-time {
    text-align: left;
}