/* ================================================================
   全局样式库（精简版）
   配色：深色背景 · 白色文字 · 黄色链接 · 浅灰代码块
   ================================================================ */

/* ================================================================
   1. 基础重置
   ================================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", Arial, sans-serif;
    line-height: 1.6;
}


/* ================================================================
   2. 深色主题（正文页）
   适用：body 添加 class="dark-theme"
   ================================================================ */

.dark-theme-c {
    background-color: #632000;
    color: #ffffff;
    padding: 20px;
}

.dark-theme-b {
    background-color: #1A497A;
    color: #ffffff;
    padding: 20px;
}

.dark-theme {
    background-color: #1a1a1a;
    color: #ffffff;
    padding: 20px;
}

.dark-theme h1,
.dark-theme h2,
.dark-theme h3,
.dark-theme h4,
.dark-theme h5,
.dark-theme h6 {
    color: #ffffff;
    margin: 20px 0 12px 0;
}

.dark-theme p {
    margin: 0 0 10px 0;
}

/* ===== 正文所有链接：亮黄色（包括标题里的） ===== */
.dark-theme a,
.dark-theme a:link,
.dark-theme a:visited,
.dark-theme h1 a,
.dark-theme h1 a:link,
.dark-theme h1 a:visited,
.dark-theme h2 a,
.dark-theme h2 a:link,
.dark-theme h2 a:visited,
.dark-theme h3 a,
.dark-theme h3 a:link,
.dark-theme h3 a:visited,
.dark-theme h4 a,
.dark-theme h4 a:link,
.dark-theme h4 a:visited,
.dark-theme h5 a,
.dark-theme h5 a:link,
.dark-theme h5 a:visited,
.dark-theme h6 a,
.dark-theme h6 a:link,
.dark-theme h6 a:visited {
    color: #ffdd00 !important;
    text-decoration: none;
}

