:root {
    --timecode-controls-height: 74px;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #1e1e1e;
    color: #e0e0e0;
    font-family: Arial, sans-serif;
}

#audio-host {
    width: 100%;
    height: 100vh;
    margin: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    background-color: #2d2d2d;
    overflow: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#audio-host::-webkit-scrollbar {
    display: none;
}

.content-wrapper {
    flex: 1;
    display: flex;
    overflow: hidden;
    min-height: 0; /* 这有助于 flex 子元素正确缩小 */
}

#left-panel {
    width: 200px;
    background-color: #3a3a3a;
    border-right: 1px solid #555;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-top: 30px;
    margin-top: -10px;
    box-sizing: border-box;
    position: sticky;
    top: 0;
    height: 100%;
}

#left-panel::-webkit-scrollbar {
    display: none;
}

#main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#timeline-container {
    height: 30px;
    background-color: #333333;
    position: relative;
    overflow: hidden;
    user-select: none;
    border-bottom: 1px solid #555;
}

#tracks-container {
    flex: 1;
    background-color: #2d2d2d;
    user-select: none;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    border-bottom: 1px solid #dda0dd;
}

#tracks-container::-webkit-scrollbar {
    display: none;
}

#timecode-container,
#controls {
    flex-shrink: 0;
}

.track-wrapper {
    flex: 0 0 195px;
    display: flex;
    width: 100%;
    border-bottom: 1px solid; /* 将边框宽度从 2px 改为 1px */
    min-height: 195px;
    box-sizing: border-box;
}

.track-wrapper:last-child {
    border-bottom: none;
}

.track-buttons {
    width: 200px;
    height: 195px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 1px;
    background-color: #3a3a3a;
    box-sizing: border-box;
    flex-shrink: 0;
    border-bottom: 1px solid #555;
    overflow-y: auto;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    border-left: 2px solid transparent;
}

.track-buttons.selected {
    box-shadow: inset 0 0 0 2px #00a8ff, 0 0 10px rgba(0, 168, 255, 0.5);
    border-left-width: 4px;
}

/* 为每个轨道设置不同的边框颜色 */
.track-buttons:nth-child(1) {
    border-left-color: #ff4136; /* 红色 */
}

.track-buttons:nth-child(2) {
    border-left-color: #ffdc00; /* 黄色 */
}

.track-buttons:nth-child(3) {
    border-left-color: #0074d9; /* 蓝色 */
}

.track-buttons:nth-child(4) {
    border-left-color: #2ecc40; /* 绿色 */
}

/* 恢复悬停效果 */
.track-buttons:hover {
    background-color: #444444;
}

/* 恢复选中状态的悬停效果 */
.track-buttons.selected:hover {
    background-color: #505050;
}

.msi-buttons {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin-top: 5px;
}

.mute-button, .solo-button, .import-audio {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 5px;
    color: #1e1e1e;
}

.mute-button {
    background-color: #ff9999;
}

.solo-button {
    background-color: #99ff99;
}

.import-audio {
    background-color: #9999ff;
}

.mute-button:hover, .solo-button:hover, .import-audio:hover {
    opacity: 0.8;
}

.mute-button.active, .solo-button.active {
    background-color: #ff0000;
    color: #ffffff;
}

.volume-control, .pan-control {
    width: 100%;
    margin: 0 auto 10px;
}

.volume-header, .pan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.volume-label-container, .pan-label-container {
    display: flex;
    align-items: center;
}

.volume-icon, .pan-icon {
    font-size: 12px; /* 统一图标大小 */
    margin-right: 5px;
}

.volume-label, .pan-label {
    font-size: 12px; /* 统一标签大小 */
}

.volume-value, .pan-value {
    font-size: 12px; /* 统一数值大小 */
    min-width: 30px;
    text-align: right;
}

.volume-slider, .pan-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 9px; /* 将高度从 8px 改为 9px */
    border-radius: 4.5px; /* 调整圆角以匹配新的高度 */
    background: #555555;
    outline: none;
    opacity: 0.7;
    transition: opacity .2s;
    margin: 1px 0;
}

.volume-slider:hover, .pan-slider:hover {
    opacity: 1;
}

.volume-slider::-webkit-slider-thumb, .pan-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 17px; /* 稍微增加滑块大小 */
    height: 17px; /* 稍微增加滑块大小 */
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
    margin-top: -4px; /* 调整滑块垂直位置 */
}

.volume-slider::-moz-range-thumb, .pan-slider::-moz-range-thumb {
    width: 17px; /* 稍微增加滑块大小 */
    height: 17px; /* 稍微增加滑块大小 */
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
    margin-top: -4px; /* 调整滑块垂直位置 */
}

