:root {
  --sidebar-bg: #1d1e23;
  --sidebar-sub-bg: #14161a;
  --brand-blue: #409eff;
  --brand-blue-dark: #2563eb;
  --text-main: #303133;
  --border-light: #e4e7ed;
}
* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #f0f2f5;
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  background: radial-gradient(circle at 18% 20%, rgba(64, 158, 255, 0.22), transparent 45%),
              radial-gradient(circle at 82% 80%, rgba(59, 130, 246, 0.25), transparent 48%),
              linear-gradient(135deg, #0b1120 0%, #13233f 50%, #1e3a6e 100%);
}
.login-screen::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px; pointer-events: none;
}
.login-card {
  position: relative; z-index: 2; width: 410px; background: #ffffff;
  border-radius: 14px; padding: 42px 38px 34px; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.42);
}
.login-brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 8px; }
.login-brand svg { width: 34px; height: 34px; flex-shrink: 0; }
.login-title { font-size: 22px; font-weight: 700; color: #14161a; letter-spacing: 0.5px; }
.login-subtitle { text-align: center; font-size: 13px; color: #8c939d; margin-bottom: 30px; }
.login-submit-btn { width: 100%; height: 42px; font-size: 15px; font-weight: 600; letter-spacing: 2px; }
.login-foot { margin-top: 22px; text-align: center; font-size: 12px; color: #a8abb2; }

.admin-layout { height: 100vh; display: flex; overflow: hidden; }
.admin-sidebar {
  width: 220px; background: var(--sidebar-bg); color: #fff;
  display: flex; flex-direction: column; transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0; z-index: 20; box-shadow: 2px 0 8px rgba(0, 0, 0, 0.18);
}
.admin-sidebar.is-collapsed { width: 64px; }
.sidebar-logo {
  height: 50px; background: #14161a; display: flex; align-items: center; padding: 0 16px; gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06); overflow: hidden; white-space: nowrap;
}
.sidebar-logo svg { width: 28px; height: 28px; flex-shrink: 0; }
.sidebar-logo-text { font-size: 15px; font-weight: 700; color: #ffffff; letter-spacing: 0.4px; }
.sidebar-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; }
.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }
.el-menu.admin-el-menu { border-right: none !important; background: var(--sidebar-bg); }

.admin-main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: #f0f2f5; }
.navbar-top {
  height: 50px; background: #ffffff; display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px; border-bottom: 1px solid #edf0f5; flex-shrink: 0;
}
.navbar-left { display: flex; align-items: center; gap: 14px; }
.collapse-trigger {
  width: 32px; height: 32px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #4e5969; font-size: 18px; transition: background 0.15s;
}
.collapse-trigger:hover { background: #f2f3f5; color: var(--brand-blue); }
.navbar-right { display: flex; align-items: center; gap: 8px; }
.tool-btn {
  width: 34px; height: 34px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #4e5969; position: relative; transition: background 0.15s;
}
.tool-btn:hover { background: #f2f3f5; color: var(--brand-blue); }
.admin-user-trigger {
  display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 10px; border-radius: 6px;
  color: #303133; font-size: 13.5px; font-weight: 500;
}
.admin-user-trigger:hover { background: #f2f3f5; }
.avatar-badge {
  width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, #409eff, #2563eb);
  color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}

.tags-view-bar {
  height: 34px; background: #ffffff; border-bottom: 1px solid #d8dce5;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04); display: flex; align-items: center;
  justify-content: space-between; padding: 0 14px; flex-shrink: 0;
}
.tags-scroll { display: flex; align-items: center; gap: 6px; overflow-x: auto; flex: 1; padding: 2px 0; }
.tags-scroll::-webkit-scrollbar { height: 0; }
.tags-item {
  display: inline-flex; align-items: center; gap: 6px; height: 25px; line-height: 25px; padding: 0 10px;
  font-size: 12px; color: #495060; background: #fff; border: 1px solid #d8dce5; border-radius: 3px;
  cursor: pointer; white-space: nowrap; user-select: none; transition: all 0.15s;
}
.tags-item:hover { color: var(--brand-blue); border-color: #b3d8ff; }
.tags-item.is-active { background-color: var(--brand-blue); color: #ffffff; border-color: var(--brand-blue); }
.tags-item.is-active::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #ffffff; }
.tags-close { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border-radius: 50%; font-size: 12px; }
.tags-close:hover { background: rgba(0, 0, 0, 0.22); color: #fff; }

.admin-content { flex: 1; overflow-y: auto; padding: 16px 18px 10px; }
.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
@media (max-width: 1440px) { .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.kpi-card { background: #ffffff; border-radius: 8px; padding: 16px 18px; border: 1px solid #ebeef5; box-shadow: 0 1px 2px rgba(0,0,0,0.03); }
.kpi-head { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: #86909c; margin-bottom: 8px; }
.kpi-val { font-size: 21px; font-weight: 700; color: #1d2129; font-variant-numeric: tabular-nums; }
.kpi-sub { margin-top: 8px; font-size: 12px; color: #86909c; display: flex; justify-content: space-between; }

.panel-card { background: #ffffff; border-radius: 8px; padding: 18px; border: 1px solid #ebeef5; box-shadow: 0 1px 2px rgba(0,0,0,0.03); margin-bottom: 16px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid #f2f3f5; }
.panel-title { font-size: 15px; font-weight: 600; color: #1d2129; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.filter-bar .spacer { flex: 1; }
.mono-text { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.up-text { color: #16a34a; font-weight: 600; }
.down-text { color: #dc2626; font-weight: 600; }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.quick-btn {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid #e5e6eb; border-radius: 6px;
  cursor: pointer; background: #fafbfc; transition: all 0.15s; font-size: 13px; font-weight: 500;
}
.quick-btn:hover { border-color: var(--brand-blue); color: var(--brand-blue); background: #ecf5ff; }
.admin-footer {
  height: 34px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #909399; border-top: 1px solid #e4e7ed; background: #ffffff; flex-shrink: 0;
}

.admin-el-menu .el-sub-menu .el-menu { background-color: var(--sidebar-sub-bg) !important; }
.admin-el-menu .el-menu-item, .admin-el-menu .el-sub-menu__title {
  height: 46px; line-height: 46px; color: #b7bdc6 !important; font-size: 13.5px;
}
.admin-el-menu .el-sub-menu .el-menu-item {
  height: 42px; line-height: 42px; background-color: var(--sidebar-sub-bg) !important; font-size: 13px;
}
.admin-el-menu .el-menu-item:hover, .admin-el-menu .el-sub-menu__title:hover {
  background-color: rgba(255, 255, 255, 0.06) !important; color: #ffffff !important;
}
.admin-el-menu .el-menu-item.is-active {
  background-color: var(--brand-blue) !important; color: #ffffff !important; font-weight: 600;
}
