/* 易图浅色材质：操作层使用毛玻璃，列表整体模糊背景，不对每行重复叠加滤镜。 */
.results-page, .batch-workbench, .batch-confirm {
  --canvas: #e5eef2; --panel: #f3f8fa; --edge: #193b4929;
  --action: #00364b; --action-hover: #00293a; --on-action: #fff;
  --text: #041018; --secondary: #06141a; --action-ink: #03151e;
  --success: #123b2e; --warning: #271602; --danger: #30060a;
  --hover: #006b910b; --selected-wash: #006b9114; --track: #193b491c;
  --workspace-ocean: linear-gradient(90deg, #d8fff040, #b3f6e810 44%, #d8f6ff40), url("/ocean.webp") center / cover;
  --workspace-glass: #edf4f6; --content-surface: #edf4f6; --table-header: #edf4f6;
  --editor-control: #e1eaee; --editor-selected: var(--action); --editor-selected-ink: var(--on-action);
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
}
/* 默认实色保证滤镜不可用时可读；仅在面板容器启用模糊，不叠加到每个控件和列表行。 */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .results-page, .batch-workbench {
    --workspace-glass: linear-gradient(145deg, #ffffff21, #ffffff00 40%, #e3f8ff0a), #eaf8ff14;
    --editor-control: #ffffff26; --table-header: #ffffff30;
    --content-surface: var(--workspace-glass);
  }
  .results-table thead { -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
  .glass-surface::after, .batch-controls > div::after {
    -webkit-backdrop-filter: blur(6px) saturate(118%) brightness(1.06);
    backdrop-filter: blur(6px) saturate(118%) brightness(1.06);
  }
}
/* 一层玻璃承载一组内容，边缘高光不覆盖文字，也不参与点击。
   模糊放在独立的 ::after 静态图层，控件过渡和列表动画不再触发整块玻璃重采样（闪烁）。 */
.glass-surface { position: relative; isolation: isolate; }
.glass-surface::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  border: 1px solid #ffffff59; border-radius: inherit;
  box-shadow: inset 0 1px 1px #ffffffb3, inset 1px 0 1px #ffffff59, inset 0 -1px 1px #ffffff4d;
}
.glass-surface::after, .batch-controls > div::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
}
.brand-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.yitu-brand { display: inline-flex; flex: none; color: #075265; }
.yitu-brand > svg { display: block; width: 130px; height: 52px; }
.batch-sidebar-head .yitu-brand {
  color: var(--text);
}
.batch-sidebar-head .yitu-brand > svg { width: 82px; height: 33px; }
.batch-sidebar-head .back { padding-inline: 8px; }
:is(.results-page, .batch-workbench) .close-face {
  border: 1px solid var(--edge); box-shadow: 0 2px 8px #173b4914; background: var(--workspace-glass);
}
:is(.results-page, .batch-workbench) .close-face::before { display: none; }
:is(.results-page, .batch-workbench) .close-workspace .close-face::after { color: var(--text); }
:is(.results-page, .batch-workbench) .close-workspace:has(.close-hover:hover) .close-face { transform: none; box-shadow: 0 2px 8px #173b4914; }
:is(.results-page, .batch-workbench) .close-workspace:has(.close-hover:hover) .close-face::after { animation: none; }
/* 这些页面已禁用 3D 翻转；残留的透视上下文会让按钮 hover 重排在玻璃背景上留下接缝线。 */
:is(.results-page, .batch-workbench) .close-workspace { perspective: none; }
/* 按下缩放会触发按钮合成层升降，玻璃面板随之重采样并闪出接缝线；这些页面 3D 按钮本已禁用，一并取消按压缩放。 */
:is(.results-page, .batch-workbench) .close-workspace:active { transform: none; }
/* 焦点进入确认框或从确认框返回时也会改变文字；取消遗留的 all 过渡，避免持续重绘。 */
:is(.results-page, .batch-workbench) .close-workspace,
:is(.results-page, .batch-workbench) .close-face,
:is(.results-page, .batch-workbench) .close-face::after { transition: none; }
.snack { background: #0d465e; }

/* 图片画布保持不透明中性底，海洋玻璃只用于外围操作层。 */
.batch-workbench {

  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 12px;
  padding: 16px;
  color: var(--text);
  background: var(--workspace-ocean);
  isolation: isolate;
  font-size: 14px;
  line-height: 1.5;
}
.batch-workbench.hidden,
.batch-workbench .hidden {
  display: none !important;
}
.batch-workbench button {
  border: 1px solid var(--edge);
  border-radius: 8px;
  padding: 8px 12px;
  line-height: 1.4;
  color: inherit;
  background: transparent;
  font-size: 13px;
}
.batch-workbench button:hover:not(:disabled) {
  background: var(--hover);
  border-color: var(--action);
}
.batch-workbench button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.batch-workbench :focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 3px;
}
.batch-workbench p {
  margin: 0;
}
.batch-workbench h2 {
  font-size: 18px;
  margin: 0 0 3px;
}
.batch-muted {
  color: var(--secondary);
  font-size: 13px;
}
.batch-main {
  min-width: 0;
  min-height: 0;
  padding: 12px;
  display: grid;
  grid-template-rows: 52px minmax(0, 1fr) 190px;
}
.canvas-top {
  display: flex;
  background: var(--workspace-glass);
  border-radius: 10px;
  gap: 18px;
  align-items: center;
  padding-right: 8px;
}
/* 返回入口常驻画布右上角，与结果页导航使用同一浅色高光材质。 */
.canvas-top #close-workspace {
  grid-area: auto;
  width: 116px;
  height: 44px;
  margin: 0;
  padding: 0 14px;
  flex: none;
  border: 1px solid #087f8c80;
  border-radius: 12px;
  background: #edfffbef;
  color: #075265;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  box-shadow: inset 0 1px #fff, 0 2px 8px #0752651a;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.canvas-top #close-workspace:hover:not(:disabled) { background: #fff; border-color: #087f8c; }
.detail-back svg { width: 20px; height: 20px; }
.canvas-top div {
  min-width: 0;
  font-size: 11px;
}
.canvas-top p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 50vw;
}
.batch-viewport {
  position: relative;
  overflow: hidden;
  min-height: 0;
  touch-action: none;
  cursor: grab;
  background-color: #eef3f5;
  background-image: conic-gradient(#e3eaed 25%, transparent 0 50%, #e3eaed 0 75%, transparent 0);
  background-size: 24px 24px;
}
/* 保留原有深灰棋盘格，用于检查浅色和透明边缘。 */
.batch-viewport[data-background="dark-checker"] {
  background-color: #303030;
  background-image: conic-gradient(#393939 25%, transparent 0 50%, #ffffff0a 0 75%, transparent 0);
  background-size: 20px 20px;
}
.batch-world {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  --split: 50%;
}
.batch-world img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  user-select: none;
  pointer-events: none;
  object-fit: fill;
}
.batch-world:not(.source-only) #img-left {
  clip-path: inset(0 calc(100% - var(--split)) 0 0);
}
.batch-world #img-right {
  clip-path: inset(0 0 0 var(--split));
}
.batch-world.source-only #img-right,
.batch-world.source-only #handle,
.batch-world.source-only .batch-after {
  display: none;
}
.batch-before,
.batch-after {
  position: absolute;
  top: 12px;
  padding: 6px 12px;
  border-radius: 8px;
  background: #142024b8;
  font-size: 13px;
  transform: scale(var(--label-scale, 1));
  transform-origin: top left;
}
.batch-before {
  left: 12px;
}
.batch-after {
  right: 12px;
  transform-origin: top right;
}
.batch-workbench #handle,
.batch-workbench #handle * {
  -webkit-user-select: none;
  user-select: none;
}
.batch-workbench #handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split);
  padding: 0;
  width: calc(32px * var(--label-scale, 1));
  transform: translateX(-50%);
  border: 0;
  background: transparent;
  border-radius: 0;
  cursor: ew-resize;
  touch-action: none;
}
.batch-workbench #handle::before {
  content: "";
  position: absolute;
  inset-block: 0;
  left: 50%;
  width: calc(2px * var(--label-scale, 1));
  transform: translateX(-50%);
  background: #fff;
  pointer-events: none;
}
.batch-workbench #handle:hover { background: transparent; }
.batch-workbench #handle span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  line-height: 1;
  border-radius: 50%;
  background: #fff;
  color: #16485c;
  font-size: 23px;
  transform: translate(-50%, -50%) scale(var(--label-scale, 1));
  box-shadow: 0 2px 6px #0003;
}
.batch-loading {
  position: absolute;
  inset: 0;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  /* 浅色画布不再随 loading 整屏变暗，短请求也不闪出提示。 */
  background: transparent;
  animation: preview-status-reveal .12s ease-out .15s both;
  pointer-events: none;
}
@keyframes preview-status-reveal { from { opacity: 0; } to { opacity: 1; } }
/* 统一由外层控制显示时机，避免圆环与文字分两次出现。 */
.batch-loading .preview-loading-rings { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .batch-loading { animation: none; }
  .batch-loading .preview-loading-ring { animation: none; }
}
.batch-loading p,
#preview-error {
  background: var(--panel);
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--text);
}
#preview-error {
  position: absolute;
  top: 45%;
  left: 15%;
  right: 15%;
  text-align: center;
}
.batch-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}
.batch-controls > div {
  display: flex;
  align-items: center;
  position: relative; isolation: isolate;
  border: 1px solid var(--edge);
  border-radius: 18px;
  padding: 4px;
  gap: 3px;
  background: var(--workspace-glass);
  box-shadow: inset 0 1px #ffffff80, 0 3px 12px #092f451a;
}
.batch-controls button {
  padding: 4px 10px;
  font-size: 12px;
}
.batch-controls output {
  font-size: 12px;
  min-width: 52px;
  text-align: center;
}
.batch-sidebar {
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--workspace-glass);
  border: 1px solid var(--edge); border-radius: 20px; margin: 0;
  box-shadow: 0 12px 32px #092f4526;
  align-self: stretch;
  max-height: 100%;
  overflow: clip;
}
/* 玻璃固定在外层，内容单独滚动，避免伪元素随滚动提前露底。 */
.batch-sidebar-scroll {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: auto;
  border-radius: inherit;
}
.batch-sidebar-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--edge);
  min-height: 52px;
  flex: none;
}
.batch-sidebar-head strong {
  font-size: 16px;
  margin-right: auto;
}
.batch-sidebar-head button {
  white-space: nowrap;
  font-size: 13px;
  padding: 8px;
}
.batch-settings {
  padding: 16px;
  flex: none;
}
.batch-settings fieldset {
  border: 0;
  padding: 0;
  margin: 18px 0 0;
  min-width: 0;
}
.batch-settings legend {
  padding: 0;
  margin: 0 0 10px;
  color: var(--secondary);
}
.batch-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid var(--edge);
  border-radius: 9px;
  margin-bottom: 8px;
  cursor: pointer;
  line-height: 1.4;
}
.batch-choice:has(input:checked) {
  border-color: var(--action);
  background: var(--hover);
  color: var(--action-ink);
  font-weight: 600;
}
.batch-choice input {
  accent-color: var(--action);
  width: 17px;
  height: 17px;
  margin: 0;
}
.batch-segments {
  display: flex;
  border: 1px solid var(--edge);
  border-radius: 9px;
  overflow: hidden;
  min-height: 36px;
}
.batch-segments .batch-choice {
  flex: 1;
  justify-content: center;
  text-align: center;
  margin: 0;
  border-color: transparent;
  border-radius: 8px;
  padding: 8px 3px;
  font-size: 13px;
}
.batch-segments .batch-choice input {
  position: absolute;
  opacity: 0;
  width: 0;
}
.batch-segments .batch-choice:has(input:focus-visible) {
  outline: 2px solid var(--action);
  outline-offset: -3px;
}
.batch-segments .batch-choice:has(input:checked) {
  border-color: var(--action);
  background: var(--action);
  color: var(--on-action);
}
/* 「应用到全部」是批量次动作，与侧栏「打包下载」同族的描边按钮，不用链接样式。 */
#apply-all {
  width: 100%;
  margin-top: 8px;
  padding: 9px 8px;
  font-size: 14px;
  font-weight: 600;
}
.batch-task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.batch-task-actions button {
  font-size: 11px;
  padding: 5px 8px;
  color: var(--secondary);
}
.batch-results {
  flex: none;
  margin: 0 12px;
  padding: 12px 5px;
  border-top: 1px solid var(--edge);
}
.batch-results > button {
  width: 100%;
  margin-top: 8px;
  padding: 9px 8px;
  border-color: var(--edge);
  font-size: 14px;
  font-weight: 600;
}
.batch-results #download-zip {
  background: var(--action);
  border-color: var(--action);
  color: var(--on-action);
}
.batch-results #download-zip:hover:not(:disabled) {
  background: var(--action-hover);
  border-color: var(--action);
}
.batch-results #result-status {
  font-size: 12px;
  margin-bottom: 5px;
  overflow-wrap: anywhere;
}
.batch-results #pause-status {
  color: var(--warning);
  font-size: 13px;
}
.batch-results #resume {
  padding: 7px;
}
.batch-size {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 7px;
}
.batch-size strong {
  font-size: 18px;
}
.batch-size span {
  font-size: 13px;
  color: var(--action-ink);
}
#zip-note {
  font-size: 11px;
  text-align: center;
  margin-top: 7px;
}
#zip-note:empty { display: none; }
#sidebar-meta { color: var(--secondary); font-size: 13px; }
.batch-tray {
  min-width: 0;
  background: var(--content-surface);
  border: 1px solid var(--edge);
  border-radius: 14px;
  padding: 12px 17px;
  overflow: hidden;
}
.batch-tray header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  height: 26px;
  margin-bottom: 8px;
}
.batch-tray header button {
  padding: 1px 8px;
  font-size: 18px;
  border: 0;
}
.batch-tray #cancel-all {
  font-size: 11px;
  color: var(--secondary);
}
#batch-count {
  white-space: nowrap;
}
.batch-thumbnails {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  overscroll-behavior: contain;
  padding: 2px 0 7px;
}
.batch-workbench .batch-thumb {
  flex: 0 0 132px;
  width: 132px;
  text-align: left;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
}
.batch-thumb canvas {
  display: block;
  width: 132px;
  height: 82px;
  object-fit: cover;
  border: 1px solid var(--edge);
  border-radius: 6px;
  background: #16485c;
}
.batch-thumb[aria-current="true"] canvas {
  border: 2px solid var(--action);
  box-shadow: 0 0 0 2px var(--track);
}
.batch-thumb strong {
  display: block;
  font-size: 11px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 4px;
}
.batch-thumb small {
  display: block;
  color: var(--secondary);
  font-size: 11px;
  white-space: nowrap;
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.batch-thumb[data-status="success"] small {
  color: var(--action-ink);
}
.batch-thumb[data-status="busy"] small,
.batch-thumb[data-status="failed"] small {
  color: var(--warning);
}
.batch-workbench .batch-add {
  flex: 0 0 122px;
  min-height: 110px;
  border-style: dashed;
  text-align: center;
  color: var(--secondary);
  font-size: 12px;
}
.batch-add span {
  display: block;
  font-size: 28px;
  margin-bottom: 5px;
}
.batch-workbench.sidebar-collapsed {
  grid-template-columns: minmax(0, 1fr) 44px;
}
.batch-workbench.sidebar-collapsed .batch-sidebar {
  display: none;
}
.batch-workbench .batch-message {
  white-space: pre-line;
}
.snack {
  max-width: min(90vw, 650px);
  white-space: pre-line;
  z-index: 1000;
}
@keyframes batch-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (max-width: 900px) {
  .batch-workbench {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
  .batch-main {
    padding: 8px;
    grid-template-rows: 52px minmax(0, 1fr) 174px;
  }
  .batch-tray {
    padding: 8px;
  }
  .batch-thumbnails {
    gap: 10px;
  }
  .batch-size strong {
    font-size: 15px;
  }
}
@media (max-width: 650px) {
  .batch-workbench {
    display: block;
    overflow: auto;
    padding: 8px;
  }
  .batch-main {
    padding: 0;
    height: 70dvh;
    min-height: 440px;
    grid-template-rows: 52px minmax(0, 1fr) 166px;
  }
  .batch-sidebar {
    margin: 12px 0 0;
    max-height: none;
  }
  .batch-settings {
    overflow: visible;
  }
  .batch-results {
    margin-top: 0;
  }
  .batch-tray header {
    gap: 4px;
    font-size: 11px;
  }
  .batch-tray #cancel-all {
    margin-right: auto;
  }
  .batch-workbench.sidebar-collapsed .batch-main {
    height: calc(100dvh - 72px);
  }
  .batch-workbench.sidebar-collapsed { padding-top: 64px; }
  .batch-workbench #sidebar-open { position: absolute; top: 8px; right: 8px; }
  .batch-controls button {
    padding: 4px 7px;
  }

  .batch-thumb canvas {
    height: 72px;
  }
}

.batch-workbench {
  color-scheme: light;
}
.batch-segments .batch-choice input {
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
}

.batch-confirm {
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 16px;
  padding: 24px;
  width: min(90vw, 520px);
  max-height: 80dvh;
  overflow: auto;
  font-family: inherit;
  box-shadow: 0 24px 80px #173b4933;
}
.batch-confirm::backdrop {
  background: #173b4959;
}
.batch-confirm h2 {
  font-size: 18px;
  margin: 0 0 16px;
}
.batch-confirm p {
  white-space: pre-line;
  overflow-wrap: anywhere;
  font-size: 14px;
  color: var(--secondary);
}
.batch-confirm footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}
.batch-confirm button {
  border: 1px solid var(--edge);
  border-radius: 8px;
  padding: 9px 22px;
}
.batch-confirm #confirm-accept {
  background: var(--action);
  color: var(--on-action);
}
.batch-confirm :focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 3px;
}