/* 为Firefox添加特定样式 */
.volume-slider::-moz-range-track, .pan-slider::-moz-range-track {
    height: 9px;
    background: #555555;
    border-radius: 4.5px;
}

.track {
    flex-grow: 1;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 2px;
    background-color: #1a1a1a;
    box-sizing: border-box;
    transition: none;
}

.track.drag-over {
    background-color: rgba(255, 255, 255, 0.1);
}

.audio-info {
    position: absolute;
    top: 5px;
    left: 10px;
    font-size: 12px;
    color: #ffffff;
    z-index: 2;
    pointer-events: none;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8); /* 添加文字阴影以提高可读性 */
    white-space: nowrap; /* 防止文本换行 */
    overflow: hidden;
    text-overflow: ellipsis; /* 超出部分显示省略号 */
    max-width: calc(100% - 20px); /* 确保不会超出轨道宽度 */
}

.waveform-container {
    flex-grow: 1;
    position: relative;
    overflow: hidden;
    min-height: 180px;
    background-color: #1a1a1a;
}

.waveform-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.track-content {
    flex-grow: 1;
    /* 这里可以添加轨道内容的样式，例如波形图等 */
}

#controls {
    margin-top: 10px;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 20px; /* 按钮之间的间距 */
}

#controls button {
    background-color: #4a4a4a;
    color: #e0e0e0;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s, transform 0.1s;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

#controls button:hover {
    background-color: #5a5a5a;
}

#controls button:active {
    transform: scale(0.95);
}

#play-pause::before {
    content: "\25B6"; /* 播放图标 (三角形) */
    margin-right: 5px;
}

#play-pause.playing::before {
    content: "\275A\275A"; /* 暂停图标 (两条竖线) */
}

#zoom-in::before {
    content: "+";
    font-weight: bold;
    margin-right: 5px;
}

#zoom-out::before {
    content: "-";
    font-weight: bold;
    margin-right: 5px;
}

#play-head {
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8); /* 80% 不透明度的白色 */
    z-index: 10;
}

.time-marker {
    position: absolute;
    top: 0;
    width: 1px;
    height: 8px; /* 调整刻度高度 */
    background-color: #888;
}

.time-marker.major {
    height: 12px; /* 调整主要刻度高度 */
    background-color: #aaa;
}

.time-marker.minor {
    height: 4px; /* 调整次要刻度高度 */
    background-color: #777;
}

.time-marker.micro {
    height: 2px; /* 调整微小刻度高度 */
    background-color: #666;
}

.time-marker span {
    position: absolute;
    left: 2px; /* 将标签放在刻度线右侧 */
    top: 12px; /* 调整标签的垂直位置 */
    font-size: 9px; /* 可需要稍微减小字体大小 */
    color: #ccc;
    white-space: nowrap; /* 防止文本换行 */
}

#timecode {
    font-size: 24px;
    font-weight: bold;
    font-family: monospace;
    color: #e0e0e0;
    margin-right: 10px;
}

#playback-speed {
    background-color: #4a4a4a;
    color: #e0e0e0;
    border: none;
    padding: 8px 15px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s, transform 0.1s;
}

#playback-speed:hover {
    background-color: #5a5a5a;
}

#playback-speed:active {
    transform: scale(0.95);
}

#timecode-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
    margin-bottom: 10px;
}

.playback-speed-container {
    position: relative;
    display: inline-block;
}

.speed-popup {
    display: none;
    position: absolute;
    background-color: #3a3a3a;
    min-width: 120px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.4);
    z-index: 1;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.speed-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -8px;
    border-width: 8px;
    border-style: solid;
    border-color: #3a3a3a transparent transparent transparent;
}

.speed-popup button {
    display: block;
    width: 100%;
    padding: 12px 15px;
    text-align: left;
    border: none;
    background: none;
    cursor: pointer;
    color: #e0e0e0;
    font-size: 14px;
    transition: background-color 0.2s;
}

.speed-popup button:hover {
    background-color: #4a4a4a;
}

.speed-popup button.active {
    background-color: #5a5a5a;
    font-weight: bold;
}

.pan-control {
    width: 100%;
    display: flex;
    flex-direction: column;
    margin-bottom: 5px;
    padding-bottom: 5px; /* 添加底部内边距 */
    border-bottom: 1px solid #555; /* 添加底部边框作为分隔线 */
}

.pan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.pan-label-container {
    display: flex;
    align-items: center;
}

.pan-icon {
    font-size: 10px;
    margin-right: 2px;
}

.pan-label {
    font-size: 10px;
}

