/* 网格布局样式文件 */

/* 轮播图样式 */
.carousel-container {
    position: relative;
    width: 100%;
    height: 400px;
    margin-bottom: 30px;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.carousel {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-slides {
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
}

.carousel-slide a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
}

.carousel-caption h3 {
    font-size: 24px;
    margin-bottom: 10px;
    font-weight: 600;
}

.carousel-caption p {
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.5;
}

.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.carousel-prev:hover,
.carousel-next:hover {
    background: rgba(255, 71, 71, 0.8);
}

.carousel-prev {
    left: 20px;
}

.carousel-next {
    right: 20px;
}

.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-indicators button.active {
    background: #ff4747;
    width: 30px;
    border-radius: 6px;
}

/* 分类区块样式 */
.sort-section {
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sort-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.sort-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e8e8e8;
}

.sort-image {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    margin-right: 15px;
    object-fit: cover;
}

.sort-title {
    flex: 1;
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.sort-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.sort-title a:hover {
    color: #007bff;
}

.post-count {
    font-size: 14px;
    color: #6c757d;
    font-weight: normal;
    margin-left: 5px;
}

.more-link {
    background: #007bff;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.more-link:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* 横向滚动容器 */
.horizontal-scroll-container {
    position: relative;
    overflow: hidden;
}

.blog-grid {
    display: flex;
    gap: 20px;
    padding: 10px 0;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.blog-grid::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* 滚动按钮 */
.scroll-btn {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
    z-index: 10;
}

.scroll-btn:hover {
    background: #0056b3;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.scroll-left {
    left: 15px;
}

.scroll-right {
    right: 15px;
}

/* 博客卡片样式 */
.blog-card {
    flex: 0 0 300px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.card-media {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .card-image {
    transform: scale(1.08);
}

.view-count {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
}

.card-content {
    padding: 15px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #2c3e50;
    line-height: 1.4;
    height: 50px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-excerpt {
    font-size: 14px;
    color: #6c757d;
    line-height: 1.5;
    margin-bottom: 15px;
    height: 60px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .carousel-container {
        height: 250px;
    }
    
    .carousel-caption h3 {
        font-size: 18px;
    }
    
    .carousel-caption p {
        font-size: 12px;
    }
    
    .blog-card {
        flex: 0 0 250px;
    }
    
    .card-media {
        height: 150px;
    }
}

@media (max-width: 576px) {
    .carousel-container {
        height: 200px;
    }
    
    .carousel-caption {
        padding: 20px;
    }
    
    .carousel-caption h3 {
        font-size: 16px;
    }
    
    .carousel-prev,
    .carousel-next {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .sort-header {
        flex-wrap: wrap;
    }
    
    .more-link {
        margin-top: 10px;
    }
    
    .blog-card {
        flex: 0 0 220px;
    }
}

/* 蓝色主题强调 */
:root {
    --primary-blue: #007bff;
    --secondary-blue: #0056b3;
    --accent-red: #ff4747;
    --light-blue: #e3f2fd;
}

/* 主色调应用 */
.sort-section:hover {
    border-left: 4px solid var(--primary-blue);
}

.more-link {
    background: var(--primary-blue);
}

.more-link:hover {
    background: var(--secondary-blue);
}

.card-title:hover {
    color: var(--primary-blue);
}

/* 添加科技感动画效果 */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 123, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
    }
}

.carousel-container {
    animation: pulse 3s infinite;
}

/* 扁平化设计强调 */
* {
    border-radius: 0;
}

.blog-card,
.sort-section,
.carousel-container {
    border-radius: 12px;
}

/* 高饱和度色彩点缀 */
.view-count i {
    color: var(--accent-red);
}

.carousel-indicators button.active {
    background: var(--accent-red);
}

.scroll-btn:hover {
    background: var(--accent-red);
}






/* 仅匹配文章内容卡片（排除左侧分类卡片）- 未hover状态 */
.content-blog > div > div:nth-child(2) div[style*="width: 280px; height: 100%; flex-shrink: 0; background: #fff"] {
    /* 浅米白色细边框（高原雪地质感） */
    border: 1px solid rgba(245, 240, 230, 0.5) !important;
    /* 覆盖内联阴影，改为柔和浅灰 */
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08) !important;
    /* 确保过渡生效 */
    transition: all 0.3s ease !important;
}

/* 文章内容卡片hover状态 */
.content-blog > div > div:nth-child(2) div[style*="width: 280px; height: 100%; flex-shrink: 0; background: #fff"]:hover {
    /* 轻微上浮3px */
    transform: translateY(-3px) !important;
    /* 暖化阴影（浅赭石色） */
    box-shadow: 
        0 8px 20px rgba(150, 120, 80, 0.12),  /* 外部阴影 */
        inset 0 0 5px rgba(255, 255, 255, 0.5) !important;  /* 内侧柔光 */
    /* 高原色系渐变边框 */
    border: 1px solid transparent !important;
    border-image: linear-gradient(90deg, 
        rgba(173, 216, 230, 0.8),  /* 淡天蓝 */
        rgba(184, 134, 11, 0.6),   /* 浅赭石 */
        rgba(245, 240, 230, 0.8)   /* 米白 */
    ) 1 !important;
}

/* 卡片内图片hover效果 */
.content-blog > div > div:nth-child(2) div[style*="width: 280px; height: 100%; flex-shrink: 0; background: #fff"] img {
    transition: transform 0.3s ease !important;
}
.content-blog > div > div:nth-child(2) div[style*="width: 280px; height: 100%; flex-shrink: 0; background: #fff"]:hover img {
    transform: scale(1.03) !important;
}

/* 卡片标题hover显示优化 */
.content-blog > div > div:nth-child(2) div[style*="width: 280px; height: 100%; flex-shrink: 0; background: #fff"] div[style*="position: absolute; bottom: 0;"] {
    opacity: 1 !important; /* 修复标题默认不显示的问题 */
    transition: opacity 0.3s ease !important;
}