/* =========================================================
   《熵界》终极视觉组件 - 高维CRT滤镜与故障特效
   ========================================================= */

/* 【1】全屏微弱CRT扫描线 (Scanlines) - 模拟视网膜植入物的视觉 */
body::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 999;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none; /* 确保不影响鼠标点击 */
}

/* 【2】故障闪烁动画定义 (Glitch Keyframes) */
@keyframes systemErrorGlow {
    0% { box-shadow: 0 0 5px #d92d20, inset 0 0 5px #d92d20; border-color: #d92d20; }
    50% { box-shadow: 0 0 20px #d92d20, inset 0 0 15px rgba(217, 45, 32, 0.5); border-color: #ff0000; }
    100% { box-shadow: 0 0 5px #d92d20, inset 0 0 5px #d92d20; border-color: #d92d20; }
}

@keyframes textGlitch {
    0% { transform: translate(0) }
    20% { transform: translate(-2px, 1px) }
    40% { transform: translate(-1px, -1px) }
    60% { transform: translate(2px, 1px) }
    80% { transform: translate(1px, -1px) }
    100% { transform: translate(0) }
}

/* 【3】强制识别并渲染代码框中的状态栏 (HUD Render) */
/* 只要AI输出的Markdown代码块包含状态栏，直接变红并开始呼吸闪烁 */
pre code {
    font-family: 'Consolas', 'Courier New', monospace !important;
    text-shadow: 0 0 2px rgba(0, 240, 255, 0.3) !important;
}

/* 针对危险状态栏的特殊框体异化 */
pre:has(code:contains("⚠️")) {
    background-color: #1a0505 !important; /* 极暗的血红色背景 */
    border: 1px solid #d92d20 !important;
    animation: systemErrorGlow 2s infinite alternate !important;
    color: #ff4d4d !important;
}

/* 状态栏内标题的轻微故障抖动 */
pre code:contains("⚠️ 实时演算监控 ⚠️") {
    display: inline-block;
    animation: textGlitch 4s infinite linear alternate-reverse !important;
}