:root {
    --modal-bg-color: rgba(0, 0, 0, 0.75);
    --modal-content-bg: #ffffff;
    --modal-border-radius: 12px;
    --modal-box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    --modal-transition: 0.3s ease-in-out;
    --modal-z-index: 1000;
    --spinner-color: var(--primary-color, #FCEA00);
    --spinner-size: 50px;
}

/* 全屏预览模态框 */
.fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    backdrop-filter: blur(3px);
}

.fullscreen-modal.active {
    opacity: 1;
    visibility: visible;
}

/* 模态框内容 */
.fullscreen-modal-content {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 95%;
    height: 95%;
    max-width: 1920px;
    max-height: 1080px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s ease-in-out;
}

.fullscreen-modal.active .fullscreen-modal-content {
    transform: scale(1);
}

/* 模态框头部 */
.fullscreen-modal-header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.fullscreen-modal-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

/* 关闭按钮 */
.fullscreen-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    transition: color 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.fullscreen-modal-close:hover {
    color: #FA446D;
    background-color: rgba(0, 0, 0, 0.05);
}

/* 模态框主体 */
.fullscreen-modal-body {
    flex: 1;
    padding: 20px;
    overflow: auto;
    position: relative;
}

/* 图表容器 */
.fullscreen-diagram-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: auto;
    scroll-behavior: smooth;
    background-color: #ffffff;
    box-sizing: border-box;
    padding: 20px; /* 添加内边距防止图表贴边 */
}

/* 图表容器内的图表元素 */
.fullscreen-diagram-container svg,
.fullscreen-diagram-container canvas,
.fullscreen-diagram-container .mermaid {
    max-width: none !important;
    max-height: none !important;
    width: auto !important;
    height: auto !important;
    transition: transform 0.2s ease-in-out;
    cursor: grab;
    transform-origin: center center;
    object-fit: contain;
}

.fullscreen-diagram-container svg:active,
.fullscreen-diagram-container canvas:active,
.fullscreen-diagram-container .mermaid:active {
    cursor: grabbing;
}

/* 确保SVG在全屏模式下正确显示 */
.fullscreen-diagram-container svg {
    overflow: visible;
}

/* 加载动画样式 */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 加载中动画 */
.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #FCEA00;
    animation: spin 1s ease-in-out infinite;
    z-index: 10;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 控制按钮 */
.fullscreen-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.8);
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(4px);
}

.fullscreen-control-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: white;
    color: #333;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.fullscreen-control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #FCEA00, #FA8A00);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .fullscreen-modal-content {
        width: 95%;
        height: 95%;
    }
    
    .fullscreen-controls {
        bottom: 10px;
        right: 10px;
    }
    
    .fullscreen-control-btn {
        width: 32px;
        height: 32px;
    }
}