/* 任务识别工作台（在线试用 / 调用记录详情共用，taskview.js 的样式）。 */
.run-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.run-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  color: #203454;
  transition: background var(--dur);
}
.back-btn:hover { background: var(--surface-secondary); }
.run-title h1 { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--c-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.run-grid { display: grid; grid-template-columns: 1fr 298px; gap: 20px; align-items: start; }
.run-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.summary {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #DCE5F0;
  border-radius: 8px;
}
.sum-cell { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.sum-k { font-size: 13px; color: #8A98AA; font-family: var(--font-data); }
.sum-v { font-size: 14px; font-weight: 600; color: #31517B; font-family: var(--font-data); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.stage { background: #000; border-radius: 8px; overflow: hidden; }
.stage-art { position: relative; aspect-ratio: 16 / 9; }
.stage-art img { width: 100%; height: 100%; object-fit: cover; }
.stage-boxes { position: absolute; inset: 0; }
/* 实时播放层（liveplayer.js 挂载点）：video contain + canvas 叠框 */
.stage-live-wrap { position: absolute; inset: 0; }
.stage-live { position: absolute; inset: 0; }
.stage-live video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.stage-live canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
/* 视频文件任务的本地回放层（taskview.js 挂载）：video contain + PTS 叠框层（JS 按 letterbox 定位） */
.stage-video-wrap { position: absolute; inset: 0; background: #000; }
.stage-video-wrap video { display: block; width: 100%; height: 100%; object-fit: contain; }
.stage-video-boxes { position: absolute; pointer-events: none; }
.dbox {
  position: absolute;
  border: 2px solid #F4B942;
  border-radius: 2px;
  transition: opacity 200ms ease;
}
.dbox .dtag {
  position: absolute;
  top: -19px;
  left: -2px;
  padding: 0 6px;
  height: 19px;
  display: flex;
  align-items: center;
  background: #F4B942;
  color: #382B09;
  font-family: var(--font-data);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 2px 2px 0 0;
}
.dbox.is-teal { border-color: #55BFA7; }
.dbox.is-teal .dtag { background: #55BFA7; color: #07332A; }
.stage-note {
  position: absolute;
  left: 10px;
  bottom: 8px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(16, 24, 40, 0.72);
  color: rgba(255, 255, 255, 0.85);
  font-size: 11px;
}
.stage-waiting {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  letter-spacing: 0.1em;
}

.stage-bar { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; background: #15181E; }
.stage-bar-row { display: flex; align-items: center; gap: 10px; }
.live-flag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  background: #D83B3B;
  color: #fff;
  font-size: 12px;
  font-family: var(--font-data);
}
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: pulse 1.6s ease-in-out infinite; }
.live-flag.is-ended { background: #3A4352; }
.live-flag.is-ended .live-dot { animation: none; }
.stage-elapsed { color: #fff; font-size: 12px; font-weight: 600; font-family: var(--font-data); }

.tracks { display: flex; flex-direction: column; gap: 6px; }
.track { display: flex; align-items: center; gap: 8px; }
.track-label { width: 34px; flex: none; font-size: 11px; color: #8F9AAA; font-family: var(--font-data); }
.track-base { position: relative; flex: 1; height: 20px; background: #27313D; border-radius: 2px; overflow: hidden; }
.track-mark { position: absolute; top: 2px; bottom: 2px; width: 4px; border-radius: 1px; background: #F4B942; }
.track-mark.is-teal { background: #55BFA7; }
.tracks-empty { font-size: 11px; color: #66717F; font-family: var(--font-data); padding: 4px 0; }

.run-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: #F7F9FC;
  border: 1px solid #DCE5F0;
  border-radius: 10px;
}
.side-title { display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 600; color: #203454; }
.side-title .mono { color: #8A98AA; font-weight: 400; }
.side-params { display: flex; flex-direction: column; gap: 12px; padding: 12px; background: #EEF3F9; border-radius: 8px; }
.side-params select { border: 0; outline: 0; background: none; font-family: var(--font-data); font-size: 13px; color: #203454; text-align: right; max-width: 170px; }
.anno { font-size: 12px; color: #4A6588; line-height: 1.5; }
.anno-sub { font-size: 11px; color: var(--text-muted); }

.frames { display: flex; flex-direction: column; gap: 10px; overflow: auto; max-height: 420px; }
.frame-chip {
  position: relative;
  display: block;
  /* .frames 是 max-height 受限的 flex 列容器，帧数多时默认 flex-shrink 会把 chip
     压成薄片（按钮本征最小高度只按文本行算，img 再高也会被裁成顶部一条），
     且每个 chip 高度随筛选后条数浮动——必须禁止收缩，让容器滚动。 */
  flex: none;
  width: 100%;
  padding: 0;
  background: none;
  font: inherit;
  border: 1px solid #D7E0ED;
  border-radius: 5px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  transition: border-color var(--dur);
}
.frame-chip:hover { border-color: var(--p-link); }
.frame-chip.is-sel { border-color: var(--p-link); box-shadow: var(--ring); }
.frame-chip img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.frame-chip .fchip-label {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 4px 6px;
  border-radius: 3px;
  background: rgba(16, 24, 40, 0.80);
  color: #fff;
  font-size: 11px;
  font-family: var(--font-data);
}
.frames-empty { padding: 20px 8px; text-align: center; font-size: 12px; color: var(--c-muted); line-height: 1.6; }

@media (max-width: 1320px) {
  .run-grid { grid-template-columns: 1fr 280px; }
}
