/* ============================================================
   通知公告展示样式系统
   统一 Topbar / Banner / Popup / List 四种展示效果
   ============================================================ */

/* ---------- CSS 变量 ---------- */
:root {
    --notification-primary: #4f46e5;
    --notification-primary-dark: #4338ca;
    --notification-accent: #f59e0b;
    --notification-success: #059669;
    --notification-warning: #d97706;
    --notification-danger: #dc2626;
    --notification-text: #1d2327;
    --notification-text-muted: #646970;
    --notification-bg: #ffffff;
    --notification-border: #e2e8f0;
    --notification-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    --notification-shadow-lg: 0 30px 80px rgba(15, 23, 42, 0.25);
    --notification-radius: 12px;
    --notification-radius-lg: 24px;
    --notification-transition: 0.3s ease;
}

/* ---------- Topbar 顶部通知 ---------- */
.notification-topbar {
    position: sticky;
    top: 0;
    z-index: 80;
    color: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
    overflow: hidden;
    background: linear-gradient(90deg, #f59e0b 0%, #f97316 50%, #fb923c 100%);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.notification-topbar.is-hidden {
    transform: translateY(-100%);
    opacity: 0;
}

.notification-topbar__inner {
    position: relative;
    z-index: 1;
    padding: 10px 18px;
    min-height: 60px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-topbar__icon {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    flex-shrink: 0;
}

.notification-topbar__content {
    flex: 1;
    min-width: 0;
}

.notification-topbar__title {
    font-weight: 700;
    line-height: 1.5;
}

.notification-topbar__text {
    font-size: 13px;
    opacity: 0.9;
    margin-top: 4px;
}

.notification-topbar__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.notification-topbar__image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.82), rgba(15, 23, 42, 0.52));
}

.notification-topbar__close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.notification-topbar__close:hover {
    background: rgba(255, 255, 255, 0.28);
}

.notification-topbar__controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.notification-topbar__controls button {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.notification-topbar__controls button:hover {
    background: rgba(255, 255, 255, 0.28);
}

.notification-topbar__dots {
    display: flex;
    gap: 4px;
    margin-left: 8px;
}

.notification-topbar__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition: background 0.15s;
}

.notification-topbar__dot.is-active {
    background: #fff;
}

/* ---------- Banner 横幅轮播 ---------- */
.notification-banner {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    position: relative;
}

.notification-banner__slide {
    aspect-ratio: 21/6;
    background: #e2e8f0;
    position: relative;
    overflow: hidden;
}

.notification-banner__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.notification-banner__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(15, 23, 42, 0.7) 100%);
}

.notification-banner__content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 16px 20px;
    color: #fff;
}

.notification-banner__title {
    font-size: 18px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.notification-banner__text {
    font-size: 13px;
    margin-top: 6px;
    opacity: 0.9;
}

.notification-banner__dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    background: #fff;
}

.notification-banner__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #dcdcde;
    transition: all 0.3s;
}

.notification-banner__dot.is-active {
    background: var(--notification-primary);
    width: 20px;
    border-radius: 4px;
}

/* ---------- Popup 弹窗公告 ---------- */
.notification-popup {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(15, 23, 42, 0.56);
    backdrop-filter: blur(10px);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: popupFadeIn 0.3s ease;
}

@keyframes popupFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.notification-popup__panel {
    width: min(520px, 100%);
    max-height: calc(100vh - 40px);
    background: #fff;
    border-radius: var(--notification-radius-lg);
    overflow: hidden;
    box-shadow: var(--notification-shadow-lg);
    display: flex;
    flex-direction: column;
    animation: popupSlideUp 0.3s ease;
}

@keyframes popupSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.notification-popup__image {
    aspect-ratio: 16/9;
    background: #e2e8f0;
    flex-shrink: 0;
}

.notification-popup__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.notification-popup__body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    min-height: 0;
}

