/* 全局样式 */
:root {
    --primary-color: #000000;
    --secondary-color: #333333;
    --accent-color: #666666;
    --light-bg: #f8f8f8;
    --text-color: #000000;
    --border-color: #000000;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    color: var(--text-color);
    font: 16px/1.6 "Microsoft YaHei", "SimSun", "SimHei", sans-serif;
    background: #FFFFFF;
    letter-spacing: 0.5px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
    color: #000000;
    background-color: #f0f0f0;
    border-radius: 2px;
}

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 20px 0;
    padding: 0;
    word-break: break-word;
    line-height: 1.8;
}

img {
    border: 0;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

#post1 img {
    width: 100%; /* 特殊需求 */
}

img.logo {
    width: auto; /* logo保持原始尺寸 */
    margin-top: 10px;
    animation: a1 6s linear infinite alternate;
}

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

button, select, input {
    font-family: inherit;
    font-size: inherit;
    outline: none;
}

select:focus, input:focus, button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

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

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

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

/* 顶部容器样式 */
#divTop {
    width: 100%;
    margin: 0 auto;
    padding: 20px 0;
    text-align: center;
    position: relative;
    border-bottom: 2px solid #000000;
}

/* 标题样式 */
#BlogTitle {
    text-align: center;
    font-size: 36px;
    margin: 0;
    padding: 0 100px;
    font-family: "SimHei", "Microsoft YaHei", sans-serif;
    font-weight: bold;
    letter-spacing: 2px;
    transition: margin-top 0.3s ease;
}

/* 检测标题是否包含英文字符 */
#BlogTitle:not(:lang(zh)) {
    margin-top: 8px;
}

#BlogTitle a {
    color: #000000;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
}

#BlogTitle a:hover {
    background-color: #f0f0f0;
}

/* 副标题样式 */
#BlogSubTitle {
    text-align: center;
    color: #000000;
    font-size: 14px;
    font-family: "SimSun", serif;
    margin: 10px 0 0 0;
    padding: 0 100px;
    letter-spacing: 1px;
    opacity: 0.8;
}

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

.language-switcher button {
    background: #ffffff;
    border: 1px solid #000000;
    padding: 6px 12px;
    margin-left: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #000000;
    border-radius: 3px;
    font-family: "Microsoft YaHei", sans-serif;
}

.language-switcher button.active {
    background-color: #000000;
    color: #ffffff;
}

.language-switcher button:hover {
    background-color: #000000;
    color: #ffffff;
}

/* 其他部分样式 */
#divMain {
    width: 100%;
    margin: 30px 0;
    padding: 0;
    text-align: left;
}

#divBottom {
    width: 100%;
    margin: 40px auto 0;
    padding: 20px 0;
    text-align: center;
    border-top: 2px solid #000000;
    background: #ffffff;
    clear: both;
}

/* 路径导航样式 - 修复溢出问题 */
#path {
    width: 100%;
    padding: 20px;
    margin: 0 0 30px 0;
    font-size: 16px;
    font-family: "Microsoft YaHei", sans-serif;
    color: #000000;
    border-bottom: 1px solid #000000;
    background: #fafafa;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
}

#path a {
    padding: 8px 16px;
    color: #000000;
    font-weight: 500;
    position: relative;
    border-radius: 4px;
    transition: all 0.3s ease;
    background-color: #f5f5f5;
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none;
}

#path a:hover {
    background-color: #e8e8e8;
}

/* 导航链接选中效果 */
#path a.active {
    color: #ffffff;
    background-color: #000000;
    font-weight: bold;
}

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

/* 菜单导航 */
.name-header {
    text-align: center;
    margin-bottom: 30px;
    color: #000000;
    font-size: 24px;
    font-family: "SimHei", "Microsoft YaHei", sans-serif;
    font-weight: bold;
    position: relative;
    padding-bottom: 15px;
    letter-spacing: 1px;
}

.name-header:after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: #000000;
}

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

.filter-group {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

.filter-group label {
    margin-right: 12px;
    color: #000000;
    font-weight: 500;
    font-family: "Microsoft YaHei", sans-serif;
    font-size: 14px;
    white-space: nowrap;
}

.filter-group select, .filter-group input {
    padding: 8px 12px;
    border: 1px solid #000000;
    border-radius: 4px;
    color: #000000;
    background: #ffffff;
    font-size: 14px;
    font-family: "Microsoft YaHei", sans-serif;
    width: 100%;
    max-width: 100%;
    min-width: 120px;
}

.search-box {
    display: flex;
    flex: 2;
    min-width: 250px;
    margin-bottom: 0;
}

.search-box input {
    padding: 8px 12px;
    border: 1px solid #000000;
    border-radius: 4px 0 0 4px;
    flex: 1;
    min-width: 150px;
    color: #000000;
    background: #ffffff;
    font-size: 14px;
    font-family: "Microsoft YaHei", sans-serif;
}

.search-box button {
    padding: 8px 16px;
    background-color: #000000;
    color: #ffffff;
    border: 1px solid #000000;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 14px;
    font-family: "Microsoft YaHei", sans-serif;
    font-weight: 500;
    transition: all 0.3s ease;
}

.search-box button:hover {
    background-color: #333333;
}

/* 版权信息样式 */
#BlogCopyRight {
    font-size: 13px;
    color: #000000;
    margin-bottom: -30px;
}

/* 分页样式 */
.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;
}

/* 佛经列表特殊样式 */
.fojing li a {
    display: block;
    padding: 12px 15px;
    margin: 5px 0;
    border: 1px solid #000000;
    border-radius: 4px;
    color: #000000;
    text-decoration: none;
    transition: all 0.3s ease;
    font-family: "SimSun", serif;
    font-size: 15px;
}

