/* ============================================================
 * 网址导航页专用样式（links.css）
 * 仅服务于 https://cadsee.cn/links 顶部搜索模块
 * 梦幻浅蓝风格（2026-10-22 更新，功能与 HTML/JS 结构不变）
 * 作用域全部以 ji- 前缀隔离，不影响主题其他模块
 * ============================================================ */

/* 顶部背景：背景图片(全宽) + 深色半透明蒙层，保证文字可读 */
.ji-header-big{
    position: relative;
    background-color: #1a2333;
    background-image:
        linear-gradient(to bottom, rgba(0,0,0,.45), rgba(0,0,0,.45)),
        url('images/links-bg.jpg') !important;
    background-size: auto, cover !important;
    background-position: center;
    background-repeat: no-repeat;
    padding-top: 90px;
    padding-bottom: 90px;
    margin-top: -20px;
    margin-bottom: 1.5rem;
}
.ji-gradient-linear{
    display: none;
}
.ji-s-search{
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}
/* 搜索模块字体统一为子主题全局字体（MiSans 栈，覆盖父主题对 input 的单独字体设置） */
.ji-header-big,
.ji-header-big input,
.ji-header-big button,
.ji-header-big label,
.ji-header-big .ji-s-search{
    font-family: "MiSans", "PingFang SC", "Noto Sans", "Noto Sans CJK SC", "Source Han Sans", "Source Han Sans SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
}
.ji-s-type{
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}
/* 顶部大类标签（nav-tabs 风格） */
.ji-s-type-list{
    display: flex;
    justify-content: center;
    gap: 40px;
    position: relative;
    overflow-x: auto;
    padding-bottom: 10px;
}
.ji-s-type-list::-webkit-scrollbar{ display: none; }
.ji-s-type-list label{
    font-size: var(--fs-lg);
    letter-spacing: 1px;
    color: rgba(255,255,255,.85);
    cursor: pointer;
    font-weight: 500;
    /* padding-bottom: 8px; */
    position: relative;
    user-select: none;
    transition: color .3s ease;
}
.ji-s-type-list label:hover{
    color: #fff;
    font-weight: 700;
}
.ji-s-type-list label.active{
    color: #fff;
    font-weight: 700;
}
/* 底部滑动指示条 */
.ji-s-type-list .ji-anchor{
    position: absolute;
    bottom: 0;
    height: 3px;
    background: #fff;
    border-radius: var(--b2radius);
    transition: all .3s cubic-bezier(.25,.8,.25,1);
    left: 0;
    width: 0;
    opacity: 0;
}
/* 搜索框容器（search-container 风格） */
.ji-super-search-fm{
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #dbeafe;
    border-radius: var(--b2radius);
    padding: 4px;
    box-shadow: 0 4px 20px rgba(148,163,184,.15);
    transition: all .3s ease;
}
.ji-super-search-fm:focus-within{
    box-shadow: 0 8px 30px rgba(148,163,184,.25), 0 0 0 3px rgba(59,130,246,.15);
    border-color: #bfdbfe;
    background: #ffffff;
}
/* 输入框 */
.ji-super-search-fm input{
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    height: 30px;
    padding: 0 14px;
    font-size: 14px;
    color: #1e293b;
    background: transparent;
}
.ji-super-search-fm input::placeholder{ color: #94a3b8; font-weight: 500; }
/* 右侧渐变按钮 */
.ji-super-search-fm button{
    border: none;
    background: linear-gradient(90deg, #3b82f6 0%, #06b6d4 100%);
    color: #fff;
    padding: 0 20px;
    height: 32px;
    border-radius: var(--b2radius);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .5px;
    cursor: pointer;
    transition: all .3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(59,130,246,.2);
}
.ji-super-search-fm button:hover{
    background: linear-gradient(90deg, #2563eb 0%, #0891b2 100%);
    box-shadow: 0 6px 15px rgba(59,130,246,.35);
}
.ji-super-search-fm button:active{
    transform: scale(.98) translateY(0);
}
/* ===== 添加导航按钮（绿色，紧贴搜索按钮右侧）===== */
.ji-super-search-fm .ji-addnav-btn{
    border: none;
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    margin-left: 8px;
    padding: 0 16px;
    height: 32px;
    border-radius: var(--b2radius);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .5px;
    cursor: pointer;
    transition: all .3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex: 0 0 auto;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(22,163,74,.2);
}
.ji-super-search-fm .ji-addnav-btn:hover{
    background: linear-gradient(90deg, #16a34a 0%, #15803d 100%);
}
.ji-super-search-fm .ji-addnav-btn:active{ transform: scale(.98) translateY(0); }
/* 我的导航头部按钮组：添加导航（绿）+ 编辑 */
.ji-mynav-actions{
    display: flex;
    align-items: center;
    gap: 8px;
}
.ji-mynav-actions .ji-addnav-btn{
    border: none;
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    padding: 0 14px;
    height: 28px;
    border-radius: var(--b2radius);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .3px;
    cursor: pointer;
    transition: all .2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(22,163,74,.18);
}
.ji-mynav-actions .ji-addnav-btn:hover{
    background: linear-gradient(90deg, #16a34a 0%, #15803d 100%);
}
/* 我的导航：添加导航按钮禁用态（满 12 个） */
.ji-mynav-actions .ji-addnav-btn:disabled,
.ji-mynav-actions .ji-addnav-btn:disabled:hover{
    background: #d1d5db;
    color: #9ca3af;
    box-shadow: none;
    transform: none;
    cursor: not-allowed;
}
/* 编辑模式：卡片加号禁用态（满 12 个） */
.ji-mynav-add:disabled{
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}
/* ===== 我的导航：未登录提示 ===== */
.ji-mynav-guest{
    padding: 18px 10px 14px;
    text-align: center;
}
.ji-mynav-guest-icon{
    display: inline-flex;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #f0fdf4;
    color: #22c55e;
    font-size: 22px;
    align-items: center;
    justify-content: center;
}
.ji-mynav-guest-text{
    margin: 10px auto 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.7;
    max-width: 260px;
}
/* ===== 弹窗：图标行（输入框 + 自动获取按钮） ===== */
.ji-addnav-iconrow{
    display: flex;
    gap: 8px;
}
.ji-addnav-iconrow input{ flex: 1; min-width: 0; }
.ji-addnav-favicon{
    flex: 0 0 auto;
    height: 38px;
    padding: 0 14px;
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #16a34a;
    border-radius: var(--b2radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}
.ji-addnav-favicon:hover{
    background: #dcfce7;
    border-color: #86efac;
}
/* ===== 添加导航弹窗 ===== */
.ji-addnav-mask{
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.ji-addnav-pop{
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: var(--b2radius);
    padding: 22px 24px 18px;
    box-shadow: 0 12px 40px rgba(0,0,0,.18);
}
.ji-addnav-title{
    font-size: 17px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 16px;
}
.ji-addnav-field{
    margin-bottom: 12px;
}
.ji-addnav-field label{
    display: block;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 5px;
    font-weight: 500;
}
.ji-addnav-field input,
.ji-addnav-field select{
    width: 100%;
    box-sizing: border-box;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #e2e8f0;
    border-radius: var(--b2radius);
    font-size: 14px;
    color: #1e293b;
    background: #fff;
    outline: none;
}
.ji-addnav-field input:focus,
.ji-addnav-field select:focus{
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34,197,94,.12);
}
.ji-addnav-msg{
    min-height: 20px;
    font-size: 13px;
    color: #dc2626;
    margin: 2px 0 8px;
}
.ji-addnav-btns{
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.ji-addnav-btns button{
    border: none;
    border-radius: var(--b2radius);
    height: 36px;
    padding: 0 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}
.ji-addnav-cancel{
    background: #f1f5f9;
    color: #475569;
}
.ji-addnav-cancel:hover{ background: #e2e8f0; }
.ji-addnav-ok{
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
}
.ji-addnav-ok:hover{ background: linear-gradient(90deg, #16a34a 0%, #15803d 100%); }
.ji-addnav-ok:disabled{ opacity: .6; cursor: not-allowed; }
#ji-search-list{ margin-top: 15px; }
.ji-search-group{ display: none; }
.ji-search-group.ji-s-current{ display: block; }
.ji-search-type{
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.ji-search-type li input[type="radio"]{ display: none; }
/* 引擎标签（engine-tag 风格）：透明黑底 + 白字 */
.ji-search-type li label{
    display: block;
    padding: 8px 24px;
    border-radius: var(--b2radius);
    font-size: var(--fs-xs);
    color: #fff;
    background-color: rgba(0,0,0,.45);
    /* border: 1px solid rgba(255,255,255,.25); */
    cursor: pointer;
    transition: all .3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,.08);
    font-weight: 500;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.ji-search-type li label:hover{
    background-color: rgb(0 0 0 / 15%);
    border-color: rgba(255,255,255,.45);
    color: #fff;
}
.ji-search-type li input[type="radio"]:checked + label{
    background-color: rgba(0,0,0,.8);
    color: #fff;
    font-weight: bold;
    border-color: rgba(255,255,255,.55);
    box-shadow: 0 4px 12px rgba(0,0,0,.35);
}
@media (max-width: 720px){
    .ji-header-big{ padding-top: 50px; padding-bottom: 50px; }
    .ji-s-type-list{ gap: 20px; }
    .ji-s-type-list label{ font-size: 14px; }
    .ji-super-search-fm{ padding: 3px; border-radius: var(--b2radius); }
    .ji-super-search-fm input{ height: 30px; padding: 0 12px; font-size: 14px; }
    .ji-super-search-fm button{ padding: 0 14px; height: 30px; font-size: 13px; }
    .ji-super-search-fm .ji-addnav-btn{ margin-left: 6px; padding: 0 10px; height: 30px; font-size: 13px; }
    .ji-super-search-fm .ji-addnav-btn span{ display: none; }
    .ji-mynav-actions .ji-addnav-btn{ padding: 0 10px; height: 26px; font-size: 12px; }
    .ji-search-type li label{ padding: 6px 16px; font-size: 13px; }
}

/* ============================================================
 * 我的导航（ji-mynav）：登录用户的网址收藏
 * 编辑模式：#links.ji-editing 显示卡片加号，chips 显示删除按钮
 * 注：区块在模板中位于 .home-links-content 之前（#primary-home 内），
 *     不影响原 flex 两栏布局
 * ============================================================ */
.ji-mynav{
    background: #fff;
    border-radius: var(--b2radius);
    padding: 16px 18px 14px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,.04);
}
.ji-mynav-head{
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.ji-mynav-title{
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ji-mynav-count{
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: var(--b2radius);
    background: #f43f3f;
    color: #fff;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
    display: inline-block;
}
.ji-mynav-edit{
    border: none;
    background: #f43f3f;
    color: #fff;
    font-size: 13px;
    padding: 5px 16px;
    border-radius: var(--b2radius);
    cursor: pointer;
    transition: all .2s;
}
.ji-mynav-edit:hover{ background: #d63030; }
.ji-mynav.ji-editing .ji-mynav-edit{ background: #3a3a3a; }
.ji-mynav-list{
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    overflow: visible;
    padding-top: 20px;
}
.ji-mynav-item{
    position: relative;
    min-width: 0;
    background: #f7f8fa;
    border: 1px solid #eee;
    border-radius: var(--b2radius);
    padding: 8px 10px;
}
.ji-mynav-item > a{
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #333;
}
.ji-mynav-icon{
    width: 26px;
    height: 26px;
    border-radius: var(--b2radius);
    object-fit: cover;
    flex: 0 0 auto;
}
.ji-mynav-noicon{
    width: 26px;
    height: 26px;
    border-radius: var(--b2radius);
    background: var(--b2color);
    color: #fff;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}
.ji-mynav-name{
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* 待审核角标：非 publish 状态的收藏显示 */
.ji-mynav-pending{
    flex: 0 0 auto;
    margin-left: auto;
    padding: 1px 6px;
    border-radius: var(--b2radius);
    background: #f59e0b;
    color: #fff;
    font-size: 10px;
    line-height: 1.5;
    white-space: nowrap;
}
.ji-mynav-del{
    display: none;
    position: absolute;
    top: -7px;
    right: -7px;
    width: 18px;
    height: 18px;
    line-height: 16px;
    border: none;
    border-radius: 50%;
    background: #f43f3f;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    z-index: 3;
}
.ji-mynav-item:hover .ji-mynav-del,
.ji-mynav.ji-editing .ji-mynav-del{
    display: block;
}

/* ===== 编辑模式下链接卡片的加号按钮 ===== */
.home-links-content .link-in{ position: relative; }
.link-in .ji-mynav-add{
    display: none;
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: var(--b2color);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    z-index: 5;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
#links.ji-editing .link-in .ji-mynav-add{
    display: inline-flex;
}
.link-in .ji-mynav-add.ji-added{
    background: #34a853;
}
@media (max-width: 720px){
    .ji-mynav{ padding: 12px 12px 10px; }
    .ji-mynav-list{ grid-template-columns: repeat(3, 1fr); }
    /* 网址卡片移动端：每行 2 个（覆盖 PHP 注入的内联宽度） */
    .links-home .link-list li{ width: 50% !important; }
}

/* ============================================================
 * 分类图标：后台「专题/分类/商城标签设置」设置的 ICON 图标/图片
 * 显示在右侧模块标题与左侧导航分类前
 * ============================================================ */
.links-home .link-title h2{
    display: flex;
    align-items: center;
    gap: 8px;
}
.links-home .ji-cat-icon{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}
.links-home .ji-cat-icon i{
    font-size: 20px;
    line-height: 1;
    color: var(--b2color);
}
.links-home .ji-cat-icon .ji-term-image{
    width: 22px;
    height: 22px;
    object-fit: cover;
    border-radius: var(--b2radius);
    display: block;
}
/* 左侧导航分类图标（tocbot 复制 h2 内容，含图标）；图标与文字中线对齐 */
.links-home .b2-tab-link-in .toc-list .toc-link{
    display: flex !important;
    align-items: center;
    line-height: 1.6;
}
.links-home .b2-tab-link-in .toc-list .toc-link .ji-cat-icon{
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-right: 6px;
}
.links-home .b2-tab-link-in .toc-list .toc-link .ji-cat-icon i{
    font-size: 14px;
    line-height: 1;
    color: var(--b2color);
}
.links-home .b2-tab-link-in .toc-list .toc-link .ji-cat-icon .ji-term-image{
    width: 16px;
    height: 16px;
    object-fit: cover;
    border-radius: var(--b2radius);
    display: block;
}

/* ============================================================
 * 网址链接卡片：左侧图标 40x40（用户指定尺寸）
 * 仅作用于网址导航页，不改变其他模块
 * ============================================================ */
.links-home .link-in .link-img{
    width: 37px;
    height: 37px;
    flex-shrink: 0;
    object-fit: cover;
}
/* 取消卡片描述的上下间距（父主题 margin: 4px 0 8px） */
.links-home .link-desc{
    margin: 0;
}
/* 最后一个分类模块底部间距为 0 */
.links-home .home-links-right .link-box.mg-b:last-child{
    margin-bottom: 0;
}

/* ============================================================
 * 网址导航左侧分类侧边栏：统一背景 + 文字居中（不改结构）
 * 父主题原为右对齐（.toc-list text-align:right; margin-right:32px）
 * ============================================================ */
.links-home .b2-tab-links{
    /* 外层由 B2 StickySidebar 管理（固定内部 .inner-wrapper-sticky），保持原结构 */
    width: 160px;
    min-width: 160px;
}
/* B2 滚动固定层：白卡背景，滚动时左侧始终可见（铺满可视高度） */
.links-home .inner-wrapper-sticky{
    background: #fff;
    border-radius: var(--b2radius);
    padding: 16px 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,.04);
    min-height: calc(100vh - 140px);
}
/* 覆盖 JS 给 .site-content 设置的 inline transform（会破坏 sticky/fixed 的视口定位） */
body.archive .site-content{
    transform: none !important;
}
.links-home .b2-tab-links .toc-list{
    text-align: center;
    margin-right: 0;
}
.links-home .b2-tab-links .link-join{
    text-align: center;
}

/* ============================================================
 * 网址导航两栏布局与侧边栏排列（不改结构）
 * - 主内容区 flex 两栏（nowrap）
 * - 侧边栏 sticky 容器纵向排列、水平居中
 * - 取消"申请入驻"按钮
 * - 标题/统计去掉父主题的 margin-right:32px（配合居中）
 * ============================================================ */
.home-links-content{
    display: flex;
    flex-wrap: nowrap;
    gap: 20px;
    align-items: flex-start;
}
.inner-wrapper-sticky{
    display: flex;
    flex-direction: column;
    align-items: center;
}
.links-home .link-join{
    display: none;
}
.links-home h1,
.links-home .link-total{
    margin-right: 0;
}
