/* ========================================
   article.css - 乾隆大藏经 内页样式
   ======================================== */

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

body {
    font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
    color: #2c2c2c;
    background: #f5f3ef;
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 24px 50px;
    line-height: 1.9;
    font-size: 16px;
    transition: background 0.3s, color 0.3s;
}

/* ===== 头部 ===== */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0 16px;
    border-bottom: 3px solid #c9b59e;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.site-title {
    font-size: 20px;
    font-weight: 700;
    color: #3d2b1f;
}

.site-title a {
    color: #3d2b1f;
    text-decoration: none;
    transition: color 0.2s;
}

.site-title a:hover {
    color: #8a6b4f;
}

.site-title a i {
    color: #c9b59e;
    margin-right: 6px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-links a {
    color: #6b5a4a;
    text-decoration: none;
    font-size: 13px;
    padding: 5px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: all 0.25s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #fff;
}

.nav-links a:hover {
    background: #3d2b1f;
    color: #fff;
    border-color: #3d2b1f;
}

/* ===== 文章标题 ===== */
.article-title {
    text-align: center;
    padding: 10px 0 6px;
    margin-bottom: 8px;
    border-bottom: 2px solid #c9b59e;
}

.article-title h1 {
    font-size: 26px;
    font-weight: 700;
    color: #3d2b1f;
    letter-spacing: 2px;
}

/* ===== 文章元信息 ===== */
.article-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    padding: 8px 0 10px;
    margin-bottom: 6px;
    font-size: 14px;
    color: #8a7a6a;
    flex-wrap: wrap;
    border-bottom: 1px solid #e8e0d8;
}

.article-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-meta .meta-item i {
    color: #c9b59e;
    font-size: 14px;
}

.article-meta .meta-item a {
    color: #5a3f2e;
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 500;
}

.article-meta .meta-item a:hover {
    color: #c9b59e;
    text-decoration: underline;
}

/* ===== 控制栏 ===== */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 10px 0 6px;
    flex-wrap: wrap;
    border-top: 1px solid #e8e0d8;
    border-bottom: 1px solid #e8e0d8;
    margin-top: 6px;
    margin-bottom: 16px;
}

.controls .label {
    font-size: 13px;
    color: #8a7a6a;
    margin-right: 4px;
}

.controls .font-btn {
    background: transparent;
    border: 2px solid #c9b59e;
    border-radius: 6px;
    padding: 3px 12px;
    font-size: 14px;
    cursor: pointer;
    color: #6b5a4a;
    font-family: inherit;
    transition: all 0.2s;
}

.controls .font-btn.active {
    background: #c9b59e;
    color: #fff;
}

.controls .font-btn:hover {
    background: #c9b59e;
    color: #fff;
}

.controls .bg-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #c9b59e;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s;
}

.controls .bg-btn.active {
    border-color: #3d2b1f;
    box-shadow: 0 0 0 3px rgba(61, 43, 31, 0.25);
}

