/* ============ 详情页 ============ */
:root {
    --nf-header-offset: 0px;
    scroll-behavior: auto;
}
.nf-toc-item a:active {
    color: inherit ;
}
.nf-toc-item a:focus {
    color: inherit ;
}
#content.site-content {
    /* overflow: clip; */
    overflow: visible;
}

/* -------- meta 左侧 tags + 右侧分享 -------- */
.nf-meta2 {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin: 14px 0 22px;
}

.nf-meta2__left {
    display: flex;
    flex-direction: column;
    width: 100%;

}
.nf-meta2__left .meta {
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    border-radius: 0.5rem;
    padding: 2px 4px;
}
.nf-meta2__left ul li {
    margin-right: 2px;
}

.tags {
    margin-top: 10px;
}
.highlight_active {
    color: var(--dt-main-color) !important;
}
.tags ul {
    list-style-type: disc !important;
    list-style-position: outside !important;
    padding-left: 12px !important;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 20px;
}

.tags ul > li {
    list-style: disc outside !important;
}
.tags ul  li:hover span {
    color: var(--dt-main-color) !important;
}
.tags ul li::marker {
    color: var(--dt-main-color);
    font-size: 0.8em;
}

.tags ul li span {
    display: inline-block;
    font-weight: bold;
    font-size: 14px;
    color: #333333;
    text-transform: none;
}

.nf-meta2 .tags a,
.nf-meta2 .tags a:hover {
    text-decoration: none;
}

/* -------- 分享 -------- */
.share-area {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    font-family: inherit;
}

.share-area .share {
    color: #8b9bb4;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.share-icons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.share-icons button {
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.share-icons button:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.share-btn.sf-twitter {
    background: #000;
}

.share-btn.sf-facebook {
    background: #1877f2;
}

.share-btn.sf-reddit {
    background: #ff4500;
}

.share-btn.sf-whatsapp {
    background: #25d366;
}

.share-btn.sf-pinterest {
    background: #e60023;
}

.share-btn.sf-instagram {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

.share-btn.sf-copy {
    background: #5b6472;
}


/* 默认隐藏，仅宽屏显示为正文左侧的吸顶目录栏 */
#nfTocSide {
    display: none;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 14px;
    margin: 0 12px;
    box-sizing: border-box;
}

@media (min-width: 1280px) {
    #nfTocSide {
        display: block;
        align-self: flex-start;
        position: -webkit-sticky;
        position: sticky;
        top: calc(var(--nf-header-offset, 0px) + 20px + 70px);
        flex: 0 0 280px;
        max-width: 280px;
        max-height: calc(100vh - var(--nf-header-offset, 0px) - 40px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        z-index: 2;
    }

    #dt-main {
        flex: 1 1 0;
        max-width: none;
        min-width: 0;
    }

    #dt-sidebar {
        flex: 0 0 min(33%, 360px);
        max-width: min(33%, 360px);
    }
}

.nf-toc-title {
    font-size: 22px;
    font-weight: 700;
    color: #222;
    margin-bottom: 10px;
}

.nf-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nf-toc-list .nf-toc-item {
    margin: 0;
    list-style: none;
}

/* h2 */
.nf-toc-item.lvl-2 .nf-toc-link::before {
    content: "";
    display: inline-block;
    height: 3px;
    color: inherit;
    background-color: #000;
    flex: 0 0 auto;
    width: 3px;
    border-radius: 50%;
    vertical-align: middle;
    margin-top: -5px;
}
.nf-toc-item.lvl-2 .nf-toc-link.active::before {
    background: var(--dt-main-color) ;
}

/* h3 */
.nf-toc-item.lvl-3 .nf-toc-link::before {
    content: "";
    display: inline-block;
    height: 1px;
    color: inherit;
    background-color: #ccc;
    flex: 0 0 auto;
    width: 5px;
    vertical-align: middle;
    margin-top: -3px;
}
.nf-toc-item.lvl-3 .nf-toc-link.active::before {
    background: var(--dt-main-color) ;
}

