/* 自定义颜色主题 - 使用更柔和的深青色/靛青色系 */
:root {
    --primary-color: #3a7b99; /* 更柔和的深青色 */
    --primary-color-hover: #2c5c73; /* 悬停时的深色 */
    --primary-color-light: rgba(58, 123, 153, 0.1); /* 浅色背景 */
    --secondary-color: #6c757d; /* 保持不变 */
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #0284c7;
    --light-color: #f1f5f9;
    --dark-color: #1e293b;
    --light-bg: #f8f9fa;
    --dark-bg: #212529;
    --font-family-base: "Noto Sans SC", -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --font-family-code: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Monaco, "Courier New", monospace;
    --font-family-article: "Noto Sans SC", -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --base-font-size: 16px;
    --article-font-size: 16px;
    --small-font-size: 14px;
    --code-font-size: 14px;
    --line-height-base: 1.5;
    --line-height-article: 1.8;
}

/* 全局强制应用字体样式 */
* {
    font-family: var(--font-family-base);
}

/* 代码元素使用等宽字体 */
code, pre, kbd {
    font-family: var(--font-family-code) !important;
    font-size: 1.0em !important;
}

/* 主色调替换 */
.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

/* 统一按钮样式 */
.btn,
.btn-primary,
.btn-secondary,
.btn-outline-primary,
.btn-link,
a.btn {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.2s ease-in-out;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
}

/* 主要按钮样式 */
.btn-primary,
.btn.btn-primary,
a.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

.btn-primary:hover,
.btn-primary:active,
.btn-primary:focus,
.btn.btn-primary:hover,
.btn.btn-primary:active,
.btn.btn-primary:focus,
a.btn-primary:hover,
a.btn-primary:active,
a.btn-primary:focus {
    background-color: var(--primary-color-hover) !important;
    border-color: var(--primary-color-hover) !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

/* 轮廓按钮样式 */
.btn-outline-primary,
.btn.btn-outline-primary,
a.btn-outline-primary {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover,
.btn-outline-primary:active,
.btn-outline-primary:focus,
.btn.btn-outline-primary:hover,
.btn.btn-outline-primary:active,
.btn.btn-outline-primary:focus,
a.btn-outline-primary:hover,
a.btn-outline-primary:active,
a.btn-outline-primary:focus {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

/* 链接按钮样式 */
.btn-link,
a.btn-link,
.article-actions a,
.btn.btn-link {
    color: var(--primary-color);
    text-decoration: none;
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
}

.btn-link:hover,
.btn-link:active,
.btn-link:focus,
a.btn-link:hover,
a.btn-link:active,
a.btn-link:focus,
.article-actions a:hover,
.article-actions a:active,
.article-actions a:focus,
.btn.btn-link:hover,
.btn.btn-link:active,
.btn.btn-link:focus {
    color: var(--primary-color-hover) !important;
    text-decoration: none !important;
    background-color: var(--primary-color-light) !important;
}

/* 次要按钮样式 */
.btn-secondary,
.btn.btn-secondary,
a.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #ffffff;
}

.btn-secondary:hover,
.btn-secondary:active,
.btn-secondary:focus,
.btn.btn-secondary:hover,
.btn.btn-secondary:active,
.btn.btn-secondary:focus,
a.btn-secondary:hover,
a.btn-secondary:active,
a.btn-secondary:focus {
    background-color: #5a6268 !important;
    border-color: #545b62 !important;
    color: #ffffff !important;
}

/* 按钮组样式 */
.btn-group {
    display: inline-flex;
    vertical-align: middle;
}

.btn-group > .btn {
    position: relative;
    flex: 0 1 auto;
}

.btn-group > .btn:not(:first-child) {
    margin-left: -1px;
}

.btn-group > .btn:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.btn-group > .btn:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.btn-group > .btn:hover {
    z-index: 1;
}

.btn-group > .btn:focus,
.btn-group > .btn:active,
.btn-group > .btn.active {
    z-index: 2;
}

/* 小型按钮组样式 */
.btn-group-sm > .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.2rem;
}

/* 暗色模式按钮适配 */
body[data-theme="dark"] .btn-link,
body[data-theme="dark"] a.btn-link,
body[data-theme="dark"] .article-actions a {
    color: var(--primary-color);
}

body[data-theme="dark"] .btn-link:hover,
body[data-theme="dark"] a.btn-link:hover,
body[data-theme="dark"] .article-actions a:hover {
    color: var(--primary-color-hover);
    background-color: var(--primary-color-light);
}

body[data-theme="dark"] .btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

body[data-theme="dark"] .btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

/* 暗色模式主题变量 */
[data-theme="dark"] {
    --primary-color: #3a7b99;
    --primary-color-hover: #2c5c73;
    --primary-color-light: rgba(58, 123, 153, 0.1);
    --secondary-color: #94a3b8;
    --dark-color: #f1f5f9;
    --light-color: #1e293b;
    --bs-body-color: #e5e7eb;
    --bs-body-bg: #1f2937;
    --bs-card-bg: #2d3748;
    --bs-border-color: #4b5563;
}

/* 暗色主题样式 */
body[data-theme="dark"] {
    color: #e5e7eb;
    background-color: #1f2937;
}

body[data-theme="dark"] .bg-light {
    background-color: #2d3748 !important;
}

body[data-theme="dark"] .bg-white {
    background-color: #374151 !important;
}

body[data-theme="dark"] .text-dark {
    color: #e5e7eb !important;
}

body[data-theme="dark"] .border {
    border-color: #4b5563 !important;
}

body[data-theme="dark"] .navbar {
    background-color: #2d3748 !important;
}

body[data-theme="dark"] .navbar-light .navbar-nav .nav-link {
    color: #e5e7eb !important;
}

body[data-theme="dark"] .navbar-light .navbar-brand {
    color: #e5e7eb !important;
}

body[data-theme="dark"] .navbar-light .navbar-nav .nav-link.active {
    color: var(--primary-color) !important;
    background-color: rgba(58, 123, 153, 0.15);
}

body[data-theme="dark"] .navbar-light .navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
    background-color: rgba(58, 123, 153, 0.1);
}

