/* ==========================================================================
   Juzi 首页组件：多功能信息导航 + New 文章轮播
   自包含样式（jz-infnav / jz-nc 前缀），深色模式 html[data-night="night"]
   ========================================================================== */

/* ===================== 多功能信息导航 ===================== */
.jz-infnav {
    margin-bottom: 20px;
    padding: 18px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .05);
    box-sizing: border-box;
}

.jz-infnav__cats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

.jz-infnav .info-cat {
    --cat-color: #f4fafe;
    background: var(--cat-color);
    border-radius: 10px;
    padding: 12px 14px;
    transition: transform .25s, box-shadow .25s;
    overflow: hidden;
}

.jz-infnav .info-cat:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .08);
}

.jz-infnav .info-cat__head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    color: #333;
    text-decoration: none;
}

.jz-infnav .info-cat__icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex: 0 0 22px;
}

.jz-infnav .info-cat__title {
    font-size: 15px;
    font-weight: 700;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color .2s;
}

.jz-infnav .info-cat__head:hover .info-cat__title {
    text-decoration: underline;
}

.jz-infnav .info-cat__arrow {
    width: 14px;
    height: 14px;
    fill: #999;
    transition: transform .2s, fill .2s;
    flex: 0 0 14px;
}

.jz-infnav .info-cat__head:hover .info-cat__arrow {
    transform: translateX(3px);
    fill: var(--jz-theme, #4f86f7);
}

.jz-infnav .info-cat__items {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px 10px;
}

.jz-infnav .info-cat__items a {
    font-size: 13px;
    color: #666;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color .2s;
}

.jz-infnav .info-cat__items a:hover {
    color: var(--jz-theme, #4f86f7);
}

.jz-infnav__bottom {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 14px;
    min-height: 80px;
}

.jz-infnav__stats {
    flex: 0 0 auto;
    min-width: 0;
    display: flex;
    align-items: center;
}

.jz-infnav .stat-item {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 8px;
    background: none;
}

.jz-infnav .stat-item + .stat-item {
    border-left: 1px solid rgba(0, 0, 0, .06);
}

.jz-infnav .stat-label {
    font-size: 13px;
    color: #999;
    white-space: nowrap;
}

.jz-infnav .stat-num {
    font-size: 25px;
    font-weight: 500;
    line-height: 30px;
    color: #2d3142;
    white-space: nowrap;
    margin-top: 6px;
}

.jz-infnav .stat-num em {
    font-style: normal;
    font-size: 14px;
    font-weight: 600;
    color: #8a90a2;
    margin-left: 3px;
}

.jz-infnav__activity {
    flex: 1 1 0%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 10px 14px;
    background: rgba(0, 0, 0, .025);
    border-radius: 8px;
    margin-left: 18px;
    position: relative;
}

.jz-infnav__activity::before {
    content: "";
    position: absolute;
    left: -9px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 45px;
    background: rgba(0, 0, 0, .06);
}

.jz-infnav .activity-head {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    color: #333;
    padding-bottom: 8px;
    border-bottom: 1px dashed rgba(0, 0, 0, .08);
}

.jz-infnav .activity-viewport {
    height: 26px;
    overflow: hidden;
    margin-top: 4px;
}

.jz-infnav .activity-track {
    will-change: transform;
}

.jz-infnav .activity-item {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 25px;
    line-height: 25px;
    font-size: 13px;
    color: #666;
    white-space: nowrap;
}

.jz-infnav .activity-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 20px;
}

.jz-infnav .activity-avatar--txt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #fff;
    background: linear-gradient(135deg, #4f86f7, #6f5bd8);
}

.jz-infnav .activity-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jz-infnav .activity-text em {
    font-style: normal;
    color: #333;
    font-weight: 600;
    margin-right: 2px;
}

.jz-infnav .activity-text a {
    color: var(--jz-theme, #4f86f7);
    text-decoration: none;
    margin-left: 2px;
}

.jz-infnav .activity-text a:hover {
    text-decoration: underline;
}

.jz-infnav .activity-date {
    flex: 0 0 auto;
    margin-left: 10px;
    font-size: 12px;
    color: #b6bcc8;
    font-style: normal;
}

.jz-infnav .activity-empty {
    font-size: 13px;
    color: #999;
    padding: 14px 0;
    text-align: center;
}

/* ===================== New 文章轮播 ===================== */
/* FOUC 防护：ESM 初始化完成前整体隐藏（固定高度仍占位，不引发布局跳动） */
.jz-nc {
    display: flex;
    flex-direction: row;
    gap: 10px;
    height: var(--jz-nc-h, 400px);
    margin-bottom: 20px;
    visibility: hidden;
    opacity: 0;
    overflow: hidden;
    transition: opacity .35s ease;
}

.jz-nc.is-ready {
    visibility: visible;
    opacity: 1;
}

/* flex 尺寸约束（1:1 对齐 WP 子比 New轮播图）：
   右栏必须显式 width + min-width:0。否则 Swiper 初始化前多个 slide
   （width:100%;flex-shrink:0）在 row flex 中形成循环百分比依赖，
   Chromium 会把右栏撑到超大值(2^25)、左栏剩余空间归零，桌面出现两条全宽灰条。
   swiper-wrapper/slide 的 nowrap、flex-shrink:0 由全局 swiper.min.css 原生提供。 */
.jz-nc .jz-nc-zone {
    position: relative;
    min-width: 0;
    border-radius: 10px;
    overflow: hidden;
}

.jz-nc .jz-nc__left {
    flex: 1 1 0%;
    min-width: 0;
}

.jz-nc .jz-nc__right {
    flex: 0 0 var(--jz-nc-rw, 300px);
    width: var(--jz-nc-rw, 300px);
    max-width: var(--jz-nc-rw, 300px);
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 右侧两块容器（DOM 中为 top/bottom 两个独立 zone） */
.jz-nc .jz-nc__top,
.jz-nc .jz-nc__bottom {
    flex: 1 1 0%;
    min-width: 0;
    min-height: 0;
}

.jz-nc .swiper-container {
    width: 100%;
    height: 100%;
    min-width: 0;
    border-radius: 10px;
    background: transparent;
}

.jz-nc .is-coverflow {
    overflow: visible;
}

.jz-nc .is-coverflow .swiper-wrapper {
    padding: 0 8%;
}

.jz-nc .jz-nc-slide {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #e8e8e8;
}

.jz-nc .jz-nc-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .5s;
}

.jz-nc .jz-nc-slide:hover .jz-nc-img {
    transform: scale(1.05);
}

.jz-nc .jz-nc-mask {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 65%;
    background: linear-gradient(to top, rgba(0, 0, 0, .78), rgba(0, 0, 0, .25) 60%, transparent);
    pointer-events: none;
}

.jz-nc .jz-nc-info {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 14px 16px;
    color: #fff;
    z-index: 2;
}

.jz-nc.is-shadow .jz-nc-info {
    text-shadow: 0 1px 4px rgba(0, 0, 0, .8);
}

.jz-nc .jz-nc-title {
    display: block;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.jz-nc__top .jz-nc-title,
.jz-nc__bottom .jz-nc-title {
    font-size: 14px;
    -webkit-line-clamp: 1;
}

.jz-nc .jz-nc-excerpt {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.5;
    opacity: .85;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.jz-nc .jz-nc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
    font-size: 12px;
    opacity: .9;
}

.jz-nc .jz-nc-meta em {
    font-style: normal;
}

.jz-nc .jz-nc-meta .jz-nc-cat {
    color: #ffd591;
}

.jz-nc .swiper-button-next,
.jz-nc .swiper-button-prev {
    --swiper-navigation-size: 22px;
    color: #fff;
    background: rgba(0, 0, 0, .25);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    opacity: 0;
    transition: opacity .25s, background .25s;
}

.jz-nc .jz-nc__left:hover .swiper-button-next,
.jz-nc .jz-nc__left:hover .swiper-button-prev {
    opacity: 1;
}

.jz-nc .swiper-button-next:hover,
.jz-nc .swiper-button-prev:hover {
    background: rgba(0, 0, 0, .5);
}

.jz-nc .swiper-button-next:after,
.jz-nc .swiper-button-prev:after {
    font-size: 14px;
    font-weight: 700;
}

.jz-nc .swiper-pagination-bullet {
    background: #fff;
    opacity: .55;
}

.jz-nc .swiper-pagination-bullet-active {
    opacity: 1;
    width: 18px;
    border-radius: 4px;
}

/* ===================== 深色模式 ===================== */
html[data-night="night"] .jz-infnav {
    background: #1e2130;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .35);
}

html[data-night="night"] .jz-infnav .info-cat__head {
    color: #e6e8f0;
}

html[data-night="night"] .jz-infnav .info-cat__items a {
    color: #a8adc0;
}

html[data-night="night"] .jz-infnav .stat-item,
html[data-night="night"] .jz-infnav__activity {
    background: rgba(255, 255, 255, .05);
}

html[data-night="night"] .jz-infnav .stat-item {
    background: none;
}

html[data-night="night"] .jz-infnav .stat-item + .stat-item {
    border-left-color: rgba(255, 255, 255, .08);
}

html[data-night="night"] .jz-infnav .stat-num {
    color: #e6e8f0;
}

html[data-night="night"] .jz-infnav .stat-num em {
    color: #9aa0b5;
}

html[data-night="night"] .jz-infnav .stat-label,
html[data-night="night"] .jz-infnav .activity-item {
    color: #9aa0b5;
}

html[data-night="night"] .jz-infnav .activity-head,
html[data-night="night"] .jz-infnav .activity-text em {
    color: #e6e8f0;
}

html[data-night="night"] .jz-infnav .activity-head {
    border-bottom-color: rgba(255, 255, 255, .1);
}

html[data-night="night"] .jz-infnav .activity-date {
    color: #6b7185;
}

/* ===================== 响应式 ===================== */
@media (max-width: 1200px) {
    .jz-infnav__cats {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .jz-infnav__bottom {
        flex-direction: column;
    }

    .jz-infnav__stats {
        flex: none;
    }
}

@media (max-width: 768px) {
    .jz-infnav__cats {
        grid-template-columns: repeat(2, 1fr);
    }

    .jz-infnav__stats {
        flex-wrap: wrap;
    }

    .jz-infnav .stat-item {
        flex: 0 0 33.3333%;
        padding: 8px;
    }

    .jz-infnav .stat-item + .stat-item {
        border-left: none;
    }

    /* 轮播移动端（1:1 对齐 WP 子比：仅 768 单档，纵向排列，右栏双小图并排） */
    .jz-nc {
        flex-direction: column;
        height: auto;
    }

    .jz-nc .jz-nc__left {
        flex: none;
        height: 200px;
        min-height: 0;
    }

    .jz-nc .jz-nc__right {
        flex: none;
        width: 100%;
        max-width: none;
        flex-direction: row;
        height: 150px;
    }

    .jz-nc .jz-nc__top,
    .jz-nc .jz-nc__bottom {
        flex: 1 1 0%;
        height: 150px;
    }
}

@media (max-width: 480px) {
    .jz-infnav {
        padding: 12px;
    }

    .jz-infnav__cats {
        grid-template-columns: 1fr;
    }

    .jz-infnav .stat-item {
        flex: 0 0 50%;
    }

    .jz-infnav .stat-num {
        font-size: 18px;
    }
}