.controls .bg-btn[data-bg="cream"] { background: #f5f3ef; }
.controls .bg-btn[data-bg="green"] { background: #e8f5e9; }
.controls .bg-btn[data-bg="gray"] { background: #f0f0f0; }
.controls .bg-btn[data-bg="blue"] { background: #e3f2fd; }
.controls .bg-btn[data-bg="dark"] { background: #1a1a2e; }

.controls .divider {
    color: #ddd;
    font-size: 14px;
    margin: 0 4px;
}

/* ===== 正文内容 ===== */
.article-content {
    padding: 20px 28px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e8e0d8;
}

/* 隐藏正文中的 hr 横杠 */
.article-content hr {
    display: none;
}

.article-content h2 {
    font-size: 20px;
    color: #3d2b1f;
    margin: 20px 0 12px 0;
    padding: 6px 0 6px 12px;
    border-left: 4px solid #c9b59e;
    font-weight: 600;
}

.article-content h3 {
    font-size: 17px;
    color: #3d2b1f;
    margin: 16px 0 10px 0;
    padding-left: 10px;
    border-left: 3px solid #c9b59e;
    font-weight: 600;
}

.article-content h4 {
    font-size: 16px;
    color: #4a3a2a;
    margin: 14px 0 8px 0;
    font-weight: 600;
}

.article-content p {
    margin: 6px 0;
    text-indent: 2em;
    line-height: 2;
}

.article-content .indent {
    display: block;
    margin-left: 2em;
    padding-left: 14px;
    border-left: 2px solid #e0d5c8;
}

.article-content .indent-2 {
    margin-left: 4em;
}

.article-content ul, 
.article-content ol {
    margin: 8px 0 8px 2em;
    padding-left: 8px;
}

.article-content li {
    margin: 3px 0;
    line-height: 1.9;
}

.article-content blockquote {
    margin: 12px 0;
    padding: 12px 18px;
    background: #f5f3ef;
    border-left: 4px solid #c9b59e;
    border-radius: 4px;
    color: #5a4a3a;
}

.article-content blockquote p {
    text-indent: 0;
    margin: 4px 0;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 14px;
}

.article-content table th,
.article-content table td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
}

.article-content table th {
    background: #f0ebe6;
    font-weight: 600;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.article-content a {
    color: #5a3f2e;
    text-decoration: underline;
    transition: color 0.2s;
}

.article-content a:hover {
    color: #c9b59e;
}

/* ===== 上一篇/下一篇导航 ===== */
.article-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0 6px;
    margin-top: 10px;
    border-top: 1px solid #e8e0d8;
    gap: 16px;
}

.article-nav .nav-prev-wrap,
.article-nav .nav-next-wrap {
    flex: 1;
    min-width: 0;
    max-width: 48%;
}

.article-nav .nav-prev-wrap {
    text-align: left;
}

.article-nav .nav-next-wrap {
    text-align: right;
}

.article-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #5a3f2e;
    text-decoration: none;
    font-size: 14px;
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: all 0.25s;
    background: #fff;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.article-nav .nav-prev-wrap a {
    justify-content: flex-start;
}

.article-nav .nav-next-wrap a {
    justify-content: flex-end;
}

.article-nav a:hover {
    background: #3d2b1f;
    color: #fff;
    border-color: #3d2b1f;
}

.article-nav .nav-prev i,
.article-nav .nav-next i {
    font-size: 12px;
    flex-shrink: 0;
}

/* ===== 底部 ===== */
.site-footer {
    margin-top: 30px;
    padding-top: 18px;
    border-top: 2px solid #c9b59e;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
    gap: 4px;
}

.footer-links a {
    color: #7a6a5a;
    text-decoration: none;
    font-size: 14px;
    padding: 4px 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
    border-radius: 4px;
}

.footer-links a i {
    font-size: 14px;
}

.footer-links a:hover {
    color: #3d2b1f;
    background: #f0ebe6;
}

.copyright {
    color: #c0b0a0;
    font-size: 13px;
    line-height: 1.8;
}

/* ===== 返回顶部 ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #c9b59e;
    color: #fff;
    border: none;
    font-size: 18px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: all 0.3s;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.back-to-top:hover {
    background: #3d2b1f;
    transform: translateY(-2px);
}

/* ===== 字体大小 ===== */
body.font-small .article-content {
    font-size: 14px;
}
body.font-small .article-content p {
    font-size: 14px;
}
body.font-small .article-content h2 {
    font-size: 18px;
}
body.font-small .article-content h3 {
    font-size: 15px;
}

body.font-large .article-content {
    font-size: 18px;
}
body.font-large .article-content p {
    font-size: 18px;
}
body.font-large .article-content h2 {
    font-size: 22px;
}
body.font-large .article-content h3 {
    font-size: 19px;
}

/* ===== 背景色 ===== */
body.bg-green {
    background: #e8f5e9;
}
body.bg-green .article-content {
    background: #f5faf5;
}

body.bg-gray {
    background: #f0f0f0;
}
body.bg-gray .article-content {
    background: #fafafa;
}

body.bg-blue {
    background: #e3f2fd;
}
body.bg-blue .article-content {
    background: #f5f9ff;
}

body.bg-dark {
    background: #1a1a2e;
    color: #d4d4d4;
}
body.bg-dark .article-title {
    border-bottom-color: #444;
}
body.bg-dark .article-title h1 {
    color: #e8d5b8;
}
body.bg-dark .article-meta {
    border-bottom-color: #444;
    color: #a09888;
}
body.bg-dark .article-meta .meta-item a {
    color: #c9b59e;
}
body.bg-dark .controls {
    border-color: #444;
}
body.bg-dark .article-content {
    background: #22223a;
    border-color: #444;
}
body.bg-dark .article-content h2 {
    color: #e8d5b8;
    border-left-color: #c9b59e;
}
body.bg-dark .article-content h3 {
    color: #e8d5b8;
    border-left-color: #c9b59e;
}
body.bg-dark .article-content h4 {
    color: #d4c4b0;
}
body.bg-dark .article-content p {
    color: #d4d4d4;
}
body.bg-dark .article-content blockquote {
    background: #2a2a3e;
    border-left-color: #c9b59e;
}
body.bg-dark .article-content blockquote p {
    color: #c0c0c0;
}
body.bg-dark .article-content table th {
    background: #2a2a3e;
    color: #e8d5b8;
}
body.bg-dark .article-content table td {
    border-color: #444;
    color: #d4d4d4;
}
body.bg-dark .article-content a {
    color: #c9b59e;
}
body.bg-dark .site-header {
    border-bottom-color: #444;
}
body.bg-dark .site-title a {
    color: #e8d5b8;
}
body.bg-dark .nav-links a {
    color: #c9b59e;
    border-color: #444;
    background: transp
}
body.bg-dark .nav-links a:hover {
    background: #c9b59e;
    color: #1a1a2e;
}
body.bg-dark .controls .label {
    color: #8a7a6a;
}
body.bg-dark .controls .font-btn {
    border-color: #555;
    color: #b8a898;
}
body.bg-dark .controls .font-btn.active {
    background: #c9b59e;
    color: #1a1a2e;
}
body.bg-dark .controls .bg-btn {
    border-color: #555;
}
body.bg-dark .controls .bg-btn.active {
    border-color: #c9b59e;
}
body.bg-dark .article-nav {
    border-top-color: #444;
}
body.bg-dark .article-nav a {
    color: #c9b59e;
    border-color: #444;
    background: transparent;
}
body.bg-dark .article-nav a:hover {
    background: #c9b59e;
    color: #1a1a2e;
}
body.bg-dark .site-footer {
    border-top-color: #444;
}
body.bg-dark .footer-links a {
    color: #a09888;
}
body.bg-dark .footer-links a:hover {
    color: #e8d5b8;
    background: #2a2a3e;
}
body.bg-dark .copyright {
    color: #666;
}
body.bg-dark .back-to-top {
    background: #c9b59e;
    color: #1a1a2e;
}
body.bg-dark .back-to-top:hover {
    background: #e8d5b8;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    body {
        padding: 16px 14px 30px;
        font-size: 15px;
    }

    .site-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 14px 0 12px;
    }

    .site-title {
        font-size: 18px;
        text-align: center;
    }

    .nav-links {
        justify-content: center;
    }

    .nav-links a {
        font-size: 12px;
        padding: 4px 10px;
    }

    .article-title h1 {
        font-size: 20px;
        letter-spacing: 0;
    }

    .article-meta {
        font-size: 13px;
        gap: 8px 12px;
        padding: 6px 0 10px;
    }

    .controls {
        gap: 3p
        padding: 8px 0 4px;
    }

    .controls .label {
        font-size: 12px;
    }

    .controls .font-btn {
        font-size: 12px;
        padding: 2px 8px;
    }

    .controls .bg-btn {
        width: 24px;
        height: 24px;
    }

    .controls .divider {
        font-size: 12px;
    }

    .article-content {
        padding: 16px 16px;
        border-radius: 8px;
    }

    .article-content h2 {
        font-size: 18px;
    }
    .article-content h3 {
        font-size: 15px;
    }
    .article-content p {
        font-size: 15px;
        text-indent: 1.8em;
    }

    .article-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .article-nav .nav-prev-wrap,
    .article-nav .nav-next-wrap {
        max-width: 100%;
        text-align: center;
    }
    
    .article-nav a {
        font-size: 13px;
        padding: 5px 10px;
        justify-content: center !important;
        max-width: 100%;
        white-space: normal;
        word-break: break-all;
    }

    .footer-links a {
        font-size: 13px;
        padding: 4px 10px;
    }

    .back-to-top {
        bottom: 16px;
        right: 16px;
        width: 38px;
        height: 38px;
        font-size: 16px;
    }

    .copyright {
        font-size: 12px;
    }
}

@media (max-width: 400px) {
    body {
        padding: 12px 10px 24px;
    }

    .article-title h1 {
        font-size: 17px;
    }

    .article-meta {
        font-size: 12px;
        gap: 4px 8px;
    }

    .nav-links a {
        font-size: 11px;
        padding: 3px 8px;
    }

    .controls .font-btn {
        font-size: 11px;
        padding: 1px 6px;
    }

    .controls .bg-btn {
        width: 20px;
        height: 20px;
    }

    .article-content {
        padding: 12px 12px;
    }

    .article-content p {
        font-size: 14px;
        text-indent: 1.5em;
    }

    .article-content h2 {
        font-size: 16px;
    }
    .article-content h3 {
        font-size: 14px;
    }

    .article-nav a {
        font-size: 12px;
        padding: 4px 8px;
    }
}