#formats .batch-choice input{appearance:none;border:2px solid var(--secondary);border-radius:50%;background:transparent;flex:none}#formats .batch-choice input:checked{border:5px solid var(--action);background:var(--panel)}

/* A single image keeps the full canvas; batch tools appear from two images. */
.batch-workbench.single-image .batch-main {
  grid-template-rows: 52px minmax(0, 1fr);
}
.single-image .batch-tray,
.single-image #apply-all,
.single-image .batch-bulk-settings,
.single-image #download-zip,
.single-image #zip-note {
  display: none;
}
.batch-sidebar-head.workspace-header {
  position: relative;
  padding: 0 58px 0 18px;
  gap: 8px;
  min-height: 60px;
}
.batch-sidebar-head .brand { font-size: 15px; }
.batch-sidebar-head .back {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding: 8px 13px;
  font-size: 12px;
  border-radius: 7px;
}
.batch-sidebar-head .sidebar-collapse {
  width: 40px;
  height: 40px;
  padding: 0;
  border-color: var(--edge);
}
/* 收起后的入口占用独立外侧栏位，不侵入对比模块。 */
.batch-workbench #sidebar-open {
  grid-area: 1 / 2;
  align-self: start;
  margin: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  color: #075265;
  border-color: #ffffffcc;
  background: #edfffbef;
  box-shadow: inset 0 1px #fff, 0 3px 12px #07526526;
}

