/* ============================================================
   GMI 智能生产管理系统 — components.css
   按钮 · 表格 · 表单 · 弹窗 · Toast · 标签徽章 · 统计卡
   ============================================================ */

/* ==================== 按钮 ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 42px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  border: 1px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn-primary {
  background: var(--grad-main);
  color: var(--on-accent);
  font-weight: 700;
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost {
  border-color: var(--line);
  color: var(--text-mid);
  background: var(--bg-panel-solid);
}
.btn-ghost:hover { color: var(--neon-cyan); border-color: var(--neon-cyan); }
.btn-danger {
  border-color: var(--danger-line);
  color: var(--danger);
}
.btn-danger:hover { background: var(--danger-bg); }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ==================== 统计指标卡 ==================== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}
.stat-card {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform 0.25s;
}
.stat-card:hover { border-color: var(--line-strong); }
.stat-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-value { font-size: 34px; line-height: 1.2; }
.stat-label { font-size: 14px; color: var(--text-mid); margin-top: 6px; }

/* ==================== 数据表格 ==================== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--bg-panel-solid);
}
.data-table th {
  text-align: left;
  padding: 11px 14px;
  color: var(--text-mid);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0;
  background: var(--table-head);
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text-mid);
  white-space: nowrap;
}
.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table tbody tr:hover td { color: var(--text-hi); }
.data-table .cell-main { color: var(--text-hi); font-weight: 600; }
.data-table .empty-row td {
  text-align: center;
  padding: 40px;
  color: var(--text-dim);
}

/* 工具栏（搜索 + 筛选 + 操作按钮） */
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px;
}
.table-toolbar .spacer { flex: 1; }

/* 分页 */
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 12px 14px;
  font-size: 12px;
  color: var(--text-dim);
}
.pagination button {
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  color: var(--text-mid);
  font-family: var(--font-num);
  transition: all 0.15s;
}
.pagination button:hover:not(:disabled) { color: var(--neon-blue); border-color: var(--neon-blue); }
.pagination button.cur {
  background: var(--neon-cyan-faint);
  border-color: var(--neon-blue);
  color: var(--neon-blue);
}
.pagination button:disabled { opacity: 0.35; cursor: not-allowed; }

/* ==================== 表单 ==================== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
}
.form-grid .full { grid-column: 1 / -1; }
.form-item label {
  display: block;
  font-size: 14px;
  color: var(--text-mid);
  margin-bottom: 8px;
}
.form-item label .req { color: var(--danger); margin-left: 2px; }
.form-item input,
.form-item select,
.form-item textarea {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: all 0.2s;
}
.form-item textarea { height: auto; min-height: 72px; padding: 9px 12px; resize: vertical; }
.form-item select option { background: var(--bg-panel-solid); }
.form-item input:focus,
.form-item select:focus,
.form-item textarea:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 3px var(--neon-cyan-faint);
}
.form-item .err-msg { font-size: 11px; color: var(--danger); margin-top: 4px; min-height: 14px; }

/* 筛选下拉（工具栏用） */
.filter-select {
  height: 40px;
  padding: 0 10px;
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-mid);
}
.filter-select option { background: var(--bg-panel-solid); }
.filter-input {
  height: 40px;
  padding: 0 12px;
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 12px;
  width: 200px;
}
.filter-input:focus { border-color: var(--neon-cyan); }

/* ==================== 标签 / 徽章 ==================== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  border: 1px solid;
  white-space: nowrap;
}
.tag::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.tag-cyan { color: var(--accent); border-color: var(--neon-cyan-dim); background: var(--neon-cyan-faint); }
.tag-ok { color: var(--ok); border-color: var(--ok-line); background: var(--ok-bg); }
.tag-warn { color: var(--warn); border-color: var(--warn-line); background: var(--warn-bg); }
.tag-danger { color: var(--danger); border-color: var(--danger-line); background: var(--danger-bg); }
.tag-purple { color: var(--purple); border-color: var(--purple-line); background: var(--purple-bg); }
.tag-dim { color: var(--text-mid); border-color: var(--line); background: var(--bg-raised); }

/* ==================== 模态弹窗 ==================== */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--overlay);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in 0.22s ease;
}
.modal-box {
  width: min(680px, 92vw);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: var(--modal-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-overlay);
  overflow: hidden;
  animation: modal-in .2s ease;
}
.modal-box.modal-sm { width: min(420px, 92vw); }
.modal-box.modal-lg { width: min(920px, 94vw); }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 15px; letter-spacing: 1px; }
.modal-close {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { color: var(--danger); background: var(--danger-bg); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}

/* ==================== Toast ==================== */
#toast-container {
  position: fixed;
  top: 74px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  min-width: 240px;
  max-width: 360px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--grad-panel);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-left-width: 3px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  box-shadow: var(--glow-card);
  animation: toast-in 0.32s cubic-bezier(0.34, 1.4, 0.64, 1), fade-out 0.3s ease 2.7s both;
}
.toast svg { width: 17px; height: 17px; flex-shrink: 0; }
.toast.ok { border-left-color: var(--ok); }
.toast.ok svg { color: var(--ok); }
.toast.warn { border-left-color: var(--warn); }
.toast.warn svg { color: var(--warn); }
.toast.error { border-left-color: var(--danger); }
.toast.error svg { color: var(--danger); }
.toast.info { border-left-color: var(--neon-cyan); }
.toast.info svg { color: var(--neon-cyan); }

/* ==================== 空状态 ==================== */
.empty-state {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}

