/* ==========================================================================
   控制台 · 图床可视化增强层（2026-10-08 老板令）
   —— 独立文件交付：**不改 console.js / console.css**（那两个文件由并行会话维护）。
   做三件事：① 行首缩略图 ② 点缩略图开大图灯箱 ③ 拖入/多选快速上传 + 多选批量删除。
   配色一律走 console.css 的 CSS 变量（--panel/--line/--text/--muted/--brand…），
   所以**浅色主题由 theme.css 自动接管**，本文件不重复写一份颜色。
   ========================================================================== */

/* ---------- ① 缩略图列 ---------- */
.imv-th-col { width: 54px; }
.imv-cell { width: 54px; padding: 5px 6px !important; }
.imv-th {
  position: relative; display: block; width: 42px; height: 42px; padding: 0;
  border: 1px solid var(--line-2); border-radius: 7px; background: var(--panel-2);
  cursor: zoom-in; overflow: hidden;
}
.imv-th:hover { border-color: var(--brand); }
.imv-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.imv-th.imv-wait::after,
.imv-th.imv-fail::after {
  content: '…'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--muted-2); font-size: 12px;
}
.imv-th.imv-fail::after { content: '查看'; font-size: 10.5px; }
/* 非图片对象（.txt 测试残留 / 目录占位）：显示类型占位，不请求降采样 */
.imv-th.imv-file::after {
  content: attr(data-ext);
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--muted-2); font-size: 10px; letter-spacing: 0.3px; text-transform: uppercase;
}

/* ---------- ② 灯箱 ---------- */
.imv-lb {
  position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center;
  background: rgba(8, 11, 16, 0.82); padding: 16px;
}
.imv-lb-box {
  display: flex; flex-direction: column; max-width: min(94vw, 1000px); max-height: 92vh; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}
