/* ==========================================================================
   video-editor.css · 深色 + 剪映红
   --------------------------------------------------------------------------
   所有颜色变量都定义在 .ve-app 作用域内，不依赖站点全局变量。
   站点 style.css 里没有 --card / --line，若沿用会导致卡片回落到白色、
   文字却跟随暗色主题变成浅色 —— 白底白字。这里自带一套，彻底隔离。
   ========================================================================== */

.ve-app {
  --ve-bg: #0b0b0f;
  --ve-panel: #14141b;
  --ve-panel2: #1b1b24;
  --ve-panel3: #23232f;
  --ve-line: #2a2a36;
  --ve-line2: #34344a;
  --ve-text: #f0f0f6;
  --ve-sub: #8b8b9c;
  --ve-dim: #5f5f70;
  --ve-red: #fe2c55;
  --ve-red-h: #ff476c;
  --ve-red-soft: rgba(254, 44, 85, .16);
  --ve-radius: 12px;
  --ve-radius-s: 8px;

  position: relative;
  color: var(--ve-text);
  font-size: 13px;
  line-height: 1.5;
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  /* 站点主容器通常带内边距，这里自己撑满，避免嵌套挤压 */
  margin: 0 auto;
  max-width: 1560px;

  /* 自带深色底板：站点是浅色主题时，顶栏/面板之间的缝隙会露出白底，
     而我们的文字是 #f0f0f6 —— 不铺底就是白底白字（线上实测标题几乎不可见）。 */
  background: var(--ve-bg);
  border: 1px solid var(--ve-line);
  border-radius: 16px;
  padding: 10px 12px 12px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, .30);
}

.ve-app *,
.ve-app *::before,
.ve-app *::after { box-sizing: border-box; }

.ve-app button { font-family: inherit; }

/* ------------------------------------------------------------- 整体骨架 */

.ve-shell {
  display: grid;
  grid-template-rows: 46px minmax(320px, 1fr) auto;
  gap: 10px;
  /* 顶栏 58 + 页面留白 + 本卡片 padding/边框，保证一屏放下且时间轴不被挤掉 */
  height: calc(100vh - 172px);
  min-height: 600px;
}

/* ---------------------------------------------------------------- 顶栏 */

.ve-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
}

.ve-top-l { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ve-top-r { display: flex; align-items: center; gap: 8px; }

.ve-top h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .2px;
}

.ve-back {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 99px;
  border: 1px solid var(--ve-line);
  background: var(--ve-panel);
  color: var(--ve-sub);
  font-size: 12.5px;
  text-decoration: none;
  transition: .18s;
}
.ve-back:hover { color: var(--ve-text); border-color: var(--ve-line2); }

.ve-beta {
  font-size: 11px;
  color: var(--ve-red);
  background: var(--ve-red-soft);
  border: 1px solid rgba(254, 44, 85, .32);
  padding: 1px 7px;
  border-radius: 99px;
}

/* --------------------------------------------------------------- 主区 */

.ve-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 356px;
  gap: 10px;
  min-height: 0;
}

/* 预览舞台 */
.ve-stage {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--ve-panel);
  border: 1px solid var(--ve-line);
  border-radius: var(--ve-radius);
  overflow: hidden;
}

.ve-stage-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid var(--ve-line);
  font-size: 12px;
  color: var(--ve-sub);
  flex: none;
}
.ve-mode { color: var(--ve-text); font-weight: 600; }
.ve-res { color: var(--ve-dim); font-variant-numeric: tabular-nums; }

.ve-canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(254, 44, 85, .05), transparent 62%),
    #08080c;
}
.ve-canvas-wrap.dragover { outline: 2px dashed var(--ve-red); outline-offset: -8px; }

.ve-canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 6px;
  background: #000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .55);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* 空状态投放层 */
