/* ============================================================
   音频光影功能 - 古风样式 (v1.0)
   静则留白，动则满盈；不点纯白，一点即生辉
   ============================================================ */

/* ===== 光影 Canvas 覆盖层 ===== */
#audio-light-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.8s ease;
}

#audio-light-canvas.active {
    opacity: 1;
}

/* ===== 四象导航容器增强 ===== */
.four-boxes-section {
    position: relative;
}

/* ===== 音乐主控按钮（中间空隙） ===== */
.audio-music-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%,
        rgba(74, 144, 217, 0.15) 0%,
        rgba(59, 118, 189, 0.08) 40%,
        rgba(44, 88, 144, 0.03) 70%,
        transparent 100%);
    border: 1px solid rgba(74, 144, 217, 0.25);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s ease;
    box-shadow: 0 0 8px rgba(74, 144, 217, 0.1);
    -webkit-tap-highlight-color: transparent;
}

/* 常态：弱光低调 */
.audio-music-btn::before {
    content: '';
    position: absolute;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 50%,
        rgba(74, 144, 217, 0.12) 0%,
        rgba(74, 144, 217, 0.06) 50%,
        transparent 80%);
    transition: all 0.4s ease;
}

/* 音乐图标 */
.audio-music-btn::after {
    content: '';
    position: absolute;
    width: 1.0rem;
    height: 1.2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%234A90D9' stroke='none'%3E%3Cpath d='M12 3v10.55A4 4 0 1 0 14 17V7h4V3h-6z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: all 0.4s ease;
    filter: drop-shadow(0 0 3px rgba(74, 144, 217, 0.5));
}

/* 激活态：微亮 */
.audio-music-btn.active {
    background: radial-gradient(circle at 40% 40%,
        rgba(74, 144, 217, 0.28) 0%,
        rgba(59, 118, 189, 0.18) 40%,
        rgba(44, 88, 144, 0.10) 70%,
        transparent 100%);
    border-color: rgba(74, 144, 217, 0.4);
    box-shadow: 0 0 16px rgba(74, 144, 217, 0.25);
}

.audio-music-btn.active::before {
    background: radial-gradient(circle at 50% 50%,
        rgba(74, 144, 217, 0.22) 0%,
        rgba(74, 144, 217, 0.12) 50%,
        transparent 80%);
}

.audio-music-btn.active::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%234A90D9' stroke='none'%3E%3Cpath d='M12 3v10.55A4 4 0 1 0 14 17V7h4V3h-6z'/%3E%3C/svg%3E");
    filter: drop-shadow(0 0 6px rgba(74, 144, 217, 0.8));
}

/* 暂停图标（播放时显示） */
.audio-music-btn.playing::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%234A90D9' stroke='none'%3E%3Crect x='6' y='4' width='4' height='16' rx='1'/%3E%3Crect x='14' y='4' width='4' height='16' rx='1'/%3E%3C/svg%3E");
    filter: drop-shadow(0 0 6px rgba(74, 144, 217, 0.8));
}

/* 呼吸光效 */
.audio-music-btn.active {
    animation: music-glow 3s ease-in-out infinite;
}

@keyframes music-glow {
    0%, 100% {
        box-shadow: 0 0 12px rgba(74, 144, 217, 0.2);
    }
    50% {
        box-shadow: 0 0 22px rgba(74, 144, 217, 0.35);
    }
}

/* ===== 音量控制按钮（左右空隙） ===== */
.audio-volume-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%,
        rgba(100, 130, 120, 0.12) 0%,
        rgba(80, 100, 90, 0.06) 50%,
        transparent 100%);
    border: 1px solid rgba(100, 130, 120, 0.15);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Ma Shan Zheng', 'STXingkai', 'KaiTi', serif;
    font-size: 1.2rem;
    color: rgba(100, 130, 120, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* 左音量键（空隙1） */
.audio-volume-btn.vol-minus {
    left: 15%;
    transform: translateY(-50%) translateX(-10px);
}

/* 右音量键（空隙3） */
.audio-volume-btn.vol-plus {
    right: 15%;
    transform: translateY(-50%) translateX(10px);
}

/* 激活态 */
.audio-volume-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

.audio-volume-btn:active {
    background: radial-gradient(circle at 40% 40%,
        rgba(100, 130, 120, 0.25) 0%,
        rgba(80, 100, 90, 0.15) 50%,
        transparent 100%);
    border-color: rgba(100, 130, 120, 0.3);
}

/* ===== 静态暗纹点缀 ===== */
.audio-pattern-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.3;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 5 Q35 15 30 25 Q25 15 30 5Z' fill='none' stroke='rgba(180,140,80,0.08)' stroke-width='0.5'/%3E%3Cpath d='M10 30 Q20 25 30 30 Q20 35 10 30Z' fill='none' stroke='rgba(180,140,80,0.06)' stroke-width='0.5'/%3E%3Cpath d='M50 30 Q40 25 30 30 Q40 35 50 30Z' fill='none' stroke='rgba(180,140,80,0.06)' stroke-width='0.5'/%3E%3C/svg%3E");
    background-size: 60px 60px;
    background-position: center;
    transition: opacity 0.8s ease;
}

