/* 全局样式 */
:root {
    --primary-color: #8a9d75;
    --secondary-color: #278D05;
    --accent-color: #5a6e48;
    --light-bg: #f9f9f7;
    --text-color: #565656;
    --border-color: #d5d5d5;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    color: var(--text-color);
    font: 14px Arial, sans-serif, SimSun, simHei;
    background: #FFFFFF;
    letter-spacing: 1px;
    line-height: 1.6;
}

a {
    text-decoration: none;
    transition: all 0.3s ease;
}

a:link {
    color: #278D05;
}


/* 移除点击变色效果 */
/* a:active {
    color: #FF0000;
} */

ul {
    list-style-type: none;
    list-style-position: outside;
    margin: 0;
    padding: 0;
    word-break: break-all;
}

li {
    margin: 0;
    padding: 0;
}

p {
    margin: 0 0 15px 0;
    padding: 0;
    word-break: break-all;
}

img {
    border: 0;
    max-width: 100%;
    height: auto;
    width: 50%;
}
#post1 img{
    border: 0;
    max-width: 100%;
    height: auto;
    width: 100%;
}

img.logo {
    margin-top: 10px;
    animation: a1 6s linear infinite alternate;
}

@keyframes a1 {
    50% {
        transform: scale(1.1);
    }
}

/* 布局样式 */
#divAll {
    width: 98%;
    max-width: 777px;
    margin: 0 auto;
    padding: 0;
}

#divPage {
    width: 100%;
    margin: 0;
    padding: 0 6px;
    text-align: left;
}

#divMiddle {
    width: 100%;
    margin: 0;
    padding: 0;
    text-align: left;
}

#divTop {
    width: 100%;
    margin: 0 auto;
    padding: 0;
    text-align: left;
    height: 88px;
    position: relative;
}

#divMain {
    width: 100%;
    margin: 0;
    padding: 0;
    text-align: left;
}

#divBottom {
    width: 100%;
    margin: 20px auto 0;
    padding: 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    background: #f8f8f8;
    clear: both;
}

/* 顶部标题样式 */
#BlogTitle {
    text-align: center;
    font-size: 32px;
    margin: 10px 0 0 10px;
    padding: 25px 0 0;
    font-family: simhei, simsun;
}

#BlogTitle a {
    color: var(--secondary-color);
}

#BlogTitle a:hover {
    color: #000066;
    text-decoration: none;
}

#BlogSubTitle {
    text-align: center;
    color: #A8A8A8;
    font-size: 12px;
    font-family: simsun;
    margin: 2px 0 0 10px;
    padding: 0;
}

/* 语言切换样式 */
.language-switcher {
    position: absolute;
    top: 5px;
    right: 20px;
}

.language-switcher button {
    background: none;
    border: 1px solid #ddd;
    padding: 3px 8px;
    margin-left: 5px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.language-switcher button.active {
    background-color: #f5f5f5;
    color: var(--secondary-color);
}

/* 路径导航样式 */
#path {
    width: 100%;
    padding: 20px;
    margin: 20px 0 10px;
    font-size: 17px;
    font-family: Arial, sans-serif, SimSun, simHei;
    background: #fafafa;
    color: var(--secondary-color);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    overflow-x: auto;
}

#path a {
    padding: 8px 16px;
    color: var(--secondary-color);
    font-weight: 500;
    position: relative;
    border-radius: 4px;
    transition: all 0.3s ease;
    background-color: var(--light-bg, #f5f5f5); /* 添加默认背景色 */
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none;
}

#path a:hover {
    background-color: var(--light-bg);
    border-radius: 4px;
}

/* 导航链接选中效果 */
#path a.active {
    color: white;
    background-color: var(--primary-color);
    border-radius: 4px;
}

#path a.active:after {
    content: "";
    position: absolute;
    bottom: -11px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--primary-color);
}


.liebiao-list {
    width: 100%;
    margin: 20px 0;
    padding: 0;
}

/* 菜单导航 */


.name-header {
    text-align: center;
    margin-bottom: 25px;
    color: var(--secondary-color);
    font-size: 22px;
    position: relative;
    padding-bottom: 10px;
}

.name-header:after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 2px;
    background: var(--primary-color);
}

