.chat-main {
    margin: 50px auto;
    width: 800px;
    height: 500px;
}

/* 主内容区 */
.section {
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 6px;
    background: white;
}
.message-user{
    width: 100%;
}
.message-user>strong{
    display: inline-block;
    width: 100%;
    text-align: right;
}
/* 聊天框 */
.chat-box {
    height: 500px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    margin: 10px 0;
    background: white;
}

/* 代码块 */
pre {
    position: relative;
    background: #f6f8fa !important;
    padding: 1em;
    border-radius: 4px;
    border: 1px solid #e1e4e8;
    margin: 10px 0;
    overflow-x: auto;
}

/* 在代码块样式下添加 */
.mermaid {
    background: white;
    padding: 20px;
    border-radius: 4px;
    margin: 10px 0;
    text-align: center;
}


pre code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 14px;
}

/* 添加think的样式 */
.think {
    color: #8b8b8b;
    white-space: pre-wrap;
    margin: 0;
    padding: 0 0 0 13px;
    line-height: 26px;
    position: relative;
    display: block;
    /* 确保think标签是块级元素 */
}

/* 默认情况下，p 标签的上下边距 */
p {
    margin: 0.8em 0;
    /* 默认值 */
}

/* 当 p 标签没有内容时，缩小上下边距 */
p:empty {
    margin: 0.1em 0;
    /* 调整为更小的值 */
}

/* 按钮样式 */
button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

#actionButton {
    background: #007bff;
    color: white;
}

#actionButton.stop {
    background: #dc3545;
}

.html-preview-btn {
    padding: 2px 8px !important;
    background: #4CAF50 !important;
    font-size: 12px !important;
}

/* 输入框 */
textarea {
    width: 98%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    font-family: inherit;
}

/* HTML预览相关样式 */
.preview-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.preview-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    height: 80%;
    display: flex;
    flex-direction: column;
}

.preview-iframe {
    flex: 1;
    border: 1px solid #ddd;
    margin-top: 10px;
}

.preview-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

/* 动画 */
@keyframes cursor-blink {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

.streaming-cursor::after {
    content: "|";
    animation: cursor-blink 1s infinite;
    color: #666;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        margin-left: 0;
        padding: 5px;
    }

    .sidebar {
        width: 80%;
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .chat-box {
        height: 60vh;
    }

    .section {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    textarea {
        font-size: 14px;
    }

    button {
        padding: 5px 8px;
        font-size: 14px;
    }

    .html-preview-btn {
        font-size: 10px !important;
    }
}