.article-meta {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}
.article-content {
    line-height: 1.8;
    font-family: inherit; /* 继承全局字体 */
    background-color: #ffffff;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin: 20px 0;
}

/* 确保 markdown-body 也使用全局字体 */
.article-content .markdown-body {
    font-family: inherit;
}
.article-content img {
    max-width: 100%;
    height: auto;
}
.article-content pre {
    position: relative;
    background-color: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid #e9ecef;
    margin: 1.5rem 0;
    font-family: "Consolas", "Monaco", "Courier New", monospace;
}

/* 代码块复制按钮 */
.code-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 10px;
    background-color: rgba(0, 0, 0, 0.05);
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 12px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 10;
}

.code-copy-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: #374151;
}

.code-copy-btn.copied {
    background-color: #10b981;
    border-color: #10b981;
    color: white;
}

/* 深色模式下的复制按钮 */
[data-theme="dark"] .code-copy-btn {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #45475a;
    color: #a6adc8;
}

[data-theme="dark"] .code-copy-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: #cdd6f4;
}

[data-theme="dark"] .code-copy-btn.copied {
    background-color: #a6e3a1;
    border-color: #a6e3a1;
    color: #1e1e2e;
}

.article-content pre code {
    font-family: "Consolas", "Monaco", "Courier New", monospace;
}

/* 深色模式下的代码块样式 */
[data-theme="dark"] .article-content pre {
    background-color: #11111b;
    border-color: #45475a;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

/* 行内代码样式 */
.article-content code:not(pre code) {
    background-color: #f1f3f5;
    color: #c92a2a;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    border: 1px solid #e9ecef;
    font-family: "Consolas", "Monaco", "Courier New", monospace;
}

[data-theme="dark"] .article-content code:not(pre code) {
    background-color: rgba(203, 166, 247, 0.1);
    color: #f5c2e7;
    border-color: #45475a;
}

/* 深色模式下的文章内容区域 */
[data-theme="dark"] .article-content {
    background-color: #1e1e2e;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 1px solid #45475a;
}

/* 深色模式下的文章元数据边框 */
[data-theme="dark"] .article-meta {
    border-bottom-color: #45475a;
}

/* 深色模式下的文章导航边框 */
[data-theme="dark"] .article-navigation {
    border-top-color: #45475a;
}

/* 深色模式下的表格样式 */
[data-theme="dark"] .article-content table {
    color: #cdd6f4;
}

[data-theme="dark"] .article-content table th,
[data-theme="dark"] .article-content table td {
    border-color: #45475a;
}

[data-theme="dark"] .article-content table thead th {
    background-color: #181825;
    border-bottom-color: #45475a;
}

/* 深色模式下的引用块样式 */
[data-theme="dark"] .article-content blockquote {
    border-left-color: #89b4fa;
    color: #a6adc8;
    background-color: rgba(137, 180, 250, 0.05);
    padding: 12px 15px;
    border-radius: 0 8px 8px 0;
}
.article-content blockquote {
    border-left: 4px solid #6c757d;
    padding-left: 15px;
    color: #6c757d;
}
.article-content table {
    width: 100%;
    margin-bottom: 1rem;
    color: #212529;
    border-collapse: collapse;
}
.article-content table th,
.article-content table td {
    padding: 0.75rem;
    vertical-align: top;
    border-top: 1px solid #dee2e6;
}
.article-content table thead th {
    vertical-align: bottom;
    border-bottom: 2px solid #dee2e6;
}
.article-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}
/* 移动端响应式 - 上下分布 */
@media (max-width: 768px) {
    .article-content {
        padding: 20px 15px;
        margin: 15px 0;
        border-radius: 8px;
    }
    .article-navigation {
        flex-direction: column;
        gap: 15px;
    }
    .article-navigation > div {
        width: 100%;
    }
    .article-navigation > div a {
        width: 100%;
        display: block;
        text-align: center;
    }
    /* 文章元数据在移动端 - 分类和标签单独一行 */
    .article-meta > div > span.me-3 {
        display: block;
        margin-bottom: 10px;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }
    /* 时间、阅读数和编辑按钮保持在同一行 */
    .article-meta > div > span.text-muted,
    .article-meta > div > span.ms-3 {
        display: inline-block;
        margin-bottom: 0;
    }
}
.related-articles {
    margin-top: 30px;
}

/* ========== 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: 20px;
    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; }
}

/* ========== 深色模式 - AI 聊天组件 ========== */
[data-theme="dark"] .ai-chat-button {
    background-color: #89b4fa;
    color: #1e1e2e;
}

[data-theme="dark"] .ai-chat-button:hover {
    background-color: #b4befe;
}

[data-theme="dark"] .ai-chat-dialog {
    background-color: #313244;
    border: 1px solid #45475a;
}

[data-theme="dark"] .ai-chat-header {
    background-color: #89b4fa;
    color: #1e1e2e;
}

[data-theme="dark"] .ai-chat-input {
    border-top-color: #45475a;
}

[data-theme="dark"] .ai-chat-input .form-control {
    background-color: #1e1e2e;
    border-color: #45475a;
    color: #cdd6f4;
}

[data-theme="dark"] .ai-chat-input .form-control::placeholder {
    color: #6c7086;
}

[data-theme="dark"] .ai-chat-input .btn-primary {
    background-color: #89b4fa;
    border-color: #89b4fa;
    color: #1e1e2e;
}

[data-theme="dark"] .ai-chat-input .btn-primary:hover {
    background-color: #b4befe;
    border-color: #b4befe;
}

[data-theme="dark"] .user-message {
    background-color: #45475a;
    color: #cdd6f4;
}

[data-theme="dark"] .ai-message {
    background-color: #1e1e2e;
    color: #cdd6f4;
}

[data-theme="dark"] .ai-chat-tooltip {
    background-color: #313244;
    color: #cdd6f4;
    border: 1px solid #45475a;
}

[data-theme="dark"] .ai-chat-tooltip:after {
    border-color: transparent transparent transparent #313244;
}

/* ========== 响应式设计 - AI 聊天移动端适配 ========== */
@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: 20px;
        right: 20px;
    }

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

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