/* 天枢物流管家 · 独立控制台样式（无外部依赖，可在内网离线运行） */
:root {
  --primary: #0f766e;
  --primary-dark: #0b5b55;
  --primary-soft: #e6f4f2;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --border: #e3e8ee;
  --text: #1f2d3d;
  --text-sub: #5b6b7c;
  --text-faint: #94a3b3;
  --ok: #0f9960;
  --warn: #c8871a;
  --danger: #d93b3b;
  --info: #2b6cb0;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 32, 48, .08), 0 6px 20px rgba(16, 32, 48, .06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg); color: var(--text);
  font: 14px/1.55 -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; }

.boot { padding: 48px; text-align: center; color: var(--text-faint); }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #0f766e 0%, #0d9488 45%, #14b8a6 100%);
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 380px; background: #fff; border-radius: 16px;
  padding: 32px 28px; box-shadow: 0 24px 60px rgba(0, 40, 36, .3);
}
.login-card h1 { margin: 0 0 4px; font-size: 22px; letter-spacing: .5px; }
.login-card p.sub { margin: 0 0 22px; color: var(--text-sub); font-size: 13px; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 210px; flex: 0 0 210px; background: #0d2b2a; color: #cfe6e3;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { padding: 20px 18px 14px; font-size: 16px; font-weight: 600; color: #fff; }
.brand small { display: block; font-weight: 400; font-size: 11px; color: #7fb3ad; margin-top: 2px; }
.nav { flex: 1; padding: 6px 8px; overflow: auto; }
.nav a {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px; margin-bottom: 2px;
  border-radius: 8px; color: #b9d6d3; font-size: 13.5px;
}
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a.active { background: var(--primary); color: #fff; font-weight: 500; }
.nav a .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.side-foot { padding: 12px 14px; font-size: 12px; color: #7fb3ad; border-top: 1px solid rgba(255,255,255,.08); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px; background: var(--panel); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; padding: 0 18px; position: sticky; top: 0; z-index: 20;
}
.topbar h2 { margin: 0; font-size: 16px; font-weight: 600; flex: 1; }
.topbar .who { font-size: 12.5px; color: var(--text-sub); }
.content { padding: 18px; flex: 1; }

/* ---------- 卡片 / 网格 ---------- */
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.card h3 { margin: 0 0 12px; font-size: 14.5px; }
.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.c4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat .k { font-size: 12px; color: var(--text-sub); }
.stat .v { font-size: 26px; font-weight: 700; margin-top: 4px; letter-spacing: -.5px; }
.stat .v small { font-size: 13px; font-weight: 500; color: var(--text-faint); margin-left: 4px; }
.stat.accent { border-left: 3px solid var(--primary); }
.stat.warn { border-left: 3px solid var(--warn); }
.stat.danger { border-left: 3px solid var(--danger); }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }

/* ---------- 表单控件 ---------- */
input, select, textarea {
  font-family: inherit; font-size: 13.5px; color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
  background: #fff; outline: none; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15,118,110,.12); }
input[disabled], select[disabled] { background: #f6f8fa; color: var(--text-faint); }
label.f { display: block; margin-bottom: 10px; }
label.f span { display: block; font-size: 12px; color: var(--text-sub); margin-bottom: 4px; }
.inline { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline > * { width: auto; }
.inline input, .inline select { min-width: 130px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; color: var(--text); cursor: pointer; font-size: 13.5px; white-space: nowrap;
}
.btn:hover { border-color: #c9d3dc; background: #fafbfc; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--primary); padding: 6px 8px; }
.btn.ghost:hover { background: var(--primary-soft); }
.btn.danger { color: var(--danger); border-color: #f2c9c9; }
.btn.danger:hover { background: #fdf3f3; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 表格 ---------- */
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { background: #f7f9fb; font-weight: 600; color: var(--text-sub); font-size: 12px; position: sticky; top: 0; z-index: 2; }
tbody tr:hover { background: #fafcfc; }
tbody tr:last-child td { border-bottom: none; }
td.wrap, th.wrap { white-space: normal; min-width: 220px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 36px; text-align: center; color: var(--text-faint); font-size: 13px; }

/* ---------- 徽标 ---------- */
.tag {
  display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px;
  font-size: 11.5px; line-height: 18px; border: 1px solid transparent; white-space: nowrap;
}
.tag.gray { background: #eef2f5; color: #5b6b7c; }
.tag.blue { background: #e8f1fb; color: #2b6cb0; }
.tag.green { background: #e6f6ee; color: #0f9960; }
.tag.orange { background: #fdf3e3; color: #b9740f; }
.tag.red { background: #fdeaea; color: #c92c2c; }
.tag.violet { background: #f0ecfb; color: #6b46c1; }

/* ---------- 进度条 ---------- */
.bar { height: 6px; border-radius: 999px; background: #edf1f5; overflow: hidden; min-width: 80px; }
.bar > i { display: block; height: 100%; background: var(--primary); border-radius: 999px; transition: width .3s; }

/* ---------- 作业台 ---------- */
.work-top { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.work-top .card { flex: 1; min-width: 260px; margin-bottom: 0; }
.scan-box { display: flex; gap: 8px; align-items: center; }
.scan-box input { font-size: 16px; padding: 12px 14px; letter-spacing: .5px; }
.scan-result { margin-top: 10px; font-size: 13px; min-height: 20px; }
.scan-result.ok { color: var(--ok); }
.scan-result.bad { color: var(--danger); }
.scan-result.warn { color: var(--warn); }

.step-head { display: flex; gap: 6px; flex-wrap: wrap; }
.step-pill {
  padding: 4px 10px; border-radius: 999px; font-size: 12px; border: 1px solid var(--border);
  background: #fff; cursor: pointer; color: var(--text-sub);
}
.step-pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.cell {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 7px;
  cursor: pointer; border: 1px dashed #cbd5dd; color: var(--text-faint); font-size: 12.5px;
  min-width: 68px; justify-content: center;
}
.cell:hover { border-color: var(--primary); color: var(--primary); }
.cell.done { border: 1px solid #bfe6d2; background: #eefaf3; color: #0f9960; }
.cell.abnormal { border: 1px solid #f2c9c9; background: #fdf3f3; color: #c92c2c; }
.cell.skipped { border: 1px solid var(--border); background: #f6f8fa; color: var(--text-faint); }
.cell .pic { font-size: 11px; opacity: .8; }

.photo-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.photo-grid img {
  width: 78px; height: 78px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); cursor: zoom-in;
}
.photo-slot {
  width: 78px; height: 78px; border-radius: 8px; border: 1px dashed #cbd5dd;
  display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--text-faint);
  cursor: pointer; text-align: center; padding: 4px;
}
.photo-slot:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- 弹层 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 30, 40, .45); display: flex;
  align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal {
  background: #fff; border-radius: 14px; width: 100%; max-width: 560px; max-height: 88vh;
  overflow: auto; box-shadow: 0 24px 70px rgba(0, 0, 0, .3);
}
.modal.wide { max-width: 900px; }
.modal header { padding: 16px 18px; border-bottom: 1px solid var(--border); font-weight: 600; }
.modal .body { padding: 16px 18px; }
.modal footer { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 10px; }

/* ---------- 提示 ---------- */
.toast-wrap { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #22333f; color: #fff; padding: 10px 14px; border-radius: 9px; font-size: 13px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: 340px; animation: pop .18s ease-out;
}
.toast.err { background: #b62c2c; }
.toast.ok { background: #0f7a5a; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.muted { color: var(--text-sub); font-size: 12.5px; }
.mono { font-variant-numeric: tabular-nums; }
.hint { color: var(--text-faint); font-size: 12px; margin-top: 6px; }
.sect-title { font-size: 13px; font-weight: 600; color: var(--text-sub); margin: 18px 0 8px; }

@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: static; flex-direction: column; }
  .nav { display: flex; overflow-x: auto; gap: 4px; padding: 8px; }
  .nav a { white-space: nowrap; }
  .side-foot { display: none; }
  .topbar { height: auto; padding: 10px 14px; flex-wrap: wrap; }
  .content { padding: 12px; }
}
