/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS变量定义 */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    --text-color: #212529;
    --border-color: #dee2e6;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* 全局样式 */
body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f5f7fa;
}

/* 导航栏样式 */
#mainNav {
    background-color: white;
    padding: 1rem 0;
    transition: var(--transition);
}

#mainNav.scrolled {
    padding: 0.5rem 0;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: var(--box-shadow);
}

.navbar-brand {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary-color);
    transition: var(--transition);
}

.navbar-brand:hover {
    color: var(--dark-color);
}

.nav-link {
    font-size: 1rem;
    font-weight: 500;
    margin-left: 1.5rem;
    color: var(--text-color);
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

/* 头部区域样式 */
.jumbotron {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6rem 0;
    margin-top: 56px;
    text-align: center;
}

.jumbotron h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.jumbotron p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
}

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

.card-img-top {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: var(--transition);
}

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

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

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.card-text {
    color: #6c757d;
    margin-bottom: 1.5rem;
}

/* 按钮样式 */
.btn {
    border-radius: 30px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary-color);
    border: none;
}

.btn-primary:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

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

aside .card-header {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

.category-list a,
.popular-posts a,
.footer-links a {
    text-decoration: none;
    transition: var(--transition);
}

.category-list a:hover,
.popular-posts a:hover,
.footer-links a:hover {
    color: var(--primary-color);
}

.category-list .badge {
    border-radius: 12px;
}

/* 社交媒体链接样式 */
.social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    transition: var(--transition);
}

.social-links a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
}

/* 页脚样式 */
footer {
    background: linear-gradient(135deg, #1a2a6c 0%, #b21f1f 51%, #fdbb2d 100%);
    color: white;
    padding: 3rem 0;
}

footer h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

footer p {
    opacity: 0.8;
}

footer .input-group {
    max-width: 400px;
}

footer .form-control {
    border-radius: 30px 0 0 30px;
    border: none;
}

footer .btn {
    border-radius: 0 30px 30px 0;
}

/* 返回顶部按钮 */
#backToTop {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: none;
    color: white;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 1000;
}

#backToTop:hover {
    background-color: #0056b3;
    transform: translateY(-3px);
}

/* 响应式设计 */
@media (max-width: 992px) {
    .jumbotron {
        padding: 5rem 0;
    }
    
    .jumbotron h1 {
        font-size: 2.2rem;
    }
    
    .nav-link {
        margin-left: 0;
        margin-top: 0.5rem;
    }
}

@media (max-width: 768px) {
    .jumbotron {
        padding: 4rem 0;
    }
    
    .jumbotron h1 {
        font-size: 2rem;
    }
    
    .card-img-top {
        height: 200px;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    .jumbotron {
        padding: 3rem 0;
    }
    
    .jumbotron h1 {
        font-size: 1.8rem;
    }
    
    .jumbotron p {
        font-size: 1rem;
    }
    
    .card-title {
        font-size: 1.3rem;
    }
    
    .card-img-top {
        height: 180px;
    }
    
    .btn {
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
    }
}

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

.fade-in {
    animation: fadeIn 0.8s ease forwards;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}