:root {
  --ink: #0c111d;
  --ink-2: #161c2b;
  --accent: #4f46e5;
  --accent-weak: rgba(79, 70, 229, 0.16);
  --violet: #7c3aed;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --border: #e6e9ef;
  --text: #101828;
  --muted: #667085;
  --faint: #98a2b3;
  --ok: #067647;
  --warn: #b54708;
  --danger: #b42318;
  --radius: 12px;
}

* { box-sizing: border-box; }

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

[v-cloak] { display: none; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(1200px 600px at 20% 0%, #1e1b4b 0%, #0c111d 55%, #080b12 100%);
}
.login-card {
  width: 380px;
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.login-logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  display: flex; align-items: center; justify-content: center;
}
.login-title { font-size: 17px; font-weight: 700; letter-spacing: .3px; }
.login-sub { font-size: 12px; color: var(--faint); margin-top: 2px; }
.login-tip { font-size: 12px; color: var(--faint); margin-top: 14px; text-align: center; }

/* ---------- 布局 ---------- */
.layout { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: 232px;
  flex: 0 0 232px;
  background: var(--ink);
  padding: 22px 16px 18px;
  display: flex;
  flex-direction: column;
  color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; height: 44px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 36px;
}
.brand-name { font-size: 15px; font-weight: 700; line-height: 1.1; }
.brand-sub { font-size: 10px; color: #6e7a8f; margin-top: 3px; letter-spacing: .4px; }

.nav-group { margin-top: 22px; }
.nav-label { font-size: 11px; color: #5c6779; padding-left: 12px; margin-bottom: 8px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  height: 38px; padding: 0 12px; border-radius: 8px;
  font-size: 13px; color: #a7b0c0; cursor: pointer;
  transition: background .15s, color .15s;
  user-select: none;
}
.nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-item.active { background: var(--accent-weak); color: #fff; }
.nav-item .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .55; }
.nav-spacer { flex: 1; }
.side-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: 10px; cursor: pointer;
}
.side-user:hover { background: rgba(255,255,255,.05); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: #222b3d; display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #c7cfe0;
}

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 64px; flex: 0 0 64px;
  background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
}
.crumb { font-size: 12px; color: var(--faint); display: flex; align-items: center; gap: 8px; }
.crumb b { font-size: 14px; font-weight: 600; color: var(--text); }
.top-right { display: flex; align-items: center; gap: 12px; }
.pill {
  height: 34px; border-radius: 8px; display: flex; align-items: center;
  gap: 6px; padding: 0 12px; font-size: 12px;
}
.pill.ok { background: #ecfdf3; color: var(--ok); }
.pill.bad { background: #fef3f2; color: var(--danger); }
.dot-ok { width: 7px; height: 7px; border-radius: 50%; background: #12b76a; }

.content { flex: 1; overflow: auto; padding: 24px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 16px; }
.page-title { font-size: 20px; font-weight: 700; }
.page-desc { font-size: 12px; color: var(--muted); margin-top: 5px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.card-pad { padding: 18px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.card-title { font-size: 13px; font-weight: 600; }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px;
}
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font-size: 26px; font-weight: 700; margin: 6px 0 4px; letter-spacing: -.5px; }
.stat-sub { font-size: 11px; color: var(--faint); }
.stat-sub.up { color: var(--ok); }
.stat-sub.warn { color: var(--warn); }

.grid-2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 14px; }

/* ---------- 表格 ---------- */
.el-table th.el-table__cell {
  background: #fafbfc !important;
  font-weight: 500;
  color: var(--muted) !important;
  font-size: 12px;
}
.el-table { --el-table-border-color: #eef0f4; font-size: 13px; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 12px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); font-size: 12px; }
.link { color: var(--accent); cursor: pointer; font-size: 12px; }
.link + .link { margin-left: 10px; }
.link.danger { color: var(--danger); }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-top: 1px solid var(--border); }
.toolbar { display: flex; gap: 12px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }

.chart-box { padding: 8px 18px 18px; }
.spark { width: 100%; height: 200px; display: block; }

.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 12px; }
.bar-name { width: 130px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { display: block; flex: 1; height: 6px; border-radius: 3px; background: #eef0f5; overflow: hidden; }
/* span 默认是 inline，不加 display:block 的话 width/height 会被忽略，进度条永远看不见 */
.bar-fill { display: block; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--violet)); }
.bar-val { width: 78px; text-align: right; color: var(--muted); }

.secret-box {
  background: #0c111d; color: #a5f3fc; padding: 14px; border-radius: 8px;
  font-family: Consolas, monospace; font-size: 13px; word-break: break-all;
}
.notice {
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
  padding: 10px 12px; border-radius: 8px; font-size: 12px; margin-bottom: 12px;
}
.empty-tip { padding: 40px; text-align: center; color: var(--faint); font-size: 13px; }

.el-button--primary { --el-button-bg-color: var(--accent); --el-button-border-color: var(--accent); --el-button-hover-bg-color: #4338ca; --el-button-hover-border-color: #4338ca; }
.el-tag { border-radius: 6px; }
.el-dialog { border-radius: 14px; }
.form-hint { font-size: 11px; color: var(--faint); line-height: 1.7; margin-top: 4px; }

@media (max-width: 1100px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