.dictionary-filter {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.filter-group label {
    margin-right: 10px;
    color: var(--accent-color);
}

.filter-group select, .filter-group input {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
}

.search-box {
    display: flex;
    margin-bottom: 10px;
}

.search-box input {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px 0 0 4px;
    width: 200px;
}

.search-box button {
    padding: 6px 12px;
    background-color: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

    /* 新增：修复select元素过宽问题 */
    .filter-group select {
        max-width: 100% !important;
        width: 100% !important;
        min-width: auto !important;
    }
    
    /* 确保filter-group容器也能正确约束宽度 */
    .filter-group {
        width: 100%;
        max-width: 100%;
    }
    
    /* 针对搜索框也做类似修复 */
    .search-box {
        width: 100%;
        max-width: 100%;
    }
    /*
    .search-box input {
        width: 100% !important;
        max-width: 100% !important;
    }*/
/* 版权信息样式 */
#BlogCopyRight {
    font-size: 14px;
    color: var(--secondary-color);
    padding: 10px;
    text-align: center;
    font-weight: normal;
    width: 100%;
}

/* 分页样式 */
.pagination {
    display: flex;
}

.pagination li {
    margin: 2px;
    flex-shrink: 0;
}

.pagination a, 
.pagination span {
    display: block;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #8a9d75;
    text-decoration: none;
    transition: all 0.3s ease;
    min-width: 16px;
    text-align: center;
    white-space: nowrap;
}

.pagination a:hover {
    background-color: #f5f5f5;
}

.pagination .active span {
    background-color: #8a9d75;
    color: white;
    border-color: #8a9d75;
}

.pagination .page_disabled span {
    color: #999;
    background-color: #f9f9f9;
    border-color: #ddd;
    cursor: not-allowed;
}

/* 移动端响应式调整 */
@media (max-width: 768px) {
    #path {
        display: grid;
        grid-template-columns: repeat(4, 1fr); /* 4列布局 */
        gap: 10px; /* 项目间距 */
        white-space: normal; /* 取消单行限制 */
        overflow-x: visible; /* 取消水平滚动 */
        padding: 15px 10px;
        margin: 10px 0;
    }
    
    #path a {
        display: flex;
        justify-content: center;
        align-items: center;
        margin-right: 0; /* 移除右边距 */
        padding: 8px 5px; /* 调整内边距 */
        text-align: center;
        min-height: 40px; /* 设置最小高度 */
        box-sizing: border-box;
        border-radius: 4px;
        background-color: var(--light-bg, #f5f5f5); /* 添加默认背景色 */
    }
    
    /* 调整选中状态的下箭头位置 */
    #path a.active:after {
        bottom: -8px; /* 调整位置适应新布局 */
    }
    /* 新增：修复select元素过宽问题 */
    .filter-group select {
        max-width: 100% !important;
        width: 100% !important;
        min-width: auto !important;
    }
    
    /* 确保filter-group容器也能正确约束宽度 */
    .filter-group {
        width: 100%;
        max-width: 100%;
    }
    
    /* 针对搜索框也做类似修复 */
    .search-box {
        width: 100%;
        max-width: 100%;
    }
    
    /* .search-box input {
        width: 100% !important;
        max-width: 100% !important;
    }/*
}


/* 更小屏幕的进一步优化 */
@media (max-width: 480px) {
    #path {
        grid-template-columns: repeat(4, 1fr); /* 在小屏幕上改为2列 */
        font-size: 15px; /* 进一步减小字体 */
    }
}
        
    .pagination {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 5px;
    }
    
    .pagination a, 
    .pagination span {
        padding: 6px 10px;
        font-size: 14px;
    }
            #divAll {
                width: 98%;
            }
            
            #divPage {
                width: 99%;
            }
            
            #divMiddle {
                width: 100%;
            }
            
            #divTop {
                width: 99%;
                height: auto;
                padding-bottom: 10px;
            }
            
            #divBottom {
                width: 100%;
            }
            
            #path a.active:after {
                bottom: -6px;
            }
            
            .post-body {
                width: 100%;
                font-size: 16px;
            }
            
            .fojing {
                width: 100%;
            }
            
            .fojing ul {
                justify-content: center;
            }
            
            /* 修复移动端佛经列表错位问题 */
            .fojing li {
                flex: 1 0 calc(50% - 10px);
                min-width: 0;
                margin-bottom: 5px;
            }
            
            .fojing li a {
                white-space: normal;
                word-break: break-word;
                padding: 8px 5px;
                font-size: 14px;
            }
            
            .language-switcher {
                position: relative;
                top: 0;
                right: 0;
                text-align: center;
                margin-top: 10px;
            }
            
            #BlogTitle {
                font-size: 32px;
            }
            
            /* 修复移动端英文重叠问题 */
            .daojing {
                height: auto; /* 改为自动高度 */
                min-height: 140px; /* 最小高度 */
            }
            
            .daojing-item {
                font-size: 14px;
                height: auto; /* 改为自动高度 */
                min-height: 50px; /* 最小高度 */
                padding: 10px 5px; /* 调整内边距 */
                display: block; /* 改为块级显示 */
                line-height: 1.5; /* 增加行高 */
            }
            
            .daojing-item.english-text {
                font-size: 12px; /* 英文更小字体 */
                line-height: 1.4; /* 英文行高 */
                min-height: 60px; /* 英文最小高度更大 */
            }
            
            .daojing-scroll {
                transition: transform 1s ease-in-out; /* 更平滑的过渡 */
            }
            /* 在小屏幕设备上进一步优化 */
    .dictionary-filter {
        gap: 8px;
    }
    
    .filter-group select {
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    /* 确保路径导航不会导致溢出 */
    #path {
        overflow: hidden;
    }
    
    #path a {
        word-break: break-word;
        white-space: normal;
    }
}