/* 质量模块：Bug 和测试用例。 */

/* 严重程度：颜色由 ui.js 的 tagColor 决定 */
.select.status.bug-severity { min-height: 24px; padding: 1px 21px 1px 9px; font-size: 13px; }

/* Bug 表格 */
table.bug-table { min-width: 960px; font-size: 14px; }
table.bug-table th { padding: 9px 8px; }
table.bug-table th:first-child, table.bug-table td:first-child { padding-left: 14px; }
table.bug-table td { padding: 7px 8px; }
table.bug-table tbody tr:hover td { background: var(--fill-soft); }
table.bug-table .bug-title-col { width: 100%; min-width: 240px; font-weight: 500; }
table.bug-table .select.cell { max-width: 120px; text-overflow: ellipsis; }
/* 窗口窄时不横滚：先收起提交人（详情里有），标题让一点，版本名过长时省略 */
@media (min-width: 761px) and (max-width: 1240px) {
  table.bug-table { min-width: 0; }
  table.bug-table th:nth-child(7), table.bug-table td:nth-child(7) { display: none; }
  table.bug-table .bug-title-col { min-width: 180px; }
  table.bug-table td.ver { max-width: 92px; overflow: hidden; text-overflow: ellipsis; }
  table.bug-table .select.cell { max-width: 84px; }
}
/* 再窄一点（800 上下）：版本和等了多久也收起，详情里都有 */
@media (min-width: 761px) and (max-width: 940px) {
  table.bug-table th:nth-child(6), table.bug-table td:nth-child(6),
  table.bug-table th:nth-child(8), table.bug-table td:nth-child(8) { display: none; }
  table.bug-table .bug-title-col { min-width: 120px; }
}
table.bug-table .select.cell.tag-select { max-width: 60px; }
table.bug-table .link-btn:hover { color: var(--accent-text); }
.bug-step-cell { text-align: right; padding-right: 14px !important; white-space: nowrap; }
.btn.bug-step { min-height: 28px; padding: 3px 10px; font-size: 13px; }
.bug-wait { font-variant-numeric: tabular-nums; }
.bug-wait.warn { color: var(--orange); font-weight: 600; }
.bug-wait.alert { color: var(--red); font-weight: 600; }
.bug-row .list-meta { gap: 6px 8px; }
.bug-row .list-meta + .list-meta { margin-top: 5px; }

/* 提 Bug */
.bug-from { padding: 0 16px; font-size: 14px; color: var(--label-2); overflow-wrap: anywhere; }
.bug-from strong { color: var(--label); font-weight: 600; }
.bug-title-input { min-height: 28px; font-size: 16px; font-weight: 600; }
.bug-more summary { padding: 2px 16px 8px; font-size: 13px; color: var(--accent-text); cursor: pointer; overflow-wrap: anywhere; }
.form-ok { padding: 8px 16px; border-radius: 10px; background: var(--green-soft); color: var(--green); font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }

