/* =========================================================================
   内页共享样式：统计卡片、筛选栏、物料列表、分页、详情页等
   ========================================================================= */

/* ---------- 统计卡片 ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat-card {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.stat-label { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.stat-value {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}
.stat-value.is-warn { color: var(--warn); }
.stat-value.is-ok { color: var(--ok); }
.stat-value.is-muted { color: var(--text-2); }
.stat-sub { margin-top: 2px; font-size: 11.5px; color: var(--text-3); }
.stat-sub a { color: var(--text-3); text-decoration: underline; }
.stat-sub a:hover { color: var(--brand); }

/* ---------- 筛选栏 ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.filter-bar .input-search { flex: 1 1 260px; min-width: 220px; max-width: 420px; }
.filter-bar .select { width: auto; min-width: 118px; }
.filter-spacer { flex: 1; }
.filter-count { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }

.legend { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: 12px; color: var(--text-3); }

/* ---------- 物料列表单元 ---------- */
.mat-cell { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.mat-thumb {
  width: 46px;
  height: 38px;
  flex: none;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-2);
}
.mat-name { font-weight: 600; line-height: 1.35; color: var(--text); }
.mat-model { font-family: var(--mono); font-size: 11.5px; color: var(--text-2); line-height: 1.35; }
.mat-sub { font-size: 11.5px; color: var(--text-3); line-height: 1.35; }

.qty { font-family: var(--mono); font-size: 15px; font-weight: 700; color: var(--text); }
.qty.is-zero { color: var(--text-3); }
.qty-unit { margin-left: 1px; font-size: 11px; color: var(--text-3); }
.cell-stock { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; min-width: 132px; }

.cell-loc { font-size: 12.5px; line-height: 1.4; }
.cell-loc .loc-main { color: var(--text); }
.cell-loc .loc-sub { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); }

.cell-text { font-size: 12.5px; color: var(--text-2); line-height: 1.4; }
.cell-mono { font-family: var(--mono); font-size: 12px; color: var(--text-2); white-space: nowrap; }

.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; white-space: nowrap; }
.row-actions .btn-link { font-size: 12.5px; }
.row-actions .is-disabled { color: var(--text-3); cursor: not-allowed; text-decoration: none; }

/* ---------- 列表底部 / 分页 ---------- */
.list-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-2);
}
.pager { display: flex; gap: 6px; align-items: center; }

/* ---------- 空状态 / 提示 ---------- */
.empty > svg {
  display: block;
  width: 40px;
  height: 40px;
  margin: 0 auto 12px;
  color: var(--text-3);
}

/* ---------- 表格卡片底部 ---------- */
.card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-2);
}
.warn-qty { font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--warn); }
.warn-qty.is-zero { color: var(--danger); }
.warn-threshold { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); }

