/* COTA 文档自定义样式 */

/* 优化中文字体显示 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* 代码块字体优化 */
code, .hljs {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
}

/* 标题样式优化 */
.chapter li.chapter-item {
    line-height: 1.6;
}

/* 搜索结果样式 */
#searchresults {
    max-height: 400px;
    overflow-y: auto;
}

/* 导航链接样式 */
.nav-chapters .nav-chapter {
    padding: 0.5rem 0;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .sidetoc {
        font-size: 0.9rem;
    }
}

/* GitHub链接样式 */
.github-corner:hover .octo-arm {
    animation: octocat-wave 560ms ease-in-out;
}

@keyframes octocat-wave {
    0%, 20% { transform: rotate(0deg) }
    40%, 60% { transform: rotate(-25deg) }
    80%, 100% { transform: rotate(10deg) }
}

/* 代码复制按钮样式 */
.hljs .copy-button {
    display: none;
}

pre:hover .copy-button {
    display: block;
}

/* Mermaid 图表样式 */
.mermaid-container {
    margin: 1rem 0;
    text-align: center;
    padding: 1rem;
    background: #1a1a1a;
    border-radius: 8px;
    border: 1px solid #333;
}

.mermaid {
    max-width: 100%;
    height: auto;
}

/* Mermaid 深色主题适配 */
.mermaid svg {
    background: transparent !important;
    max-width: 100%;
    height: auto;
}

.mermaid .node rect,
.mermaid .node circle,
.mermaid .node ellipse,
.mermaid .node polygon {
    fill: #2d3748 !important;
    stroke: #4a5568 !important;
    stroke-width: 1px !important;
}

.mermaid .node .label {
    color: #e2e8f0 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

.mermaid .edgePath .path {
    stroke: #718096 !important;
    stroke-width: 1.5px !important;
}

.mermaid .edgeLabel {
    background-color: #1a202c !important;
    color: #e2e8f0 !important;
    padding: 2px 4px !important;
    border-radius: 3px !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .mermaid-container {
        margin: 0.5rem 0;
        padding: 0.5rem;
    }
    
    .mermaid svg {
        width: 100% !important;
        height: auto !important;
    }
}
