/* ========================================
   铭心阁识辨辑 · 公共样式
   包含：面包屑、系列导航、返回顶部、目录、引用块等
   ======================================== */

/* ---------- CSS 变量 ---------- */
:root {
    --ink-light: #6a7a6a;
    --paper: #f6f8f6;
    --zhu-red: #b53b2c;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    background-color: #faf9f8;
    color: #1e1e1e;
    line-height: 1.6;
    padding: 2rem 1rem;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    padding: 2rem;
}

/* ---------- 标题 ---------- */
h1 {
    text-align: center;
}

h2 {
    border-left: 3px solid #2c6e2f;
    padding-left: 0.8rem;
}

h3 {
    margin-left: 2.5em;
}

h2, h3, h4, h5, h6 {
    margin-top: 1.2em;
    margin-bottom: 0.5em;
    font-weight: 600;
}
h4, h5, h6 {
    margin-left: 0;
}

/* ---------- 段落 ---------- */
.container p {
    text-indent: 2em;
    margin-bottom: 1rem;
}
.container p.no-indent {
    text-indent: 0;
}

/* ---------- 链接 ---------- */
a {
    text-decoration: none;
    color: #2c6e2f;
    border-bottom: 1px dotted #c8d6c8;
}
a:hover {
    color: #1a4a1c;
    border-bottom-color: #2c6e2f;
}

/* ---------- 列表 ---------- */
ul, ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}
li {
    margin-bottom: 0.5rem;
}

/* ---------- 面包屑 ---------- */
.breadcrumb {
    font-size: 0.85rem;
    color: var(--ink-light);
    margin-bottom: 1.5rem;
    padding: 0.4rem 0.8rem;
    background: var(--paper);
    border-radius: 20px;
    display: inline-block;
    opacity: 0.7;
}
.breadcrumb a {
    color: var(--ink-light);
    text-decoration: none;
    border-bottom: none;
}
.breadcrumb a:hover {
    color: var(--zhu-red);
    text-decoration: underline;
}
.breadcrumb span {
    margin: 0 4px;
}

/* ---------- 章内目录 ---------- */
.toc {
    background: #f9fafb;
    border-left: 4px solid #2c6e2f;
    padding: 0.8rem 1.2rem;
    margin: 1.5rem 0;
    border-radius: 8px;
}
.toc h2 {
    font-size: 1.1rem;
    margin: 0 0 0.5rem 0;
    color: #2c6e2f;
    border-left: none;
    padding-left: 0;
}
.toc ul {
    margin: 0;
    padding-left: 1.2rem;
    list-style: none;
}
.toc li {
    margin: 0.3rem 0;
}
.toc a {
    text-decoration: none;
    color: #2c6e2f;
    border-bottom: 1px dotted #c8d6c8;
}
.toc a:hover {
    border-bottom-style: solid;
}
.toc ul ul {
    padding-left: 1.5rem;
}

/* ---------- 独立引用块 ---------- */
.quote-block {
    display: block;
    margin: 1rem 0;
    padding: 0.8rem 1.2rem;
    font-style: italic;
    color: #2c6e2f;
    background: #f0f5f0;
    border-radius: 8px;
    border-left: 3px solid #2c6e2f;
    line-height: 2;
    text-align: center;
    font-size: 1.05rem;
    letter-spacing: 0.04em;
}
.quote-block + p {
    margin-top: 0.8rem;
}

/* ---------- 行内引用 ---------- */
.inline-quote {
    color: #2c6e2f;
    font-style: italic;
    background: #f0f5f0;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    white-space: nowrap;
}

/* ---------- 目录列表 ---------- */
.catalog-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}
.catalog-list li {
    padding: 0.4rem 0;
    border-bottom: 1px solid #f0f2f0;
    display: flex;
    align-items: baseline;
    gap: 0.8rem;
}
.catalog-list li:last-child {
    border-bottom: none;
}
.catalog-list .index {
    color: #8a9b8a;
    font-size: 0.85rem;
    min-width: 2.4rem;
    font-feature-settings: "tnum";
}
.catalog-list a {
    color: #2c6e2f;
    text-decoration: none;
    border-bottom: 1px dotted #c8d6c8;
}
.catalog-list a:hover {
    border-bottom-style: solid;
    color: #1a4a1c;
}
.catalog-list .desc {
    color: #8a9b8a;
    font-size: 0.85rem;
    margin-left: auto;
    white-space: nowrap;
}