body[data-theme="dark"] .navbar-light .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3E%3Cpath stroke='rgba(255, 255, 255, 0.8)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

body[data-theme="dark"] .card {
    background-color: #2d3748;
    border-color: #4b5563;
}

body[data-theme="dark"] .list-group-item {
    background-color: #2d3748;
    border-color: #4b5563;
    color: #e5e7eb;
}

body[data-theme="dark"] .form-control,
body[data-theme="dark"] .form-select {
    background-color: #374151;
    border-color: #4b5563;
    color: #e5e7eb;
}

/* 从admin布局中移动的暗色主题样式 */
body[data-theme="dark"] .sidebar {
    background-color: #2d3748;
}

body[data-theme="dark"] .table {
    color: #e5e7eb;
}

body[data-theme="dark"] .table-hover tbody tr:hover {
    color: #e5e7eb;
    background-color: rgba(255, 255, 255, 0.075);
}

body[data-theme="dark"] .input-group-text {
    background-color: #4b5563;
    border-color: #4b5563;
    color: #e5e7eb;
}

/* 其他通用样式 */
.theme-switch {
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 50px;
    transition: all 0.3s ease;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    background-color: transparent;
}

.theme-switch:hover {
    background-color: var(--primary-color-light);
}

body[data-theme="dark"] .theme-switch {
    color: #3a7b99 !important;
    border-color: #3a7b99 !important;
}

body[data-theme="dark"] .theme-switch:hover {
    background-color: rgba(58, 123, 153, 0.15) !important;
}

/* 主题下拉菜单样式 */
.theme-dropdown-menu {
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(58, 123, 153, 0.1);
    min-width: 120px;
}

.theme-item {
    color: #666;
    transition: all 0.2s ease;
    padding: 0.5rem 1rem;
}

.theme-item:hover {
    color: var(--primary-color);
    background-color: var(--primary-color-light);
}

/* 暗色模式下的主题切换 */
body[data-theme="dark"] .theme-item {
    color: #e5e7eb;
}

body[data-theme="dark"] .theme-item:hover {
    color: var(--primary-color);
    background-color: var(--primary-color-light);
}

.dropdown-menu {
    min-width: auto;
}

.navbar-brand {
    font-weight: 700;
}

@media (max-width: 768px) {
    .container { padding: 1rem; }
}

/* 主内容区域最小高度 */
.main-content {
    min-height: calc(100vh - 160px);
    padding-bottom: 2rem;
}

/* 文章封面图样式 */
.article-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-container {
    position: relative;
    width: 100%;
    padding-bottom: 50%; /* 强制2:1比例 */
    overflow: hidden;
}

/* 暗色模式适配 */
body[data-theme="dark"] .image-container {
    border-bottom: 1px solid #4b5563;
}

/* 卡片悬停效果 */
.hover-shadow {
    transition: all 0.3s ease;
}

.hover-shadow:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
}

/* 卡片内链接样式 */
.card-title a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: none;
}

.card-title a:hover {
    color: var(--primary-color-hover);
    text-decoration: none;
    border-bottom: none;
}

/* 广告容器样式 */
.ad-container {
    overflow: hidden;
    width: 100%;
    text-align: center;
    margin-bottom: 1rem;
}

.ad-container iframe {
    max-width: 100%;
    margin: 0 auto;
}

/* 暗色模式下的广告容器 */
body[data-theme="dark"] .ad-container {
    background-color: transparent;
}

