* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
}


/* 平板端 (768px-1199px)：3列 */
@media (max-width: 1200px) and (min-width: 768px) {
    .news-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 18px;
    }
}

/* 手机端和小平板 (459px-767px)：最低保证3列 */
@media (max-width: 767px) and (min-width: 460px) {
    .news-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 15px;
    }
}

/* 小屏手机 (<=459px)：最低保证2列 */
@media (max-width: 459px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }
}

/* 超小屏幕 (<=359px)：单卡片限制 */
@media (max-width: 359px) {
    .news-grid {
        grid-template-columns: repeat(1, 1fr) !important;
        gap: 10px;
    }
}

/* 顶部导航栏固定样式 */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #f0f2f5;
    padding: 10px 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    margin-bottom: 0 !important;
    max-width: 1200px;
    margin: 0 auto !important;
}

/* 调整容器内边距，避免内容被固定导航栏遮挡 */
.container {
    padding-top: 200px !important;
    /* 修复：确保足够的顶部内边距，避免被固定导航栏遮挡 */
}

body {
    font-family: Arial, "Microsoft YaHei", sans-serif;
    background-color: #f0f2f5;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 28px;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 强制桌面端始终显示5列的覆盖规则 */
@media (min-width: 1201px) {
    .news-grid {
        grid-template-columns: repeat(5, 1fr) !important;
        /* 桌面端强制5列 */
        gap: 20px !important;
    }
}

/* 1200px以下逐步响应 */
@media (max-width: 1200px) {

    /* 默认显示4列，但因为嵌套规则，不会覆盖3列设置 */
    .news-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 18px !important;
    }
}

