/* ============================================================
   连康食品设备管理系统 — 全局样式（自包含，无需外部 CDN）
   浅色企业主题
   ============================================================ */
:root {
  --primary: #0d6efd;
  --primary-dark: #0b5ed7;
  --success: #198754;
  --warning: #ffc107;
  --danger: #dc3545;
  --info: #0dcaf0;
  --bg: #f4f6f9;
  --panel: #ffffff;
  --border: #e3e8ef;
  --text: #212a3e;
  --muted: #6b7280;
  --shadow: 0 2px 10px rgba(16, 24, 40, .06);
  --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: "Microsoft YaHei", "微软雅黑", -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cdd5df; border-radius: 8px; }

/* ---------- 通用工具 ---------- */
.flex { display: flex; }
.between { display: flex; justify-content: space-between; align-items: center; }
.center { display: flex; align-items: center; }
.gap-1 { gap: .4rem; } .gap-2 { gap: .8rem; } .gap-3 { gap: 1.2rem; }
.mt-1{margin-top:.5rem}.mt-2{margin-top:1rem}.mt-3{margin-top:1.5rem}
.mb-1{margin-bottom:.5rem}.mb-2{margin-bottom:1rem}.mb-3{margin-bottom:1.5rem}
.muted { color: var(--muted); }
.hidden { display: none !important; }
.text-center { text-align: center; }
.w-100 { width: 100%; }
.fw-bold { font-weight: 700; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem .9rem; border: 1px solid transparent; border-radius: 8px;
  font-size: .875rem; background: #eef1f5; color: var(--text);
  transition: .15s; white-space: nowrap;
}
.btn:hover { filter: brightness(.97); }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: .3rem .6rem; font-size: .8rem; }
.btn-lg { padding: .75rem 1rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-outline { background: #fff; border-color: var(--border); }
.btn-outline-primary { background: #fff; border-color: var(--primary); color: var(--primary); }
.btn-outline-danger { background: #fff; border-color: var(--danger); color: var(--danger); }
.btn-ghost { background: transparent; }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-block; padding: .2em .55em; font-size: .72rem; font-weight: 700;
  color: #fff; border-radius: 6px; line-height: 1.4; white-space: nowrap;
}
.badge-primary { background: var(--primary); }
.badge-success { background: var(--success); }
.badge-warning { background: var(--warning); color: #000; }
.badge-danger  { background: var(--danger); }
.badge-muted   { background: #9aa4b2; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1.2rem;
  overflow: hidden;
}
.card-header {
  padding: .9rem 1.1rem; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  background: #fbfcfe;
}
.card-header h5 { font-size: 1rem; }
.card-body { padding: 1.1rem; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .875rem; }
table.tbl th, table.tbl td { padding: .7rem .75rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tbl thead th { background: #f7f9fc; color: var(--muted); font-weight: 600; white-space: nowrap; }
table.tbl tbody tr:hover { background: #f7fbff; }

/* ---------- 表单 ---------- */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: .4rem; }
.form-control, .form-select {
  width: 100%; padding: .6rem .75rem; font-size: .9rem;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text);
}
.form-control:focus, .form-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,110,253,.12); }
textarea.form-control { resize: vertical; min-height: 70px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
@media (max-width: 640px){ .form-row { grid-template-columns: 1fr; } }

/* ---------- 图片缩略图 ---------- */
.thumb {
  width: 64px; height: 64px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border); cursor: zoom-in; background: #f0f2f5;
}
.thumb-lg { width: 120px; height: 90px; }
.img-grid { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------- 上传区 ---------- */
.upload-area {
  border: 2px dashed #c7d0dc; border-radius: 10px; padding: 1.3rem 1rem;
  text-align: center; color: var(--muted); cursor: pointer; transition: .15s; background:#fbfcfe;
}
.upload-area:hover { border-color: var(--primary); color: var(--primary); background:#f5f9ff; }
.upload-area .ico { font-size: 1.8rem; }
.upload-preview { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.upload-preview .item { position: relative; }
.upload-preview img { width: 74px; height: 74px; object-fit: cover; border-radius: 8px; border:1px solid var(--border); }
.upload-preview .del {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--danger); color: #fff; border: 2px solid #fff; font-size: .7rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(16,24,40,.5); z-index: 2000;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal {
  background: #fff; border-radius: 14px; width: 100%; max-width: 640px;
  max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.modal-header { padding: 1rem 1.2rem; border-bottom: 1px solid var(--border); display:flex; justify-content:space-between; align-items:center; }
.modal-body { padding: 1.2rem; }
.modal-footer { padding: 1rem 1.2rem; border-top: 1px solid var(--border); display:flex; justify-content:flex-end; gap:.6rem; }
.modal-close { background: none; border: none; font-size: 1.4rem; color: var(--muted); }
.lightbox-mask { position: fixed; inset:0; background: rgba(0,0,0,.85); z-index: 3000; display:flex; align-items:center; justify-content:center; }
.lightbox-mask img { max-width: 92vw; max-height: 92vh; border-radius: 8px; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; top: 74px; right: 20px; z-index: 4000; display: flex; flex-direction: column; gap: .6rem; }
.toast {
  background: #fff; border-left: 4px solid var(--primary); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: .8rem 1rem; min-width: 260px; max-width: 340px;
  animation: slideIn .25s ease;
}
.toast.success { border-left-color: var(--success); }
.toast.warning { border-left-color: var(--warning); }
.toast.danger  { border-left-color: var(--danger); }
.toast .t-title { font-weight: 700; font-size: .9rem; margin-bottom: .2rem; }
.toast .t-msg { font-size: .82rem; color: var(--muted); }
@keyframes slideIn { from { transform: translateX(120%); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- 空状态 ---------- */
.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }
.empty .ico { font-size: 2.4rem; opacity: .5; }

/* ---------- 存储条 ---------- */
.storage-bar { height: 10px; background: #eef1f5; border-radius: 6px; overflow: hidden; }
.storage-bar > span { display:block; height: 100%; background: linear-gradient(90deg,var(--primary),var(--info)); }

/* ---------- 常见故障速查面板（v5，手机端维修汇报页） ----------
 * 位置很关键：机修接到单、动手修之前，先在这里看一眼这台机器以前坏过什么。
 * 所以默认展开，第一次就看到内容；看完可以点标题收起，让出屏幕空间。
 * 配色全部走 CSS 变量 —— 本项目是**浅色**主题，
 * 早先按深色写成 rgba(255,255,255,...) 的话在白底上几乎看不见。 */
.kb-box {
  margin: .6rem 0 1rem; border: 1px solid var(--primary);
  border-radius: 10px; overflow: hidden; background: #f5f9ff;
}
.kb-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: .55rem .8rem; background: rgba(13,110,253,.10);
  font-size: .9rem; font-weight: 600; cursor: pointer; user-select: none;
}
.kb-caret { font-size: .78rem; color: var(--muted); }
.kb-body-pad { padding: .6rem .8rem .8rem; }
.kb-item { border-top: 1px dashed var(--border); padding: .5rem 0; }
.kb-item:first-child { border-top: none; }
.kb-item .kb-f { font-weight: 600; font-size: .9rem; }
.kb-item .kb-i { font-size: .85rem; color: var(--text); margin-top: .2rem; white-space: pre-wrap; }
.kb-item .kb-m { font-size: .78rem; color: var(--muted); margin-top: .25rem; }
.kb-more { font-size: .82rem; color: var(--muted); padding: .45rem .8rem; }
