/* 全局样式 - 宣纸底色 */
:root {
    --rice-paper: #FFFEFC; /* 仿古宣纸色 */
}

body {
    font-family: "楷体", "宋体", serif;
    display: flex;
    margin: 0;
    background: var(--rice-paper);
    color: #5A4A3F; /* 茶墨色 */
    min-height: 100vh;
    line-height: 1.6;
}

/* 左侧目录 - 青瓷色调 */
.sidebar {
    width: 300px;
    height: 100vh;
    overflow-y: auto;
    background: #E8F1F2; /* 雨过天青云破处 */
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
    position: fixed;
    transition: all 0.3s;
    border-right: 1px solid #D1D9D9; /* 青瓷冰裂纹 */
}

.sidebar h2 {
    text-align: center;
    color: #3A6351; /* 竹青色 */
    border-bottom: 1px solid #C7D8D2; /* 淡竹叶青 */
    padding-bottom: 10px;
    margin-top: 0;
    font-weight: normal;
    letter-spacing: 2px;
}

/* 筛选控件样式 */
.filter-container {
    margin: 15px 0;
    display: flex;
    justify-content: center;
}

.filter-select {
    width: 300px;
    padding: 8px;
    border: 1px solid #C7D8D2;
    border-radius: 3px;
    background: var(--rice-paper);
    font-family: "楷体", serif;
    font-size: 16px;
    cursor: pointer;
    color: #5A4A3F;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

.filter-select:placeholder-shown {
    color: #A8A59B;
    font-style: italic;
}

.article-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.article-list li {
    margin: 8px 0;
}

.article-list li a {
    display: block;
    padding: 12px 15px;
    background: rgba(255,255,255,0.7);
    color: #5A4A3F;
    text-decoration: none;
    border-radius: 3px;
    transition: all 0.3s;
    border-left: 3px solid transparent;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.article-list li a:hover,
.article-list li a.active   {
    background: #D1E0D7; /* 嫩荷色 */
    color: #3A6351;
    border-left: 3px solid #3A6351;
}

.article-number {
    display: inline-block;
    width: 25px;
    text-align: right;
    margin-right: 10px;
    color: #7A8B7B; /* 苔绿色 */
    font-weight: bold;
}

/* 右侧文章 - 宣纸正文 */
.content {
    flex: 1;
    margin-left: 340px;
    padding: 40px;
    max-width: 800px;
    background: var(--rice-paper);
}

/* 文集标题 */
.collection-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 1px solid #D1D9D9;
    padding-bottom: 20px;
}

.collection-header h1 {
    color: #3A6351;
    font-size: 2.5em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.03);
    margin-bottom: 10px;
    margin-top: 0;
    letter-spacing: 5px;
    font-weight: normal;
}

/* 搜索栏 */
.search-bar {
    margin-top: 15px;
    display: flex;
    justify-content: center;
}

.search-bar input {
    padding: 8px 15px;
    width: 300px;
    border: 1px solid #D1D9D9;
    border-radius: 4px 0 0 4px;
    font-family: "楷体", serif;
    font-size: 16px;
    outline: none;
    background: var(--rice-paper);
    color: #5A4A3F;
}

.search-bar button {
    padding: 8px 15px;
    background: #3A6351;
    color: var(--rice-paper);
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-family: "楷体", serif;
    font-size: 16px;
    transition: background 0.3s;
}

.search-bar button:hover {
    background: #5A4A3F;
}

/* 文章内容 */
.article-content {
    line-height: 1.8;
    font-size: 18px;
    padding-bottom: 80px;
    color: #5A4A3F;
}

.article-title {
    color: #3A6351;
    border-left: 5px solid #7A8B7B;
    padding-left: 15px;
    margin: 40px 0 25px 0;
    font-weight: normal;
    font-size: 1.8em;
}