/* ==================== AI 扫码 / 拍照识别 ==================== */
.scanner-view {
  position: relative;
  height: 240px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--media-bg);
}
.scanner-view video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scan-frame {
  position: absolute;
  inset: 34px 60px;
  pointer-events: none;
}
.scan-frame .c {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 3px solid var(--neon-cyan);
}
.scan-frame .tl { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.scan-frame .tr { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.scan-frame .bl { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.scan-frame .br { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.scan-beam {
  position: absolute;
  left: 4px;
  right: 4px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
  box-shadow: 0 0 12px var(--neon-cyan);
  animation: scan-beam-move 2.2s ease-in-out infinite;
}
.scanner-status {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--media-ink);
  background: var(--bg-panel-solid);
  text-align: center;
}
.recog-log { font-size: 12px; }

/* ==================== 预警中心抽屉 ==================== */
.drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: var(--overlay);
  animation: fade-in 0.2s ease;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 121;
  width: min(400px, 94vw);
  background: var(--bg-panel-solid);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-overlay);
  display: flex;
  flex-direction: column;
  animation: drawer-in 0.28s cubic-bezier(0.3, 1.1, 0.6, 1);
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h3 { font-size: 15px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 12px; }
.alert-item {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.18s;
  background: var(--bg-panel-solid);
}
.alert-item:hover { border-color: var(--neon-cyan); transform: translateX(-3px); }
.alert-item.read { opacity: 0.55; }
.alert-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.alert-item .a-title { font-size: 13px; color: var(--text-hi); font-weight: 600; }
.alert-item .a-detail { font-size: 12px; color: var(--text-mid); margin: 3px 0; line-height: 1.5; }
.alert-item .a-time { font-size: 11px; color: var(--text-dim); font-family: var(--font-num); }

/* ==================== AI 助手 ==================== */
.ai-fab {
  position: fixed;
  right: 26px;
  bottom: 30px;
  z-index: 90;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--grad-main);
  color: var(--on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-overlay);
  cursor: pointer;
  transition: transform 0.2s;
}
.ai-fab:hover { transform: scale(1.08); }
.ai-fab svg { width: 27px; height: 27px; }
.ai-panel {
  position: fixed;
  right: 26px;
  bottom: 96px;
  z-index: 91;
  width: min(360px, 92vw);
  height: min(480px, 70vh);
  background: var(--bg-panel-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-overlay);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-in 0.28s cubic-bezier(0.34, 1.3, 0.64, 1);
}
.ai-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 15px;
  background: var(--grad-main);
  color: var(--on-accent);
  font-size: 14px;
  font-weight: 700;
}
.ai-head svg { width: 19px; height: 19px; }
.ai-head .spacer { flex: 1; }
.ai-head button { color: var(--on-accent); opacity: 0.85; }
.ai-head button:hover { opacity: 1; }
.ai-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ai-msg {
  max-width: 86%;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}
.ai-msg.bot {
  align-self: flex-start;
  background: var(--line);
  border: 1px solid var(--line);
  color: var(--text-hi);
  border-bottom-left-radius: 3px;
}
.ai-msg.user {
  align-self: flex-end;
  background: var(--grad-main);
  color: var(--on-accent);
  border-bottom-right-radius: 3px;
}
.ai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px 8px;
}
.ai-chips .chip {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  color: var(--neon-blue);
  cursor: pointer;
  background: var(--neon-cyan-faint);
}
.ai-chips .chip:hover { border-color: var(--neon-cyan); }
.ai-input {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}
.ai-input input {
  flex: 1;
  height: 34px;
  padding: 0 12px;
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: 17px;
  font-size: 13px;
}
.ai-input input:focus { border-color: var(--neon-cyan); }

/* ==================== 图表面板 / 驾驶舱 ==================== */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}
.chart-panel { padding: 24px; min-width: 0; }
.chart-panel h4 {
  font-size: 16px;
  letter-spacing: 0;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-hi);
}
.chart-panel h4::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--grad-main);
}
.chart-panel canvas { width: 100%; height: 220px; display: block; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }
@media (max-width: 1100px) {
  .span-3, .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; }
}

/* 驾驶舱预警流 */
.feed-list { display: flex; flex-direction: column; gap: 9px; max-height: 220px; overflow-y: auto; }
.feed-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12px;
  color: var(--text-mid);
  line-height: 1.5;
}
.feed-item b { color: var(--text-hi); font-weight: 600; }
.feed-item .t { margin-left: auto; color: var(--text-dim); font-family: var(--font-num); white-space: nowrap; }

/* ==================== 详情键值对 ==================== */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 4px 20px;
}
.detail-grid .d-item {
  display: flex;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}
.detail-grid .d-item label { color: var(--text-dim); flex-shrink: 0; min-width: 74px; }
.detail-grid .d-item span { color: var(--text-hi); }

/* ==================== 工艺流程图 ==================== */
.flow-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
}
.flow-step {
  position: relative;
  min-width: 148px;
  flex: 1;
  max-width: 210px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-panel-solid);
  transition: all 0.2s;
}
.flow-step:hover { border-color: var(--neon-cyan); box-shadow: var(--glow-cyan); transform: translateY(-2px); }
.flow-step .f-seq {
  position: absolute;
  top: -9px;
  left: 12px;
  padding: 1px 9px;
  font-size: 10px;
  font-family: var(--font-num);
  color: var(--on-accent);
  background: var(--grad-main);
  border-radius: 9px;
}
.flow-step .f-name { font-size: 13px; font-weight: 700; color: var(--text-hi); margin: 4px 0 5px; }
.flow-step .f-meta { font-size: 11px; color: var(--text-mid); line-height: 1.6; }
.flow-step.qc-point { border-color: var(--purple-line); }
.flow-step.qc-point .f-seq { background: var(--grad-purple); }
.flow-arrow {
  align-self: center;
  color: var(--neon-cyan);
  font-size: 17px;
  flex-shrink: 0;
}

/* ==================== 部门树 ==================== */
.dept-tree { padding: 6px 4px; }
.dept-node {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
  font-size: 13px;
  color: var(--text-hi);
}
.dept-node:hover { background: var(--bg-hover); }
.dept-node .d-count { margin-left: auto; font-size: 11px; color: var(--text-dim); font-family: var(--font-num); }

/* ==================== 库区卡片 ==================== */
.wh-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}
.wh-card { padding: 16px 18px; }
.wh-card .w-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.wh-card .w-name { font-size: 14px; font-weight: 700; color: var(--text-hi); }
.wh-card .w-meta { font-size: 12px; color: var(--text-mid); line-height: 1.8; }
.wh-card .w-usage { margin-top: 10px; }
.wh-card .w-usage .u-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 5px;
  font-family: var(--font-num);
}

/* ==================== 权限矩阵 ==================== */
.perm-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.perm-table th, .perm-table td {
  padding: 8px 10px;
  border: 1px solid var(--line);
  text-align: center;
}
.perm-table th { background: var(--table-head); color: var(--neon-blue); }
.perm-table td:first-child { text-align: left; color: var(--text-hi); }
.perm-table input[type="checkbox"] { accent-color: var(--neon-blue); width: 15px; height: 15px; }

