/**
 * B2Child 搜索模块样式
 * 原: b2child_search_module_center_css()
 * 
 * 搜索模块三列横排布局：LOGO - 搜索框 - 快讯
 * 参考 https://www.dny123.com/ 的布局
 * Version: 2.0
 */

/* wrapper容器改为横向grid布局 - 与下方网址导航区域对齐 */
/* 【居中核心】grid布局：侧边栏区域(152px+16px) + 内容区域(1fr) + 快讯区域(300px) */
.home_row.module-search > .wrapper {
    display: grid !important;
    grid-template-columns: 168px 1fr 300px !important;
    gap: 16px !important;
    align-items: center !important;
    max-width: 1600px !important;
    margin: 0 auto !important;
    padding: 30px 30px !important;
    box-sizing: border-box !important;
}

/* 左侧Logo列 - 与下方侧边栏左对齐 */
.home_row.module-search .search-module-logo-wrapper {
    grid-column: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    align-self: center !important;
    padding-top: 65px !important;
}

.home_row.module-search .search-module-logo-wrapper img {
    max-width: 100% !important;
    max-height: 160px !important;
    height: auto !important;
    width: auto !important;
    object-fit: contain !important;
}

.home_row.module-search .search-module-logo-wrapper .widget {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* 中间搜索框列 */
.home_row.module-search .home-row-left.content-area {
    grid-column: 2 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

.home_row.module-search .search-module {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

/* 搜索模块标题居中 */
.home_row.module-search .search-module-title {
    text-align: center !important;
    width: 100% !important;
}

/* 搜索模块描述居中 */
.home_row.module-search .search-module-desc {
    text-align: center !important;
    width: 100% !important;
}

/* 搜索框容器居中 */
.home_row.module-search .search-module-box {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
}

/* 优化搜索框内的"全部"按钮融入 */
.home_row.module-search .search-module-form {
    background: #ffffff !important;
    border-radius: 50px !important;
    overflow: hidden !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1) !important;
    display: flex !important;
    align-items: center !important;
}

.home_row.module-search .search-module-form > div {
    display: flex !important;
    align-items: center !important;
    flex: 1 !important;
}

.home_row.module-search .picked-category {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 12px 20px !important;
    margin: 0 !important;
    color: #093290 !important;
    font-weight: 600 !important;
    border-right: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.home_row.module-search .search-module-input {
    border: none !important;
    background: transparent !important;
    padding: 12px 20px !important;
    flex: 1 !important;
}

.home_row.module-search .search-button-action {
    background: #093290 !important;
    border: none !important;
    padding: 12px 24px !important;
    margin: 0 !important;
    border-radius: 0 50px 50px 0 !important;
}

/* 右侧快讯列 - 与内容区域右边缘对齐 */
.home_row.module-search .widget-area {
    grid-column: 3 !important;
    width: 300px !important;
    max-width: 300px !important;
    margin: 0 !important;
    justify-self: end !important;
}

/* 快讯小工具样式 - 只针对搜索模块中的快讯 */
.home_row.module-search .widget-area .widget_newsflash_widget {
    width: 100% !important;
    max-width: 300px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
    transition: none !important;
    display: block !important;
    height: auto !important;
}

/* 快讯头部容器 */
.home_row.module-search .widget-area .widget_newsflash_widget .newsflash-widget-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 12px 16px !important;
    background: linear-gradient(135deg, #0d47a1 0%, #093290 100%) !important;
    border: 1px solid #e5e7eb !important;
    border-bottom: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}

.home_row.module-search .widget-area .widget_newsflash_widget:hover .newsflash-widget-header {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1) !important;
}

/* 快讯标题 */
.home_row.module-search .widget-area .widget_newsflash_widget .widget-title {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* 快讯图标 */
.home_row.module-search .widget-area .widget_newsflash_widget .newsflash-icon {
    font-size: 18px !important;
    line-height: 1 !important;
    display: inline-block !important;
    animation: pulse 2s ease-in-out infinite !important;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* 更多链接 - 头部 */
.home_row.module-search .widget-area .widget_newsflash_widget .newsflash-widget-header .newsflash-more-link {
    font-size: 12px !important;
    font-weight: 600 !important;
    color: rgba(255, 255, 255, 0.9) !important;
    text-decoration: none !important;
    padding: 4px 10px !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.15) !important;
    transition: all 0.3s ease !important;
    white-space: nowrap !important;
}

.home_row.module-search .widget-area .widget_newsflash_widget .newsflash-widget-header .newsflash-more-link:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    transform: translateX(2px) !important;
}

/* 快讯容器 */
.home_row.module-search .widget-area .widget_newsflash_widget .newsflash-container {
    padding: 0 !important;
    height: 200px !important;
    max-height: 200px !important;
    overflow: hidden !important;
    position: relative !important;
    box-sizing: border-box !important;
    display: block !important;
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-top: none !important;
}

/* 快讯列表 - 高度自适应，由JS控制滚动 */
.home_row.module-search .widget-area .widget_newsflash_widget .newsflash-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 12px 16px !important;
    display: block !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
    position: relative !important;
    /* 移除固定高度，让内容撑开，由container的overflow:hidden裁剪 */
}

/* 快讯列表项 */
.home_row.module-search .widget-area .widget_newsflash_widget .newsflash-list li {
    display: flex !important;
    align-items: flex-start !important;
    gap: 10px !important;
    padding: 8px 0 !important;
    border-bottom: 1px solid #f3f4f6 !important;
    transition: background-color 0.2s ease, border-radius 0.2s ease !important;
    box-sizing: border-box !important;
}

.home_row.module-search .widget-area .widget_newsflash_widget .newsflash-list li:first-child {
    padding-top: 0 !important;
}

.home_row.module-search .widget-area .widget_newsflash_widget .newsflash-list li:last-child {
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

.home_row.module-search .widget-area .widget_newsflash_widget .newsflash-list li:hover {
    background: #f9fafb !important;
    border-radius: 6px !important;
}

/* 时间标签基础样式 */
.home_row.module-search .widget-area .widget_newsflash_widget .newsflash-time {
    font-size: 11px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    padding: 3px 8px !important;
    border-radius: 10px !important;
    white-space: nowrap !important;
    min-width: 60px !important;
    text-align: center !important;
    flex-shrink: 0 !important;
}

/* 热门快讯 - 1小时内 - 红色 */
.home_row.module-search .widget-area .widget_newsflash_widget .newsflash-time.time-hot {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3) !important;
}

/* 新快讯 - 24小时内 - 橙色 */
.home_row.module-search .widget-area .widget_newsflash_widget .newsflash-time.time-new {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(249, 115, 22, 0.3) !important;
}

/* 旧快讯 - 超过24小时 - 灰色 */
.home_row.module-search .widget-area .widget_newsflash_widget .newsflash-time.time-old {
    background: #e5e7eb !important;
    color: #6b7280 !important;
}

/* 快讯链接 */
.home_row.module-search .widget-area .widget_newsflash_widget .newsflash-list li a {
    flex: 1 !important;
    color: #1f2937 !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
    text-decoration: none !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    font-weight: 500 !important;
    transition: color 0.2s ease !important;
}

.home_row.module-search .widget-area .widget_newsflash_widget .newsflash-list li a:hover {
    color: #093290 !important;
}

/* 空状态 */
.home_row.module-search .widget-area .widget_newsflash_widget .newsflash-empty {
    color: #9ca3af !important;
    font-size: 13px !important;
    text-align: center !important;
    padding: 20px 0 !important;
}

/* 移动端响应式 */
@media (max-width: 968px) {
    .home_row.module-search > .wrapper {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    .home_row.module-search .search-module-logo-wrapper,
    .home_row.module-search .home-row-left.content-area,
    .home_row.module-search .widget-area {
        grid-column: 1 !important;
        max-width: 100% !important;
    }
}

/* 移动端快讯样式覆盖 */
@media (max-width: 768px) {
    /* 搜索框和快讯栏之间的间距 */
    .home_row.module-search > div.wrapper,
    .home_row.module-search > div[class*="wrapper"] {
        gap: 15px !important;
    }
    
    /* 快讯栏margin */
    #newsflash_widget-3 {
        margin: 0 !important;
    }
    
    /* 内容字体 */
    .home_row.module-search .widget-area .widget_newsflash_widget .newsflash-list li a {
        font-size: 12px !important;
    }
    
    /* 头部高度27px */
    .home_row.module-search .widget-area .widget_newsflash_widget .newsflash-widget-header {
        height: 27px !important;
        min-height: 27px !important;
        max-height: 27px !important;
        padding: 0 16px !important;
    }
    
    /* 内容区高度88px - 显示4行(每行22px) */
    .home_row.module-search .widget-area .widget_newsflash_widget .newsflash-container {
        height: 88px !important;
        max-height: 88px !important;
        min-height: 88px !important;
        overflow: hidden !important;
    }
    
    /* 列表padding - 参考TKFFF: 10px 16px */
    .home_row.module-search .widget-area .widget_newsflash_widget .newsflash-list {
        padding: 0 16px !important;
    }
    
    /* 每条高度22px（含2px间距）- 显示4行共88px */
    .home_row.module-search .widget-area .widget_newsflash_widget .newsflash-list li {
        height: 22px !important;
        max-height: 22px !important;
        line-height: 18px !important;
        padding: 2px 0 !important;
        margin: 0 !important;
        border-bottom: none !important;
        display: flex !important;
        align-items: center !important;
    }
    
    /* 标题样式 - 参考TKFFF */
    .home_row.module-search .widget-area .widget_newsflash_widget .widget-title {
        font-size: 15px !important;
        font-weight: 700 !important;
    }
    
    .home_row.module-search .widget-area .widget_newsflash_widget .newsflash-icon {
        font-size: 15px !important;
    }
    
    .home_row.module-search .widget-area .widget_newsflash_widget .newsflash-more-link {
        font-size: 12px !important;
        padding: 4px 12px !important;
    }
}
