body {
    background-color: #121212;
    color: #e0e0e0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    line-height: 1.7;
    padding: 2rem;
    display: flex;
    flex-direction: row;
    align-items: start;
}

body >nav {
    width: 25%;
    counter-reset: section-index 0;
    padding-top: 4rem;
    position: sticky;
    top: 0;
}

body >nav::before {
    content: "Table Of Contents";
    font-size: large;
    font-weight: bold;
}

body >nav a {
    display: flex;
    min-height: 1em;
    width: 100%;
    align-items: start;
}

body >nav a::before {
    display: block;
    width: 2em;
    counter-increment: section-index;
    content: counter(section-index)". ";
    /* content: " "; */
}

body >article {
    width: 65%;
    padding-left: 5%;
}

html {
    scroll-behavior: smooth;
}

/* 通用 Markdown 段落 */
p.md {
    margin: 0.8em 0;
    color: #ddd;
}

/* 标题与日期 */
.title {
    border-bottom: 1px solid #2a2a2a;
    margin-top: 2.2em;
    margin-bottom: 1em;
    padding-bottom: 0.4em;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.title h2 {
    color: #f5f5f5;
    font-size: 1.4em;
    margin: 0;
}

.title h2>span {
    color: #aaa;
    font-size: 1.4em;
}

/* 文字样式 */
.plain.md {
    color: #ddd;
}

.italic.md i {
    color: #ccc;
    font-style: italic;
}

.bold.md b {
    color: #fff;
    font-weight: 600;
}

.underlined.md u {
    text-decoration: underline;
    text-decoration-color: #555;
}

/* 链接 */
a.md {
    color: #80bfff;
    text-decoration: none;
    border-bottom: 1px dashed #80c0ffdd;
}

a.md:hover {
    color: #a8d0ff;
    border-bottom: 1px solid #a8d0ff;
}

/* 图片与说明 */
img.md {
    display: block;
    max-width: 100%;
    border-radius: 8px;
    margin: 1em auto;
    box-shadow: 0 0 12px #000a;
}

p.caption.md {
    text-align: center;
    color: #aaa;
    font-size: 0.9em;
    margin-top: -0.5em;
}

/* 列表 */
ul.itemization {
    list-style: disc;
    margin-left: 1.5em;
    color: #ccc;
}

ul.itemization li {
    margin: 0.4em 0;
}

ul.itemization li .item ul {
    list-style: circle;
    margin-left: 1.2em;
}

/* 数学公式 (KaTeX) */
/* .katex,
.katex-display {
  color: #d6d6d6;
}

.katex-display {
  background: #1e1e1e;
  padding: 0.8em;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1.2em 0;
  box-shadow: 0 0 10px #0004;
} */

/* 内联公式 */
/* .math.inline.md {
  background: #1c1c1c;
  padding: 0.1em 0.3em;
  border-radius: 3px;
} */

/* 代码块 */
pre.code {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 1em;
    overflow-x: auto;
    margin: 1.2em 0;
    box-shadow: 0 0 10px #0005;
    color: #dcdcdc;
}

p.language {
    font-size: 0.85em;
    color: #999;
    margin-bottom: 0.4em;
    text-transform: uppercase;
}

p.code {
    font-family: "Fira Code", Consolas, monospace;
    color: #eaeaea;
    line-height: 1.5;
}

/* 代码高亮基础色（兼容 highlight.js 类名） */
.hljs-variable,
.hljs-title {
    color: #9cdcfe;
}

.hljs-string {
    color: #ce9178;
}

.hljs-function_ {
    color: #c586c0;
}

/* 行号（如果使用 counter-reset） */
/* pre.code {
    counter-reset: line-number;
} */

pre.code p.code::before {
    counter-increment: line-number;
    content: counter(line-number);
    display: inline-block;
    width: 2em;
    text-align: right;
    margin-right: 1em;
    color: #555;
}

/* 响应式优化 */
@media (max-width: 768px) {
    body {
        padding: 1rem;
        flex-direction: column;
    }

    .title h2 {
        font-size: 1.2em;
    }
}

/* 📊 表格样式（暗色主题） */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    background-color: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 10px #0004;
}

/* 表头 */
table thead {
    background-color: #222;
}

table th {
    padding: 0.75em 1em;
    color: #f0f0f0;
    font-weight: 600;
    font-size: 0.95em;
    border-bottom: 2px solid #333;
}

/* 表格主体 */
table tbody tr {
    border-bottom: 1px solid #2a2a2a;
    transition: background-color 0.2s ease;
}

table tbody tr:hover {
    background-color: #262626;
}

table td {
    padding: 0.7em 1em;
    color: #ddd;
    font-size: 0.95em;
    vertical-align: middle;
}

/* 对齐方式 */
th.left,
td.left {
    text-align: left;
}

th.center,
td.center {
    text-align: center;
}

th.right,
td.right {
    text-align: right;
}

/* 表格边框与间距 */
table th:first-child,
table td:first-child {
    padding-left: 1.2em;
}

table th:last-child,
table td:last-child {
    padding-right: 1.2em;
}

/* 响应式优化 */
@media (max-width: 600px) {

    table th,
    table td {
        padding: 0.5em 0.7em;
        font-size: 0.9em;
    }
}

* {
    font-size: large;
}