/* ==================== 条码 ==================== */
.barcode-box { text-align: center; padding: 10px 0; }
.barcode-bars {
  display: inline-flex;
  align-items: flex-end;
  height: 64px;
  gap: 0;
}
.barcode-bars i { display: inline-block; height: 100%; background: var(--print-ink); }
.barcode-text { font-family: var(--font-num); font-size: 13px; letter-spacing: 3px; margin-top: 6px; color: var(--text-hi); }

/* ==================== 通用小工具 ==================== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
.view-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.view-head .spacer { flex: 1; }
.num-strong { font-family: var(--font-num); font-weight: 700; }
.text-ok { color: var(--ok); }
.text-warn { color: var(--warn); }
.text-danger { color: var(--danger); }

/* ==================== 工艺工序编辑器 ==================== */
.op-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 44vh;
  overflow-y: auto;
  padding-right: 4px;
}
.op-row {
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.op-row .op-line {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.op-row .op-line + .op-line { margin-top: 8px; }
.op-row input,
.op-row select {
  height: 32px;
  padding: 0 10px;
  background: var(--bg-panel-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 12px;
  transition: all 0.2s;
}
.op-row input:focus,
.op-row select:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 3px var(--neon-cyan-faint);
}
.op-row input[type='checkbox'] {
  width: 15px;
  height: 15px;
  accent-color: var(--neon-blue);
  cursor: pointer;
}
.op-qc-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-mid);
  cursor: pointer;
  white-space: nowrap;
}
.op-move-btns { display: flex; gap: 4px; margin-left: auto; }
.op-move-btns .btn { padding: 0 8px; height: 28px; }

/* ==================== AI 视觉检测 · 实时监控墙 ==================== */
.cam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.cam-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-panel);
  transition: all 0.25s;
}
.cam-card:hover { box-shadow: var(--glow-card); transform: translateY(-2px); }
.cam-card.st-danger { border-color: var(--danger-line); }
.cam-card.st-warn { border-color: var(--warn-line); }

/* 模拟视频流画面 */
.cam-live {
  position: relative;
  aspect-ratio: 16 / 9;
  background: radial-gradient(ellipse at 60% 40%, var(--neon-cyan-faint), transparent 60%), var(--media-bg);
  overflow: hidden;
}
.cam-live .cl-scan {
  position: absolute;
  left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
  box-shadow: 0 0 8px var(--neon-cyan);
  animation: cam-scan 3s linear infinite;
}
.cam-live .cl-target {
  position: absolute;
  border: 1px solid var(--accent-secondary);
  border-radius: 3px;
  box-shadow: 0 0 10px var(--neon-cyan-faint) inset;
}
.cam-live .cl-target::after {
  content: attr(data-label);
  position: absolute;
  top: -16px; left: -1px;
  font-size: 9px;
  font-family: var(--font-num);
  color: var(--neon-cyan);
  white-space: nowrap;
}
.cam-live .cl-target.ng { border-color: var(--danger); }
.cam-live .cl-target.ng::after { color: var(--danger); }
.cam-live .cl-osd {
  position: absolute;
  left: 8px; top: 6px;
  font-family: var(--font-num);
  font-size: 10px;
  color: var(--media-ink);
  text-shadow: 0 1px 2px var(--bg-deep);
  line-height: 1.5;
}
.cam-live .cl-rec {
  position: absolute;
  right: 8px; top: 6px;
  display: flex; align-items: center; gap: 5px;
  font-family: var(--font-num);
  font-size: 10px;
  color: var(--media-ink);
}
.cam-live .cl-rec i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger);
  animation: rec-blink 1.1s ease infinite;
}
.cam-live .cl-offline {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: repeating-linear-gradient(45deg, var(--bg-deep) 0 12px, var(--bg-panel-solid) 12px 24px);
  color: var(--media-ink);
  font-size: 12px;
  letter-spacing: 2px;
}

/* 卡片信息栏 */
.cam-info { padding: 10px 12px 12px; }
.cam-info .ci-head { display: flex; align-items: center; gap: 8px; }
.cam-dot {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
}
.cam-dot.g { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.cam-dot.y { background: var(--warn); box-shadow: 0 0 6px var(--warn); animation: rec-blink 1.4s ease infinite; }
.cam-dot.r { background: var(--danger); box-shadow: 0 0 6px var(--danger); animation: rec-blink 0.8s ease infinite; }
.cam-info .ci-name {
  font-size: 13px; font-weight: 600; color: var(--text-hi);
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cam-info .ci-meta { font-size: 11px; color: var(--text-dim); margin-top: 5px; line-height: 1.6; }
.cam-info .ci-result {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px; padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
}

/* 监控墙顶部汇总条 */
.mon-summary {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 16px;
}
.mon-summary .ms-item { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-mid); }
.mon-summary .ms-item b { font-family: var(--font-num); font-size: 18px; color: var(--text-hi); }

/* 驾驶舱 · AI 视觉监视带 */
.vis-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 10px;
  margin-top: 4px;
}
.vis-cam {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  cursor: pointer;
  transition: all 0.2s;
}
.vis-cam:hover { border-color: var(--neon-cyan); box-shadow: 0 0 0 3px var(--neon-cyan-faint); transform: translateY(-1px); }
.vis-cam .vc-body { flex: 1; min-width: 0; }
.vis-cam .vc-name {
  font-size: 12px; font-weight: 600; color: var(--text-hi);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vis-cam .vc-meta { font-size: 10px; color: var(--text-dim); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vis-cam .vc-score { font-family: var(--font-num); font-size: 13px; font-weight: 700; flex-shrink: 0; }
.vis-head-chips { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--text-mid); font-weight: 400; }
.vis-head-chips b { font-family: var(--font-num); color: var(--text-hi); }

/* ================================================================
 * 条码 / 二维码标签
 * ================================================================ */
.label-sheet { }
.label-box {
  display: flex;
  gap: 16px;
  align-items: stretch;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-panel-solid);
}
.label-left { flex: 1; min-width: 0; }
.label-right {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding-left: 14px; border-left: 1px dashed var(--line); flex-shrink: 0;
}
.label-name { font-size: 17px; font-weight: 700; color: var(--text-hi); line-height: 1.3; }
.label-sub { font-size: 12px; color: var(--text-mid); margin-top: 3px; }
.label-meta { font-size: 11px; color: var(--text-dim); margin-top: 3px; line-height: 1.6; }
.label-meta.small { font-size: 11px; }
.label-qrtext {
  font-family: var(--font-num); font-size: 11px; color: var(--text-mid);
  letter-spacing: 1px; text-align: center;
}
.barcode-bars-wrap { margin-top: 10px; display: inline-block; line-height: 0; }
.barcode-bars-wrap svg { display: block; }
.label-preview {
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--bg-input);
  overflow: hidden;
}
.label-preview .label-box { background: var(--bg-panel-solid); }

