/* CMS 搜索页（/search）结果页样式：左栏类型切换（全部 / API接口 / Skill技能 / 文章文档），右栏三段卡片
   PC 与 WAP 共用一份，移动端靠底部 media query 塌成单栏
   类名沿用 tag-* 前缀（页面根节点为 .tag-page.search-page），与 cms 标签无关
   主色走 var(--brand)：tabler 主题取品牌蓝，default(layui) 主题无该变量，回落到 layui 蓝 */
.tag-page {
    background: #fff;
    border-radius: 4px;
    /* 距顶部导航条留 10px 呼吸；外层 .main > .page-shell 没有上内边距，卡片原来是贴着导航的 */
    margin-top: 10px;
    padding: 6px 18px 24px;
    overflow: hidden;
}

.tag-crumb {
    font-size: 14px;
    color: #666;
    padding: 10px 0 4px;
    border-bottom: 1px solid #f0f0f0;
}

.tag-crumb a {
    color: #666;
}

.tag-crumb .sep {
    margin: 0 6px;
    color: #ccc;
}

.tag-crumb a:hover {
    color: var(--brand, #1E9FFF);
}

.tag-crumb .tag-crumb-cur {
    color: #333;
    font-weight: 600;
}

.tag-h1 {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    padding: 12px 0 6px;
    margin: 0;
}

.tag-h1 .tag-name {
    color: var(--brand, #1E9FFF);
}

.tag-h1 .tag-sum {
    font-size: 13px;
    font-weight: 400;
    color: #999;
    margin-left: 10px;
}

/* ---------- 两栏骨架 ---------- */
.tag-layout {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-top: 8px;
}

.tag-side {
    width: 230px;
    flex: 0 0 230px;
}

.tag-main {
    flex: 1 1 auto;
    min-width: 0;
}

/* ---------- 左栏面板 ---------- */
.tag-panel {
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 14px;
    background: #fafafa;
}

.tag-panel-hd {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    background: #fff;
    border-radius: 4px 4px 0 0;
}

.tag-panel-hd i {
    color: var(--brand, #1E9FFF);
    margin-right: 5px;
}

.tag-panel-bd {
    padding: 4px 0 8px;
}

.tag-cats {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tag-cats li {
    position: relative;
}

.tag-cats a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 12px;
    font-size: 14px;
    color: #444;
    line-height: 1.4;
}

.tag-cats a:hover {
    background: var(--brand-soft, #f0f7ff);
    color: var(--brand, #1E9FFF);
}

.tag-cats .tag-cnt {
    font-size: 12px;
    color: #999;
    background: #f1f1f1;
    border-radius: 10px;
    padding: 0 7px;
    margin-left: 8px;
    flex: 0 0 auto;
}

/* 二级栏目缩进一档 */
.tag-cats .tag-lv2 > a {
    padding-left: 26px;
    font-size: 13px;
    color: #666;
}

.tag-none {
    font-size: 13px;
    color: #aaa;
    padding: 8px 12px;
}

/* ---------- 右栏通用块 ---------- */
.tag-sec {
    margin-bottom: 22px;
}

.tag-sec-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    padding: 8px 0;
    border-bottom: 2px solid var(--brand, #1E9FFF);
}

.tag-sec-hd i {
    color: var(--brand, #1E9FFF);
    margin-right: 6px;
}

.tag-sec-hd .tag-total {
    font-size: 13px;
    font-weight: 400;
    color: #999;
}

/* ---------- 文章条目 ---------- */
.tag-arts {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tag-art {
    display: flex;
    align-items: flex-start;
    padding: 14px 0;
    border-bottom: 1px dashed #eee;
}

.tag-art-thumb {
    flex: 0 0 148px;
    width: 148px;
    height: 92px;
    margin-right: 14px;
    overflow: hidden;
    border-radius: 4px;
    background: #f6f6f6;
}

.tag-art-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}

.tag-art:hover .tag-art-thumb img {
    transform: scale(1.05);
}

.tag-art-bd {
    flex: 1 1 auto;
    min-width: 0;
}

.tag-art-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 6px;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tag-art-title a {
    color: #1f2d3d;
}

.tag-art-title a:hover {
    color: var(--brand, #1E9FFF);
}

.tag-art-desc {
    font-size: 13px;
    color: #888;
    line-height: 1.7;
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.tag-art-meta {
    font-size: 12px;
    color: #999;
}

.tag-art-meta span {
    margin-right: 14px;
}

.tag-art-meta i {
    margin-right: 3px;
}

.tag-art-meta a {
    color: #999;
}

.tag-art-meta a:hover {
    color: var(--brand, #1E9FFF);
}

/* ---------- 接口卡片 ---------- */
.tag-api-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    padding-top: 14px;
}

.tag-api-card {
    display: block;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 14px;
    background: #fff;
    transition: box-shadow .2s, border-color .2s;
}

.tag-api-card:hover {
    border-color: var(--brand, #1E9FFF);
    box-shadow: 0 3px 12px rgba(30, 159, 255, .12);
}

.tag-api-hd {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.tag-api-icon {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    border-radius: 6px;
    background: var(--brand-soft, #f0f7ff);
    color: var(--brand, #1E9FFF);
    font-size: 15px;
    margin-right: 8px;
    overflow: hidden;
}

.tag-api-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tag-api-name {
    flex: 1 1 auto;
    font-size: 15px;
    font-weight: 600;
    color: #1f2d3d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tag-api-badge {
    flex: 0 0 auto;
    font-size: 11px;
    line-height: 18px;
    padding: 0 6px;
    border-radius: 3px;
    margin-left: 6px;
    color: #fff;
}

.tag-api-badge.sync {
    background: var(--brand, #1E9FFF);
}

.tag-api-badge.async {
    background: #ff8f1f;
}

.tag-api-desc {
    font-size: 12px;
    color: #888;
    line-height: 1.6;
    height: 38px;
    margin: 0 0 10px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.tag-api-ft {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    border-top: 1px dashed #f0f0f0;
    padding-top: 8px;
}

.tag-api-price {
    color: #ff6a00;
    font-weight: 600;
}

.tag-api-cat {
    color: #999;
    background: #f5f5f5;
    border-radius: 3px;
    padding: 1px 6px;
}

/* ---------- 分页 ---------- */
.tag-pager {
    padding: 16px 0 4px;
    text-align: center;
    font-size: 13px;
}

.tag-pager a,
.tag-pager span {
    display: inline-block;
    min-width: 30px;
    height: 28px;
    line-height: 28px;
    padding: 0 9px;
    margin: 0 3px;
    border: 1px solid #e5e5e5;
    border-radius: 3px;
    color: #555;
    background: #fff;
}

.tag-pager a:hover {
    border-color: var(--brand, #1E9FFF);
    color: var(--brand, #1E9FFF);
}

.tag-pager .tag-cur {
    border-color: var(--brand, #1E9FFF);
    color: var(--brand, #1E9FFF);
    font-weight: 600;
}

.tag-pager .tag-off {
    color: #ccc;
    cursor: not-allowed;
}

/* ---------- 移动端 ---------- */
@media (max-width: 768px) {
    .tag-page {
        padding: 4px 12px 18px;
    }

    .tag-h1 {
        font-size: 18px;
    }

    .tag-h1 .tag-sum {
        display: block;
        margin: 4px 0 0;
    }

    .tag-layout {
        display: block;
        margin-top: 4px;
    }

    .tag-side {
        width: auto;
        flex: none;
    }

    .tag-panel {
        margin-bottom: 10px;
    }

    /* 左栏两个面板改成横向滑动条，纵向列表在小屏太占高 */
    .tag-panel-bd {
        padding: 0;
    }

    .tag-cats {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 8px 10px;
    }

    .tag-cats li {
        flex: 0 0 auto;
    }

    .tag-cats a {
        padding: 4px 10px;
        font-size: 13px;
        white-space: nowrap;
        border: 1px solid #eee;
        border-radius: 14px;
        background: #fff;
        margin-right: 8px;
    }

    /* 移动端不出二级树，避免横条过高 */
    .tag-cats .tag-lv2 {
        display: none;
    }

    .tag-cats .tag-cnt {
        display: none;
    }

    .tag-api-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding-top: 10px;
    }

    .tag-art-thumb {
        flex-basis: 108px;
        width: 108px;
        height: 72px;
        margin-right: 10px;
    }

    .tag-art-title {
        font-size: 15px;
    }

    .tag-art-meta span {
        margin-right: 10px;
    }
}
