/* 模态窗口样式 */
.modal, .preview-modal, .queue-modal, .api-test-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

.modal.show, .preview-modal.show, .queue-modal.show {
    display: flex;
}

/* API测试模态框 */
.api-test-modal {
    z-index: 10000;
}

.api-test-content {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
}

.api-test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.api-test-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #ddd;
}

.api-test-item.success {
    border-left-color: #52c41a;
    background: #f6ffed;
}

.api-test-item.error {
    border-left-color: #ff4d4f;
    background: #fff1f0;
}

.api-test-item.testing {
    border-left-color: #faad14;
    background: #fffbe6;
}

.api-test-name {
    font-weight: 600;
    color: #262626;
}

.api-test-model {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.api-test-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.api-error-detail {
    font-size: 11px;
    color: #ff4d4f;
    margin-top: 4px;
    word-break: break-all;
}

/* 队列模态框 */
.queue-modal {
    backdrop-filter: blur(3px);
}

.queue-modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.queue-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.queue-modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f1f1f;
}

/* 预览模态框 */
.preview-modal {
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
}

.preview-modal-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    background: var(--bg-card);
    padding: 20px;
}

.preview-modal img,
.preview-modal video {
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

/* 图片画廊模态框 */
.gallery-container {
    text-align: center;
}

.gallery-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

#galleryImageContainer {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

#galleryImage {
    max-width: 100%;
    max-height: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

#galleryDescription {
    margin-top: 15px;
    color: #666;
    font-size: 14px;
}

#galleryThumbnails {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.gallery-thumbnail {
    width: 80px;
    height: 60px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    object-fit: cover;
}

.gallery-thumbnail:hover {
    border-color: #1890ff;
}

.gallery-thumbnail.active {
    border-color: #52c41a;
}

/* 视频合成模态框 */
#videoCompositeModal .preview-modal-content {
    max-width: 90%;
    width: 1000px;
    padding: 20px;
}

.composite-container {
    text-align: center;
}

#compositeVideoContainer {
    display: flex;
    justify-content: center;
    align-items: center;
}

#compositeVideo {
    width: 100%;
    max-height: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

#compositeDescription {
    color: #666;
    margin-bottom: 10px;
    font-size: 14px;
}

#compositeList {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.composite-video-item {
    width: 120px;
    height: 90px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.composite-video-item:hover {
    border-color: #1890ff;
}

.composite-video-item.active {
    border-color: #52c41a;
}

/* 爆款库来源按钮样式 */
.trending-source-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.trending-source-btn:active {
    transform: translateY(0);
}

/* 爆款库内容模态窗口 */
#trendingSourceModal.preview-modal {
    z-index: 10001;
}

#trendingSourceFrame {
    background: white;
}
