.mh-editor{--ed-bg:#111116;--ed-panel:#1b1b23;--ed-text:#f1f2f6;--ed-muted:#a3a7b2;--ed-blue:#75d6e8;background:var(--ed-bg);color:var(--ed-text);border-radius:14px;padding:18px;min-width:700px;font-size:13px}
.mh-editor *{box-sizing:border-box}.mh-editor [hidden]{display:none!important}.mh-editor h2,.mh-editor h3,.mh-editor p{color:inherit}.mh-editor h2{font-size:18px;margin:0}.mh-editor h3{font-size:14px;margin:0 0 12px}.mh-editor a{color:var(--ed-blue)}
.mh-editor button,.mh-editor input{font:inherit}.mh-editor button{background:#303946;color:var(--ed-text);border:1px solid #475365;padding:8px 11px;border-radius:6px;cursor:pointer;white-space:nowrap}.mh-editor button:hover:not(:disabled){border-color:var(--ed-blue);background:#374759}.mh-editor button:disabled{opacity:.4;cursor:not-allowed}.mh-editor button:focus-visible,.mh-editor a:focus-visible,.mh-editor input:focus-visible{outline:2px solid var(--ed-blue);outline-offset:3px}
.mh-editor input:not([type=range]):not([type=checkbox]){background:#15191f;color:var(--ed-text);border:1px solid #475365;border-radius:5px;padding:8px;width:100%}.mh-editor input[type=checkbox]{width:auto}.mh-editor kbd{font-size:10px;font-family:inherit;color:#b6c4d5;margin-left:4px}.mh-editor .ed-primary{background:#2788de;border-color:#399df4;color:white}
.ed-header{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.ed-header h2{flex:1}.ed-header>span{color:#9eb2c9}.ed-note{margin:14px 0;color:#b3c1d2;border-left:3px solid #edb35a;padding:7px 12px;background:#272a2e;line-height:1.6}
.ed-workspace{display:grid;grid-template-columns:210px minmax(240px,1fr) 235px;gap:12px;min-height:385px}.ed-assets,.ed-inspector,.ed-preview{background:var(--ed-panel);border:1px solid #303a48;border-radius:8px;padding:14px}.ed-assets{max-height:480px;overflow:auto}.ed-assets h3:not(:first-child){margin-top:22px}.ed-assets p,.ed-inspector p{color:var(--ed-muted);font-size:12px;line-height:1.7}.mh-editor .ed-asset{display:block;width:100%;text-align:left;margin:8px 0;white-space:normal}.ed-asset span{display:block;overflow-wrap:anywhere}.ed-asset small{display:block;color:#a6b8ce;margin-top:6px}
.ed-version{border-top:1px solid #3d4653;margin-top:8px;padding:8px 0;font-size:11px}.mh-editor .ed-version button{font-size:11px;white-space:normal;width:100%;text-align:left}.ed-version a,.ed-version>span{display:block;margin-top:7px}
.ed-preview{display:flex;flex-direction:column;align-items:center;justify-content:flex-start}.ed-video-stage{position:relative;width:100%;flex-shrink:0}.ed-video-stage #ed-caption-preview{position:absolute;bottom:20%;left:8%;right:8%;text-align:center;white-space:pre-line;color:white;font-weight:700;font-size:clamp(16px,2vw,24px);text-shadow:1px 1px 2px #000,-1px -1px 2px #000;pointer-events:none}.ed-preview video{width:100%;height:300px;object-fit:contain;background:#07090c;border-radius:5px}.ed-preview-bar{display:flex;align-items:center;gap:12px;width:100%;padding-top:12px;flex-wrap:wrap}.ed-preview-bar output{font-variant-numeric:tabular-nums;flex:1}.ed-preview-bar label{font-size:11px;display:flex;align-items:center;gap:6px;color:var(--ed-muted)}.ed-preview-bar input{width:72px}.ed-preview #ed-message{align-self:flex-start;font-size:12px;line-height:1.6;color:#a7bbd4}.ed-preview #ed-message.ed-error{color:#ffad9f}.ed-preview #ed-download{align-self:flex-start;padding:7px 0;font-weight:600}
.ed-inspector label{display:block;color:#b4c2d4;font-size:12px;margin-bottom:12px}.ed-inspector label input{display:block;margin-top:6px}.ed-inspector>button{display:block;width:100%;margin:8px 0}.ed-toolbar{display:flex;align-items:center;gap:7px;padding:14px 0;flex-wrap:wrap}.ed-spacer{flex:1}.ed-timeline-scroll{overflow-x:auto;overflow-y:hidden;border:1px solid #394454;border-radius:6px;background:#191e25}.ed-timeline{position:relative;padding-bottom:24px;min-height:143px}.ed-timeline #ed-ruler{position:relative;height:37px;border-bottom:1px solid #3d4959;cursor:crosshair;touch-action:none}.ed-timeline #ed-ruler span{position:absolute;font-size:10px;color:#9aaec7;padding:8px 4px;border-left:1px solid #5a6c81;font-variant-numeric:tabular-nums;pointer-events:none}
.ed-timeline #ed-clips{display:flex;padding-top:10px;touch-action:none}.mh-editor .ed-clip{height:74px;flex-shrink:0;position:relative;overflow:hidden;border-radius:5px;margin:0;border:2px solid #496990;background:#263d59;text-align:left;padding:0;min-width:0;white-space:nowrap}.mh-editor .ed-clip.asset{background:#294e49;border-color:#45867b}.mh-editor .ed-clip.selected{border-color:#88ccff;box-shadow:inset 0 0 0 1px #88ccff}.mh-editor .ed-clip-body{display:block;width:100%;height:100%;padding:8px 15px;text-align:left;border:0;border-radius:0;background:transparent;overflow:hidden}.mh-editor .ed-clip-body:hover:not(:disabled){background:#ffffff0b}.ed-clip-body>span,.ed-clip-body>small{display:block;overflow:hidden;text-overflow:ellipsis;pointer-events:none}.ed-clip-body>small{font-size:10px;margin-top:4px;color:#b5cbe1}.mh-editor .ed-trim-handle{position:absolute;top:0;bottom:0;width:12px;padding:0;border:0;border-radius:0;background:#456b8c;z-index:2;cursor:ew-resize;opacity:0;touch-action:none}.mh-editor .ed-trim-handle:disabled{cursor:ew-resize}.ed-trim-handle i{position:absolute;width:2px;height:22px;left:5px;top:24px;background:#d5ecff;pointer-events:none}.ed-trim-in{left:0}.ed-trim-out{right:0}.ed-clip.selected .ed-trim-handle,.ed-clip:hover .ed-trim-handle,.ed-trim-handle:focus-visible{opacity:1}.ed-trim-actions{display:flex;gap:6px}.mh-editor .ed-trim-actions button{flex:1;padding:7px 4px}.ed-timeline #ed-playhead{position:absolute;top:0;height:100%;width:2px;background:#f5c975;pointer-events:none}.ed-timeline #ed-playhead:before{content:'';position:absolute;top:0;left:-5px;border:6px solid transparent;border-top-color:#f5c975}.mh-editor details{margin-top:14px;color:#a9bdd6;font-size:12px;line-height:1.8}.mh-editor summary{cursor:pointer}
/* 笔记本上把时间轴留在首屏；属性面板独立滚动。 */
.ed-workspace{min-height:0;height:clamp(300px,43vh,420px)}.ed-inspector{overflow:auto}.ed-preview{overflow:auto}.ed-preview video{height:clamp(180px,28vh,300px);flex-shrink:0}
@media(max-width:1100px){.ed-workspace{grid-template-columns:170px minmax(220px,1fr) 200px}.ed-preview-bar label{display:none}}
.ed-material-modes{display:flex;gap:5px;margin-bottom:12px}.mh-editor .ed-material-modes button{flex:1;padding:7px 4px;font-size:11px}.mh-editor .ed-material-modes [aria-pressed=true]{border-color:#77bbff;background:#264968}.mh-editor dialog{background:var(--ed-panel);color:var(--ed-text);border:1px solid #66778e;border-radius:10px;padding:22px;width:min(560px,90vw);max-height:90vh;overflow:auto}.mh-editor dialog::backdrop{background:#050a11b8}.mh-editor dialog video{display:block;width:100%;height:230px;object-fit:contain;background:#07090c;margin:12px 0}.ed-material-range{display:flex;gap:14px;margin:14px 0}.ed-material-range label{flex:1}.ed-material-range input{margin-top:5px}.ed-material-warning{color:#ebc78f!important;font-size:12px;line-height:1.7}.ed-material-buttons{display:flex;justify-content:flex-end;gap:10px;margin-top:16px}.mh-editor .ed-error{color:#ffad9f}.mh-editor #ed-keep-label{display:flex;align-items:center;gap:6px}
.candidate-compare{display:grid;grid-template-columns:1fr 1fr;gap:16px}.candidate-compare video{width:100%;max-height:340px;background:#101725}.candidate-compare img{display:block;width:100%;max-height:480px;object-fit:contain;background:#101725}.candidate-compare p{margin:6px 0}@media(max-width:650px){.candidate-compare{grid-template-columns:1fr}}
.ed-inspector [data-action]{display:block;width:100%;margin:8px 0}.ed-audio-bar{display:flex;align-items:center;gap:10px;margin:0 0 10px}.ed-audio-bar span{color:#a5c6bb;font-size:12px}.ed-audio-bar button{flex-shrink:0}.ed-timeline #ed-audio-track{position:relative;border-top:1px solid #3d4959;margin-top:9px;touch-action:none}.ed-track-label{position:absolute;top:4px;left:5px;color:#9eacba;font-size:11px;white-space:nowrap}.mh-editor .ed-audio-clip{position:absolute;height:46px;border:2px solid #478778;border-radius:5px;background:#233e36;overflow:hidden;min-width:0}.mh-editor .ed-audio-clip.selected{border-color:#8eebc6;box-shadow:inset 0 0 0 1px #8eebc6}.mh-editor .ed-audio-clip.muted{background:#303638;border-color:#64776f}.mh-editor .ed-audio-body{width:100%;height:100%;border:0;border-radius:0;background:transparent;padding:4px 14px;text-align:left;overflow:hidden;cursor:grab}.ed-audio-body span,.ed-audio-body small{display:block;overflow:hidden;text-overflow:ellipsis;pointer-events:none}.ed-audio-body small{font-size:10px;color:#b2cfc1}.mh-editor .ed-audio-edge{position:absolute;top:0;bottom:0;width:10px;border:0;padding:0;border-radius:0;cursor:ew-resize;background:#4a7e6a;opacity:0;z-index:2;touch-action:none}.ed-audio-in{left:0}.ed-audio-out{right:0}.ed-audio-clip.selected .ed-audio-edge,.ed-audio-clip:hover .ed-audio-edge{opacity:1}.mh-editor #ed-keep-sound-label{display:flex;align-items:center;gap:6px;margin-top:10px}
.ed-timeline-scroll{max-height:310px;overflow:auto}@media(max-height:800px){.mh-editor.has-audio .ed-workspace{height:clamp(200px,30vh,260px)}.mh-editor.has-audio .ed-preview video{height:140px}.mh-editor.has-audio .ed-toolbar{padding:10px 0}.mh-editor.has-audio .ed-note{margin:10px 0;padding:6px 12px}}
.ed-audio-fields{display:grid;grid-template-columns:1fr 1fr;gap:0 8px}.ed-audio-fields label{min-width:0;margin-bottom:8px}.ed-audio-actions{display:flex;gap:6px}.mh-editor .ed-audio-actions button{width:auto;flex:1;padding:7px 4px;font-size:11px}
.ed-frame-crop{border-top:1px solid #475365;padding-top:10px}.ed-frame-crop summary{cursor:pointer;font-weight:600}.ed-crop-fields{display:grid;grid-template-columns:1fr 1fr;gap:8px}.ed-crop-fields label{min-width:0;font-size:11px}.ed-crop-fields input{margin-top:5px}.ed-preview canvas{width:100%;height:clamp(180px,28vh,300px);object-fit:contain;background:#07090c;border-radius:5px;flex-shrink:0}@media(max-height:800px){.mh-editor.has-audio .ed-preview canvas{height:140px}}
/* 新字幕只属于当前草稿；不与画面或声音共享选择状态。 */
.mh-editor.ed-preview-large .ed-workspace{height:clamp(450px,75vh,760px)}
.mh-editor.ed-preview-large .ed-preview video,.mh-editor.ed-preview-large .ed-preview canvas{height:clamp(300px,55vh,590px)}
.ed-captions{padding:16px;border:1px solid #343640;border-radius:10px;margin:12px 0;background:#17191f}
.mh-editor .ed-captions>label{display:block;max-width:720px;margin:12px 0}
.mh-editor .ed-captions textarea,.mh-editor .ed-captions select{font:inherit;background:#242731;color:var(--ed-text);border:1px solid #454957;border-radius:6px;padding:8px}
.mh-editor .ed-captions>label textarea{display:block;width:100%;margin-top:6px;resize:vertical}
#ed-shot-narration{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px;margin:14px 0}
#ed-shot-narration>label{display:flex;flex-direction:column;gap:8px;min-width:0;padding:12px;border:1px solid #454957;border-radius:8px}
#ed-shot-narration textarea,#ed-shot-narration audio{display:block;width:100%;min-width:0}
#ed-shot-narration textarea{resize:vertical;min-height:64px}
.ed-captions p{color:#a7adba;font-size:13px}.ed-caption-row{display:grid;grid-template-columns:minmax(180px,1fr) 110px 110px 140px 90px;gap:12px;align-items:center;margin:10px 0}
.ed-caption-row textarea,.ed-caption-row input,.ed-caption-row select{width:100%;box-sizing:border-box;background:#242731;color:#eee;border:1px solid #454957;border-radius:6px;padding:8px}
.ed-caption-row label{font-size:12px}.ed-caption-row textarea{min-height:48px;resize:vertical}
#ed-caption-track{position:relative;height:62px;border-top:1px solid #383341}.ed-caption-block{position:absolute;top:24px;height:30px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:#624b86;border:1px solid #a189c6;border-radius:4px;padding:3px 8px;box-sizing:border-box;font-size:12px}
.ed-video-stage #ed-caption-preview{position:absolute;bottom:auto;right:auto;white-space:pre-wrap;line-height:1.35;text-align:center;color:white;pointer-events:none;font-weight:700;text-shadow:0 1px 3px black}
#ed-caption-preview span{position:absolute}#ed-caption-preview .ed-caption-top{top:8%}#ed-caption-preview .ed-caption-bottom{bottom:8%}#ed-caption-preview .ed-caption-legacy{bottom:20%}#ed-caption-preview .ed-caption-middle{top:50%;transform:translateY(-50%)}
@media(max-width:800px){.ed-caption-row{grid-template-columns:1fr 1fr}.ed-caption-row textarea{grid-column:1/-1}}
.mh-editor #ed-export-dialog{width:min(800px,calc(100vw - 32px));max-width:calc(100vw - 32px);max-height:calc(100dvh - 24px);box-sizing:border-box;padding:16px}
.mh-editor #ed-export-dialog h3{margin:0 0 8px}
.mh-editor #ed-export-dialog p{font-size:12px;line-height:1.5;margin:8px 0}
.mh-editor #ed-export-dialog video{height:clamp(180px,calc(100dvh - 220px),720px);margin:12px 0}
/* 操作反馈与拖动选择：不让浏览器把轨道文字当作可拖文本。 */
#ed-notice{position:sticky;top:10px;z-index:20;padding:12px 16px;border:1px solid #a65344;border-radius:8px;background:#412923;color:#ffd0c5!important;line-height:1.6}
.ed-timeline{user-select:none;-webkit-user-select:none}.ed-timeline button{user-select:none}
.mh-editor .ed-asset-cover{display:block;width:100%;height:96px;object-fit:cover;border-radius:4px;background:#0b0f15;margin-bottom:7px;pointer-events:none}
.ed-fullscreen-controls{display:none}.ed-video-stage:fullscreen{width:100vw;height:100vh;background:#05070a;display:flex;align-items:center;justify-content:center}
.ed-video-stage:fullscreen video,.ed-video-stage:fullscreen canvas{width:100%;height:100%;object-fit:contain}
.ed-video-stage:fullscreen .ed-fullscreen-controls{display:flex;position:absolute;bottom:16px;left:50%;transform:translateX(-50%);gap:12px;background:#15191fd9;padding:10px;border-radius:10px;z-index:4}
.ed-caption-block{display:flex;padding:0;touch-action:none}.ed-caption-block.selected{outline:2px solid #e2c7ff;outline-offset:-2px}
.mh-editor .ed-caption-block button{border:0;border-radius:0;padding:2px 4px;background:transparent;min-width:10px;cursor:ew-resize}
.mh-editor .ed-caption-block .ed-caption-body{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;cursor:grab;text-align:left}
#ed-narration-preview{width:min(100%,600px)}
.ed-video-stage.ed-fullscreen-fallback{position:fixed;inset:0;width:100vw;height:100dvh;background:#05070a;display:flex;align-items:center;justify-content:center;z-index:10000}
.mh-editor.has-audio .ed-preview .ed-video-stage.ed-fullscreen-fallback video,.mh-editor.has-audio .ed-preview .ed-video-stage.ed-fullscreen-fallback canvas,.ed-video-stage.ed-fullscreen-fallback video,.ed-video-stage.ed-fullscreen-fallback canvas{width:100%;height:100%;object-fit:contain}
.ed-video-stage.ed-fullscreen-fallback .ed-fullscreen-controls{display:flex;position:absolute;top:16px;right:16px;gap:12px;background:#15191fd9;padding:10px;border-radius:10px;z-index:4}
