/* 博客自定义样式 */

/* 全局样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8fafc;
    color: #0f172a;
    text-rendering: optimizeLegibility;
}

a {
    text-decoration: none;
}

/* 导航栏样式 */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

/* 轮播图样式 */
.carousel-img {
    position: relative;
}

.carousel-img::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.carousel-caption {
    z-index: 2;
}

/* 文章卡片样式 */
.blog-card-hover {
    transition: all 0.3s ease;
}

.blog-card-hover:hover {
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

/* 章节标题样式 */
.section-title {
    position: relative;
    padding-bottom: 10px;
}

/* 侧边栏卡片 */
.card {
    border: 1px solid #e2e8f0;
    box-shadow: none;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

/* 标签云样式 */
.tag-cloud-item {
    color: #6c757d;
    padding: 5px 10px;
    background-color: #f8f9fa;
    border-radius: 15px;
    transition: all 0.3s ease;
}

.tag-cloud-item:hover {
    background-color: #2563eb;
    color: white;
}

/* 分页样式 */
.pagination .page-link {
    color: #2563eb;
}

.pagination .page-item.active .page-link {
    background-color: #2563eb;
    border-color: #2563eb;
}

/* 页脚样式 */
footer {
    margin-top: 80px;
}

/* 返回顶部按钮 */
#back-to-top {
    z-index: 1000;
    transition: all 0.3s ease;
}

#back-to-top:hover {
    transform: translateY(-5px);
}

/* 文章列表动画 */
.card {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 搜索框样式 */
.form-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .carousel-img {
        height: 250px !important;
    }

    .carousel-caption h2 {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 1.25rem;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #2563eb;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 文章元信息样式 */
.article-meta {
    color: #6c757d;
    font-size: 0.9rem;
}

.article-meta a {
    color: inherit;
    text-decoration: none;
}

.article-meta a:hover {
    color: #2563eb;
}

/* 代码块样式 */
pre {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
}

code {
    background-color: #f8f9fa;
    padding: 2px 5px;
    border-radius: 3px;
}

pre code {
    background-color: transparent;
    padding: 0;
}

/* 引用样式 */
blockquote {
    border-left: 4px solid #2563eb;
    padding-left: 20px;
    margin: 20px 0;
    color: #6c757d;
}

/* 图片样式 */
img {
    max-width: 100%;
    height: auto;
}

/* 表格样式 */
.table {
    margin-bottom: 20px;
}

.table th,
.table td {
    padding: 12px;
    vertical-align: top;
    border-top: 1px solid #dee2e6;
}

/* 锚点链接平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 文章阅读进度条 */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background-color: #2563eb;
    z-index: 1000;
    transition: width 0.2s ease;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.blog-hero {
    background:
        linear-gradient(180deg, rgba(248, 250, 252, 0.7), rgba(255, 255, 255, 1)),
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 34rem);
}

.blog-feature-card,
.blog-side-panel {
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.blog-side-panel {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.blog-side-panel:hover {
    border-color: #cbd5e1;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}
