/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #0c0c0c; /* 深邃的、接近纯黑的背景 */
    color: #fff;
    font-family: 'Noto Sans SC', sans-serif;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* 扫描线效果 */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(255, 255, 255, 0.05),
        rgba(255, 255, 255, 0.05) 1px,
        transparent 1px,
        transparent 4px
    );
    z-index: -1;
    pointer-events: none; /* 让鼠标可以穿透这层 */
}

/* 居中容器 */
.container {
    text-align: center;
}

/* 单词样式 */
.word-cyberpunk {
    font-size: 20vw;
    font-weight: 900;
    letter-spacing: 0.2em;
    cursor: pointer;
    user-select: none;
    padding: 0 0.2em;
}

/* 核心：单个字的样式和故障效果 */
.letter {
    display: inline-block;
    position: relative; /* 为伪元素定位 */
    color: #00ffff; /* 经典的赛博朋克青色 */
    /* 多层 text-shadow 创造强烈的霓虹光晕 */
    text-shadow:
        0 0 5px #00ffff,
        0 0 10px #00ffff,
        0 0 20px #00ffff,
        0 0 40px #00aaff,
        0 0 70px #00aaff;
    transition: transform 0.8s ease-out, opacity 0.8s ease-out;
}

/* --- Glitch 故障效果 --- */
.letter::before,
.letter::after {
    content: attr(data-text); /* 关键！获取JS设置的文字 */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0c0c0c;
    overflow: hidden;
    clip-path: inset(50% 0 50% 0); /* 默认只显示中间一小部分 */
}

/* 错位的青色通道 */
.letter::before {
    color: #00ffff;
    text-shadow: -2px 0 #ff00ff; /* 添加品红色阴影 */
    animation: glitch-anim-1 2.5s infinite linear alternate-reverse;
}

/* 错位的品红色通道 */
.letter::after {
    color: #ff00ff;
    text-shadow: 2px 0 #00ffff; /* 添加青色阴影 */
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

/* Glitch 动画 Keyframes */
@keyframes glitch-anim-1 {
    0%, 100% { clip-path: inset(45% 0 55% 0); transform: translate(-0.05em, 0); }
    10%, 90% { clip-path: inset(20% 0 70% 0); }
    20%, 80% { clip-path: inset(80% 0 10% 0); transform: translate(0.05em, 0); }
    30%, 70% { clip-path: inset(30% 0 60% 0); }
    40%, 60% { clip-path: inset(10% 0 85% 0); }
    50% { clip-path: inset(60% 0 30% 0); transform: translate(0.02em, 0.02em); }
}
@keyframes glitch-anim-2 {
    0%, 100% { clip-path: inset(90% 0 5% 0); transform: translate(0.05em, -0.02em); }
    25% { clip-path: inset(10% 0 80% 0); }
    50% { clip-path: inset(50% 0 50% 0); transform: translate(-0.05em, 0.02em); }
    75% { clip-path: inset(5% 0 90% 0); }
}

/* 提示文字 */
.hint {
    font-family: 'Courier New', Courier, monospace; /* 使用等宽字体，更有终端感 */
    margin-top: 30px;
    font-size: 1rem;
    color: #00ff00; /* 经典的终端绿色 */
    text-shadow: 0 0 5px #00ff00;
    letter-spacing: 3px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .word-cyberpunk {
        font-size: 30vw;
        letter-spacing: 0.1em;
    }
    .hint {
        font-size: 0.8rem;
    }
}