.ve-drop {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: transparent;
}
.ve-drop-in {
  text-align: center;
  padding: 28px 34px;
  border: 1.5px dashed var(--ve-line2);
  border-radius: 14px;
  background: rgba(255, 255, 255, .02);
  transition: .2s;
}
.ve-drop:hover .ve-drop-in { border-color: var(--ve-red); background: rgba(254, 44, 85, .06); }
.ve-drop-icon {
  width: 40px; height: 40px; margin: 0 auto 10px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--ve-red-soft);
  color: var(--ve-red);
  font-size: 22px;
}
.ve-drop p { margin: 0; font-size: 13.5px; color: var(--ve-text); }
.ve-drop .ve-dim { margin-top: 5px; font-size: 12px; color: var(--ve-sub); }

/* 播放控制条 */
.ve-transport {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--ve-line);
  flex: none;
}

.ve-tb {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 1px solid var(--ve-line);
  background: var(--ve-panel2);
  color: var(--ve-text);
  border-radius: var(--ve-radius-s);
  cursor: pointer;
  font-size: 13px;
  transition: .16s;
}
.ve-tb:hover { border-color: var(--ve-line2); background: var(--ve-panel3); }
.ve-play {
  width: 40px;
  background: var(--ve-red);
  border-color: var(--ve-red);
  color: #fff;
  font-size: 15px;
}
.ve-play:hover { background: var(--ve-red-h); border-color: var(--ve-red-h); }

.ve-time {
  margin-left: 4px;
  font-size: 12.5px;
  color: var(--ve-sub);
  font-variant-numeric: tabular-nums;
}

.ve-status {
  padding: 0 12px 9px;
  min-height: 17px;
  font-size: 12px;
  color: var(--ve-sub);
  flex: none;
}
.ve-status.err { color: #ff6b6b; }
.ve-status.ok { color: #35d07f; }

/* ------------------------------------------------------------- 属性面板 */

.ve-side {
  min-height: 0;
  display: flex;
}

.ve-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--ve-panel);
  border: 1px solid var(--ve-line);
  border-radius: var(--ve-radius);
  overflow: hidden;
}

.ve-tabs {
  display: flex;
  gap: 2px;
  padding: 6px;
  background: var(--ve-panel2);
  border-bottom: 1px solid var(--ve-line);
  flex: none;
}
.ve-tabs button {
  flex: 1;
  padding: 7px 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ve-sub);
  font-size: 12.5px;
  cursor: pointer;
  transition: .16s;
}
.ve-tabs button:hover { color: var(--ve-text); }
.ve-tabs button.on {
  background: var(--ve-panel3);
  color: var(--ve-text);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--ve-line2);
}

.ve-panes { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; }
.ve-pane { display: none; }
.ve-pane.on { display: block; }

/* 面板滚动条（深色下默认滚动条很突兀） */
.ve-panes::-webkit-scrollbar { width: 8px; }
.ve-panes::-webkit-scrollbar-thumb { background: var(--ve-line2); border-radius: 99px; }
.ve-panes::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------------------------------------ 通用构件 */

.ve-sec { margin-bottom: 14px; }
.ve-sec:last-child { margin-bottom: 0; }

.ve-sec-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--ve-sub);
  margin-bottom: 8px;
  letter-spacing: .3px;
}

.ve-sub-hd {
  font-size: 11.5px;
  color: var(--ve-dim);
  margin: 10px 0 6px;
}

.ve-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  font-size: 12.5px;
  color: var(--ve-sub);
}
.ve-row-lb { width: 40px; flex: none; }
.ve-row-v {
  width: 42px;
  text-align: right;
  color: var(--ve-text);
  font-variant-numeric: tabular-nums;
  flex: none;
}

.ve-app input[type="range"] {
  flex: 1;
  min-width: 60px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--ve-line2);
  border-radius: 99px;
  outline: none;
}
.ve-app input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--ve-red);
  border: 2px solid #fff;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}
.ve-app input[type="range"]::-moz-range-thumb {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--ve-red);
  border: 2px solid #fff;
  cursor: pointer;
}

