/* ==========================================================================
   PACK 再制造车间系统 · 共享设计系统（深色工业风）
   ========================================================================== */
:root {
  --bg: #070d18;
  --bg-2: #0a1424;
  --panel: #0e1a2e;
  --panel-2: #12203a;
  --line: #1e3252;
  --line-2: #26405f;
  --tx: #e9f0fd;
  --tx-2: #9db2d2;
  --tx-3: #6b83a6;
  --cyan: #22d3ee;
  --blue: #3b82f6;
  --amber: #f59e0b;
  --red: #ef4444;
  --green: #34d399;
  --violet: #a78bfa;
  --radius: 10px;
  --shadow: 0 8px 26px rgba(0, 0, 0, .45);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--tx);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background-image:
    radial-gradient(1200px 600px at 12% -10%, rgba(34, 211, 238, .10), transparent 60%),
    radial-gradient(900px 500px at 88% 0%, rgba(59, 130, 246, .10), transparent 55%);
}

a { color: var(--cyan); text-decoration: none; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #24405f; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #325b83; }

/* ---------------- 通用板件 ---------------- */
.panel {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel-h {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  font-size: 14px; font-weight: 700; letter-spacing: .4px;
}
.panel-h .sp { flex: 1; }
.panel-b { padding: 14px 16px; }

.muted { color: var(--tx-2); }
.dim { color: var(--tx-3); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }

/* ---------------- 按钮 ---------------- */
.btn {
  appearance: none; border: 1px solid var(--line-2); background: #16273f; color: var(--tx);
  padding: 7px 14px; border-radius: 8px; font-size: 13px; font-family: var(--font);
  cursor: pointer; transition: .16s; white-space: nowrap; line-height: 1.4;
}
.btn:hover { background: #1d3556; border-color: #35608f; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.pri { background: linear-gradient(180deg, #0ea5b7, #0b7f96); border-color: #16b6cc; color: #04141c; font-weight: 700; }
.btn.pri:hover { background: linear-gradient(180deg, #22d3ee, #0e9ab5); }
.btn.warn { background: #7a3410; border-color: #b45309; color: #ffe6cf; }
.btn.warn:hover { background: #9a4415; }
.btn.danger { background: #7f1d1d; border-color: #b91c1c; color: #ffe3e3; }
.btn.danger:hover { background: #a02020; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }

/* ---------------- 标签 ---------------- */
.tag {
  display: inline-block; padding: 1px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 600; line-height: 18px; white-space: nowrap;
  border: 1px solid transparent;
}
.tag.t-mo   { background: rgba(129, 140, 248, .16); color: #a5b4fc; border-color: rgba(129, 140, 248, .4); }
.tag.t-box  { background: rgba(167, 139, 250, .16); color: #c4b5fd; border-color: rgba(167, 139, 250, .4); }
.tag.t-fpc  { background: rgba(52, 211, 153, .14);  color: #6ee7b7; border-color: rgba(52, 211, 153, .4); }
.tag.t-tbd  { background: rgba(148, 163, 184, .16); color: #cbd5e1; border-color: rgba(148, 163, 184, .4); }
.tag.t-ok   { background: rgba(52, 211, 153, .14);  color: #6ee7b7; border-color: rgba(52, 211, 153, .4); }
.tag.t-warn { background: rgba(245, 158, 11, .16);  color: #fcd34d; border-color: rgba(245, 158, 11, .45); }
.tag.t-bad  { background: rgba(239, 68, 68, .16);   color: #fca5a5; border-color: rgba(239, 68, 68, .45); }
.tag.t-info { background: rgba(56, 189, 248, .16);  color: #7dd3fc; border-color: rgba(56, 189, 248, .4); }
.tag.t-gray { background: rgba(100, 116, 139, .18); color: #cbd5e1; border-color: rgba(100, 116, 139, .4); }
.tag.hot { box-shadow: 0 0 0 1px rgba(239, 68, 68, .5) inset; animation: bpulse 1.6s infinite; }
@keyframes bpulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* ---------------- 进度条 ---------------- */
.bar { height: 6px; border-radius: 6px; background: #16263d; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #22d3ee, #3b82f6); }
.bar.warn > i { background: linear-gradient(90deg, #f59e0b, #ef4444); }

/* ---------------- 表单 ---------------- */
.inp, select.inp, textarea.inp {
  width: 100%; background: #0b1626; border: 1px solid var(--line-2); color: var(--tx);
  padding: 9px 11px; border-radius: 8px; font-size: 13px; font-family: var(--font); outline: none;
}
.inp:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, .13); }
.inp::placeholder { color: #55708f; }
label.fld { display: block; margin-bottom: 12px; }
label.fld > span { display: block; font-size: 12px; color: var(--tx-2); margin-bottom: 6px; }
label.fld > span b { color: var(--red); }
.err { color: #fca5a5; font-size: 12px; margin-top: 6px; }
.hint { color: var(--tx-3); font-size: 12px; }

/* ---------------- 表格 ---------------- */
table.tb { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tb th {
  text-align: left; font-weight: 600; color: var(--tx-2); font-size: 12px;
  padding: 9px 10px; border-bottom: 1px solid var(--line); background: rgba(14, 26, 46, .7);
  position: sticky; top: 0; z-index: 2; white-space: nowrap;
}
table.tb td { padding: 9px 10px; border-bottom: 1px solid rgba(30, 50, 82, .55); vertical-align: middle; }
table.tb tbody tr:hover { background: rgba(34, 211, 238, .05); }
table.tb tbody tr.sel { background: rgba(34, 211, 238, .10); }

/* ---------------- 弹层 ---------------- */
.mask {
  position: fixed; inset: 0; background: rgba(3, 8, 16, .78); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 90; padding: 24px;
}
.modal {
  width: 100%; max-width: 620px; max-height: 88vh; overflow: auto;
  background: linear-gradient(180deg, #0f1d33, #0c1728);
  border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 24px 70px rgba(0, 0, 0, .7);
}
.modal-h { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 700; }
.modal-h .sp { flex: 1; }
.modal-b { padding: 18px; }
.modal-f { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
.x { cursor: pointer; color: var(--tx-3); font-size: 20px; line-height: 1; padding: 0 4px; }
.x:hover { color: var(--tx); }

/* ---------------- Chip 多选 ---------------- */
.chip {
  display: inline-block; padding: 3px 10px; margin: 2px 4px 2px 0;
  border-radius: 999px; border: 1px solid var(--line-2); background: #12233c;
  color: var(--tx-2); font-size: 12px; cursor: pointer; user-select: none;
  transition: .12s;
}
.chip:hover { border-color: var(--cyan); color: var(--tx); }
.chip.on { background: linear-gradient(180deg, #075985, #0c4a6e); border-color: #38bdf8; color: #ecfeff; box-shadow: 0 0 0 1px rgba(56,189,248,.25) inset; }
.chiprow { display: flex; flex-wrap: wrap; gap: 0; }
.brPlat { min-width: 200px; }

/* ---------------- 提示条 ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  background: #12233c; border: 1px solid var(--line-2); color: var(--tx);
  padding: 10px 20px; border-radius: 10px; font-size: 13px; z-index: 200;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .2s;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(-6px); }
.toast.bad { border-color: #b91c1c; background: #2a1010; }

.empty { padding: 34px 10px; text-align: center; color: var(--tx-3); font-size: 13px; }
.loading { padding: 40px; text-align: center; color: var(--tx-2); font-size: 13px; }
.spin {
  display: inline-block; width: 14px; height: 14px; border: 2px solid #2b4666;
  border-top-color: var(--cyan); border-radius: 50%; animation: sp .7s linear infinite;
  vertical-align: -2px; margin-right: 8px;
}
@keyframes sp { to { transform: rotate(360deg); } }
