/**
 * FlintHub — 公告弹窗中心 · 前台样式
 *
 * ⚠️ 只用核心**已定义**的 `--mn-*` 变量（清单见 assets/css/modern.css）——
 *    `--mn-danger` 存在，但 `--mn-radius-*` / `--mn-spectrum-*` **不存在**，别凭印象写。
 * ⚠️ 隐藏工具类一律 `display: none !important`：插件 CSS 在 `main.php:40` 注入，
 *    **早于**核心 `editor.css` → 同权重核心后胜；不给 `!important` 会被静默压掉。
 * ⚠️ z-index 取 **100010** —— 核心浮层天花板实测为 100005（`.image-lightbox` = 99999）。
 * ⚠️ 本文件不参与后台（后台用 assets/admin.css）。
 *
 * @file plugins/notice_center/assets/style.css
 * @package Plugin\NoticeCenter
 */

/* ==================== 根容器 ==================== */

.ntc-root {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 100010;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.ntc-root[hidden] {
    display: none !important;
}

/* 弹窗显示时锁 body 滚动（由 JS 挂 class，不用内联 style） */
body.ntc-lock {
    overflow: hidden;
}

/* ==================== 遮罩 ==================== */

.ntc-mask {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: var(--mn-comp-overlay-bg);
    animation: ntc-fade-in 0.2s ease-out;
}

/* ==================== 对话卡 ==================== */

.ntc-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 460px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: var(--mn-bg-card);
    border: 1px solid var(--mn-border);
    border-radius: 14px;
    box-shadow: var(--mn-shadow-float);
    box-sizing: border-box;
    animation: ntc-pop-in 0.2s ease-out;
}

.ntc-close {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--mn-text-muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.ntc-close:hover {
    background: var(--mn-bg-row-hover);
    color: var(--mn-text);
}

/* ==================== 单条公告 ==================== */

.ntc-notice {
    padding: 24px 24px 20px;
}

.ntc-notice[hidden] {
    display: none !important;
}

.ntc-title {
    margin: 0 0 12px;
    padding-right: 28px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--mn-text);
}

.ntc-notice-urgent .ntc-title {
    color: var(--mn-error);
}

.ntc-notice-guide .ntc-title {
    color: var(--mn-primary);
}

.ntc-content {
    font-size: 14px;
    line-height: 1.75;
    color: var(--mn-text-secondary);
    word-break: break-word;
    overflow-wrap: anywhere;
}

.ntc-content p {
    margin: 0 0 10px;
}

.ntc-content p:last-child {
    margin-bottom: 0;
}

.ntc-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.ntc-content a {
    color: var(--mn-text-link);
}

.ntc-content ul,
.ntc-content ol {
    margin: 0 0 10px;
    padding-left: 22px;
}

.ntc-content blockquote {
    margin: 0 0 10px;
    padding: 8px 12px;
    border-left: 3px solid var(--mn-border);
    background: var(--mn-bg);
    color: var(--mn-text-muted);
}

/* ==================== 按钮 ==================== */

.ntc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.ntc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 20px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.ntc-btn-primary {
    background: var(--mn-primary);
    color: var(--mn-text-white);
}

.ntc-btn-primary:hover {
    background: var(--mn-primary-hover);
    color: var(--mn-text-white);
}

/* ==================== 动画 ==================== */

@keyframes ntc-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes ntc-pop-in {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to   { opacity: 1; transform: none; }
}

/* 尊重系统「减少动态效果」偏好 */
@media (prefers-reduced-motion: reduce) {
    .ntc-mask,
    .ntc-dialog {
        animation: none;
    }
}

/* ==================== 窄屏 ==================== */

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

    .ntc-dialog {
        max-width: none;
        max-height: calc(100vh - 24px);
    }

    .ntc-notice {
        padding: 20px 18px 16px;
    }

    .ntc-title {
        font-size: 16px;
    }
}
