* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    overflow: hidden;
}

.player-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #fff;
}

@media (min-width: 768px) {
    .player-container {
        width: 375px;
        height: 667px;
        margin: 20px auto;
        border: 1px solid #ddd;
        border-radius: 20px;
        overflow: hidden;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }
}

.top-area {
    position: relative;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
}

.filename {
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    max-width: 80%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #495057;
}

.hidden-import-area {
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    cursor: pointer;
}

.player-main {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    min-height: 0; /* 重要：确保flex子元素可以收缩 */
}

.video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.subtitle-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
    background: #f8f9fa;
    position: relative;
    min-height: 0; /* 重要：确保可以收缩 */
}

.subtitle-content {
    max-height: 100%;
    overflow-y: auto;
    scroll-behavior: auto; /* 改为auto，让自定义滚动更流畅 */
    padding: 15px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    -webkit-overflow-scrolling: touch; /* iOS滚动优化 */
    touch-action: pan-y; /* 允许垂直滚动 */
    user-select: none; /* 防止文本选择 */
}

/* 高亮区域指示器 */
.subtitle-highlight-zone {
    position: absolute;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(180deg, 
        rgba(25, 118, 210, 0.05) 0%, 
        rgba(25, 118, 210, 0.02) 50%, 
        rgba(25, 118, 210, 0.05) 100%);
    border: 1px solid rgba(25, 118, 210, 0.1);
    border-radius: 8px;
    pointer-events: none;
    z-index: 1;
    transition: all 0.3s ease;
    opacity: 0.3; /* 降低透明度，减少干扰 */
}

.subtitle-placeholder {
    text-align: center;
    color: #6c757d;
    font-size: 16px;
    padding: 40px 20px;
}

.subtitle-line {
    padding: 10px 15px;
    margin: 6px 0;
    border-radius: 8px;
    font-size: 18px;
    line-height: 1.6;
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
    color: #495057;
    border: 1px solid transparent;
    position: relative;
    z-index: 2;
}

.subtitle-line.active {
    background: #e3f2fd;
    color: #1976d2;
    font-weight: 500;
    transform: scale(1.02);
    border-color: #bbdefb;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.15);
}

.subtitle-line.highlighted {
    background: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
}

.subtitle-line:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
}

.subtitle-time {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 4px;
    font-weight: 500;
}

.control-bar {
    height: 90px; /* 增加高度，为时间显示留出空间 */
    background: #fff;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 8px;
    border-top: 1px solid #e9ecef;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.control-left {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 10;
}

.control-center {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 5;
    min-width: 0; /* 允许收缩 */
}

.control-right {
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.control-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: #007bff;
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
    pointer-events: auto; /* 确保可以点击 */
    user-select: none; /* 防止文本选择 */
    -webkit-tap-highlight-color: transparent; /* 移动端点击高亮 */
    position: relative; /* 确保定位正确 */
    z-index: 15; /* 最高层级 */
}

.control-btn:hover {
    background: #0056b3;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

.play-icon, .pause-icon {
    pointer-events: none; /* 防止图标阻止点击 */
    user-select: none;
}

.progress-container {
    flex: 1;
    position: relative;
    min-width: 0; /* 允许收缩 */
}

.target-display {
    position: absolute;
    bottom: 200%;
    left: 0;
    right: 0;
    height: 20px;
    font-size: 12px;
    color: #ff6b35;
    text-align: center;
    font-weight: 600;
    margin-bottom: 4px;
    pointer-events: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: rgba(255, 107, 53, 0.1);
    border-radius: 4px;
    padding: 2px 8px;
    border: 1px solid rgba(255, 107, 53, 0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 20;
}

.target-display.show {
    opacity: 1;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    overflow: visible;
    transition: all 0.2s ease;
}

.progress-bar:hover {
    background: #dee2e6;
}

.progress-bar:active {
    background: #ced4da;
}

.progress-fill {
    height: 100%;
    background: #007bff;
    border-radius: 3px;
    transition: width 0.1s ease;
}

.progress-handle {
    position: absolute;
    top: 50%;
    left: 0;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: grab;
    transition: transform 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    border: 2px solid #007bff;
}

.progress-handle:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.progress-handle:active {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.4);
}

/* TARGET点样式 */
.target-point {
    position: absolute;
    top: 50%;
    width: 10px;
    height: 10px;
    background: #ff6b35;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(255, 107, 53, 0.4);
}

.target-point:hover {
    background: #ff5722;
    transform: translate(-50%, -50%) scale(1.3);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.6);
}

