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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
        'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    display: flex;
    gap: 20px;
    max-width: 1600px;
    margin: 0 auto;
    height: calc(100vh - 40px);
}

.video-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.video-wrapper {
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

#videoPlayer {
    width: 100%;
    height: 100%;
}

.video-js {
    width: 100% !important;
    height: 100% !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
        'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.video-js .vjs-big-play-button {
    border-radius: 50%;
    width: 2em;
    height: 2em;
    line-height: 2em;
    border: 0.06666em solid rgba(255, 255, 255, 0.8);
    background-color: rgba(102, 126, 234, 0.9);
    transition: all 0.3s;
}

.video-js .vjs-big-play-button:hover {
    background-color: rgba(102, 126, 234, 1);
    border-color: #fff;
    transform: scale(1.1);
}

.video-js .vjs-control-bar {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
}

.video-js .vjs-play-progress {
    background-color: #667eea;
}

.video-js .vjs-volume-level {
    background-color: #667eea;
}

.placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.placeholder:hover {
    background: rgba(0, 0, 0, 0.9);
}

.placeholder:active {
    transform: scale(0.98);
}

.placeholder.hidden {
    display: none;
}

.mkv-warning-banner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #78350f;
    padding: 12px 16px;
    display: none;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
    z-index: 100;
    animation: slideDown 0.3s ease-out;
}

.mkv-warning-banner.show {
    display: flex;
}

.warning-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.warning-content svg {
    flex-shrink: 0;
    stroke: #78350f;
}

.warning-content span {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

.close-warning {
    background: none;
    border: none;
    color: #78350f;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.close-warning:hover {
    background: rgba(120, 53, 15, 0.1);
}

.close-warning:active {
    transform: scale(0.95);
}

.manual-screenshot-overlay {
    position: absolute;
    top: 16px;
    left: 16px;
    display: none;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    z-index: 50;
    pointer-events: none;
}

.manual-screenshot-overlay.show {
    display: flex;
}

.capture-screenshot-btn {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    background: transparent;
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    transition: all 0.2s;
    pointer-events: auto;
}

.capture-screenshot-btn svg {
    width: 18px;
    height: 18px;
}

.capture-screenshot-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(102, 126, 234, 0.5);
    color: #667eea;
}

.capture-screenshot-btn:active {
    transform: scale(0.92);
}

.manual-screenshot-info {
    background: rgba(0, 0, 0, 0.6);
    color: rgba(255, 255, 255, 0.9);
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 400;
    pointer-events: none;
    white-space: nowrap;
}

.clear-manual-btn {
    padding: 4px 10px;
    font-size: 12px;
    color: #999;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.2s;
}

.clear-manual-btn:hover:not(:disabled) {
    color: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.25);
}

.clear-manual-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.open-editor-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: white;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s;
    pointer-events: auto;
    box-shadow: none;
    white-space: nowrap;
}

.open-editor-btn:hover:not(:disabled) {
    background: rgba(102, 126, 234, 0.8);
    border-color: rgba(102, 126, 234, 0.5);
    color: rgba(255, 255, 255, 0.9);
    box-shadow: none;
    transform: none;
}

.open-editor-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.open-editor-btn svg {
    width: 14px;
    height: 14px;
}

.placeholder-content {
    text-align: center;
    transition: transform 0.3s;
}

.placeholder:hover .placeholder-content {
    transform: scale(1.05);
}