#nfTocSide .nf-toc-item a:focus,
#nfTocSide .nf-toc-item a:hover {
    text-decoration: none;
}

.nf-toc-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 14px;
    line-height: 1.4;
    color: #555;
    text-decoration: none;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}

.nf-toc-link:hover {
    color: var(--dt-main-color);
    background: rgba(var(--dt-main-rgb), 0.06);
}

.nf-toc-link.active {
    color: var(--dt-main-color) !important;
    font-weight: 700;
    background: rgba(var(--dt-main-rgb), 0.1);
}

.lvl-3 .nf-toc-link {
    padding-left: 22px;
    font-size: 13px;
}

.lvl-4 .nf-toc-link {
    padding-left: 34px;
    font-size: 13px;
}

/* --------  Recommended Article -------- */
.nf-recommend {
    background: #f5f5f5;
    border-radius: 1rem;
    padding: 24px;
    margin-top: 24px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.07);
}

.nf-recommend__title {
    font-size: 18px;
    font-weight: 700;
    color: #000;
    text-transform: uppercase;
    margin: 0 0 12px;
}

.nf-recommend__list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 20px;
}

.nf-recommend .nf-recommend__list > li {
    list-style: none;
    margin: 0;
    min-width: 0;
}

.nf-recommend__item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid #ccc;
    text-decoration: none;
}

.nf-recommend__list > li:nth-last-child(-n+2) .nf-recommend__item {
    border-bottom: none;
}

.nf-recommend__img {
    display: block;
    flex: 0 0 auto;
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    background: #ececec;
}

.nf-recommend__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease-in-out;
}

.nf-recommend__item:hover .nf-recommend__img img {
    transform: scale(1.05);
}

.nf-recommend__text {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.nf-recommend__name {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nf-recommend__item:hover .nf-recommend__name {
    color: var(--dt-main-color);
}

.nf-recommend__date {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.5);
}

.nf-recommend__date::before {
    content: "";
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 100%;
    background: rgba(0, 0, 0, 0.2);
}

body.dark #nfTocSide {
    background: rgba(255, 255, 255, .1);
    border-color: rgba(189, 189, 189, .3);
}
body.dark .nf-toc-title {
    color: #fff;
}
body.dark .nf-toc-link {
    color: rgba(255, 255, 255, .7);
}
body.dark .nf-toc-item.lvl-2 .nf-toc-link::before {
    background-color: #fff;
}
body.dark .nf-toc-item.lvl-3 .nf-toc-link::before {
    background-color: rgba(255, 255, 255, .4);
}

body.dark .nf-recommend {
    background: rgba(255, 255, 255, .1);
}
body.dark .nf-recommend__title {
    color: #fff;
}
body.dark .nf-recommend__name {
    color: rgba(255, 255, 255, .75);
}
body.dark .nf-recommend__item {
    border-bottom-color: rgba(189, 189, 189, .3);
}
body.dark .nf-recommend__img {
    background: rgba(255, 255, 255, .15);
}
body.dark .nf-recommend__date {
    color: rgba(255, 255, 255, .5);
}
body.dark .nf-recommend__date::before {
    background: rgba(255, 255, 255, .3);
}

body.dark .nf-toc-drawer {
    background: var(--dt-secondary-color);
}
body.dark .nf-meta2__left .meta {
    color: #fff;
    background: rgba(255, 255, 255, .1);
}
body.dark .tags ul li span {
    color: #fff;
}

/* -------- 移动端：悬浮按钮 + 抽屉目录 -------- */
.nf-toc-fab {
    display: none;
    position: fixed;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100000;
    width: 36px;
    height: fit-content;
    border-radius: 10px;
    border: none;
    background: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 10px;
}

.nf-toc-fab .nf-bar {
    display: block;
    width: 18px;
    height: 3px;
    border-radius: 2px;
    background: #cfcfcf;
    transition: all 0.2s ease;
}

.nf-bar.active {
    width: 26px !important;
    background-color: var(--dt-main-color) !important;
}

.nf-toc-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100001;
    background: transparent;
    display: none;
}