.batch-thumb-card { position: relative; flex: 0 0 132px; padding-bottom: 8px; }
.batch-workbench .batch-thumb-remove {
  position: absolute; top: 3px; right: 3px; width: 30px; height: 30px;
  padding: 0; border-radius: 50%; border: 1px solid #ffffff70;
  background: #16485c; color: #fff; font-size: 22px; line-height: 1;
  box-shadow: 0 1px 4px #0005;
}
.batch-workbench .batch-thumb-remove:hover:not(:disabled),
.batch-workbench .batch-thumb-remove:focus-visible {
  background: var(--action-hover);
  color: #fff;
  border-color: var(--action);
}
.batch-thumb-remove:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.batch-thumb-progress {
  display: block; width: 100%; height: 4px; margin-top: 5px;
  border: 0; border-radius: 3px; overflow: hidden; appearance: none;
  background: var(--track);
}
.batch-thumb-progress::-webkit-progress-bar { background: transparent; }
.batch-thumb-progress:indeterminate {
  background: linear-gradient(90deg, transparent 0 25%, var(--action) 45% 55%, transparent 75%) var(--track);
  background-size: 240% 100%; animation: thumb-progress 1.6s ease-in-out infinite;
}
@keyframes thumb-progress { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .batch-thumb-progress:indeterminate { animation: none; } }

.batch-workbench .batch-add {
  flex: 0 0 132px; width: 132px; height: 82px; min-height: 82px;
  align-self: flex-start; padding: 8px; border-radius: 6px;
}
.batch-add span { line-height: 1; margin-bottom: 4px; }
.batch-tray #tray-toggle {
  display: grid; place-items: center; flex: none; width: 30px; height: 30px;
  padding: 4px; border: 1px solid var(--edge); border-radius: 7px;
}
#tray-toggle svg { width: 20px; height: 20px; }
.tray-collapsed #tray-toggle svg { transform: rotate(180deg); }
.batch-workbench.tray-collapsed:not(.single-image) .batch-main {
  grid-template-rows: 52px minmax(0, 1fr) 52px;
}
.tray-collapsed .batch-thumbnails { display: none; }
.tray-collapsed .batch-tray header { margin-bottom: 0; }

@media (max-width: 650px) { .batch-workbench .batch-add { height: 72px; min-height: 72px; } }
#batch-savings { color: var(--action-ink); font-size: 11px; margin-right: auto; }
@media (max-width: 900px) {
  .batch-tray header { flex-wrap: wrap; height: auto; min-height: 26px; }
  #batch-savings { order: 1; flex-basis: 100%; }
  .batch-workbench.tray-collapsed:not(.single-image) .batch-main {
    grid-template-rows: 52px minmax(0, 1fr) 76px;
  }
  .batch-tray #cancel-all { margin-left: auto; }
}

.batch-workbench.immersive { display: block; padding: 0; }
.batch-workbench.immersive .batch-main { display: block; height: 100%; min-height: 0; padding: 0; }
.immersive .batch-sidebar, .immersive .batch-tray, .immersive .canvas-top,
.batch-workbench.immersive #sidebar-open { display: none; }
.batch-workbench.immersive .batch-viewport { position: absolute; inset: 0; }
.batch-workbench #immersive-exit {
  position: absolute; right: 16px; top: 16px; z-index: 20;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--action);
  box-shadow: 0 2px 8px #0005;
}
.immersive .batch-controls {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  z-index: 15; padding: 8px; border-radius: 10px; background: var(--panel);
  opacity: 0;
}
.immersive .batch-controls:hover, .immersive .batch-controls:focus-within { opacity: 1; }
@media (hover: none) { .immersive .batch-controls { opacity: 1; } }

@media (hover: hover) {
  .batch-workbench #immersive-exit:hover:not(:disabled) {
    background: var(--action-hover);
    border-color: var(--action);
    color: #fff;
  }
  #profile-options .batch-choice:hover:has(input:not(:disabled):not(:checked)) {
    background: var(--selected-wash);
  }
}

#format-fixed { font-size: 14px; color: var(--text); }
#out-fallback:empty, #out-duration:empty,
.batch-task-actions:not(:has(button:not(.hidden))) { display: none; }
#out-fallback { margin-top: 8px; }

/* 可见胶囊保持紧凑，拖拽区域独立保留 44px，不随图片缩放。 */
.batch-workbench #handle { width: 44px; z-index: 6; }
.batch-workbench #handle::before { width: 1.5px; background: #ffffffcc; box-shadow: 0 0 4px #12374566; }
.batch-workbench #handle span {
  width: 28px; height: 42px; padding: 0 2px; border-radius: 12px;
  background: #f3fafbe6; border: 1px solid #fff; color: #087f8c;
  transform: translate(-50%, -50%); box-shadow: inset 0 1px #fff, 0 3px 12px #12374533;
  transition: transform .2s ease, background-color .2s ease;
}
.batch-workbench #handle:hover span { transform: translate(-50%, -50%) scale(1.06); background: #fff; }
.batch-workbench #handle:active span { transform: translate(-50%, -50%) scale(.96); }
@media (prefers-reduced-motion: reduce) { .batch-workbench #handle span { transition: none; } }
#handle span svg { display: block; width: 100%; }
.batch-viewport:has(.batch-world.source-only) > #handle,
.batch-viewport:has(.batch-world.hidden) > #handle { display: none; }

.batch-viewport, .batch-viewport * {
  -webkit-user-select: none; user-select: none; -webkit-user-drag: none;
}
#handle > span, #handle svg, #handle path { pointer-events: none; }
.batch-viewport > .batch-before, .batch-viewport > .batch-after {
  top: 16px; transform: none; z-index: 7; pointer-events: none;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; border: 1px solid var(--edge); border-radius: 6px;
  background: #f8fcfce6; box-shadow: 0 2px 8px #1237450d; font-size: 12px; color: #254d5c;
}
.batch-viewport > .batch-before { left: 16px; }
.batch-viewport > .batch-after { right: 16px; }
.batch-before::before, .batch-after::before {
  display: none;
}
.batch-after::before { background: var(--action); }
.batch-viewport:has(.batch-world.source-only) > .batch-after,
.batch-viewport:has(.batch-world.hidden) > .batch-before,
.batch-viewport:has(.batch-world.hidden) > .batch-after { display: none; }
.immersive .batch-viewport > .batch-after { top: 64px; }

/* 手动编辑不重建控件；侧栏内容紧凑排列，超过可用高度时整体滚动。 */
.canvas-top > div { flex: 1; min-width: 0; }
.canvas-meta { margin-left: 10px; color: var(--secondary); }
.batch-settings #format-options { margin-top: 0; }
.batch-segments { flex-wrap: wrap; overflow: visible; }
.batch-segments .batch-choice { min-width: 56px; }
.batch-formats .batch-choice { min-width: 110px; }
/* 侧栏选项与批量设置一致使用浅色描边卡片：选中为深描边+浅底，不用深底白字。 */
#formats, #profile-list { gap: 8px; border: 0; min-height: 0; }
#profile-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
#formats .batch-choice, #profile-list .batch-choice {
  border-color: var(--edge); border-radius: 8px; background: var(--editor-control); color: var(--text);
  min-height: 44px; padding: 8px 12px; transition: background-color .15s, color .15s, border-color .15s;
}
#profile-list .batch-choice { padding: 8px 6px; }
#formats .batch-choice:hover:has(input:not(:disabled)),
#profile-list .batch-choice:hover:has(input:not(:disabled)) { background: var(--selected-wash); border-color: var(--action); color: var(--action-ink); }
#formats .batch-choice:has(input:checked),
#profile-list .batch-choice:has(input:checked) { border-color: var(--action); background: #ffffffe6; color: var(--action-ink); font-weight: 600; box-shadow: 0 2px 6px #12374512, inset 0 1px #fff; }
#formats .batch-choice:has(input:focus-visible),
#profile-list .batch-choice:has(input:focus-visible) { outline-offset: 2px; }
.manual-settings { margin-top: 20px; }
.manual-quality-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.manual-quality-heading > div { display: flex; align-items: center; gap: 8px; color: var(--secondary); }
#manual-quality-number { width: 64px; box-sizing: border-box; padding: 7px; border: 1px solid var(--edge); border-radius: 8px; color: var(--text); background: var(--canvas); font: inherit; text-align: center; }
#manual-quality-number[aria-invalid="true"] { border-color: var(--danger); }
#manual-quality-range { display: block; width: 100%; margin: 12px 0 8px; accent-color: var(--action); cursor: pointer; }
.manual-error { color: var(--danger); font-size: 13px; margin-top: 6px !important; }
.manual-dirty { margin-top: 12px !important; color: var(--warning); font-size: 13px; }
.manual-dirty::before { content: "●"; margin-right: 7px; font-size: 10px; }
.batch-workbench #manual-apply { width: 100%; margin-top: 10px; background: var(--action); border-color: var(--action); color: var(--on-action); font-weight: 600; padding: 10px; }
.batch-workbench #manual-apply:hover:not(:disabled) { background: var(--action-hover); }
.batch-workbench #manual-apply:disabled { background: var(--selected-wash); color: var(--secondary); border-color: var(--edge); }
#manual-retry-note, #apply-all-note, #result-setting-note { margin-top: 6px; font-size: 12px; }
#manual-error:empty, #manual-retry-note:empty, #apply-all-note:empty, #result-setting-note:empty { display: none; }
.batch-bulk-settings { margin-top: 10px; }
.batch-size { flex-wrap: wrap; }
.batch-results #zip-note { margin-top: 7px; font-size: 12px; }
@media (max-width: 650px) {
  .batch-sidebar-scroll { flex: none; overflow: visible; }
  .canvas-top { line-height: 1.25; }
  .canvas-top p { max-width: none; }
  .canvas-meta { display: block; margin-left: 0; }
}