/* 文章内容样式 */
.article-content {
    font-family: var(--font-family-base) !important;
    font-size: 16px !important;
    line-height: 1.8 !important;
    color: #2c3e50;
    text-align: justify;
    letter-spacing: 0.02em;
    word-spacing: 0.05em;
    padding-left: 2rem;
    padding-right: 2rem;
}

/* 确保内容中的所有元素都继承字体 */
.article-content * {
    font-family: inherit;
}

/* 特定元素恢复使用标题字体 */
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    font-family: var(--font-family-base) !important;
}

.article-content h1 {
    font-size: 2rem;
    font-weight: 600;
    color: #2c3e50;
}

.article-body {
    margin-top: 2rem;
}

.article-content p {
    margin-bottom: 1.2em;
    font-family: var(--font-family-base);
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    font-family: var(--font-family-base);
    font-weight: 600;
    margin-top: 1.5em;
    margin-bottom: 0.8em;
}

/* 标题中英文字重优化 */
.article-content h1:lang(en),
.article-content h2:lang(en),
.article-content h3:lang(en),
.article-content h4:lang(en),
.article-content h5:lang(en),
.article-content h6:lang(en) {
    font-weight: 500;
}

.article-content h1:lang(zh),
.article-content h2:lang(zh),
.article-content h3:lang(zh),
.article-content h4:lang(zh),
.article-content h5:lang(zh),
.article-content h6:lang(zh) {
    font-weight: 600;
}

.article-content h2 {
    font-size: 1.75rem;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding-bottom: 0.75rem;
    margin-top: 3rem;
}

.article-content h3 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
}

.article-content h4 {
    font-size: 1.25rem;
    margin-top: 2rem;
}

.article-content blockquote {
    font-family: var(--font-family-base);
    font-size: 1.1em;
    line-height: 1.8;
    border-left: 4px solid var(--primary-color);
    padding: 1rem 1.2rem;
    color: #555;
    background-color: rgba(0,0,0,0.02);
    margin: 1.75rem 0;
    border-radius: 0 4px 4px 0;
}

.article-content blockquote p {
    margin-bottom: 0;
}

.article-content code {
    font-family: var(--font-family-code);
    font-size: 0.9em;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    background-color: transparent;
    color: #d33682;
    border: 1px solid #e2e8f0;
}

.article-content pre {
    background-color: transparent;
    border-radius: 5px;
    padding: 1.2rem;
    margin: 1.75rem 0;
    overflow: auto;
    border: 1px solid #e2e8f0;
}

.article-content pre code {
    font-family: var(--font-family-code);
    font-size: 14px;
    line-height: 1.6;
    background-color: transparent;
    padding: 0;
    color: #333;
    border: none;
    -webkit-font-smoothing: auto;
}

.article-content ul, 
.article-content ol {
    padding-left: 2.2rem;
    margin-bottom: 1.75rem;
    font-size: 16px;
    line-height: 1.8;
}

.article-content li {
    margin-bottom: 0.8rem;
}

.article-content li p {
    margin-bottom: 0.8rem;
}

.article-content a:not(.article-title a) {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: none;
    transition: all 0.2s ease;
}

.article-content a:not(.article-title a):hover {
    color: var(--primary-color-hover);
    border-bottom-color: rgba(44, 92, 115, 0.6);
}

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

.article-content table,
.article-content table td,
.article-content table th {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    border: 1px solid #dee2e6;
    padding: 8px;
}

.article-content table {
    width: 100%;
    margin: 1.75rem 0;
    border-collapse: collapse;
    font-size: 16px;
    line-height: 1.6;
}

.article-content table th,
.article-content table td {
    border: 1px solid #e1e4e8;
    padding: 0.75rem 1rem;
    text-align: left;
    vertical-align: top;
}

/* 暗色模式文章样式调整 */
body[data-theme="dark"] .article-content {
    color: #e1e1e1;
}

body[data-theme="dark"] .article-content h1, 
body[data-theme="dark"] .article-content h2, 
body[data-theme="dark"] .article-content h3, 
body[data-theme="dark"] .article-content h4, 
body[data-theme="dark"] .article-content h5, 
body[data-theme="dark"] .article-content h6 {
    color: #e1e1e1;
}

body[data-theme="dark"] .article-content h2 {
    border-bottom-color: rgba(255,255,255,0.1);
}

body[data-theme="dark"] .article-content blockquote {
    color: #d1d5db;
    background-color: rgba(255,255,255,0.05);
}

body[data-theme="dark"] .article-content pre {
    background-color: #2d333b;
}

body[data-theme="dark"] .article-content code {
    background-color: rgba(255,255,255,0.1);
    color: #e5887a;
}

body[data-theme="dark"] .article-content pre code {
    color: #ddd;
}