.ve-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--ve-line);
  border-radius: var(--ve-radius-s);
  background: var(--ve-panel2);
  color: var(--ve-text);
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: .16s;
}
.ve-btn:hover { border-color: var(--ve-line2); background: var(--ve-panel3); }
.ve-btn.primary {
  background: var(--ve-red);
  border-color: var(--ve-red);
  color: #fff;
  font-weight: 600;
}
.ve-btn.primary:hover { background: var(--ve-red-h); border-color: var(--ve-red-h); }
.ve-btn.danger { color: #ff6b6b; }
.ve-btn.danger:hover { border-color: rgba(255, 107, 107, .5); background: rgba(255, 107, 107, .1); }
.ve-btn:disabled { opacity: .45; cursor: not-allowed; }
.ve-btn.ve-wide { width: 100%; margin-top: 8px; height: 36px; }

.ve-btnrow { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.ve-btnrow .ve-btn { flex: 1; min-width: 0; padding: 0 8px; }
.ve-btnrow.ve-sml .ve-btn { height: 28px; font-size: 12px; }

.ve-mini {
  border: 0; background: transparent;
  color: var(--ve-red); font-size: 11.5px; cursor: pointer; padding: 0;
}

.ve-hint {
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--ve-sub);
  margin: 8px 0;
}
.ve-hint:empty { display: none; }

.ve-kv {
  font-size: 12px;
  color: var(--ve-text);
  background: var(--ve-panel2);
  border: 1px solid var(--ve-line);
  border-radius: var(--ve-radius-s);
  padding: 8px 10px;
  line-height: 1.7;
}

.ve-info { display: grid; grid-template-columns: 52px 1fr; gap: 6px 8px; margin: 0; font-size: 12px; }
.ve-info dt { color: var(--ve-dim); }
.ve-info dd { margin: 0; color: var(--ve-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 比例选择 */
.ve-ratio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ve-ratio button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 7px 2px;
  border: 1px solid var(--ve-line);
  border-radius: var(--ve-radius-s);
  background: var(--ve-panel2);
  color: var(--ve-sub);
  cursor: pointer;
  transition: .16s;
}
.ve-ratio button b { font-size: 12.5px; color: var(--ve-text); font-weight: 600; }
.ve-ratio button i { font-style: normal; font-size: 10.5px; color: var(--ve-dim); }
.ve-ratio button:hover { border-color: var(--ve-line2); }
.ve-ratio button.on {
  border-color: var(--ve-red);
  background: var(--ve-red-soft);
}
.ve-ratio button.on b { color: var(--ve-red); }
.ve-ratio button.on i { color: var(--ve-red); opacity: .8; }

.ve-cust { display: none; margin-top: 8px; }
.ve-cust input {
  width: 66px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--ve-line);
  border-radius: var(--ve-radius-s);
  background: var(--ve-panel2);
  color: var(--ve-text);
  font-size: 12px;
}
.ve-times { color: var(--ve-dim); }

.ve-field { margin: 8px 0; }
.ve-field label { display: block; font-size: 11.5px; color: var(--ve-sub); margin-bottom: 5px; }

.ve-app select,
.ve-app input[type="text"],
.ve-app input[type="number"],
.ve-app textarea {
  width: 100%;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--ve-line);
  border-radius: var(--ve-radius-s);
  background: var(--ve-panel2);
  color: var(--ve-text);
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
}
.ve-app textarea { height: auto; padding: 7px 8px; resize: vertical; line-height: 1.5; }
.ve-app select:focus,
.ve-app input:focus,
.ve-app textarea:focus { border-color: var(--ve-red); }

.ve-app input[type="color"] {
  width: 34px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--ve-line);
  border-radius: 6px;
  background: var(--ve-panel2);
  cursor: pointer;
}

.ve-num { width: 72px !important; height: 28px !important; flex: none; }
.ve-unit { font-size: 11.5px; color: var(--ve-dim); }

.ve-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.ve-grid2 label { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; color: var(--ve-sub); }

.ve-chk { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ve-sub); white-space: nowrap; }
.ve-app input[type="checkbox"] { accent-color: var(--ve-red); width: 13px; height: 13px; }

/* 开关 */
.ve-switch-row { justify-content: space-between; }
.ve-switch { position: relative; display: inline-block; width: 38px; height: 21px; flex: none; }
.ve-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.ve-switch i {
  position: absolute; inset: 0;
  background: var(--ve-line2);
  border-radius: 99px;
  transition: .2s;
}
.ve-switch i::after {
  content: "";
  position: absolute; top: 2px; left: 2px;
  width: 17px; height: 17px;
  background: #fff;
  border-radius: 50%;
  transition: .2s;
}
.ve-switch input:checked + i { background: var(--ve-red); }
.ve-switch input:checked + i::after { transform: translateX(17px); }