.placeholder-content svg {
    margin-bottom: 20px;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.placeholder:hover .placeholder-content svg {
    opacity: 1;
}

.placeholder-content p {
    font-size: 18px;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.placeholder:hover .placeholder-content p {
    opacity: 1;
}

.controls {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
}

.file-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.file-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.file-label:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.file-label:active {
    transform: translateY(0);
}

input[type="file"] {
    display: none;
}

.file-name {
    color: #666;
    font-size: 14px;
    flex: 1;
    min-width: 150px;
}

.subtitle-status {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    display: none;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.6;
    max-height: 300px;
    overflow-y: auto;
}

.subtitle-status.success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.subtitle-status.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.subtitle-status.info {
    display: block;
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.subtitle-section {
    width: 400px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.subtitle-header {
    padding: 20px 24px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.subtitle-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.subtitle-count {
    font-size: 14px;
    opacity: 0.9;
}

.subtitle-toolbar {
    padding: 12px 16px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.subtitle-toolbar.visible {
    display: flex;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.selected-count {
    font-size: 13px;
    color: #667eea;
    font-weight: 500;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.toolbar-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.toolbar-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.toolbar-btn-subtle {
    background: white;
    color: #666;
    border: 1px solid #ddd;
    font-weight: 400;
    padding: 6px 12px;
    font-size: 13px;
    white-space: nowrap;
}

.toolbar-btn-subtle:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #ccc;
    color: #333;
    transform: none;
    box-shadow: none;
}

.toolbar-btn-subtle:active:not(:disabled) {
    background: #f0f0f0;
    transform: none;
}

.subtitle-search {
    padding: 8px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    display: none;
    animation: slideDown 0.3s ease-out;
}

.subtitle-search.visible {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s;
}

.modal.show {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    margin: 20px auto;
    width: 95%;
    max-width: 1600px;
    height: calc(100vh - 40px);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 2px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    flex: 1;
    display: flex;
    gap: 20px;
    padding: 20px;
    overflow: hidden;
}

.screenshot-list-panel {
    width: 200px;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.panel-header {
    padding: 12px 16px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
}

.panel-header h3 {
    font-size: 14px;
    margin-bottom: 4px;
}

.panel-footer {
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.btn-download-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    padding: 8px 12px;
    background: white;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-download-all:hover {
    background: #f8f9fa;
    border-color: #ccc;
    color: #333;
}

.btn-download-all:active {
    background: #f0f0f0;
}

.btn-download-all:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-download-all svg {
    width: 14px;
    height: 14px;
}

.tip-text {
    display: block;
    font-size: 12px;
    color: #667eea;
    margin-top: 4px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border: 1px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-small:hover {
    background: #667eea;
    color: white;
}

.screenshot-items {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.screenshot-item {
    margin-bottom: 12px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s;
    background: white;
    position: relative;
}

.screenshot-item:hover {
    border-color: #e0e0e0;
}

.screenshot-item.active {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.screenshot-item img {
    width: 100%;
    display: block;
}

.screenshot-item-info {
    padding: 8px;
    font-size: 12px;
    color: #666;
}

.screenshot-item-controls {
    position: absolute;
    top: 4px;
    right: 4px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.screenshot-item:hover .screenshot-item-controls {
    opacity: 1;
}

.screenshot-control-btn {
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}

.screenshot-control-btn:hover {
    background: rgba(102, 126, 234, 0.9);
    transform: scale(1.1);
}

.screenshot-control-btn.delete-btn:hover {
    background: rgba(239, 68, 68, 0.9);
}

.screenshot-control-btn.replace-btn:hover {
    background: rgba(16, 185, 129, 0.9);
}

.screenshot-control-btn.download-btn:hover {
    background: rgba(59, 130, 246, 0.9);
}

.screenshot-control-btn svg {
    width: 14px;
    height: 14px;
}

.screenshot-order-controls {
    position: absolute;
    top: 4px;
    left: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.2s;
}

.screenshot-item:hover .screenshot-order-controls {
    opacity: 1;
}

.screenshot-editor-panel {
    flex: 0.7;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.editor-canvas-wrapper {
    flex: 1;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#editorCanvas {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.crop-box {
    position: absolute;
    border: 2px solid #667eea;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
    cursor: move;
}

.crop-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: white;
    border: 2px solid #667eea;
    border-radius: 50%;
}

.handle-nw { top: -6px; left: -6px; cursor: nw-resize; }
.handle-ne { top: -6px; right: -6px; cursor: ne-resize; }
.handle-sw { bottom: -6px; left: -6px; cursor: sw-resize; }
.handle-se { bottom: -6px; right: -6px; cursor: se-resize; }
.handle-n { top: -6px; left: 50%; margin-left: -6px; cursor: n-resize; }
.handle-s { bottom: -6px; left: 50%; margin-left: -6px; cursor: s-resize; }
.handle-w { top: 50%; left: -6px; margin-top: -6px; cursor: w-resize; }
.handle-e { top: 50%; right: -6px; margin-top: -6px; cursor: e-resize; }

.editor-toolbar {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: white;
    border-radius: 8px;
}

.stitch-settings-panel {
    flex: 0.3;
    min-width: 350px;
    min-height: 600px;
    background: white;
    border-radius: 8px;
    padding: 20px;
    overflow-y: auto;
}

.stitch-settings-panel h3 {
    font-size: 16px;
    margin-bottom: 16px;
}

.setting-group {
    margin-bottom: 20px;
}

.setting-group-advanced {
    transition: opacity 0.3s, max-height 0.3s;
    overflow: hidden;
    max-height: 200px;
    opacity: 1;
}

.setting-group-advanced.hidden {
    max-height: 0;
    margin-bottom: 0;
    opacity: 0;
}

.setting-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
}

.mode-tip {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #667eea;
    line-height: 1.4;
}

.setting-group select,
.setting-group input[type="range"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 13px;
}

.setting-group input[type="range"] {
    padding: 0;
}

.color-options {
    display: flex;
    gap: 8px;
}

.color-btn {
    width: 40px;
    height: 40px;
    border: 3px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.color-btn:hover {
    transform: scale(1.1);
}

.color-btn.active {
    border-color: #667eea;
    box-shadow: 0 0 0 2px white, 0 0 0 4px #667eea;
}

.preview-section {
    margin-top: 20px;
}

.preview-buttons {
    display: flex;
    gap: 10px;
}

.btn-primary {
    flex: 1;
    padding: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.preview-container {
    margin-top: 12px;
    max-height: 600px;
    overflow: auto;
    border-radius: 6px;
    background: #f8f9fa;
}

.preview-container img {
    width: 100%;
    display: block;
}

.preview-container:empty {
    display: none;
}

.btn-download {
    flex: 1;
    padding: 12px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-download:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-download:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 1200px) {
    .modal-content {
        width: 100%;
        height: 100vh;
        margin: 0;
        border-radius: 0;
    }
    
    .modal-body {
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
        min-height: 0;
    }
    
    .screenshot-list-panel {
        width: 100%;
        max-height: 150px;
        flex-shrink: 0;
    }
    
    .screenshot-items {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        flex-direction: row;
        padding: 8px;
        min-height: 100px;
        -webkit-overflow-scrolling: touch;
    }
    
    .screenshot-item {
        flex-shrink: 0;
        width: 120px;
        height: 150px;
        margin-bottom: 0;
        display: flex;
        flex-direction: column;
        background: white;
        border-radius: 6px;
        overflow: hidden;
    }
    
    .screenshot-item img {
        width: 100%;
        height: 100px;
        display: block;
        object-fit: cover;
        background: #f0f0f0;
        flex-shrink: 0;
    }
    
    .screenshot-item-info {
        padding: 4px 6px;
        font-size: 11px;
        line-height: 1.2;
        flex-shrink: 0;
    }
    
    .screenshot-item-info {
        flex-shrink: 0;
    }
    
    .stitch-settings-panel {
        width: 100%;
        flex-shrink: 0;
    }
    
    .screenshot-editor-panel {
        min-height: 400px;
        flex-shrink: 0;
    }
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: #999;
    pointer-events: none;
}

#subtitleSearchInput {
    width: 100%;
    padding: 8px 40px 8px 40px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
    background: white;
}

#subtitleSearchInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#subtitleSearchInput::placeholder {
    color: #999;
}

.clear-search {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: #999;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-search:hover {
    background: #f0f0f0;
    color: #667eea;
}

.clear-search:active {
    transform: scale(0.95);
}

.search-results {
    margin-top: 6px;
    font-size: 13px;
    color: #666;
    min-height: 0;
    line-height: 1.2;
}

.search-results:empty {
    display: none;
}

.search-results.has-results {
    color: #667eea;
    font-weight: 500;
}

.search-results.no-results {
    color: #999;
}

.subtitle-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.subtitle-list::-webkit-scrollbar {
    width: 8px;
}

.subtitle-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

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

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

.subtitle-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    padding: 40px;
}

.subtitle-empty svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.subtitle-empty p {
    font-size: 16px;
}

.subtitle-item {
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #f8f9fa;
    border: 2px solid transparent;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.subtitle-item-checkbox {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.subtitle-item-content {
    flex: 1;
    min-width: 0;
}

.subtitle-item:hover {
    background: #e9ecef;
    transform: translateX(4px);
}

.subtitle-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #5568d3;
    transform: translateX(8px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.subtitle-time {
    font-size: 12px;
    opacity: 0.7;
    margin-bottom: 4px;
    font-family: 'Courier New', monospace;
}

.subtitle-item.active .subtitle-time {
    opacity: 0.9;
}

.subtitle-text {
    font-size: 14px;
    line-height: 1.6;
}

@media (max-width: 1024px) {
    body {
        padding: 10px;
    }
    
    .container {
        flex-direction: column;
        min-height: calc(100vh - 20px);
        gap: 10px;
    }
    
    .subtitle-section {
        width: 100%;
        min-height: 0;
        flex: 1;
        max-height: 50vh;
    }
    
    .video-wrapper {
        flex: none;
        width: 100%;
        min-height: auto;
        aspect-ratio: 16 / 9;
    }
    
    .video-section {
        flex: none;
        gap: 10px;
    }

    .subtitle-list {
        min-height: 0;
    }
}

@media (max-width: 640px) {
    body {
        padding: 10px;
    }
    
    .container {
        gap: 10px;
    }
    
    .controls {
        padding: 16px;
    }
    
    .control-group {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }
    
    .file-label {
        flex-shrink: 0;
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .file-label svg {
        width: 16px;
        height: 16px;
    }
    
    .file-name {
        flex: 1;
        min-width: 0;
        font-size: 12px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .subtitle-search {
        padding: 4px 12px 0px 12px;
        border-bottom: none;
    }
    
    #subtitleSearchInput {
        padding: 6px 32px 6px 32px;
        font-size: 13px;
        border-width: 1px;
    }
    
    .search-icon {
        left: 10px;
    }
    
    .search-icon,
    .search-icon svg {
        width: 14px !important;
        height: 14px !important;
    }
    
    .clear-search {
        right: 6px;
        padding: 4px;
    }
    
    .clear-search svg {
        width: 14px !important;
        height: 14px !important;
    }
    
    .search-results {
        font-size: 12px;
        margin-top: 2px;
        min-height: 0;
        margin-bottom: 0;
        padding: 0;
        line-height: 1.2;
    }
    
    .search-results:empty {
        display: none;
    }
    
    .subtitle-list {
        padding: 2px 8px 8px 8px;
    }
    
    .subtitle-header {
        padding: 8px 12px;
        border-bottom-width: 1px;
    }
    
    .subtitle-header h2 {
        font-size: 16px;
        font-weight: 600;
    }
    
    .subtitle-count {
        font-size: 12px;
    }
    
    .subtitle-toolbar {
        padding: 8px 12px;
    }
    
    .toolbar-btn {
        font-size: 13px;
        padding: 6px 12px;
    }
    
    .toolbar-btn-subtle {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .toolbar-right {
        gap: 8px;
    }
    
    .checkbox-label {
        font-size: 13px;
    }
    
    .selected-count {
        font-size: 13px;
    }
}

/* 帮助按钮 */
.help-btn {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667eea;
    z-index: 10;
    transition: all 0.3s;
    pointer-events: auto;
}

.help-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 教程弹窗 */
.tutorial-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    overflow-y: auto;
    padding: 20px;
}

.tutorial-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tutorial-content {
    background: white;
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tutorial-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px 16px 0 0;
}

.tutorial-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.close-tutorial-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-tutorial-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.tutorial-body {
    padding: 28px;
    overflow-y: auto;
    flex: 1;
}

.tutorial-section {
    margin-bottom: 32px;
}

.tutorial-section:last-child {
    margin-bottom: 0;
}

.tutorial-section h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #333;
    font-weight: 600;
}

.tutorial-step {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.tutorial-step:last-child {
    margin-bottom: 0;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content strong {
    display: block;
    font-size: 16px;
    margin-bottom: 6px;
    color: #333;
}

.step-content p {
    color: #666;
    line-height: 1.6;
    margin: 0;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.feature-item {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s;
}

.feature-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.feature-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.feature-item strong {
    display: block;
    font-size: 16px;
    margin-bottom: 8px;
    color: #333;
}

.feature-item p {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.shortcut-item kbd {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 12px;
    font-family: monospace;
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-width: 60px;
    text-align: center;
}

.shortcut-item span {
    color: #666;
    font-size: 14px;
}

.tips-list {
    list-style: none;
    padding: 0;
}

.tips-list li {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    line-height: 1.6;
    color: #666;
}

.tips-list li:last-child {
    border-bottom: none;
}

.tips-list li strong {
    color: #333;
}

/* 移动端适配 */
@media (max-width: 1024px) {
    .help-btn {
        bottom: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
    }
    
    .help-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .tutorial-modal {
        padding: 10px;
    }
    
    .tutorial-content {
        max-height: 95vh;
    }
    
    .tutorial-header {
        padding: 20px;
    }
    
    .tutorial-header h2 {
        font-size: 20px;
    }
    
    .tutorial-body {
        padding: 20px;
    }
    
    .tutorial-section {
        margin-bottom: 24px;
    }
    
    .tutorial-section h3 {
        font-size: 18px;
        margin-bottom: 16px;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .shortcuts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .help-btn {
        width: 36px;
        height: 36px;
        bottom: 10px;
        right: 10px;
    }
    
    .help-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .tutorial-header {
        padding: 16px;
    }
    
    .tutorial-header h2 {
        font-size: 18px;
    }
    
    .tutorial-body {
        padding: 16px;
    }
    
    .step-number {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .step-content strong {
        font-size: 15px;
    }
    
    .step-content p {
        font-size: 14px;
    }
}