body[data-theme="dark"] .article-content a:not(.article-title a) {
    color: #3a7b99;
    border-bottom-color: rgba(58, 123, 153, 0.2);
}

body[data-theme="dark"] .article-content a:not(.article-title a):hover {
    color: #2c5c73;
    border-bottom-color: rgba(44, 92, 115, 0.6);
}

body[data-theme="dark"] .article-content hr {
    border-top-color: rgba(255,255,255,0.1);
}

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

body[data-theme="dark"] .article-content table tr:nth-child(2n) {
    background-color: #2b2b2b;
}

/* 移动设备适配 */
@media (max-width: 768px) {
    .article-content {
        font-size: 16px;
        line-height: 1.8;
        letter-spacing: 0.01em;
    }
}

/* 黑暗模式下的下拉菜单 */
body[data-theme="dark"] .dropdown-menu {
    background-color: #2d3748;
    border-color: #4b5563;
}

body[data-theme="dark"] .dropdown-item {
    color: #e5e7eb;
}

body[data-theme="dark"] .dropdown-item:hover, 
body[data-theme="dark"] .dropdown-item:focus {
    background-color: #374151;
    color: #ffffff;
}

body[data-theme="dark"] .dropdown-divider {
    border-top-color: #4b5563;
}

/* 其他黑暗模式下的按钮样式 */
body[data-theme="dark"] .btn-outline-primary {
    color: #3a7b99 !important;
    border-color: #3a7b99 !important;
}

body[data-theme="dark"] .btn-outline-primary:hover {
    background-color: rgba(58, 123, 153, 0.1) !important;
    color: #3a7b99 !important;
    border-color: #3a7b99 !important;
}

body[data-theme="dark"] .btn-secondary {
    background-color: #4b5563;
    border-color: #4b5563;
    color: #e5e7eb;
}

body[data-theme="dark"] .card {
    background-color: #2d3748;
    border-color: #4b5563;
}

/* 基础字体应用 */
body {
    font-family: var(--font-family-base);
    font-size: var(--base-font-size);
    line-height: var(--line-height-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* 代码字体 */
pre, code, kbd, samp {
    font-family: var(--font-family-code);
}

/* 标题字体 */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-base);
    font-weight: 600;
    line-height: 1.4;
}

/* 处理SVG画布过大问题 */
.upyun-logo {
    fill: #3a7b99; /* 橙色填充 */
    stroke: #3a7b99;  /* 深灰色描边 */
    stroke-width: 1px;
    height: 25px;
    width: auto;
    object-fit: contain; /* 确保图像适合容器 */
    object-position: center; /* 居中显示 */
    max-width: 70px; /* 限制最大宽度 */
    transform: scale(1.0); /* 适中缩放 */
    transform-origin: center center; /* 从中心点放大 */
    margin: 0 2px; /* 减少左右边距 */
    vertical-align: middle;
    position: relative;
    top: 7px; /* 微调垂直位置 */
    display: inline-block; /* 确保图片作为内联块级元素 */
    padding-left: 0;
}

/* 网站logo样式 */
.site-logo {
    height: 30px;
    width: auto;
    object-fit: contain;
    margin-right: 8px;
    vertical-align: middle;
    display: inline-block;
}

/* 编辑器容器样式 */
.editor-container {
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.editor-content {
    width: 100%;
    font-family: var(--font-family-code);
    font-size: 0.95rem;
    line-height: 1.6;
    padding: 1rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    min-height: 400px;
    resize: vertical;
    background-color: #ffffff;
}

.editor-content:focus {
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(58, 123, 153, 0.25);
}

[data-theme="dark"] .editor-content {
    background-color: #292d32;
    color: #e9ecef;
    border-color: #495057;
}

/* 阅读数样式 */
.views-badge {
    font-size: 0.75rem;
    background-color: #f0f0f0;
    color: #666;
    border: 1px solid #e0e0e0;
    padding: 0.2rem 0.5rem;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

[data-theme="dark"] .views-badge {
    background-color: #303030;
    color: #aaa;
    border-color: #444;
}

/* 摘要字数统计样式 */
#excerptCount {
    transition: color 0.3s ease;
}

#excerptCount.text-warning {
    color: #ffc107 !important;
}

#excerptCount.text-danger {
    color: #dc3545 !important;
}

[data-theme="dark"] #excerptCount {
    color: #adb5bd;
}

[data-theme="dark"] #excerptCount.text-warning {
    color: #ffde59 !important;
}

[data-theme="dark"] #excerptCount.text-danger {
    color: #ff6b6b !important;
}

/* 文章编辑按钮组样式 */
.editor-toolbar {
    margin-bottom: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.editor-toolbar .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .editor-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .editor-toolbar .btn-group {
        margin-bottom: 0.5rem;
    }
}

