/* 运营管理后台 · 样式（无外部依赖） */
[v-cloak] { display: none; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font: 14px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: #1f2937; background: #f1f5f9;
}
a { color: #2563eb; text-decoration: none; }

.page-loading { padding: 120px 0; text-align: center; color: #64748b; }

/* ---------- 登录 ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.auth-card {
  width: 380px; background: #fff; border-radius: 12px; padding: 40px 36px 32px;
  box-shadow: 0 10px 40px rgba(15, 23, 42, .08);
}
.auth-logo { font-size: 40px; text-align: center; }
.auth-card h1 { font-size: 20px; text-align: center; margin: 8px 0 4px; }
.auth-sub { text-align: center; color: #64748b; margin-bottom: 22px; font-size: 13px; }
.auth-card label { display: block; font-size: 13px; color: #475569; margin-bottom: 14px; }
.auth-card input, .modal label input {
  display: block; width: 100%; margin-top: 4px; padding: 9px 12px;
  border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px; outline: none;
}
.auth-card input:focus, .modal label input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.form-error { color: #dc2626; font-size: 13px; margin: 4px 0 10px; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 216px; flex-shrink: 0; background: #0f172a; color: #cbd5e1;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.side-brand { color: #fff; font-size: 16px; font-weight: 600; padding: 22px 20px 18px; }
.side-item {
  display: flex; align-items: center; gap: 10px; color: #cbd5e1;
  padding: 11px 20px; font-size: 14px; transition: background .15s;
}
.side-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-item.active { background: #2563eb; color: #fff; }
.side-icon { width: 20px; text-align: center; }
.side-foot { margin-top: auto; padding: 16px 20px; font-size: 12px; color: #475569; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 56px; background: #fff; border-bottom: 1px solid #e2e8f0;
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
  position: sticky; top: 0; z-index: 10;
}
.topbar-title { font-size: 16px; font-weight: 600; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.user-chip { color: #475569; font-size: 13px; }

.content { padding: 24px; }

/* ---------- 组件 ---------- */
.card {
  background: #fff; border-radius: 10px; padding: 20px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .06); margin-bottom: 18px;
}
.card h3 { font-size: 15px; margin-bottom: 14px; color: #0f172a; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat {
  background: #fff; border-radius: 10px; padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
}
.stat .num { font-size: 28px; font-weight: 700; color: #0f172a; }
.stat .label { color: #64748b; font-size: 13px; margin-top: 2px; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; padding: 9px 10px; background: #f8fafc; color: #64748b;
  font-weight: 600; border-bottom: 1px solid #e2e8f0; white-space: nowrap;
}
.tbl td { padding: 9px 10px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.tbl tr:hover td { background: #f8fafc; }
.tbl .ops { white-space: nowrap; text-align: right; }

.badge { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; }
.badge.green { background: #dcfce7; color: #15803d; }
.badge.red { background: #fee2e2; color: #b91c1c; }
.badge.gray { background: #e2e8f0; color: #475569; }
.badge.blue { background: #dbeafe; color: #1d4ed8; }

.btn {
  display: inline-block; padding: 7px 14px; border-radius: 8px; border: 1px solid #cbd5e1;
  background: #fff; color: #334155; font-size: 13px; cursor: pointer; transition: all .15s;
}
.btn:hover { border-color: #94a3b8; background: #f8fafc; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.btn-danger { color: #dc2626; border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; border-color: #dc2626; }
.btn-ghost { border: none; background: transparent; color: #475569; padding: 5px 8px; }
.btn-ghost:hover { background: #f1f5f9; }
.btn-sm { padding: 4px 9px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; padding: 10px; font-size: 14px; }
.tbl .btn-sm { margin-left: 6px; }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar select {
  padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 13px; background: #fff; min-width: 220px;
}
.tabs { display: flex; gap: 4px; border-bottom: 2px solid #e2e8f0; margin-bottom: 18px; }
.tabs button {
  padding: 9px 18px; border: none; background: none; font-size: 14px; color: #64748b;
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.tabs button.active { color: #2563eb; border-bottom-color: #2563eb; font-weight: 600; }

.muted { color: #94a3b8; font-size: 12px; }
.empty { text-align: center; color: #94a3b8; padding: 34px 0; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
  display: flex; align-items: flex-start; justify-content: center; z-index: 100; padding: 60px 16px 16px;
}
.modal {
  background: #fff; border-radius: 12px; width: 520px; max-width: 100%;
  max-height: calc(100vh - 100px); display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(15, 23, 42, .25);
}
.modal.wide { width: 760px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid #f1f5f9;
}
.modal-head b { font-size: 15px; }
.modal-head .x { border: none; background: none; font-size: 18px; color: #94a3b8; cursor: pointer; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 12px 20px; border-top: 1px solid #f1f5f9; text-align: right; }
.modal-foot .btn { margin-left: 10px; }
.modal label { display: block; font-size: 13px; color: #475569; margin-bottom: 14px; }

.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.img-grid img {
  width: 100%; height: 80px; object-fit: cover; border-radius: 8px;
  border: 1px solid #e2e8f0; background: #f8fafc;
}
.json-box {
  background: #0f172a; color: #e2e8f0; border-radius: 8px; padding: 12px;
  font: 12px/1.5 ui-monospace, Consolas, monospace; overflow: auto; max-height: 320px; white-space: pre-wrap; word-break: break-all;
}

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: 13px; }
.kv .k { color: #64748b; }
.kv .v { word-break: break-all; }

.toast {
  position: fixed; top: 70px; right: 24px; z-index: 200; padding: 11px 18px;
  border-radius: 8px; color: #fff; font-size: 13px; box-shadow: 0 8px 24px rgba(15,23,42,.2);
  max-width: 420px;
}
.toast.ok { background: #059669; }
.toast.err { background: #dc2626; }
.fade-enter-active, .fade-leave-active { transition: opacity .25s; }
.fade-enter-from, .fade-leave-to { opacity: 0; }

.cover-thumb { width: 56px; height: 36px; object-fit: cover; border-radius: 6px; border: 1px solid #e2e8f0; vertical-align: middle; background: #f8fafc; }

/* 槽位九宫格 */
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.slot-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px; }
.slot-card.occupied { border-color: #93c5fd; background: #f8fbff; }
.slot-card.abnormal { border-color: #fecaca; background: #fff8f8; }
.slot-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.slot-head b { font-size: 14px; }
.slot-cover { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; border: 1px solid #e2e8f0; background: #f8fafc; display: block; }
.slot-cover-empty { width: 100%; height: 110px; border-radius: 8px; border: 1px dashed #cbd5e1; display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: 12px; background: #f8fafc; }
.slot-name { font-weight: 600; font-size: 14px; margin: 10px 0 2px; }
.slot-preset-note { font-size: 12px; color: #94a3b8; margin-bottom: 10px; }
.slot-ops { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.slot-ops .btn-sm { margin-left: 0; }