.audio-pattern-overlay.active {
    opacity: 0.6;
}

/* ===== 光影粒子效果（Canvas 备用 CSS 粒子） ===== */
.audio-particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.audio-particle.active {
    opacity: 1;
}

/* ===== 音量提示浮层 ===== */
.audio-volume-hint {
    position: absolute;
    bottom: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background: rgba(60, 50, 40, 0.85);
    color: rgba(240, 220, 180, 0.95);
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
    border-radius: 0.3rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 20;
    font-family: 'Ma Shan Zheng', 'STXingkai', 'KaiTi', serif;
}

.audio-volume-btn:active .audio-volume-hint {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ===== 移动端适配 ===== */
@media (max-width: 768px) {
    .audio-music-btn {
        width: 1.8rem;
        height: 1.8rem;
    }

    .audio-music-btn::before {
        width: 1.2rem;
        height: 1.2rem;
    }

    .audio-music-btn::after {
        width: 0.6rem;
        height: 0.75rem;
    }

    .audio-volume-btn {
        width: 1.6rem;
        height: 1.6rem;
        font-size: 1rem;
    }

    .audio-volume-btn.vol-minus {
        left: 10%;
    }

    .audio-volume-btn.vol-plus {
        right: 10%;
    }
}

/* ===== 低端设备降级 ===== */
.no-audio-light .audio-music-btn,
.no-audio-light .audio-volume-btn {
    display: none !important;
}

.no-audio-light #audio-light-canvas {
    display: none !important;
}

/* ============================================================
   歌词同步栏样式
   播放音乐时覆盖公告栏，暂停/停止后自动恢复公告栏
   ============================================================ */

/* 歌词栏容器 */
.lyric-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    pointer-events: none;
    overflow: hidden;
}

.lyric-bar.active {
    opacity: 1;
    visibility: visible;
}

/* 歌词轨道 */
.lyric-track {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0 1rem;
    gap: 0.2rem;
}

/* 歌词行 */
.lyric-line {
    display: block;
    font-family: 'Ma Shan Zheng', 'STXingkai', 'KaiTi', 'SimKai', serif;
    font-size: 0.95rem;
    color: rgba(0, 0, 0, 0.45);
    letter-spacing: 0.15em;
    line-height: 1.4;
    text-align: center;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90%;
}

/* 当前歌词行 */
.lyric-line.lyric-active {
    font-size: 1.15rem;
    color: rgba(139, 105, 20, 0.9);
    letter-spacing: 0.25em;
    text-shadow: 0 1px 3px rgba(180, 140, 80, 0.2);
}

.lyric-line.lyric-highlight {
    animation: lyric-glow 2s ease-in-out infinite;
}

@keyframes lyric-glow {
    0%, 100% {
        text-shadow: 0 1px 3px rgba(180, 140, 80, 0.2);
    }
    50% {
        text-shadow: 0 1px 6px rgba(180, 140, 80, 0.35);
    }
}

/* 歌曲信息 */
.lyric-song-info {
    position: absolute;
    bottom: 0.3rem;
    right: 0.8rem;
    font-family: 'Ma Shan Zheng', 'STXingkai', 'KaiTi', serif;
    font-size: 0.65rem;
    color: rgba(139, 105, 20, 0.4);
    letter-spacing: 0.1em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 50%;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .lyric-line {
        font-size: 0.85rem;
        max-width: 85%;
    }

    .lyric-line.lyric-active {
        font-size: 1.05rem;
    }

    .lyric-song-info {
        font-size: 0.6rem;
        right: 0.5rem;
    }
}

