/* === State_Aurora (微光) === */
body.state-aurora .line-num {
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    color: #a0a0c0;
}

body.state-aurora .code-area {
    /* Slight glow/stroke effect */
    text-shadow: 0 0 1px rgba(248, 248, 242, 0.5);
}

body.state-aurora .code-line::after {
    opacity: 1; /* Always visible */
    animation: floatComment 3s ease-in-out infinite;
    content: attr(data-source) " ♡";
    color: #ffb86c;
}

@keyframes floatComment {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* === State_Vitrimura (崩坏前夕) === */
body.state-vitrimura .line-num {
    transform: rotate(5deg);
    filter: blur(0.5px);
    color: rgba(255, 85, 85, 0.8);
    background: rgba(50, 0, 0, 0.2);
}

body.state-vitrimura .code-area {
    background: linear-gradient(180deg, rgba(80, 20, 20, 0.4) 0%, rgba(60, 10, 10, 0.8) 100%);
}

body.state-vitrimura .code-line span {
    display: inline-block;
    animation: brownianMotion 0.2s infinite;
    color: #ff5555 !important; /* Override syntax highlighting */
    text-shadow: 2px 0 0 rgba(0,0,0,0.5);
}

@keyframes brownianMotion {
    0% { transform: translate(0, 0); }
    25% { transform: translate(1px, 1px); }
    50% { transform: translate(-1px, 0); }
    75% { transform: translate(0, -1px); }
    100% { transform: translate(0, 0); }
}

body.state-vitrimura .code-line::after {
    animation: flashComment 0.5s infinite alternate;
    transition-delay: 1s; /* Delay appearance */
    opacity: 0;
}

body.state-vitrimura .code-line:hover::after {
    opacity: 1;
    transition-delay: 0s;
}

/* Keep visible for 3s after hover - handled by transition delay on the base class if needed, 
   but here we want specific behavior. We can use a long transition duration for opacity on the non-hover state */
body.state-vitrimura .code-line::after {
    transition: opacity 3s ease;
}

@keyframes flashComment {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* === State_Nostofobia (彻底崩坏) === */
body.state-nostofobia {
    background: #000;
}

body.state-nostofobia .window {
    box-shadow: 0 0 0 0 rgba(0,0,0,0);
    border: 1px solid #ff0000;
}

body.state-nostofobia .line-num {
    /* JS will handle random visibility */
    color: #333;
}

body.state-nostofobia .code-area {
    background: #050000;
}

body.state-nostofobia .code-line span {
    display: inline-block;
    /* Character level chaos handled by JS splitting, here just base styles */
}

body.state-nostofobia .macro-error {
    display: block;
    font-size: 1.5em;
    font-weight: 900;
    color: #ff0000;
    transform: rotate(-2deg) scale(1.1);
    text-shadow: 4px 4px 0 #000;
    animation: pulseError 0.1s infinite;
}

@keyframes pulseError {
    0% { transform: rotate(-2deg) scale(1.1); }
    50% { transform: rotate(2deg) scale(1.15); }
    100% { transform: rotate(-2deg) scale(1.1); }
}

body.state-nostofobia .code-line::after {
    display: none;
}
