/* Photo-level review is the primary surface. The existing inspector remains
   available through each row's "查看依据 / 详情" action. */
#job-view > .workbench-grid { display: none !important; }
body[data-detail-mode="true"] #job-view > .workbench-grid { display: grid !important; }
.batch-review-root { display: block; margin-top: 14px; }
.batch-review-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 18px 20px; border: 1px solid #d7e1d0; border-radius: 16px 16px 0 0; background: linear-gradient(135deg, #f7fbf3 0%, #ffffff 62%); }
.batch-review-heading h2 { margin: 3px 0 4px; font-size: clamp(20px, 2.2vw, 28px); letter-spacing: -.02em; }
.batch-review-subtitle { max-width: 680px; margin: 0; color: #607060; font-size: 13px; }
.batch-review-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.batch-filter-toggle { display: inline-flex; align-items: center; gap: 7px; color: #435343; font-size: 13px; white-space: nowrap; }
.batch-filter-toggle input { accent-color: #527146; }
.batch-count { color: #6c786d; font-size: 12px; white-space: nowrap; }
.batch-return-link, .batch-retention-note { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 20px; border: 1px solid #d7e1d0; border-top: 0; background: #fbfdf9; color: #526253; font-size: 12px; }
.batch-return-link a { color: #356bb2; font-weight: 700; }
.batch-retention-note { align-items: baseline; color: #6b766e; background: #f6f8f1; }
.batch-retention-note small { color: #849083; white-space: nowrap; }
.batch-review-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 20px; border: 1px solid #d7e1d0; border-top: 0; background: #f0f5eb; }
.batch-review-toolbar > div { display: flex; align-items: baseline; gap: 9px; min-width: 0; flex-wrap: wrap; }
.batch-review-toolbar strong { color: #38513b; font-size: 13px; }
#batch-selection-hint { color: #6b786a; font-size: 12px; }
.batch-review-toolbar .button { min-height: 36px; padding: 8px 15px; }
.batch-review-toolbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.batch-download-pdf { color: #356b46; border-color: #a9c59f; background: #f2f9ed; font-weight: 800; }
.batch-download-pdf:hover:not(:disabled):not(.disabled) { border-color: #6b9a61; background: #e7f3df; }
.batch-download-pdf:disabled, .batch-download-pdf.disabled { cursor: not-allowed; opacity: .55; }
.batch-photo-list { display: grid; gap: 10px; padding-top: 10px; }
.batch-photo-row { border: 1px solid #d7e1d0; border-radius: 14px; background: #fff; overflow: hidden; box-shadow: 0 2px 8px rgba(55, 78, 53, .04); }
.batch-photo-row.is-selected { border-color: #6c9a61; box-shadow: 0 0 0 2px rgba(89, 133, 78, .12); }
.batch-photo-row.is-processing { border-color: #d7d8cb; background: #fcfcf8; }
.batch-photo-head { display: grid; grid-template-columns: auto minmax(190px, 250px) minmax(170px, 1fr) auto; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid #edf1e9; }
.batch-row-check { display: inline-flex; align-items: center; gap: 7px; min-width: 112px; color: #4a5c4c; font-size: 12px; font-weight: 700; cursor: pointer; }
.batch-row-check input { width: 17px; height: 17px; accent-color: #527146; }
.batch-row-check input:disabled { cursor: not-allowed; opacity: .45; }
.batch-photo-image { width: 230px; height: 138px; display: grid; place-items: center; overflow: hidden; border: 1px solid #e0e7dc; border-radius: 8px; background: #f5f7f2; }
.batch-source-button { width: 100%; height: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.batch-photo-image img { width: 100%; height: 100%; object-fit: contain; }
.batch-photo-placeholder { color: #9aa59b; font-size: 22px; }
.batch-photo-title { display: grid; gap: 3px; min-width: 0; }
.batch-photo-title strong { overflow: hidden; color: #27392b; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.batch-photo-title span { color: #7b887c; font-size: 12px; }
.batch-photo-title .batch-photo-status { color: #a36b36; font-weight: 700; }
.batch-photo-row.is-processing .batch-photo-status { color: #7a7b5f; }
.batch-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.batch-original-button, .batch-detail-button { color: #4a6b43; font-size: 12px; white-space: nowrap; }
.batch-readings-wrap { width: 100%; overflow-x: auto; }
.batch-readings { width: 100%; min-width: 860px; border-collapse: collapse; table-layout: fixed; }
.batch-field { position: relative; width: 14.285%; padding: 9px 10px 10px; border-right: 1px solid #edf1e9; vertical-align: top; background: #fbfdf9; }
.batch-field:last-child { border-right: 0; }
.batch-field.is-pending { background: #fffaf0; box-shadow: inset 0 3px 0 #e4a654; }
.batch-field.is-auto { background: #f8faf6; color: #6b796c; }
.batch-field.is-processing { background: #f4f4ef; box-shadow: none; }
.batch-field-label { display: flex; align-items: baseline; justify-content: space-between; gap: 5px; margin-bottom: 5px; color: #536454; font-size: 12px; font-weight: 700; }
.batch-field.is-pending .batch-field-label { color: #875d2e; }
.batch-field-label small { color: #899589; font-size: 10px; font-weight: 500; }
.batch-field-value { display: flex; align-items: center; gap: 5px; }
.batch-field-value input { width: 100%; min-width: 0; min-height: 34px; padding: 6px 7px; border: 1px solid #d5dfd1; border-radius: 7px; background: #fff; color: #263a2b; font: inherit; font-size: 13px; }
.batch-field-plain-value { display: block; min-height: 34px; padding: 6px 0; color: #526253; font-size: 14px; line-height: 1.6; }
.batch-field.is-pending .batch-field-value input { border-color: #d9ae6b; background: #fffdf8; }
.batch-field.is-auto .batch-field-value input { border-color: #e0e7dc; background: #f6f8f3; color: #607060; }
.batch-field-value input:disabled { cursor: not-allowed; color: #899083; background: #f2f2ed; }
.batch-field-status { display: block; flex: 0 0 auto; color: #7f8a80; font-size: 10px; line-height: 1.2; white-space: nowrap; writing-mode: vertical-rl; }
.batch-field.is-pending .batch-field-status { color: #aa6c2d; font-weight: 700; }
.batch-field.is-auto .batch-field-status { color: #6b846c; }
.batch-evidence-button { display: inline-flex; align-items: center; gap: 5px; margin-top: 5px; padding: 0; border: 0; color: #567a9f; background: transparent; font: inherit; font-size: 11px; cursor: pointer; }
.batch-evidence-button img { width: 64px; height: 42px; object-fit: cover; border: 1px solid #dce5d8; border-radius: 4px; background: #f3f6f0; }
.batch-row-hint, .batch-processing-note { margin: 0; padding: 7px 12px; border-top: 1px solid #edf1e9; color: #876d45; background: #fffdf7; font-size: 11px; }
.batch-processing-note { color: #7b7d69; background: #f6f6f0; }
.batch-pagination { display: flex; align-items: center; justify-content: center; gap: 20px; padding: 13px 0 3px; color: #738075; font-size: 12px; }
.batch-pagination button:disabled { opacity: .4; cursor: not-allowed; }
.batch-empty { padding: 32px 18px; border: 1px dashed #c9d6c6; border-radius: 12px; color: #708071; text-align: center; background: #fafcf8; }
.batch-review-heading .eyebrow, .batch-review-subtitle,
#batch-selection-hint, .batch-row-hint, .batch-processing-note { display: none; }
.batch-info { border: 1px solid #d7e1d0; border-top: 0; background: #fbfdf9; color: #6b766e; font-size: 12px; }
.batch-info > summary { padding: 8px 12px; cursor: pointer; }
.batch-info .batch-return-link, .batch-info .batch-retention-note { border: 0; }
.batch-review-return { margin: 14px 0; }
body[data-detail-mode="true"] .batch-review-return { display: inline-flex; }
.batch-evidence-lightbox .lightbox-stage { max-width: min(94vw, 1280px); max-height: 82vh; }
.batch-evidence-lightbox .lightbox-stage img { max-width: 100%; max-height: 82vh; object-fit: contain; }

@media (min-width: 1150px) {
  .batch-review-root { margin-top: 8px; }
  .batch-review-heading { gap: 12px; padding: 10px 16px; border-radius: 12px 12px 0 0; }
  .batch-review-heading h2 { margin: 0 0 2px; font-size: 22px; }
  .batch-review-subtitle { font-size: 12px; }
  .batch-review-tools { gap: 10px; }
  .batch-filter-toggle { gap: 5px; font-size: 12px; }
  .batch-count { font-size: 11px; }
  .batch-return-link, .batch-retention-note { min-height: 28px; padding: 5px 16px; line-height: 1.35; }
  .batch-return-link > span, .batch-retention-note > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .batch-review-toolbar { gap: 10px; padding: 6px 16px; }
  .batch-review-toolbar > div { gap: 7px; }
  .batch-review-toolbar strong, #batch-selection-hint { font-size: 11px; }
  .batch-review-toolbar .button { min-height: 32px; padding: 6px 12px; }
  .batch-review-toolbar-actions { gap: 6px; }
  .batch-photo-list { gap: 8px; padding-top: 8px; }
  .batch-photo-row { display: grid; grid-template-columns: 240px minmax(0, 1fr); border-radius: 10px; }
  .batch-photo-head { grid-column: 1; grid-row: 1; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 104px auto auto; gap: 5px; padding: 8px; border-right: 1px solid #edf1e9; border-bottom: 0; }
  .batch-row-check { min-width: 0; gap: 5px; font-size: 11px; }
  .batch-row-check input { width: 15px; height: 15px; }
  .batch-photo-image { width: 100%; height: 104px; border-radius: 6px; }
  .batch-photo-title { gap: 1px; }
  .batch-photo-title strong { font-size: 12px; }
  .batch-photo-title span { font-size: 11px; }
  .batch-row-actions { justify-content: flex-start; gap: 7px; }
  .batch-original-button, .batch-detail-button { font-size: 11px; }
  .batch-readings-wrap { grid-column: 2; grid-row: 1; align-self: stretch; display: flex; align-items: stretch; overflow-x: visible; }
  .batch-readings { min-width: 0; }
  .batch-field { padding: 7px 6px 6px; }
  .batch-field-label { gap: 3px; margin-bottom: 3px; font-size: 11px; }
  .batch-field-label small { font-size: 9px; }
  .batch-field-value { gap: 3px; }
  .batch-field-value input { min-height: 30px; padding: 4px 5px; font-size: 12px; }
  .batch-field-plain-value { min-height: 30px; padding: 4px 0; font-size: 13px; line-height: 1.45; }
  .batch-field-status { font-size: 9px; }
  .batch-evidence-button { gap: 3px; margin-top: 3px; font-size: 10px; }
  .batch-evidence-button img { width: 52px; height: 34px; }
  .batch-row-hint, .batch-processing-note { grid-column: 1 / -1; padding: 4px 9px; font-size: 10px; }
}

@media (max-width: 900px) {
  .batch-photo-head { grid-template-columns: auto 170px minmax(120px, 1fr) auto; gap: 8px; }
  .batch-photo-image { width: 170px; height: 105px; }
  .batch-row-check { min-width: 96px; }
  .batch-check-label { display: none; }
  .batch-readings { min-width: 760px; }
}

@media (max-width: 720px) {
  body[data-detail-mode="true"] #job-view > .workbench-grid { display: flex !important; }
  .batch-review-root { margin-top: 8px; }
  .batch-review-heading { align-items: flex-start; flex-direction: column; gap: 7px; padding: 10px 12px; }
  .batch-review-heading .eyebrow, .batch-review-subtitle { display: none; }
  .batch-review-heading h2 { margin: 0; font-size: 20px; }
  .batch-review-tools { width: 100%; justify-content: space-between; }
  .batch-return-link { align-items: center; flex-direction: row; padding: 7px 12px; font-size: 11px; }
  .batch-return-link > span { display: -webkit-box; flex: 1 1 auto; min-width: 0; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .batch-return-link a { flex: 0 0 auto; white-space: nowrap; }
  .batch-retention-note { align-items: flex-start; flex-direction: row; padding: 7px 12px; font-size: 11px; line-height: 1.35; }
  .batch-retention-note > span { min-width: 0; }
  .batch-retention-note small { display: none; }
  .batch-review-toolbar { align-items: center; flex-direction: row; gap: 7px; padding: 7px 12px; }
  .batch-review-toolbar > div:first-child { flex: 0 0 auto; }
  .batch-review-toolbar #batch-selection-hint { display: none; }
  .batch-review-toolbar-actions { width: auto; flex: 1 1 auto; }
  .batch-review-toolbar-actions .button { width: auto; min-width: 0; flex: 1 1 0; padding-right: 8px; padding-left: 8px; }
  .batch-photo-head { grid-template-columns: auto minmax(0, 1fr); padding: 9px; }
  .batch-row-check { grid-column: 1 / -1; }
  .batch-photo-image { grid-column: 1 / -1; width: 100%; height: 120px; }
  .batch-photo-title { grid-column: 1 / -1; }
  .batch-row-actions { grid-column: 2 / -1; justify-content: flex-start; }
  .batch-readings { min-width: 0; }
  .batch-readings tbody, .batch-readings tr { display: block; }
  .batch-readings tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .batch-field { width: auto; min-height: 94px; border-right: 1px solid #edf1e9; border-bottom: 1px solid #edf1e9; }
  .batch-field[data-batch-cell="serial"] { grid-column: 1 / -1; border-right: 0; }
  .batch-field[data-batch-cell="power_C"], .batch-field[data-batch-cell="current_C"] { border-right: 0; }
  .batch-field:last-child { border-right: 0; }
  .batch-field-value input { min-height: 38px; }
  .batch-field-status { writing-mode: horizontal-tb; }
  .batch-pagination { gap: 12px; }
}
