/* 全局样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

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

/* 主要内容区域 */
.main-content {
    min-height: calc(100vh - 200px);
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: 10px;
    transition: all 0.3s ease;
}

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

/* 文章卡片特殊样式 */
.post-card {
    overflow: hidden;
}

.post-card .card-img-top {
    transition: transform 0.3s ease;
    height: 200px;
    object-fit: cover;
}

.post-card:hover .card-img-top {
    transform: scale(1.05);
}

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

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,.2);
}

/* 徽章样式 */
.badge {
    border-radius: 15px;
    padding: 5px 10px;
    font-weight: 500;
}

/* 搜索框样式 */
.search-form {
    position: relative;
}

.search-form .form-control {
    border-radius: 25px;
    padding-right: 50px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

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

.search-form .btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%;
    width: 35px;
    height: 35px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 侧边栏样式 */
.sidebar .card {
    margin-bottom: 1.5rem;
}

.sidebar .card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px 10px 0 0;
    font-weight: 600;
}

.sidebar .list-group-item {
    border: none;
    padding: 10px 15px;
    transition: all 0.3s ease;
}

.sidebar .list-group-item:hover {
    background-color: #f8f9fa;
    padding-left: 20px;
}

/* 分页样式 */
.pagination .page-link {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 2px;
    border: 2px solid #dee2e6;
    color: #6c757d;
    transition: all 0.3s ease;
}

.pagination .page-link:hover {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
    transform: scale(1.1);
}

.pagination .page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
    transform: scale(1.1);
}

/* 评论样式 */
.comment {
    transition: all 0.3s ease;
}

.comment:hover {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin: -5px;
}

.comment .reply {
    border-left: 3px solid #007bff;
    background-color: #f8f9fa;
    border-radius: 0 10px 10px 0;
}

/* 表单样式 */
.form-control {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    padding: 12px 15px;
    transition: all 0.3s ease;
}

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

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

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

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

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

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,.1);
    margin: 1rem 0;
}

.post-content blockquote {
    border-left: 4px solid #007bff;
    background-color: #f8f9fa;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 10px 10px 0;
    font-style: italic;
}

.post-content code {
    background-color: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #e83e8c;
}

.post-content pre {
    background-color: #2d3748;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 10px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-content pre code {
    background: none;
    color: inherit;
    padding: 0;
}

/* 页脚样式 */
footer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-top: 3rem;
}

footer a {
    color: #e9ecef;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: white;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .post-content {
        font-size: 1rem;
    }
    
    .btn {
        padding: 6px 15px;
        font-size: 0.9rem;
    }
    
    .pagination .page-link {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 10px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .post-content {
        font-size: 0.95rem;
        line-height: 1.6;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

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

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

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

/* 特殊效果 */
.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-custom {
    box-shadow: 0 10px 30px rgba(0,0,0,.1);
}

.border-gradient {
    border: 2px solid;
    border-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%) 1;
}

/* 消息提示样式 */
.alert {
    border: none;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,.1);
}

.alert-dismissible .btn-close {
    padding: 0.75rem 1rem;
}

/* 标签云样式 */
.tag-cloud {
    line-height: 2.5;
}

.tag-cloud a {
    display: inline-block;
    margin: 0.2rem;
    padding: 0.3rem 0.8rem;
    background-color: #f8f9fa;
    color: #6c757d;
    text-decoration: none;
    border-radius: 15px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tag-cloud a:hover {
    background-color: #007bff;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,123,255,.3);
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0,0,0,.2);
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,.3);
}

.back-to-top.show {
    display: flex;
}