/* ================================================================
 * 扫码枪工作区
 * ================================================================ */
.gun-zone {
  border: 1.5px dashed var(--neon-blue);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--bg-raised), var(--bg-panel-solid));
  padding: 12px 14px;
}
.gun-input-row { display: flex; align-items: center; gap: 10px; }
.gun-icon {
  width: 30px; height: 30px; flex-shrink: 0;
  border-radius: 8px;
  background: var(--grad-main);
  color: var(--on-accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
}
.gun-input {
  flex: 1; min-width: 0;
  height: 38px;
  padding: 0 12px;
  background: var(--bg-panel-solid);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--font-num);
  font-size: 14px;
  letter-spacing: 1px;
}
.gun-input:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 3px var(--neon-cyan-faint);
}
.gun-badge {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-dim);
  background: var(--bg-input);
  border-radius: 11px;
  padding: 3px 10px;
  white-space: nowrap;
}
.gun-badge.ok { color: var(--ok); background: var(--ok-bg); }

/* 数量倍数（箱/托盘装量） */
.gun-mult {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  height: 30px;
  padding: 0 6px 0 8px;
  border-radius: 8px;
  background: var(--neon-cyan-faint);
  border: 1px solid var(--line);
}
.gun-mult-label {
  font-family: var(--font-num);
  font-size: 13px;
  font-weight: 700;
  color: var(--neon-blue);
  line-height: 1;
}
.gun-mult-input {
  width: 52px;
  height: 24px;
  padding: 0 4px;
  border: none;
  background: transparent;
  font-family: var(--font-num);
  font-size: 14px;
  font-weight: 700;
  color: var(--neon-blue);
  text-align: center;
  outline: none;
}
.gun-mult-input::-webkit-outer-spin-button,
.gun-mult-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.gun-mult-input { -moz-appearance: textfield; appearance: textfield; }
.gun-mult:focus-within { border-color: var(--neon-cyan); box-shadow: 0 0 0 3px var(--neon-cyan-faint); }
.gun-hint { font-size: 11px; color: var(--text-dim); margin-top: 7px; line-height: 1.6; }
.gun-log { margin-top: 6px; }
.gun-log-line {
  font-family: var(--font-num);
  font-size: 11px;
  color: var(--text-mid);
  padding: 2px 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ================================================================
 * 扫码枪极速入库布局
 * ================================================================ */
.gun-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 16px;
  align-items: start;
}
.gun-left { min-width: 0; }
.gun-right {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-input);
  overflow: hidden;
}
.gun-right-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12px; color: var(--text-mid);
  background: var(--bg-panel-solid);
}
.gun-right-head .spacer { flex: 1; }
.gun-right-head b { font-size: 15px; color: var(--text-hi); }
.gun-items { max-height: 46vh; overflow-y: auto; overflow-x: auto; }
.gun-items .empty-state { padding: 30px 12px; }
.gun-table { font-size: 12px; min-width: 540px; }
.gun-table th, .gun-table td { padding: 7px 10px; }
.gun-table .gun-qty {
  width: 82px; height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-panel-solid);
  font-family: var(--font-num);
  font-size: 12px;
  text-align: right;
}
.gun-table .gun-qty:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 2px var(--neon-cyan-faint);
}
.gun-tips {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.7;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.gun-tips b { color: var(--neon-blue); font-size: 12px; }
.gun-tips ul { margin: 6px 0 0; padding-left: 16px; }
.gun-tips li { margin-bottom: 3px; }

/* 弹窗尺寸：极速入库用更宽 */
.modal-box.modal-xl { width: min(1180px, 96vw); }

/* 平板 / 手机：极速入库改为上下堆叠 */
/* 平板：左栏收窄但仍保持左右并排（明细表需要横向空间） */
@media (max-width: 1240px) {
  .gun-layout { grid-template-columns: 340px 1fr; gap: 12px; }
  .gun-items { max-height: 42vh; }
}
/* 窄屏：改为上下堆叠，明细表全宽展开 */
@media (max-width: 1024px) {
  .gun-layout { grid-template-columns: 1fr; }
  .gun-items { max-height: 40vh; }
}
@media (max-width: 760px) {
  .gun-layout { grid-template-columns: 1fr; gap: 12px; }
  .gun-items { max-height: 34vh; }
  .label-box { flex-direction: column; }
  .label-right { border-left: none; border-top: 1px dashed var(--line); padding: 12px 0 0; }
  .label-preview .label-box { transform: none !important; }
  .modal-box.modal-xl { width: calc(100vw - 16px); }
}

/* 打印：仅输出标签内容 */
@media print {
  body * { visibility: hidden; }
  .label-sheet, .label-sheet *,
  .label-print-area, .label-print-area * { visibility: visible; }
  .label-sheet, .label-print-area {
    position: absolute; left: 0; top: 0;
    width: 100%; padding: 0;
  }
  .label-print-area { position: static; }
  .label-box { border: 1px solid var(--print-ink); break-inside: avoid; }
  .label-grid { display: block; }
  .label-grid .label-box {
    display: inline-flex;
    width: 32%;
    min-width: 60mm;
    margin: 0 1% 4mm 0;
    page-break-inside: avoid;
  }
  .modal-head, .modal-foot, .modal-mask { display: none !important; }
}

/* ================================================================
 * 标签打印 · 物料选择器与标签网格
 * ================================================================ */
.lb-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 210px;
  overflow-y: auto;
  padding: 4px 2px;
}
.lb-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--bg-input);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.18s;
  max-width: 260px;
}
.lb-chip:hover { border-color: var(--neon-cyan); }
.lb-chip.on {
  border-color: var(--neon-blue);
  background: var(--neon-cyan-faint);
  color: var(--neon-blue);
}
.lb-chip input { accent-color: var(--neon-blue); cursor: pointer; }
.lb-chip-code { font-family: var(--font-num); font-size: 11px; color: var(--text-mid); }
.lb-chip.on .lb-chip-code { color: var(--neon-blue); }
.lb-chip-name {
  color: var(--text-hi);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.label-print-area {
  background: var(--bg-panel-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.label-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}
.label-grid .label-box { margin-bottom: 0; }
.label-grid .label-box:hover { border-color: var(--neon-blue); }

/* ================================================================
 * 发货与物流
 * ================================================================ */

/* 在途看板 */
.ship-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  align-items: start;
}
.ship-col {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-panel);
  overflow: hidden;
}
.sc-head {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px;
  font-size: 13px; font-weight: 600;
  border-bottom: 1px solid var(--line);
  background: var(--bg-panel-solid);
}
.sc-head b {
  margin-left: auto;
  font-family: var(--font-num);
  font-size: 13px;
  color: var(--text-mid);
}
.sc-dot { width: 8px; height: 8px; border-radius: 50%; }
.sc-dot.warn { background: var(--warn); }
.sc-dot.cyan { background: var(--neon-blue); }
.sc-dot.ok { background: var(--ok); }
.sc-dot.danger { background: var(--danger); }
.sc-body { padding: 10px; display: flex; flex-direction: column; gap: 10px; max-height: 62vh; overflow-y: auto; }
.sc-empty { text-align: center; color: var(--text-dim); font-size: 12px; padding: 24px 0; }

