:root #tool-body {
  --card-bg: #fff;
  --primary: #16baaa;
  --danger: #ff5722;
  --warn: #ffb800;
  --dark-item: #2b2d36;
  --border-color: #eee;
  --text-muted: #999;
  --panel-bg: #f2f4f7;
  --text-color: #333;
  --label-color: #666;
  --tip-bg: #e8f9f7;
  --tip-border: #b2e8e3;
  --tip-color: #0d8f82;
  --player-bg: #111;
  --timeline-bg: #3a3d48;
  --timeline-range: rgba(22,186,170,0.45);
}
.theme-dark-mode #tool-body {
  --card-bg: #2b2b2b;
  --border-color: #444;
  --panel-bg: #333;
  --text-color: #ddd;
  --label-color: #aaa;
  --tip-bg: #1a3a38;
  --tip-border: #2a5a55;
  --tip-color: #5dcfc7;
  --player-bg: #0a0a0a;
  --timeline-bg: #2a2c34;
}
#tool-body { font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif; color: var(--text-color); }

#tool-body .mode-tabs { display: flex; gap: 10px; margin-bottom: 16px; }
#tool-body .mode-tab { flex: 1; padding: 12px 10px; border: 2px solid var(--border-color); border-radius: 8px; cursor: pointer; text-align: center; background: var(--card-bg); color: var(--text-color); transition: .2s; }
#tool-body .mode-tab.active { border-color: var(--primary); background: rgba(22,186,170,0.08); color: var(--primary); }
#tool-body .mode-tab i { font-size: 20px; display: block; margin-bottom: 4px; }
#tool-body .mode-tab span { font-size: 14px; font-weight: bold; }
#tool-body .mode-tab small { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; font-weight: normal; }
.theme-dark-mode #tool-body .mode-tab { background: var(--panel-bg); }

#tool-body .upload-area { padding: 40px; text-align: center; border-radius: 8px; border-width: 2px; cursor: pointer; transition: .3s; display: block; color: inherit; }
#tool-body .upload-area:hover { border-color: var(--primary); }
#tool-body .layui-upload-choose { display: none !important; }
#tool-body .upload-icon { font-size: 48px; color: var(--primary); margin-bottom: 10px; }
#tool-body .upload-area h3 { margin-bottom: 5px; }
#tool-body .upload-area p { color: var(--text-muted); font-size: 14px; }

#tool-body .section-title { margin: 25px 0 15px; font-weight: bold; display: flex; justify-content: space-between; align-items: center; }
#tool-body .clear-btn { font-size: 14px; color: var(--danger); cursor: pointer; font-weight: normal; }
#tool-body .video-item, #tool-body .img-item { background: var(--dark-item); color: #fff; border-radius: 8px; margin-bottom: 10px; padding: 12px 14px; display: flex; align-items: center; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
#tool-body .file-icon { width: 40px; height: 40px; background: rgba(255,255,255,0.1); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-right: 12px; flex-shrink: 0; }
#tool-body .file-icon i { font-size: 20px; color: var(--primary); }
#tool-body .img-thumb { width: 48px; height: 48px; border-radius: 6px; object-fit: contain; margin-right: 12px; flex-shrink: 0; background-color: #fff; background-image: linear-gradient(45deg,#ddd 25%,transparent 25%),linear-gradient(-45deg,#ddd 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ddd 75%),linear-gradient(-45deg,transparent 75%,#ddd 75%); background-size: 12px 12px; background-position: 0 0,0 6px,6px -6px,-6px 0; }
#tool-body .file-info { flex: 1; min-width: 0; }
#tool-body .file-name { font-size: 14px; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#tool-body .file-meta { font-size: 12px; color: #bbb; margin-top: 3px; }
#tool-body .item-order { width: 26px; height: 26px; background: rgba(255,255,255,0.12); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-right: 10px; flex-shrink: 0; font-size: 12px; color: #ccc; }
#tool-body .item-actions { display: flex; align-items: center; gap: 4px; margin-left: 8px; flex-shrink: 0; }
#tool-body .sort-btn { width: 28px; height: 28px; background: rgba(255,255,255,0.1); border: none; border-radius: 4px; color: #ccc; cursor: pointer; }
#tool-body .sort-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }
#tool-body .sort-btn:disabled { opacity: .3; cursor: not-allowed; }
#tool-body .del-btn { color: var(--danger); cursor: pointer; font-size: 20px; opacity: .6; padding: 4px 6px; }
#tool-body .del-btn:hover { opacity: 1; }