.nf-toc-drawer {
    display: none;
    position: fixed;
    right: 10px;
    top: 50%;
    z-index: 100002;
    width: min(84%, 360px);
    max-height: 74vh;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
    overflow: hidden;
    flex-direction: column;
    transform: translateY(-50%);
    padding: 0 0 ;
}

.nf-toc-drawer.is-open {
    display: flex;
}

.nf-toc-backdrop.is-open {
    display: block;
}

.nf-toc-drawer-head {
    flex: 0 0 auto;
    position: relative;
    background: var(--dt-main-color);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
 
button.nf-toc-drawer-close {
        background: none;
        color: #fff;
        box-shadow: none;
        border: none;
        padding: 0;
        margin: 0;
 
}

.nf-toc-drawer .nf-toc-list {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px 0;
}

.nf-toc-drawer .nf-toc-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border-radius: 0;
    background: transparent;
    font-size: 15px;
    font-weight: 700;
    color: #222;
    line-height: 1.35;
}


.nf-toc-drawer .lvl-3 .nf-toc-link {
    padding-left: 30px;
    font-weight: 400;
    color: #8a8a8a;
    font-size: 14px;
}





.nf-toc-drawer .nf-toc-link.active {
    background: rgba(var(--dt-main-rgb), 0.1);
    color: var(--dt-main-color);
}


/* 窄屏（容不下左侧目录栏）：悬浮按钮 + 抽屉 */
@media (max-width: 1279.98px) {
    .nf-toc-fab {
        display: flex;
    }
}

@media (max-width: 768px) {
    .tags ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 0px;
    }

    #nfBody {
        font-size: 15px;
    }

    .nf-recommend {
        padding: 18px;
    }

    .nf-recommend__list {
        grid-template-columns: 1fr;
    }

    .nf-recommend__list > li:nth-last-child(-n+2) .nf-recommend__item {
        border-bottom: 1px solid #ccc;
    }

    .nf-recommend__list > li:last-child .nf-recommend__item {
        border-bottom: none;
    }

    /* zuozhe  */
    .nf-meta2__left  ul.author {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 4px;
    }
    .nf-meta2__left ul.author li, .nf-meta2__left ul.author  span  {
        margin-right: 0;
        font-size: 12px !important;
    }


    #nfToast{ 
        max-width: 90vw;
        padding:10px 10px;
    }
    /* fuwenben table yangshi  */
    #nfBody table {
        display: table;
        width: 100%;
        max-width: 100%;
        table-layout: auto;
        word-break: normal;
        overflow-wrap: break-word;
    }

    #nfBody table th,
    #nfBody table td {
        padding: 2px 2px;
        font-size: 1.2rem;
        width: auto !important;
        max-width: 100%;
        word-break: normal;
        overflow-wrap: break-word;
    }
}

/* tanchuang  */
 #nfToastMask{
    position:fixed;
    left:0;
    top:0;
    right:0;
    bottom:0;
    background:rgba(0,0,0,.35);
    z-index:100009;
    opacity:0;
    visibility:hidden;
    transition:opacity .25s;pointer-events:none;
}
#nfToast{
    position:fixed;
    left:50%;
    top: 40vh;
    transform:translateX(-50%);
    background:rgba(var(--dt-main-rgb));
    color:#fff;
    padding:10px;
    border-radius:6px;
    font-size:14px;
    line-height:1.4;
    width: max-content; 
    max-width:30vw;
    text-align:center;
    z-index:100010;
    opacity:0;
    visibility:hidden;
    transition:opacity .25s;
    pointer-events:none;
    text-align: left;
    overflow-wrap: anywhere;
    word-break: break-word;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}


#nfToast.show,
#nfToastMask.show{
    opacity:1;
    visibility:visible;
    pointer-events:auto;
}
#nfToastClose{
    position:absolute;
    right:-10px;
    top:0%;
    transform:translateY(-50%);
    border:0;
    flex: 0 0 auto;
    background:none;
    width: 22px;
    height:22px;
    color:#fff;
    font-size:14px;
    line-height:1;
    cursor:pointer;
    background-color: var(--dt-main-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
}


