/* ========================================
   代码块增强样式 - Code Block Enhancement
   ======================================== */

/* 代码块容器 - 使用更温和的样式 */
.highlight-wrapper {
    position: relative;
    margin: 1.5rem 0;
    border-radius: 12px;
    overflow: visible !important;
    transition: all 0.3s ease;
}

/* 代码块主体 - 保持透明，不覆盖主题样式 */
.highlight {
    position: relative;
    margin: 0 !important;
    border-radius: 12px !important;
    background: transparent !important;
}

/* 复制按钮样式增强 - 保持可见 */
.copy-btn {
    border-radius: 6px !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
    transition: all 0.3s ease !important;
    opacity: 1 !important;
    transform: none !important;
}

.copy-btn:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3) !important;
}

/* 代码块滚动条美化 */
.highlight pre::-webkit-scrollbar {
    height: 6px;
}

.highlight pre::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.highlight pre::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 3px;
}

[data-user-color-scheme="dark"] .highlight pre::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

/* 内联代码样式 */
code:not(pre code) {
    padding: 3px 8px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 6px;
    font-family: 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.9em;
    color: #667eea;
    transition: all 0.3s ease;
}

code:not(pre code):hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    transform: scale(1.02);
}

[data-user-color-scheme="dark"] code:not(pre code) {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
}

/* Mermaid 图表样式增强 */
.mermaid {
    background: rgba(255, 255, 255, 0.5) !important;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

[data-user-color-scheme="dark"] .mermaid {
    background: rgba(30, 35, 45, 0.5) !important;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .highlight {
        padding: 1rem !important;
        font-size: 13px;
    }
}

/* 代码搜索高亮 */
.code-search-highlight {
    background: rgba(255, 235, 59, 0.3);
    border-radius: 2px;
}
