/* ========================================
   首页博客模块样式
   ======================================== */

/* 博客区域基础样式 */
#homeBlogSection {
    background-color: var(--bg-section);
    position: relative;
    overflow: hidden;
}

/* 背景装饰元素 */
#homeBlogSection::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: var(--primary-alpha-10);
    border-radius: 50%;
    filter: blur(100px);
    z-index: 0;
}

#homeBlogSection .container {
    position: relative;
    z-index: 1;
}

/* 标题样式优化 */
#homeBlogSection .section-title {
    position: relative;
    margin-bottom: 3rem;
}

#homeBlogSection .section-title .title {
    color: var(--text-primary);
    font-size: var(--font-size-3xl);
    font-weight: 700;
    position: relative;
    display: inline-block;
}


/* 左侧大图样式 */
#homeBlogLeft .blog-box {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    height: 100%;
    min-height: 500px;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-normal);
}

#homeBlogLeft .blog-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.7) 100%);
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: 1;
}

#homeBlogLeft .blog-box:hover::before {
    opacity: 1;
}

#homeBlogLeft .blog-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .1s;
}

#homeBlogLeft .blog-box:hover img {
    transform: scale(1.05);
}

#homeBlogLeft .blog-box:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
}

/* 右侧博客列表样式 */
#homeBlogRight {
    gap: 1.5rem;
    height: 100%;
    min-height: 500px;
}

#homeBlogRight .blog-box-content {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding:0 20px;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    flex: 1;
    display: flex;
    align-items: center;
    min-height: 110px;
    height: calc((100% - 4.5rem) / 4);  /* 减去间距后平分高度 */
}

/* 悬停效果 */
#homeBlogRight .blog-box-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--primary-alpha-10), transparent);
    transition: left var(--transition-slow);
}

#homeBlogRight .blog-box-content:hover::before {
    left: 100%;
}

#homeBlogRight .blog-box-content:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
    background: var(--bg-hover);
}

/* 博客图片样式 */
#homeBlogRight .blog-img {
    width:20%;
    height: 80%;
    object-fit: cover;
    border-radius: var(--radius-sm);
    transition: all var(--transition-normal);
    flex-shrink: 0;
}

#homeBlogRight .blog-box-content:hover .blog-img {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

/* 博客标题样式 */
#homeBlogRight h5 {
    font-size: var(--font-size-lg);
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

#homeBlogRight h5 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

#homeBlogRight h5 a:hover {
    color: var(--primary-color);
}

/* 元信息样式 */
#homeBlogRight .list-inline {
    margin-bottom: 0;
}

#homeBlogRight .list-inline-item {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

#homeBlogRight .list-inline-item i {
    color: var(--primary-color);
    margin-right: 0.25rem;
}

/* 加载动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 应用加载动画 */
#homeBlogSection.wow {
    visibility: hidden;
}

#homeBlogSection.animated {
    visibility: visible;
}

#homeBlogLeft .blog-box {
    animation: slideInLeft 0.8s ease-out;
}

/* 内容区域添加内边距 */
#homeBlogRight .blog-box-content .flex-grow-1 {
    padding: 1.25rem;
}

#homeBlogRight .blog-box-content:nth-child(1) {
    animation-delay: 0.1s;
}

#homeBlogRight .blog-box-content:nth-child(2) {
    animation-delay: 0.2s;
}

#homeBlogRight .blog-box-content:nth-child(3) {
    animation-delay: 0.3s;
}

#homeBlogRight .blog-box-content:nth-child(4) {
    animation-delay: 0.4s;
}

/* 响应式设计 - 平板设备 */
@media (max-width: 991.98px) {
    #homeBlogSection .section-title .title {
        font-size: var(--font-size-2xl);
    }

    #homeBlogLeft .blog-box {
        min-height: 400px;
    }

    #homeBlogRight {
        gap: 1rem;
    }

    #homeBlogRight .blog-box-content {
        padding: 1rem;
    }

    #homeBlogRight h5 {
        font-size: var(--font-size-base);
    }
}

