/* ============ 语音朗读功能样式 ============ */
/* 左下角语音按钮 */
.voice-btn {
    position: fixed;
    bottom: 16px;
    left: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid #2DD4BF;
    background: linear-gradient(135deg, #0F2557 0%, #1A3A6E 100%);
    z-index: 9999;
    box-shadow: 0 4px 16px rgba(15, 37, 87, 0.4);
    transition: all 0.3s ease;
    padding: 0;
    /* 移动端优化 */
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.voice-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(45, 212, 191, 0.5);
}

.voice-btn:active {
    transform: scale(0.95);
}

.voice-btn .voice-icon {
    font-size: 20px;
    transition: animation 0.3s ease;
    line-height: 1;
}

.voice-btn.is-playing {
    border-color: #5EEAD4;
    box-shadow: 0 0 20px rgba(94, 234, 212, 0.6);
    animation: voice-glow 2s ease-in-out infinite;
}

.voice-btn.is-playing .voice-icon {
    animation: voice-rotate 1.2s linear infinite;
}

.voice-btn:not(.is-playing) .voice-icon {
    animation: none;
}

@keyframes voice-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes voice-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(94, 234, 212, 0.4); }
    50% { box-shadow: 0 0 30px rgba(94, 234, 212, 0.7); }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .voice-btn {
        width: 40px;
        height: 40px;
        bottom: 16px;
        left: 16px;
    }
    .voice-btn .voice-icon {
        font-size: 20px;
    }
}

/* 小屏移动端适配 */
@media (max-width: 360px) {
    .voice-btn {
        width: 36px;
        height: 36px;
        bottom: 14px;
        left: 14px;
    }
    .voice-btn .voice-icon {
        font-size: 18px;
    }
}

/* iPhone安全区适配 */
@supports (padding: max(0px)) {
    @media (max-width: 768px) {
        .voice-btn {
            bottom: max(16px, env(safe-area-inset-bottom));
            left: max(16px, env(safe-area-inset-left));
        }
    }
}

/* 深色模式适配（如果页面支持） */
[data-theme="dark"] .voice-btn {
    background: linear-gradient(135deg, #0F2557 0%, #1A3A6E 100%);
    border-color: #2DD4BF;
}

[data-theme="light"] .voice-btn {
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    border-color: #1A3A6E;
}

/* 减少动画（尊重用户设置） */
@media (prefers-reduced-motion: reduce) {
    .voice-btn.is-playing {
        animation: none;
    }
    .voice-btn.is-playing .voice-icon {
        animation: none;
    }
}
/* ============ 语音朗读功能样式结束 ============ */
