/* ============================================
   观澜Media 桌面端首页优化 CSS
   - 增强视觉层次和分隔
   - 优化卡片样式
   - 改善排版密度
   ============================================ */

/* ===== 1. Header 增强 ===== */
header.wp-block-template-part {
    border-bottom: 1px solid rgba(0,0,0,0.08) !important;
    position: sticky;
    top: 0;
    z-index: 9999;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

header.wp-block-template-part .wp-block-group {
    border-bottom: none !important;
}

@media (max-width: 600px) {
    header.wp-block-template-part {
        border-bottom: none !important;
    }
}

/* ===== 2. Section 标题样式 ===== */
main h2.wp-block-heading {
    position: relative;
    padding-bottom: 10px;
    margin-bottom: 16px !important;
}

main h2.wp-block-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 32px;
    height: 3px;
    background: var(--wp--preset--color--secondary, #e63946);
    border-radius: 2px;
}

/* ===== 3. 头条区域样式优化 ===== */
.toutiao-top-headlines {
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding-bottom: 16px !important;
    margin-bottom: 20px !important;
}

/* 大标题 hover 效果 */
.toutiao-headline-large h2 a {
    transition: color 0.2s ease;
}

.toutiao-headline-large:hover h2 a {
    color: var(--wp--preset--color--secondary, #e63946) !important;
}

/* 小标题 hover 效果 */
.toutiao-headline-small h2 a {
    transition: color 0.2s ease;
    position: relative;
    padding-left: 12px;
}

.toutiao-headline-small h2 a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: var(--wp--preset--color--secondary, #e63946);
    border-radius: 50%;
    opacity: 0.5;
}

.toutiao-headline-small:hover h2 a {
    color: var(--wp--preset--color--secondary, #e63946) !important;
}

/* ===== 4. 双栏小标题分隔线 ===== */
.wp-block-columns .wp-block-column .toutiao-headline-small:not(:last-child) {
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

/* ===== 5. 卡片 hover 效果 ===== */
.wp-block-post {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 8px;
    overflow: hidden;
}

.wp-block-post:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* 卡片图片圆角 */
.wp-block-post-featured-image img {
    border-radius: 6px;
    transition: transform 0.3s ease;
}

.wp-block-post:hover .wp-block-post-featured-image img {
    transform: scale(1.03);
}

/* ===== 6. 分类标签样式 ===== */
.wp-block-post-terms a {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 3px;
    background: rgba(230, 57, 70, 0.08);
    color: var(--wp--preset--color--secondary, #e63946) !important;
    text-decoration: none;
    transition: background 0.2s;
}

.wp-block-post-terms a:hover {
    background: rgba(230, 57, 70, 0.15);
}

/* ===== 7. 最新资讯 + 热门文章列表样式 ===== */
.wp-block-columns .wp-block-column .wp-block-query .wp-block-post {
    border-radius: 0;
    overflow: visible;
}

.wp-block-columns .wp-block-column .wp-block-query .wp-block-post:hover {
    transform: none;
    box-shadow: none;
}

.wp-block-columns .wp-block-column .wp-block-query .wp-block-post:not(:last-child) {
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding-bottom: 12px;
}

/* 侧栏小图片样式 */
.wp-block-columns .wp-block-column[style*="30%"] .wp-block-post-featured-image img {
    border-radius: 4px;
    width: 100%;
    height: auto;
    aspect-ratio: 3/2;
    object-fit: cover;
}

/* ===== 8. 标签云样式 ===== */
.wp-block-tag-cloud a {
    display: inline-block;
    padding: 3px 10px;
    margin: 3px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 14px;
    font-size: 11px !important;
    text-decoration: none;
    color: #555;
    transition: all 0.2s;
}

.wp-block-tag-cloud a:hover {
    background: var(--wp--preset--color--secondary, #e63946);
    color: #fff;
    border-color: var(--wp--preset--color--secondary, #e63946);
}

/* ===== 9. Footer 链接样式 ===== */
footer .wp-block-tag-cloud a {
    border-color: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.7);
}

footer .wp-block-tag-cloud a:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-color: rgba(255,255,255,0.4);
}

/* ===== 10. 全局链接过渡 ===== */
a {
    transition: color 0.2s ease;
}

/* ===== 11. 搜索按钮胶囊样式（保留） ===== */
.wp-block-search__button {
    border-radius: 20px !important;
}

/* ===== 12. 推荐区域背景微调 ===== */
main > .wp-block-group:nth-child(2) {
    background: rgba(0,0,0,0.01);
    border-radius: 8px;
    padding-top: 16px;
    padding-bottom: 16px;
}

/* ===== 13. 底部版权区域 ===== */
footer .has-black-background-color {
    background-color: #111 !important;
}

/* ===== 响应式：移动端不应用这些样式 ===== */
@media (max-width: 768px) {
    header.wp-block-template-part {
        position: relative;
        backdrop-filter: none;
    }
    
    .wp-block-post:hover {
        transform: none;
        box-shadow: none;
    }
    
    .wp-block-post:hover .wp-block-post-featured-image img {
        transform: none;
    }
    
    .toutiao-headline-small h2 a {
        padding-left: 0;
    }
    
    .toutiao-headline-small h2 a::before {
        display: none;
    }
}