.notification-popup__badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    color: var(--notification-primary);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.notification-popup__title {
    margin-top: 14px;
    margin-bottom: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.35;
    color: #0f172a;
}

.notification-popup__content {
    margin-top: 16px;
    color: #475569;
    font-size: 14px;
    line-height: 1.75;
}

.notification-popup__footer {
    flex-shrink: 0;
    padding: 16px 24px;
    background: #fff;
    border-top: 1px solid #f1f5f9;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.06);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.notification-popup__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 110px;
    height: 44px;
    padding: 0 18px;
    border-radius: 12px;
    border: 1.5px solid #e0e7ff;
    background: #fff;
    color: var(--notification-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.15s;
}

.notification-popup__link:hover {
    background: #e0e7ff;
}

.notification-popup__confirm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 110px;
    height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--notification-primary), #6366f1);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
    transition: filter 0.15s;
}

.notification-popup__confirm:hover {
    filter: brightness(1.08);
}

.notification-popup__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.notification-popup__close:hover {
    background: #e2e8f0;
}

/* ---------- List 公告列表 ---------- */
.notification-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification-list__item {
    background: #fff;
    border-radius: var(--notification-radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--notification-border);
    transition: box-shadow 0.15s, transform 0.15s;
}

.notification-list__item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.notification-list__item.is-unread {
    border-left: 3px solid var(--notification-primary);
}

.notification-list__image {
    aspect-ratio: 16/9;
    background: #e2e8f0;
}

.notification-list__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.notification-list__body {
    padding: 16px;
}

.notification-list__label {
    font-size: 11px;
    color: var(--notification-text-muted);
    margin-bottom: 6px;
}

.notification-list__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--notification-text);
}

.notification-list__content {
    margin-top: 8px;
    font-size: 13px;
    color: #475569;
    line-height: 1.6;
}

.notification-list__meta {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #8c8f94;
}

.notification-list__unread {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--notification-primary);
}

/* ---------- 富文本内容 ---------- */
.notification-richtext {
    word-break: break-word;
}

.notification-richtext > :first-child { margin-top: 0; }
.notification-richtext > :last-child { margin-bottom: 0; }

.notification-richtext p,
.notification-richtext div,
.notification-richtext ul,
.notification-richtext ol,
.notification-richtext blockquote,
.notification-richtext h3,
.notification-richtext h4 {
    margin: 0 0 .8em;
}

.notification-richtext ul,
.notification-richtext ol {
    padding-left: 1.4em;
}

.notification-richtext span {
    color: inherit;
}

.notification-richtext a {
    color: inherit;
    text-decoration: underline;
}

.notification-richtext img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: .9em auto;
    border-radius: .5rem;
}

.notification-richtext blockquote {
    padding-left: .9em;
    border-left: 3px solid currentColor;
    opacity: .9;
}

.notification-richtext h3,
.notification-richtext h4 {
    font-weight: 700;
    line-height: 1.45;
}

/* ---------- 响应式适配 ---------- */
@media (max-width: 782px) {
    .notification-topbar__inner {
        padding: 8px 12px;
        min-height: 50px;
    }

    .notification-banner__slide {
        aspect-ratio: 16/9;
    }

    .notification-banner__content {
        padding: 12px 16px;
    }

    .notification-banner__title {
        font-size: 16px;
    }

    .notification-popup {
        padding: 10px;
    }

    .notification-popup__panel {
        border-radius: 16px;
    }

    .notification-popup__body {
        padding: 16px;
    }

    .notification-popup__footer {
        padding: 12px 16px;
    }

    .notification-popup__link,
    .notification-popup__confirm {
        min-width: 80px;
        height: 40px;
        font-size: 13px;
    }

    .notification-list__body {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .notification-topbar__controls {
        display: none;
    }

    .notification-popup__footer {
        flex-direction: column;
    }

    .notification-popup__link,
    .notification-popup__confirm {
        width: 100%;
    }
}