.article-meta {
    color: #7A8B7B;
    font-size: 14px;
    margin-bottom: 30px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.article-meta span {
    display: flex;
    align-items: center;
}

.article-meta span::before {
    content: "•";
    margin-right: 5px;
    color: #C7D8D2;
}

/* 关键词高亮 */
.highlight {
    background-color: #F0E6C5; /* 蜜蜡黄 */
    padding: 0 3px;
    border-radius: 2px;
    color: #5A4A3F;
}

/* 段落缩进 */
.paragraph-indent {
    text-indent: 2em;
}

/* 诗和词格式样式 */
.poem {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background: rgba(241,245,240,0.5); /* 蝉翼宣 */
    border-radius: 3px;
}

.poem-title {
    font-weight: bold;
    margin-bottom: 15px;
    color: #3A6351;
}

.poem-content {
    white-space: pre-line;
    line-height: 2.2;
    font-size: 1.1em;
}
 
/* 诗词正文与注释差异化样式 */
.poem-content {
    color: #5a3921; /* 正文颜色 */
    font-size: 1.1em;
    line-height: 2;
}
 
/* 注释类样式 */
.annotation {
    color: #8b4513; /* 棕色 */
    font-family: "宋体", SimSun, serif;
    font-size: 0.9em;
    line-height: 1.6;
    border-left: 2px solid #cdaa7d;
    padding-left: 15px;
    margin: 15px 0;
}
 
/* 针对特定关键词的样式 */
p:has(strong:contains("附注")),
p:has(strong:contains("附记")),
p:has(strong:contains("注")) {
    color: #666 !important;
    font-style: italic;
}

/* 加载指示 */
.loading {
    text-align: center;
    padding: 50px;
    color: #7A8B7B;
    font-size: 1.2em;
}

/* 悬浮导航按钮 */
.article-float-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    padding: 10px;
    background: rgba(248,244,233,0.95); /* 半透明宣纸 */
    border-top: 1px solid #D1D9D9;
    z-index: 90;
    display: none;
}

.article-float-nav a {
    color: #3A6351;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 20px;
    background: rgba(255,255,255,0.8);
    transition: all 0.3s;
    border: 1px solid #D1D9D9;
}

.article-float-nav a:hover {
    background: #3A6351;
    color: white;
    text-decoration: none;
}

/* 页面导航样式 */
.page-navigation {
    text-align: center;
    margin: 20px 0;
    padding: 10px;
    background: rgba(241,245,240,0.5);
    border-radius: 5px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
}

.page-link {
    margin: 0 5px;
    padding: 5px 12px;
    color: #5A4A3F;
    text-decoration: none;
    border-radius: 3px;
    transition: background 0.3s;
    font-size: 15px;
    white-space: nowrap;
}

.page-link:hover {
    background: #D1E0D7;
    color: #3A6351;
}

.page-link.active   {
    background: #3A6351;
    color: white;
}

/* 卷按钮特殊样式 */
.volume-btn {
    font-weight: bold;
}

/* 作者版权按钮 */
.author-link a {
    display: block;
    text-align: center;
    padding: 10px;
    background: rgba(58,99,81,0.1);
    color: #3A6351;
    margin-bottom: 15px;
    border-radius: 5px;
    transition: all 0.3s;
    border: 1px dashed rgba(58,99,81,0.3);
}