/* 截图和录屏 */
.media-pending { display: flex; flex-direction: column; gap: 8px; }
.media-hint { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 0 10px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.media-thumb { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 10px; background: var(--fill); }
.media-thumb.video { grid-column: span 2; aspect-ratio: 16 / 9; background: #000; }
.media-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.media-thumb video { display: block; width: 100%; height: 100%; object-fit: contain; }
.media-open { display: block; width: 100%; height: 100%; cursor: zoom-in; }
.media-name { padding: 6px; font-size: 12px; color: var(--label-2); text-align: center; overflow-wrap: anywhere; text-decoration: none; }
a.media-name:hover { color: var(--accent-text); }
.media-remove {
  position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 14px; line-height: 1; opacity: 0; transition: opacity .12s;
}
.media-thumb:hover .media-remove, .media-remove:focus-visible { opacity: 1; }
@media (hover: none) { .media-remove { opacity: 1; } }

/* Bug 详情 */
.sheet-nav-right { display: flex; align-items: center; gap: 6px; }
.bug-next { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px 12px 16px; }
.bug-next-text { flex: 1 1 200px; min-width: 0; font-size: 14px; }
.bug-next-hint { margin-left: 8px; color: var(--label-2); }
.bug-next-note { margin-top: 6px; font-size: 14px; color: var(--label-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.bug-next-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-left: auto; }
.bug-task-select { max-width: 220px; text-overflow: ellipsis; }
.bug-link { color: var(--accent-text); text-decoration: none; overflow-wrap: anywhere; text-align: right; }
.bug-link:hover { text-decoration: underline; }
.bug-timeline { padding-top: 2px; }
.tl-text { white-space: pre-wrap; }
.borderless.input { min-height: 0; }
.borderless.input:focus { outline: none; }

/* 用例：执行进度 */
.case-progress { display: flex; flex-direction: column; gap: 10px; padding: 12px 16px 14px; }
.case-progress-head { display: flex; align-items: center; gap: 8px 20px; flex-wrap: wrap; }
.case-rate { font-size: 13px; color: var(--label-2); white-space: nowrap; }
.case-rate b { font-size: 22px; font-weight: 700; color: var(--label); font-variant-numeric: tabular-nums; }
.case-legend { min-height: 26px; padding: 1px 8px; margin: -1px -4px; border-radius: 7px; }
.case-legend b { font-weight: 600; color: var(--label); font-variant-numeric: tabular-nums; }
.case-legend:hover { background: var(--fill-soft); }
.case-legend[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); }
.case-version { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }

/* 用例：左树右表 */
.case-tree { position: sticky; top: 70px; }
.case-new-folder { width: 100%; justify-content: flex-start; margin-top: 6px; font-weight: 500; font-size: 14px; }
.case-new-folder svg { width: 15px; height: 15px; }
.case-main { display: flex; flex-direction: column; gap: 10px; }
.case-folder-head { display: flex; align-items: center; gap: 6px; padding: 0 2px; font-size: 16px; }
.case-folder-head .input { max-width: 320px; font-size: 16px; }
.case-add {
  position: sticky; top: 64px; z-index: 5; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 14px;
  border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-card); color: var(--label-3);
}
.case-add svg { flex: none; width: 17px; height: 17px; }
.case-add .input { flex: 1; min-width: 0; background: none; color: var(--label); }
.case-list.drop-hover { box-shadow: var(--shadow-card); }
.case-row { min-height: 52px; padding-block: 8px; }
.case-row .list-title { font-size: 15px; }
.case-note { margin-top: 4px; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.case-bug { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 13px; color: var(--accent-text); text-decoration: none; }
.case-bug:hover { text-decoration: underline; }
.case-run { flex: none; display: inline-flex; padding: 2px; border-radius: 9px; background: var(--fill-soft); }
.case-run-btn { min-height: 28px; padding: 3px 10px; border-radius: 7px; color: var(--label-2); font-size: 13px; font-weight: 500; white-space: nowrap; transition: background-color .12s, color .12s; }
.case-run-btn:hover { background: var(--fill); color: var(--label); }
.case-run-btn[aria-pressed="true"] { font-weight: 600; }
.case-import-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.case-sheet-run { justify-content: flex-start; flex-wrap: wrap; }
.task-bug .list-title { overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .case-add { top: 0; }
  .case-tree { position: static; }
  .case-row .case-run, .case-sheet-run .case-run { width: 100%; }
  .case-run-btn { flex: 1; min-height: 38px; padding-inline: 4px; }
  .case-version { flex: 1; }
  .case-version .select { flex: 1; width: 100%; max-width: 100%; }
  .bug-next-actions { width: 100%; }
  .bug-next-actions .btn { flex: 1; }
  .bug-row .bug-step { width: 100%; min-height: 38px; }
  .media-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .media-thumb.video { grid-column: 1 / -1; }
}

/* .stack 是统计用的 8px 堆叠条，和表单行的 .row.stack 撞名，多行输入框会被裁掉 */
.row.stack { height: auto; min-width: 0; }
/* .empty 是空状态的大留白，和“没指派”的灰色头像 .av.empty 撞名，头像会被撑高 */
.av.empty { padding: 0; }

/* 指派给整组时的头像 */
.av.group-av { display: inline-grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.av.group-av svg { width: 14px; height: 14px; }