/* 封面图片容器样式 */
.cover-image-container {
    position: relative;
    margin-bottom: 1rem;
    border-radius: 4px;
    overflow: hidden;
    max-width: 100%;
    max-height: 300px;
}

.cover-image-preview {
    max-width: 100%;
    max-height: 300px;
    border-radius: 4px;
    object-fit: contain;
    display: block;
}

.remove-image {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 24px;
    height: 24px;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.remove-image:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

/* 预览区域字体优化 */
.markdown-preview {
    font-family: var(--font-family-base);
    line-height: 1.8;
    color: #2c3e50;
}

/* 表单元素字体 */
input, select, textarea, button {
    font-family: var(--font-family-base);
}

/* 导航和菜单字体 */
.navbar, .sidebar {
    font-family: var(--font-family-base);
}

/* 中文特殊优化 */
:lang(zh), :lang(zh-CN) {
    text-align: justify;
    text-justify: inter-ideograph;
}

/* 标点符号优化 */
:lang(zh), :lang(zh-CN) {
    hanging-punctuation: first allow-end last;
}

/* 文章标题字重优化 */
.article-title:lang(en) {
    font-weight: 500;
}

.article-title:lang(zh) {
    font-weight: 600;
}

/* Markdown 表格样式增强 */
.article-content table,
.article-content .markdown-content table,
.markdown-content table {
    font-family: var(--font-family-base) !important;
    width: 100%;
    margin: 1.75rem 0;
    border-collapse: collapse;
    font-size: 16px;
    line-height: 1.6;
}

.article-content table th,
.article-content table td,
.article-content .markdown-content table th,
.article-content .markdown-content table td,
.markdown-content table th,
.markdown-content table td {
    border: 1px solid #e1e4e8;
    padding: 0.75rem 1rem;
    text-align: left;
    vertical-align: top;
    font-family: var(--font-family-base) !important;
}

.article-content table th,
.article-content .markdown-content table th,
.markdown-content table th {
    font-weight: 600;
    background-color: rgba(0,0,0,0.02);
    font-size: 1em;
}

.article-content table tr:nth-child(2n),
.article-content .markdown-content table tr:nth-child(2n),
.markdown-content table tr:nth-child(2n) {
    background-color: #f6f8fa;
}

/* 暗色模式表格样式 */
body[data-theme="dark"] .article-content table,
body[data-theme="dark"] .article-content .markdown-content table,
body[data-theme="dark"] .markdown-content table {
    color: #e5e7eb;
}

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

body[data-theme="dark"] .article-content table tr:nth-child(2n),
body[data-theme="dark"] .article-content .markdown-content table tr:nth-child(2n),
body[data-theme="dark"] .markdown-content table tr:nth-child(2n) {
    background-color: #2b2b2b;
}

/* 表格样式 - 被markdown-content.css覆盖，仅用于其他地方 */
/*
.article-content table,
.markdown-content table,
.markdown-table {
    font-family: var(--font-family-article) !important;
    width: 100%;
    margin-bottom: 1rem;
    border-collapse: collapse;
}

.article-content table th,
.markdown-content table th,
.markdown-table th {
    font-family: var(--font-family-article) !important;
    font-weight: 600;
    font-size: 1em;
}

.article-content table td,
.markdown-content table td,
.markdown-table td {
    font-family: var(--font-family-article) !important;
}
*/

/* 确保代码块使用正确字体 - 被markdown-content.css覆盖，保留其他地方使用 */
/*
.article-content code,
.article-content pre code {
    font-family: var(--font-family-code) !important;
}

code, pre, .code, 
.article-content code, 
.markdown-content code {
    font-family: var(--font-family-code) !important;
}
*/

/* 响应式侧边栏调整 */
@media (max-width: 991.98px) {
    .sidebar {
        position: static;
        margin-top: 2rem;
    }
}

/* 确保编辑器在卡片内正确显示 */
.card-body {
    min-height: auto;
    height: auto;
    position: relative;
}

.card {
    height: auto;
    min-height: auto;
    display: flex;
    flex-direction: column;
}

/* 确保表单容器不限制高度 */
.form-control {
    height: auto;
    min-height: unset;
}

textarea.form-control {
    height: auto;
    min-height: unset;
}

/* 分类链接样式优化 */
.fas.fa-folder + a,
.fas.fa-tag + a,
.fas.fa-folder-open + a,
a[href^="/category/"],
a.category-link {
    color: #6c757d !important;
    text-decoration: none;
    transition: all 0.2s ease;
}

.fas.fa-folder + a:hover,
.fas.fa-tag + a:hover,
.fas.fa-folder-open + a:hover,
a[href^="/category/"]:hover,
a.category-link:hover {
    color: var(--primary-color) !important;
}

[data-theme="dark"] .fas.fa-folder + a,
[data-theme="dark"] .fas.fa-tag + a,
[data-theme="dark"] .fas.fa-folder-open + a,
[data-theme="dark"] a[href^="/category/"],
[data-theme="dark"] a.category-link {
    color: #adb5bd !important;
}

[data-theme="dark"] .fas.fa-folder + a:hover,
[data-theme="dark"] .fas.fa-tag + a:hover,
[data-theme="dark"] .fas.fa-folder-open + a:hover,
[data-theme="dark"] a[href^="/category/"]:hover,
[data-theme="dark"] a.category-link:hover {
    color: var(--primary-color) !important;
}

/* 前端分类标签样式优化 */
.category-tag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
    background-color: #f0f0f0;
    color: #666;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
    text-decoration: none;
}

