/* Custom CSS for Article News Website */

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin-bottom: 1rem;
}

a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #0056b3;
    text-decoration: none;
}

/* Header */
.header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.site-logo {
    height: 50px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: #fff !important;
}

/* Hero Section */
.hero-section .carousel-item {
    border-radius: 0.5rem;
    overflow: hidden;
}

.hero-section .carousel-caption {
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem 1rem 1rem;
}

.hero-section .carousel-caption h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 0.5rem;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.card-title {
    font-weight: 600;
    line-height: 1.4;
}

.card-title a {
    color: #333;
}

.card-title a:hover {
    color: #007bff;
}

.card-footer {
    border-top: 1px solid #f8f9fa;
    background: transparent;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
}

.badge.bg-primary {
    background-color: #007bff !important;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #212529;
}

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.btn-outline-primary {
    color: #007bff;
    border-color: #007bff;
}

.btn-outline-primary:hover {
    background-color: #007bff;
    border-color: #007bff;
}

/* Article Cards */
.article-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.article-card .card-body {
    flex: 1;
}

.article-card .card-img-top {
    height: 200px;
    object-fit: cover;
}

.article-meta {
    font-size: 0.875rem;
    color: #6c757d;
}

.article-meta i {
    margin-right: 0.25rem;
}

/* Category Cards */
.category-card {
    text-align: center;
    transition: transform 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
}

.category-card .card-img-top {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1rem;
}

/* Sidebar */
.sidebar-card {
    margin-bottom: 1.5rem;
}

.sidebar-card .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

/* Popular Articles Sidebar */
.popular-article-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f8f9fa;
}

.popular-article-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.popular-article-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 0.375rem;
    margin-right: 1rem;
}

.popular-article-item .article-info {
    flex: 1;
}

.popular-article-item h6 {
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.popular-article-item h6 a {
    color: #333;
    font-weight: 600;
}

.popular-article-item h6 a:hover {
    color: #007bff;
}

/* Friend Links */
.friend-link-card {
    text-align: center;
    height: 100%;
}

.friend-link-card .card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.friend-link-card img {
    max-height: 40px;
    max-width: 100%;
    margin-bottom: 0.5rem;
}

/* Friend Links Section - Compact Layout */
.friend-links-section {
    margin-bottom: 2rem;
}

.friend-links-section .row {
    margin: 0 -0.25rem;
}

.friend-links-section .col-lg-3,
.friend-links-section .col-md-4,
.friend-links-section .col-sm-6 {
    padding: 0 0.25rem;
}

.friend-links-section a {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    color: #495057;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-decoration: none;
    width: 100%;
    text-align: center;
}

.friend-links-section a:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
    color: #007bff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Newsletter Section */
.newsletter-section .card {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
}

.newsletter-section .form-control {
    border: none;
    border-radius: 0.375rem 0 0 0.375rem;
}

.newsletter-section .btn {
    border-radius: 0 0.375rem 0.375rem 0;
    background-color: #fff;
    color: #007bff;
    border: none;
}

.newsletter-section .btn:hover {
    background-color: #f8f9fa;
}

/* Footer */
footer {
    background-color: #343a40;
    color: #fff;
}

footer h5 {
    color: #fff;
    margin-bottom: 1rem;
}

footer a {
    color: #6c757d;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #fff;
}

.social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    margin-right: 0.5rem;
    transition: background-color 0.3s ease;
}

.social-links a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Pagination */
.pagination {
    justify-content: center;
    margin-top: 2rem;
}

.page-link {
    color: #007bff;
    border: 1px solid #dee2e6;
    padding: 0.5rem 0.75rem;
}

.page-link:hover {
    color: #0056b3;
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
}

/* Search Form */
.search-form .form-control {
    border-radius: 0.375rem 0 0 0.375rem;
    border-right: none;
}

.search-form .btn {
    border-radius: 0 0.375rem 0.375rem 0;
    border-left: none;
}

/* Alert Messages */
.alert {
    border: none;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

/* Advertisement */
.advertisement {
    text-align: center;
}

.advertisement img {
    max-width: 100%;
    border-radius: 0.375rem;
}

.advertisement .card {
    background-color: #f8f9fa;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .site-logo {
        height: 40px;
        max-width: 150px;
    }
    
    .hero-section .carousel-caption h2 {
        font-size: 1.4rem;
    }
    
    .hero-section .carousel-caption p {
        font-size: 0.9rem;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 0;
    }
    
    .search-form {
        margin-bottom: 1rem;
    }
    
    /* Friend Links Responsive */
    .friend-links-section .col-md-4,
    .friend-links-section .col-sm-6 {
        padding: 0 0.2rem;
    }
    
    .friend-links-section a {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
        margin-bottom: 0.4rem;
    }
}

