.dialog-box {
    background: #2d2d2d;
    border-radius: 5px;
    margin: 5px 0;
    position: relative;
    overflow: hidden;
    padding-bottom: 2px;

    &.user {
        background: none;
    }
}

.username {
    padding: 3px 6px;
    border-bottom: 1px solid #444;
    font-size: 14px;
    color: #888;

    i {
        font-size: 16px;
    }
}

.content {
    padding: 3px 6px;
    user-select: text;

    &.thinking {
        color: #aaa;
    }

    ::ng-deep {

        h1,
        h2,
        h3,
        h4,
        h5,
        h6 {
            font-weight: bold;
            margin-top: 0;
        }

        h1 {
            font-size: 20px;
            margin-bottom: 0.5em;
        }

        h2 {
            font-size: 18px;
            margin-bottom: 0.5em;
            border-left: 6px solid #3794ff;
            line-height: 26px;
            padding-left: 10px;
        }

        h3 {
            font-size: 16px;
            margin-bottom: 0.2em;
        }

        h4 {
            font-size: 14px;
            margin-bottom: 0.2em;
        }

        h5 {
            font-size: 14px;
            margin-bottom: 0.2em;
        }

        h6 {
            font-size: 14px;
            margin-bottom: 0.2em;
        }

        p,
        ul,
        ol,
        pre,
        table,
        blockquote {
            margin-top: 0.5em;
            margin-bottom: 0.5em;
            font-size: 14px;

            img {
                max-width: 100%;
            }
        }

        ul,
        ol {
            padding-left: 1.5em;
        }

        blockquote {
            padding: 0 1em;
            border-left: 0.25em solid #ccc;
            color: #999;

            code {
                padding: 0 5px;
                font-family: "MiSans Regular", "FiraCode Regular" !important;
                color: #ffbd08;
            }
        }

        a {
            color: #0366d6;
            text-decoration: none;
        }

        a:hover {
            text-decoration: underline;
        }

        table {
            border-collapse: collapse;
            width: 100%;
            position: relative;
            margin-top: 20px;

            &:hover {
                .export-btn {
                    visibility: visible;
                }
            }
        }

        table,
        th,
        td {
            border: 1px solid #ccc;
        }

        th,
        td {
            padding: 0.3em;
            text-align: left;
        }

        hr {
            border: none;
            border-top: 1px solid #ccc;
            margin: 2em 0;
        }

        // Shiki 代码高亮样式
        .shiki {
            background-color: #0d1117 !important;
            color: #e6edf3;
            border-radius: 6px;
            padding: 1rem;
            overflow-x: auto;
            font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
            font-size: 13px;
            line-height: 1.45;

            .line {
                min-height: 1em;
            }
        }

        // 代码显示
        pre {
            display: grid;
            position: relative;
            margin: 0;
            overflow: visible;

            code {
                display: block;
                overflow-x: auto;
                padding: 0.5em;
            }

            .language-mermaid {
                overflow: hidden;
            }

            .aily-component-container {
                font-family: "MiSans Regular", "FiraCode Regular" !important;
                width: 100%;
            }

            .language-aily-state {
                height: 40px;
                overflow: hidden;
                font-family: "MiSans Regular", "FiraCode Regular" !important;
                display: flex;
                align-items: center;
            }

            .language-aily-board {
                height: 70px;
                font-family: "MiSans Regular", "FiraCode Regular" !important;
                overflow: hidden;
                display: flex;
                align-items: center;
            }

            .language-aily-library {
                height: 70px;
                font-family: "MiSans Regular", "FiraCode Regular" !important;
                overflow: hidden;
                display: flex;
                align-items: center;
            }

            .language-aily-button {
                font-family: "MiSans Regular", "FiraCode Regular" !important;
                overflow: hidden;
                display: flex;
                align-items: center;
            }
        }

        .export {
            position: absolute;
            right: 108px;
            top: -20px;
            font-size: 12px;
            height: 20px;
            display: flex;
            justify-content: center;
            align-items: center;
            background: none;
            border: none;
            opacity: 0.3;
        }

        .export-btn {
            position: absolute;
            right: 0;
            top: -20px;
            font-size: 12px;
            width: 35px;
            height: 20px;
            display: flex;
            justify-content: center;
            align-items: center;
            cursor: pointer;
            border: none;
            white-space: nowrap;
            opacity: 0.5;
            background: none;

            &:hover {
                opacity: 1;
            }

            &.excel {
                right: 0;
                border: 1px solid #555;
            }

            &.json {
                right: 36px;
                border: 1px solid #555;
            }

            &.sql {
                right: 72px;
                border: 1px solid #555;
            }
        }

        .copy-btn {
            position: absolute;
            right: 0;
            top: -20px;
            font-size: 12px;
            width: 35px;
            height: 20px;
            display: flex;
            justify-content: center;
            align-items: center;
            cursor: pointer;
            border: none;
            white-space: nowrap;
            opacity: 0.5;
            background: none;
            border: 1px solid #555;

            &:hover {
                opacity: 1;
            }
        }

        a {
            color: #007bff;
            text-decoration: none;
        }

        a:hover {
            text-decoration: underline;
        }

        p {
            margin-top: 5px;
            margin-bottom: 5px;
            font-size: 14px;
        }
    }
}

.voice-btn {
    margin-left: 15px;
    cursor: pointer;

    i.fa-play {
        color: #00772c;
    }

    i.fa-stop {
        color: rgb(133, 0, 0);
    }
}

.ps {
    padding-top: 5px;
    margin: 0 15px 15px 15px;
    border-top: 1px solid #bbb;
    color: #646464;
}

.image-box {
    display: flex;
    padding: 8px 0 0 8px;

    >div {
        width: 104px;
        height: 104px;
        padding: 8px;
        border: 1px solid #d9d9d9;
        border-radius: 2px;
        display: flex;
        justify-content: center;
        align-items: center;
        background: #FFF;
        margin: 0 8px 0 0;

        img {
            max-width: 100%;
            max-height: 100%;
            cursor: pointer;
        }
    }
}

// blockly 相关样式
.dialog-box {
    ::ng-deep {

        .blockly-container {
            border: 1px solid #ddd;
            border-radius: 4px;
            margin: 1rem 0;
            background-color: #f5f5f5;
        }

        .blockly-preview {
            width: 100%;
            height: 300px;
            overflow: auto;
        }
    }
}


.loader {
    position: absolute;
    bottom: 0;
    height: 2px;
    width: 100%;
    --c: no-repeat linear-gradient(#585858 0 0);
    background: var(--c), var(--c), #3d3d3d;
    background-size: 60% 100%;
    animation: l16 3s infinite;
}

@keyframes l16 {
    0% {
        background-position: -150% 0, -150% 0
    }

    66% {
        background-position: 250% 0, -150% 0
    }

    100% {
        background-position: 250% 0, 250% 0
    }
}