.category-tag:hover {
    background-color: #e9e9e9;
    color: #444;
    text-decoration: none;
}

[data-theme="dark"] .category-tag {
    background-color: #343a40;
    color: #e1e1e1;
    border-color: #495057;
}

[data-theme="dark"] .category-tag:hover {
    background-color: #2b3035;
    color: #fff;
}

/* 侧边栏样式 */
.sidebar {
    position: sticky;
    top: 2rem;
}

.sidebar .card-header {
    border-bottom: 2px solid var(--primary-color);
}

.sidebar .list-group-item {
    border-left: none;
    border-right: none;
}

.sidebar .list-group-item:first-child {
    border-top: none;
}

.sidebar .list-group-item:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.sidebar .list-group-item a {
    color: #6c757d !important;
    text-decoration: none;
    transition: all 0.2s ease;
}

.sidebar .list-group-item a:hover {
    color: var(--primary-color) !important;
}

.sidebar-ad img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

[data-theme="dark"] .sidebar .card-header {
    background-color: #2c3034 !important;
    border-bottom-color: #495057;
}

[data-theme="dark"] .sidebar .list-group-item {
    background-color: #212529;
    border-color: #495057;
}

[data-theme="dark"] .sidebar .list-group-item:hover {
    background-color: #2c3034;
}

[data-theme="dark"] .sidebar .badge {
    background-color: #495057 !important;
    color: #e9ecef !important;
}

[data-theme="dark"] .sidebar .list-group-item a {
    color: #adb5bd !important;
}

[data-theme="dark"] .sidebar .list-group-item a:hover {
    color: var(--primary-color) !important;
}

/* 响应式侧边栏调整 */
@media (max-width: 991.98px) {
    .sidebar {
        position: static;
        margin-top: 2rem;
    }
}

/* 确保代码块使用正确字体 */
.article-content code,
.article-content pre code {
    font-family: var(--font-family-code) !important;
}

/* 正文内行内代码样式强制指定 */
code, pre, .code, 
.article-content code, 
.markdown-content code {
    font-family: var(--font-family-code) !important;
}

/* 确保深色模式下的表格样式 */
[data-theme="dark"] .article-content table,
[data-theme="dark"] .markdown-content table,
[data-theme="dark"] .markdown-table {
    color: #e5e7eb;
} 
body[data-theme="dark"] .btn-learn-more,
body[data-theme="dark"] .btn-view-all-articles,
body[data-theme="dark"] .btn-theme {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

body[data-theme="dark"] .btn-learn-more:hover,
body[data-theme="dark"] .btn-view-all-articles:hover,
body[data-theme="dark"] .btn-theme:hover {
    color: var(--primary-color-hover);
    border-color: var(--primary-color-hover);
}

/* 页脚样式更新 */
footer {
    background: transparent !important;
    border: none !important;
}

footer .container {
    border-top: none;
    padding-top: 1rem;
}

[data-theme="dark"] footer .container {
    border-top-color: transparent;
}

footer a:hover {
    color: var(--primary-color) !important;
    text-decoration: none !important;
}

footer .text-muted {
    opacity: 0.8;
}

footer .text-muted:hover {
    opacity: 1;
}

/* 确保编辑器在卡片内正确显示 */
.card-body {
    min-height: auto;
    height: auto;
    position: relative;
}

.card {
    height: auto;
    min-height: auto;
    display: flex;
    flex-direction: column;
}

/* 确保表单容器不限制高度 */
.form-control {
    height: auto;
    min-height: unset;
}

textarea.form-control {
    height: auto;
    min-height: unset;
}

/* 分类链接样式优化 */
.fas.fa-folder + a,
.fas.fa-tag + a,
.fas.fa-folder-open + a,
a[href^="/category/"],
a.category-link {
    color: #6c757d !important;
    text-decoration: none;
    transition: all 0.2s ease;
}

.fas.fa-folder + a:hover,
.fas.fa-tag + a:hover,
.fas.fa-folder-open + a:hover,
a[href^="/category/"]:hover,
a.category-link:hover {
    color: var(--primary-color) !important;
}

[data-theme="dark"] .fas.fa-folder + a,
[data-theme="dark"] .fas.fa-tag + a,
[data-theme="dark"] .fas.fa-folder-open + a,
[data-theme="dark"] a[href^="/category/"],
[data-theme="dark"] a.category-link {
    color: #adb5bd !important;
}

[data-theme="dark"] .fas.fa-folder + a:hover,
[data-theme="dark"] .fas.fa-tag + a:hover,
[data-theme="dark"] .fas.fa-folder-open + a:hover,
[data-theme="dark"] a[href^="/category/"]:hover,
[data-theme="dark"] a.category-link:hover {
    color: var(--primary-color) !important;
}

/* 前端分类标签样式优化 */
.category-tag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
    background-color: #f0f0f0;
    color: #666;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
    text-decoration: none;
}