@media (max-width: 576px) {
    .site-logo {
        height: 35px;
        max-width: 120px;
    }
    
    .hero-section .carousel-caption {
        padding: 1rem 0.5rem 0.5rem;
    }
    
    .hero-section .carousel-caption h2 {
        font-size: 1.2rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.9rem;
    }
    
    /* Friend Links Mobile */
    .friend-links-section .row {
        margin: 0 -0.15rem;
    }
    
    .friend-links-section .col-sm-6 {
        padding: 0 0.15rem;
    }
    
    .friend-links-section a {
        padding: 0.3rem 0.5rem;
        font-size: 0.8rem;
        margin-bottom: 0.3rem;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus Styles */
.btn:focus,
.form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Print Styles */
@media print {
    .navbar,
    .footer,
    .sidebar,
    .advertisement {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
} 

/* Category Page Styles */
.category-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 0.5rem;
    padding: 2rem;
    margin-bottom: 2rem;
}

.category-icon {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.category-stats span {
    background: rgba(255, 255, 255, 0.8);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-weight: 500;
}

/* Breadcrumb Styles */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: #6c757d;
}

.breadcrumb-item.active {
    color: #6c757d;
}

/* Article Card Hover Effects */
.hover-shadow {
    transition: all 0.3s ease;
}

.hover-shadow:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

/* Card Image Overlay */
.card-img-top {
    transition: transform 0.3s ease;
}

.hover-shadow:hover .card-img-top {
    transform: scale(1.05);
}

/* Tag Badge Styles */
.badge.bg-light {
    background-color: #f8f9fa !important;
    border: 1px solid #dee2e6;
    color: #495057 !important;
    transition: all 0.3s ease;
}

.badge.bg-light:hover {
    background-color: #007bff !important;
    color: white !important;
    border-color: #007bff;
}

/* Sidebar Card Styles */
.sidebar .card {
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sidebar .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.12);
}

.sidebar .card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

/* Popular Articles Sidebar */
.sidebar .d-flex.mb-3 {
    transition: all 0.3s ease;
    border-radius: 0.375rem;
    padding: 0.5rem;
}

.sidebar .d-flex.mb-3:hover {
    background-color: #f8f9fa;
    transform: translateX(5px);
}

.sidebar .d-flex.mb-3 h6 a {
    color: #333;
    transition: color 0.3s ease;
}

.sidebar .d-flex.mb-3:hover h6 a {
    color: #007bff;
}

/* Newsletter Card */
.card.bg-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
    border: none;
}

.card.bg-primary .btn-light {
    background-color: white;
    border-color: white;
    color: #007bff;
    font-weight: 500;
    transition: all 0.3s ease;
}

.card.bg-primary .btn-light:hover {
    background-color: #f8f9fa;
    border-color: #f8f9fa;
    transform: translateY(-2px);
}

/* Pagination Styles */
.pagination .page-link {
    border: none;
    color: #007bff;
    margin: 0 0.25rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.pagination .page-link:hover {
    background-color: #007bff;
    color: white;
    transform: translateY(-2px);
}

.pagination .page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

/* No Articles Found */
.text-center.py-5 {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 0.5rem;
    margin: 2rem 0;
}

.text-center.py-5 .fas.fa-newspaper {
    color: #6c757d;
    opacity: 0.5;
}

/* Responsive Adjustments for Category Page */
@media (max-width: 768px) {
    .category-header {
        padding: 1.5rem;
    }
    
    .category-icon {
        width: 60px;
        height: 60px;
    }
    
    .category-icon i {
        font-size: 1.5rem !important;
    }
    
    .category-stats {
        flex-direction: column;
        gap: 0.5rem !important;
    }
    
    .category-stats span {
        text-align: center;
    }
}

@media (max-width: 576px) {
    .category-header {
        padding: 1rem;
    }
    
    .category-header h1 {
        font-size: 1.5rem;
    }
    
    .card-title {
        font-size: 1rem;
    }
} 

/* Article Detail Page Styles */
.article-detail {
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
}

.article-header {
    border-bottom: 1px solid #f8f9fa;
    padding-bottom: 2rem;
}

.article-header h1 {
    color: #2c3e50;
    line-height: 1.3;
    font-weight: 700;
}

.article-meta {
    font-size: 0.9rem;
}

.article-excerpt {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #6c757d;
}

.article-featured-image img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
}

/* Article Content Styles */
.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #2c3e50;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    color: #2c3e50;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.375rem;
    margin: 1.5rem 0;
}

.article-content blockquote {
    border-left: 4px solid #007bff;
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #6c757d;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 0.375rem;
}

.article-content ul,
.article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content code {
    background: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
    color: #e83e8c;
}