.author-link a:hover {
    background: rgba(58,99,81,0.2);
    border-color: #3A6351;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    body {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        z-index: 100;
        padding: 15px;
        max-height: 50vh;
        overflow-y: auto;
        transition: all 0.3s;
        border-right: none;
        border-bottom: 1px solid #D1D9D9;
    }
    
    .sidebar.hidden   {
        max-height: 0;
        padding: 0;
        overflow: hidden;
        opacity: 0;
    }
    
    .content {
        margin-left: 0;
        padding: 20px;
    }
    .collection-header h1 {
        font-size: 1.8em;
        letter-spacing: 3px;
    }
    .search-bar input {
        width: 70%;
    }
    
    /* 标签页导航样式 */
    .tab-nav {
        display: flex;
        justify-content: space-around;
        border-bottom: 1px solid #D1D9D9;
        margin-bottom: 15px;
    }
    .tab-nav button {
        flex: 1;
        padding: 10px;
        background: transparent;
        border: none;
        color: #5A4A3F;
        cursor: pointer;
        font-family: "楷体", serif;
        transition: all 0.3s;
    }
    .tab-nav button.active   {
        color: #3A6351;
        border-bottom: 2px solid #3A6351;
    }
    .tab-content {
        display: none;
    }
    .tab-content.active   {
        display: block;
    }
    
    /* 显示移动端悬浮导航 */
    .article-float-nav {
        display: flex;
    }
    
    /* 移动端导航样式优化 */
    .page-navigation {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }
    
    .page-link {
        margin: 0;
        padding: 6px 10px;
        font-size: 13px;
    }
    
    /* 显示/隐藏侧边栏按钮 */
    .sidebar-toggle {
        position: fixed;
        top: 10px;
        right: 10px;
        background: rgba(58,99,81,0.9);
        color: white;
        border-radius: 50%;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 101;
        cursor: pointer;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    
    .filter-container {
        margin: 10px 0;
    }
    
    .filter-select {
        width: 70%;
        padding: 6px;
        font-size: 14px;
    }
}

/* 打印样式 */
@media print {
    .sidebar, .search-bar {
        display: none;
    }
    .content {
        margin: 0;
        width: 100%;
    }
}
/* 道玄文集图片样式规范 */
.dx-image {
max-width: 90%;
height: auto;
display: block;
margin: 20px auto;
border: 1px solid #D4B483; /* 古典绢布色边框 */
border-radius: 2px;
box-shadow: 0 4px 8px rgba(139, 69, 19, 0.15); /* 朱砂色阴影 */
transition: all 0.3s ease;
background-color: #FFF9F0; /* 宣纸底色 */
padding: 5px;
}
 
/* 悬停动画效果 */
.dx-image:hover {
transform: translateY(-3px);
box-shadow: 0 6px 12px rgba(139, 69, 19, 0.2);
}
 
/* 图片说明文字 */
.dx-caption {
font-family: "方正楷体", "楷体", serif;
font-size: 13px;
color: #7A8B7B; /* 青灰色 */
text-align: center;
margin-top: 8px;
line-height: 1.5;
}
 
/* 特殊图片变体 */
.dx-image-poetic {
border: 2px double #8B4513; /* 双线边框 */
background-color: #F5F0E6; /* 古书衬页色 */
padding: 10px;
}
 
.dx-image-modern {
border: none;
box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
border-radius: 4px;
}
 
/* 响应式适配 */
@media (max-width: 768px) {
.dx-image {
max-width: 95%;
margin: 15px auto;
}

.dx-caption {
font-size: 12px;
}
}
.image-container {
  margin: 25px 0;
  text-align: center;
}
/* 添加到您的样式表 */
.image-container {
  margin: 1.5em auto;
  text-align: center;
  max-width: 95%;
}
 
.dx-image {
  border: 1px solid #D4B483;
  padding: 5px;
  background: #FFF9F0;
  max-width: 100%;
}
 
.dx-caption {
  font-size: 0.9em;
  color: #6D7B7D;
  margin-top: 0.5em;
}
/* ===== 作者版权链接 ===== */
.author-copyright-link {
    display: block;
    text-align: center;
    padding: 10px;
    background: rgba(58,99,81,0.1);
    color: #3A6351;
    margin-bottom: 15px;
    border-radius: 5px;
    border: 1px dashed rgba(58,99,81,0.3);
    text-decoration: none;
    transition: all 0.3s;
}
.author-copyright-link:hover {
    background: rgba(58,99,81,0.2);
    border-color: #3A6351;
}
/* ===== 侧边栏切换按钮（移动端默认隐藏） ===== */
.sidebar-toggle {
    display: none;
}
/* ===== 标签页导航（移动端默认隐藏） ===== */
.tab-nav {
    display: none;
}
/* ===== 文章导航（默认隐藏，JS控制显示） ===== */
/* ===== 为 wsf 项目增加的多级标题样式 ===== */
h2 {
    font-size: 1.5em;
    margin: 1.2em 0 0.5em 0;
    color: #3A6351;
    border-bottom: 1px solid #D1D9D9;
    padding-bottom: 0.3em;
    font-weight: normal;
}

