        /* --- Mermaid 全屏放大查看器样式 --- */
        .mermaid-viewer-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background-color: rgba(0, 0, 0, 0.75);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            z-index: 100000;
            display: flex;
            flex-direction: column;
            animation: fadeIn 0.2s ease-out;
            user-select: none;
        }
        .viewer-header {
            height: 56px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 24px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            background-color: rgba(20, 20, 20, 0.8);
            color: #ffffff;
        }
        .viewer-title {
            font-size: 15px;
            font-weight: 600;
        }
        .viewer-actions {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .viewer-btn {
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid rgba(255, 255, 255, 0.15);
            color: #dddddd;
            width: 32px;
            height: 32px;
            border-radius: 6px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.15s;
            padding: 0;
        }
        .viewer-btn:hover {
            background: rgba(255, 255, 255, 0.15);
            color: #ffffff;
            border-color: rgba(255, 255, 255, 0.3);
        }
        .viewer-btn.btn-close {
            background: #ff4d4f;
            border-color: #ff4d4f;
            color: #ffffff;
            font-size: 14px;
        }
        .viewer-btn.btn-close:hover {
            background: #ff7875;
            border-color: #ff7875;
        }
        .viewer-body {
            flex: 1;
            position: relative;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .viewer-canvas {
            position: absolute;
            transform-origin: center center;
            transition: transform 0.05s ease-out;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 12px;
            box-sizing: border-box;
            background: var(--bg-gray);
            border: 1px solid var(--border-color);
            border-radius: 8px;
        }
        .viewer-canvas svg {
            max-width: none !important;
            max-height: none !important;
            user-select: none;
            pointer-events: none;
        }
        .viewer-canvas .viewer-mermaid {
            width: auto;
            max-width: none;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .viewer-tip {
            position: absolute;
            bottom: 24px;
            left: 50%;
            transform: translateX(-50%);
            background-color: rgba(0, 0, 0, 0.6);
            color: rgba(255, 255, 255, 0.7);
            padding: 8px 16px;
            border-radius: 20px;
            font-size: 12px;
            pointer-events: none;
            letter-spacing: 0.5px;
        }