.pan-value {
    font-size: 10px;
    text-align: right;
    min-width: 20px;
}

.pan-slider {
    width: 100%;
    -webkit-appearance: none;
    height: 3px;
    border-radius: 1.5px;
    background: #555555;
    outline: none;
    opacity: 0.7;
    transition: opacity .2s;
    margin-top: 2px;
}

.pan-slider:hover {
    opacity: 1;
}

.pan-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
}

.pan-slider::-moz-range-thumb {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
}

.volume-pan-container {
    width: 95%; /* 保持父容器的宽度为95% */
    margin: 0 auto;
    padding: 1px;
    box-sizing: border-box;
    background-color: #3a3a3a;
    border-radius: 4px;
    margin-bottom: 2px;
}

.volume-pan-content {
    width: 95%; /* 将内容区域的宽度设置为父容器的95% */
    margin: 0 auto; /* 居中对齐 */
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.volume-control, .pan-control {
    width: 100%; /* 确保控制元素占满 volume-pan-content 的宽度 */
    margin-bottom: 5px;
}

.volume-slider, .pan-slider {
    width: 100%; /* 确保滑块占满控制元素宽度 */
    /* 其他样式保持不变 */
}

.volume-pan-title {
    font-size: 12px; /* 统一标题大小 */
    padding: 3px 5px;
    margin-bottom: 3px;
    background-color: #4a4a4a;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #e0e0e0;
}

.volume-pan-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.volume-control, .pan-control {
    margin-bottom: 1px; /* 将底部外边距从 5px 改为 1px */
}

.volume-header, .pan-header {
    margin-bottom: 1px; /* 将底部外边距从 5px 改为 1px */
}

.volume-slider, .pan-slider {
    margin: 1px 0; /* 将上下外边距从 5px 改为 1px */
    height: 3px; /* 减小滑块高度 */
}

.msi-buttons {
    margin-top: 5px; /* 增加顶部边距 */
}

/* 为每个 track-wrapper 设置不同的分隔线颜色，颜色更暗 */
.track-wrapper:nth-child(1) {
    border-bottom-color: #660000; /* 更暗的红色 */
}

.track-wrapper:nth-child(2) {
    border-bottom-color: #666600; /* 更暗的黄色 */
}

.track-wrapper:nth-child(3) {
    border-bottom-color: #002244; /* 更暗的蓝色 */
}

.track-wrapper:nth-child(4) {
    border-bottom-color: #004400; /* 更暗的绿色 */
}

/* 其他 track-wrapper 样式保持不变 */
.track-wrapper {
    flex: 0 0 195px;
    display: flex;
    width: 100%;
    border-bottom: 1px solid; /* 保持边框宽度为 1px */
    min-height: 195px;
    box-sizing: border-box;
}

.track-wrapper:last-child {
    border-bottom: none;
}

.volume-pan-content.collapsed {
    display: none;
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.toggle-icon.collapsed {
    transform: rotate(180deg);
}

.mute-button, .solo-button, .import-audio {
    width: 22px; /* 减小按钮尺寸 */
    height: 22px;
    font-size: 10px; /* 减小字体大小 */
}

.pan-header {
    display: flex;
    align-items: center;
    margin-bottom: 2px;
}

.pan-icon {
    margin-right: 5px;
    font-size: 14px;
}

.pan-label {
    font-size: 12px;
    flex-grow: 1;
}

.volume-control, .pan-control {
    width: 100%; /* 确保控制元素占满容器宽度 */
    margin-bottom: 5px;
}

.volume-slider, .pan-slider {
    width: 100%; /* 确保滑块占满控制元素宽度 */
    /* 其他样式保持不变 */
}

#detected-key {
    margin-left: 10px;
    font-size: 14px;
    color: #e0e0e0;
    background-color: rgba(0, 0, 0, 0.3); /* 添加半透明黑色背景 */
    padding: 5px 10px; /* 添加内边距 */
    border-radius: 4px; /* 添加圆角 */
    display: inline-block; /* 使背景框适应内容大小 */
}

/* 在文件末尾添加以下样式 */

#bottom-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    background-color: #2d2d2d;
    border-top: 1px solid #555;
}

#timecode-container {
    display: flex;
    align-items: center;
    margin-right: 20px;
}

#controls {
    display: flex;
    align-items: center;
}

#timecode {
    font-size: 20px;
    margin-right: 15px;
    min-width: 120px;
}

.playback-speed-container {
    margin-right: 20px;
}

#controls button {
    padding: 8px 15px;
    font-size: 13px;
    margin: 0 5px;
}

#playback-speed {
    padding: 8px 15px;
    font-size: 13px;
}
