/* 全局样式 */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f8f9fa;
}

/* 导航栏样式 */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

/* 卡片样式 */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,.075);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 1.5rem;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,.15);
}

.card-title a {
    color: var(--dark-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.card-title a:hover {
    color: var(--primary-color);
}

/* 文章内容样式 */
.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.375rem;
    margin: 1rem 0;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.post-content p {
    margin-bottom: 1rem;
}

.post-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin-left: 0;
    font-style: italic;
    color: var(--secondary-color);
}

.post-content code {
    background-color: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.post-content pre {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.375rem;
    overflow-x: auto;
}

/* 侧边栏样式 */
.blog-sidebar {
    top: 2rem;
}

.sidebar-sticky {
    position: sticky;
    top: 2rem;
}

.sidebar .card {
    margin-bottom: 1.5rem;
}

.sidebar .list-unstyled li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #dee2e6;
}

.sidebar .list-unstyled li:last-child {
    border-bottom: none;
}

/* 分页样式 */
.pagination .page-link {
    color: var(--primary-color);
    border: 1px solid #dee2e6;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination .page-link:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
}

/* 标签样式 */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

.badge-secondary {
    background-color: var(--secondary-color);
}

/* 评论样式 */
.comment {
    border-left: 3px solid var(--primary-color);
    padding-left: 1rem;
    margin-bottom: 1rem;
}

.comment-reply {
    margin-left: 2rem;
    border-left-color: var(--secondary-color);
}

.comment-author {
    font-weight: 600;
    color: var(--dark-color);
}

.comment-date {
    font-size: 0.875rem;
    color: var(--secondary-color);
}

.comment-content {
    margin-top: 0.5rem;
}

/* 表单样式 */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

/* 页脚样式 */
.footer {
    background-color: var(--dark-color);
    color: var(--light-color);
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer a {
    color: var(--light-color);
    text-decoration: none;
}

.footer a:hover {
    color: var(--primary-color);
}

.footer .social-links a {
    font-size: 1.5rem;
    margin-right: 1rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .post-content {
        font-size: 1rem;
    }
    
    .comment-reply {
        margin-left: 1rem;
    }
    
    .footer .row > div {
        margin-bottom: 1.5rem;
    }
}

/* 打印样式 */
@media print {
    .navbar, .sidebar, .footer, .comment-form {
        display: none;
    }
    
    .container {
        max-width: 100%;
    }
    
    .post-content {
        font-size: 12pt;
        line-height: 1.5;
    }
}