.dark-theme a:hover,
.dark-theme h1 a:hover,
.dark-theme h2 a:hover,
.dark-theme h3 a:hover,
.dark-theme h4 a:hover,
.dark-theme h5 a:hover,
.dark-theme h6 a:hover {
    color: #ffdd00 !important;
    text-decoration: underline;
}
.dark-theme-c a {
    color: #FFD700; /* 金盏黄，比纯黄更深邃，搭配咖啡色反而更高级 */
}
/* ===== 目录中的链接：浅灰色（覆盖上面的亮黄色） ===== */
.toc a,
.toc a:link,
.toc a:visited,
.toc li a,
.toc li a:link,
.toc li a:visited {
    color: #cccccc !important;
    font-size: 15px;
    text-decoration: none;
    display: block;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.toc a:hover,
.toc li a:hover {
    color: #ffffff !important;
    background-color: #3a3a3a;
    text-decoration: none;
}

.toc a.active,
.toc li a.active {
    background-color: #ffdd00;
    color: #1a1a1a !important;
    font-weight: bold;
}

/* ===== 目录标题中的"返回主页"链接：亮黄色 ===== */
.toc-title a,
.toc-title a:link,
.toc-title a:visited {
    color: #ffdd00 !important;
    text-decoration: none;
}

.toc-title a:hover {
    color: #ffdd00 !important;
    text-decoration: underline;
}

.dark-theme ul,
.dark-theme ol {
    padding-left: 24px;
    margin: 10px 0;
}

.dark-theme li {
    margin: 4px 0;
}

.dark-theme blockquote {
    border-left: 4px solid #ffdd00;
    padding-left: 16px;
    margin: 12px 0;
    color: #cccccc;
}

.dark-theme hr {
    border: none;
    border-top: 1px solid #444444;
    margin: 24px 0;
}


/* ================================================================
   3. 浅色导航条
   适用：nav 添加 class="nav-light"
   ================================================================ */

.nav-light {
    background-color: #ffffff;
    color: #000000;
    padding: 10px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.nav-light a {
    color: #000000;
    text-decoration: none;
    margin-right: 16px;
}

.nav-light a:hover {
    text-decoration: underline;
}


/* ================================================================
   4. 深色导航条
   适用：nav 添加 class="nav-dark"
   ================================================================ */

.nav-dark {
    background-color: #2a2a2a;
    color: #ffffff;
    padding: 10px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.nav-dark a {
    color: #eeeeee;
    text-decoration: none;
    margin-right: 16px;
}

.nav-dark a:hover {
    text-decoration: underline;
}


/* ================================================================
   5. 代码块（浅灰背景）
   适用：pre, .code-block, .cmd-block
   ================================================================ */

pre,
.code-block,
.cmd-block {
    background-color: #2d2d2d;
    color: #eeeeee;
    font-family: "Consolas", "Monaco", monospace;
    font-size: 14px;
    padding: 12px 16px;
    margin: 10px 0;
    border-radius: 4px;
    border: 1px solid #444444;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: auto;
}

code,
.code-inline {
    background-color: #2d2d2d;
    color: #eeeeee;
    font-family: "Consolas", "Monaco", monospace;
    font-size: 14px;
    padding: 2px 8px;
    border-radius: 3px;
}


/* ================================================================
   6. 表格（深色主题适配）
   ================================================================ */

.dark-theme table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

.dark-theme th,
.dark-theme td {
    padding: 8px 12px;
    border: 1px solid #444444;
    text-align: left;
}

.dark-theme th {
    background-color: #2a2a2a;
    color: #ffdd00;
}

.dark-theme tr:nth-child(even) td {
    background-color: rgba(255, 255, 255, 0.04);
}


/* ================================================================
   7. 响应式目录导航（1300px 断点）
   ================================================================ */

.toc-wrapper {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

.toc {
    background-color: #2a2a2a;
    border-radius: 8px;
    padding: 16px 18px;
    border: 1px solid #444444;
}

.toc-title {
    color: #cccccc;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #444444;
}

.toc ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.toc li {
    margin: 4px 0;
}

.toc-toggle {
    display: none;
    background-color: #2a2a2a;
    color: #ffdd00;
    border: 1px solid #444444;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 16px;
    width: 100%;
    text-align: left;
}

.toc-toggle:hover {
    background-color: #3a3a3a;
}

/* ---------- 大屏 ≥ 1300px ---------- */
@media (min-width: 1300px) {
    .toc-wrapper {
        display: flex;
        gap: 40px;
        padding: 20px;
        align-items: flex-start;
    }

    .toc {
        width: 280px;
        flex-shrink: 0;
        position: sticky;
        top: 20px;
        align-self: flex-start;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
        display: block !important;
    }

    .toc-toggle {
        display: none !important;
    }

    .toc-content {
        flex: 1;
        min-width: 0;
    }
}

/* ---------- 小屏 < 1300px ---------- */
@media (max-width: 1299px) {
    .toc-wrapper {
        flex-direction: column;
        gap: 0;
        padding: 12px;
    }

    .toc {
        width: 100%;
        position: static;
        max-height: none;
        display: none;
        margin-bottom: 16px;
    }

    .toc.open {
        display: block;
    }

    .toc-toggle {
        display: block;
    }
}

.toc::-webkit-scrollbar {
    width: 4px;
}

.toc::-webkit-scrollbar-thumb {
    background: #ffdd00;
    border-radius: 4px;
}

.toc::-webkit-scrollbar-track {
    background: #2a2a2a;
}


/* ================================================================
   8. 工具类
   ================================================================ */

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mt-10 {
    margin-top: 10px;
}

.mb-10 {
    margin-bottom: 10px;
}

.m-10 {
    margin: 10px;
}

.p-10 {
    padding: 10px;
}

.p-20 {
    padding: 20px;
}

.hidden {
    display: none;
}
/* ================================================================
   9. dark-theme-b 链接颜色修复（亮黄色）
   ================================================================ */

.dark-theme-b a,
.dark-theme-b a:link,
.dark-theme-b a:visited,
.dark-theme-b h1 a,
.dark-theme-b h1 a:link,
.dark-theme-b h1 a:visited,
.dark-theme-b h2 a,
.dark-theme-b h2 a:link,
.dark-theme-b h2 a:visited,
.dark-theme-b h3 a,
.dark-theme-b h3 a:link,
.dark-theme-b h3 a:visited,
.dark-theme-b h4 a,
.dark-theme-b h4 a:link,
.dark-theme-b h4 a:visited,
.dark-theme-b h5 a,
.dark-theme-b h5 a:link,
.dark-theme-b h5 a:visited,
.dark-theme-b h6 a,
.dark-theme-b h6 a:link,
.dark-theme-b h6 a:visited {
    color: #ffdd00 !important;
    text-decoration: none;
}

.dark-theme-b a:hover,
.dark-theme-b h1 a:hover,
.dark-theme-b h2 a:hover,
.dark-theme-b h3 a:hover,
.dark-theme-b h4 a:hover,
.dark-theme-b h5 a:hover,
.dark-theme-b h6 a:hover {
    color: #ffdd00 !important;
    text-decoration: underline;
}

/* 目录中的链接保持浅灰色 */
.toc a,
.toc a:link,
.toc a:visited {
    color: #cccccc !important;
}

.toc a:hover {
    color: #ffffff !important;
}

.toc-title a,
.toc-title a:link,
.toc-title a:visited {
    color: #ffdd00 !important;
}