/* 封面预览 */
.ve-cover-prev {
  position: relative;
  height: 132px;
  border: 1px solid var(--ve-line);
  border-radius: var(--ve-radius-s);
  background: #08080c center/contain no-repeat;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--ve-dim);
  margin-bottom: 8px;
}

/* 文字图层列表 */
.ve-layer-list {
  max-height: 168px;
  overflow-y: auto;
  border: 1px solid var(--ve-line);
  border-radius: var(--ve-radius-s);
  background: var(--ve-panel2);
  padding: 4px;
  margin: 8px 0;
}
.ve-layer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--ve-sub);
  cursor: pointer;
}
.ve-layer:hover { background: var(--ve-panel3); }
.ve-layer.on { background: var(--ve-red-soft); color: var(--ve-text); }
.ve-layer span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ve-layer-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; border: 1px solid rgba(255,255,255,.25); }
.ve-empty { padding: 12px; text-align: center; font-size: 11.5px; color: var(--ve-dim); }

.ve-text-props.is-disabled { opacity: .45; pointer-events: none; }

/* 进度条 */
.ve-prog {
  height: 5px;
  border-radius: 99px;
  background: var(--ve-panel3);
  overflow: hidden;
  margin-top: 8px;
  display: none;
}
.ve-prog.on { display: block; }
.ve-prog i { display: block; height: 100%; width: 0; background: var(--ve-red); transition: width .15s linear; }

/* --------------------------------------------------------------- 时间轴 */

.ve-tl {
  background: var(--ve-panel);
  border: 1px solid var(--ve-line);
  border-radius: var(--ve-radius);
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  flex: none;
}

/* 顶部工具条：左边操作、右边时间码 */
.ve-tl-hd {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--ve-sub);
}

.ve-tl-tools { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; min-width: 0; }
.ve-tl-tools button {
  height: 26px;
  padding: 0 9px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid var(--ve-line);
  background: var(--ve-panel2);
  color: var(--ve-sub);
  cursor: pointer;
  white-space: nowrap;
  transition: .15s;
}
.ve-tl-tools button:hover:not(:disabled) {
  color: var(--ve-text);
  border-color: var(--ve-line2);
  background: var(--ve-panel3);
}
.ve-tl-tools button:disabled { opacity: .38; cursor: not-allowed; }
.ve-tl-sep { width: 1px; height: 16px; background: var(--ve-line); margin: 0 3px; flex: none; }

.ve-tl-tc {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--ve-sub);
  flex: none;
}
.ve-tl-tc i { font-style: normal; color: var(--ve-dim); }
.ve-tl-tc #veTc { color: var(--ve-red); font-weight: 600; }

/* 横向滚动容器：内容宽度由 JS 按 pxPerSec 设定 */
.ve-tl-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}
.ve-tl-scroll::-webkit-scrollbar { height: 8px; }
.ve-tl-scroll::-webkit-scrollbar-thumb { background: var(--ve-line2); border-radius: 99px; }
.ve-tl-scroll::-webkit-scrollbar-track { background: transparent; }

.ve-tl-inner { position: relative; min-width: 100%; }

