/* 自定义音频播放器样式 */
.custom-audio-controls {
    display: flex;
    align-items: center;
    background: #f7f9fd;
    border-radius: 6px;
    padding: 4px 6px;
    margin-top: 6px;
    width: calc(100% - 10px);  /* 增加宽度，减少边距 */
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    gap: 4px;
    height: 30px;
    overflow: hidden;  /* 防止内容溢出 */
    margin-bottom: 0;  /* 消除底部边距 */
    position: absolute; /* 绝对定位 */
    right: 5px; /* 靠近右侧边缘 */
    bottom: 5px; /* 靠底部对齐 */
    transform-origin: right;
    transition: transform 0.3s ease, width 0.3s ease;
    z-index: 10; /* 确保在文本上方 */
}

/* 为容器添加相对定位 */
.split-bubble {
    position: relative;
    min-height: 40px;
    scrollbar-width: thin; /* Firefox细滚动条 */
    padding: 0; /* 移除内边距 */
    padding-bottom: 40px; /* 为音频控件留出空间 */
    scrollbar-color: rgba(0, 0, 0, 0.1) transparent; /* 滚动条颜色 */
}

/* 底部区域的播放器为灰色背景 */
.input-side .custom-audio-controls {
    background: #f1f2f5; /* 灰色背景 */
}

/* 修改内容区域的内边距，减少左侧空白 */
.split-bubble #gpt-response,
.split-bubble #whisper-response {
    padding: 0 0 0 0; /* 移除所有内边距 */
    margin: 0; /* 确保无外边距 */
    width: 100%; /* 使用全宽 */
    box-sizing: border-box; /* 确保内边距不增加宽度 */
}

/* 折叠状态 */
.custom-audio-controls.collapsed {
    width: 24px;  /* 只显示三点菜单的宽度 */
    height: 24px; /* 调整高度 */
    justify-content: center;
    background: transparent; /* 移除背景 */
    box-shadow: none; /* 移除阴影 */
    padding: 0; /* 移除内边距 */
    transition: all 0.3s ease;
    position: absolute; /* 绝对定位 */
    bottom: 4px; /* 底部对齐 */
    right: 4px; /* 几乎贴近右侧 */
    margin: 0; /* 移除边距 */
    z-index: 5; /* 确保在滚动条遮罩上方 */
}

.custom-audio-controls.collapsed .controls-main {
    width: 0;
    opacity: 0;
    transition: width 0.3s ease, opacity 0.2s ease;
}

/* 确保三点菜单在折叠状态下居中 */
.custom-audio-controls.collapsed .menu-toggle {
    margin: 0;
}

/* 控件主体部分 */
.controls-main {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 4px;
    width: calc(100% - 24px);  /* 减去三点菜单的宽度 */
    opacity: 1;
    transition: width 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
}

/* TTS播放器特殊样式 - 蓝色区域 */
.tts-audio-controls {
    background: #e3f2fd;  /* 蓝色背景 */
    margin-top: 0; /* 移除顶部外边距 */
}

/* 三点菜单按钮样式 - 去掉圆形容器 */
.menu-toggle {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    z-index: 5;
    background-color: transparent; /* 透明背景 */
    border-radius: 0; /* 移除圆形边框 */
    box-shadow: none; /* 移除阴影 */
}

.menu-toggle:hover {
    opacity: 0.7; /* 恢复半透明效果 */
    background-color: transparent; /* 保持透明背景 */
}

/* 确保原始音频播放器不可见 */
#whisper-audio-player, #tts-audio-player {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    overflow: hidden !important;
    z-index: -1 !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none !important;
    /* 不使用display:none，以便允许正确加载和播放 */
}

.audio-control-btn {
    background: none;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #4483c3;
    transition: all 0.2s;
    padding: 0;
    flex-shrink: 0;
}

.audio-control-btn:hover {
    background-color: rgba(68, 131, 195, 0.1);
}

.audio-time {
    font-size: 10px;
    color: #666;
    white-space: nowrap;
    flex-shrink: 0;
}

.time-current {
    margin-right: 2px;
}

.time-total {
    margin-left: 2px;
}

.audio-progress-container {
    flex: 1;
    position: relative;
    height: 14px;
    display: flex;
    align-items: center;
    min-width: 50px; /* 确保进度条有最小宽度 */
}

.audio-progress-bar {
    height: 4px;
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.volume-slider-container {
    width: 0;
    overflow: hidden;
    transition: width 0.2s;
    height: 24px;
    display: flex;
    align-items: center;
}

.volume-slider-container.show {
    width: 60px;
}

.volume-slider {
    width: 60px;
    height: 3px;
    -webkit-appearance: none;
    appearance: none;
    background: #e0e0e0;
    border-radius: 1.5px;
    outline: none;
    margin: 0;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4483c3;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4483c3;
    cursor: pointer;
    border: none;
}

.speed-btn {
    font-size: 10px;
    width: auto;
    min-width: 28px;
    padding: 0 2px;
    background: none;
    border: none;
    color: #4483c3;
    border-radius: 3px;
    cursor: pointer;
}

.speed-options {
    display: none;
    flex-direction: row;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 15;
    position: absolute;
    right: 55px; /* 位于speed-btn左侧 */
    top: 0;
    height: 24px;
    padding: 0 2px;
}

.speed-options.show {
    display: flex;
}

/* 调整选项样式 */
.speed-option {
    padding: 2px 3px;
    margin: 0 1px;
    text-align: center;
    font-size: 9px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 2px;
    color: #4483c3;
    line-height: 1;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.speed-option:hover, .speed-option.active {
    background-color: #e3f2fd;
    font-weight: bold;
}

/* 细滚动条样式 - Webkit浏览器 */
.split-bubble::-webkit-scrollbar {
    width: 3px; /* 进一步减小滚动条宽度 */
    position: absolute;
    right: 0;
}

.split-bubble::-webkit-scrollbar-track {
    background: transparent; /* 透明轨道 */
    margin: 0; /* 移除所有边距 */
}

.split-bubble::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.1); /* 更淡的滚动条 */
    border-radius: 1.5px;
}

/* 禁用额外伪元素，它可能导致问题 */
.split-bubble::after {
    display: none;
} 