/* 自定义样式 */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

/* 基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
}

/* 导航栏 */
.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: rgba(255, 255, 255, 0.9);
}

/* 文章卡片 */
.card {
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 0.5rem;
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.card-title a {
    color: var(--dark-color);
    transition: color 0.15s ease-in-out;
}

.card-title a:hover {
    color: var(--primary-color);
}

/* 文章内容 */
.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.post-content h1, 
.post-content h2, 
.post-content h3, 
.post-content h4, 
.post-content h5, 
.post-content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.post-content p {
    margin-bottom: 1.5rem;
}

.post-content blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid var(--primary-color);
    background-color: var(--light-color);
    border-radius: 0.25rem;
}

.post-content ul, 
.post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

/* 代码样式 */
.post-content code {
    background-color: var(--light-color);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
}

.post-content pre {
    background-color: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 0.5rem !important;
    padding: 1rem !important;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.post-content pre code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    font-size: 0.875rem;
}

/* 图片样式 */
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 表格样式 */
.post-content table {
    margin-bottom: 1.5rem;
}

.post-content table th {
    background-color: var(--light-color);
    border-color: #dee2e6;
    font-weight: 600;
}

/* 标签和分类 */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.35rem 0.65rem;
}

.badge a {
    color: inherit;
}

.badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 按钮样式 */
.btn {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.15s ease-in-out;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 分页 */
.pagination .page-link {
    color: var(--primary-color);
    border-color: #dee2e6;
    padding: 0.5rem 0.75rem;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination .page-link:hover {
    color: var(--primary-color);
    background-color: var(--light-color);
    border-color: #dee2e6;
}

/* 侧边栏 */
.card-header {
    background-color: var(--light-color);
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    font-weight: 600;
}

/* 面包屑 */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 1rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: var(--secondary-color);
}

/* 错误页面 */
.error-page {
    padding: 2rem 0;
}

.error-page h1 {
    font-weight: 700;
    font-size: 8rem;
    opacity: 0.8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .display-1 {
        font-size: 3rem;
    }
    
    .display-5 {
        font-size: 2rem;
    }
    
    .display-6 {
        font-size: 1.5rem;
    }
    
    .post-content {
        font-size: 1rem;
    }
    
    .error-page h1 {
        font-size: 5rem;
    }
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 加载动画 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* 高亮搜索结果 */
mark {
    background-color: #fff3cd;
    padding: 0.1rem 0.2rem;
    border-radius: 0.2rem;
}

/* 页脚 */
footer {
    margin-top: auto;
}

/* 确保页面最小高度 */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    flex: 1;
}

/* 返回顶部按钮 */
.btn-back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: none;
    justify-content: center;
    align-items: center;
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 打印样式 */
@media print {
    .navbar, .card-header, .btn, .pagination, footer {
        display: none !important;
    }
    
    .card {
        border: none;
        box-shadow: none;
    }
    
    .post-content {
        font-size: 12pt;
        line-height: 1.5;
    }
}