.target-point.active {
    background: #007bff;
    border-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.5);
}

/* TARGET点对应的显示标签 */
.target-label {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 107, 53, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 25;
    margin-bottom: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.target-label::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(255, 107, 53, 0.9);
}

.target-point:hover .target-label {
    opacity: 1;
}

.time-display {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
    text-align: center;
    margin-top: 4px;
    pointer-events: none;
}

.volume-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 80px;
    height: 6px; /* 与进度条高度一致 */
    align-self: flex-start; /* 与进度条顶部对齐 */
    margin-top: 0; /* 确保顶部对齐 */
}

.volume-icon {
    font-size: 16px;
    color: #6c757d;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
}

.volume-icon:hover {
    color: #007bff;
}

.volume-bar {
    width: 60px;
    height: 6px; /* 与进度条高度一致 */
    background: #e9ecef;
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.volume-fill {
    height: 100%;
    background: #007bff;
    border-radius: 3px;
    transition: width 0.1s ease;
    width: 100%; /* 默认满音量 */
}

.volume-handle {
    position: absolute;
    top: 50%;
    left: 100%;
    width: 12px; /* 比进度条手柄稍小 */
    height: 12px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 2px solid #007bff;
    transition: transform 0.2s ease;
}

.volume-handle:hover {
    transform: translate(-50%, -50%) scale(1.2);
}

/* TARGET列表按钮 */
.target-list-btn {
    /* margin-left: 8px; */
    background: #ff6b35; /* 与TARGET点颜色一致 */
}

.target-list-btn:hover {
    background: #ff5722; /* 悬停时更深的橙色 */
}

/* TARGET列表弹窗 */
.target-list-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.target-list-container {
    background: #fff;
    border-radius: 12px 12px 0 0;
    width: 100%;
    max-width: 400px;
    max-height: 300px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.target-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.target-list-header span {
    font-weight: 600;
    color: #495057;
}

.target-list-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.target-list-close:hover {
    background: #e9ecef;
}

.target-list-content {
    max-height: 200px;
    overflow-y: auto;
    padding: 10px 0;
}

.target-list-item {
    padding: 12px 20px;
    border-bottom: 1px solid #f8f9fa;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.target-list-item:hover {
    background: #f8f9fa;
}

.target-list-item.active {
    background: #e3f2fd;
    color: #1976d2;
}

.target-list-item .target-time {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
}

.target-list-item .target-text {
    flex: 1;
    margin-right: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .control-bar {
        height: 80px; /* 移动端稍微减小高度 */
        padding: 0 15px;
        gap: 10px;
    }
    
    .control-btn {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    
    .subtitle-line {
        font-size: 16px;
        padding: 8px 12px;
    }
    
    .subtitle-area {
        padding: 15px;
    }
    
    .subtitle-highlight-zone {
        height: 50px;
    }
    
    .volume-bar {
        width: 50px; /* 移动端稍微缩小音量条 */
    }
    
    .time-display {
        font-size: 11px; /* 移动端稍微缩小字体 */
        margin-top: 3px; /* 移动端减小间距 */
    }
    
    .target-label {
        display: none;
        font-size: 10px;
        padding: 3px 6px;
        margin-bottom: 6px;
    }
    
    .target-display {
        font-size: 11px;
        height: 18px;
        padding: 1px 6px;
    }
} 