/* 字幕编辑器ZmEdit样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    width: 100%;
    height: 100vh;
    max-width: none;
    margin: 0;
    padding: 0;
    background-color: white;
    border-radius: 0;
    box-shadow: none;
}

/* 左侧按钮区域 */
.sidebar {
    width: 160px;
    background-color: #2c3e50;
    color: white;
    padding: 15px 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    padding: 12px 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 6px;
    font-size: 18px;
    line-height: 1.2;
    padding: 0;
}

/* 按钮样式 */
.sidebar button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 10px;
    margin-bottom: 4px;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    text-align: center;
    height: 44px;
    line-height: 1.2;
    word-break: keep-all;
    white-space: normal;
    min-height: 44px;
}

.sidebar .btn-primary {
    background-color: #3498db;
}

.sidebar .btn-primary:hover {
    background-color: #2980b9;
    transform: translateX(2px);
}

/* 时间调整按钮样式 */
.sidebar .btn-time {
    background-color: #27ae60;
}

.sidebar .btn-time:hover {
    background-color: #229954;
    transform: translateX(2px);
}

.sidebar button:active {
    transform: translateX(1px);
}

/* 音频播放器 */
.audio-player {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #ddd;
}

#audio-player {
    flex: 1;
    height: 30px;
}

#audio-player::-webkit-media-controls-panel {
    background-color: #f8f9fa;
}

#current-time, #duration {
    font-size: 12px;
    font-family: monospace;
    color: #666;
    min-width: 45px;
    text-align: center;
}

/* 数据轴容器 */
.timeline-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-height: 0;
}

/* 时间轴区域 */
.timeline-section {
    background-color: #ffffff;
    border-radius: 8px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 15px;
    background-color: #34495e;
    color: white;
    font-weight: bold;
    font-size: 12px;
    height: 32px;
}

/* 缩放控制按钮 */
.zoom-controls {
    display: flex;
    gap: 5px;
}

.zoom-controls button {
    width: 24px;
    height: 24px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #555;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.zoom-controls button:hover {
    background-color: #666;
    transform: scale(1.1);
}

.zoom-controls button:active {
    transform: scale(0.95);
}

/* 时间轴样式 */
.timeline {
    flex: 1;
    position: relative;
    background-color: #f9f9f9;
    overflow-x: auto;
    overflow-y: hidden;
    min-height: 100px;
    border-top: 1px solid #ddd;
}

/* 音频时间轴特定样式 */
#audio-timeline {
    min-height: 60px;
}

/* 字幕时间轴特定样式 */
#subtitle-timeline {
    min-height: 120px;
}

/* 时间刻度 */
.time-markers {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 35px;
    background-color: #f0f0f0;
    display: flex;
    border-bottom: 1px solid #ddd;
}

.time-marker {    position: absolute;    top: 0;    width: 1px;    height: 12px;    background-color: #999;    transform: translateX(-50%);}

.time-marker::after {    content: attr(data-time);    position: absolute;    top: 14px;    left: 50%;    transform: translateX(-50%);    white-space: nowrap;    line-height: 1.2;    font-size: 11px;    color: #666;}

/* 音频波形区域 */
.audio-waveform {
    position: absolute;
    top: 35px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e8f4f8;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

/* 波形SVG容器样式 */
.waveform-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* 波形路径样式 - 改为红色 */
.waveform-path {
    fill: none;
    stroke: #e74c3c; /* 红色 */
    stroke-width: 2px;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: none; /* 实线波形 */
    animation: none; /* 禁用动画，保持静态波形 */
}

/* 已播放波形路径样式 - 改为深红色 */
.waveform-played-path {
    fill: none;
    stroke: #c0392b; /* 深红色 */
    stroke-width: 2px;
    stroke-linecap: round;
    stroke-linejoin: round;
    z-index: 2; /* 确保已播放波形在普通波形上方 */
}

/* 字幕轨道区域 */
.subtitle-track {
    position: absolute;
    top: 35px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #fafafa;
    border-top: 1px solid #ddd;
}

/* 字幕块样式 */
.subtitle-block {
    position: absolute;
    top: 5px;
    height: 60px;
    background-color: #3498db;
    color: white;
    border-radius: 4px;
    padding: 8px 5px;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
}

/* 选中字幕块样式 */
.subtitle-block.selected {
    background-color: #e74c3c;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* 拖动时的光标样式 */
.subtitle-block:hover {
    cursor: move;
}

/* 字幕块拖拽手柄 */
.subtitle-block .resize-handle {
    position: absolute;
    right: 0;
    top: 0;
    width: 8px;
    height: 100%;
    cursor: ew-resize;
    background-color: rgba(255, 255, 255, 0.3);
    transition: background-color 0.2s;
}

.subtitle-block .resize-handle:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

.subtitle-block:hover {
    background-color: #2980b9;
}

.subtitle-block.selected {
    background-color: #e74c3c;
}

/* 播放头 */
.playhead {
    position: absolute;
    top: 0;
    width: 2px;
    background-color: #e74c3c;
    z-index: 10;
    pointer-events: none;
}

/* 滚动条样式 */
.timeline::-webkit-scrollbar {
    height: 8px;
}

.timeline::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.timeline::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.timeline::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 字幕清单 */
.lyrics-container {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid #ddd;
    height: 300px;
    min-height: 200px;
}

.lyrics-header {
    display: grid;
    grid-template-columns: 80px 120px 120px 1fr;
    padding: 10px 15px;
    background-color: #34495e;
    color: white;
    font-weight: bold;
    font-size: 13px;
    height: 45px;
    align-items: center;
    line-height: 1.4;
}

.lyrics-list {
    overflow-y: auto;
    flex: 1;
}

.lyrics-line {
    display: grid;
    grid-template-columns: 80px 120px 120px 1fr;
    padding: 6px 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
    align-items: center;
    min-height: 36px;
}

/* 移除了操作按钮相关样式 */

.lyrics-line:hover {
    background-color: #f8f9fa;
}

.lyrics-line.selected {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.lyrics-line input {
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 3px 5px;
    font-size: 12px;
    width: 100%;
    max-width: 300px;
    height: 24px;
    line-height: 1;
}

.lyrics-line .time-tag {
    font-family: monospace;
    color: #e74c3c;
    font-weight: bold;
}

.lyrics-line .end-time-tag {
    font-family: monospace;
    color: #27ae60;
    font-weight: bold;
}

/* 错误信息 */
.error-message {
    margin-top: 15px;
    padding: 10px;
    background-color: #ffebee;
    color: #c62828;
    border-radius: 4px;
    font-size: 14px;
    display: none;
}

/* 滚动条样式 */
.lyrics-list::-webkit-scrollbar {
    width: 8px;
}

.lyrics-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.lyrics-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.lyrics-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .sidebar button {
        flex: 1;
        min-width: 120px;
    }
    
    .lyrics-header,
    .lyrics-line {
        grid-template-columns: 50px 90px 1fr;
        font-size: 13px;
    }
}