.ship-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  padding: 10px 11px;
  transition: all 0.2s;
}
.ship-card:hover { border-color: var(--neon-cyan); box-shadow: var(--glow-card); }
.ship-card.over { border-color: var(--danger-line); }
.sk-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sk-top .num { font-size: 12px; font-weight: 700; color: var(--text-hi); }
.sk-order { font-size: 11px; color: var(--neon-blue); margin-top: 5px; }
.sk-meta { font-size: 11px; color: var(--text-dim); margin-top: 3px; line-height: 1.5; }
.sk-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px; padding-top: 7px;
  border-top: 1px dashed var(--line);
  font-size: 11px;
}
.sk-qty { font-family: var(--font-num); font-weight: 700; color: var(--text-hi); }
.sk-due { color: var(--text-dim); }
.sk-due.soon { color: var(--warn); font-weight: 600; }
.sk-due.over { color: var(--danger); font-weight: 700; }
.sk-due.ok { color: var(--ok); }
.sk-acts { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 9px; }
.sk-acts .btn { flex: 1 1 auto; min-width: 58px; }

/* 物流轨迹时间轴 */
.track-timeline { position: relative; padding-left: 18px; }
.track-timeline::before {
  content: "";
  position: absolute;
  left: 5px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--neon-cyan), var(--line));
  border-radius: 1px;
}
.track-node { position: relative; padding-bottom: 14px; }
.track-node:last-child { padding-bottom: 0; }
.tn-dot {
  position: absolute;
  left: -17px; top: 4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--neon-blue);
  border: 2px solid var(--bg-panel-solid);
  box-shadow: 0 0 0 2px var(--neon-cyan-faint);
}
.tn-dot.ok { background: var(--ok); box-shadow: 0 0 0 2px var(--ok-bg); }
.tn-dot.ng { background: var(--danger); box-shadow: 0 0 0 2px var(--danger-bg); }
.tn-head { display: flex; align-items: baseline; gap: 10px; font-size: 13px; }
.tn-head b { color: var(--text-hi); }
.tn-head .num { font-size: 11px; color: var(--text-dim); }
.tn-loc { font-size: 12px; color: var(--text-mid); margin-top: 3px; }
.tn-note { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* 响应式：看板与轨迹 */
@media (max-width: 1024px) {
  .ship-board { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .ship-board { grid-template-columns: 1fr; }
  .sc-body { max-height: none; }
}

@media (max-width: 760px) {
  .label-grid { grid-template-columns: 1fr; }
  .lb-picker { max-height: 160px; }
}

/* ================================================================
 * 响应式适配 · 组件层（平板 / 手机）
 * ================================================================ */

/* ===== 平板（≤ 1024px） ===== */
@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
  .stat-card { padding: 14px; gap: 11px; }
  .chart-grid { gap: 12px; }
  /* 平板上 12 列栏格折为双列：小卡占半、大卡占整行 */
  .span-3, .span-4, .span-5 { grid-column: span 6; }
  .span-6, .span-7, .span-8, .span-9, .span-10, .span-11, .span-12 { grid-column: span 12; }
  .chart-panel canvas { height: 200px; }
  .cam-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
  .vis-strip { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
  .detail-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
}

/* ===== 手机 / 窄屏平板（≤ 760px） ===== */
@media (max-width: 760px) {
  /* 指标卡：双列紧凑布局 */
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 12px 11px; gap: 9px; }
  .stat-icon { width: 36px; height: 36px; }
  .stat-icon svg { width: 19px; height: 19px; }
  .stat-value { font-size: 32px; }
  .stat-label { font-size: 13px; }

  /* 图表：全部单列堆叠 */
  .chart-grid { grid-template-columns: 1fr; gap: 10px; }
  .span-3, .span-4, .span-5, .span-6, .span-7, .span-8, .span-9, .span-10, .span-11, .span-12 { grid-column: span 1; }
  .chart-panel { padding: 13px 12px; }
  .chart-panel canvas { height: 190px; }
  .grid-2 { grid-template-columns: 1fr; }

  /* Tab 页签：横向滚动不换行 */
  .tabs {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs .tab { padding: 8px 14px; font-size: 14px; flex-shrink: 0; }

  /* 表格：横向滚动 + 缩紧内边距 */
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .data-table { font-size: 14px; }
  .data-table th { padding: 9px 10px; }
  .data-table td { padding: 9px 10px; }
  .table-toolbar { padding: 10px; gap: 8px; }
  .table-toolbar .spacer { display: none; }        /* 取消右推，改为自然换行 */
  .table-toolbar .filter-input { flex: 1 1 100%; }
  .table-toolbar .filter-select { flex: 1 1 auto; min-width: 0; }
  .pagination { justify-content: center; padding: 10px; flex-wrap: wrap; }

  /* 表单：单列 */
  .form-grid { grid-template-columns: 1fr; gap: 12px; }

  /* 弹窗：几乎全屏 + 底部按钮拉通 */
  .modal-box,
  .modal-box.modal-sm,
  .modal-box.modal-lg { width: calc(100vw - 20px); max-height: 90vh; }
  .modal-head { padding: 14px 16px; }
  .modal-head h3 { font-size: 15px; }
  .modal-body { padding: 16px; }
  .modal-foot { padding: 12px 16px; flex-wrap: wrap; }
  .modal-foot .btn { flex: 1; justify-content: center; min-width: 110px; }

  /* 预警抽屉：全宽 */
  .drawer { width: 100vw; }

  /* AI 助手：面板贴底全宽，悬浮球上提避开手势区 */
  .ai-fab { right: 16px; bottom: 20px; width: 48px; height: 48px; }
  .ai-panel {
    right: 10px; left: 10px; bottom: 78px;
    width: auto;
    height: min(66vh, 440px);
  }

  /* AI 视觉监控墙 / 驾驶舱监视带：单列 */
  .cam-grid { grid-template-columns: 1fr; gap: 12px; }
  .vis-strip { grid-template-columns: 1fr 1fr; gap: 8px; }
  .vis-cam { padding: 8px 9px; gap: 7px; }
  .mon-summary { gap: 12px 16px; padding: 11px 13px; }
  .mon-summary .ms-item { font-size: 11px; }
  .mon-summary .ms-item b { font-size: 16px; }

  /* 工艺流程图 / 工序编辑器：竖向排列 */
  .flow-steps { flex-direction: column; }
  .flow-step { width: 100%; }
  .flow-arrow { align-self: center; transform: rotate(90deg); }
  .op-editor { max-height: 50vh; }
  .op-row .op-line { gap: 6px; }
  .op-row input, .op-row select { flex: 1 1 auto; min-width: 0; }

  /* 详情、库区、权限矩阵 */
  .detail-grid { grid-template-columns: 1fr; }
  .wh-grid { grid-template-columns: 1fr; }
  .perm-table { font-size: 12px; }
  .feed-list { max-height: 260px; }
}

/* ===== 小屏手机（≤ 420px） ===== */
@media (max-width: 420px) {
  .stat-grid { grid-template-columns: 1fr; }
  .vis-strip { grid-template-columns: 1fr; }
  .chart-panel canvas { height: 168px; }
  .modal-foot .btn { min-width: 0; }
}

/* ===== 触控设备：去除 hover 位移、加大点击区 ===== */
@media (hover: none) and (pointer: coarse) {
  .stat-card:hover,
  .cam-card:hover,
  .vis-cam:hover,
  .wh-card:hover { transform: none; }
  .btn { min-height: 34px; }
  .btn-sm { min-height: 30px; }
  .tabs .tab { padding-top: 9px; padding-bottom: 9px; }
  .data-table tbody tr:hover { background: var(--bg-hover); }
}

/* ==================== 清晰工作区：统一密度与表面 ==================== */
.btn { justify-content: center; font-weight: 500; }
.btn-primary { font-weight: 600; }
.btn:disabled { opacity: .55; }
.stat-card, .chart-panel, .settings-panel { min-width: 0; }
.stat-card { padding: 20px; }
.stat-grid, .chart-grid { gap: 20px; }
.data-table th { background: var(--table-head); }
.data-table td { color: var(--text-hi); }
.data-table tbody tr:nth-child(even) { background: var(--table-stripe); }
.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table .btn-sm { min-height: 30px; height: 30px; }
.table-toolbar { padding: 16px; gap: 12px; }
.table-toolbar .filter-input { min-width: 120px; max-width: 100%; }
.form-grid { gap: 20px; }
.form-item input, .form-item select, .form-item textarea, .filter-select, .filter-input { font-size: 14px; }
.form-item input:not([type="checkbox"]):not([type="radio"]), .form-item select, .form-item textarea { border-color: var(--line-strong); }
.form-item input[type="checkbox"], .form-item input[type="radio"] { width: 18px; height: 18px; }
.form-item textarea { min-height: 96px; }
.form-item .err-msg { font-size: 12px; }
.tag { font-size: 12px; padding: 3px 9px; line-height: 1.5; }
.modal-head { padding: 18px 24px; }
.modal-head h3 { font-size: 20px; letter-spacing: 0; }
.modal-body { padding: 24px; overscroll-behavior: contain; }
.modal-foot { padding: 16px 24px; background: var(--bg-raised); }
.modal-close svg { width: 18px; height: 18px; }
.toast { background: var(--bg-panel-solid); font-size: 14px; }
.empty-state { color: var(--text-mid); font-size: 14px; }
.alert-item.read { opacity: 1; background: var(--bg-base); }
.alert-item.read .a-title { color: var(--text-mid); font-weight: 400; }
.ai-msg { font-size: 14px; }
.ai-msg.bot { background: var(--bg-raised); }
.ai-input input { min-width: 0; height: 40px; border-radius: 8px; font-size: 14px; }
.flow-step { max-width: none; }
.cam-live .cl-osd, .cam-live .cl-rec { padding: 2px 5px; border-radius: 4px; background: var(--bg-panel-solid); }
.cam-live .cl-target::after { background: var(--bg-panel-solid); }
.barcode-box, .barcode-bars-wrap, .label-right svg { background: var(--print-paper); color: var(--print-ink); }
.barcode-box .barcode-text { color: var(--print-ink); }

/* ==================== 企业设置 / 六主题选择 ==================== */
.theme-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.theme-option { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 12px; gap: 8px; text-align: left; background: var(--bg-panel-solid); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: border-color .18s, background .18s; }
.theme-option:hover { border-color: var(--line-strong); background: var(--bg-hover); }
.theme-option.active, .theme-option.selected, .theme-option[aria-checked="true"], .theme-option[aria-pressed="true"], .theme-option:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.theme-option:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.theme-option:disabled { opacity: .6; cursor: not-allowed; }
.theme-preview { width: 100%; min-height: 72px; display: flex; align-items: stretch; gap: 5px; padding: 8px; overflow: hidden; border-radius: 6px; background: var(--bg-deep); border: 1px solid var(--line); }
.theme-preview > span, .theme-preview > i { flex: 1; display: block; min-width: 0; border-radius: 3px; }
.theme-preview > span:first-child, .theme-preview > i:first-child { flex: 1.5; }
.theme-name { display: block; color: var(--text-hi); font-size: 14px; font-weight: 600; line-height: 1.5; }
.theme-description { display: block; font-size: 12px; line-height: 1.6; color: var(--text-mid); font-weight: 400; }
.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 320px); gap: 24px; align-items: start; }
.settings-panel { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-panel-solid); }
.settings-panel + .settings-panel { margin-top: 24px; }
.settings-panel h2 { font-size: 24px; line-height: 1.4; }
.settings-panel h3 { font-size: 18px; margin-bottom: 12px; }
.settings-panel p { color: var(--text-mid); line-height: 1.8; }
.settings-panel .form-grid { margin-top: 24px; }
.settings-preview { position: sticky; top: 0; min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raised); }
.settings-preview h3 { font-size: 16px; margin-bottom: 16px; }
.brand-preview { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 24px 16px; min-height: 180px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-panel-solid); overflow-wrap: anywhere; }
.brand-preview img { display: block; width: 96px; height: 96px; max-width: 100%; object-fit: contain; }
.brand-preview h3, .brand-preview strong { font-size: 20px; color: var(--text-hi); margin: 0; }
.brand-preview p, .brand-preview small { font-size: 13px; color: var(--text-mid); }
.image-picker { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; padding: 16px; min-height: 112px; background: var(--bg-input); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); }
.image-picker img { width: 80px; height: 80px; object-fit: contain; border-radius: 6px; }
.image-picker input[type="file"] { height: auto; max-width: 100%; padding: 8px 0; border: none; font-size: 13px; }
.image-picker input::file-selector-button { min-height: 36px; padding: 6px 12px; margin-right: 10px; color: var(--text-hi); background: var(--bg-raised); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.module-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.module-option { display: flex; align-items: flex-start; gap: 12px; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-input); }
.module-option input[type="checkbox"] { width: 18px; height: 18px; flex-shrink: 0; margin-top: 3px; }
.module-option:has(input:checked) { border-color: var(--neon-cyan-dim); background: var(--neon-cyan-faint); }
.module-option:has(input:disabled) { cursor: not-allowed; }
.module-option label, .module-option strong { color: var(--text-hi); font-size: 14px; font-weight: 600; }
.module-option small, .module-option p { display: block; color: var(--text-mid); font-size: 12px; margin-top: 4px; }
.module-status { display: inline-flex; align-items: center; gap: 5px; color: var(--text-mid); background: var(--bg-raised); border: 1px solid var(--line); border-radius: 5px; padding: 2px 7px; font-size: 12px; white-space: nowrap; }
.module-status.enabled, .module-status.active { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.module-status.disabled { color: var(--text-dim); }
.settings-tabs { display: flex; align-items: center; gap: 8px; overflow-x: auto; max-width: 100%; border-bottom: 1px solid var(--line); margin-bottom: 24px; padding-bottom: 8px; }
.settings-tabs > button, .settings-tabs > a, .settings-tabs [role="tab"] { flex-shrink: 0; min-height: 40px; padding: 8px 16px; font-size: 14px; border-radius: 6px; color: var(--text-mid); }
.settings-tabs .active, .settings-tabs [aria-selected="true"] { background: var(--neon-cyan-faint); color: var(--accent); font-weight: 600; }

/* ==================== 仪表盘：企业欢迎区 + 指标带 + 真实记录 ==================== */
.dashboard-page { max-width: 1680px; margin-inline: auto; }
.dashboard-welcome { display: flex; align-items: flex-start; justify-content: space-between; gap: 32px; padding: 8px 0 28px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.dashboard-welcome-copy { min-width: 0; }
.dashboard-eyebrow { color: var(--accent); font-size: 11px; font-family: var(--font-num); letter-spacing: .12em; margin-bottom: 12px; }
.dashboard-welcome h1 { font-size: 28px; line-height: 1.45; font-weight: 650; letter-spacing: -.02em; overflow-wrap: anywhere; }
.dashboard-welcome h1 span { display: inline-block; padding-left: 16px; margin-left: 16px; border-left: 1px solid var(--line-strong); color: var(--text-mid); font-weight: 400; font-size: 20px; }
.dashboard-welcome p { max-width: 720px; font-size: 14px; line-height: 1.8; color: var(--text-mid); margin-top: 10px; white-space: pre-line; overflow-wrap: anywhere; }
.dashboard-date { text-align: right; flex-shrink: 0; padding-top: 6px; }
.dashboard-date span, .dashboard-date small { display: block; color: var(--text-dim); font-size: 12px; }
.dashboard-date time { display: block; color: var(--text-hi); font-family: var(--font-num); font-size: 20px; letter-spacing: .04em; margin: 2px 0 6px; }
.dashboard-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-panel-solid); margin-bottom: 24px; overflow: hidden; }
.dashboard-metric { padding: 20px 24px; min-width: 0; border-right: 1px solid var(--line); }
.dashboard-metric:nth-child(3n) { border-right: 0; }
.dashboard-metric:nth-child(n+4) { border-top: 1px solid var(--line); }
.dashboard-metrics[data-count="1"] { grid-template-columns: 1fr; }
.dashboard-metrics[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dashboard-metric:last-child { border-right: 0; }
.metric-label { display: flex; gap: 8px; align-items: center; color: var(--text-mid); font-size: 14px; }
.metric-label svg { width: 16px; height: 16px; color: var(--text-dim); flex-shrink: 0; }
.metric-value { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: clamp(32px, 2.3vw, 40px); letter-spacing: -.035em; line-height: 1.25; font-weight: 600; margin-top: 14px; overflow-wrap: anywhere; }
.metric-value small { font-family: var(--font-body); font-size: 12px; font-weight: 400; letter-spacing: 0; margin-left: 8px; color: var(--text-dim); }
.dashboard-metric p { color: var(--text-dim); font-size: 11px; line-height: 1.6; margin-top: 8px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: stretch; }
.dashboard-grid > :only-child { grid-column: 1 / -1; }
.dashboard-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.panel-heading h3 { font-size: 16px; color: var(--text-hi); font-weight: 600; line-height: 1.5; }
.panel-heading p { font-size: 12px; color: var(--text-dim); line-height: 1.6; margin-top: 4px; }
.dashboard-link { display: inline-flex; align-items: center; min-height: 32px; font-size: 12px; white-space: nowrap; color: var(--accent); }
.dashboard-grid canvas { height: 240px; max-width: 100%; }
.chart-note { color: var(--text-dim); font-size: 11px; line-height: 1.7; margin-top: 12px; }
.dashboard-empty { display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; min-height: 230px; padding: 24px 12px; text-align: center; color: var(--text-mid); font-size: 14px; background: var(--bg-base); border: 1px dashed var(--line); border-radius: var(--radius-sm); }
.dashboard-empty small { color: var(--text-dim); font-size: 12px; max-width: 340px; line-height: 1.7; }
.dashboard-feed { display: flex; flex-direction: column; }
.dashboard-feed-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--text-mid); min-width: 0; }
.dashboard-feed-item:last-child { border-bottom: 0; }
.dashboard-feed-item:hover { text-decoration: none; color: var(--accent); }
.dashboard-feed-item .tag { flex-shrink: 0; font-size: 11px; }
.feed-copy { flex: 1; min-width: 0; }
.feed-copy strong { display: block; font-size: 13px; line-height: 1.5; color: var(--text-hi); font-weight: 500; overflow-wrap: anywhere; }
.feed-copy small { display: block; color: var(--text-dim); font-size: 11px; margin-top: 4px; }
.dashboard-vision { margin-top: 24px; }
.vision-summary { display: flex; flex-wrap: wrap; gap: 12px 32px; margin: 0 0 20px; font-size: 13px; color: var(--text-mid); }
.vision-summary b { color: var(--text-hi); font-family: var(--font-num); font-size: 18px; padding-left: 8px; }
.dashboard-vision .vc-name, .dashboard-vision .vc-meta { display: block; }
.dashboard-vision .vis-cam:hover { text-decoration: none; transform: none; box-shadow: none; }
.dashboard-basic { padding: 56px 32px; text-align: center; }
.dashboard-basic-icon { display: inline-flex; padding: 16px; border-radius: 12px; background: var(--neon-cyan-faint); color: var(--accent); margin-bottom: 20px; }
.dashboard-basic-icon svg { width: 28px; height: 28px; }
.dashboard-basic h2 { font-size: 24px; font-weight: 600; }
.dashboard-basic p { max-width: 580px; margin: 12px auto 0; line-height: 1.9; color: var(--text-mid); }
.dashboard-scope-note { font-size: 11px; color: var(--text-dim); margin-top: 24px; }