/* 刻度尺 */
.ve-ruler {
  position: relative;
  height: 17px;
  border-bottom: 1px solid var(--ve-line);
  margin-bottom: 4px;
  cursor: pointer;
  touch-action: none;
}
.ve-ruler i { position: absolute; top: 4px; bottom: 0; width: 1px; background: rgba(255,255,255,.10); }
.ve-ruler i b {
  position: absolute;
  left: 4px;
  top: -3px;
  font-size: 10px;
  font-weight: 400;
  color: var(--ve-dim);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* 轨道：连续片段块，与剪映一样首尾相接 */
.ve-track {
  position: relative;
  display: flex;
  align-items: stretch;
  height: 58px;
  border-radius: 6px;
  background: #101018;
  border: 1px solid var(--ve-line);
  touch-action: none;
}
.ve-track.is-empty { border-style: dashed; }

.ve-blk {
  position: relative;
  flex: none;
  min-width: 6px;
  overflow: hidden;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, .10);
  cursor: pointer;
  background: #1a1a24;
}
.ve-blk-strip { position: absolute; inset: 0; display: flex; pointer-events: none; }
.ve-blk-strip b {
  flex: 1 1 0;
  min-width: 0;
  background: #000 center/cover no-repeat;
  opacity: .92;
}
.ve-blk-strip b.ve-blk-noimg { background: repeating-linear-gradient(45deg, #23232f 0 6px, #1b1b24 6px 12px); opacity: 1; }

.ve-blk-tag {
  position: absolute;
  left: 4px;
  bottom: 3px;
  font-size: 10px;
  line-height: 1.5;
  color: #fff;
  background: rgba(0, 0, 0, .58);
  padding: 0 4px;
  border-radius: 3px;
  white-space: nowrap;
  pointer-events: none;
  max-width: calc(100% - 8px);
  overflow: hidden;
  text-overflow: ellipsis;
}

.ve-blk.is-cover { border-color: rgba(254, 44, 85, .75); }
.ve-blk.is-cover .ve-blk-tag { background: rgba(254, 44, 85, .85); }
.ve-blk.is-image .ve-blk-tag { background: rgba(52, 120, 246, .85); }
.ve-blk.on { border-color: var(--ve-red); box-shadow: inset 0 0 0 1px var(--ve-red); }
.ve-blk.is-dragging { z-index: 5; opacity: .85; box-shadow: 0 6px 18px rgba(0,0,0,.5); }
.ve-blk.is-trim { z-index: 4; }

/* 左右修剪手柄：悬停/选中才显示，避免小片段上全是白条 */
.ve-blk-h {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 11px;
  cursor: ew-resize;
  opacity: 0;
  transition: opacity .12s;
  touch-action: none;
  z-index: 2;
}
.ve-blk-h.l { left: 0; background: linear-gradient(90deg, rgba(255,255,255,.28), rgba(255,255,255,0)); }
.ve-blk-h.r { right: 0; background: linear-gradient(270deg, rgba(255,255,255,.28), rgba(255,255,255,0)); }
.ve-blk:hover .ve-blk-h, .ve-blk.on .ve-blk-h, .ve-blk.is-trim .ve-blk-h { opacity: 1; }
.ve-blk-h::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 16px;
  margin: -8px 0 0 -1px;
  background: #fff;
  border-radius: 1px;
  opacity: .85;
}

/* 红色游标：贯穿刻度与轨道 */
.ve-ph {
  position: absolute;
  left: 0;
  top: -21px;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: var(--ve-red);
  z-index: 6;
  pointer-events: none;
  will-change: transform;
}
.ve-ph::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  background: var(--ve-red);
  border-radius: 2px;
  transform: rotate(45deg);
}

.ve-tl-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--ve-dim);
  pointer-events: none;
}

.ve-ins-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, .7);
  display: none;
  z-index: 7;
  pointer-events: none;
}

/* --------------------------------------------------- 画布内联文字编辑 */

.ve-inline {
  position: absolute;
  display: none;
  z-index: 20;
  margin: 0;
  padding: 2px 4px;
  border: 1px solid var(--ve-red);
  border-radius: 4px;
  background: rgba(0, 0, 0, .72);
  outline: none;
  resize: none;
  overflow: hidden;
  transform-origin: center center;
  font-family: inherit;
  box-shadow: 0 0 0 3px rgba(254, 44, 85, .18);
}
.ve-inline.on { display: block; }

/* 隐藏的 <video>：1px 且几乎透明，保证移动端也能正常解码与出声 */
.ve-video-src {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: .001;
  pointer-events: none;
}

/* 文字列表里的「显示范围」标记 */
.ve-layer-scope {
  margin-left: auto;
  font-style: normal;
  font-size: 10px;
  color: var(--ve-dim);
  border: 1px solid var(--ve-line);
  border-radius: 3px;
  padding: 0 4px;
  flex: none;
}

