/**
 * FlintHub — 外链跳转提醒 · 前台样式
 *
 * ⚠️ 只用核心**已定义**的 `--mn-*` 变量（清单见 assets/css/modern.css）——
 *    `--mn-danger` 存在，但 `--mn-radius-*` / `--mn-spectrum-*` **不存在**，别凭印象写。
 * ⚠️ 隐藏工具类一律 `display: none !important`：插件 CSS 在 `main.php:40` 注入，
 *    **早于**核心 `editor.css` → 同权重核心后胜；不给 `!important` 会被静默压掉。
 * ⚠️ z-index 取 **100020** —— 核心浮层天花板实测为 100005（`.image-lightbox` = 99999），
 *    且需**高于** notice_center 的 100010（两个弹窗可能同时存在，外链确认框应在最上层）。
 * ⚠️ 按钮直接用核心全局类 `.mn-btn` / `.mn-btn-primary`（`modern.css:1067` / `:1089`）
 *    → 天然与全站一致，且核心改按钮样式会自动跟随，**不自造按钮样式**。
 * ⚠️ 本文件不参与后台（后台用核心 assets/admin.css）。
 *
 * @file plugins/external_link_guard/assets/style.css
 * @package Plugin\ExternalLinkGuard
 */

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

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

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

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

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

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

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

.elg-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 24px 24px 20px;
    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: elg-pop-in 0.2s ease-out;
}

.elg-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;
}

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

/* ==================== 文案 ==================== */

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

.elg-desc {
    margin: 0 0 6px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--mn-text-secondary);
}

/* 目标域名（由 JS 填入 textContent） */
.elg-host {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--mn-text-link);
    word-break: break-all;
    overflow-wrap: anywhere;
}

.elg-hint {
    margin: 0;
    font-size: 12px;
    line-height: 1.6;
    color: var(--mn-text-muted);
}

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

.elg-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

/* `.mn-btn` 是 button 样式，用在 <a> 上需去掉下划线。
   ⚠️ 核心 `.mn-btn` 未定义 text-decoration → 本规则不会被压掉（CSS 按属性覆盖，非按规则）。 */
.elg-btn-go {
    text-decoration: none;
}

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

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

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

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

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

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

    .elg-dialog {
        max-width: none;
        max-height: calc(100vh - 24px);
        padding: 20px 18px 16px;
    }

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

    .elg-actions {
        justify-content: stretch;
    }

    .elg-actions .mn-btn {
        flex: 1 1 auto;
    }
}