.article-content pre {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 0.375rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.article-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* Social Share Styles */
.social-share .btn {
    transition: all 0.3s ease;
}

.social-share .btn:hover {
    transform: translateY(-2px);
}

/* Comments Section Styles */
.comments-section {
    border-top: 1px solid #f8f9fa;
    padding-top: 2rem;
}

.comment-item {
    transition: all 0.3s ease;
}

.comment-item:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.comment-avatar {
    flex-shrink: 0;
}

.comment-content {
    line-height: 1.6;
    color: #2c3e50;
}

/* Author Info Styles */
.author-avatar {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Related Articles Styles */
.related-articles .card {
    transition: all 0.3s ease;
    border: 1px solid #f8f9fa;
}

.related-articles .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.related-articles .card-title a {
    color: #2c3e50;
    transition: color 0.3s ease;
}

.related-articles .card-title a:hover {
    color: #007bff;
}

/* Article Tags Styles */
.article-tags .badge {
    transition: all 0.3s ease;
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
}

.article-tags .badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Copy Link Button Animation */
.btn-outline-success:active {
    transform: scale(0.95);
}

/* Responsive Adjustments for Article Detail */
@media (max-width: 768px) {
    .article-header h1 {
        font-size: 1.8rem;
    }
    
    .article-meta {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }
    
    .social-share .btn {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }
    
    .article-content {
        font-size: 1rem;
    }
    
    .related-articles .col-md-6 {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .article-header h1 {
        font-size: 1.5rem;
    }
    
    .article-excerpt {
        font-size: 1rem;
    }
    
    .social-share .d-flex {
        flex-direction: column;
        gap: 0.5rem !important;
    }
    
    .social-share .btn {
        width: 100%;
    }
    
    .comment-item .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .comment-avatar {
        margin-bottom: 0.5rem;
    }
}

/* Print Styles for Articles */
@media print {
    .article-detail {
        background: white;
        box-shadow: none;
    }
    
    .social-share,
    .comments-section,
    .related-articles,
    .sidebar {
        display: none !important;
    }
    
    .article-content {
        font-size: 12pt;
        line-height: 1.6;
    }
    
    .article-header h1 {
        font-size: 18pt;
        color: black;
    }
    
    .article-meta {
        color: #666;
    }
} 

/* Tag Page Styles */
.tag-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
}

.tag-header h1 {
    color: white;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.tag-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

.tag-stats {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Tag Cards Hover Effects */
.card.hover-shadow {
    transition: all 0.3s ease;
    border: 1px solid #f8f9fa;
}

.card.hover-shadow:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

/* Tag Badge Styles */
.badge.bg-light {
    transition: all 0.3s ease;
}

.badge.bg-light:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Responsive Adjustments for Tag Page */
@media (max-width: 768px) {
    .tag-header {
        padding: 1.5rem;
    }
    
    .tag-header h1 {
        font-size: 1.5rem;
    }
    
    .tag-stats {
        flex-direction: column;
        gap: 0.5rem !important;
    }
    
    .card.hover-shadow:hover {
        transform: none;
    }
}

@media (max-width: 576px) {
    .tag-header {
        padding: 1rem;
    }
    
    .tag-header h1 {
        font-size: 1.3rem;
    }
    
    .tag-icon {
        width: 50px;
        height: 50px;
    }
    
    .tag-icon i {
        font-size: 1.5rem !important;
    }
}

/* 广告样式 */
.header-advertisement {
    border-bottom: 1px solid #e9ecef;
}

.header-advertisement img {
    max-height: 60px;
    width: auto;
}

.footer-advertisement {
    border-top: 1px solid #e9ecef;
}

.footer-advertisement img {
    max-height: 80px;
    width: auto;
}

.content-top-advertisement {
    margin: 2rem 0;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    background-color: #f8f9fa;
}

.content-top-advertisement .card {
    border: none;
    background: transparent;
}

.content-top-advertisement .card-body {
    padding: 1.5rem;
}

.content-top-advertisement img {
    max-width: 100%;
    height: auto;
    border-radius: 0.375rem;
}

/* 广告响应式设计 */
@media (max-width: 768px) {
    .header-advertisement img {
        max-height: 40px;
    }
    
    .footer-advertisement img {
        max-height: 60px;
    }
    
    .content-top-advertisement {
        margin: 1.5rem 0;
    }
}

@media (max-width: 576px) {
    .header-advertisement {
        padding: 0.5rem 0;
    }
    
    .footer-advertisement {
        padding: 1rem 0;
    }
    
    .content-top-advertisement .card-body {
        padding: 1rem;
    }
} 

/* --- Footer Link Contrast Enhancement --- */
footer a,
footer .list-unstyled a,
footer .text-muted,
footer .quick-links a {
    color: #fff !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
footer a:hover,
footer .list-unstyled a:hover,
footer .quick-links a:hover {
    color: #ffd700 !important;
    text-decoration: underline;
}
footer .text-muted {
    color: #fff !important;
    opacity: 0.85;
}
/* --- End Footer Link Contrast Enhancement --- */

/* Tag Links in Article Content */
.tag-link {
    color: #007bff;
    background-color: #e7f3ff;
    padding: 0.2em 0.4em;
    border-radius: 0.25rem;
    text-decoration: none;
    font-weight: 500;
    border: 1px solid #b3d9ff;
    transition: all 0.3s ease;
    position: relative;
}

.tag-link:hover {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.3);
}

.tag-link::before {
    margin-right: 0.1em;
    opacity: 0.7;
}

.tag-link:hover::before {
    opacity: 1;
} 