h3 {
    font-size: 1.2em;
    margin: 1em 0 0.3em 0;
    color: #4A7B6B;
    font-weight: normal;
}
.article-nav {
    display: none;
}

/* ============================================================
   道玄文集 6.0 新增：阅读工具条 / 提示气泡 / 字号变量 / 夜间模式
   ============================================================ */

/* 正文字号变量（由 render.js 读写，localStorage 记忆） */
.article-content {
    font-size: var(--reader-fs, 18px);
}

/* 右上角阅读工具条（夜间模式 / 字号 / 分享） */
.dx-tools {
    position: fixed;
    top: 14px;
    right: 16px;
    z-index: 200;
    display: flex;
    gap: 6px;
}
.dx-tools button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #C7D8D2;
    background: rgba(255,254,252,0.94);
    cursor: pointer;
    font-size: 15px;
    font-family: "楷体", serif;
    color: #3A6351;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}
.dx-tools button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    background: #FFFFFF;
}
/* 移动端避开右上角侧边栏按钮，移到右下 */
@media (max-width: 768px) {
    .dx-tools {
        top: auto;
        bottom: 64px;
        right: 12px;
        flex-direction: column;
    }
    .dx-tools button {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }
}

/* 提示气泡（复制链接成功等） */
.dx-toast {
    position: fixed;
    left: 50%;
    bottom: 80px;
    transform: translateX(-50%) translateY(20px);
    background: rgba(58,99,81,0.95);
    color: #FFFFFF;
    padding: 10px 22px;
    border-radius: 24px;
    font-size: 15px;
    font-family: "楷体", serif;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 300;
    max-width: 80vw;
    text-align: center;
}
.dx-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================================
   夜间模式（html.dark，由 render.js 切换，localStorage 记忆）
   配色：深墨底 + 浅宣纸字 + 亮竹青点缀
   ============================================================ */