.category-tag:hover {
    background-color: #e9e9e9;
    color: #444;
    text-decoration: none;
}

[data-theme="dark"] .category-tag {
    background-color: #343a40;
    color: #e1e1e1;
    border-color: #495057;
}

[data-theme="dark"] .category-tag:hover {
    background-color: #2b3035;
    color: #fff;
}

/* 侧边栏样式 */
.sidebar {
    position: sticky;
    top: 2rem;
}

.sidebar .card-header {
    border-bottom: 2px solid var(--primary-color);
}

.sidebar .list-group-item {
    border-left: none;
    border-right: none;
}

.sidebar .list-group-item:first-child {
    border-top: none;
}

.sidebar .list-group-item:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.sidebar .list-group-item a {
    color: #6c757d !important;
    text-decoration: none;
    transition: all 0.2s ease;
}

.sidebar .list-group-item a:hover {
    color: var(--primary-color) !important;
}

.sidebar-ad img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

[data-theme="dark"] .sidebar .card-header {
    background-color: #2c3034 !important;
    border-bottom-color: #495057;
}

[data-theme="dark"] .sidebar .list-group-item {
    background-color: #212529;
    border-color: #495057;
}

[data-theme="dark"] .sidebar .list-group-item:hover {
    background-color: #2c3034;
}

[data-theme="dark"] .sidebar .badge {
    background-color: #495057 !important;
    color: #e9ecef !important;
}

[data-theme="dark"] .sidebar .list-group-item a {
    color: #adb5bd !important;
}

[data-theme="dark"] .sidebar .list-group-item a:hover {
    color: var(--primary-color) !important;
}

/* 响应式侧边栏调整 */
@media (max-width: 991.98px) {
    .sidebar {
        position: static;
        margin-top: 2rem;
    }
}

/* 文章标题样式 */
.article-title, 
.card-body h1 {
    padding-left: 2rem;
    padding-right: 2rem;
}

/* 文章元信息样式 */
.article-meta {
    padding-left: 2rem;
    padding-right: 2rem;
}

/* 确保文章标题链接不受上面样式影响 */
.article-title a,
.card-title a {
    border-bottom: none !important;
    text-decoration: none !important;
}

.article-title a:hover,
.card-title a:hover {
    border-bottom: none !important;
    text-decoration: none !important;
}

/* Markdown 样式适配深色模式 */
[data-theme="dark"] .markdown-body {
    color-scheme: dark;
    --color-prettylights-syntax-comment: #8b949e;
    --color-prettylights-syntax-constant: #79c0ff;
    --color-prettylights-syntax-entity: #d2a8ff;
    --color-prettylights-syntax-storage-modifier-import: #c9d1d9;
    --color-prettylights-syntax-entity-tag: #7ee787;
    --color-prettylights-syntax-keyword: #ff7b72;
    --color-prettylights-syntax-string: #a5d6ff;
    --color-prettylights-syntax-variable: #ffa657;
    --color-prettylights-syntax-brackethighlighter-unmatched: #f85149;
    --color-prettylights-syntax-invalid-illegal-text: #f0f6fc;
    --color-prettylights-syntax-invalid-illegal-bg: #8e1519;
    --color-prettylights-syntax-carriage-return-text: #f0f6fc;
    --color-prettylights-syntax-carriage-return-bg: #b62324;
    --color-prettylights-syntax-string-regexp: #7ee787;
    --color-prettylights-syntax-markup-list: #f2cc60;
    --color-prettylights-syntax-markup-heading: #1f6feb;
    --color-prettylights-syntax-markup-italic: #c9d1d9;
    --color-prettylights-syntax-markup-bold: #c9d1d9;
    --color-prettylights-syntax-markup-deleted-text: #ffdcd7;
    --color-prettylights-syntax-markup-deleted-bg: #67060c;
    --color-prettylights-syntax-markup-inserted-text: #aff5b4;
    --color-prettylights-syntax-markup-inserted-bg: #033a16;
    --color-prettylights-syntax-markup-changed-text: #ffdfb6;
    --color-prettylights-syntax-markup-changed-bg: #5a1e02;
    --color-prettylights-syntax-markup-ignored-text: #c9d1d9;
    --color-prettylights-syntax-markup-ignored-bg: #1158c7;
    --color-prettylights-syntax-meta-diff-range: #d2a8ff;
    --color-prettylights-syntax-brackethighlighter-angle: #8b949e;
    --color-prettylights-syntax-sublimelinter-gutter-mark: #484f58;
    --color-prettylights-syntax-constant-other-reference-link: #a5d6ff;
    --color-fg-default: #c9d1d9;
    --color-fg-muted: #8b949e;
    --color-fg-subtle: #6e7681;
    --color-canvas-default: #0d1117;
    --color-canvas-subtle: #161b22;
    --color-border-default: #30363d;
    --color-border-muted: #21262d;
    --color-neutral-muted: rgba(110,118,129,0.4);
    --color-accent-fg: #58a6ff;
    --color-accent-emphasis: #1f6feb;
    --color-attention-subtle: rgba(187,128,9,0.15);
    --color-danger-fg: #f85149;
    background-color: var(--color-canvas-default);
    color: var(--color-fg-default);
}