#tool-body .player-panel { background: var(--card-bg); border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.05); margin-top: 20px; border: 1px solid var(--border-color); overflow: hidden; }
#tool-body .player-stage { position: relative; background: var(--player-bg); min-height: 160px; }
#tool-body #previewVideo { display: block; width: 100%; max-height: 360px; background: #000; outline: none; }
#tool-body #previewVideo.is-hidden { display: none; }
#tool-body .player-fallback { display: none; color: #bbb; text-align: center; padding: 40px 20px 36px; font-size: 14px; line-height: 1.7; }
#tool-body .player-fallback.show { display: block; }
#tool-body .player-fallback .fallback-icon { font-size: 36px; color: var(--primary); display: block; margin-bottom: 10px; }
#tool-body .preview-job { display: none; max-width: 420px; margin: 16px auto 0; text-align: left; }
#tool-body .preview-job.show { display: block; }
#tool-body .preview-job .job-progress-bar { background: #333; }
#tool-body .fallback-actions { margin-top: 14px; }
#tool-body .play-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; background: rgba(0,0,0,0.22); z-index: 2; }
#tool-body .play-overlay.hide { display: none; }
#tool-body .play-overlay i { font-size: 52px; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,0.45); }
#tool-body .play-overlay.is-playing { background: rgba(0,0,0,0.12); }
#tool-body .play-overlay.is-playing i { font-size: 46px; opacity: 0.88; }
#tool-body .player-toolbar { padding: 12px 16px 16px; }
#tool-body .time-readout { display: flex; justify-content: space-between; font-size: 12px; color: var(--label-color); margin-bottom: 8px; font-variant-numeric: tabular-nums; }
#tool-body .time-readout b { color: var(--primary); }
#tool-body .timeline { position: relative; height: 36px; user-select: none; touch-action: none; margin: 4px 0 14px; }
#tool-body .timeline-track { position: absolute; left: 0; right: 0; top: 12px; height: 12px; background: var(--timeline-bg); border-radius: 6px; cursor: pointer; }
#tool-body .timeline-range { position: absolute; top: 0; height: 100%; background: var(--timeline-range); border-radius: 6px; pointer-events: none; }
#tool-body .timeline-playhead { position: absolute; top: -6px; width: 2px; height: 24px; background: #fff; border-radius: 1px; pointer-events: none; z-index: 2; }
#tool-body .timeline-handle { position: absolute; top: 4px; width: 18px; height: 28px; margin-left: -9px; background: var(--primary); border-radius: 4px; cursor: ew-resize; z-index: 3; }
#tool-body .timeline.disabled { opacity: 0.45; pointer-events: none; }
#tool-body .time-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
#tool-body .time-field { display: flex; flex-direction: column; gap: 4px; min-width: 120px; flex: 1; }
#tool-body .time-field label { font-size: 12px; color: var(--label-color); font-weight: 600; }
#tool-body .time-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#tool-body .clip-len { font-size: 12px; color: var(--text-muted); white-space: nowrap; line-height: 30px; }

