/* 彩蛋：点击正文关键词或末尾光标 → 居中弹出图片（展开），3 秒后自动消失（收起） */

/* 终端风格的闪烁方块光标（纯装饰，大小与文字匹配、底部与文字基线对齐） */
.egg-cursor {
    display: inline-block;
    width: 0.3em;
    height: 1em;
    margin-left: 6px;
    background: var(--accent-color);
    vertical-align: baseline;
    animation: egg-blink 1.2s step-end infinite;
}

/* 正文里的可点击关键词（触发彩蛋） */
.egg-trigger {
    display: inline;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: var(--accent-color);
    cursor: pointer;
    text-decoration: underline dotted;
    text-underline-offset: 3px;
}

.egg-trigger:hover,
.egg-trigger:focus-visible {
    background: none;
}

.egg-trigger:hover {
    text-decoration-style: solid;
}

.egg-trigger:focus-visible {
    outline: 1px solid var(--accent-color);
    outline-offset: 2px;
}

@keyframes egg-blink {
    50% {
        opacity: 0;
    }
}

/* 居中弹出的图片卡片（带半透明遮罩） */
.egg-popup {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.egg-popup.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.3s ease, visibility 0s linear 0s;
}

/* 图片展开/收起动效：显示时从中心一个点放大展开，隐藏时缩小回一个点收起 */
.egg-popup-img {
    max-width: min(60vw, 480px);
    max-height: 70vh;
    width: auto;
    height: auto;
    border: 1px solid var(--accent-color);
    background: var(--background-color);
    box-shadow: 0 0 0 4px var(--background-color);
    transform-origin: center;
    transform: scale(0);
    transition: transform 0.25s ease;
}

.egg-popup.show .egg-popup-img {
    transform: scale(1);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (prefers-reduced-motion: reduce) {
    .egg-cursor {
        animation: none;
    }

    .egg-popup {
        transition: none;
    }

    .egg-popup-img {
        transition: none;
    }
}