/* 响应式设计 - 移动设备 */
@media (max-width: 767.98px) {
    #homeBlogSection {
        padding: 3rem 0;
    }

    #homeBlogSection::before {
        width: 300px;
        height: 300px;
        top: -20%;
        right: -20%;
    }

    #homeBlogSection .section-title {
        margin-bottom: 2rem;
        text-align: center;
    }

    #homeBlogLeft .blog-box {
        min-height: 300px;
        margin-bottom: 1.5rem;
    }

    #homeBlogRight {
        gap: 1rem;
    }

    #homeBlogRight .blog-box-content {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }

    #homeBlogRight .blog-img {
        width: 100%;
        height: 180px;
        margin-right: 0 !important;
        margin-bottom: 1rem;
    }

    #homeBlogRight h5 {
        font-size: var(--font-size-base);
        margin-bottom: 0.5rem;
    }

    #homeBlogRight h5 a {
        -webkit-line-clamp: 3;
    }

    /* 移动端动画调整 */
    #homeBlogLeft .blog-box,
    #homeBlogRight .blog-box-content {
        animation: fadeInUp 0.6s ease-out;
    }
}

/* 小屏幕设备优化 */
@media (max-width: 575.98px) {
    #homeBlogSection {
        padding: 2.5rem 0;
    }

    #homeBlogSection .section-title .title {
        font-size: var(--font-size-xl);
    }

    #homeBlogLeft .blog-box {
        min-height: 250px;
        border-radius: var(--radius-md);
    }

    #homeBlogRight .blog-box-content {
        padding: 0.875rem;
        border-radius: var(--radius-sm);
    }

    #homeBlogRight .blog-img {
        height: 150px;
        border-radius: var(--radius-sm);
    }

    #homeBlogRight h5 {
        font-size: 0.9rem;
        line-height: 1.3;
    }

    #homeBlogRight .list-inline-item {
        font-size: 0.75rem;
    }
}

/* 加载状态样式 */
#homeBlogLeft:empty::before,
#homeBlogRight:empty::before {
    content: '';
    display: block;
    width: 100%;
    height: 300px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 辅助类 */
.blog-date {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.blog-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary-alpha-10);
    color: var(--primary-color);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 确保图标正确显示 */
.icon-size-15 {
    width: 15px;
    height: 15px;
    vertical-align: middle;
}



/* ========================================
   移动端博客模块优化
   ======================================== */

/* 移动端基础优化 */
@media (max-width: 767.98px) {
    /* 调整整体内边距 */
    #homeBlogSection {
        padding: 2.5rem 0;
    }

    /* 标题居中并减小底部间距 */
    #homeBlogSection .section-title {
        text-align: center;
        padding-bottom: 2rem !important;
    }

    /* 左侧大图优化 */
    #homeBlogLeft {
        margin-bottom: 1.5rem;
    }

    #homeBlogLeft .blog-box {
        min-height: 250px;
        max-height: 300px;
    }

    /* 右侧列表重新设计 */
    #homeBlogRight {
        gap: 1rem;
        min-height: auto;
    }

    #homeBlogRight .blog-box-content {
        flex-direction: row !important;
        height: auto;
        min-height: 90px;
        padding: 0.75rem !important;
        margin-bottom: 0.75rem;
    }

    #homeBlogRight .blog-box-content:last-child {
        margin-bottom: 0;
    }

    /* 博客图片调整 */
    #homeBlogRight .blog-img {
        width: 80px !important;
        height: 80px !important;
        margin-right: 0.75rem !important;
        margin-bottom: 0 !important;
        object-fit: cover;
        flex-shrink: 0;
    }

    /* 内容区域优化 */
    #homeBlogRight .blog-box-content .flex-grow-1 {
        padding: 0 !important;
        text-align: left !important;
    }

    /* 标题样式 */
    #homeBlogRight h5 {
        font-size: 0.9rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.25rem !important;
    }

    #homeBlogRight h5 a {
        -webkit-line-clamp: 2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* 日期信息 */
    #homeBlogRight .list-inline {
        margin-bottom: 0 !important;
    }

    #homeBlogRight .list-inline-item {
        font-size: 0.75rem !important;
        margin-right: 0 !important;
    }

    /* 图标尺寸 */
    #homeBlogRight .icon-size-15 {
        width: 12px !important;
        height: 12px !important;
    }
}

