/* ========================================= */
/*               代码块样式                  */
/* ========================================= */

/* 代码块容器 */
.ContentBox pre {
    background-color: #1e1e1e;
    /* 关键修改：增加顶部内边距给标签栏留位置 */
    padding: 40px 15px 15px 15px; 
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid #40444B;
    /* 关键修改：必须设置相对定位，否则标签栏会跑偏 */
    position: relative; 
    margin: 20px 0;
}

/* 语言标签栏 (顶部条) */
.ContentBox pre::before {
    content: attr(data-lang); /* 读取 HTML 中的 data-lang 属性 */
    position: absolute;
    top: 0;
    left: 0;
    right: 0; /* 让它横向铺满 */
    height: 30px;
    background-color: #2d2d2d;
    color: #858585;
    font-size: 13px;
    font-family: sans-serif;
    line-height: 30px;
    padding-left: 15px;
    border-bottom: 1px solid #40444B;
    border-radius: 8px 8px 0 0; /* 只有上面有两个圆角 */
    text-transform: uppercase;
    font-weight: bold;
    pointer-events: none; /* 让鼠标点击穿透 */
}

/* 默认缺省标签 */
.ContentBox pre:not([data-lang])::before {
    content: "TEXT";
}

/* 行内代码 (`code`) */
.ContentBox code {
    font-family: 'Consolas', 'Courier New', monospace;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    color: #e06c75; 
    font-size: 0.9em;
}

/* 代码块内的代码（移除固定颜色） */
.ContentBox pre code{
    background-color: transparent;
    padding: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #abb2bf;
}





/* ========================================= */
/*               LaTeX 公式适配              */
/* ========================================= */

/* 让所有 KaTeX 公式变成亮色 */
.katex {
    color: #C4C7C5 !important; 
    font-size: 1.1em; /* 稍微放大一点，让公式更清晰 */
}

/* 块级公式滚动条适配 */
.katex-display {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 0;
}

/* ========================================= */
/*               其他 Markdown 样式          */
/* ========================================= */

.ContentBox blockquote {
    color: #8b949e;
    border-left: 4px solid #40444B;
    margin: 20px 0;
    background-color: rgba(255, 255, 255, 0.05);
    padding: 10px 20px;
    border-radius: 0 5px 5px 0;
}

.ContentBox ul, .ContentBox ol {
    color: #C4C7C5;
    padding-left: 20px;
    margin-left: 10px;
}

.ContentBox li {
    margin-bottom: 8px;
}

.ContentBox a {
    color: #58a6ff;
    text-decoration: none;
}
.ContentBox a:hover {
    text-decoration: underline;
}

/* 表格 */
.ContentBox table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    color: #C4C7C5;
    border-radius: 8px;
    overflow: hidden; /* 防止圆角被直角单元格覆盖 */
}

.ContentBox th, .ContentBox td {
    border: 1px solid #40444B;
    padding: 12px 15px;
    text-align: left;
}

.ContentBox th {
    background-color: #313131;
    font-weight: bold;
    color: white;
}

.ContentBox tr:nth-child(even) {
    background-color: rgba(255,255,255,0.02);
}

/* 正文 */
.ContentBox p {
    font-size: 18px; /* 根据你之前的 large 调整 */
    line-height: 1.6;
    margin-bottom: 1.5em; /* 段落间距 */
    text-indent: 0; /* Markdown 通常不推荐首行缩进，若需要保持可改回 2em */
    letter-spacing: 0.04em;
    color: #C4C7C5;
}

.ContentBox hr {
    border: 0;
    border-top: 1px solid #40444B;
    margin: 40px 0;
}