.news-card {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.news-card:hover {
    background-color: #f8f9fa;
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.card-content h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: #2c3e50;
}

.card-content p {
    font-size: 12px;
    line-height: 1.4;
    color: #666;
    word-break: break-all;
    margin-bottom: 8px;
}

/* 卡片描述样式 */
.card-description {
    font-size: 12px;
    line-height: 1.4;
    color: #666;
    margin-top: 8px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.search-container {
    text-align: center;
    margin-bottom: 30px;
}

.search-box {
    display: inline-flex;
    margin-bottom: 15px;
}

.search-box input {
    width: 400px;
    height: 40px;
    padding: 0 15px;
    border: 2px solid #e0e0e0;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-box input:focus {
    border-color: #3498db;
}

.search-box button {
    height: 40px;
    padding: 0 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-box button:hover {
    background-color: #2980b9;
}

.search-tags {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.search-tags a {
    padding: 5px 12px;
    background-color: #e0e0e0;
    /* background-color: #f0f0f0; */
    color: #333;
    text-decoration: none;
    border-radius: 15px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-tags a:hover {
    background-color: rgba(0, 120, 215, 0.3);
    /* background-color: #e0e0e0; */
}

.search-tags a.active {
    background: rgba(0, 120, 215, 0.3);
    color: white;
}

.category-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto 10px auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.tab {
    padding: 6px 16px;
    margin: 5px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.tab:hover {
    background-color: #f5f5f5;
}

.tab.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

/* 新闻导航区域样式 */
.news-navigation {
    background-color: #e9ecef;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

/* 收藏按钮样式 */
.bookmark-button {
    padding: 8px 16px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.bookmark-button:hover {
    background-color: #2980b9;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.bookmark-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* 回到顶部按钮样式 */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 16px;
    width: 100px;
    height: 40px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 500;
    /* 降低层级 */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
}

.back-to-top:hover {
    background-color: #2980b9;
    transform: scale(1.1);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* 页脚 */
footer {
    background: rgba(255, 255, 255, 0.5);
    padding: 20px 0;
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

footer p {
    color: #666;
    font-size: 14px;
    transition: color 0.3s ease;
}

/* 基础响应式布局 - 桌面端5列，移动端最少3列 */
.news-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* 平板端 (1200px以下)到中等平板：4列 */
@media (max-width: 1200px) {
    .news-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 18px;
    }
}

/* 平板到宽手机 (768px-991px)：3列，保证最少展示 */
@media (max-width: 991px) and (min-width: 768px) {
    .news-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 15px;
    }
}

/* 手机端 (456px-767px)：保证最少显示3列 */
@media (max-width: 767px) and (min-width: 456px) {
    .news-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 12px;
    }
}

/* 手机端 (小于456px)：最少显示2列 */
@media (max-width: 455px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }

    .news-card {
        padding: 15px !important;
    }
}

/* 超小屏幕 (小于360px)：单行单卡片 */
@media (max-width: 359px) {
    .news-grid {
        grid-template-columns: repeat(1, 1fr) !important;
        gap: 8px;
    }
}

/* 优化分类标签显示 - 确保两行内显示 */
@media (max-width: 768px) {

    /* 重置导航栏定位 */
    .top-nav {
        position: fixed !important;
        /* 恢复固定定位 */
        margin-bottom: 0 !important;
        padding: 15px 10px !important;
    }

    /* 恢复容器内边距 */
    .container {
        padding: 200px 10px 20px 10px !important;
        /* 增加顶部内边距 */
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* 分类标签区域优化 - 两行显示且居中 */
    .category-tabs {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        /* 关键：居中显示 */
        gap: 8px 10px !important;
        /* 设置行列间距 */
        max-height: 80px !important;
        /* 限制最大高度两行 */
        overflow: hidden !important;
        /* 超出隐藏 */
        margin-bottom: 10px !important;
        padding: 5px 20px !important;
        /* 左右内边距 */
    }
}

.tab {
    padding: 5px 12px !important;
    margin: 0 2px !important;
    font-size: 12px !important;
    flex: 0 0 auto !important;
    /* 不伸缩，固定大小 */
    min-width: 60px !important;
    max-width: none !important;
    /* 移除宽度限制 */
    text-align: center !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    /* 不允许换行 */
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    /* 超出显示省略号 */
}

/* 特殊优化长标签 */
.tab[data-category="health"] {
    max-width: 50% !important;
}

.tab[data-category="travel"] {
    max-width: 35% !important;
}

/* 隐藏滚动条 */
.category-tabs::-webkit-scrollbar {
    display: none !important;
}

/* 分类标签区域优化 */
.category-tabs {
    margin-bottom: 20px !important;
    gap: 8px !important;
    justify-content: flex-start !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 5px 0 !important;
    scrollbar-width: none !important;
}

.category-tabs::-webkit-scrollbar {
    display: none !important;
}

.tab {
    padding: 5px 12px !important;
    margin: 0 !important;
    font-size: 12px !important;
    flex-shrink: 0 !important;
}

/* 修复网格布局 */
.news-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
    margin-top: 0 !important;
}

.news-card {
    padding: 15px !important;
}

/* 修复文字竖向显示 */
.nav-item .text {
    font-size: 12px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
}

h1 {
    font-size: 20px !important;
}

.logo-area {
    flex-wrap: wrap !important;
}

.nav-buttons {
    margin-top: 10px !important;
}

@media (max-width: 480px) {
    .category-tabs {
        gap: 6px !important;
        max-height: 70px !important;
    }

    .tab {
        padding: 5px 8px !important;
        font-size: 11px !important;
    }

    .news-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        /* 保证最少3列 */
        gap: 10px !important;
    }

    .container {
        padding: 15px 10px !important;
        /* 增加左右内边距 */
    }

    h1 {
        font-size: 18px !important;
    }
}


/* 移动端适配样式 */
@media (max-width: 768px) {

    /* 修复顶部导航栏文字竖向显示问题 */
    .top-nav>div {
        flex-direction: column !important;
        gap: 10px;
        padding: 10px 15px !important;
    }

    .top-nav>div>div:first-child {
        flex-direction: row !important;
        flex-wrap: wrap;
        width: 100%;
        justify-content: center !important;
    }

    h1 {
        font-size: 20px !important;
        margin: 0 !important;
    }

    .news-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .nav-item {
        padding: 8px !important;
    }

    .nav-item .logo {
        width: 24px !important;
        height: 24px !important;
    }

    .nav-item .text {
        font-size: 12px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        writing-mode: horizontal-tb !important;
        text-orientation: mixed !important;
    }

    .container {
        padding: 150px 10px 20px 10px !important;
    }

    .top-nav {
        padding: 10px 10px !important;
    }
}

@media (max-width: 768px) {
    .container {
        padding-top: 140px !important;
        /* 导航栏60px + 两行标签50px + 间距30px */
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}

@media (max-width: 480px) {

    /* 小屏幕进一步优化 */
    .category-tabs {
        gap: 4px !important;
        max-height: 65px !important;
    }

    .tab {
        padding: 3px 6px !important;
        font-size: 10px !important;
        max-width: 48% !important;
    }

    /* 修正：小屏手机始终保证2-3列 */
    .news-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        /* 默认小屏2列 */
        gap: 10px !important;
    }

    /* 376px-480px ：条件性显示3列 (足够宽度) */
    @media (min-width: 376px) {
        .news-grid {
            grid-template-columns: repeat(3, 1fr) !important;
            /* 更宽时保证3列 */
            gap: 12px !important;
        }
    }

    .container {
        padding-top: 140px !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    h1 {
        font-size: 18px !important;
    }
}

/* 🔧 重点修复：桌面端强制保证5列显示 + 搜索栏可见性 */
@media (min-width: 768px) {
    .news-grid {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 20px !important;
        max-width: 1200px !important;
        margin: 0 auto !important;
        padding: 0 20px !important;
    }

    /* 桌面端搜索栏无需特别移位，但确保容器正常工作 */
    .search-container {
        position: relative;
        z-index: auto;
        display: block !important;
        /* 确保可见 */
        visibility: visible !important;
        /* 保证不被隐藏 */
        opacity: 1 !important;
    }

    /* 额外明确：粉碎任何可能存在的隐藏规则 */
    .search-container::before,
    .search-container::after {
        display: none !important;
        content: none !important;
    }
}

/* 🚫 清除浮动和层叠问题 - 在桌面端 */
@media screen and (min-width: 768px) {

    /* 搜索栏强制凸顯 */
    .search-container {
        clear: both !important;
        position: static !important;
        display: block !important;
        float: none !important;
        overflow: visible !important;
        opacity: 1 !important;
    }

    /* 修复搜索框内元素布局 */
    .search-container * {
        display: inline-block !important;
    }

    .search-box {
        display: inline-flex !important;
    }

    .search-box input {
        display: block !important;
    }

    .search-box button {
        display: block !important;
    }

    .search-tags {
        display: flex !important;
    }

    .search-tags a {
        display: block !important;
    }
}

/* 🔧 修复搜索框和按钮不可见问题 */
.search-container {
    display: block !important;
    position: static !important;
    visibility: visible !important;
    opacity: 1 !important;
    clear: both !important;
    text-align: center !important;
    /* 重置任何可能的重叠 */
    z-index: auto !important;
    transform: none !important;
}

/* 修复搜索框和按钮 */
.search-box {
    display: inline-flex !important;
    visibility: visible !important;
    position: relative !important;
    z-index: 1 !important;
}

.search-box input {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.search-box button {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* 修复搜索标签按钮成一行显示 */
.search-tags {
    display: flex !important;
    /* 保证flex布局 */
    flex-direction: row !important;
    /* 水平排列 */
    justify-content: center !important;
    /* 居中对齐 */
    align-items: center !important;
    /* 垂直居中 */
    gap: 10px !important;
    /* 间距 */
    flex-wrap: nowrap !important;
    /* 不换行，确保一行显示 */
    white-space: nowrap !important;
    /* 禁止换行 */
}

.search-tags a {
    flex: 0 0 auto !important;
    /* 不拉伸，固定大小 */
    white-space: nowrap !important;
    /* 文字不换行 */
    min-width: fit-content !important;
    /* 根据内容调整宽度 */
}

/* 🔧 搜索栏遮罩修复：移动端不使用固定定位 */

/* 提升级搜索栏保护 - 任何OWF加持（带遮罩都会破）*/
.search-container {
    position: static !important;
    z-index: auto !important;
    display: block !important;
    float: none !important;
    overflow: visible !important;
    opacity: 1 !important;
    transform: none !important;
    clip: auto !important;
    clip-path: none !important;
    will-change: auto !important;
}

/* 终极搜索栏一切可见（最高优先级）*/
body>.search-container {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    transform: none !important;
}

/*🔔 特别修复：防止搜索元素被隐藏或错位 */
.search-container *,
.search-box *,
.search-tags * {
    visibility: visible !important;
    position: static !important;
    opacity: 1 !important;
}

/* 确保搜索框水平布局 */
.search-box {
    display: inline-flex !important;
}

.search-box input {
    display: block !important;
}

.search-box button {
    display: block !important;
}

/* 确保搜索标签水平布局 */
.search-tags {
    display: flex !important;
    justify-content: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
}

.search-tags a {
    display: block !important;
}

@media (max-width: 767px) {
    .top-nav {
        position: static !important;
        margin-bottom: 25px !important;
    }

    .container {
        padding-top: 0 !important;
    }


    /* 桌面端额外明确规则 - 保护搜索栏显示 */
    /* 专拱桌面端访问时显示5列和正常搜索栏 */
    @media (min-width: 768px) {

        /* 可视化搜索栏保护 */
        .search-container {
            display: block !important;
            visibility: visible !important;
            opacity: 1 !important;
            position: relative !important;
            width: 100% !important;
            text-align: center !important;
            top: auto !important;
            left: auto !important;
            transform: none !important;
        }

        /* 确保不会被之前的内边距规则影响 */
        .container>.search-container {
            margin: 0 auto 30px auto !important;
            position: relative !important;
            float: none !important;
        }
    }
}