/* =========================================================
   笔记教程目录（note-catalog）   左侧分类树 + 右侧按分类分块的文章列表
   参考 C语言中文网的教程目录版式
   ========================================================= */

body[data-page="note-catalog"] {

    background: #f5f7fa;

}

body[data-page="note-catalog"] .ncat-page {

    padding: 24px 0 60px;

}


/* =========================================================
   页面头部
   ========================================================= */

body[data-page="note-catalog"] .ncat-head {

    background: linear-gradient(
            135deg,
            #241a52 0%,
            #5b4fe8 60%,
            #3b82f6 100%
    );

    border-radius: 14px;

    padding: 20px 26px;

    margin-bottom: 20px;

    color: #fff;

}

body[data-page="note-catalog"] .ncat-crumb {

    display: flex;

    align-items: center;

    gap: 6px;

    font-size: .78rem;

    color: rgba(255, 255, 255, .8);

    margin-bottom: 10px;

}

body[data-page="note-catalog"] .ncat-crumb a {

    color: rgba(255, 255, 255, .85);

    text-decoration: none;

}

body[data-page="note-catalog"] .ncat-crumb a:hover {

    color: #fff;

    text-decoration: underline;

}

body[data-page="note-catalog"] .ncat-head-main {

    display: flex;

    align-items: flex-end;

    justify-content: space-between;

    gap: 16px;

    flex-wrap: wrap;

}

body[data-page="note-catalog"] .ncat-title {

    margin: 0;

    font-size: 1.5rem;

    font-weight: 700;

    letter-spacing: -.01em;

}

body[data-page="note-catalog"] .ncat-desc {

    margin: 6px 0 0;

    font-size: .82rem;

    color: rgba(255, 255, 255, .82);

}

body[data-page="note-catalog"] .ncat-desc b {

    font-weight: 700;

    color: #fff;

}

body[data-page="note-catalog"] .ncat-head-ops {

    display: flex;

    gap: 8px;

}

body[data-page="note-catalog"] .ncat-btn {

    display: inline-flex;

    align-items: center;

    height: 34px;

    padding: 0 16px;

    border-radius: 999px;

    font-size: .8rem;

    font-weight: 600;

    text-decoration: none;

    cursor: pointer;

    white-space: nowrap;

    transition: all .15s;

}

body[data-page="note-catalog"] .ncat-btn-outline {

    border: 1px solid
            rgba(255, 255, 255, .55);

    background: rgba(255, 255, 255, .1);

    color: #fff;

}

body[data-page="note-catalog"] .ncat-btn-outline:hover {

    background: #fff;

    color: #5b4fe8;

}

body[data-page="note-catalog"] .ncat-btn-solid {

    background: #fff;

    border: 1px solid #fff;

    color: #5b4fe8;

}

body[data-page="note-catalog"] .ncat-btn-solid:hover {

    background: rgba(255, 255, 255, .88);

}


/* =========================================================
   布局
   ========================================================= */

body[data-page="note-catalog"] .ncat-layout {

    display: flex;

    align-items: flex-start;

    gap: 20px;

}


/* =========================================================
   左侧分类树    ========================================================= */

body[data-page="note-catalog"] .ncat-side {

    width: 268px;

    min-width: 268px;

    position: sticky;

    top: 88px;

    max-height: calc(100vh - 108px);

}

body[data-page="note-catalog"] .ncat-side-inner {

    max-height: calc(100vh - 108px);

    overflow-y: auto;

    background: #fff;

    border: 1px solid #e9e6f7;

    border-radius: 12px;

    padding: 12px;

}

body[data-page="note-catalog"] .ncat-side-head {

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 2px 6px 10px;

    margin-bottom: 6px;

    border-bottom: 1px solid #f5f3ff;

    font-size: .88rem;

    font-weight: 700;

    color: #241a52;

}

body[data-page="note-catalog"] .ncat-side-close {

    display: none;

    border: 0;

    background: transparent;

    font-size: 1.2rem;

    line-height: 1;

    color: #8a83a8;

    cursor: pointer;

}

body[data-page="note-catalog"] .ncat-side-empty {

    padding: 18px 8px;

    text-align: center;

    font-size: .8rem;

    color: #8a83a8;

}


/* 分类标题栏*/

body[data-page="note-catalog"] .ncat-tree-group {

    margin-bottom: 2px;

}

body[data-page="note-catalog"] .ncat-tree-title {

    display: flex;

    align-items: center;

    gap: 6px;

    padding: 8px 8px;

    border-radius: 8px;

    cursor: pointer;

    font-size: .85rem;

    font-weight: 600;

    color: #241a52;

    transition: background-color .15s,
                color .15s;

}

body[data-page="note-catalog"] .ncat-tree-title:hover {

    background: #f5f3ff;

    color: #5b4fe8;

}

