/* 博客容器布局 */
.blog_container {
    display: flex;
    gap: 30px;
    padding: 20px 0;
    align-items: flex-start;
    box-sizing: border-box;
    /* 确保padding包含在宽度内 */
}

/* 左侧内容区 */
.blog_left {
    flex: 1;
    min-width: 0;
    /* 防止flex子元素溢出 */
}

/* 分类标签 */
.blog_tabs {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 30px;
    display: flex;
    gap: 30px;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    /* 强制不换行 */
    -webkit-overflow-scrolling: touch;
    /* iOS平滑滚动 */
    scrollbar-width: none;
    /* Firefox隐藏滚动条 */
    -ms-overflow-style: none;
    /* IE/Edge隐藏滚动条 */
}

/* 隐藏Webkit浏览器滚动条 */
.blog_tabs::-webkit-scrollbar {
    display: none;
}

.tab_item {
    font-size: 15px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
    white-space: nowrap;
    /* 标签文字不换行 */
    flex-shrink: 0;
    /* 防止标签被压缩 */
}

.tab_item:hover,
.tab_item.active {
    color: #ff6600;
    font-weight: 500;
}

.tab_item.active::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: #ff6600;
}

/* 文章列表 */
.blog_list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.blog_item {
    display: flex;
    gap: 20px;
    background: #fff;
    overflow: hidden;
    transition: all 0.3s;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    /* 去掉链接下划线 */
    color: inherit;
    /* 继承文字颜色 */
}



/* 确保a标签作为blog_item时的样式 */
a.blog_item {
    display: flex;
}

.blog_img {
    width: 254px;
    height: 141px;
    flex-shrink: 0;
    overflow: hidden;
}

.blog_img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.blog_item:hover .blog_img img {
    transform: scale(1.05);
}

.blog_content {
    flex: 1;
    min-width: 0;
    /* 关键：允许flex子元素缩小到内容宽度以下 */
    padding: 11px 11px 11px 0;
    display: flex;
    flex-direction: column;
}

.blog_title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    line-height: 1.5;
    margin: 0 0 12px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    display: block;
}

.blog_desc {
    font-size: 14px;
    color: #666;
    line-height: 1.8;
    margin: 0 0 auto 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.blog_meta {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 10px;
}

.blog_source {
    font-size: 13px;
    color: #999;
}

.blog_date {
    font-size: 13px;
    color: #ccc;
}

/* 右侧广告区 */
.blog_right {
    width: 278px;
    flex-shrink: 0;
}

.blog_ad_sticky {
    /* 不使用CSS sticky，改用JavaScript实现 */
    z-index: 10;
}

/* 广告盒子 */
.blog_ad_box {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    padding: 23px 20px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #fff 0%, #fff5f0 100%);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* 背景图层1 - 橙色柱状图 */
.ad_bg_layer1 {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 320px;
    background: linear-gradient(to top, rgba(255, 140, 50, 0.6) 0%, rgba(255, 140, 50, 0.2) 60%, transparent 100%);
    opacity: 0.8;
    z-index: 1;
}

.ad_bg_layer1::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 90px;
    width: 80px;
    height: 190px;
    background: linear-gradient(to top, #ff8c32 0%, rgba(255, 140, 50, 0.5) 100%);
    border-radius: 4px 4px 0 0;
}

/* 背景图层2 - 渐变点阵 */
.ad_bg_layer2 {
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle at top right, rgba(255, 140, 50, 0.3) 0%, rgba(255, 100, 150, 0.2) 50%, transparent 80%);
    opacity: 0.7;
    z-index: 1;
}

.ad_bg_layer2::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 10% 10%, rgba(255, 140, 50, 0.4) 2px, transparent 2px),
        radial-gradient(circle at 20% 15%, rgba(255, 140, 50, 0.35) 2px, transparent 2px),
        radial-gradient(circle at 30% 20%, rgba(255, 120, 80, 0.3) 2px, transparent 2px),
        radial-gradient(circle at 40% 25%, rgba(255, 120, 100, 0.25) 1.5px, transparent 1.5px),
        radial-gradient(circle at 50% 30%, rgba(255, 100, 120, 0.2) 1.5px, transparent 1.5px),
        radial-gradient(circle at 60% 35%, rgba(255, 100, 140, 0.15) 1px, transparent 1px),
        radial-gradient(circle at 70% 40%, rgba(255, 100, 150, 0.1) 1px, transparent 1px);
    background-size: 100% 100%;
    background-repeat: no-repeat;
}