@media (min-width: 1280px) {
  .dashboard-metrics { grid-template-columns: repeat(var(--metric-count, 6), minmax(0, 1fr)); }
  .dashboard-metric:nth-child(3n) { border-right: 1px solid var(--line); }
  .dashboard-metric:last-child { border-right: 0; }
  .dashboard-metric:nth-child(n+4) { border-top: 0; }
}
@media (max-width: 1180px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .settings-preview { position: static; }
  .dashboard-metric { padding: 20px; }
}
@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-welcome { gap: 24px; }
  .dashboard-welcome h1 span { display: block; border: 0; padding: 0; margin: 6px 0 0; font-size: 16px; }
  .theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .chart-panel, .settings-panel, .settings-preview { padding: 20px; }
  .module-grid { grid-template-columns: 1fr; }
  .settings-tabs { gap: 4px; }
  .theme-grid { gap: 12px; }
  .theme-option { padding: 10px; }
  .theme-preview { min-height: 60px; }
  .modal-head, .modal-body, .modal-foot { padding: 16px; }
  .modal-head h3 { font-size: 18px; }
  .modal-foot .btn { min-height: 42px; }
  #toast-container { left: 16px; right: 16px; }
  .toast { min-width: 0; max-width: 100%; }
  .dashboard-welcome { padding-top: 0; padding-bottom: 24px; margin-bottom: 20px; flex-wrap: wrap; gap: 16px; }
  .dashboard-welcome h1 { font-size: 24px; }
  .dashboard-date { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 0; text-align: left; }
  .dashboard-date span { display: none; }
  .dashboard-date time { font-size: 14px; margin: 0; }
  .dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 20px; }
  .dashboard-metric { padding: 18px 16px; border-right: 1px solid var(--line); }
  .dashboard-metric:nth-child(3n) { border-right: 1px solid var(--line); }
  .dashboard-metric:nth-child(2n) { border-right: 0; }
  .dashboard-metric:nth-child(n+3) { border-top: 1px solid var(--line); }
  .metric-value { font-size: 32px; }
  .metric-label { font-size: 13px; gap: 6px; }
  .metric-label svg { width: 14px; height: 14px; }
  .dashboard-grid { gap: 20px; }
  .dashboard-grid canvas { height: 220px; }
  .dashboard-empty { min-height: 200px; }
  .dashboard-basic { padding: 40px 24px; }
}
@media (max-width: 360px) {
  .theme-grid { grid-template-columns: 1fr; }
  .dashboard-metrics { grid-template-columns: 1fr; }
  .dashboard-metric:nth-child(n) { border-right: 0; }
  .dashboard-metric + .dashboard-metric { border-top: 1px solid var(--line); }
  .panel-heading { gap: 8px; }
}
@media (hover: none) and (pointer: coarse) {
  .btn, .btn-sm, .data-table .btn-sm, .pagination button, .op-move-btns .btn { min-height: 40px; }
  .dashboard-link { min-height: 40px; }
}
@media print {
  .label-box, .label-print-area { background: var(--print-paper); --text-hi: var(--print-ink); --text-mid: var(--print-ink); --text-dim: var(--print-ink); }
}


