.poem-content {
    font-size: 1rem;
    line-height: 2;
    margin-top: -3rem;
    margin-bottom: -1.5rem !important;
}

/* 文章内容中的链接颜色 - 与著名作者按钮颜色一致 */
.poem-content a,
.translation a {
    color: #0d6efd;
    text-decoration: none;
}

.poem-content a:hover,
.translation a:hover {
    color: #0a58ca;
    text-decoration: underline;
}

.translation {
    font-size: 1rem;
    line-height: 1.8;
    color: #555;
}

/* 深色模式下文章内容中的链接颜色 - 与著名作者按钮颜色一致 */
:root[data-theme="dark"] .poem-content a,
:root[data-theme="dark"] .translation a {
    color: rgba(125, 211, 252, 0.8) !important;
}

:root[data-theme="dark"] .poem-content a:hover,
:root[data-theme="dark"] .translation a:hover {
    color: rgba(125, 211, 252, 1) !important;
}

/* 深色模式下译文文字颜色 - 提高可读性 */
:root[data-theme="dark"] .translation {
    color: rgba(230, 232, 234, 0.85) !important;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.article-tags {
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.breadcrumb {
    background-color: transparent;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
}

/* AI对话相关样式 */
.ai-chat-button {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #007bff;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.ai-chat-button:hover {
    background-color: #0056b3;
}

.ai-chat-dialog {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 500px;
    height: 600px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    z-index: 1000;
}

.ai-chat-header {
    padding: 10px;
    background-color: #007bff;
    color: white;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-chat-messages {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.ai-chat-messages::after {
    content: "";
    display: table;
    clear: both;
}

.ai-chat-input {
    padding: 10px;
    border-top: 1px solid #ddd;
}

.message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    max-width: 80%;
    display: inline-block;
    word-break: break-word;
}

.user-message {
    background-color: #e3f2fd;
    margin-left: auto;
    float: right;
    clear: both;
}

.ai-message {
    background-color: #f1f1f1;
    float: left;
    clear: both;
}

/* 调整AI消息中Markdown渲染的段落间距 */
.ai-message p {
    margin-top: 0.3rem;
    margin-bottom: 0.3rem;
}

.ai-message p:first-child {
    margin-top: 0;
}

.ai-message p:last-child {
    margin-bottom: 0;
}

/* 调整AI消息中Markdown渲染的列表间距 */
.ai-message ul,
.ai-message ol {
    margin-top: -2.5rem;
    margin-bottom: -1.5rem;
    padding-left: 1.5rem;
}

.ai-message li {
    margin-bottom: -1.8rem;
}

.ai-message li:last-child {
    margin-bottom: 0;
}

/* AI对话按钮提示气泡 */
.ai-chat-tooltip {
    position: fixed;
    bottom: 90px;
    right: 90px;
    background-color: #fff;
    color: #333;
    padding: 8px 15px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    max-width: 200px;
    opacity: 1;
    z-index: 999;
}

.ai-chat-tooltip:after {
    content: "";
    position: absolute;
    bottom: 8px;
    right: -10px;
    border-width: 10px 0 10px 10px;
    border-style: solid;
    border-color: transparent transparent transparent #fff;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

/* 响应式设计 - 移动设备适配 */
@media (max-width: 768px) {
    .ai-chat-dialog {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    .ai-chat-header {
        border-radius: 0;
    }

    .ai-chat-button {
        bottom: 70px;
        right: 20px;
    }

    .ai-chat-tooltip {
        bottom: 30px;
        right: 90px;
        max-width: 150px;
        font-size: 12px;
    }

    .message {
        max-width: 90%;
    }
}

/* 朗读功能相关样式 */
.read-aloud-loading {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
    cursor: not-allowed !important;
}

.read-aloud-playing {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: white !important;
}

.read-aloud-status {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #17a2b8;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    z-index: 1001;
    display: none;
    font-size: 14px;
}

@media (max-width: 768px) {
    .read-aloud-status {
        right: 10px;
        top: 10px;
        font-size: 12px;
        padding: 8px 12px;
    }
}

/* 译文分隔线样式 */
.translation-separator {
    margin: 2rem 0 1.5rem 0;
    height: 1px;
    background-color: #ddd;
    border: none;
}

/* 深色模式下译文分隔线样式 */
:root[data-theme="dark"] .translation-separator {
    background-color: rgba(255, 255, 255, 0.15) !important;
}

/* 文章鉴赏样式 */
.article-appreciation-container {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.appreciation-separator {
    margin: 2rem 0 1.5rem 0;
    height: 1px;
    background-color: #ddd;
    border: none;
}

/* 深色模式下文章鉴赏分隔线样式 */
:root[data-theme="dark"] .appreciation-separator {
    background-color: rgba(255, 255, 255, 0.15) !important;
}

.appreciation-content {
    font-size: 1rem;
    line-height: 1.8;
    color: #444;
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

/* 深色模式下文章鉴赏样式 */
:root[data-theme="dark"] .appreciation-content {
    color: rgba(230, 232, 234, 0.85) !important;
    background-color: #253547 !important;
    border-left-color: rgba(125, 211, 252, 0.8) !important;
}

/* 文章注释样式 */
.article-annotation-container {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.annotation-separator {
    margin: 2rem 0 1.5rem 0;
    height: 1px;
    background-color: #ddd;
    border: none;
}

/* 深色模式下文章注释分隔线样式 */
:root[data-theme="dark"] .annotation-separator {
    background-color: rgba(255, 255, 255, 0.15) !important;
}

.annotation-content {
    font-size: 1rem;
    line-height: 1.8;
    color: #444;
}

.annotation-item {
    margin-bottom: 0.8rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

/* 深色模式下文章注释样式 */
:root[data-theme="dark"] .annotation-content {
    color: rgba(230, 232, 234, 0.85) !important;
}

:root[data-theme="dark"] .annotation-item {
    background-color: #253547 !important;
    border-left-color: #28a745 !important;
}

:root[data-theme="dark"] .annotation-text {
    color: rgba(230, 232, 234, 0.85) !important;
}

.annotation-number {
    display: inline-block;
    background-color: #28a745;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-size: 14px;
    font-weight: bold;
    margin-right: 0.5rem;
    vertical-align: top;
}

.annotation-text {
    display: inline-block;
    width: calc(100% - 34px);
}

@media (max-width: 768px) {

    /* 减小容器和卡片的外边距和内边距 */
    .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .col-md-8 .card {
        margin-bottom: 1rem;
    }

    .col-md-8 .card-body {
        padding: 1rem 0.75rem;
    }

    /* 减小面包屑导航的边距 */
    .breadcrumb {
        padding: 0.25rem 0;
        margin-bottom: 0.5rem;
    }

    /* 减小标题的边距 */
    .card-title {
        margin-bottom: 0.75rem !important;
    }

    /* 减小文章元数据的边距 */
    .article-meta {
        margin-bottom: 0.75rem;
        padding-bottom: 0.5rem;
    }

    /* 减小作者信息区域的边距 */
    .text-center.mb-4 {
        margin-bottom: 1rem !important;
    }

    /* 减小译文分隔线的边距 */
    .translation-separator {
        margin: 1rem 0 0.75rem 0;
    }

    /* 减小译文的边距 */
    .translation {
        margin-bottom: 1rem !important;
    }

    /* 减小标题（h4）的边距 */
    h4.mb-3 {
        margin-bottom: 0.75rem !important;
    }

    /* 减小文章鉴赏容器的边距 */
    .article-appreciation-container {
        margin-top: 1rem;
        margin-bottom: 1rem;
    }

    .appreciation-separator {
        margin: 1rem 0 0.75rem 0;
    }

    .appreciation-content {
        padding: 1rem;
        font-size: 0.9rem;
        margin-bottom: 1rem !important;
    }

    /* 减小文章注释容器的边距 */
    .article-annotation-container {
        margin-top: 1rem;
        margin-bottom: 1rem;
    }

    .annotation-separator {
        margin: 1rem 0 0.75rem 0;
    }

    .annotation-content {
        padding: 0.5rem;
        font-size: 0.9rem;
        margin-bottom: 1rem !important;
    }

    .annotation-item {
        padding: 0.8rem;
        margin-bottom: 0.5rem;
    }

    /* 减小标签区域的边距 */
    .article-tags {
        padding-top: 0.75rem;
        margin-top: 0.75rem;
    }

    /* 减小视频容器的边距 */
    .article-video-container {
        margin-top: 1rem;
        margin-bottom: 1rem;
        padding-top: 0.5rem;
    }
}

/* 图片展示样式 */
.article-image-container {
    margin-top: 1rem;
    margin-bottom: 2rem;
    text-align: center;
}

.image-wrapper {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    display: inline-block;
    max-width: 100%;
}

.image-wrapper img {
    border-radius: 8px;
    max-width: 60%;
    max-height: 400px;
    height: auto;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

@media (max-width: 768px) {
    .article-image-container {
        margin-top: 0.5rem;
        margin-bottom: 1.5rem;
    }

    .image-wrapper img {
        max-width: 80%;
        max-height: 250px;
        object-fit: contain;
    }
}

/* 视频播放器样式 */
.article-video-container {
    margin-top: 2rem;
    margin-bottom: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.video-wrapper {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background: #000;
}

.video-wrapper video {
    border-radius: 8px;
    background: #000;
}

@media (max-width: 768px) {
    .article-video-container {
        margin-top: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .video-wrapper video {
        max-height: 250px;
    }
}

/* 该作者的文章列表样式 */
.author-article-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s;
}

.author-article-item:last-child {
    border-bottom: none;
}

.author-article-item:hover {
    background-color: #f8f9fa;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    border-radius: 4px;
}

.author-article-item a {
    text-decoration: none;
    color: #333;
    display: block;
}

.author-article-item a:hover {
    color: #007bff;
}

.author-article-title {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.author-article-meta {
    font-size: 0.8rem;
    color: #6c757d;
}

/* 深色模式下该作者的文章列表样式 */
:root[data-theme="dark"] .author-article-item {
    border-bottom-color: rgba(255, 255, 255, 0.15) !important;
}

:root[data-theme="dark"] .author-article-item:hover {
    background-color: rgba(255, 255, 255, 0.06) !important;
}

:root[data-theme="dark"] .author-article-item a {
    color: rgba(230, 232, 234, 0.9) !important;
}

:root[data-theme="dark"] .author-article-item a:hover {
    color: rgba(125, 211, 252, 1) !important;
}

/* 同时代作者列表样式 */
.same-dynasty-author-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s;
}

.same-dynasty-author-item:last-child {
    border-bottom: none;
}

.same-dynasty-author-item:hover {
    background-color: #f8f9fa;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    border-radius: 4px;
}

.same-dynasty-author-item a {
    text-decoration: none;
    color: #333;
    display: block;
}

.same-dynasty-author-item a:hover {
    color: #007bff;
}

.same-dynasty-author-name {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.same-dynasty-author-meta {
    font-size: 0.8rem;
    color: #6c757d;
}

/* 深色模式下同时代作者列表样式 */
:root[data-theme="dark"] .same-dynasty-author-item {
    border-bottom-color: rgba(255, 255, 255, 0.15) !important;
}

:root[data-theme="dark"] .same-dynasty-author-item:hover {
    background-color: rgba(255, 255, 255, 0.06) !important;
}

:root[data-theme="dark"] .same-dynasty-author-item a {
    color: rgba(230, 232, 234, 0.9) !important;
}

:root[data-theme="dark"] .same-dynasty-author-item a:hover {
    color: rgba(125, 211, 252, 1) !important;
}