/* --------------------------------------------------------------- 响应式 */

/* 中屏：面板变窄 */
@media (max-width: 1180px) {
  .ve-main { grid-template-columns: minmax(0, 1fr) 320px; }
  .ve-shell { height: calc(100vh - 132px); }
}

/* ---------------------------------------------------------------- 移动版 */
/*
 * 手机上的目标形态：像手机剪映 App ——
 *   预览占上半屏 → 时间轴常驻 → 工具面板做成底部抽屉（收起时只留一条把手）
 * 用 display:contents 把 .ve-main 拆开，让 stage / side 直接参与 shell 的
 * flex 排序，这样不改 DOM 顺序也能重排成「预览 / 时间轴 / 抽屉」。
 * 抽屉用 fixed 定位，收起时只露 44px 把手，不占预览空间。
 */
@media (max-width: 900px) {
  .ve-shell {
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: calc(100dvh - 170px);
    min-height: 380px;
  }
  .ve-main { display: contents; }

  .ve-top { order: 0; flex: none; }
  .ve-stage { order: 1; flex: 1 1 auto; min-height: 160px; }
  .ve-tl { order: 2; flex: none; }
  .ve-side { order: 3; }

  /* ---- 底部抽屉 ---- */
  .ve-side {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    height: 58vh;
    max-height: 58vh;
    transform: translateY(calc(100% - 44px));
    transition: transform .24s cubic-bezier(.2, .8, .2, 1);
    border-radius: 14px 14px 0 0;
    overflow: hidden;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, .5);
  }
  .ve-side.is-open { transform: translateY(0); }

  .ve-sheet-grip {
    height: 44px;
    flex: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    background: var(--ve-panel2);
    border: 1px solid var(--ve-line);
    border-bottom: 0;
    border-radius: 14px 14px 0 0;
    color: var(--ve-text);
    font-size: 13px;
    cursor: pointer;
    user-select: none;
  }
  .ve-sheet-grip b { font-weight: 600; }
  .ve-sheet-grip span { color: var(--ve-dim); font-size: 11.5px; }
  .ve-sheet-grip i {
    margin-left: auto;
    font-style: normal;
    color: var(--ve-sub);
    transition: transform .24s;
  }
  .ve-side.is-open .ve-sheet-grip i { transform: rotate(180deg); }

  .ve-panel { border-radius: 0 0 14px 14px; max-height: none; }
  .ve-panes { padding: 10px; }
  .ve-canvas-wrap { padding: 6px; }

  /* 面板标签横向可滑，避免 5 个挤成一条 */
  .ve-tabs { overflow-x: auto; flex-wrap: nowrap; }
  .ve-tabs button { flex: 0 0 auto; min-width: 64px; padding: 7px 12px; font-size: 12.5px; }

  /* 时间轴更紧凑，但片段块要够高才看得清缩略图 */
  .ve-tl { padding: 6px 8px 8px; gap: 6px; }
  .ve-tl-tools button { height: 24px; padding: 0 7px; font-size: 11.5px; }
  .ve-tl-tc { font-size: 11px; }
  .ve-track { height: 52px; }
  .ve-blk-h { width: 14px; }       /* 手指点得中 */
}

/* 桌面端不显示抽屉把手 */
@media (min-width: 901px) {
  .ve-sheet-grip { display: none; }
}

@media (max-width: 560px) {
  .ve-top h1 { font-size: 15px; }
  .ve-back { padding: 0 9px; }
  .ve-tl-tc #veTcTotal, .ve-tl-tc i { display: none; }
  .ve-ratio { grid-template-columns: repeat(3, 1fr); }
  .ve-track { height: 48px; }
  .ve-blk-tag { font-size: 9.5px; }
  .ve-transport { padding: 6px 10px; }
  .ve-status { padding: 4px 10px; font-size: 11.5px; }
}

/* 横屏手机：预览再压一点，保证时间轴与把手都在屏内 */
@media (max-height: 520px) and (max-width: 900px) {
  .ve-shell { height: calc(100dvh - 150px); }
  .ve-stage { min-height: 110px; }
  .ve-side { height: 66vh; max-height: 66vh; }
}
