/* 博客前台样式 */

/* 全局样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 导航栏 */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.nav-link {
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: #007bff !important;
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: 8px;
    overflow: hidden;
}

.hover-card {
    transition: all 0.3s ease;
}

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

/* 标签云 */
.tag-cloud .badge {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border-radius: 1rem;
    transition: all 0.3s ease;
}

.tag-cloud .badge:hover {
    background-color: #007bff;
    color: white !important;
}

/* 文章内容 */
.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.card-title a {
    transition: color 0.3s ease;
}

.card-title a:hover {
    color: #007bff;
    text-decoration: none;
}

.card-text {
    font-size: 1rem;
    color: #666;
    line-height: 1.7;
}

/* 代码块 */
pre {
    margin: 0;
    overflow-x: auto;
    padding: 1rem;
    border-radius: 4px;
}

code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875rem;
}

/* 分页 */
.pagination {
    margin-top: 2rem;
}

.page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
}

.page-link {
    color: #007bff;
    transition: all 0.3s ease;
}

.page-link:hover {
    color: #0056b3;
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

/* 页脚 */
footer {
    background-color: #343a40;
    color: white;
}

footer a {
    transition: color 0.3s ease;
}

footer a:hover {
    color: #007bff;
    text-decoration: none;
}

/* 头像 */
.avatar img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* 按钮样式 */
.btn {
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0069d9;
    border-color: #0062cc;
}

.btn-outline-primary {
    color: #007bff;
    border-color: #007bff;
}

.btn-outline-primary:hover {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .card-title {
        font-size: 1.25rem;
    }
    
    .col-lg-4 {
        margin-top: 2rem;
    }
}

/* 加载动画 */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.loading .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* 错误提示 */
.error {
    border-radius: 8px;
}

/* 视频容器 */
.ratio {
    border-radius: 8px;
    overflow: hidden;
}

/* 图片样式 */
.img-fluid {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 徽章样式 */
.badge {
    font-weight: 500;
    border-radius: 0.375rem;
}

/* 搜索框 */
.form-control {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

/* 社交图标 */
.fab {
    transition: all 0.3s ease;
}

.fab:hover {
    transform: translateY(-3px);
    color: #007bff;
}

/* 时间线 */
.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background-color: #e9ecef;
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    padding: 20px;
    width: 50%;
}

.timeline-item:nth-child(odd) {
    left: 0;
    padding-right: 40px;
}

.timeline-item:nth-child(even) {
    left: 50%;
    padding-left: 40px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    top: 25px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #007bff;
    border: 3px solid white;
    box-shadow: 0 0 0 2px #007bff;
}

.timeline-item:nth-child(odd)::before {
    right: -8px;
}

.timeline-item:nth-child(even)::before {
    left: -8px;
}

@media (max-width: 768px) {
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item {
        width: 100%;
        left: 0 !important;
        padding-left: 60px !important;
        padding-right: 0 !important;
    }
    
    .timeline-item::before {
        left: 12px !important;
        right: auto !important;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}