.ad_content {
    position: relative;
    z-index: 2;
    text-align: left;
}

.ad_title {
    font-size: 20px;
    font-weight: 700;
    color: #F56624;
    margin: 0 0 15px 0;
    line-height: 1.4;
}

.ad_subtitle {
    font-size: 15px;
    color: #333333;
    line-height: 1.8;
    margin: 0 0 19px 0;
}

.ad_btn {
    display: inline-block;
    background: linear-gradient(135deg, #ff8533 0%, #ff6600 100%);
    color: #fff;
    padding: 6px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(255, 102, 0, 0.3);
    cursor: pointer;
}

/* 热门文章 */
.hot_articles {
    background: #fff;
    border-radius: 8px;
    padding: 22px 18px 22px 18px;
    border: 1px solid #f0f0f0;
}

.hot_title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #F35F2C;
}

.hot_list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hot_item {
    margin-bottom: 20px;
}

.hot_item:last-child {
    margin-bottom: 0;
}

.hot_item a {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transition: all 0.3s;
}

.hot_item a:hover .hot_text {
    color: #ff6600;
}

.hot_text {
    font-size: 14px;
    color: #333;
    line-height: 1.6;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.hot_views {
    font-size: 12px;
    color: #999;
}

/* 响应式 */
@media (max-width: 1200px) {
    .blog_container {
        flex-direction: column;
        gap: 20px;
    }

    .blog_left {
        max-width: 100%;
    }

    .blog_right {
        width: 100%;
    }

    .blog_ad_sticky {
        position: static !important;
    }
}

@media (max-width: 768px) {
    .blog_container {
        padding: 20px 0;
    }

    /* 分类标签移动端优化 */
    .blog_tabs {
        gap: 20px;
        padding: 12px 15px;
    }

    .tab_item {
        font-size: 14px;
    }

    /* 文章列表移动端 */
    .blog_list {
        gap: 15px;
    }

    .blog_item {
        flex-direction: column;
        gap: 0;
    }

    .blog_img {
        width: 100%;
        height: 180px;
    }

    .blog_content {
        padding: 15px;
    }

    .blog_title {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .blog_desc {
        font-size: 13px;
        line-height: 1.6;
    }

    .blog_meta {
        margin-top: 8px;
        gap: 15px;
    }

    .blog_source,
    .blog_date {
        font-size: 12px;
    }

    /* 右侧区域移动端 */
    .blog_right {
        width: 100%;
    }

    .blog_ad_box {
        padding: 25px 15px;
    }

    .ad_title {
        font-size: 18px;
    }

    .ad_subtitle {
        font-size: 13px;
    }

    .ad_btn {
        padding: 8px 25px;
        font-size: 14px;
    }

    .hot_articles {
        padding: 18px 15px;
    }

    .hot_title {
        font-size: 16px;
    }

    .hot_text {
        font-size: 13px;
    }

    .hot_views {
        font-size: 11px;
    }
}

/* 小屏手机优化 */
@media (max-width: 480px) {
    .blog_container {
        padding: 15px;
    }

    .blog_tabs {
        gap: 15px;
        padding: 10px 12px;
    }

    .tab_item {
        font-size: 13px;
    }

    .blog_item {
        border-radius: 6px;
    }

    .blog_img {
        height: 160px;
    }

    .blog_content {
        padding: 12px;
    }

    .blog_title {
        font-size: 15px;
    }

    .blog_desc {
        font-size: 12px;
    }
}