.imv-lb-hd { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.imv-lb-hd .k {
  flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
  color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.imv-lb-bd { flex: 1; min-height: 120px; display: flex; align-items: center; justify-content: center; padding: 14px; background: var(--bg-2); overflow: auto; }
.imv-lb-bd img { display: block; max-width: 100%; max-height: 60vh; border-radius: 6px; }
.imv-lb-bd .imv-lb-msg { color: var(--muted); font-size: 13px; }
.imv-lb-ft { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; border-top: 1px solid var(--line); }
.imv-lb-meta { margin-right: auto; color: var(--muted-2); font-size: 12px; }

/* ---------- ③ 拖入 / 多选上传 + 批量条 ---------- */
.imv-drop { padding: 12px 18px; border-bottom: 1px dashed var(--line); background: var(--bg-2); }
.imv-drop-zone {
  padding: 14px; text-align: center; color: var(--muted); font-size: 13px; cursor: pointer;
  border: 1.5px dashed var(--line-2); border-radius: 10px; transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.imv-drop-zone:hover { border-color: var(--brand); }
.imv-drop.imv-over .imv-drop-zone { border-color: var(--brand); background: rgba(22, 119, 255, 0.08); color: var(--text); }
.imv-drop .b { color: var(--brand-2); font-weight: 600; }
.imv-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.imv-item { display: flex; align-items: center; gap: 9px; font-size: 12.5px; }
.imv-item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, monospace; }
.imv-item .bar { flex: none; width: 116px; height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.imv-item .bar > i { display: block; width: 0; height: 100%; background: var(--brand); border-radius: 999px; transition: width 0.2s; }
.imv-item .st { flex: none; width: 80px; text-align: right; color: var(--muted-2); }
.imv-item.ok .st { color: var(--ok); }
.imv-item.bad .st { color: var(--danger); }
.imv-selbar { display: flex; align-items: center; gap: 10px; padding: 9px 18px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.imv-selbar .n { color: var(--muted); font-size: 13px; }
.imv-tip { color: var(--muted-2); font-size: 12px; }
.imv-check { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; vertical-align: middle; }
.imv-check-col { width: 36px; }
.imv-row-gone { opacity: 0.35; text-decoration: line-through; }

/* ==========================================================================
   第二批（2026-10-08 老板令）：目录（文件夹）可设置 / 安排人审核 / 逐条备注 / 多种查看方式
   仍然是**独立文件 + 零侵入**：不改 console.js、不改 console.css，全部靠
   ① 在他们表格上补列（预览 / 勾选 / 备注）② 用 CSS 把同一份 DOM 转成卡片 / 紧凑视图。
   颜色仍一律走 console.css 的变量（浅色主题由 theme.css 覆盖变量自动接管）。
   ========================================================================== */

/* ---------- 视图切换条（我自己的一条，挂在他们的 tabs 下面） ---------- */
.imv-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 18px; border-bottom: 1px solid var(--line); background: var(--bg-2);
}
.imv-seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.imv-seg button {
  background: transparent; border: 0; border-right: 1px solid var(--line-2);
  color: var(--muted); padding: 5px 11px; font-size: 12.5px; cursor: pointer; font-family: var(--font);
}
.imv-seg button:last-child { border-right: 0; }
.imv-seg button.active { background: var(--brand); color: #fff; font-weight: 600; }
.imv-bar .lbl { color: var(--muted-2); font-size: 12.5px; }
.imv-bar .lbl b { color: var(--text); font-weight: 600; }
.imv-spacer { flex: 1; }

/* ---------- 备注列 ---------- */
.imv-note-cell { width: 210px; vertical-align: middle; }
.imv-note {
  display: block; width: 100%; text-align: left; cursor: pointer; font: inherit;
  background: transparent; border: 1px dashed var(--line-2); border-radius: 7px;
  color: var(--muted); padding: 4px 7px; font-size: 12px; line-height: 1.45;
}
.imv-note:hover { border-color: var(--brand); color: var(--text); }
.imv-note.has { border-style: solid; color: var(--text); }
.imv-note .t { font-weight: 600; }
.imv-note .d { color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imv-note.mini { border: 0; padding: 0; font-size: 11px; color: var(--muted-2); }

/* 审核/备注角标（文字上色 + currentColor 描边，浅深两色都成立） */
.imv-badge {
  display: inline-flex; align-items: center; gap: 3px; border: 1px solid currentColor;
  border-radius: 999px; padding: 0 6px; font-size: 11px; line-height: 17px; margin-right: 4px;
  color: var(--muted); white-space: nowrap;
}
.imv-badge.pending { color: var(--warn); }
.imv-badge.approved { color: var(--ok); }
.imv-badge.rejected { color: var(--danger); }
.imv-badge.note { color: var(--brand-2); }
.imv-badge.tag { color: var(--muted); }

/* ---------- 视图②：卡片 ---------- */
.panel[data-imv-view='card'] table.tbl thead { display: none; }
.panel[data-imv-view='card'] table.tbl tbody {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px; padding: 12px 14px;
}
.panel[data-imv-view='card'] table.tbl tbody tr {
  position: relative; display: grid; grid-template-columns: 104px 1fr; gap: 3px 10px;
  grid-template-areas: "thumb key" "thumb size" "thumb time" "note note" "act1 act2";
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  padding: 10px; margin: 0;
}
.panel[data-imv-view='card'] table.tbl tbody tr:hover { background: var(--panel-2); }
.panel[data-imv-view='card'] tbody td { display: block; padding: 0 !important; border: 0 !important; vertical-align: top; }
.panel[data-imv-view='card'] td.imv-check-col { position: absolute; top: 9px; right: 9px; width: auto; z-index: 1; }
.panel[data-imv-view='card'] td.imv-cell:not(.imv-check-col) { grid-area: thumb; }
.panel[data-imv-view='card'] .imv-th { width: 104px; height: 78px; }
.panel[data-imv-view='card'] td.imv-c-key { grid-area: key; }
.panel[data-imv-view='card'] td.imv-c-size { grid-area: size; }
.panel[data-imv-view='card'] td.imv-c-time { grid-area: time; }
.panel[data-imv-view='card'] td.imv-note-cell { grid-area: note; width: auto; margin-top: 6px; }
.panel[data-imv-view='card'] td.imv-c-access { grid-area: act1; margin-top: 8px; }
.panel[data-imv-view='card'] td.imv-c-act { grid-area: act2; margin-top: 8px; text-align: right; }
.panel[data-imv-view='card'] .imv-note { border-style: solid; }
.panel[data-imv-view='card'] .imv-note .d { white-space: normal; }

/* ---------- 视图③：紧凑 ---------- */
.panel[data-imv-view='compact'] tbody td { padding: 3px 8px !important; }
.panel[data-imv-view='compact'] .imv-cell { padding: 3px 5px !important; }
.panel[data-imv-view='compact'] .imv-th { width: 22px; height: 22px; border-radius: 4px; }
.panel[data-imv-view='compact'] .imv-th.imv-file::after { font-size: 7px; letter-spacing: 0; }
.panel[data-imv-view='compact'] td.imv-c-size,
.panel[data-imv-view='compact'] td.imv-c-time { display: none; }
.panel[data-imv-view='compact'] .imv-note-cell { width: 150px; }
.panel[data-imv-view='compact'] .imv-note { padding: 2px 6px; font-size: 11.5px; }


/* ---------- 弹层（备注 / 目录设置 / 审核工作台共用一套壳） ---------- */
.imv-dlg {
  position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center;
  background: rgba(8, 11, 16, 0.68); padding: 16px;
}
.imv-dlg-box {
  display: flex; flex-direction: column; width: min(94vw, 720px); max-height: 90vh;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45); overflow: hidden;
}
.imv-dlg-box.wide { width: min(96vw, 980px); }
.imv-dlg-hd { display: flex; align-items: center; gap: 10px; padding: 11px 15px; border-bottom: 1px solid var(--line); }
.imv-dlg-hd h3 { margin: 0; font-size: 14.5px; color: var(--text); }
.imv-dlg-hd .sub { color: var(--muted-2); font-size: 12px; font-family: ui-monospace, monospace; overflow-wrap: anywhere; }
.imv-dlg-hd .x { margin-left: auto; }
.imv-dlg-bd { padding: 14px 15px; overflow: auto; }
.imv-dlg-ft {
  display: flex; align-items: center; gap: 8px; padding: 11px 15px;
  border-top: 1px solid var(--line); background: var(--bg-2);
}
.imv-dlg-ft .sp { flex: 1; }
.imv-field { margin-bottom: 12px; }
.imv-field > label { display: block; color: var(--muted); font-size: 12.5px; margin-bottom: 5px; }
.imv-field input[type='text'], .imv-field textarea, .imv-field select {
  width: 100%; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 8px;
  color: var(--text); padding: 7px 9px; font-size: 13px; font-family: var(--font);
}
.imv-field textarea { min-height: 68px; resize: vertical; }
.imv-field .tip { color: var(--muted-2); font-size: 11.5px; margin-top: 4px; }
.imv-check-row { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 13px; }
.imv-check-row input { accent-color: var(--brand); width: 15px; height: 15px; }

/* 审核人名单 */
.imv-ppl { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.imv-ppl .row {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 9px; font-size: 12.5px; background: var(--panel-2);
}
.imv-ppl .row .nm { color: var(--text); }
.imv-ppl .row .em { color: var(--muted-2); font-size: 11.5px; }
.imv-ppl .row .sp { flex: 1; }
.imv-ppl .empty { color: var(--muted-2); font-size: 12.5px; }
.imv-cand { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; max-height: 168px; overflow: auto; }
.imv-cand button {
  display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; font-family: var(--font);
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 9px;
  color: var(--text); font-size: 12.5px;
}
.imv-cand button:hover { border-color: var(--brand); }

/* 审核工作台 */
.imv-rev-item {
  display: grid; grid-template-columns: 78px 1fr; gap: 4px 11px; align-items: start;
  border: 1px solid var(--line); border-radius: 10px; padding: 9px; margin-bottom: 9px; background: var(--panel-2);
}
.imv-rev-item .th { grid-row: span 4; }
.imv-rev-item .th .imv-th { width: 78px; height: 62px; }
.imv-rev-item .k { font-family: ui-monospace, monospace; font-size: 12px; color: var(--text); overflow-wrap: anywhere; }
.imv-rev-item .m { color: var(--muted-2); font-size: 11.5px; }
.imv-rev-item .n { color: var(--muted); font-size: 12px; }
.imv-rev-item .btns { display: flex; gap: 7px; align-items: center; margin-top: 7px; flex-wrap: wrap; }
.imv-rev-item .why { color: var(--danger); font-size: 11.5px; }
.imv-rev-tabs { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.imv-rev-tabs button {
  background: transparent; border: 1px solid var(--line-2); border-radius: 999px; color: var(--muted);
  padding: 3px 11px; font-size: 12.5px; cursor: pointer; font-family: var(--font);
}
.imv-rev-tabs button.active { border-color: var(--brand); color: var(--brand-2); font-weight: 600; }
.imv-rev-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--line);
}
.imv-rev-empty { color: var(--muted-2); font-size: 13px; padding: 18px 4px; text-align: center; }

/* 审核员入口（没有 admin 卡的人也能到自己的活） */
.imv-fab { position: fixed; right: 18px; bottom: 18px; z-index: 60; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35); }
.imv-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 95;
  background: var(--panel); border: 1px solid var(--line); border-radius: 9px;
  color: var(--text); padding: 9px 14px; font-size: 13px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}
.imv-toast.err { border-color: var(--danger); color: var(--danger); }



/* ==========================================================================
   图床工具栏里那个原生文件选择框（console.js 的 #imgUpFile）
   问题（2026-10-08 老板指出）：console.css / theme.css 里**没有任何 input[type=file] 规则**，
   所以它一直是浏览器默认样式 —— ::file-selector-button 是「白底 rgb(239,239,239) + 2px 黑边 + 0 圆角 +
   Arial 13.33px」，在深色主题里像贴了张白纸，框高 25px 也和旁边的 .btn-sm（高 30）不齐。
   这里只补样式、不动他们的 HTML/JS：按 .btn-sm 的度量把它整成同款，颜色全走变量（浅色自动接管）。
   ========================================================================== */
#imgUpFile {
  appearance: none; -webkit-appearance: none;
  display: inline-flex; align-items: center; vertical-align: middle;
  max-width: 260px; height: 30px; padding: 0 8px;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 7px;
  color: var(--text); font: 12.5px var(--font); cursor: pointer;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  transition: border-color 0.15s, background 0.15s;
}
#imgUpFile:hover { border-color: var(--brand); }
#imgUpFile:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
#imgUpFile::file-selector-button {
  appearance: none; -webkit-appearance: none;
  margin: 0 8px 0 0; padding: 3px 10px; border: 0; border-radius: 6px;
  background: var(--brand); color: #fff; font: 600 12.5px var(--font); cursor: pointer;
  transition: background 0.15s;
}
#imgUpFile::file-selector-button:hover { background: var(--brand-2); }
/* 窄屏别把工具条撑破 */
@media (max-width: 700px) { #imgUpFile { max-width: 190px; } }
