/* 文件及媒体预览共用工具箱卡片，结果与原始内容并排显示，窄屏自动堆叠。 */
.tool-fields { align-items: center; }
.tool-fields label, .tool-field-input { gap: 8px; font-size: 14px; color: #475b77; }
.tool-fields label { display: inline-flex; align-items: center; flex-wrap: wrap; }
.tool-fields .tool-field-input { flex: 1 0 min(24rem, 100%); min-width: 0; }
.tool-fields input:not([type="checkbox"], [type="range"]) {
  min-width: 0; padding: 8px 10px; border: 1px solid #dfe5ee;
  border-radius: 6px; font: 15px/1.5 var(--mono); color: #344762;
}
.tool-field-input input { flex: 1 0 min(13rem, 100%); }
.tool-fields input[type="number"] { width: 7rem; }
.tool-range input { accent-color: var(--blue); width: 100px; }
.tool-range output { min-width: 3ch; }
.media-drop {
  display: grid; gap: 10px; margin: 18px 20px; padding: 18px; color: #43556f;
  border: 1px dashed #a9bce1; border-radius: 8px; background: #f6f9ff; font-size: 15px;
}
.media-drop input { max-width: 100%; }
.media-drop input::file-selector-button {
  background: white; color: #365b9b; border: 1px solid #cbd7eb; border-radius: 5px; padding: 7px 10px;
}
.media-tool-page [hidden] { display: none !important; }
.media-tool-page progress { margin: 10px 20px; width: calc(100% - 40px); accent-color: var(--blue); }
.media-panels { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%, 19rem),1fr)); }
.media-panel { min-width: 0; margin: 0; border-bottom: 1px solid #e9edf4; }
.media-panel figcaption {
  display: grid; gap: 4px; padding: 15px 20px; font-weight: 600; color: #405571;
}
.media-panel figcaption span { font-weight: 400; overflow-wrap: anywhere; color: #52647d; }
.media-preview {
  display: flex; justify-content: center; align-items: center; min-height: 12rem;
  background: repeating-conic-gradient(#f0f3f8 0% 25%,white 0% 50%) 50%/18px 18px;
}
.media-preview img, .media-preview video { display: block; max-width: 100%; max-height: 28rem; }
.media-preview video { width: 100%; background: #192438; }
.media-image-box { position: relative; max-width: 100%; overflow: hidden; }
.media-crop { position: absolute; pointer-events: none; box-shadow: 0 0 0 2000px #1c263680; border: 2px solid white; }
.media-fields { display: grid; grid-template-columns: minmax(5rem,auto) 1fr; gap: 9px 16px; padding: 16px 20px; margin: 0; }
.media-fields dt { color: #405571; }
.media-fields dd { margin: 0; overflow-wrap: anywhere; }
#hash-output { height: 84px; min-height: 84px; }
#hash-text { height: 205px; }
@media (max-width: 640px) {
  .media-drop { margin: 14px; padding: 14px; }
  .media-panel figcaption { padding: 12px 14px; }
}
