/*
 * 公告栏：首页（banner 下方，纵向轮播）与测算项目页（顶部，横向滚动）。
 * 类名统一使用 nb- 前缀，避免与各模板旧样式冲突；尺寸使用 px，不依赖页面 rem 设置。
 */
.nb {
    --nb-red: #8b0e10;
    --nb-red-light: #b3201f;
    --nb-gold: #f8e9ca;
    --nb-brown: #573414;
    --nb-muted: #998263;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    width: 100%;
    overflow: hidden;
    color: var(--nb-brown);
    font-size: 14px;
    line-height: 1.4;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}
.nb *,
.nb *::before,
.nb *::after {
    box-sizing: border-box;
}
.nb[hidden] {
    display: none !important;
}
.nb a {
    color: inherit;
    text-decoration: none;
}
.nb a:focus-visible,
.nb button:focus-visible {
    outline: 2px solid var(--nb-red);
    outline-offset: -2px;
}

/* 左侧标识 */
.nb__badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 100%;
    font-weight: 600;
    white-space: nowrap;
}
.nb__icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}
.nb__viewport {
    position: relative;
    flex: 1;
    min-width: 0;
    height: 100%;
    overflow: hidden;
}
.nb__tag {
    display: inline-block;
    margin-right: 6px;
    padding: 0 5px;
    border-radius: 3px;
    background: var(--nb-red);
    color: #fff;
    font-size: 11px;
    font-style: normal;
    line-height: 17px;
    vertical-align: 1px;
}
.nb__item--hot .nb__text,
.nb__chip--hot {
    color: var(--nb-red);
    font-weight: 600;
}

/* ===== 首页：banner 下方卡片，纵向逐条轮播 ===== */
.nb--home {
    float: left;
    height: 44px;
    margin: .3rem 0 0;
    padding-right: 12px;
    border-radius: .1rem;
    background: #fff;
    box-shadow: 0 2px 10px rgba(139, 14, 16, .06);
}
.nb--home .nb__badge {
    margin-right: 12px;
    padding: 0 12px 0 10px;
    border-radius: 0 22px 22px 0;
    background: linear-gradient(135deg, var(--nb-red-light), var(--nb-red));
    color: var(--nb-gold);
    font-size: 14px;
    letter-spacing: 1px;
}
.nb__list {
    margin: 0;
    padding: 0;
    list-style: none;
    transition: transform .45s ease;
}
.nb__item {
    display: flex;
    align-items: center;
    height: 44px;
}
.nb__item .nb__text {
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nb__more {
    flex-shrink: 0;
    margin-left: 10px;
    color: var(--nb-muted);
    font-size: 13px;
    white-space: nowrap;
}
.nb__more i {
    margin-left: 2px;
    font-style: normal;
}

/* ===== 测算项目页：顶部细条，横向连续滚动 ===== */
.nb--project {
    position: relative;
    z-index: 20;
    height: 36px;
    padding-left: 10px;
    border-bottom: 1px solid #ecd9ae;
    background: linear-gradient(90deg, #fdf5e2, var(--nb-gold));
    font-size: 13px;
}
.nb--sticky {
    position: sticky;
    top: 0;
}
.nb--project .nb__badge {
    margin-right: 8px;
    padding-right: 8px;
    border-right: 1px solid rgba(139, 14, 16, .2);
    color: var(--nb-red);
}
.nb--project .nb__viewport {
    display: flex;
    align-items: center;
    /* 两端渐隐，滚动文字不会硬切 */
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
}
.nb__track {
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nb__group {
    display: inline;
    /* 留出左侧渐隐区，首条文字不被遮住 */
    padding-left: 12px;
}
.nb__chip + .nb__chip::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 4px;
    margin: 0 14px;
    border-radius: 50%;
    background: rgba(139, 14, 16, .35);
    vertical-align: middle;
}
.nb.is-scrolling .nb__track {
    display: inline-flex;
    width: auto;
    overflow: visible;
    will-change: transform;
    animation: nb-marquee 20s linear infinite;
}
.nb.is-scrolling .nb__group {
    display: inline-block;
    flex-shrink: 0;
    padding-right: 56px;
}
.nb--home .nb__group {
    padding-left: 0;
}
.nb.is-scrolling:hover .nb__track,
.nb.is-scrolling:focus-within .nb__track,
.nb.is-background .nb__track,
.nb.is-paused .nb__track {
    animation-play-state: paused;
}
.nb__close {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--nb-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}
.nb__close:active {
    color: var(--nb-red);
}

@keyframes nb-marquee {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

@media (min-width: 750px) {
    .nb--project {
        font-size: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nb__list {
        transition: none;
    }
    .nb.is-scrolling .nb__track {
        animation: none;
    }
}
