/* ============================================================================
   腾龙发科AI元宇宙 · V54 后台样式扩展
   一、补齐后台通用布局类（.topbar / .admin-main / .page-header / .btn-logout）
   二、补齐侧边栏注入容器类（.sidebar-menu / .menu-group-title）
   三、V54 五大专属页样式（前缀 a54-）
   统一深色科技风，叠加于 admin.css 之上
   ============================================================================ */

/* ---------------- 一、后台通用布局补齐 ---------------- */
.topbar {
  height: 60px;
  background: rgba(30,41,59,0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(99,102,241,0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: #e2e8f0; }
.topbar-right { display: flex; align-items: center; }
.btn-logout {
  padding: 7px 16px; border-radius: 8px; font-size: 13px; cursor: pointer;
  background: transparent; border: 1px solid rgba(99,102,241,0.4); color: #a5b4fc; transition: .2s;
}
.btn-logout:hover { background: rgba(99,102,241,0.15); color: #fff; }
.admin-main { flex: 1; padding: 24px; overflow-y: auto; min-width: 0; }
.page-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.page-header h1 { font-size: 21px; font-weight: 700; color: #fff; }
.header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.a54-top-time { color: #64748b; font-size: 13px; margin-right: 16px; }
.a54-top-link { color: #a5b4fc; text-decoration: none; margin-right: 16px; font-size: 13px; }
.a54-top-link:hover { color: #fff; text-decoration: underline; }
.a54-top-user { margin-right: 12px; color: #cbd5e1; font-size: 13px; }

/* ---------------- 二、侧边栏注入容器 ---------------- */
.sidebar-menu { flex: 1; padding: 12px; overflow-y: auto; }
.sidebar-menu .menu-group-title {
  padding: 14px 14px 6px; font-size: 11px; font-weight: 600; color: #64748b;
  letter-spacing: 1px; text-transform: uppercase;
}
.sidebar-menu .menu-group:first-child .menu-group-title { padding-top: 4px; }
.sidebar-menu .menu-item { display: flex; }
.sidebar-menu .menu-item > a {
  display: flex; align-items: center; gap: 10px; width: 100%;
  color: inherit; text-decoration: none; font-size: inherit;
}
.sidebar-menu .menu-item.active {
  background: linear-gradient(135deg, rgba(99,102,241,0.25), rgba(139,92,246,0.15));
  color: #fff; border-left: 3px solid #6366f1; padding-left: 11px;
}
.sidebar-menu .menu-icon { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0; }

/* ---------------- 三、V54 专属页 ---------------- */

/* 统计条 */
.a54-statbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.a54-stat {
  background: linear-gradient(150deg, rgba(30,41,59,0.92), rgba(15,23,42,0.86));
  border: 1px solid rgba(99,102,241,0.18); border-radius: 12px; padding: 16px 18px;
}
.a54-stat .lb { font-size: 12px; color: #94a3b8; margin-bottom: 8px; }
.a54-stat .vl { font-size: 23px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.a54-stat .sub { font-size: 11px; color: #64748b; margin-top: 4px; }
.a54-stat.green .vl { color: #34d399; } .a54-stat.orange .vl { color: #fbbf24; }
.a54-stat.blue .vl { color: #60a5fa; } .a54-stat.purple .vl { color: #c084fc; }

/* 过滤条 */
.a54-filterbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.a54-select, .a54-input {
  padding: 8px 12px; border-radius: 8px; font-size: 13px; min-width: 160px;
  background: rgba(15,23,42,0.6); border: 1px solid rgba(99,102,241,0.25); color: #e2e8f0; outline: none;
}
.a54-select:focus, .a54-input:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }
.a54-input { min-width: 200px; }

/* 卡片 */
.a54-card {
  background: rgba(30,41,59,0.7); border: 1px solid rgba(99,102,241,0.15);
  border-radius: 14px; padding: 20px; margin-bottom: 18px;
}
.a54-card h3 { margin: 0 0 14px; font-size: 15px; color: #fff; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.a54-card h3 .ops { display: flex; gap: 8px; }
.a54-rules-extra { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed rgba(99,102,241,0.2); }

/* 按钮补充 */
.a54-btn {
  padding: 8px 16px; border-radius: 8px; font-size: 13px; cursor: pointer; transition: .18s;
  background: rgba(15,23,42,0.6); border: 1px solid rgba(99,102,241,0.3); color: #cbd5e1;
}
.a54-btn:hover { border-color: #6366f1; color: #fff; background: rgba(99,102,241,0.15); }
.a54-btn.primary { background: linear-gradient(135deg,#6366f1,#8b5cf6); color: #fff; border: none; }
.a54-btn.primary:hover { filter: brightness(1.12); }
.a54-btn.green { background: linear-gradient(135deg,#10b981,#059669); color: #fff; border: none; }
.a54-btn.danger { color: #fca5a5; border-color: rgba(239,68,68,0.4); background: transparent; }
.a54-btn.danger:hover { background: rgba(239,68,68,0.12); }
.a54-btn:disabled { opacity: .5; cursor: not-allowed; }

/* 表格小标签 */
.a54-tag { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: 11.5px; font-weight: 600; }
.a54-tag.S { background: rgba(168,85,247,0.18); color: #d8b4fe; } .a54-tag.A { background: rgba(59,130,246,0.18); color: #93c5fd; }
.a54-tag.B { background: rgba(16,185,129,0.18); color: #6ee7b7; } .a54-tag.C { background: rgba(148,163,184,0.18); color: #cbd5e1; }
.a54-tag.wait { background: rgba(245,158,11,0.18); color: #fcd34d; } .a54-tag.disp { background: rgba(59,130,246,0.18); color: #93c5fd; }
.a54-tag.grab { background: rgba(99,102,241,0.2); color: #a5b4fc; } .a54-tag.done { background: rgba(16,185,129,0.18); color: #6ee7b7; }
.a54-tag.on { background: rgba(16,185,129,0.18); color: #6ee7b7; } .a54-tag.off { background: rgba(148,163,184,0.15); color: #94a3b8; }

/* 配置项 */
.a54-cfg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.a54-cfg {
  display: flex; justify-content: space-between; align-items: center; padding: 12px 14px;
  border: 1px solid rgba(99,102,241,0.15); border-radius: 10px; background: rgba(15,23,42,0.45);
}
.a54-cfg .k { font-size: 13px; color: #cbd5e1; }
.a54-cfg .v { font-size: 14px; font-weight: 700; color: #a5b4fc; }
.a54-cfg .d { display: block; font-size: 11px; color: #64748b; margin-top: 3px; }

/* cron 状态卡 */
.a54-cron {
  display: flex; align-items: center; gap: 16px; padding: 16px 18px; margin-bottom: 12px;
  border: 1px solid rgba(99,102,241,0.15); border-radius: 12px; background: rgba(15,23,42,0.45);
}
.a54-cron .ic { font-size: 26px; }
.a54-cron .info { flex: 1; }
.a54-cron .nm { font-size: 14px; font-weight: 600; color: #fff; margin-bottom: 4px; }
.a54-cron .expr { font-family: 'Consolas', monospace; font-size: 12px; color: #c084fc; background: rgba(168,85,247,0.14); padding: 2px 8px; border-radius: 5px; display: inline-block; }
.a54-cron .dsc { font-size: 12px; color: #64748b; margin-top: 6px; font-family: 'Consolas', monospace; }

/* 信用分布 */
.a54-dist { display: grid; gap: 10px; }
.a54-dist-row { display: flex; align-items: center; gap: 12px; }
.a54-dist-row .lv { width: 42px; font-size: 13px; font-weight: 700; }
.a54-dist-row .bar { flex: 1; height: 20px; background: rgba(15,23,42,0.6); border-radius: 6px; overflow: hidden; }
.a54-dist-row .bar i { display: block; height: 100%; border-radius: 6px; }
.a54-dist-row .cnt { width: 76px; text-align: right; font-size: 13px; color: #cbd5e1; font-variant-numeric: tabular-nums; }

/* 调度节点网格 */
.a54-node-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.a54-node { border: 1px solid rgba(99,102,241,0.15); border-radius: 10px; padding: 14px; background: rgba(15,23,42,0.45); }
.a54-node .hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.a54-node .nm { font-size: 13.5px; font-weight: 600; color: #e2e8f0; }
.a54-node .meta { font-size: 12px; color: #94a3b8; line-height: 1.9; }
.a54-node .loadbar { height: 6px; background: rgba(15,23,42,0.7); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.a54-node .loadbar i { display: block; height: 100%; background: linear-gradient(90deg,#10b981,#f59e0b); }

/* 客户端卡片 */
.a54-client-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.a54-client { border: 1px solid rgba(99,102,241,0.15); border-radius: 12px; padding: 18px; background: rgba(15,23,42,0.45); }
.a54-client .hd { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.a54-client .ic { font-size: 28px; }
.a54-client .nm { font-size: 15px; font-weight: 700; color: #fff; }
.a54-client .vr { font-size: 12px; color: #94a3b8; }
.a54-client .meta { font-size: 12.5px; color: #94a3b8; line-height: 2; }
.a54-client .meta b { color: #cbd5e1; }

/* 空态 / 日志 */
.a54-empty { text-align: center; padding: 40px 20px; color: #64748b; font-size: 14px; }
.a54-log {
  background: #0b1220; color: #cbd5e1; border: 1px solid rgba(99,102,241,0.15); border-radius: 10px; padding: 14px;
  font-family: 'Consolas', monospace; font-size: 12.5px; line-height: 1.9; max-height: 320px; overflow-y: auto;
}
.a54-log .ok { color: #34d399; } .a54-log .err { color: #f87171; } .a54-log .info { color: #60a5fa; }

/* 自定义弹窗 / 提示（替代原生 alert / prompt） */
.a54-mask { position: fixed; inset: 0; background: rgba(2,6,23,.7); display: flex; align-items: center; justify-content: center; z-index: 9999; opacity: 0; transition: opacity .25s; padding: 20px; }
.a54-mask.show { opacity: 1; }
.a54-modal { background: #1e293b; border: 1px solid rgba(99,102,241,0.25); border-radius: 14px; width: 100%; max-width: 460px; padding: 24px; transform: translateY(14px); transition: transform .25s; max-height: 90vh; overflow-y: auto; }
.a54-mask.show .a54-modal { transform: translateY(0); }
.a54-modal h3 { margin: 0 0 18px; font-size: 17px; color: #fff; }
.a54-field { margin-bottom: 14px; }
.a54-field label { display: block; font-size: 13px; color: #94a3b8; margin-bottom: 6px; }
.a54-field .a54-input, .a54-field .a54-select { width: 100%; box-sizing: border-box; }
.a54-modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.a54-toast { position: fixed; top: 26px; left: 50%; transform: translate(-50%,-20px); background: #1e293b; border: 1px solid rgba(99,102,241,0.3); color: #fff; padding: 11px 22px; border-radius: 10px; font-size: 13.5px; z-index: 10000; opacity: 0; transition: all .3s; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.a54-toast.show { opacity: 1; transform: translate(-50%,0); }
.a54-toast.ok { background: #065f46; } .a54-toast.err { background: #7f1d1d; } .a54-toast.info { background: #1e3a8a; }

@media (max-width: 768px) {
  .admin-main { padding: 16px; }
  .a54-statbar { grid-template-columns: repeat(2, 1fr); }
  .a54-filterbar { flex-direction: column; align-items: stretch; }
  .a54-input, .a54-select { width: 100%; }
}
