/* Claude风格的代码块样式 */

/* 基础代码块容器 */
.streaming-content pre {
    position: relative;
    border-radius: 6px;
    background: #282c34;
    margin: 16px 0;
    overflow: hidden;
    contain: content;
    will-change: transform;
    transform: translateZ(0);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* 正在生成中的代码块样式 */
.streaming-content pre.generating-code {
    border-left: 3px solid #61afef;
    position: relative;
    min-height: 3em;
    opacity: 0.9;
    background-color: #2c313c;
}

/* 代码块内容 */
.streaming-content pre code {
    display: block;
    padding: 1rem;
    overflow-x: auto;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    line-height: 1.5;
    tab-size: 2;
    color: #abb2bf;
    white-space: pre;
    transition: color 0.3s ease;
}

/* 代码块语言标签 */
.code-language-label {
    position: absolute;
    top: 0;
    right: 0;
    padding: 0.25rem 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    color: #bac1d2;
    border-bottom-left-radius: 4px;
    font-size: 0.75rem;
    font-family: sans-serif;
    user-select: none;
}

/* 代码复制按钮 */
.code-copy-button {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    border-radius: 4px;
    color: #bac1d2;
    width: 28px;
    height: 28px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.streaming-content pre:hover .code-copy-button {
    opacity: 1;
}

.code-copy-button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* 代码块加载指示器 */
.code-loading-indicator {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
}

.code-loading-indicator span {
    width: 6px;
    height: 6px;
    background-color: #61afef;
    border-radius: 50%;
    display: inline-block;
    animation: code-loading-bounce 1.4s infinite ease-in-out both;
}

.code-loading-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.code-loading-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes code-loading-bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* 删除原来的高亮动画 */
.highlight-complete {
    /* 删除动画，改用无动画的过渡 */
    opacity: 1;
    transform: none;
    /* 使用静态样式代替动画 */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 删除整个动画关键帧 */
@keyframes highlight-fade-in {
    /* 删除这个整个动画定义 */
}

/* 替换为简单的静态样式 */
pre.hljs-processed {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 生成中的代码块光标效果 */
pre.generating-code code::after {
    content: "▌";
    display: inline-block;
    color: #61afef;
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
    margin-left: 2px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}