/* 小屏幕设备进一步优化 */
@media (max-width: 575.98px) {
    /* 容器内边距 */
    #homeBlogSection .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* 标题大小 */
    #homeBlogSection .section-title .title {
        font-size: 1.5rem !important;
    }

    /* 左侧大图 */
    #homeBlogLeft .blog-box {
        min-height: 200px;
        max-height: 250px;
        border-radius: 0.75rem;
    }

    /* 右侧内容卡片 */
    #homeBlogRight .blog-box-content {
        padding: 0.625rem !important;
        border-radius: 0.5rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    /* 博客图片 */
    #homeBlogRight .blog-img {
        width: 70px !important;
        height: 70px !important;
        border-radius: 0.375rem;
    }

    /* 标题字体 */
    #homeBlogRight h5 {
        font-size: 0.85rem !important;
        font-weight: 600 !important;
    }

    /* 悬停效果优化 - 移动端减弱 */
    #homeBlogRight .blog-box-content:hover {
        transform: none;
        box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    }

    #homeBlogRight .blog-box-content:hover .blog-img {
        transform: none;
    }
}

/* 超小屏幕设备 (< 400px) */
@media (max-width: 399.98px) {
    #homeBlogSection {
        padding: 2rem 0;
    }

    /* 标题 */
    #homeBlogSection .section-title {
        padding-bottom: 1.5rem !important;
    }

    #homeBlogSection .section-title .title {
        font-size: 1.25rem !important;
    }

    /* 左侧大图 */
    #homeBlogLeft {
        margin-bottom: 1rem;
    }

    #homeBlogLeft .blog-box {
        min-height: 180px;
        max-height: 220px;
    }

    /* 右侧列表间距 */
    #homeBlogRight {
        gap: 0.75rem;
    }

    #homeBlogRight .blog-box-content {
        min-height: 80px;
        padding: 0.5rem !important;
        margin-bottom: 0.5rem;
    }

    /* 图片尺寸 */
    #homeBlogRight .blog-img {
        width: 60px !important;
        height: 60px !important;
        margin-right: 0.625rem !important;
    }

    /* 文字大小 */
    #homeBlogRight h5 {
        font-size: 0.8rem !important;
    }

    #homeBlogRight .list-inline-item {
        font-size: 0.7rem !important;
    }
}

/* 横屏模式优化 */
@media (max-width: 767.98px) and (orientation: landscape) {
    #homeBlogLeft .blog-box {
        min-height: 200px;
        max-height: 250px;
    }

    #homeBlogRight .blog-box-content {
        min-height: 70px;
    }

    #homeBlogRight .blog-img {
        width: 60px !important;
        height: 60px !important;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    /* 移除悬停动画效果 */
    #homeBlogLeft .blog-box:hover,
    #homeBlogRight .blog-box-content:hover {
        transform: none !important;
    }

    #homeBlogLeft .blog-box:hover img,
    #homeBlogRight .blog-box-content:hover .blog-img {
        transform: none !important;
    }

    /* 增加点击区域 */
    #homeBlogRight h5 a {
        display: block;
        padding: 0.25rem 0;
    }
}

/* 性能优化 - 减少移动端动画 */
@media (max-width: 767.98px) {
    /* 简化动画 */
    #homeBlogLeft .blog-box,
    #homeBlogRight .blog-box-content {
        animation: none !important;
    }

    /* 使用简单的淡入效果 */
    #homeBlogSection.animated #homeBlogLeft .blog-box,
    #homeBlogSection.animated #homeBlogRight .blog-box-content {
        animation: simpleFadeIn 0.4s ease-out !important;
    }
}

@keyframes simpleFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 确保图片不变形 */
@media (max-width: 767.98px) {
    #homeBlogLeft .blog-box img,
    #homeBlogRight .blog-img {
        object-fit: cover !important;
        object-position: center !important;
    }
}

/* 移动端滚动优化 */
@media (max-width: 767.98px) {
    #homeBlogRight {
        /* 如果内容过多，允许垂直滚动 */
        /*max-height: 400px;*/
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

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

    #homeBlogRight::-webkit-scrollbar-thumb {
        background: var(--primary-alpha-20);
        border-radius: 2px;
    }
}