[data-theme="dark"] .markdown-body a {
    color: var(--color-accent-fg);
}

[data-theme="dark"] .markdown-body hr {
    border-bottom: 1px solid var(--color-border-muted);
    border-bottom-color: var(--color-border-default);
}

[data-theme="dark"] .markdown-body kbd {
    background-color: var(--color-canvas-subtle);
    border: 1px solid var(--color-border-muted);
    color: var(--color-fg-default);
}

[data-theme="dark"] .markdown-body table tr {
    background-color: var(--color-canvas-default);
    border-top: 1px solid var(--color-border-muted);
}

[data-theme="dark"] .markdown-body table tr:nth-child(2n) {
    background-color: var(--color-canvas-subtle);
}

[data-theme="dark"] .markdown-body table td,
[data-theme="dark"] .markdown-body table th {
    border: 1px solid var(--color-border-default);
}

[data-theme="dark"] .markdown-body blockquote {
    border-left: 0.25em solid var(--color-border-default);
    color: var(--color-fg-muted);
}

[data-theme="dark"] .markdown-body code {
    background-color: var(--color-canvas-subtle);
    color: var(--color-fg-default);
}

[data-theme="dark"] .markdown-body pre {
    background-color: var(--color-canvas-subtle);
    border-radius: 6px;
}

[data-theme="dark"] .markdown-body pre code {
    background-color: transparent;
    color: var(--color-fg-default);
}

/* 调整图片在深色模式下的显示 */
[data-theme="dark"] .markdown-body img {
    background-color: var(--color-canvas-default);
    border-radius: 4px;
}

/* 调整列表样式 */
[data-theme="dark"] .markdown-body ul,
[data-theme="dark"] .markdown-body ol {
    color: var(--color-fg-default);
}

/* 调整标题样式 */
[data-theme="dark"] .markdown-body h1,
[data-theme="dark"] .markdown-body h2,
[data-theme="dark"] .markdown-body h3,
[data-theme="dark"] .markdown-body h4,
[data-theme="dark"] .markdown-body h5,
[data-theme="dark"] .markdown-body h6 {
    color: var(--color-fg-default);
    border-bottom-color: var(--color-border-muted);
}

/* 调整分割线样式 */
[data-theme="dark"] .markdown-body hr {
    background-color: var(--color-border-muted);
}

/* 调整行内代码样式 */
[data-theme="dark"] .markdown-body code {
    background-color: rgba(110,118,129,0.4);
    border-radius: 3px;
    padding: 0.2em 0.4em;
}

/* 友情链接样式 */
.sidebar .useful-links-item {
    transition: all 0.2s ease;
    border: 1px solid var(--primary-color);
    background-color: transparent;
    color: var(--primary-color);
    border-radius: 4px;
}

.sidebar .useful-links-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    background-color: var(--primary-color);
    color: #ffffff;
}

[data-theme="dark"] .sidebar .useful-links-item {
    background-color: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

[data-theme="dark"] .sidebar .useful-links-item:hover {
    background-color: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* 修复侧边栏卡片圆角问题 */
.sidebar .card {
    overflow: hidden;
    border-radius: 0.5rem;
}

.sidebar .card-body {
    padding: 1rem;
}

.sidebar .card-body.p-0 {
    padding: 0 !important;
}

.sidebar .list-group {
    border-radius: 0;
}

.sidebar .list-group-item:last-child {
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

/* 确保深色模式下同样有圆角 */
[data-theme="dark"] .sidebar .card {
    overflow: hidden;
    border-radius: 0.5rem;
}

[data-theme="dark"] .sidebar .list-group-item:last-child {
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}