body[data-page="note-catalog"] .ncat-caret {

    flex-shrink: 0;

    color: #b9c2d0;

    transition: transform .18s;

}

body[data-page="note-catalog"] .ncat-tree-group.open .ncat-caret {

    transform: rotate(90deg);

}

body[data-page="note-catalog"] .ncat-tree-name {

    flex: 1;

    min-width: 0;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

}

body[data-page="note-catalog"] .ncat-tree-count {

    font-style: normal;

    font-size: .72rem;

    font-weight: 600;

    color: #8a83a8;

    background: #faf9ff;

    border-radius: 999px;

    padding: 1px 7px;

}


/* 当前阅读中的分类 */

body[data-page="note-catalog"] .ncat-tree-group.current > .ncat-tree-title {

    background: rgba(91, 79, 232, .08);

    color: #5b4fe8;

}

body[data-page="note-catalog"] .ncat-tree-group.current .ncat-caret {

    color: #5b4fe8;

}


/* 分类下的文章列表 */

body[data-page="note-catalog"] .ncat-tree-list {

    list-style: none;

    margin: 0;

    padding: 0 0 4px 22px;

    display: none;

}

body[data-page="note-catalog"] .ncat-tree-group.open .ncat-tree-list {

    display: block;

}

body[data-page="note-catalog"] .ncat-tree-list li a {

    display: block;

    padding: 5px 6px;

    border-radius: 6px;

    font-size: .79rem;

    color: #5b6675;

    text-decoration: none;

    line-height: 1.5;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

    transition: background-color .15s,
                color .15s;

}

body[data-page="note-catalog"] .ncat-tree-list li a:hover {

    background: #f5f3ff;

    color: #5b4fe8;

}

body[data-page="note-catalog"] .ncat-tree-list b {

    color: #8a83a8;

    font-weight: 600;

    margin-right: 2px;

}


/* =========================================================
   右侧内容
   ========================================================= */

body[data-page="note-catalog"] .ncat-main {

    flex: 1;

    min-width: 0;

}

body[data-page="note-catalog"] .ncat-side-open {

    display: none;

    align-items: center;

    justify-content: center;

    gap: 6px;

    width: 100%;

    height: 38px;

    margin-bottom: 14px;

    border: 1px solid #dbe2ec;

    border-radius: 10px;

    background: #fff;

    color: #5b4fe8;

    font-size: .85rem;

    font-weight: 600;

    cursor: pointer;

}


/* 分类块*/

body[data-page="note-catalog"] .ncat-block {

    background: #fff;

    border: 1px solid #e9e6f7;

    border-radius: 12px;

    padding: 18px 22px 12px;

    margin-bottom: 16px;

}

body[data-page="note-catalog"] .ncat-block-head {

    display: flex;

    align-items: center;

    gap: 10px;

    padding-bottom: 12px;

    margin-bottom: 6px;

    border-bottom: 1px solid #f5f3ff;

}

body[data-page="note-catalog"] .ncat-block-index {

    font-size: .72rem;

    font-weight: 700;

    color: #fff;

    background: linear-gradient(
            135deg,
            #3b82f6,
            #5b4fe8
    );

    border-radius: 5px;

    padding: 2px 8px;

}

body[data-page="note-catalog"] .ncat-block-title {

    margin: 0;

    font-size: 1.02rem;

    font-weight: 700;

    color: #241a52;

}

body[data-page="note-catalog"] .ncat-block-count {

    margin-left: auto;

    font-size: .75rem;

    color: #8a83a8;

}


/* 块内文章列表：两列*/

body[data-page="note-catalog"] .ncat-block-list {

    list-style: none;

    margin: 0;

    padding: 0;

    display: grid;

    grid-template-columns:
            repeat(2, minmax(0, 1fr));

    gap: 0 22px;

}

body[data-page="note-catalog"] .ncat-item-link {

    display: flex;

    align-items: center;

    gap: 8px;

    padding: 8px 6px;

    border-radius: 8px;

    border-bottom: 1px dashed #faf9ff;

    text-decoration: none;

    transition: background-color .15s;

}

body[data-page="note-catalog"] .ncat-item-link:hover {

    background: #f5f3ff;

}

body[data-page="note-catalog"] .ncat-item-num {

    flex-shrink: 0;

    width: 22px;

    height: 22px;

    border-radius: 6px;

    background: #eff3fa;

    color: #7a8699;

    font-size: .72rem;

    font-weight: 700;

    display: flex;

    align-items: center;

    justify-content: center;

}

body[data-page="note-catalog"] .ncat-item-link:hover .ncat-item-num {

    background: #5b4fe8;

    color: #fff;

}

