/* 自定义Tailwind配置 */
@layer utilities {
    .text-shadow {
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    }

    .bg-texture {
        background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23c41e3a' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
    }

    .willow-leaf::before,
    .willow-leaf::after {
        content: "";
        display: block;
        width: 40px;
        height: 20px;
        margin: 0 auto;
        background-repeat: no-repeat;
    }

    .willow-leaf::before {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 50'%3E%3Cpath d='M50,5 C30,20 10,30 10,40 C10,45 20,50 30,45 C40,40 60,20 70,10 C80,0 90,5 90,15 C90,25 70,35 50,5 Z' fill='%23c41e3a'/%3E%3C/svg%3E");
    }

    .willow-leaf::after {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 50' transform='rotate(180)'%3E%3Cpath d='M50,5 C30,20 10,30 10,40 C10,45 20,50 30,45 C40,40 60,20 70,10 C80,0 90,5 90,15 C90,25 70,35 50,5 Z' fill='%23c41e3a'/%3E%3C/svg%3E");
    }

    /* 轮播图过渡效果 */
    .carousel-item {
        transition: opacity 1s ease-in-out, transform 1s ease-in-out;
    }

    /* 淡入动画 */
    @keyframes fadeIn {
        from {
            opacity: 0;
        }

        to {
            opacity: 1;
        }
    }

    /* 淡出动画 */
    @keyframes fadeOut {
        from {
            opacity: 1;
        }

        to {
            opacity: 0;
        }
    }

    /* 自定义滚动条 */
    .custom-scrollbar::-webkit-scrollbar {
        height: 8px;
    }

    .custom-scrollbar::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }

    .custom-scrollbar::-webkit-scrollbar-thumb {
        background: #C41E3A;
        /* 宫殿红 */
        border-radius: 4px;
    }

    .custom-scrollbar::-webkit-scrollbar-thumb:hover {
        background: #A01830;
    }
}

/* 悬浮音乐播放器 */
#music-player-container {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.5s ease;
    pointer-events: auto;
}

.music-disc {
    width: 60px;
    height: 60px;
    background: url('https://p1.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg') no-repeat center center;
    background-size: cover;
    border-radius: 50%;
    border: 3px solid #333;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    animation: rotate-disk 10s linear infinite;
    animation-play-state: paused;
    /* 默认暂停 */
    position: relative;
    transition: transform 0.3s;
    pointer-events: auto;
}

.music-disc:hover {
    transform: scale(1.1);
}

.music-disc::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 15px;
    height: 15px;
    background: #000;
    border-radius: 50%;
    border: 2px solid #fff;
}

/* 播放状态：旋转 */
.music-disc.playing {
    animation-play-state: running;
    box-shadow: 0 0 20px rgba(182, 60, 60, 0.6);
    border-color: #B63C3C;
    /* 宫墙红 */
}

/* 等待播放状态：脉冲发光动画，提示用户点击继续播放 */
.music-disc.waiting-to-play {
    animation: pulse-glow 1.5s ease-in-out infinite;
    border-color: #FFD700;
    /* 金色边框 */
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.5), 0 0 20px rgba(255, 215, 0, 0.3);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.8), 0 0 40px rgba(255, 215, 0, 0.5);
        transform: scale(1.08);
    }
}

/* 等待状态时也显示控制条 */
.music-disc.waiting-to-play+.music-controls {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

/* 音乐控制条 */
.music-controls {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 8px 15px;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
    pointer-events: none;
}

#music-player-container:hover .music-controls,
.music-disc.playing+.music-controls {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.song-info {
    font-size: 12px;
    color: #333;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: bold;
}

.control-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    font-size: 14px;
    transition: color 0.3s;
    padding: 0 5px;
}

.control-btn:hover {
    color: #B63C3C;
}

@keyframes rotate-disk {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    #music-player-container {
        bottom: 20px;
        left: 20px;
    }

    .music-disc {
        width: 45px;
        height: 45px;
    }

    /* 移动端点击显示控制条，不自动隐藏 */
    .music-disc.playing+.music-controls {
        display: flex;
        opacity: 1;
        pointer-events: auto;
        transform: translateX(0);
    }
}

/* 移动端音乐播放器适配 */
@media (max-width: 640px) {
    #music-player-container {
        bottom: 10px;
        left: 10px;
        padding: 8px;
        max-width: calc(100% - 20px);
    }
    
    .music-disc {
        width: 40px;
        height: 40px;
    }
    
    .music-controls {
        padding-left: 50px;
    }
    
    .song-info {
        font-size: 10px;
        max-width: 100px;
    }
    
    .control-btn {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
}

/* 移动端地图弹窗适配 */
.tmap-info-window {
    max-width: 280px !important;
}

@media (min-width: 768px) {
    .tmap-info-window {
        max-width: 400px !important;
    }
}