/* 详情页：浅色比较舞台与海盐玻璃操作层。 */
.batch-workbench { --action: #087f8c; --action-hover: #076d78; --action-ink: #123745; --secondary: #365866; }
.batch-main { grid-template-columns: minmax(0, 1fr); background: #edf4f680; border-radius: 20px; gap: 10px; }
.canvas-top { grid-column: 1; grid-row: 1; min-width: 0; background: transparent; gap: 12px; padding-right: 0; }
#canvas-filename { font-size: 14px; font-weight: 600; }
.batch-viewport { grid-column: 1; grid-row: 2; border-radius: 14px; border: 1px solid #fff; box-shadow: inset 0 1px 8px #12374512; }
.batch-controls { grid-column: 1; grid-row: 2; align-self: end; justify-self: center; z-index: 8; margin: 0 8px 12px; max-width: calc(100% - 16px); pointer-events: none; }
.batch-controls > div { pointer-events: auto; background: #edf7f9e6; border-color: #ffffffcc; border-radius: 14px; }
.batch-controls button { min-height: 32px; border-color: transparent; }
.batch-tray { grid-column: 1; grid-row: 3; }
.batch-sidebar { background: #e7f3f5d9; }
.batch-sidebar-head .yitu-brand { color: #075265; }
#sidebar-meta { display: none; }
.detail-result-card { flex: none; margin: 0 16px 16px; padding: 16px; border: 1px solid #ffffffcc; border-radius: 14px; background: #f8fcfcd9; }
.detail-result-card h2 { font-size: 13px; font-weight: 500; color: var(--secondary); }
.detail-result-card .batch-size { justify-content: start; gap: 8px 12px; margin: 8px 0; }
.detail-result-card #size-change { font-size: 28px; line-height: 1.2; font-variant-numeric: tabular-nums; }
#size-percent { padding: 4px 8px; border-radius: 12px; font-size: 12px; white-space: nowrap; }
#size-percent:empty { display: none; }
#size-percent[data-tone="decreased"] { color: #12614c; background: #bfeeda; }
#size-percent[data-tone="increased"] { color: #77501d; background: #f8e3bd; }
#size-percent[data-tone="unchanged"] { color: #49636c; background: #e3ecef; }
.detail-result-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--secondary); }
.detail-result-card #result-status { margin-top: 6px; font-size: 12px; color: var(--secondary); overflow-wrap: anywhere; }
.batch-results { margin: auto 16px 0; padding: 0 0 16px; border-top: 0; }
.batch-results #download { min-height: 44px; color: #fff; background: var(--action); border-color: var(--action); box-shadow: inset 0 1px #ffffff33, 0 3px 10px #087f8c1a; }
.batch-results #download:hover:not(:disabled) { background: var(--action-hover); }
.batch-results #download-zip { color: var(--action-ink); background: #ffffff40; border-color: var(--edge); }
.batch-results #download-zip:hover:not(:disabled) { background: #ffffff80; }
@media (max-width: 900px) { .batch-controls { flex-wrap: wrap; gap: 4px; } }
@media (max-width: 650px) {
  .batch-main { padding: 8px; }
  .batch-sidebar { margin-top: 12px; }
  .canvas-top { gap: 8px; }
  .canvas-top #close-workspace { width: auto; font-size: 12px; padding-inline: 8px; }
  #canvas-filename { font-size: 12px; }
  .batch-viewport > .batch-before { left: 8px; }
  .batch-viewport > .batch-after { right: 8px; }
  .batch-viewport > .batch-before, .batch-viewport > .batch-after { top: 8px; padding: 5px 7px; font-size: 11px; }
  .batch-results { margin-top: 0; }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .batch-main, .batch-sidebar, .batch-controls > div { background: #edf4f6; }
}
@media (forced-colors: active) {
  #size-percent[data-tone] { color: CanvasText; background: Canvas; border: 1px solid CanvasText; }
  .batch-results #download { color: ButtonText; background: ButtonFace; }
  .canvas-top #close-workspace { color: ButtonText; background: ButtonFace; border-color: ButtonText; box-shadow: none; }
}

/* 结果页沿用首页海面，连续列表承载结果。 */
.results-page {

  position: fixed; inset: 0; overflow: hidden; color: var(--text);
  background: var(--workspace-ocean);
  scrollbar-gutter: stable; color-scheme: light; isolation: isolate;
}
/* 共用首页海面，结果页的背景固定在视口内，不随窄屏列表滚动。 */
.results-page > .ocean-scene, .batch-workbench > .ocean-scene { position: fixed; }
.results-page > .ocean-scene::after, .batch-workbench > .ocean-scene::after { background: linear-gradient(90deg, #d8fff040, #b3f6e810 44%, #d8f6ff40); }
.results-shell { width: 100%; max-width: 1312px; height: 100%; min-height: 0; display: flex; flex-direction: column; margin: auto; padding: 24px 36px 28px; }
.results-header, .results-bulk, .results-summary { flex-shrink: 0; }
.results-board {
  display: flex; flex-direction: column; flex: 0 1 auto; min-height: 0;
  border-radius: 24px; overflow: hidden;
  background: var(--workspace-glass); box-shadow: 0 16px 40px #092f4529, 0 2px 5px #092f4514;
}
.results-toolbar { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 24px; flex: none; padding: 20px; border-bottom: 1px solid var(--edge); }
.results-scroll { overflow-anchor: none; flex: 1; min-height: 0; overflow: auto; scrollbar-gutter: stable; overscroll-behavior: contain; padding: 0 4px 4px; scroll-padding-block: 8px; }
.results-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.results-header .results-home { margin-left: auto; flex: none; align-self: center; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 44px; min-height: 44px; padding-inline: 16px; border: 1px solid #d7fff452; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; color: #effff9; background: linear-gradient(140deg, #1b5257b8, #093b46cf); box-shadow: 0 6px 18px #00283324, inset 0 1px 0 #ffffff24; transform: translateZ(0); transition: none; }
.results-header .results-home svg { width: 16px; height: 16px; flex: none; color: #9ef0d6; }
.results-header .results-home::before { display: none; }
.results-header .results-home:hover:not(:disabled) { border-color: #c8f3e099; background: linear-gradient(140deg, #226368d4, #0d4854eb); box-shadow: 0 8px 22px #00283333, inset 0 1px 0 #ffffff33; }
.results-heading { display: flex; align-items: center; min-width: 0; }
.results-heading h1 { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.results-page p, .results-page h2 { margin: 0; }
.results-page h2 { font-size: 14px; font-weight: 600; }
.results-page :focus-visible { outline: 2px solid var(--action); outline-offset: 4px; }
.results-page button:disabled { opacity: .45; cursor: not-allowed; }
.results-button { padding: 9px 15px; border: 1px solid var(--edge); border-radius: 7px; color: var(--text); font-size: 13px; line-height: 1.5; white-space: nowrap; }
.results-button:hover:not(:disabled) { border-color: var(--action); background: var(--hover); }
.results-primary { color: var(--on-action); background: var(--action); border-color: var(--action); font-weight: 650; }
.results-primary:hover:not(:disabled) { color: var(--on-action); background: var(--action-hover); }
#results-zip { width: 176px; flex: 0 0 176px; font-variant-numeric: tabular-nums; --action: #087f8c; --action-hover: #08717d; --on-action: #fff; border-color: #086a76; box-shadow: inset 0 1px #ffffff33, 0 2px 6px #07526520; }
.results-page label { display: flex; gap: 12px; align-items: center; color: var(--secondary); font-size: 13px; }
/* 原生 progress 保留读屏语义，圆环只负责视觉显示。 */
.results-progress progress { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); }
.results-progress-ring { display: block; width: 32px; height: 32px; flex: none; fill: none; stroke-width: 3; transform: rotate(-90deg); }
.results-progress-track { stroke: var(--track); }
.results-progress-value { stroke: var(--progress-color); stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--progress, 0)); transition: stroke-dashoffset .35s ease; }
.results-paused { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; background: #8050150c; border-left: 2px solid var(--warning); }
.results-paused p { font-size: 13px; }
.results-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.results-table th { padding: 14px 12px; color: var(--secondary); font-size: 12px; font-weight: 500; text-align: left; }
.results-table th:nth-child(1) { width: 40%; }
.results-table th:nth-child(2) { width: 23%; }
.results-table th:nth-child(3) { width: 12%; }
.results-table th:nth-child(4) { width: 25%; }
.result-row { border-top: 1px solid var(--edge); transition: background-color .16s ease; }
.result-row:last-child { border-bottom: 1px solid var(--edge); }
.result-row:hover, .result-row:focus-within { background: #ffffff2e; }
.result-row.is-editing { background: #ffffff40; }
.result-row.is-previewing { background: var(--preview-row-background); transition: none; }
.result-row td { padding: 16px 12px; vertical-align: middle; overflow-wrap: anywhere; }
.result-row small { display: block; margin-top: 5px; color: var(--secondary); font-size: 12px; }
.result-image-inner { display: flex; align-items: center; gap: 12px; min-width: 0; }
.result-thumbnail { width: 120px; height: 80px; flex: none; overflow: hidden; border-radius: 8px; border: 1px solid var(--edge); box-shadow: 0 2px 6px #07526514, inset 0 0 0 1px #ffffff59; background: conic-gradient(#c5d2d8 25%, #e4ebee 0 50%, #c5d2d8 0 75%, #e4ebee 0) 0 0 / 12px 12px; }
.result-thumbnail canvas { width: 100%; height: 100%; object-fit: contain; display: block; }
button.result-thumbnail { position: relative; padding: 0; cursor: zoom-in; }
button.result-thumbnail::after { content: ""; position: absolute; right: 5px; bottom: 5px; width: 24px; height: 24px; border-radius: 50%; background: #effffbef url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23087f8c' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='10' cy='10' r='5'/%3E%3Cpath d='m14 14 5 5M10 7v6M7 10h6'/%3E%3C/svg%3E") center / 18px no-repeat; opacity: 0; transition: opacity .18s; }
button.result-thumbnail:is(:hover, :focus-visible)::after { opacity: 1; }
@media (hover: none) { button.result-thumbnail::after { opacity: 1; } }
.quick-preview { position: fixed; inset: 0; width: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 76px 24px 48px; overflow: hidden; border: 0; background: transparent; color: #123f48; box-shadow: none; font: inherit; }
.quick-preview[open] { display: flex; align-items: center; justify-content: center; }
.quick-preview::backdrop { background: #073e4973; will-change: opacity; animation: quick-preview-backdrop .24s ease both; }
.quick-preview-description { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#quick-preview-close { position: absolute; top: 20px; left: calc(100% - 68px); z-index: 1; width: 44px; height: 44px; padding: 0; border: 1px solid #ffffffb3; border-radius: 50%; background: #effffbd9; color: #075265; font-size: 26px; line-height: 1; cursor: pointer; transition: opacity .24s, background-color .18s; }
#quick-preview-close:hover { background: #fff; }
#quick-preview-close:focus-visible { outline: 2px solid #d5fff4; outline-offset: 3px; }
.quick-preview-stage { position: relative; display: flex; align-items: center; justify-content: center; width: min(860px, 100%); height: min(70dvh, 100%); min-height: 0; }
#quick-preview-image { position: relative; display: block; flex: none; max-width: none; max-height: none; transform-origin: 0 0; will-change: transform; }
#quick-preview-image[hidden] { display: none; }
#quick-preview-status { position: absolute; padding: 12px 16px; border-radius: 12px; background: #effffbf2; font-size: 14px; color: #416572; animation: quick-preview-backdrop .12s ease .15s both; }
.quick-preview.is-closing #quick-preview-close { opacity: 0; }
.quick-preview.is-closing::backdrop { animation: quick-preview-backdrop-close .42s ease both; }
@keyframes quick-preview-backdrop { from { opacity: 0; } to { opacity: 1; } }
@keyframes quick-preview-backdrop-close { from { opacity: var(--preview-backdrop-opacity, 1); } to { opacity: 0; } }
@media (max-width: 650px) {
  .quick-preview { padding: 68px 16px 32px; }
}
@media (prefers-reduced-motion: reduce) { .quick-preview::backdrop, .quick-preview.is-closing::backdrop, #quick-preview-status { animation: none; } }
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) { #quick-preview-close { background: #effffb; } }
@media (forced-colors: active) { #quick-preview-close { background: Canvas; color: CanvasText; border-color: ButtonText; } #quick-preview-close:focus-visible { outline-color: Highlight; } }
.result-file { min-width: 0; }
.result-file strong { display: block; font-weight: 600; font-size: 14px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.result-file span { display: block; color: var(--secondary); font-size: 12px; margin-top: 4px; }
.result-file .result-settings { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 4px; }
.result-file .result-settings span { margin: 0; }
.result-file .result-format-note { line-height: 1.5; overflow-wrap: anywhere; }
.result-file .result-format-note[hidden] { display: none; }
.result-profile::before { content: "·"; margin-right: 8px; }
.result-bytes { font-variant-numeric: tabular-nums; font-size: 20px; font-weight: 650; color: var(--text); }
.result-row .result-saving { color: var(--secondary); line-height: 1.6; }
.result-row .result-saving { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.result-change { display: inline-block; padding: 3px 8px; border-radius: 12px; background: #bfeeda; color: #12614c; font-size: 12px; font-weight: 600; white-space: nowrap; }
.result-change:empty { display: none; }
.result-saving.is-increased .result-change { background: #f8e3bd; color: #77501d; }
.result-saving.is-unchanged .result-change { background: #edf4f6b3; color: #49636c; }
.result-state { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.result-state::before { content: ''; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--secondary); }
.result-row[data-status="success"] .result-state { color: var(--secondary); }
.result-row[data-status="success"] .result-state::before { background: var(--success); }
.result-row[data-status="failed"] .result-state, .result-row[data-status="busy"] .result-state { color: var(--warning); }
.result-row[data-status="failed"] .result-state::before, .result-row[data-status="busy"] .result-state::before { background: var(--warning); }
.result-row[data-status="requesting"] .result-state::before { width: 12px; height: 12px; background: none; border: 2px solid var(--track); border-top-color: var(--action); animation: result-spin 1s linear infinite; }
@keyframes result-spin { to { transform: rotate(360deg); } }
.result-actions > div { display: flex; flex-wrap: nowrap; gap: 8px; align-items: center; }
.result-actions .results-button { padding: 6px 13px; border-radius: 9px; background: linear-gradient(180deg, #ffffffa8, #f2fafbad); border: 1px solid #ffffffc4; font-size: 13px; font-weight: 500; line-height: 1.5; white-space: nowrap; color: var(--action-ink); box-shadow: inset 0 1px 0 #ffffffd9, 0 2px 5px #07384814, 0 0 0 1px #0d435414; transition: background-color .15s ease, background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .1s ease; }
.result-actions .results-button:hover:not(:disabled) { background: #fffffff2; border-color: #087f8c73; color: #064b57; box-shadow: inset 0 1px 0 #fff, 0 4px 10px #0752651f; }
.result-actions .results-button:active:not(:disabled) { transform: scale(.98); }
.result-actions .result-adjust { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.result-actions .result-adjust::after { content: ""; width: 5.5px; height: 5.5px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: translateY(-1.5px) rotate(45deg); opacity: .72; transition: transform .15s ease; }
.result-actions .result-adjust[aria-expanded="true"] { background: #fffffff5; border-color: #087f8c8c; color: #064b57; }
.result-actions .result-adjust[aria-expanded="true"]::after { transform: translateY(1.5px) rotate(-135deg); }
.result-actions .result-download:not(:disabled) { background: linear-gradient(180deg, #0b8d9b, #087885); border-color: #066773; color: #fff; font-weight: 600; box-shadow: inset 0 1px 0 #ffffff47, 0 3px 8px #0752652e; }
.result-actions .result-download:hover:not(:disabled) { background: linear-gradient(180deg, #0d9aa9, #088290); border-color: #055c67; color: #fff; box-shadow: inset 0 1px 0 #ffffff59, 0 5px 12px #0752653d; }
.result-actions .result-retry:not(:disabled) { background: linear-gradient(180deg, #fff8ebdb, #fcecd2db); border-color: #d6983a73; color: #78490a; font-weight: 600; }
.result-actions .result-retry:hover:not(:disabled) { background: #fff9f0; border-color: #b7791f; color: #5f3706; }
.result-remove { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 26px; height: 26px; padding: 0; border: 1px solid #0e384724; border-radius: 50%; background: #ffffff52; color: #365a66; box-shadow: inset 0 1px #ffffff80, 0 1px 2px #0752650d; transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .12s ease; }
.result-remove svg { width: 13px; height: 13px; flex: none; }
.result-row:hover .result-remove { border-color: #0e384738; background: #ffffff80; color: #193e4a; }
.result-remove:hover, .result-remove:focus-visible { background: #e5484d !important; border-color: #ce2c31 !important; color: #fff !important; box-shadow: 0 3px 8px #e5484d40; }
.result-remove:active { transform: scale(.94); }
.row-editor td { padding: 0; }
.row-editor-panel { border-block: 1px solid var(--edge); padding: 20px 24px; background: var(--workspace-glass); box-shadow: inset 0 1px #ffffff05; }
.row-editor-panel header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.row-editor-panel h2 { overflow-wrap: anywhere; }
#row-editor-close { flex: none; display: grid; place-items: center; margin: 0; width: 44px; height: 44px; padding: 0; border: 1px solid var(--edge); border-radius: 50%; background: transparent; color: var(--secondary); }
#row-editor-close svg { width: 20px; height: 20px; }
#row-editor-close:hover { background: var(--editor-control); color: var(--text); }
.row-editor-fields { display: grid; grid-template-columns: minmax(180px, 240px) minmax(0, 520px); align-items: start; gap: 18px 32px; }
.row-editor-panel footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; }
.row-editor-panel footer > div { display: flex; gap: 10px; }
.row-editor-panel footer p, .row-manual p { color: var(--secondary); font-size: 12px; }
.row-manual { grid-column: 2; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 4px; }
.row-manual input[type="range"] { flex: 1; min-width: 100px; width: 140px; accent-color: var(--action); }
.row-manual input[type="number"] { width: 64px; padding: 8px; border: 1px solid #78919c; border-radius: 6px; background: var(--editor-control); color: var(--text); font: inherit; }
.row-manual p { width: 100%; }
.row-manual #row-quality-error { color: var(--danger); }
.return-to-results .close-face::after { content: '←'; }
.return-to-results:is(:hover, :focus-visible) .close-face::after { content: '返回列表'; font-size: 15px; letter-spacing: 0; }

.row-choice-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.row-choice-field legend { color: var(--secondary); font-size: 12px; margin-bottom: 9px; padding: 0; }
.row-segments { display: flex; flex-wrap: wrap; padding: 3px; gap: 3px; border-radius: 9px; background: var(--editor-control); border: 1px solid #78919c; }
.results-page .row-segments label { position: relative; display: flex; flex: 1; min-width: 0; cursor: pointer; }
.row-segments input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.row-segments span { width: 100%; min-height: 38px; display: grid; place-items: center; padding: 7px 12px; border-radius: 6px; color: var(--secondary); white-space: nowrap; font-size: 13px; transition: background-color .15s, color .15s; }
.row-segments label:hover span { background: var(--hover); color: var(--text); }
.row-segments input:checked + span { color: var(--editor-selected-ink); background: var(--editor-selected); font-weight: 600; box-shadow: 0 1px 3px #0003; }
.row-segments input:focus-visible + span { outline: 2px solid var(--action); outline-offset: 3px; }
.results-progress-activity { display: none; stroke: var(--progress-color); stroke-dasharray: 12 88; stroke-linecap: round; opacity: .5; transform-origin: 16px 16px; }
.results-progress.is-processing .results-progress-activity { display: block; animation: results-wait 1.8s linear infinite; }
@keyframes results-wait { to { transform: rotate(360deg); } }

@media (max-width: 1150px) {
  .results-shell { padding: 20px; }
  .result-thumbnail { width: 72px; height: 56px; }
  .result-image-inner { gap: 10px; }
  .result-row td { padding: 14px 8px; }
}
@media (max-width: 760px) {
  .results-shell { padding: 14px; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  .results-header { gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
  .results-header .results-home { padding-inline: 12px; font-size: 13px; }
  .results-table, .results-table tbody { display: block; }
  .results-table thead { display: none; }
  .result-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 14px;
    padding: 14px;
    margin-bottom: 10px;
    border: 1px solid #ffffff59;
    border-radius: 16px;
    background: #ffffff29;
    box-shadow: 0 2px 10px #092f450d;
    transition: background-color .16s ease;
  }
  .result-row:last-child { margin-bottom: 2px; }
  .result-row td { display: block; padding: 0; min-width: 0; }
  .result-row td[data-label]::before { display: none; }
  .result-row .result-image { grid-column: 1 / -1; }
  .result-thumbnail { width: 84px; height: 56px; border-radius: 6px; }
  .result-row td[data-label="压缩后体积"] { grid-column: 1 / 2; align-self: center; }
  .result-row td[data-label="状态"] { grid-column: 2 / 3; justify-self: end; align-self: center; }
  .result-row .result-actions { grid-column: 1 / -1; margin-top: 2px; padding-top: 10px; border-top: 1px solid #193b4914; }
  .result-actions > div { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; align-items: center; }
  .result-actions .results-button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 6px 12px; flex: 1 1 auto; }
  .result-remove { width: 28px; height: 28px; align-self: center; }
  .row-editor { display: block; }
  .row-editor td { display: block; }
  .row-editor-panel { padding: 16px; }
  .row-editor-fields { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .row-manual { grid-column: 1; }
  .row-editor-panel footer > div { width: 100%; }
  #row-apply { flex: 1; }
  .results-paused { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .results-page *, .close-workspace, .close-workspace * { animation: none !important; transition: none !important; }
  .results-progress.is-processing .results-progress-activity { display: none; }
}

@media (max-width: 380px) { .row-profile-field .row-segments { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (forced-colors: active) { .row-segments input:checked + span { background: Highlight; color: HighlightText; } .row-segments { border-color: ButtonText; } }

/* 小屏和矮窗口让内容自然滚动，避免工具栏挤占图片区域。 */
@media (max-width: 760px), (max-height: 600px) {
  .results-page { overflow: auto; }
  .results-shell { height: auto; min-height: 100%; }
  .results-scroll { flex: none; overflow: visible; scrollbar-gutter: auto; }
  .results-board { flex: none; overflow: visible; }
}

@media (min-width: 761px) and (min-height: 601px) {
  .results-scroll { scroll-padding-top: 52px; }
  .results-table th { position: sticky; top: 0; z-index: 1; background: var(--panel); box-shadow: 0 1px var(--edge); }
}

/* 单张压缩设置直接下拉框：点击“压缩设置”直接弹出 100%~10% 质量列表，选中即刻重新压缩。
   外层 #row-editor 固定承载毛玻璃与圆角裁切，内层 .row-quality-list 独立滚动并使用自定义细滚动条。 */
#row-editor {
  position: fixed;
  top: 12px;
  left: 12px;
  right: auto;
  bottom: auto;
  display: flex;
  flex-direction: column;
  width: 118px;
  max-height: min(320px, calc(100dvh - 24px));
  padding: 0;
  z-index: 30;
  isolation: isolate;
  overflow: hidden;
  border-radius: 13px;
  border: 1px solid #ffffffd9;
  box-shadow: 0 14px 34px #072d3b33, 0 2px 8px #072d3b17, inset 0 1px 0 #fff;
  --panel: #e9f5f6;
  --edge: #193b4924;
  --secondary: #34525d;
  --action: #087f8c;
  --action-hover: #066974;
  background: var(--panel);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .14s ease, transform .14s cubic-bezier(.22, 1, .36, 1);
  will-change: transform, opacity;
}
#row-editor[data-placement="top"] {
  transform: translateY(4px);
}
#row-editor.is-open {
  opacity: 1;
  transform: translateY(0);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  #row-editor { --panel: linear-gradient(180deg, #dff3f4f0, #eef2f3f5); }
  #row-editor::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; -webkit-backdrop-filter: blur(22px) saturate(140%); backdrop-filter: blur(22px) saturate(140%); }
}
.row-quality-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: min(318px, calc(100dvh - 26px));
  padding: 5px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.row-quality-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 31px;
  padding: 4px 12px 4px 26px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #123745;
  font: inherit;
  font-size: 14px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.row-quality-option:hover:not(.is-selected) {
  background: #087f8c17;
  color: #064b57;
}
.row-quality-option.is-selected {
  background: linear-gradient(180deg, #0b8d9b, #087885);
  color: #fff;
  font-weight: 650;
  box-shadow: 0 2px 6px #07526526, inset 0 1px 0 #ffffff40;
}
.row-quality-option.is-selected::before {
  content: "✓";
  position: absolute;
  left: 9px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
.row-quality-option:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: -2px;
}
@media (forced-colors: active) {
  .row-quality-option.is-selected { background: Highlight; color: HighlightText; forced-color-adjust: none; }
}

/* 状态切换只更新内容，不让下载说明与统计换行牵动进度条。 */
#results-percent { flex: 0 0 4ch; text-align: right; }

/* 质量数值保持视觉居中；方向键仍可按原生 number 输入调整。 */
/* 隐藏原生数字箭头的实色底板，保留 number 校验与键盘步进。 */
:is(#results-quality, #manual-quality-number) { text-align: center; font-variant-numeric: tabular-nums; appearance: textfield; -moz-appearance: textfield; }
:is(#results-quality, #manual-quality-number)::-webkit-inner-spin-button,
:is(#results-quality, #manual-quality-number)::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* 压缩固定工具区的留白，保留统计与说明的稳定占位。 */
.results-shell { padding-top: 20px; }
.results-header { margin-bottom: 10px; }

@media (prefers-reduced-motion: reduce) {
  #row-editor { transition: none; }
}
@media (max-width: 760px) {
  .result-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* 设置与批次操作共用工具栏，只保留工作台外层玻璃。 */
.results-bulk { min-width: 0; padding-left: 24px; border-left: 1px solid var(--edge); align-self: center; }
.results-bulk-heading { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#results-bulk-summary { color: var(--secondary); font-size: 12px; }
.results-bulk-fields { display: grid; grid-template-columns: 108px minmax(0, 1fr); align-items: center; column-gap: 12px; }
.results-page .results-setting { display: flex; flex-direction: column; align-items: start; gap: 0; margin: 0; }
.results-setting-label, .results-profile-field legend { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.results-manual-content > label { color: var(--secondary); font-size: 12px; font-weight: 500; }
.results-profile-field { margin: 0; padding: 0; border: 0; min-width: 0; }
.results-select-shell { display: block; width: 100%; }
#results-format {
  appearance: none; -webkit-appearance: none;
  min-height: 44px; width: 108px; padding: 8px 30px 8px 12px; border: 1px solid var(--edge);
  border-radius: 10px; color: var(--text);
  background: #ffffff2e url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%23287681' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center / 13px 13px;
  font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
}
#results-format option { background: var(--panel); color: var(--text); }
#results-format:hover { border-color: #208b9799; background-color: #ffffff4d; }
#results-format:focus { outline: none; }
#results-format:focus-visible { outline: 2px solid #158b97; outline-offset: 2px; }
/* 保留原生选择与键盘语义，支持的浏览器使用可定制的顶层菜单。 */
@supports (appearance: base-select) {
  #results-format, #results-format::picker(select) { appearance: base-select; }
  #results-format { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 30px 8px 12px; cursor: pointer; }
  #results-format:open { outline: none; border-color: #208b9799; background-color: #effffbd9; box-shadow: 0 0 0 3px #46bac41a; }
  #results-format::picker-icon { display: none; }
  #results-format::picker(select) {
    min-width: 144px; padding: 5px; margin-block-start: 6px;
    border: 1px solid #ffffffd9; border-radius: 13px;
    background: #e7f8f5f2; color: #123f48; font: inherit; font-size: 14px;
    box-shadow: 0 8px 24px #07526524, inset 0 1px #fff;
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  }
  #results-format option { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 8px 10px; border-radius: 8px; background: transparent; color: #123f48; }
  #results-format option:checked { background: #ffffffd9; font-weight: 600; }
  #results-format option:is(:hover, :focus) { background: #d1efeb; outline: none; }
  #results-format option::checkmark { order: 1; margin-left: auto; color: #087f8c; }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  #results-format::picker(select) { background: #e7f8f5; backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (forced-colors: active) {
  #results-format:focus-visible { outline-color: Highlight; }
  #results-format::picker(select) { background: Canvas; color: CanvasText; border-color: ButtonText; box-shadow: none; }
  #results-format option { color: CanvasText; }
  #results-format option:is(:hover, :focus, :checked) { background: Highlight; color: HighlightText; }
  #results-format option::checkmark { color: currentColor; }
}
/* 批量档位使用标准胶囊分段轨道，去除未选中项多余内框。 */
#results-profile { position: relative; --pill-x: 0; --pill-y: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 3px; gap: 2px; background: #ffffff2e; border: 1px solid var(--edge); border-radius: 10px; }
#results-profile span { min-height: 36px; padding-inline: 6px; font-size: 13px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--secondary); transition: background-color .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease; }
#results-profile label:hover span { background: #ffffff38; color: var(--action-ink); }
/* 仅移动选中底板，文字和整个毛玻璃面板保持原位。 */
#results-profile::before { box-sizing: border-box; content: ""; position: absolute; pointer-events: none; left: 3px; top: 3px; width: calc((100% - 12px) / 4); height: calc(100% - 6px); border: 1px solid #087f8c66; border-radius: 7px; background: #ffffffeb; box-shadow: 0 2px 6px #07526518, inset 0 1px #fff; transform: translate(calc(var(--pill-x) * (100% + 2px)), 0); transition: transform .36s cubic-bezier(.22, 1, .36, 1); }
#results-profile:has(label:nth-child(2) input:checked) { --pill-x: 1; }
#results-profile:has(label:nth-child(3) input:checked) { --pill-x: 2; }
#results-profile:has(label:nth-child(4) input:checked) { --pill-x: 3; }
#results-profile input:checked + span { background: transparent; border-color: transparent; color: var(--action); font-weight: 600; box-shadow: none; }
@media (prefers-reduced-motion: reduce) { #results-profile::before { transition: none; } }
#results-apply-all { flex: none; min-height: 38px; padding-inline: 16px; border-radius: 8px; --action: #087f8c; --action-hover: #08717d; --on-action: #fff; border-color: #086a76; box-shadow: inset 0 1px #ffffff33, 0 2px 6px #07526520; transition: all .15s ease; }
/* 内层允许收缩到零，隐藏时仍能完成高度动画，键盘访问由 inert 立即关闭。 */
.results-manual { display: grid; grid-column: 1 / -1; grid-template-rows: 1fr; margin-top: 12px; min-width: 0; opacity: 1; visibility: visible; transition: grid-template-rows .45s cubic-bezier(.4, 0, .2, 1), margin-top .45s cubic-bezier(.4, 0, .2, 1), opacity .35s ease, visibility .45s; }
.results-manual-content { min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 4px; }
#results-manual.hidden { display: grid !important; grid-template-rows: 0fr; margin-top: 0; opacity: 0; visibility: hidden; }
.results-quality-controls { display: flex; align-items: center; gap: 12px; min-height: 44px; color: var(--secondary); }
#results-quality-range { flex: 1; min-width: 60px; accent-color: var(--action); }
#results-quality { width: 66px; padding: 8px; border: 1px solid var(--edge); border-radius: 7px; background: var(--editor-control); color: var(--text); font: inherit; text-align: center; }
#results-quality[aria-invalid="true"] { border-color: var(--danger); }
.results-quality-controls > span { white-space: nowrap; font-size: 12px; }
.results-manual-note { margin: 0; font-size: 12px; line-height: 16px; color: var(--secondary); }
.results-setting-label, .results-profile-field legend, .results-manual-content > label { line-height: 18px; }
#results-quality-error { color: var(--danger); }
#results-quality-error:empty { display: none; }
.results-summary { display: flex; flex-direction: column; align-items: start; gap: 14px; min-width: 0; padding: 0; background: transparent; margin-top: 0; border-radius: 0; }
.results-totals { display: grid; grid-template-columns: 170px minmax(0, 1fr); width: 100%; align-items: baseline; gap: 8px 20px; font-variant-numeric: tabular-nums; }
.results-totals strong { font-size: 19px; font-weight: 600; }
.results-totals span { color: var(--secondary); font-size: 12px; }
.results-progress { --progress-color: #248f91; position: relative; display: flex; flex: none; align-items: center; gap: 8px; min-height: 44px; font-size: 13px; font-variant-numeric: tabular-nums; }
.results-download { width: 100%; text-align: left; }
.results-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: start; gap: 10px; }
.results-actions .results-button { min-height: 44px; }
.results-download p { margin-top: 8px; font-size: 12px; color: var(--secondary); }
.results-download p:empty { display: none; }
.results-drop { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: 1px solid var(--edge); border-radius: 8px; color: var(--action-ink); background: var(--editor-control); font-size: 26px; line-height: 1; }
.results-drop:hover:not(:disabled) { background: var(--selected-wash); border-color: var(--action); }
.results-page .results-empty { padding: 24px 20px; color: var(--secondary); }
.results-paused { width: 100%; }
.results-scroll { background: transparent; border-radius: 0; }
.results-scroll .results-table th { position: static; background: transparent; box-shadow: none; }
.results-table thead { position: sticky; top: 0; z-index: 1; background: var(--table-header); }
.results-shell { padding-bottom: 20px; }
@media (max-width: 1199px) {
  .results-toolbar { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .results-bulk { padding: 16px 0 0; border-left: 0; border-top: 1px solid var(--edge); }
}
@media (max-width: 1599px) {
  .results-heading .yitu-brand > svg { width: 118px; height: 47px; }
}
@media (max-width: 760px) {
  .intro .yitu-brand > svg { width: 112px; height: 45px; }
  .results-header { flex-wrap: wrap; }
  .results-heading .yitu-brand > svg { width: 104px; height: 42px; }
  .results-toolbar { padding: 16px 14px; gap: 16px; }
  .results-board { border-radius: 20px; }
  .results-bulk-heading { margin-bottom: 4px; }
  .results-bulk-fields { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .results-profile-field { width: 100%; }
  #results-format { min-height: 38px; height: 38px; font-size: 13px; }
  #results-profile { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  #results-profile::before { width: calc((100% - 12px) / 2); height: calc((100% - 12px) / 2); transform: translate(calc(var(--pill-x) * (100% + 6px)), calc(var(--pill-y) * (100% + 6px))); }
  #results-profile:has(label:nth-child(3) input:checked) { --pill-x: 0; --pill-y: 1; }
  #results-profile:has(label:nth-child(4) input:checked) { --pill-x: 1; --pill-y: 1; }
  #results-profile span { min-height: 38px; padding-inline: 8px; font-size: 13px; border-radius: 7px; }
  #results-apply-all { width: auto; min-height: 38px; margin-top: 0; }
  .results-summary { padding: 0; }
  .results-totals { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  #results-zip { width: 100%; min-width: 0; }
  .results-scroll { padding-inline: 10px; }
  .results-actions { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px; }
  .results-actions .results-progress { justify-self: start; }
  .results-actions .results-button { padding-inline: 10px; }
  .batch-sidebar-head.workspace-header { padding-left: 12px; }
}
@media (max-width: 480px) {
  .result-actions > div { display: flex; flex-wrap: wrap; gap: 6px; }
  .result-actions .results-button { flex: 1 1 calc(50% - 6px); min-width: 80px; font-size: 12px; }
}
@media (max-width: 650px) {
  .batch-controls { flex-wrap: wrap; gap: 4px; padding-block: 4px; }
  .batch-controls button { white-space: nowrap; }
  .batch-main { grid-template-rows: 52px minmax(0, 1fr) 166px; }
  .batch-workbench.single-image .batch-main { grid-template-rows: 52px minmax(0, 1fr); }
  .batch-workbench.tray-collapsed:not(.single-image) .batch-main { grid-template-rows: 52px minmax(0, 1fr) 76px; }
}

/* 减少透明度和高对比偏好使用实色。 */
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .results-page, .batch-workbench { --workspace-glass: #edf4f6; --content-surface: #f5f9fb; --editor-control: #e1eaee; --table-header: #edf4f6; --edge: #617c88; }
  .results-header .results-home, .results-header .results-home:hover:not(:disabled) { background: #104852; color: #effff9; }
  .results-table thead { -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
  .glass-surface::after, .batch-controls > div::after, .results-table thead {
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
}
/* 减少透明度或高对比时抽屉回到实色海盐白。 */
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  #row-editor { --panel: #eff7f8; --editor-control: #e1edf0; --editor-selected: #dceff0; --edge: #617c88; }
  #row-editor::after { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (forced-colors: active) {
  #results-zip { --action: ButtonFace; --action-hover: ButtonFace; --on-action: ButtonText; border-color: ButtonText; box-shadow: none; }
  .results-progress { --progress-color: LinkText; }
  .result-change, .result-saving.is-increased .result-change, .result-saving.is-unchanged .result-change { background: Canvas; color: CanvasText; border: 1px solid CanvasText; }
  #row-editor { --panel: Canvas; --secondary: CanvasText; --editor-control: Canvas; --action: LinkText; --action-hover: LinkText; --editor-selected: Highlight; --editor-selected-ink: HighlightText; border-color: ButtonText; }
  #row-result-change[data-tone] { color: CanvasText; background: Canvas; border: 1px solid CanvasText; }
  #row-editor #row-format input:checked + span { background: Highlight; color: HighlightText; forced-color-adjust: none; }
  .results-page, .batch-workbench, .batch-confirm { --text: CanvasText; --secondary: CanvasText; --action: LinkText; --action-ink: LinkText; --edge: ButtonText; --workspace-glass: Canvas; --content-surface: Canvas; --panel: Canvas; --editor-control: Canvas; }
  #profile-options .batch-choice:has(input:checked), .batch-segments .batch-choice:has(input:checked), .row-segments input:checked + span, #row-editor #row-profile input:checked + span { forced-color-adjust: none; background: Highlight; color: HighlightText; border-color: Highlight; }
}

/* 首页上传卡片底部：精简为单行「格式 + 档位」分段条；手动质量以独立浮层展示，不改变卡片高度。 */
.intro .upload-zone { min-height: 336px; padding: 28px 20px 24px; }
.intro-defaults { position: relative; margin-top: 10px; padding: 0; }
.intro-defaults-bar { display: grid; grid-template-columns: 98px minmax(0, 1fr); align-items: center; gap: 8px; }
.intro-setting-format, .intro-profile-field { margin: 0; padding: 0; border: 0; min-width: 0; }
.intro-setting-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
#intro-format {
  appearance: none; -webkit-appearance: none;
  height: 36px; width: 100%; padding: 0 30px 0 12px;
  border: 1px solid #ccfff138; border-radius: 10px;
  color: #effff9;
  background: #05283159 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23c8f3e0' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 12px 12px;
  font: inherit; font-size: 12.5px; font-weight: 550; cursor: pointer;
}
#intro-format option { background: #0b3d47; color: #effff9; }
#intro-format:hover {
  border-color: #c8f3e080;
  background-color: #06313c78;
}
#intro-format:focus-visible { outline: 2px solid #c8f3e0; outline-offset: 2px; }
@supports (appearance: base-select) {
  #intro-format, #intro-format::picker(select) { appearance: base-select; }
  #intro-format { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 30px 0 12px; }
  #intro-format:open { outline: none; border-color: #c8f3e099; background-color: #083b4799; box-shadow: 0 0 0 3px #c8f3e024; }
  #intro-format::picker-icon { display: none; }
  #intro-format::picker(select) {
    min-width: 132px; padding: 5px; margin-block-start: 6px;
    border: 1px solid #d7fff44d; border-radius: 12px;
    background: #093842f2; color: #effff9; font: inherit; font-size: 13px;
    box-shadow: 0 14px 32px #001f2959, inset 0 1px #ffffff24;
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  }
  #intro-format option { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 6px 10px; border-radius: 8px; background: transparent; color: #d6f3ec; }
  #intro-format option:checked { background: #c8f3e026; color: #effff9; font-weight: 600; }
  #intro-format option:is(:hover, :focus) { background: #c8f3e038; color: #fff; outline: none; }
  #intro-format option::checkmark { order: 1; margin-left: auto; color: #c8f3e0; }
}
#intro-profile { position: relative; --pill-x: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); height: 36px; padding: 3px; gap: 2px; background: #05283159; border: 1px solid #ccfff133; border-radius: 10px; }
#intro-profile label { position: relative; display: flex; min-width: 0; cursor: pointer; }
#intro-profile span { width: 100%; min-height: 28px; display: grid; place-items: center; padding: 2px 6px; font-size: 12.5px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #d6f3ec; }
#intro-profile label:hover span { background: #ffffff1a; color: #fff; }
#intro-profile::before { box-sizing: border-box; content: ""; position: absolute; pointer-events: none; left: 3px; top: 3px; width: calc((100% - 12px) / 4); height: calc(100% - 6px); border-radius: 7px; background: #c8f3e0; box-shadow: 0 2px 6px #001b2433; transform: translate(calc(var(--pill-x) * (100% + 2px)), 0); }
#intro-profile:not(:has(input:checked))::before { opacity: 0; }
#intro-profile:has(label:nth-child(2) input:checked) { --pill-x: 1; }
#intro-profile:has(label:nth-child(3) input:checked) { --pill-x: 2; }
#intro-profile:has(label:nth-child(4) input:checked) { --pill-x: 3; }
#intro-profile input:checked + span { background: transparent; border-color: transparent; color: #0d3d38; font-weight: 650; box-shadow: none; }
#intro-profile input:focus-visible + span { outline: 2px solid #ecfff5; outline-offset: 2px; }
.intro-manual { position: absolute; left: 0; right: 0; top: calc(100% + 14px); z-index: 4; padding: 8px 14px; border-radius: 14px; background: linear-gradient(140deg, #1b4f54e6, #073540eb); border: 1px solid #d7fff445; box-shadow: 0 14px 36px #00232e47, inset 0 1px 0 #ffffff24; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); opacity: 1; visibility: visible; transform: translateY(0); }
/* 仅在用户主动切换档位时启用滑块与浮层动效，页面刷新或恢复预设时直接就位。 */
.intro-defaults.is-animated #intro-profile span { transition: color .15s ease, background-color .15s ease; }
.intro-defaults.is-animated #intro-profile::before { transition: transform .32s cubic-bezier(.22, 1, .36, 1); }
.intro-defaults.is-animated .intro-manual { transition: opacity .18s ease, transform .18s ease, visibility .18s; }
@media (prefers-reduced-motion: reduce) {
  .intro-defaults.is-animated #intro-profile::before,
  .intro-defaults.is-animated .intro-manual { transition: none; }
}
#intro-manual.hidden { display: block !important; opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-4px); }
.intro-quality-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.intro-manual-label { font-size: 12px; font-weight: 500; color: #d6f3ec; white-space: nowrap; }
.intro-quality-controls { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; height: 30px; color: #d6f3ec; font-size: 12px; }
#intro-quality-range { flex: 1; min-width: 56px; accent-color: #c8f3e0; cursor: pointer; }
#intro-quality { width: 54px; padding: 4px 6px; border: 1px solid #ccfff145; border-radius: 7px; background: #04212980; color: #effff9; font: inherit; font-size: 12.5px; text-align: center; font-variant-numeric: tabular-nums; }
#intro-quality[aria-invalid="true"] { border-color: #ff9c9c; }
.intro-manual-note { margin: 0; font-size: 11px; line-height: 1.3; color: #b6dfd5; white-space: nowrap; }
#intro-quality-error { color: #ffb3b3; }
#intro-quality-error:empty { display: none; }
.intro-quality-row:has(#intro-quality-error:not(:empty)) #intro-quality-help { display: none; }
@media (max-width: 520px) {
  .intro-defaults-bar { grid-template-columns: 1fr; gap: 8px; }
  #intro-quality-help { display: none; }
}

/* 统一工作台、结果列表与参数下拉框的无箭头圆角细滚动条。 */
:is(.results-scroll, .results-page, .batch-sidebar-scroll, .batch-thumbnails, .batch-confirm, .batch-workbench, #row-editor, .row-quality-list)::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
:is(.results-scroll, .results-page, .batch-sidebar-scroll, .batch-thumbnails, .batch-confirm, .batch-workbench, #row-editor, .row-quality-list)::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}
:is(.results-scroll, .results-page, .batch-sidebar-scroll, .batch-thumbnails, .batch-confirm, .batch-workbench, #row-editor, .row-quality-list)::-webkit-scrollbar-track {
  background: transparent;
  margin-block: 6px;
}
:is(.results-scroll, .results-page, .batch-sidebar-scroll, .batch-thumbnails, .batch-confirm, .batch-workbench, #row-editor, .row-quality-list)::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #193b4933;
}
:is(.results-scroll, .results-page, .batch-sidebar-scroll, .batch-thumbnails, .batch-confirm, .batch-workbench, #row-editor, .row-quality-list)::-webkit-scrollbar-thumb:hover {
  background: #193b4959;
}
@supports not selector(::-webkit-scrollbar) {
  :is(.results-scroll, .results-page, .batch-sidebar-scroll, .batch-thumbnails, .batch-confirm, .batch-workbench, #row-editor, .row-quality-list) {
    scrollbar-width: thin;
    scrollbar-color: var(--edge) transparent;
  }
}