#tool-body .control-panel-wrapper { background: var(--card-bg); border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.05); margin-top: 20px; border: 1px solid var(--border-color); }
#tool-body .panel-header { border-radius: 12px 12px 0 0; background: var(--panel-bg); padding: 14px 20px; display: flex; align-items: center; gap: 8px; font-weight: bold; color: var(--label-color); font-size: 15px; border-bottom: 1px solid var(--border-color); }
#tool-body .panel-header i { color: var(--primary); font-size: 18px; }
#tool-body .panel-content { padding: 18px 22px; }
#tool-body .param-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px 24px; margin-bottom: 16px; }
@media(max-width:600px){ #tool-body .param-grid { grid-template-columns: 1fr; } }
#tool-body .param-cell { display: flex; flex-direction: column; gap: 4px; }
#tool-body .param-cell .layui-form-label-sm { font-size: 12px; color: var(--label-color); font-weight: 600; margin-bottom: 2px; padding: 0; width: auto; float: none; }
#tool-body .delay-row { display: flex; align-items: center; gap: 8px; }
#tool-body .delay-row .layui-input { flex: 1; }
#tool-body .delay-unit { color: var(--label-color); font-size: 13px; flex-shrink: 0; }
#tool-body .mute-tip { background: var(--tip-bg); border: 1px solid var(--tip-border); color: var(--tip-color); border-radius: 6px; padding: 10px 14px; font-size: 13px; line-height: 1.6; margin-bottom: 16px; display: flex; gap: 8px; align-items: flex-start; }
#tool-body .mute-tip i { flex-shrink: 0; margin-top: 1px; }
#tool-body .action-row { display: flex; align-items: center; gap: 12px; padding-top: 16px; border-top: 1px dashed var(--border-color); margin-top: 4px; flex-wrap: wrap; }
#tool-body #processBtn { background-color: var(--primary); min-width: 160px; border: none; }
#tool-body #stopBtn { display: none; }
#tool-body .job-progress { display: none; width: 100%; margin-top: 14px; }
#tool-body .job-progress.show { display: block; }
#tool-body .job-progress-bar { height: 8px; background: var(--panel-bg); border-radius: 4px; overflow: hidden; }
#tool-body .job-progress-fill { height: 100%; width: 0; background: var(--primary); transition: width .25s ease; }
#tool-body .job-progress-text { font-size: 13px; color: var(--label-color); margin-top: 8px; }

#tool-body .output-area { display: none; margin-top: 28px; border-top: 1px solid var(--border-color); padding-top: 20px; }
#tool-body .gif-preview-wrap { text-align: center; margin-bottom: 14px; padding: 12px; border-radius: 8px; background-color: #f7f7f7; background-image: linear-gradient(45deg,#ddd 25%,transparent 25%),linear-gradient(-45deg,#ddd 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ddd 75%),linear-gradient(-45deg,transparent 75%,#ddd 75%); background-size: 16px 16px; background-position: 0 0,0 8px,8px -8px,-8px 0; }
.theme-dark-mode #tool-body .gif-preview-wrap { background-color: #2a2a2a; background-image: linear-gradient(45deg,#3a3a3a 25%,transparent 25%),linear-gradient(-45deg,#3a3a3a 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#3a3a3a 75%),linear-gradient(-45deg,transparent 75%,#3a3a3a 75%); }
#tool-body .gif-preview-wrap img { max-width: 100%; max-height: 360px; }
#tool-body .output-item { border: 1px solid var(--border-color); border-radius: 8px; padding: 12px 15px; display: flex; align-items: center; justify-content: space-between; background: var(--card-bg); flex-wrap: wrap; gap: 10px; }
#tool-body .output-name { font-weight: bold; font-size: 14px; color: var(--text-color); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
#tool-body .tag-fmt { background: #e3f9f5; color: var(--primary); border: 1px solid #c2e9e3; padding: 2px 7px; border-radius: 4px; font-size: 12px; font-weight: bold; }
.theme-dark-mode #tool-body .tag-fmt { background: #1a3a38; border-color: #2a5a55; }
#tool-body .tag-size { color: var(--text-muted); font-size: 12px; }

@media(max-width:768px){
  #tool-body .upload-area { padding: 20px; }
  #tool-body #previewVideo { max-height: 220px; }
  #tool-body .time-row { flex-direction: column; align-items: stretch; }
  #tool-body .mode-tabs { flex-direction: column; }
}