html.dark body {
    background: #1E1B18;
    color: #D8CFC2;
}
html.dark .sidebar {
    background: #26221F;
    border-right-color: #3A3530;
    box-shadow: none;
}
html.dark .sidebar h2 {
    color: #8FBCA9;
    border-bottom-color: #3A3530;
}
html.dark .filter-select {
    background: #1E1B18;
    color: #D8CFC2;
    border-color: #3A3530;
    box-shadow: none;
}
html.dark .article-list li a {
    background: rgba(255,255,255,0.04);
    color: #D8CFC2;
    box-shadow: none;
}
html.dark .article-list li a:hover,
html.dark .article-list li a.active {
    background: #31433C;
    color: #BFE3D2;
    border-left-color: #8FBCA9;
}
html.dark .content {
    background: #1E1B18;
}
html.dark .collection-header {
    border-bottom-color: #3A3530;
}
html.dark .collection-header h1 {
    color: #8FBCA9;
    text-shadow: none;
}
html.dark .search-bar input {
    background: #26221F;
    color: #D8CFC2;
    border-color: #3A3530;
}
html.dark .search-bar button {
    background: #4A7B6B;
    color: #F0EFE9;
}
html.dark .article-title {
    color: #8FBCA9;
    border-left-color: #5A7B6B;
}
html.dark .article-content {
    color: #D8CFC2;
}
html.dark .article-meta {
    color: #8A9B8B;
}
html.dark .poem {
    background: rgba(255,255,255,0.03);
}
html.dark .poem-content {
    color: #E3D5C3;
}
html.dark .poem-title {
    color: #8FBCA9;
}
html.dark .annotation {
    color: #D0A87E;
    border-left-color: #6B5A3E;
}
html.dark .highlight {
    background-color: #6B5A2A;
    color: #F5EDD8;
}
html.dark .page-navigation {
    background: rgba(255,255,255,0.03);
}
html.dark .page-link {
    color: #D8CFC2;
}
html.dark .page-link:hover {
    background: #31433C;
    color: #BFE3D2;
}
html.dark .page-link.active {
    background: #4A7B6B;
    color: #F0EFE9;
}
html.dark .author-link a,
html.dark .author-copyright-link {
    background: rgba(143,188,169,0.08);
    color: #8FBCA9;
    border-color: rgba(143,188,169,0.3);
}
html.dark .article-float-nav {
    background: rgba(30,27,24,0.95);
    border-top-color: #3A3530;
}
html.dark .article-float-nav a {
    color: #8FBCA9;
    background: #2A2622;
    border-color: #3A3530;
}
html.dark h2 {
    color: #8FBCA9;
    border-bottom-color: #3A3530;
}
html.dark h3 {
    color: #7BA394;
}
html.dark .dx-image {
    background: #2A2622;
    border-color: #6B5A3E;
    box-shadow: none;
}
html.dark .dx-caption {
    color: #8A9B8B;
}
html.dark .tab-nav {
    border-bottom-color: #3A3530;
}
html.dark .tab-nav button {
    color: #D8CFC2;
}
html.dark .tab-nav button.active {
    color: #8FBCA9;
    border-bottom-color: #8FBCA9;
}
html.dark .sidebar-toggle {
    background: rgba(74,123,107,0.9);
}
html.dark .dx-tools button {
    background: rgba(42,38,34,0.94);
    border-color: #3A3530;
    color: #8FBCA9;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
html.dark .dx-toast {
    background: rgba(74,123,107,0.97);
}

/* 夜间模式 · 搜索页（search.html 内联样式的覆盖） */
html.dark .container {
    background: #26221F;
    border-color: #3A3530;
    box-shadow: none;
}
html.dark .header {
    border-bottom-color: #3A3530;
}
html.dark .header h1 {
    color: #8FBCA9;
}
html.dark .header h1 span {
    color: #7A8B7B;
}
html.dark .back-link {
    color: #8FBCA9;
    border-color: #3A3530;
}
html.dark .back-link:hover {
    background: #4A7B6B;
    color: #F0EFE9;
}
html.dark .search-bar input {
    background: #1E1B18;
    color: #D8CFC2;
    border-color: #3A3530;
}
html.dark .search-bar input:focus {
    border-color: #8FBCA9;
    box-shadow: 0 0 0 3px rgba(143,188,169,0.12);
}
html.dark .search-bar button {
    background: #4A7B6B;
}
html.dark .search-stats {
    color: #8A9B8B;
}
html.dark .search-stats strong {
    color: #8FBCA9;
}
html.dark .left-panel {
    border-right-color: #3A3530;
}
html.dark .result-item {
    background: rgba(255,255,255,0.03);
}
html.dark .result-item:hover {
    background: #2E2A26;
    border-left-color: #5A7B6B;
}
html.dark .result-item.active {
    background: #31433C;
    border-left-color: #8FBCA9;
}
html.dark .result-item .title {
    color: #8FBCA9;
}
html.dark .result-item .meta {
    color: #8A9B8B;
}
html.dark .result-item .snippet-preview {
    color: #9AAB9B;
}
html.dark .result-item .highlight,
html.dark .preview-article .preview-body .highlight {
    background-color: #6B5A2A;
}
html.dark .preview-placeholder,
html.dark .empty-state {
    color: #7A8B7B;
}
html.dark .preview-article .preview-title {
    color: #8FBCA9;
    border-left-color: #5A7B6B;
}
html.dark .preview-article .preview-meta {
    color: #8A9B8B;
}
html.dark .preview-article .preview-body {
    color: #D8CFC2;
}
html.dark .preview-article .preview-body .annotation {
    color: #D0A87E;
    border-left-color: #6B5A3E;
}
html.dark .preview-article .preview-body .poem-title {
    color: #8FBCA9;
}
html.dark .preview-nav {
    border-top-color: #3A3530;
    color: #8A9B8B;
}
html.dark .preview-nav a {
    color: #8FBCA9;
}
html.dark .preview-nav a:hover {
    background: #31433C;
}