/* ---------- 通用小工具 ---------- */
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.inline-tags { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.text-danger { color: var(--danger); }
.text-warn { color: var(--warn); }
.text-ok { color: var(--ok); }

/* =========================================================================
   活力色块主题（内页：物料总览 / 库存预警 / 后续详情与表单）
   说明：仅追加颜色、色块、hover 与隔行底色，不改布局
   ========================================================================= */

/* 顶部统计卡片：四色色块轮转 */
.stat-card { box-shadow: none; }
.stat-grid .stat-card:nth-child(4n+1) { background: var(--block-sky); border-color: transparent; }
.stat-grid .stat-card:nth-child(4n+2) { background: var(--block-mint); border-color: transparent; }
.stat-grid .stat-card:nth-child(4n+3) { background: var(--block-lemon); border-color: transparent; }
.stat-grid .stat-card:nth-child(4n+4) { background: var(--block-lilac); border-color: transparent; }
.stat-label { color: var(--text-2); }
.stat-sub { color: #5d6a75; }
.stat-value.is-warn { color: #8a5f13; }

/* 筛选区：暖色块 */
.filter-bar { background: var(--surface-2); border-bottom-color: var(--border); }
.filter-bar .input, .filter-bar .select { background: #fffdf7; }
.filter-count { color: var(--text-2); }

/* 列表单元 */
.mat-thumb { background: #fffdf7; border-color: var(--border); }
.mat-model { color: #5d6a75; }
.mat-sub { color: #7d8a95; }
.cell-text { color: var(--text-2); }
.cell-loc .loc-sub { color: #7d8a95; }

/* 列表底部 / 卡片底部：暖色块 */
.list-foot { background: var(--surface-2); border-top-color: var(--border); }
.card-foot { background: var(--surface-2); border-top-color: var(--border); }

/* 空状态图标 */
.empty > svg { color: #c0ad8f; }

/* =========================================================================
   物料总览微调（数字放大 / 名称链接）+ 物料详情页
   说明：仅样式与视觉增强，不改动布局结构与字段
   ========================================================================= */

/* 1) 统计卡片：突出数字 */
.stat-grid .stat-label { font-size: 12.5px; font-weight: 600; color: #46555f; }
.stat-grid .stat-value {
  margin-top: 3px;
  font-size: 40px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -1px;
  color: var(--text);
}
.stat-grid .stat-value.is-ok { color: #1f7a5c; }
.stat-grid .stat-value.is-warn { color: #8a5f13; }
.stat-grid .stat-value.is-muted { color: #4f5d68; }
.stat-grid .stat-sub { margin-top: 6px; color: #5d6a75; }
@media (max-width: 1100px) {
  .stat-grid .stat-value { font-size: 34px; }
}

/* 2) 物料名称：可点击链接 */
.mat-name a { color: var(--text); text-decoration: none; }
.mat-name a:hover { color: var(--brand); text-decoration: underline; }

/* 3) 物料详情页 */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
  font-size: 12.5px;
  color: var(--text-2);
  text-decoration: none;
}
.back-link:hover { color: var(--brand); text-decoration: none; }
.detail-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.detail-title-row .page-title { font-size: 22px; }

.detail-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
  align-items: start;
}
.detail-media-card { background: var(--block-sky); border-color: transparent; }
.detail-media-card .card-bd { padding: 16px; }
.detail-media {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 220px;
  padding: 14px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(38, 49, 59, .06);
  border-radius: 10px;
}
.detail-media img { max-width: 100%; max-height: 100%; object-fit: contain; }
.detail-media-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 12px;
  font-size: 11.5px;
  line-height: 1.5;
  color: #5d6a75;
}
.detail-media-meta .mono { font-size: 12px; color: var(--text-2); }

.detail-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.detail-stat { padding: 12px 14px; border-radius: 10px; background: var(--block-mint); }
.detail-stat:nth-child(2) { background: var(--block-lemon); }
.detail-stat:nth-child(3) { background: var(--block-sky); }
.detail-stat:nth-child(4) { background: var(--block-lilac); }
.detail-stat-label { font-size: 11.5px; color: #4f5d68; }
.detail-stat-value {
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
}
.detail-stat-value small {
  margin-left: 2px;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 400;
  color: #5d6a75;
}

.detail-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; margin: 0; }
.detail-list .detail-item { min-width: 0; }
.detail-list .is-full { grid-column: 1 / -1; }
.detail-list dt { margin: 0 0 2px; font-size: 11.5px; color: #7d8a95; }
.detail-list dd { margin: 0; font-size: 13px; line-height: 1.55; color: var(--text); word-break: break-word; }
.detail-list dd.mono { font-family: var(--mono); font-size: 12.5px; }

.detail-warning {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--block-lemon);
  border: 1px solid transparent;
}
.detail-warning.is-ok { background: var(--block-mint); }
.detail-warning.is-empty { background: var(--block-rose); }
.detail-warning-main { display: flex; align-items: center; gap: 12px; }
.detail-warning-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 9px;
  background: rgba(255, 255, 255, .7);
  color: #8a5f13;
}
.detail-warning.is-ok .detail-warning-icon { color: #1f7a5c; }
.detail-warning.is-empty .detail-warning-icon { color: #a03831; }
.detail-warning-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.detail-warning-desc { margin-top: 2px; font-size: 12px; color: #5d6a75; }
.detail-warning-values { display: flex; gap: 18px; flex-wrap: wrap; }
.detail-warn-item { min-width: 44px; text-align: center; }
.detail-warn-item .v { font-family: var(--mono); font-size: 20px; font-weight: 800; line-height: 1.1; color: var(--text); }
.detail-warn-item .k { margin-top: 2px; font-size: 11px; color: #5d6a75; }

.detail-history .table th, .detail-history .table td { padding: 10px 14px; }
.detail-empty-row { padding: 28px 16px; text-align: center; color: var(--text-2); font-size: 12.5px; }

@media (max-width: 1100px) {
  .detail-grid { grid-template-columns: 1fr; }
  .detail-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .detail-list { grid-template-columns: 1fr; }
  .detail-stats { grid-template-columns: 1fr 1fr; }
}

/* =========================================================================
   新增 / 编辑物料表单
   说明：仅新增表单布局样式，不改动已有页面的结构与功能
   ========================================================================= */

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
}
.form-grid .is-full { grid-column: 1 / -1; }

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}

/* 管理模式选择 */
.mode-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #fffdf7;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color .12s, background-color .12s;
}
.mode-option:hover { border-color: #b9d9cc; background: #fff; }
.mode-option:focus-visible { outline: 2px solid rgba(43, 125, 108, .4); outline-offset: 1px; }
.mode-option[aria-pressed="true"] {
  border-color: var(--brand);
  background: var(--brand-weak);
}
.mode-option .mode-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 9px;
  background: var(--block-mint);
  color: var(--brand);
}
.mode-option .mode-icon.is-blue { background: var(--block-sky); color: var(--precise); }
.mode-option strong { display: block; font-size: 13.5px; }
.mode-option small { display: block; margin-top: 2px; font-size: 11.5px; color: #6b7782; line-height: 1.45; }

/* 简易模式状态选择 */
.choice-picker { display: flex; gap: 8px; }
.choice-option {
  flex: 1;
  height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fffdf7;
  color: var(--text-2);
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color .12s, background-color .12s, color .12s;
}
.choice-option:hover { border-color: #b9d9cc; }
.choice-option:focus-visible { outline: 2px solid rgba(43, 125, 108, .4); outline-offset: 1px; }
.choice-option[aria-pressed="true"] {
  border-color: var(--brand);
  background: var(--brand-weak);
  color: var(--brand-strong);
  font-weight: 600;
}

/* 图片选择 */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px;
}
.image-option {
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fffdf7;
  cursor: pointer;
  transition: border-color .12s, background-color .12s;
}
.image-option:hover { border-color: #b9d9cc; background: #fff; }
.image-option:focus-visible { outline: 2px solid rgba(43, 125, 108, .4); outline-offset: 1px; }
.image-option[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-weak); }
.image-option img { display: block; width: 100%; height: 54px; object-fit: contain; }
.image-option span {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: #6b7782;
  font-size: 11px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 只读输入框（入库时间） */
.input[readonly] {
  background: var(--surface-3);
  color: var(--text-2);
  cursor: not-allowed;
}

/* 校验失败态 */
.field.is-invalid .input,
.field.is-invalid .select,
.field.is-invalid .textarea { border-color: var(--danger); background: #fff7f6; }
.field.is-invalid .label { color: var(--danger); }

@media (max-width: 900px) {
  .form-grid { grid-template-columns: 1fr; }
  .mode-picker { grid-template-columns: 1fr; }
  .form-actions { justify-content: stretch; }
  .form-actions .btn { flex: 1; }
}

/* =========================================================================
   领用登记页
   说明：仅新增本页布局样式，不改动已有页面的结构与功能
   ========================================================================= */

.borrow-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr);
  gap: 16px;
  align-items: start;
}
.borrow-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* 选中物料摘要 */
.borrow-material-head { display: flex; align-items: center; gap: 12px; }
.borrow-material-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 66px;
  height: 54px;
  flex: none;
  padding: 6px;
  background: #fffdf7;
  border: 1px solid var(--border);
  border-radius: 9px;
}
.borrow-material-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.borrow-material-name { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.35; }
.borrow-material-meta { margin-top: 2px; font-size: 11.5px; color: #6b7782; }
.borrow-material-list { grid-template-columns: 1fr 1fr; margin-top: 14px; }

.borrow-empty { padding: 28px 12px; text-align: center; color: var(--text-2); font-size: 12.5px; }

/* 最近领用动态 */
.borrow-recent { display: flex; flex-direction: column; gap: 12px; }
.borrow-recent-item { display: flex; gap: 8px; font-size: 12px; line-height: 1.5; }
.borrow-recent-dot { width: 6px; height: 6px; flex: none; margin-top: 5px; border-radius: 50%; background: var(--brand); }
.borrow-recent-main { color: var(--text); font-weight: 500; }
.borrow-recent-sub { margin-top: 1px; font-size: 11.5px; color: #6b7782; }

/* 登记说明 */
.borrow-tips { margin: 0; padding-left: 16px; font-size: 12px; line-height: 1.9; color: var(--text-2); }

@media (max-width: 1000px) {
  .borrow-grid { grid-template-columns: 1fr; }
}

/* =========================================================================
   批量领用 / 物料使用车
   说明：仅新增弹窗、数量选择、悬浮使用车与批量清单样式
   ========================================================================= */

/* 领用数量弹窗 */
.modal.modal-borrow { width: min(430px, calc(100vw - 40px)); }
.borrow-pick-name { font-size: 16px; font-weight: 700; line-height: 1.4; color: var(--text); }
.borrow-pick-meta { margin-top: 3px; font-family: var(--mono); font-size: 11.5px; color: #6b7782; }
.borrow-pick-tags { display: flex; gap: 8px; margin-top: 10px; }
.borrow-pick-stock {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--block-lemon);
  font-size: 12.5px;
  color: #5d6a75;
}
.borrow-pick-stock strong { font-family: var(--mono); font-size: 15px; color: var(--text); }

.qty-picker { display: flex; align-items: center; gap: 8px; }
.qty-btn {
  width: 34px;
  height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fffdf7;
  color: var(--text-2);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.qty-btn:hover { background: var(--block-mint); border-color: #b9d9cc; color: var(--text); }
.qty-btn:disabled { opacity: .45; cursor: not-allowed; }
.qty-btn:focus-visible { outline: 2px solid rgba(43, 125, 108, .4); outline-offset: 1px; }
.qty-input { width: 86px; text-align: center; font-family: var(--mono); font-size: 15px; font-weight: 700; }

/* 悬浮物料使用车 */
.cart-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 800;
  display: flex;
  flex-direction: column;
  width: 320px;
  max-height: 62vh;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(38, 49, 59, .16);
}
.cart-panel[hidden] { display: none !important; }
.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: var(--block-mint);
  border-bottom: 1px solid var(--border);
}
.cart-title { display: flex; align-items: center; font-size: 13.5px; font-weight: 700; color: var(--text); }
.cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
}
.cart-clear { border: 0; background: transparent; padding: 0; color: var(--text-2); font-size: 12px; cursor: pointer; }
.cart-clear:hover { color: var(--danger); text-decoration: underline; }
.cart-list { flex: 1; overflow-y: auto; padding: 4px 14px; }
.cart-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed rgba(38, 49, 59, .12); }
.cart-item:last-child { border-bottom: 0; }
.cart-item-main { flex: 1; min-width: 0; }
.cart-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}
.cart-item-meta {
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: #6b7782;
}
.cart-item-side { display: flex; align-items: center; gap: 6px; flex: none; }
.cart-qty { font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--brand); }
.cart-item-remove {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-3);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.cart-item-remove:hover { background: var(--block-rose); color: var(--danger); }
.cart-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.cart-total { font-size: 11.5px; color: var(--text-2); }

/* 批量领用清单 */
.batch-list { display: flex; flex-direction: column; gap: 8px; }
.batch-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fffdf7;
}
.batch-item.is-invalid { border-color: var(--danger); background: #fff7f6; }
.batch-item-main { flex: 1; min-width: 0; }
.batch-item-name { font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--text); }
.batch-item-meta { margin-top: 2px; font-size: 11.5px; color: #6b7782; }
.batch-item-side { display: flex; align-items: center; gap: 8px; flex: none; }
.batch-qty { font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--brand); }
.batch-item-remove {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-3);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.batch-item-remove:hover { background: var(--block-rose); color: var(--danger); }

@media (max-width: 900px) {
  .cart-panel { left: 16px; right: 16px; bottom: 16px; width: auto; max-height: 50vh; }
}

/* =========================================================================
   领用弹窗排版优化 / 使用车拖动与数量编辑
   说明：仅样式覆盖，不改功能逻辑
   ========================================================================= */

/* 弹窗整体宽度与分区间距 */
.modal.modal-borrow { width: min(468px, calc(100vw - 40px)); }
.borrow-pick-body { display: flex; flex-direction: column; gap: 16px; }
.borrow-pick-head { display: flex; flex-direction: column; gap: 2px; }
.borrow-pick-name { font-size: 17px; line-height: 1.4; }
.borrow-pick-meta { margin-top: 0; }
.borrow-pick-tags { margin-top: 4px; }

/* 库存信息：三等分信息块 */
.borrow-pick-stock {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(38, 49, 59, .08);
}
.borrow-pick-stock-item { padding: 10px 12px; background: var(--block-lemon); }
.borrow-pick-stock-item .k { display: block; font-size: 11px; line-height: 1.3; color: #6b7782; }
.borrow-pick-stock-item .v {
  display: block;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text);
}
.borrow-pick-stock-item .v small {
  margin-left: 2px;
  font-family: var(--font);
  font-size: 10.5px;
  font-weight: 400;
  color: #6b7782;
}
.borrow-pick-stock-item .v.is-text {
  padding-top: 3px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
}

/* 数量区域：标题行 + 左右对称步进器 */
.borrow-qty-block {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}
.borrow-qty-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.borrow-qty-limit { font-size: 11.5px; color: #6b7782; }
.qty-picker {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 46px;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.qty-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 42px;
  padding: 0;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
}
.qty-input {
  width: 100%;
  height: 42px;
  padding: 0 8px;
  border-radius: 8px;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
}
.borrow-qty-block .field-hint { display: block; margin-top: 8px; text-align: center; }

/* ---------- 使用车：拖动 ---------- */
.cart-head { cursor: grab; user-select: none; }
.cart-panel.is-dragging { box-shadow: 0 16px 40px rgba(38, 49, 59, .22); user-select: none; }
.cart-panel.is-dragging .cart-head { cursor: grabbing; }

/* ---------- 使用车：数量就地编辑 ---------- */
.cart-qty { padding: 2px 5px; border-radius: 5px; cursor: text; }
.cart-qty:hover { background: rgba(43, 125, 108, .14); }
.cart-qty-input {
  width: 56px;
  height: 24px;
  padding: 0 4px;
  border: 1px solid var(--brand);
  border-radius: 6px;
  background: #fffdf7;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  outline: none;
}
.cart-qty-input:focus { box-shadow: none; outline: 2px solid rgba(43, 125, 108, .22); }

/* =========================================================================
   物料使用车拖拽缩放 / 内部滚动 / 尺寸自适应
   ========================================================================= */

/* 内部滚动：超出可视范围时列表滚动，头尾固定 */
.cart-head { flex: none; }
.cart-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.cart-foot { flex: none; }

/* 拖拽缩放手柄 */
.cart-resize { position: absolute; z-index: 3; }
.cart-resize-e { top: 48px; bottom: 48px; right: 0; width: 6px; cursor: ew-resize; }
.cart-resize-s { left: 12px; right: 12px; bottom: 0; height: 6px; cursor: ns-resize; }
.cart-resize-se { right: 0; bottom: 0; width: 16px; height: 16px; cursor: nwse-resize; }
.cart-resize-e:hover, .cart-resize-s:hover { background: rgba(43, 125, 108, .16); }
.cart-resize-se::after {
  content: "";
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 8px;
  height: 8px;
  border-right: 2px solid #a9bcc6;
  border-bottom: 2px solid #a9bcc6;
  border-radius: 2px;
}
.cart-resize-se:hover::after { border-color: var(--brand); }
.cart-panel.is-resizing { user-select: none; }

/* 尺寸自适应：窄面板压缩间距，文字省略不换行 */
.cart-panel.is-narrow .cart-head { padding: 10px 12px; gap: 8px; }
.cart-panel.is-narrow .cart-title { font-size: 12.5px; }
.cart-panel.is-narrow .cart-list { padding: 2px 12px; }
.cart-panel.is-narrow .cart-item { gap: 8px; }
.cart-panel.is-narrow .cart-item-name { font-size: 12px; }
.cart-panel.is-narrow .cart-item-meta { font-size: 10.5px; }
.cart-panel.is-narrow .cart-qty { padding: 2px 3px; font-size: 12.5px; }
.cart-panel.is-narrow .cart-foot { padding: 8px 12px; gap: 8px; }
.cart-panel.is-narrow .cart-total { font-size: 11px; }
.cart-panel.is-narrow .cart-foot .btn { padding: 0 9px; font-size: 12px; }

/* 矮面板压缩上下间距 */
.cart-panel.is-short .cart-head { padding: 8px 12px; }
.cart-panel.is-short .cart-list { padding: 2px 12px; }
.cart-panel.is-short .cart-item { padding: 7px 0; }
.cart-panel.is-short .cart-foot { padding: 8px 12px; }

/* 文字防挤压 */
.cart-item-main { min-width: 0; }
.cart-title { white-space: nowrap; }
.cart-qty { flex: none; }

/* =========================================================================
   领用日志页
   ========================================================================= */

.log-note {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  font-size: 12.5px;
  color: var(--text-2);
}

/* =========================================================================
   用户管理页
   ========================================================================= */

.user-cell { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: var(--block-sky);
  color: var(--precise);
  font-size: 12.5px;
  font-weight: 700;
}
.user-name { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text); }
.user-account { font-family: var(--mono); font-size: 11px; color: #6b7782; }

.user-form { display: flex; flex-direction: column; gap: 14px; }
.modal.user-modal { width: min(440px, calc(100vw - 40px)); }

/* =========================================================================
   2026-11 迭代：整行点击 / 详情左卡填充 / 分类展开 / 超级管理员 / 访问通知
   ========================================================================= */

/* 物料总览：整行可点击 + 型号链接 */
#materialBody tr[data-id] { cursor: pointer; }
.mat-model a { color: #6b7782; text-decoration: none; }
.mat-model a:hover { color: var(--brand); text-decoration: underline; }

/* 物料详情：左侧信息卡填满 */
.detail-grid { align-items: stretch; }
.detail-media-card { display: flex; flex-direction: column; }
.detail-media-card .card-bd { display: flex; flex-direction: column; gap: 14px; height: 100%; }
.detail-side-block { padding-top: 12px; border-top: 1px dashed rgba(38, 49, 59, .12); }
.detail-media-card .detail-side-block:first-of-type { padding-top: 0; border-top: 0; }
.detail-side-title {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .3px;
  color: #5d6a75;
}
.detail-side-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 0; }
.detail-side-list > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.detail-side-list dt { flex: none; margin: 0; font-size: 11.5px; color: #7d8a95; }
.detail-side-list dd { margin: 0; font-size: 12.5px; color: var(--text); text-align: right; word-break: break-word; }
.detail-side-list dd.mono { font-family: var(--mono); font-size: 12px; }
.detail-side-text { margin: 6px 0 0; font-size: 12.5px; line-height: 1.65; color: var(--text-2); word-break: break-word; }
.detail-recent { margin-top: 16px; padding-top: 12px; border-top: 1px dashed rgba(38, 49, 59, .12); }
.detail-recent-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.detail-recent-list { display: flex; flex-direction: column; gap: 9px; margin-top: 8px; }
.detail-recent-item { display: flex; gap: 8px; font-size: 12px; }
.detail-recent-dot { width: 6px; height: 6px; flex: none; margin-top: 5px; border-radius: 50%; background: var(--brand); }
.detail-recent-main { color: var(--text); }
.detail-recent-sub { font-size: 11px; color: #6b7782; }
.detail-recent-empty { margin-top: 8px; font-size: 12px; color: var(--text-3); }

/* 分类管理：展开 / 收起物料清单 */
.cat-name-cell { display: flex; align-items: center; gap: 8px; }
.cat-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: none;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fffdf7;
  color: var(--text-2);
  cursor: pointer;
  transition: background-color .12s, border-color .12s;
}
.cat-toggle:hover { background: var(--block-mint); border-color: #b9d9cc; color: var(--brand-strong); }
.cat-toggle svg { transition: transform .15s; }
.cat-toggle.is-open svg { transform: rotate(90deg); }
.cat-expand-row td { background: var(--surface-2); padding: 0 14px 12px; }
.cat-expand-panel { padding: 12px 14px; border: 1px solid var(--border); border-radius: 9px; background: #fffdf7; }
.cat-expand-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-size: 12px; color: var(--text-2); }
.cat-material-list { display: flex; flex-direction: column; gap: 6px; }
.cat-material-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; background: var(--surface-2); flex-wrap: wrap; }
.cat-material-name { font-size: 12.5px; font-weight: 500; color: var(--text); text-decoration: none; }
.cat-material-name:hover { color: var(--brand); text-decoration: underline; }
.cat-material-model {
  flex: 1;
  min-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 11.5px;
  color: #6b7782;
}
.cat-material-empty { padding: 14px 12px; border-radius: 7px; background: var(--surface-2); font-size: 12.5px; color: var(--text-3); }

/* 超级管理员标签 / 头像 */
.tag-super { background: #f7e7c8; color: #8a5f13; border-color: transparent; }
.user-avatar.is-super { background: #f7e7c8; color: #8a5f13; }

/* 访问通知面板 */
.visit-modal { width: min(480px, calc(100vw - 40px)); }
.visit-list { display: flex; flex-direction: column; gap: 4px; max-height: 360px; overflow-y: auto; }
.visit-item { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-bottom: 1px dashed rgba(38, 49, 59, .1); }
.visit-item:last-child { border-bottom: 0; }
.visit-avatar {
  width: 28px;
  height: 28px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--block-sky);
  color: var(--precise);
  font-size: 12px;
  font-weight: 700;
}
.visit-main { flex: 1; min-width: 0; }
.visit-name { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text); }
.visit-meta { margin-top: 1px; font-family: var(--mono); font-size: 11px; color: #6b7782; }
.visit-time { flex: none; font-family: var(--mono); font-size: 11px; color: #6b7782; }

/* 用户管理：管理员不可分配角色时的提示 */
.role-readonly {
  display: flex;
  flex-direction: column;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 12.5px;
  color: var(--text-2);
}


/* =========================================================================
   2026-11 新增物料：分类复合框 / 多图上传 / 详情图集
   ========================================================================= */

/* 下拉框字号、内边距与垂直居中 */
.select,
select.select {
  min-height: 42px;
  padding: 10px 38px 10px 12px;
  font-size: 14.5px;
  line-height: 1.5;
}
.select option,
select.select option {
  padding: 8px 10px;
  font-size: 14.5px;
  line-height: 1.8;
}
.input-lg,
.select-lg {
  min-height: 44px;
  font-size: 15px;
}

/* 多图上传 */
.upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.uploaded-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.uploaded-item {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
}
.uploaded-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.uploaded-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(30, 41, 59, .72);
  color: #fff;
  cursor: pointer;
}
.uploaded-remove:hover { background: #b4453f; }
.uploaded-empty {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 12px;
  color: #6b7782;
}

/* 详情页图集 */
.detail-thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.detail-thumb {
  width: 56px;
  height: 56px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.detail-thumb.is-active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-weak);
}
.detail-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 720px) {
  .uploaded-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}


/* =========================================================================
   2026-11 图片等比展示优化：不拉伸、不裁切、小图居中留白
   ========================================================================= */
.detail-media {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 260px;
  padding: 16px;
  overflow: hidden;
  /* 背景使用外层卡片自己的蓝色，不单独铺浅色块 */
  background: transparent;
  border: 0;
  border-radius: 0;
}
.detail-media img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}
.detail-thumbs {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.detail-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  padding: 3px;
  overflow: hidden;
  border: 1px solid rgba(38, 49, 59, .18);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}
.detail-thumb img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 4px;
}
.uploaded-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  background: #fffdf7;
}
.uploaded-item img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}


/* =========================================================================
   2026-11 列表缩略图与大图预览
   ========================================================================= */
.mat-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mat-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 2px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fffdf7;
  cursor: pointer;
}
.mat-thumb:hover { border-color: var(--brand); }
.mat-thumb img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.mat-thumb.is-empty {
  color: var(--text-3);
  background: var(--surface-2);
  border-style: dashed;
  cursor: default;
}
.log-material {
  display: flex;
  align-items: center;
  gap: 9px;
}
.log-material .mat-thumb { width: 36px; height: 36px; }

/* 点击缩略图查看大图 */
.image-preview-mask {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(18, 27, 36, .78);
  backdrop-filter: blur(3px);
}
.image-preview {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: min(92vw, 1000px);
  max-height: 92vh;
}
.image-preview img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(92vh - 50px);
  object-fit: contain;
  border-radius: 8px;
  background: #fffdf7;
}
.image-preview-title {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
  font-size: 13px;
}

@media (max-width: 720px) {
  .mat-thumb { width: 38px; height: 38px; }
  .log-material .mat-thumb { width: 32px; height: 32px; }
}


/* 库存预警：整行可点击进入物料详情 */
.alert-row { cursor: pointer; }
.alert-row:hover td { background: var(--block-sky); }
