/* BootStrap 自定义样式 */
:root {
    --bs-primary: #0066cc;
    --bs-primary-rgb: 0, 102, 204;
    --bs-font-sans-serif: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
    --bs-body-font-family: var(--bs-font-sans-serif);
}

body {
    font-family: var(--bs-body-font-family);
    font-size: 16px;
    line-height: 1.8;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* 导航栏样式 */
.navbar {
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95) !important;
}

.navbar-brand {
    font-weight: 600;
}

/* 文章卡片样式 */
.post.card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.post.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15) !important;
}

.post-title a {
    color: #333;
    transition: color 0.2s ease-in-out;
}

.post-title a:hover {
    color: var(--bs-primary);
}

.post-meta {
    font-size: 0.875rem;
}

/* 侧边栏样式 */
.card {
    border: none;
    border-radius: 0.5rem;
}

.widget ul li a {
    color: #666;
    transition: all 0.2s ease-in-out;
}

.widget ul li a:hover {
    color: var(--bs-primary);
    text-decoration: none;
    padding-left: 0.5rem;
}

/* 评论区样式 */
.comment-list {
    padding-left: 0;
}

.comment-author {
    font-weight: 600;
}

.comment-content {
    margin: 1rem 0;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
}

.respond .form-control:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

/* 分页样式 */
.pagination {
    margin: 2rem 0;
}

.page-link {
    border: none;
    margin: 0 0.2rem;
    border-radius: 0.25rem;
    padding: 0.5rem 1rem;
    color: var(--bs-primary);
}

.page-link:hover {
    background-color: var(--bs-primary);
    color: #fff;
}

.page-item.active .page-link {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

/* 页头横幅 */
.header-banner {
    background: linear-gradient(135deg, var(--bs-primary) 0%, #0099ff 100%);
}

/* 标签云 */
.badge {
    transition: all 0.2s ease-in-out;
}

.badge:hover {
    transform: translateY(-2px);
}

/* 文章内容样式 */
.post-content {
    line-height: 1.8;
    font-size: 1.1rem;
}

.post-content p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    margin: 2rem 0 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.post-content h1 { font-size: 2rem; }
.post-content h2 { font-size: 1.75rem; }
.post-content h3 { font-size: 1.5rem; }
.post-content h4 { font-size: 1.25rem; }
.post-content h5 { font-size: 1.1rem; }
.post-content h6 { font-size: 1rem; }

.post-content img {
    max-width: 100%;
    height: auto;
    margin: 1.5rem auto;
    border-radius: 0.5rem;
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.1);
    display: block;
}

.post-content blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid var(--bs-primary);
    background-color: rgba(var(--bs-primary-rgb), 0.05);
    border-radius: 0 0.5rem 0.5rem 0;
}

.post-content blockquote p:last-child {
    margin-bottom: 0;
}

.post-content pre {
    margin: 1.5rem 0;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    overflow-x: auto;
    font-size: 0.9rem;
}

.post-content code {
    background-color: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
    color: #d63384;
}

.post-content pre code {
    padding: 0;
    color: inherit;
    background-color: transparent;
}

.post-content ul,
.post-content ol {
    margin: 1rem 0 1.5rem;
    padding-left: 1.5rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

.post-content table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: collapse;
}

.post-content table th,
.post-content table td {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
}

.post-content table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.post-content hr {
    margin: 2rem 0;
    border-top: 2px solid #dee2e6;
}

/* 文章导航 */
.post-navigation {
    background-color: #fff;
}

.post-navigation a {
    color: var(--bs-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-navigation a:hover {
    color: #004c99;
}

/* 文章页面响应式优化 */
@media (max-width: 768px) {
    .post-content {
        font-size: 1rem;
    }

    .post-content h1 { font-size: 1.75rem; }
    .post-content h2 { font-size: 1.5rem; }
    .post-content h3 { font-size: 1.25rem; }
    .post-content h4 { font-size: 1.1rem; }
    .post-content h5 { font-size: 1rem; }
    .post-content h6 { font-size: 0.9rem; }

    .post-content blockquote {
        padding: 0.75rem 1rem;
    }
    
    .post-meta .list-inline-item {
        display: block;
        margin-bottom: 0.5rem;
    }
}

/* 文章标签 */
.post-tags .badge {
    margin: 0.25rem;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    transition: all 0.2s ease;
}

.post-tags .badge:hover {
    background-color: var(--bs-primary) !important;
    color: #fff !important;
    transform: translateY(-2px);
}

/* 修复内容区域的图片和iframe */
.post-content img,
.post-content iframe {
    max-width: 100%;
    margin: 1rem auto;
}

/* 代码高亮 */
.post-content pre code {
    display: block;
    overflow-x: auto;
    padding: 1rem;
    background: #f8f9fa;
    color: #333;
    font-size: 0.9rem;
    line-height: 1.5;
}
