/* ===========================================
 * AI 朗读功能样式
 * =========================================== */

/* 悬浮耳机按钮 + 提示框 */
.tts-trigger-btn {
    position: relative;
    cursor: pointer;
}
.tts-trigger-btn.is-playing {
    --this-color: var(--theme-color) !important;
}
.tts-trigger-btn::after {
    content: attr(data-tts-tip);
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(-8px);
    background: rgba(30, 30, 30, 0.92);
    color: #fff;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1001;
}
.tts-trigger-btn:hover::after {
    opacity: 1;
}

/* 底部浮动播放条 */
.tts-bottom-bar {
    position: fixed;
    left: 50%;
    bottom: 80px;
    transform: translate(-50%, 20px);
    width: min(92%, 420px);
    background: var(--float-btn-bg, rgba(40,40,40,0.7));
    backdrop-filter: saturate(2) blur(10px);
    -webkit-backdrop-filter: saturate(2) blur(10px);
    border-radius: 999px;
    padding: 8px 10px 8px 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.tts-bottom-bar.show {
    transform: translate(-50%, 0);
    opacity: 1;
    pointer-events: auto;
}
.tts-bar-inner {
    display: flex;
    align-items: center;
    gap: 10px;
}
.tts-play-pause {
    width: 36px; height: 36px; min-width: 36px;
    border-radius: 50%;
    background: var(--theme-color);
    color: #fff; border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0;
}
.tts-progress-area {
    flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0;
}
#ttsSeek {
    flex: 1; height: 4px; -webkit-appearance: none;
    background: rgba(255,255,255,0.25); border-radius: 4px; outline: none;
}
#ttsSeek::-webkit-slider-thumb {
    -webkit-appearance: none; width: 12px; height: 12px;
    border-radius: 50%; background: #fff; cursor: pointer;
}
.tts-time {
    font-size: 12px; color: rgba(255,255,255,0.85);
    flex-shrink: 0; min-width: 32px; text-align: right;
}
.tts-speed-wrap {
    position: relative; flex-shrink: 0;
}
.tts-speed-btn {
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255,255,255,0.15); color: #fff; border: none;
    font-size: 12px; cursor: pointer;
}
.tts-speed-menu {
    display: none; position: absolute; bottom: 44px; right: 0;
    background: var(--float-btn-bg, rgba(40,40,40,0.9));
    backdrop-filter: saturate(2) blur(10px);
    -webkit-backdrop-filter: saturate(2) blur(10px);
    border-radius: 10px; overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    min-width: 64px;
}
.tts-speed-menu.show { display: block; }
.tts-speed-option {
    padding: 8px 14px; font-size: 13px; color: #fff;
    text-align: center; cursor: pointer; white-space: nowrap;
}
.tts-speed-option:hover, .tts-speed-option.active {
    background: var(--theme-color);
}

/* ===========================================
 * AI 朗读功能 - 样式
 * =========================================== */

.tts-trigger-btn {
    position: relative;
    cursor: pointer;
    --tts-tip-bg: rgba(0, 0, 0, 0.95);
}
.tts-trigger-btn.is-playing {
    --this-color: var(--theme-color) !important;
}
.tts-trigger-btn::after {
    content: attr(data-tts-tip);
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(-8px);
    background: var(--tts-tip-bg) !important;
    color: #fff !important;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1001;
}
.tts-trigger-btn:hover::after { opacity: 1; }
.tts-trigger-btn::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-right: -2px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent transparent var(--tts-tip-bg) !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1002;
}
.tts-trigger-btn:hover::before { opacity: 1; }

.tts-bottom-bar {
    position: fixed !important;
    left: 50%;
    bottom: 130px;
    transform: translate(-50%, 20px);
    width: min(90%, 320px);
    background: var(--float-btn-bg, rgba(40,40,40,0.75));
    backdrop-filter: saturate(2) blur(10px);
    -webkit-backdrop-filter: saturate(2) blur(10px);
    border-radius: 999px;
    padding: 8px 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    z-index: 999998;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.tts-bottom-bar.show {
    transform: translate(-50%, 0);
    opacity: 1;
    pointer-events: auto;
}
.tts-bar-inner { display: flex; align-items: center; gap: 8px; }

.tts-play-pause {
    width: 30px; height: 30px; min-width: 30px;
    border-radius: 50%;
    background: var(--theme-color);
    color: #fff; border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0;
}

#ttsSeek {
    flex: 1; height: 4px; -webkit-appearance: none;
    background: rgba(255,255,255,0.25); border-radius: 4px; outline: none;
    margin: 0;
}
#ttsSeek::-webkit-slider-thumb {
    -webkit-appearance: none; width: 12px; height: 12px;
    border-radius: 50%; background: #fff; cursor: pointer;
}

.tts-speed-wrap { position: relative; flex-shrink: 0; }
.tts-speed-btn {
    width: 30px; height: 30px; border-radius: 50%;
    background: rgba(255,255,255,0.15); color: #fff; border: none;
    font-size: 11px; cursor: pointer;
}
.tts-speed-menu {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--float-btn-bg, rgba(30,30,30,0.92));
    backdrop-filter: saturate(2) blur(10px);
    -webkit-backdrop-filter: saturate(2) blur(10px);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    min-width: 60px;
    z-index: 999999;
}
.tts-speed-menu.show { display: block; }
.tts-speed-option {
    padding: 8px 12px; font-size: 13px; color: #fff;
    text-align: center; cursor: pointer; white-space: nowrap;
}
.tts-speed-option:hover, .tts-speed-option.active { background: var(--theme-color); }

.tts-close-btn {
    width: 24px; height: 24px; min-width: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.85);
    border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0;
}
