/**
 * 站内公告：顶部滚动条 / 详情弹窗 / 侧栏滚动公告小工具 / 短代码
 * 全部为块级元素，宽度 100%，不参与父级浮动与栅格伸缩。
 */

.ls-notice-bar {
    position: relative;
    z-index: 90;
    width: 100%;
    background: linear-gradient(90deg, #eaf7ef, #f7fbf8 55%, #eaf7ef);
    border-bottom: 1px solid #dceee3;
    color: #35503f;
    font-size: 13px;
    line-height: 1.5;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

.ls-notice-bar * {
    box-sizing: border-box;
}

.ls-notice-bar__inner {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 100%;
    min-height: 38px;
    margin: 0 auto;
    padding: 4px 16px;
}

.ls-notice-bar__label {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border-radius: 999px;
    background: #5fb878;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.ls-notice-bar__stage {
    position: relative;
    flex: 1;
    min-width: 0;
    height: 28px;
    overflow: hidden;
}

.ls-notice-bar__item {
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 28px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #2f4b3a;
    font: inherit;
    text-align: left;
    cursor: pointer;
    opacity: 0;
    transform: translateY(100%);
    transition: transform .35s ease, opacity .35s ease;
    pointer-events: none;
}

.ls-notice-bar__item.is-on {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.ls-notice-bar__item.is-out {
    opacity: 0;
    transform: translateY(-100%);
}

.ls-notice-bar__badge {
    flex: none;
    display: inline-block;
    padding: 1px 7px;
    border-radius: 4px;
    color: #fff;
    font-size: 11px;
    line-height: 17px;
    white-space: nowrap;
}

.ls-notice-bar__text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ls-notice-bar__item:hover .ls-notice-bar__text {
    color: #2f8a4d;
    text-decoration: underline;
}

.ls-notice-bar__pin {
    flex: none;
    color: #e0a020;
    font-size: 11px;
}

.ls-notice-bar__tools {
    flex: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ls-notice-bar__nav,
.ls-notice-bar__all,
.ls-notice-bar__close {
    border: 0;
    background: transparent;
    color: #6b8a76;
    font: inherit;
    cursor: pointer;
    border-radius: 5px;
    transition: background .15s ease, color .15s ease;
}

.ls-notice-bar__nav {
    width: 22px;
    height: 22px;
    line-height: 1;
}

.ls-notice-bar__all {
    padding: 2px 8px;
    font-size: 12px;
}

.ls-notice-bar__close {
    width: 22px;
    height: 22px;
    font-size: 18px;
    line-height: 1;
}

.ls-notice-bar__nav:hover,
.ls-notice-bar__all:hover,
.ls-notice-bar__close:hover {
    background: rgba(95, 184, 120, .14);
    color: #2f8a4d;
}

/* 公告弹窗 */
.ls-notice-modal[hidden] {
    display: none !important;
}

.ls-notice-modal {
    position: fixed;
    inset: 0;
    z-index: 100010;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

.ls-notice-modal *,
.ls-notice-modal *::before,
.ls-notice-modal *::after {
    box-sizing: border-box;
}

.ls-notice-modal__mask {
    position: absolute;
    inset: 0;
    background: rgba(12, 22, 17, .5);
    backdrop-filter: blur(2px);
}

.ls-notice-modal__panel {
    position: relative;
    width: 100%;
    max-width: 540px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 26px 70px -20px rgba(0, 0, 0, .42);
    overflow: hidden;
}

.ls-notice-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #eef2f0;
}

.ls-notice-modal__head h3 {
    margin: 0;
    font-size: 16px;
    color: #1f2d26;
}

.ls-notice-modal__close {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: #f2f5f3;
    color: #6b7c73;
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
}

.ls-notice-modal__body {
    padding: 14px 18px 20px;
    overflow-y: auto;
}

.ls-notice-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ls-notice-list li {
    border-bottom: 1px solid #f0f3f1;
}

.ls-notice-list li:last-child {
    border-bottom: 0;
}

.ls-notice-list__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 4px;
    border: 0;
    background: transparent;
    color: #2a3a32;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.ls-notice-list__item:hover {
    color: #2f8a4d;
}

.ls-notice-list__title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.ls-notice-list__item > i {
    color: #b8c4bd;
    font-size: 12px;
}

.ls-notice-detail__badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 4px;
    background: #5fb878;
    color: #fff;
    font-size: 11px;
}

.ls-notice-detail h4 {
    margin: 10px 0;
    font-size: 17px;
    color: #1f2d26;
}

.ls-notice-detail__content {
    color: #4b5b53;
    font-size: 14px;
    line-height: 1.9;
    white-space: pre-wrap;
    word-break: break-word;
}

.ls-notice-detail__link {
    display: inline-block;
    margin-top: 12px;
    color: #2f8a4d;
    text-decoration: none;
    font-size: 13px;
}

.ls-notice-detail__back {
    display: block;
    margin-top: 18px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #6b7c73;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

/* 侧栏「滚动公告」小工具 */
.ls-notice-widget {
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

.ls-notice-widget__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.ls-notice-widget__head b {
    font-size: 14px;
    color: #2a3a32;
}

.ls-notice-widget__all {
    border: 0;
    background: transparent;
    color: #6b8a76;
    font-size: 12px;
    cursor: pointer;
}

.ls-notice-widget__viewport {
    position: relative;
    overflow: hidden;
    height: 168px;
}

.ls-notice-widget__track {
    display: flex;
    flex-direction: column;
    transition: transform .45s ease;
}

.ls-notice-widget__item {
    display: block;
    height: 42px;
    flex: none;
    padding: 6px 0;
    border-bottom: 1px dashed #eef2f0;
    overflow: hidden;
}

.ls-notice-widget__item:last-child {
    border-bottom: 0;
}

.ls-notice-widget__row {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #3b4b43;
    font-size: 13px;
    line-height: 18px;
}

.ls-notice-widget__title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.ls-notice-widget__title:hover {
    color: #2f8a4d;
}

.ls-notice-widget__excerpt {
    display: block;
    padding-left: 2px;
    color: #93a49a;
    font-size: 11px;
    line-height: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ls-notice-widget__dots {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 8px;
}

.ls-notice-widget__dot {
    width: 5px;
    height: 5px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #d5e2da;
    cursor: pointer;
}

.ls-notice-widget__dot.is-on {
    background: #5fb878;
}

.ls-notice-widget__empty {
    padding: 24px 0;
    text-align: center;
    color: #93a49a;
    font-size: 13px;
}

/* 短代码列表 */
.ls-notice-sc {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0;
}

.ls-notice-sc__item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #e9f1ec;
    border-radius: 8px;
    background: #fbfdfc;
}

.ls-notice-sc__body b {
    font-size: 14px;
    color: #22312a;
}

.ls-notice-sc__body p {
    margin: 3px 0 0;
    font-size: 12px;
    color: #8a9a92;
    line-height: 1.6;
}

.ls-notice-sc--empty {
    padding: 18px;
    text-align: center;
    color: #93a49a;
    font-size: 13px;
    border: 1px dashed #dce7e0;
    border-radius: 8px;
}

@media (max-width: 640px) {
    .ls-notice-bar__inner {
        gap: 8px;
        padding: 4px 10px;
    }

    .ls-notice-bar__label {
        padding: 2px 7px;
        font-size: 11px;
    }

    .ls-notice-bar__nav,
    .ls-notice-bar__all {
        display: none;
    }

    .ls-notice-modal {
        align-items: flex-end;
        padding: 0;
    }

    .ls-notice-modal__panel {
        max-height: 86vh;
        border-radius: 14px 14px 0 0;
    }
}
