:root {
    --primary-color: #00ff41; /* Matrix Green */
    --secondary-color: #008f11; /* Darker Green */
    --accent-color: #d6ebff; /* Mathematical White/Blue */
    --bg-color: #000500; /* Deep Black */
}

body {
    margin: 0;
    overflow: hidden;
    background-color: var(--bg-color);
    font-family: 'Courier New', Courier, monospace;
    color: var(--primary-color);
}

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align to top */
    padding-top: 60px;       /* Explicit 60px from top */
    box-sizing: border-box;
    pointer-events: none; /* Let clicks pass through to canvas if needed */
    background: radial-gradient(circle, transparent 20%, #000000 120%); /* Vignette */
}

.content {
    text-align: center;
    pointer-events: auto;
    z-index: 3;
    padding: 0.8rem 1.5rem; /* 大幅缩小内边距 */
    border: 1px solid var(--secondary-color);
    background: rgba(0, 5, 0, 0.7);
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.2);
    backdrop-filter: blur(5px);
}

h1.glitch {
    font-size: 4rem;
    font-weight: bold;
    text-transform: uppercase;
    position: relative;
    text-shadow: 0.05em 0 0 rgba(255,0,0,0.75),
                -0.025em -0.05em 0 rgba(0,255,0,0.75),
                0.025em 0.05em 0 rgba(0,0,255,0.75);
    animation: glitch 2s infinite;
    margin: 0; /* 移除默认margin */
}

h1.glitch::before, h1.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
}

h1.glitch::before {
    left: 2px;
    text-shadow: -1px 0 red;
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-1 2.5s infinite linear alternate-reverse;
}

h1.glitch::after {
    left: -2px;
    text-shadow: -1px 0 blue;
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

.subtitle {
    font-size: 1.2rem;
    letter-spacing: 0.5rem;
    margin-top: 0.3rem; /* 缩小间距 */
    color: var(--accent-color);
    text-shadow: 0 0 10px var(--accent-color);
}

.email-text {
    font-size: 0.9rem;
    margin-top: 0.2rem; /* 缩小间距 */
    color: var(--primary-color);
    text-shadow: 0 0 5px var(--primary-color);
    opacity: 0.8;
    letter-spacing: 0.05rem;
}

.terminal-text {
    margin-top: 0.8rem; /* 缩小间距 */
    font-size: 1.4rem;
    min-height: 2rem;
    color: var(--primary-color);
}

.cursor {
    animation: blink 1s step-end infinite;
}

/* Cyber Button */
.cyber-btn {
    margin-top: 0.8rem; /* 缩小间距 */
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.6rem 1.2rem; /* 缩小按钮内边距 */
    font-family: inherit;
    font-size: 0.9rem; /* 稍微缩小字体 */
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cyber-btn:hover {
    background: var(--primary-color);
    color: var(--bg-color);
    box-shadow: 0 0 15px var(--primary-color);
}

.cyber-btn.active {
    background: var(--primary-color);
    color: var(--bg-color);
    box-shadow: 0 0 20px var(--primary-color), inset 0 0 10px #fff;
    border-color: #fff;
}

/* Music Status Indicator */
.music-status {
    margin-top: 0.6rem; /* 缩小间距 */
    font-size: 1.5rem; /* 大字体 */
    color: var(--primary-color);
    font-weight: bold;
    text-shadow: 0 0 15px var(--primary-color);
    animation: attention 1.5s ease-in-out infinite; /* 醒目动画 */
    transition: all 0.5s ease;
}

.music-status.playing {
    font-size: 0.75rem; /* 播放后变小 */
    font-weight: normal;
    text-shadow: none;
    opacity: 0.6;
    animation: pulse 2s ease-in-out infinite; /* 切换到温和的脉动 */
}

/* 醒目提示动画 */
@keyframes attention {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.7; 
        transform: scale(1.05);
    }
}

/* 播放中的温和脉动 */
@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.3; }
}

/* CRT Scanlines */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0),
        rgba(255,255,255,0) 50%,
        rgba(0,0,0,0.2) 50%,
        rgba(0,0,0,0.2)
    );
    background-size: 100% 4px;
    pointer-events: none;
    opacity: 0.6;
}

/* Animations */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@keyframes glitch-anim-1 {
    0% { clip: rect(20px, 9999px, 80px, 0); }
    20% { clip: rect(10px, 9999px, 10px, 0); }
    40% { clip: rect(80px, 9999px, 20px, 0); }
    60% { clip: rect(50px, 9999px, 60px, 0); }
    80% { clip: rect(0px, 9999px, 100px, 0); }
    100% { clip: rect(90px, 9999px, 30px, 0); }
}

@keyframes glitch-anim-2 {
    0% { clip: rect(60px, 9999px, 40px, 0); }
    20% { clip: rect(10px, 9999px, 90px, 0); }
    40% { clip: rect(50px, 9999px, 10px, 0); }
    60% { clip: rect(90px, 9999px, 20px, 0); }
    80% { clip: rect(30px, 9999px, 80px, 0); }
    100% { clip: rect(70px, 9999px, 50px, 0); }
}

/* ICP备案信息样式 */
.icp-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 12px 0;
    text-align: center;
    background: rgba(0, 5, 0, 0.8);
    z-index: 11;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.75rem;
    color: var(--secondary-color);
    text-shadow: 0 0 5px rgba(0, 255, 65, 0.3);
    pointer-events: auto;
    backdrop-filter: blur(3px);
}

.icp-footer a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: all 0.3s ease;
    letter-spacing: 0.05em;
}

.icp-footer a:hover {
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-color);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    h1.glitch { font-size: 2rem; }
    .subtitle { font-size: 0.8rem; letter-spacing: 0.2rem; }
    .email-text { font-size: 0.7rem; }
    .icp-footer { font-size: 0.65rem; padding: 10px 0; }
    .content { padding: 0.5rem 1rem; } /* 移动端更紧凑 */
    .cyber-btn { font-size: 0.8rem; padding: 0.5rem 1rem; }
    .music-status { font-size: 1.2rem; }
    .music-status.playing { font-size: 0.65rem; }
}
