/* ============================================================
   山木金代采平台 · 新前端补充样式（Bootstrap5 之上）
   仅放老项目两套 CSS 没有的部分：AI 面板 / 备注图粘贴格 / 杂项
   ============================================================ */

/* ---------- AI 助手 ---------- */
.ai-fab {
  position: fixed; right: 22px; bottom: 22px; width: 52px; height: 52px;
  border-radius: 50%; border: none; cursor: pointer; z-index: 1080;
  background: linear-gradient(135deg, #0d6efd, #6610f2); color: #fff;
  font-weight: 700; font-size: 15px; letter-spacing: .5px;
  box-shadow: 0 6px 20px rgba(13,110,253,.45);
}
.ai-fab:hover { transform: translateY(-2px); }
.ai-panel {
  position: fixed; right: 22px; bottom: 84px; width: 360px; max-width: calc(100vw - 32px);
  height: 480px; background: #fff; border-radius: 12px; z-index: 1080;
  box-shadow: 0 12px 40px rgba(0,0,0,.18); display: flex; flex-direction: column; overflow: hidden;
}
.ai-head {
  padding: 10px 12px; border-bottom: 1px solid #eef0f3; display: flex;
  justify-content: space-between; align-items: center; background: #f8f9fc;
}
.ai-msgs { flex: 1; overflow-y: auto; padding: 10px; }
.ai-msg { max-width: 88%; padding: 8px 11px; border-radius: 10px; font-size: 13px; line-height: 1.55; margin-bottom: 8px; white-space: pre-wrap; word-break: break-word; }
.ai-msg.user { margin-left: auto; background: #0d6efd; color: #fff; }
.ai-msg.assistant { background: #f1f3f6; color: #222b45; }
.ai-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #eef0f3; }
@media (max-width: 575.98px) {
  .ai-panel { right: 8px; left: 8px; width: auto; bottom: 76px; height: 60vh; }
  .ai-fab { right: 14px; bottom: 14px; }
}

/* ---------- 批量提交订单：可粘贴备注图单元格 ---------- */
.book-img-cell {
  min-width: 72px; min-height: 46px; border: 1px dashed #ced4da; border-radius: 4px;
  padding: 2px; text-align: center; cursor: pointer; position: relative;
  display: inline-block; vertical-align: middle; background: #fff;
}
.book-img-cell:hover { border-color: #0d6efd; background: #f8fbff; }
.book-img-cell img { max-width: 64px; max-height: 64px; display: block; margin: 0 auto; border-radius: 4px; }
.book-img-cell .book-img-del {
  position: absolute; top: -8px; right: -8px; background: #dc3545; color: #fff;
  font-size: 11px; border-radius: 50%; width: 18px; height: 18px; line-height: 16px;
  cursor: pointer; text-align: center;
}

/* ---------- 批量表格 ---------- */
.batch-wrap { overflow-x: auto; border: 1px solid #dee2e6; border-radius: 6px; }
.batch-tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.batch-tbl th {
  background: #f8f9fa; padding: 8px 10px; text-align: left; white-space: nowrap;
  border-bottom: 1px solid #dee2e6; font-weight: 600; color: #495057;
}
.batch-tbl td { padding: 5px 6px; border-bottom: 1px solid #f1f3f6; vertical-align: middle; }
.batch-tbl tbody tr:hover td { background: #f8f9fc; }
.batch-tbl tr.row-err td { background: #fff5f5; }
.batch-tbl input { border: 1px solid #dee2e6; border-radius: 4px; padding: 4px 6px; font-size: 13px; width: 100%; min-width: 70px; }
.batch-tbl input:focus { outline: none; border-color: #0d6efd; box-shadow: 0 0 0 2px rgba(13,110,253,.12); }
.batch-tbl .req { color: #dc3545; margin-left: 1px; }
.batch-tbl .sno { width: 46px; text-align: center; color: #6c757d; }
.batch-tbl .op { width: 64px; }

/* ---------- 通用小工具 ---------- */
.filter-bar { background: #fff; border: 1px solid #eaecef; border-radius: 8px; padding: 14px 16px; margin-bottom: 14px; }
.filter-bar .row > [class*="col-"] { margin-bottom: 10px; }
.stat-card { border-radius: 10px; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.04); padding: 16px; text-align: center; height: 100%; }
.stat-card .ic { font-size: 22px; }
.stat-card .num { font-size: 24px; font-weight: 700; margin-top: 4px; }
.stat-card .lb { font-size: 13px; color: #868e96; margin-top: 2px; }
.clickable-row { cursor: pointer; }
.text-money-lg { font-size: 26px; font-weight: 700; color: #e74c3c; }
.qr-tile { border: 1px solid #eaecef; border-radius: 8px; padding: 14px; text-align: center; height: 100%; background: #fff; }
.qr-tile img { max-width: 180px; width: 100%; border-radius: 6px; }
.qr-tile .stars { color: #f0a020; font-size: 12px; }
.section-title { font-size: 15px; font-weight: 600; color: #222b45; margin: 0 0 12px; }
.empty-tip { text-align: center; color: #adb5bd; padding: 3rem 1rem; font-size: .9rem; }
.empty-tip::before { content: '📭'; display: block; font-size: 2.2rem; margin-bottom: .4rem; }
.mini-muted { font-size: 12px; color: #868e96; }
.img-set { display: flex; gap: 4px; flex-wrap: wrap; }
.img-set img { width: 42px; height: 42px; object-fit: cover; border: 1px solid #dee2e6; border-radius: 4px; cursor: pointer; }

/* ---------- 长单号防溢出串列（平台单号 29~31 位无空格，不能撑破单元格） ---------- */
.admin-table tbody td,
.table tbody td { overflow-wrap: anywhere; word-break: break-word; }
/* 单号列给一个上限，超长自动折行，避免把相邻列挤没 */
.admin-table .cell-no, .table .cell-no { max-width: 220px; }
.mono-no { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: -.2px; }
