/* ============================================================
 * 全站上传组件样式（2026-10-09 九项反馈第 2 条），配合 public/js/upload.js
 *   .fu        自动接管的文件框：虚线拖拽区 + 文件卡片 + 红字错误
 *   .fu-line   紧凑单行上传条（Core.uploader，卡片底部用）
 * 颜色全部取 app.css 的变量（--brand / --border / --red …），和全站一致。
 * ============================================================ */

/* 原生文件框：留在 DOM 里（表单字段、页面读 files 都不变），视觉隐藏；
 * 要压过 .field input { width:100%; padding; border } 和页面写的行内 style，所以用 !important */
.fu-native {
  position: absolute !important; width: 1px !important; height: 1px !important; min-width: 0 !important;
  padding: 0 !important; margin: -1px !important; border: 0 !important; overflow: hidden !important;
  clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important; opacity: 0 !important; white-space: nowrap; pointer-events: none;
}

/* ---------- 上传区 ---------- */
.fu { position: relative; display: flex; flex-direction: column; gap: 6px; width: 100%; min-width: 0; }
.fu-zone {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 64px;
  border: 1.5px dashed #cbd5e1; border-radius: 10px; background: #fff; cursor: pointer; outline: none;
  transition: border-color .15s, background-color .15s, box-shadow .15s; user-select: none; -webkit-user-select: none;
}
.fu-zone:hover, .fu.fu-drag .fu-zone { border-color: var(--brand); background: var(--blue-bg); }
.fu-zone:focus-visible { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }
.fu.fu-drag .fu-zone { border-style: solid; }
.fu-ico {
  flex: none; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--blue-bg); color: var(--brand); transition: background-color .15s;
}
.fu-ico svg { width: 18px; height: 18px; }
.fu-zone:hover .fu-ico, .fu.fu-drag .fu-ico { background: #fff; }
.fu-tx { display: flex; flex-direction: column; min-width: 0; line-height: 1.45; }
.fu-t1 { font-size: 13px; color: var(--text); }
.fu-t1 b { color: var(--brand); font-weight: 600; }
.fu-t2 { font-size: 12px; color: var(--text-3); }
/* 单选且已选中文件：上传区收成一行，突出下面的文件卡片 */
.fu.fu-has:not(.fu-multi) .fu-zone { padding: 7px 12px; min-height: 0; }
.fu.fu-has:not(.fu-multi) .fu-ico { width: 26px; height: 26px; }
.fu.fu-has:not(.fu-multi) .fu-ico svg { width: 14px; height: 14px; }
.fu.fu-has:not(.fu-multi) .fu-t2 { display: none; }
.fu.fu-dis .fu-zone { cursor: not-allowed; opacity: .55; background: var(--bg); border-color: var(--border); }
.fu.fu-dis .fu-zone:hover { border-color: var(--border); background: var(--bg); }
/* Core.fileZone().upload() 传的途中：上传区暂不能选 / 拖文件 */
.fu.fu-busy .fu-zone { cursor: progress; opacity: .7; }
.fu.fu-busy .fu-zone:hover { border-color: #cbd5e1; background: #fff; }
.fu-cur { font-size: 12px; color: var(--text-2); overflow-wrap: anywhere; }

/* ---------- 文件卡片（40px 高，底部 2px 进度条） ---------- */
/* container-type：卡片窄时（两栏表单里约 250px）收起「待上传」字样，把位置留给文件名 */
.fu-list { display: flex; flex-direction: column; gap: 6px; min-width: 0; container-type: inline-size; }
@container (max-width: 300px) { .fu-card .fu-st.pend { display: none; } }
.fu-list:empty { display: none; }
.fu-card {
  position: relative; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 6px 0 7px; min-width: 0;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; overflow: hidden;
}
.fu-card.bad { border-color: #fecaca; background: var(--red-bg); }
.fu-fi {
  flex: none; width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; font-style: normal; color: #fff; letter-spacing: .2px; background: #94a3b8;
}
.fu-fi.pdf { background: #dc2626; }
.fu-fi.word { background: #2563eb; }
.fu-fi.excel { background: #16a34a; }
.fu-fi.ppt { background: #ea580c; }
.fu-fi.img { background: #7c3aed; }
.fu-fi.zip { background: #a16207; }
.fu-fi.txt { background: #64748b; }
.fu-thumb { flex: none; width: 28px; height: 28px; border-radius: 6px; object-fit: cover; border: 1px solid var(--border); background: var(--bg); }
/* 文件名中间省略：首字 .fu-nm-h 与末尾 .fu-nm-b 始终显示，只有中段 .fu-nm-a 放不下时 ellipsis（显示成「张…最终版.pdf」）。
 * 中段不设 min-width：原来的 min-width:1.6em 把「small.pdf」这类短名字的中段撑宽，出现「s   mall.pdf」的空隙。
 * white-space:pre：拆段处正好是空格时（「Hello abcd.pdf」）空格不会被 flex 项吞掉。
 * width:0 + flex-basis 0：长文件名不计入最小宽度，否则放在 .form-grid 两栏里会把整栏撑宽（实测招聘弹窗被撑歪） */
.fu-nm { flex: 1 1 0; width: 0; min-width: 0; display: flex; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; }
.fu-nm > span { white-space: pre; }
.fu-nm-h { flex: none; }
.fu-nm-a { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.fu-nm-b { flex: none; }
.fu-sz { flex: none; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.fu-st { flex: none; font-size: 12px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fu-card.up .fu-st, .fu-chip.up .fu-st { color: var(--brand); }
.fu-card.ok .fu-st, .fu-chip.ok .fu-st { color: var(--green); }
.fu-card.fail .fu-st, .fu-card.bad .fu-st, .fu-chip.bad .fu-st { color: var(--red); }
.fu-card.bad .fu-st { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.fu-retry { flex: none; font-size: 12px; color: var(--brand); cursor: pointer; white-space: nowrap; }
.fu-retry:hover { text-decoration: underline; }
.fu-x {
  flex: none; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: transparent;
  color: var(--text-3); font-size: 17px; line-height: 1; cursor: pointer; font-family: inherit;
}
.fu-x:hover { background: var(--red-bg); color: var(--red); }
.fu-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--brand); transition: width .2s; font-style: normal; pointer-events: none; }
.fu-card.ok .fu-bar, .fu-chip.ok .fu-bar { background: var(--green); }
.fu-card.fail .fu-bar, .fu-chip.fail .fu-bar, .fu-chip.bad .fu-bar { background: var(--red); }
.fu-card.pending .fu-bar, .fu-card.bad .fu-bar { width: 0 !important; }

/* 错误：12px 红字 */
.fu-err { font-size: 12px; color: var(--red); line-height: 1.5; overflow-wrap: anywhere; }

/* ---------- 紧凑单行上传条（卡片底部） ---------- */
/* position: relative —— 里面的隐藏文件框（.fu-native，绝对定位）以这一行为参照，不再跑到主区滚动容器外面把整页撑高
 * （否则 scrollIntoView / 浏览器查找会把整页连侧边栏、顶栏一起推上去，body 不能滚，用户拉不回来）。评审 mike-6 */
.fu-line { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; border-radius: 8px; transition: background-color .15s; }
.fu-line.fu-drag { outline: 1.5px dashed var(--brand); outline-offset: 3px; background: var(--blue-bg); }
.fu-line-btn { flex: none; }
.fu-line-hint { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.fu-chips { display: contents; }
.fu-chip {
  position: relative; display: inline-flex; align-items: center; gap: 6px; max-width: 260px; height: 26px; padding: 0 3px 0 5px; min-width: 0;
  border: 1px solid var(--border); border-radius: 6px; background: #fff; font-size: 12px; overflow: hidden;
}
.fu-chip.fail, .fu-chip.bad { border-color: #fecaca; background: var(--red-bg); }
.fu-chip .fu-fi, .fu-chip .fu-thumb { width: 18px; height: 18px; border-radius: 4px; font-size: 8px; }
.fu-chip .fu-nm { flex: 0 1 auto; width: auto; font-size: 12px; max-width: 150px; }
.fu-chip .fu-x { width: 18px; height: 18px; font-size: 14px; border-radius: 4px; }
