/* 机器人之家 · 管理后台样式（复用产品设计系统：冷钢蓝 #0A6E9E / 安全橙 #DD5210） */
:root {
  --ink: #16374f;
  --ink-2: #1a2b3c;
  --primary: #0a6e9e;
  --primary-soft: #e6f1f7;
  --orange: #dd5210;
  --orange-soft: #fdeee4;
  --muted: #8494a3;
  --faint: #f3f5f7;
  --surface: #ffffff;
  --line: #e4e9ee;
  --line-strong: #d5dde5;
  --green: #1e8e5a;
  --green-soft: #e5f4ec;
  --red: #d64545;
  --red-soft: #fdeaea;
  --amber: #b8740a;
  --amber-soft: #faf1dd;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[v-cloak] { display: none; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--faint);
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: 14px; color: var(--ink); }

/* —— 登录 —— */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0a6e9e 0%, #16374f 60%, #0e2233 100%);
  padding: 24px;
}
.login-card {
  width: 380px; max-width: 100%; background: var(--surface); border-radius: 16px;
  padding: 36px 32px; box-shadow: 0 24px 60px rgba(7, 30, 46, .35);
}
.login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.login-logo .mark {
  width: 40px; height: 40px; border-radius: 10px; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700;
}
.login-logo h1 { font-size: 20px; color: var(--ink); }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 28px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; color: var(--ink); margin-bottom: 6px; font-weight: 500; }
.field input {
  width: 100%; height: 42px; border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 0 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.btn-primary {
  width: 100%; height: 44px; background: var(--primary); color: #fff; font-size: 15px; font-weight: 600;
  border-radius: 8px; transition: background .15s;
}
.btn-primary:hover { background: #085a82; }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.login-error { color: var(--red); font-size: 13px; margin-bottom: 12px; min-height: 18px; }

/* —— 布局 —— */
.layout { display: flex; height: 100vh; }
.sidebar {
  width: 220px; flex-shrink: 0; background: var(--ink-2); color: #c7d3dd;
  display: flex; flex-direction: column;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .brand .mark {
  width: 34px; height: 34px; border-radius: 9px; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px;
}
.sidebar .brand b { color: #fff; font-size: 15px; }
.sidebar .brand span { display: block; font-size: 11px; color: #7d93a5; }
.nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; margin-bottom: 2px;
  border-radius: 8px; color: #c7d3dd; font-size: 14px; text-align: left; transition: background .12s, color .12s;
}
.nav-item .ico { font-size: 16px; width: 20px; text-align: center; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.on { background: var(--primary); color: #fff; font-weight: 600; }
.sidebar .foot { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; color: #6f8699; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 60px; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
}
.topbar .crumb { font-size: 16px; font-weight: 600; color: var(--ink); }
.topbar .right { display: flex; align-items: center; gap: 14px; }
.topbar .admin { display: flex; align-items: center; gap: 9px; }
.topbar .avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.topbar .logout { color: var(--muted); font-size: 13px; padding: 6px 10px; border-radius: 6px; }
.topbar .logout:hover { color: var(--red); background: var(--red-soft); }

.content { flex: 1; overflow-y: auto; padding: 24px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.page-head h2 { font-size: 18px; color: var(--ink); }
.page-head .actions { display: flex; gap: 10px; }

/* —— 卡片 / 统计 —— */
.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.stat-card .label { font-size: 13px; color: var(--muted); }
.stat-card .value { font-size: 28px; font-weight: 700; color: var(--ink); margin-top: 6px; }
.stat-card .accent { width: 36px; height: 4px; border-radius: 2px; margin-top: 10px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.panel h3 { font-size: 15px; margin-bottom: 16px; color: var(--ink); }
.dist { display: flex; flex-direction: column; gap: 12px; }
.dist-row { display: flex; align-items: center; gap: 12px; }
.dist-row .name { width: 110px; font-size: 13px; color: var(--ink); text-align: right; flex-shrink: 0; }
.dist-row .bar { flex: 1; height: 12px; background: var(--faint); border-radius: 6px; overflow: hidden; }
.dist-row .bar i { display: block; height: 100%; background: var(--primary); border-radius: 6px; }
.dist-row .num { width: 40px; font-size: 13px; color: var(--muted); text-align: right; }
.dist-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }

/* —— 工具栏 / 表格 —— */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.search {
  flex: 1; min-width: 200px; height: 38px; border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 0 12px; outline: none;
}
.search:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.select {
  height: 38px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px;
  background: var(--surface); outline: none;
}
.btn { height: 38px; padding: 0 16px; border-radius: 8px; font-size: 14px; font-weight: 500; transition: all .12s; }
.btn-primary { width: auto; height: 38px; }
.btn-ghost { border: 1px solid var(--line-strong); color: var(--ink); background: var(--surface); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.btn-link { color: var(--primary); font-size: 13px; padding: 3px 6px; border-radius: 4px; }
.btn-link:hover { background: var(--primary-soft); }
.btn-link.danger { color: var(--red); }
.btn-link.danger:hover { background: var(--red-soft); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12px; background: #fafbfc; }
tbody tr:hover { background: #f7fafc; }
td .cell-main { font-weight: 500; color: var(--ink); }
td .cell-sub { color: var(--muted); font-size: 12px; }
td.wrap { white-space: normal; min-width: 200px; max-width: 420px; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.tag.blue { background: var(--primary-soft); color: var(--primary); }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.orange { background: var(--orange-soft); color: var(--orange); }
.tag.red { background: var(--red-soft); color: var(--red); }
.tag.amber { background: var(--amber-soft); color: var(--amber); }
.tag.gray { background: var(--faint); color: var(--muted); }

.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 16px; font-size: 13px; color: var(--muted); }
.pager button { width: 30px; height: 30px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--ink); background: var(--surface); }
.pager button:disabled { opacity: .4; cursor: not-allowed; }
.pager button:not(:disabled):hover { border-color: var(--primary); color: var(--primary); }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* —— 弹窗 —— */
.mask { position: fixed; inset: 0; background: rgba(14, 34, 51, .5); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal { background: var(--surface); border-radius: 14px; width: 640px; max-width: 100%; max-height: 90vh; display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; }
.modal-head .close { color: var(--muted); font-size: 22px; line-height: 1; padding: 0 6px; }
.modal-head .close:hover { color: var(--ink); }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field textarea {
  width: 100%; min-height: 120px; border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 10px 12px; outline: none; resize: vertical; line-height: 1.6;
}
.field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* —— 参数编辑器 —— */
.param-group { border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 16px; background: #fbfcfd; }
.param-group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.param-group-head .group-name {
  flex: 1; height: 36px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px;
  font-weight: 600; outline: none; background: var(--surface);
}
.param-group-head .group-name:focus { border-color: var(--primary); }
.param-item { display: grid; grid-template-columns: 1.1fr 1.5fr 1.1fr 1.5fr 32px; gap: 8px; margin-bottom: 8px; align-items: center; }
.param-item input { height: 34px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 0 8px; outline: none; background: var(--surface); }
.param-item input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.param-item-head { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.param-item-head span { padding-left: 4px; }
@media (max-width: 720px) {
  .param-item { grid-template-columns: 1fr 1fr; }
}

/* —— 品牌缩略图 —— */
.brand-cell { display: flex; align-items: center; gap: 10px; }
.brand-thumb {
  position: relative; width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; overflow: hidden;
}
.brand-thumb img, .logo-preview img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff;
}
.brand-initial { position: relative; }
.logo-field { display: flex; gap: 14px; align-items: center; }
.logo-preview {
  position: relative; width: 72px; height: 72px; border-radius: 14px; flex-shrink: 0;
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 700; overflow: hidden;
}
.logo-preview > span { position: relative; }
.logo-actions { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.logo-actions > input {
  width: 100%; height: 36px; border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 0 10px; outline: none; background: var(--surface);
}
.logo-actions > input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.logo-actions .row { display: flex; align-items: center; gap: 8px; }
.logo-actions .row .btn { cursor: pointer; }

/* —— Toast —— */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: var(--ink-2); color: #fff;
  padding: 11px 20px; border-radius: 8px; font-size: 14px; z-index: 200; box-shadow: 0 8px 24px rgba(7,30,46,.3);
}
.toast.error { background: var(--red); }

/* —— 响应式 —— */
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dist-grid { grid-template-columns: 1fr; }
  .sidebar { width: 64px; }
  .sidebar .brand b, .sidebar .brand span, .nav-item .label, .sidebar .foot { display: none; }
  .nav-item { justify-content: center; }
}