/* ---------- 下载链接区 ---------- */
.download-links {
    margin: 2rem 0;
}
.download-links h2 {
    font-size: 1.1rem;
    margin: 0 0 1rem 0;
    color: #2c6e2f;
    border-left: none;
    padding-left: 0;
}
.download-grid {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.download-grid a {
    flex: 1;
    min-width: 160px;
    display: block;
    padding: 0.8rem 1.2rem;
    background: #f8f9fa;
    border: 1px solid #eaecef;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    color: #2c6e2f;
    font-size: 1rem;
    transition: 0.2s;
    border-bottom: 1px solid #eaecef;
}
.download-grid a:hover {
    background: #edf0f3;
    border-color: #c8d6c8;
    transform: translateY(-1px);
}

/* ---------- 下载（旧版兼容） ---------- */
.download {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eaecef;
    text-align: center;
}
.download a {
    display: inline-block;
    background-color: #2c6e2f;
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 6px;
    text-decoration: none;
    border: none;
}
.download a:hover {
    background-color: #1a4a1c;
}

/* ---------- 底部版权 ---------- */
.footer-note {
    margin-top: 1rem;
    font-size: 0.8rem;
    text-align: center;
    color: #8a9b8a;
}

/* ---------- blockquote ---------- */
blockquote {
    margin: 1rem 0;
    padding: 0.5rem 1rem;
    background-color: #fefaf0;
    border-left: 4px solid #b88b4a;
    color: #3a3a2a;
    font-style: italic;
}

/* ---------- code / pre ---------- */
pre {
    background-color: #f6f8fa;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    font-family: monospace;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}
code {
    background-color: #f6f8fa;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.85rem;
}
pre code {
    background: none;
    padding: 0;
}

/* ---------- 表格 ---------- */
table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 1rem;
}
th, td {
    border: 1px solid #dfe2e5;
    padding: 0.5rem 1rem;
    text-align: left;
}
th {
    background-color: #f6f8fa;
}

/* ---------- 系列底部导航 ---------- */
.series-nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eaecef;
}
.series-nav a {
    display: inline-block;
    background: #f6f8fa;
    color: #2c6e2f;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    border: 1px solid #e2e4e8;
    transition: 0.2s;
}
.series-nav a:hover {
    background: #edf0f3;
    border-color: #c8d6c8;
}
.series-nav .prev {
    margin-right: auto;
}
.series-nav .next {
    margin-left: auto;
}
.series-nav a.disabled {
    cursor: default;
    opacity: 0.5;
    pointer-events: none;
}
.series-nav a.disabled:hover {
    background: #f6f8fa;
    border-color: #e2e4e8;
}

/* ---------- 返回顶部小圆球 ---------- */
.back-to-top-ball {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: transparent;
    color: #2c6e2f;
    text-decoration: none;
    cursor: pointer;
    box-shadow: none;
    transition: 0.2s;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: normal;
    transform: translateY(2px);
}
.back-to-top-ball:hover {
    background: rgba(44, 110, 47, 0.1);
    transform: scale(1.05) translateY(2px);
    color: #1f5222;
}

/* ---------- 响应式 ---------- */
@media (max-width: 600px) {
    body {
        padding: 1rem;
    }
    .container {
        padding: 1.5rem;
    }
    h1 {
        font-size: 1.5rem;
    }
    h2 {
        font-size: 1.2rem;
    }
    h3 {
        margin-left: 1.5em;
    }
    .series-nav {
        gap: 1rem;
    }
    .series-nav .prev,
    .series-nav .next {
        margin: 0;
    }
    .back-to-top-ball {
        width: 38px;
        height: 38px;
        font-size: 24px;
        bottom: 15px;
        right: 15px;
        transform: translateY(2px);
    }
    .back-to-top-ball:hover {
        transform: scale(1.05) translateY(2px);
    }
    .breadcrumb {
        font-size: 0.78rem;
        padding: 0.3rem 0.6rem;
    }
    .catalog-list li {
        flex-wrap: wrap;
        gap: 0.2rem;
    }
    .catalog-list .desc {
        margin-left: 0;
        width: 100%;
        padding-left: 2.4rem;
        white-space: normal;
    }
    .download-grid a {
        min-width: 100%;
    }
    .quote-block {
        padding: 0.6rem 0.8rem;
        font-size: 0.95rem;
        line-height: 1.9;
        border-left-width: 2px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.8rem 0.6rem;
    }
    h1 {
        font-size: 1.2rem;
    }
    .toc {
        padding: 0.6rem 0.8rem;
    }
    .toc ul {
        padding-left: 0.8rem;
    }
    .toc ul ul {
        padding-left: 1rem;
    }
}