.fojing li a:hover {
    background-color: #000000;
    color: #ffffff;
    transform: translateX(5px);
}

/* 内容区域优化 */
.post-body {
    font-size: 16px;
    line-height: 1.8;
    font-family: "SimSun", "Microsoft YaHei", serif;
}

.post-body h1, 
.post-body h2, 
.post-body h3 {
    font-family: "SimHei", "Microsoft YaHei", sans-serif;
    font-weight: bold;
    color: #000000;
    margin: 30px 0 15px 0;
}

.post-body h1 {
    font-size: 24px;
    border-bottom: 2px solid #000000;
    padding-bottom: 10px;
}

.post-body h2 {
    font-size: 20px;
}

.post-body h3 {
    font-size: 18px;
}

/* 音频播放器样式修复 */
.audio-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    background-color: #ffffff;
    transition: all 0.3s ease;
    position: relative;
}

.audio-item:hover {
    background-color: #fafafa;
}

.audio-item.playing {
    background-color: #f5f5f5;
}

.audio-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    margin-right: 18px;
    object-fit: cover;
    flex-shrink: 0;
}

.audio-info {
    overflow: hidden;
    min-width: 0;
    flex: 1;
}

.audio-title {
    font-size: 18px;
    font-weight: 600;
    color: #000000;
    margin: 0 0 6px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audio-title a {
    color: #000000;
}

.audio-controls {
    display: flex;
    align-items: center;
    margin-left: auto;
    flex-shrink: 0;
}

.progress-container {
    height: 5px;
    background-color: #e0e0e0;
    border-radius: 3px;
    width: 200px;
    margin: 0 20px;
    overflow: hidden;
    display: none;
    cursor: pointer;
    flex-shrink: 0;
}

.audio-item.playing .progress-container {
    display: block;
}

.progress-bar {
    height: 100%;
    background: #000000;
    width: 0%;
    transition: width 0.2s ease;
    border-radius: 3px;
}

.play-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #000000;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.time-display {
    font-size: 14px;
    color: #666666;
    display: none;
    width: 90px;
    text-align: center;
    flex-shrink: 0;
}

.audio-item.playing .time-display {
    display: block;
}

/* 移动端响应式调整 - 重点修复路径导航溢出问题 */
@media (max-width: 768px) {
    body {
        font-size: 15px;
        line-height: 1.7;
    }
    
    #divAll {
        width: 95%;
    }
    
    #divTop {
        padding: 15px 0;
    }
    
    #BlogTitle {
        font-size: 28px;
        padding: 0 20px;
    }
    
    #BlogSubTitle {
        font-size: 13px;
        padding: 0 20px;
    }
    
    .language-switcher {
        position: relative;
        top: 0;
        right: 0;
        text-align: center;
        margin: 15px 0;
    }
    
    /* 修复路径导航溢出问题 */
    #path {
        padding: 15px 10px;
        margin: 0 0 20px 0;
        font-size: 15px;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); /* 自适应列数 */
        gap: 8px;
        white-space: normal;
        overflow-x: visible;
    }
    
    #path a {
        padding: 8px 5px;
        font-size: 14px;
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        background-color: #f5f5f5;
        word-break: break-word;
        white-space: normal;
        line-height: 1.3;
        hyphens: auto;
        overflow: hidden;
    }
    
    #path a.active:after {
        display: none;
    }
    
    /* 针对英文导航项的特殊优化 */
    html[lang="en"] #path a,
    body:lang(en) #path a {
        font-size: 11px;
        word-break: break-word;
        padding: 6px 3px;
        min-height: 40px;
    }
    
    .name-header {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .dictionary-filter {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .filter-group {
        justify-content: space-between;
        width: 100%;
        margin-bottom: 10px;
        min-width: 100%;
    }
    
    .filter-group label {
        margin-right: 8px;
        font-size: 13px;
    }
    
    .filter-group select {
        min-width: 150px;
        max-width: 200px;
        flex: 1;
    }
    
    .search-box {
        min-width: 100%;
        flex: none;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 3px;
        margin-bottom: -30px;
    }
    
    .pagination a, 
    .pagination span {
        padding: 8px 12px;
        min-width: 40px;
        font-size: 13px;
    }
    
    /* 音频播放器移动端适配 */
    .audio-item {
        padding: 12px 15px;
        flex-wrap: nowrap;
    }
    
    .audio-thumbnail {
        width: 50px;
        height: 50px;
        margin-right: 12px;
    }
    
    .audio-title {
        font-size: 16px;
    }
    
    .audio-item.playing .progress-container,
    .audio-item.playing .time-display {
        display: none !important;
    }
    
    .audio-controls {
        margin-left: 10px;
    }
    
    .play-btn {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    #BlogTitle {
        font-size: 24px;
    }
    
    .name-header {
        font-size: 18px;
    }
    
    .dictionary-filter {
        gap: 8px;
    }
    
    .filter-group select {
        font-size: 16px;
    }
    
    /* 小屏幕进一步优化路径导航 */
    #path {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
        gap: 5px;
        padding: 10px 5px;
    }
    
    #path a {
        padding: 6px 3px;
        font-size: 14px;
        min-height: 40px;
    }
    
    /* 小屏幕英文导航项优化 */
    html[lang="en"] #path a,
    body:lang(en) #path a {
        font-size: 10px;
        padding: 5px 2px;
        min-height: 36px;
    }
}

/* 超小屏幕特殊处理 */
@media (max-width: 360px) {
    #path {
        grid-template-columns: repeat(2, 1fr); /* 超小屏幕改为2列 */
        gap: 4px;
    }
    
    #path a {
        font-size: 11px;
        min-height: 38px;
    }
    
    html[lang="en"] #path a,
    body:lang(en) #path a {
        font-size: 9px;
        min-height: 34px;
    }
}