/*
 * 场景三：资料地图页 Tab 显隐与宽度适配
 * 版本：v1.0.0（2026-11-18）
 * 上传位置：OSS UIA/news/service/css/tab-visibility-v1.0.0.css
 *
 * 版本约定：样式变更时递增版本号（v1.0.1 / v1.0.2 ...），
 * 同步修改文件名与 5 个模板中的 <link> 引用，避免 CDN 缓存旧样式。
 *
 * 引入顺序要求：必须放在页面主样式之后（同优先级下后加载者生效）。
 *
 * Figma 标注：
 *   PC：Width Fixed 1440px / Height 60px / Radius 4px / BG #F7F7F7
 *       文字 20px / 行高 27px / Bold 700 / 居中
 *       分隔线 1px × 32px
 *   移动端：Width Fill 375px / Height 41px / Radius 4px / BG #F7F7F7
 *           容器左右留白 20px（margin，白底）
 *           Tab 与下方内容间距 20px
 *           Tab 间距 10px，文字 16px / 行高 17px / Regular 400 / 居中
 *           分隔线 1px × 24px
 *
 * 选项卡四边无边框；分隔线只出现在未选中项之间。
 * 容器不加 padding：选中红块直接贴灰底边缘。
 * 移动端标题栏「+ 订阅」按钮与标题左边缘对齐。
 */

/* ---------- Tab 容器 ---------- */
.tab1 {
    display: flex;
    background: #F7F7F7;
    border-radius: 4px;
    overflow: hidden;
    padding: 0 !important;
    /* 防止各页主样式对容器限高后，overflow:hidden 把 60px 的 <a> 裁切成不同高度 */
    height: auto !important;
    min-height: 60px !important;
    max-height: none !important;
}

/* 文档页：标题区下方空隙较小，Tab 比视频页高约 23px；全局下移对齐（PC + 移动端）。
   软件页同为 .lx-page4>.com-content，但其 .flex 带 tab-flex-full，用 :not() 排除，避免误伤 */
.lx-page4 .com-content .flex:not(.tab-flex-full) .tab1 {
    margin-top: 43px !important;
}

/* ---------- Tab 项：等分 + 文字水平/垂直居中，四边无边框 ---------- */
.tab1 > a,
.tab1 > a.on,
.tab1 > a:not(.on) {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px !important;
    padding: 0 8px !important;
    box-sizing: border-box;
    font-size: 20px !important;
    line-height: 27px !important;
    font-weight: 700 !important;
    letter-spacing: 0;
    text-align: center !important;
    text-indent: 0 !important;
    white-space: nowrap;
    border: 0 !important;
    box-shadow: none !important;
}

/* 选中 Tab：红底四角 4px 圆角 */
.tab1 > a.on {
    border-radius: 4px !important;
}

/* 未选中 Tab：字重 400、字体色 #2A2B2E（选中项 .on 为红底白字、字重 700，不受影响） */
.tab1 > a:not(.on) {
    font-weight: 400 !important;
    color: #2A2B2E !important;
}

/* ---------- 分隔线：仅在「未选中项左侧」绘制 ---------- */
.tab1 > a:not(.on):not(:first-child)::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 1px;
    height: 32px;
    margin-top: -16px;
    background: #E3E5E6;
    pointer-events: none;
}

/* 前一项是选中项时，该项左侧不显示竖线（即选中项右侧无线） */
.tab1 > a.on + a:not(.on)::before {
    display: none;
}

/* ---------- 内容区占满：右栏业务块已注释，分享块浮动到右上 ---------- */
.tab-flex-full {
    position: relative;
}

.tab-flex-full > .left {
    width: 100% !important;
    flex: 1 1 100%;
}

.tab-flex-full > .tab-share-float {
    position: absolute;
    top: 0;
    right: 0;
    width: auto !important;
    height: auto !important;
    z-index: 20;
}

.tab-share-float > div {
    width: 160px !important;
    height: auto !important;
}

/* 空态 */
.nodata {
    padding: 40px 0;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* ---------- 移动端 ---------- */
@media screen and (max-width: 750px) {
    /* 左右 margin 留白 20px（白底），上方与标题区间距 20px，底部与内容间距 20px */
    .tab1 {
        margin: 20px 20px 20px !important;
        padding: 0 !important;
        min-height: 41px !important;
    }

    /* 视频/公告/工具页父级 .z-content 自带约 15px 内边距，补偿到总留白一致 */
    .z-content .tab1 {
        margin: 20px 5px 20px !important;
        padding: 0 !important;
    }

    .tab1 > a,
    .tab1 > a.on,
    .tab1 > a:not(.on) {
        flex: 0 1 auto;
        height: 41px !important;
        padding: 0 !important;
        border-radius: 4px;
        font-size: 16px !important;
        line-height: 17px !important;
        font-weight: 400 !important;
    }

    /* 移动端分隔线 24px */
    .tab1 > a:not(.on):not(:first-child)::before {
        height: 24px;
        margin-top: -12px;
    }

    .tab-flex-full > .tab-share-float {
        position: static;
        width: 100% !important;
        height: auto !important;
    }

    .tab-share-float > div {
        width: 100% !important;
    }

    /* ---------- 标题栏：整体左移 20px，与下方内容/Tab 左边缘对齐 ---------- */
    .wd-title-bar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
        padding-left: 20px !important;
    }

    .wd-title-bar > .wd-subscribe-actions {
        margin-left: 0 !important;
        padding-left: 0 !important;
        float: none !important;
        text-align: left;
    }

    .wd-title-bar .wd-subscribe-btn {
        margin-left: 0 !important;
    }
}
