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

/* 导航栏样式 */
.navbar {
    background: linear-gradient(135deg, #6c9bcf 0%, #8a6fcf 100%);
}

.navbar-brand h2 {
    margin: 0;
    font-weight: bold;
}

/* 轮播图样式 */
.hero-slider {
    position: relative;
    margin-bottom: 2rem;
}

.carousel-item img {
    height: 400px;
    object-fit: cover;
}

.carousel-caption {
    background: rgba(108, 155, 207, 0.7);
    border-radius: 10px;
    padding: 20px;
}

.carousel-caption h2 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

/* 栏目卡片样式 */
.category-card {
    border: none;
    box-shadow: 0 4px 6px rgba(108, 155, 207, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    background: #ffffff;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(108, 155, 207, 0.2);
}

.category-card .card-header {
    background: linear-gradient(135deg, #8a9fcf 0%, #a88fcf 100%);
    color: white;
    border-bottom: none;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: between;
    align-items: center;
}

.category-card .card-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.category-card .card-title i {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

/* 文章列表样式 */
.article-item {
    padding: 1rem 0;
    border-bottom: 1px solid #e9ecef;
}

.article-item:last-child {
    border-bottom: none;
}

.article-item h5 {
    margin-bottom: 0.5rem;
}

.article-item h5 a {
    color: #495057;
    text-decoration: none;
    transition: color 0.3s ease;
}

.article-item h5 a:hover {
    color: #6c9bcf;
}

.article-item p {
    margin-bottom: 0.5rem;
    color: #6c757d;
}

/* 文章详情页样式 */
.article-content {
    background: #ffffff;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(108, 155, 207, 0.1);
}

.article-header {
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 1.5rem;
}

.article-title {
    font-size: 2.5rem;
    font-weight: bold;
    color: #495057;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.article-meta {
    font-size: 0.9rem;
}

.article-meta span {
    margin-right: 1rem;
    color: #6c757d;
}

.article-image img {
    width: 100%;
    border-radius: 10px;
}

.article-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #495057;
}

.article-body p {
    margin-bottom: 1.5rem;
}

.article-body h2, .article-body h3, .article-body h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #495057;
}

/* 分页样式 */
.pagination .page-link {
    border-radius: 50px;
    margin: 0 2px;
    border: none;
    color: #6c9bcf;
    background-color: #ffffff;
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #8a9fcf 0%, #a88fcf 100%);
    border: none;
}

.pagination .page-link:hover {
    color: #ffffff;
    background-color: #6c9bcf;
}

/* 侧边栏样式 */
.sidebar .card {
    border: none;
    box-shadow: 0 2px 10px rgba(108, 155, 207, 0.1);
    margin-bottom: 1.5rem;
    background: #ffffff;
}

.sidebar .card-header {
    background: #e9ecef;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

/* 页面标题样式 */
.page-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
    background: linear-gradient(135deg, #8a9fcf 0%, #a88fcf 100%);
    color: white;
    border-radius: 10px;
}

.page-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.page-title i {
    margin-right: 0.5rem;
}

.page-description {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
}

/* 文章卡片样式 */
.article-card {
    border: none;
    box-shadow: 0 4px 6px rgba(108, 155, 207, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #ffffff;
}

.article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(108, 155, 207, 0.2);
}

.article-card .card-title a {
    color: #495057;
    text-decoration: none;
    font-weight: 600;
}

.article-card .card-title a:hover {
    color: #6c9bcf;
}

.article-card .card-img-top {
    height: 200px;
    object-fit: cover;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .carousel-caption h2 {
        font-size: 1.8rem;
    }
    
    .article-title {
        font-size: 2rem;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .article-content {
        padding: 1rem;
    }
}

/* 404 页面样式 */
.error-page {
    padding: 3rem 0;
}

.error-page .display-1 {
    font-size: 8rem;
    font-weight: bold;
}

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

.category-card, .article-card {
    animation: fadeInUp 0.6s ease-out;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #868e96;
}

/* 信息流样式 */
.news-feed {
    max-width: 100%;
}

.news-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 1.5rem;
}

.news-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(108, 155, 207, 0.2) !important;
}

.news-item .card {
    border: none;
    border-radius: 5px;
    overflow: hidden;
    height: 100%;
    position: relative;
    background: #ffffff;
    display: flex;
    flex-direction: column;
}

.news-image-container {
    width: 100%;
    height: 100%;
    min-height: 200px;
    overflow: hidden;
    /* 移除圆角，改为直角 */
    border-radius: 0;
    /* 添加4像素的边距 */
    padding: 4px;
    /* 确保容器撑满 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    /* 移除圆角，改为直角 */
    border-radius: 0;
    /* 确保图片撑满容器 */
    min-height: 100%;
    min-width: 100%;
}

.news-item .card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-item .card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.news-item .card-text {
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.news-item .btn {
    border-radius: 25px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-right: 0.5rem;
}

.news-item .btn-primary {
    background-color: #6c9bcf;
    border-color: #6c9bcf;
}

.news-item .btn-primary:hover {
    background-color: #5a89c2;
    border-color: #5a89c2;
}

.news-item .btn-outline-primary {
    color: #6c9bcf;
    border-color: #6c9bcf;
}

.news-item .btn-outline-primary:hover {
    background-color: #6c9bcf;
    border-color: #6c9bcf;
}

.news-item .btn-success {
    background-color: #8bc34a;
    border-color: #8bc34a;
}

.news-item .btn-success:hover {
    background-color: #7cb342;
    border-color: #7cb342;
}

.news-item .btn-outline-success {
    color: #8bc34a;
    border-color: #8bc34a;
}

.news-item .btn-outline-success:hover {
    background-color: #8bc34a;
    border-color: #8bc34a;
}

.news-item .btn-warning {
    background-color: #ffca28;
    border-color: #ffca28;
}

.news-item .btn-warning:hover {
    background-color: #ffb300;
    border-color: #ffb300;
}

.news-item .btn-outline-warning {
    color: #ffca28;
    border-color: #ffca28;
}

.news-item .btn-outline-warning:hover {
    background-color: #ffca28;
    border-color: #ffca28;
}

.news-item .btn-danger {
    background-color: #ef5350;
    border-color: #ef5350;
}

.news-item .btn-danger:hover {
    background-color: #e53935;
    border-color: #e53935;
}

.news-item .btn-outline-danger {
    color: #ef5350;
    border-color: #ef5350;
}

.news-item .btn-outline-danger:hover {
    background-color: #ef5350;
    border-color: #ef5350;
}

.news-item .btn-info {
    background-color: #26c6da;
    border-color: #26c6da;
}

.news-item .btn-info:hover {
    background-color: #00bcd4;
    border-color: #00bcd4;
}

.news-item .btn-outline-info {
    color: #26c6da;
    border-color: #26c6da;
}

.news-item .btn-outline-info:hover {
    background-color: #26c6da;
    border-color: #26c6da;
}

.news-item .btn:last-child {
    margin-right: 0;
}

.news-item .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(108, 155, 207, 0.2);
}

/* 统计信息样式 */
.news-stats .badge {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
    border: 1px solid #e9ecef;
    background-color: #f8f9fa;
}

.news-stats .badge.bg-light {
    background-color: #f8f9fa !important;
}

.news-stats .bi {
    font-size: 0.9rem;
    margin-right: 0.25rem;
}

.rating-stars {
    font-size: 0.8rem;
}

.rating-stars .bi {
    margin-right: 0.1rem;
    margin-left: 0;
}

/* 排名徽章样式 */
.rank-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(108, 155, 207, 0.2);
}

.rank-top1 {
    background: linear-gradient(135deg, #ffccd5 0%, #f8c2c2 100%);
    color: #c22a4a;
}

.rank-top2 {
    background: linear-gradient(135deg, #c2e0ff 0%, #b3d1f0 100%);
    color: #2a6bc2;
}

.rank-top3 {
    background: linear-gradient(135deg, #d4f2d4 0%, #c2e0c2 100%);
    color: #2a8c2a;
}

.rank-other {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe6b3 100%);
    color: #c28a2a;
}

/* 统计信息动画 */
.news-stats .badge {
    transition: all 0.3s ease;
}

.news-stats .badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(108, 155, 207, 0.15);
}

/* 响应式设计 - 移动端优化 */
@media (max-width: 768px) {
    .news-item .row {
        flex-direction: row;
        height: auto !important;
    }
    
    .news-image-container {
        width: 100%;
        height: auto;
        min-height: 200px;
        /* 移除圆角，改为直角 */
        border-radius: 0;
        /* 添加4像素的边距 */
        padding: 4px;
        /* 确保容器撑满 */
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .news-image {
        width: 100%;
        height: auto;
        object-fit: contain;
        object-position: center;
        /* 移除圆角，改为直角 */
        border-radius: 0;
        /* 确保图片完整显示 */
        max-width: 100%;
    }
    
    .news-item .card-body {
        padding: 1rem;
    }
    
    .news-item .card-title {
        font-size: 1.1rem;
    }
    
    .news-item .d-flex {
        flex-direction: column;
    }
    
    .news-item .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .rank-badge {
        top: 5px;
        right: 5px;
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
}

@media (max-width: 576px) {
    .news-item .card-body {
        padding: 0.75rem;
    }
    
    .news-item .card-title {
        font-size: 1rem;
    }
    
    .news-item .card-text {
        font-size: 0.9rem;
    }
    
    .news-image-container {
        min-height: 150px;
    }
}

/* 信息流动画 */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-item {
    animation: slideInUp 0.6s ease-out;
}

.news-item:nth-child(even) {
    animation-delay: 0.1s;
}

.news-item:nth-child(odd) {
    animation-delay: 0.2s;
}

/* 无信息状态 */
.text-center.py-5 {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 5px;
    margin: 2rem 0;
}

/* 返回顶部按钮样式 */
.back-to-top {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    z-index: 1000 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 24px !important;
    font-weight: bold !important;
    background-color: #0d6efd !important;
    color: white !important;
}

.back-to-top:hover {
    background-color: #0b5ed7 !important;
    transform: translateY(-2px);
    transition: all 0.3s ease;
}