body[data-page="note-catalog"] .ncat-item-title {

    flex: 1;

    min-width: 0;

    font-size: .875rem;

    color: #241a52;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

    transition: color .15s;

}

body[data-page="note-catalog"] .ncat-item-link:hover .ncat-item-title {

    color: #5b4fe8;

}

body[data-page="note-catalog"] .ncat-item-view {

    flex-shrink: 0;

    font-size: .72rem;

    color: #8a83a8;

}

body[data-page="note-catalog"] .ncat-empty {

    background: #fff;

    border: 1px solid #e9e6f7;

    border-radius: 12px;

    padding: 60px 20px;

    text-align: center;

    color: #8a83a8;

}

body[data-page="note-catalog"] .ncat-empty h3 {

    margin: 0 0 6px;

    font-size: 1rem;

    color: #241a52;

}


/* =========================================================
   响应式    ========================================================= */

@media (max-width: 991.98px) {

    body[data-page="note-catalog"] .ncat-layout {

        display: block;

    }

    body[data-page="note-catalog"] .ncat-side {

        position: fixed;

        left: 0;

        top: 0;

        z-index: 1050;

        width: 280px;

        max-width: 84vw;

        height: 100%;

        background: #fff;

        transform: translateX(-100%);

        transition: transform .22s;

        padding: 14px;

    }

    body[data-page="note-catalog"] .ncat-side.show {

        transform: translateX(0);

        box-shadow: 4px 0 24px
                    rgba(36, 26, 82, .18);

    }

    body[data-page="note-catalog"] .ncat-side-inner {

        max-height: 100%;

        border: 0;

        border-radius: 0;

        padding: 0;

    }

    body[data-page="note-catalog"] .ncat-side-close {

        display: block;

    }

    body[data-page="note-catalog"] .ncat-side-open {

        display: flex;

    }

    body[data-page="note-catalog"] .ncat-block-list {

        grid-template-columns: 1fr;

    }

}


/* =========================================================
   侧栏搜索框    ========================================================= */

body[data-page="note-catalog"] .ncat-search {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    margin: 0 0 10px;
    padding: 0 8px 0 12px;
    background: #ffffff;
    border: 1px solid #e6eaf0;
    border-radius: 10px;
    color: #8a83a8;
    box-shadow: 0 1px 2px rgba(36, 26, 82, .03);
    transition: border-color .15s, box-shadow .15s;
}

body[data-page="note-catalog"] .ncat-search:hover {
    border-color: #c9d6ea;
}

body[data-page="note-catalog"] .ncat-search:focus-within {
    border-color: #5b4fe8;
    box-shadow: 0 0 0 3px rgba(91, 79, 232, .12);
}

body[data-page="note-catalog"] .ncat-search svg {
    flex-shrink: 0;
    color: #8a83a8;
}

body[data-page="note-catalog"] .ncat-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: #241a52;
    font-size: .82rem;
}

body[data-page="note-catalog"] .ncat-search input::placeholder {
    color: #a9b2c0;
}

body[data-page="note-catalog"] .ncat-search-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    flex-shrink: 0;
    border: 0;
    border-radius: 50%;
    background: #f5f3ff;
    color: #6b7684;
    cursor: pointer;
    transition: background-color .15s, color .15s;
}

body[data-page="note-catalog"] .ncat-search-clear:hover {
    background: #e34d4d;
    color: #ffffff;
}

body[data-page="note-catalog"] .ncat-search-clear.hidden {
    display: none;
}

body[data-page="note-catalog"] .ncat-search-meta {
    display: inline-block;
    margin: 0 0 10px;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(91, 79, 232, .08);
    color: #5b4fe8;
    font-size: .72rem;
    font-weight: 600;
}

body[data-page="note-catalog"] .ncat-search-meta.hidden {
    display: none;
}

/* =========================================================
   左侧分类导航（只有分类 + 所有目录）
   ========================================================= */

body[data-page="note-catalog"] .ncat-cat-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

body[data-page="note-catalog"] .ncat-cat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 600;
    color: #241a52;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s, color .15s;
}

body[data-page="note-catalog"] .ncat-cat-item:hover {
    background: #f5f3ff;
    color: #5b4fe8;
}

body[data-page="note-catalog"] .ncat-cat-item.current {
    background: rgba(91, 79, 232, .08);
    color: #5b4fe8;
}

body[data-page="note-catalog"] .ncat-cat-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body[data-page="note-catalog"] .ncat-cat-count {
    flex-shrink: 0;
    font-style: normal;
    font-size: .72rem;
    font-weight: 600;
    color: #8a83a8;
    background: #faf9ff;
    border-radius: 999px;
    padding: 1px 7px;
}

body[data-page="note-catalog"] .ncat-cat-item.current .ncat-cat-count {
    background: #ffffff;
    color: #5b4fe8;
}
