* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: #f2f4f8;
  color: #1f2937;
  -webkit-font-smoothing: antialiased;
}
#app { height: 100%; }

/* ---------- 登录 ---------- */
.login-wrap {
  height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 20% 10%, #1e3a8a 0%, #0f172a 55%, #060b18 100%);
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 400px; background: #fff; border-radius: 18px;
  padding: 34px 30px 24px; box-shadow: 0 30px 80px rgba(0,0,0,.45);
}
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.login-logo {
  width: 48px; height: 48px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2563eb, #1d4ed8); color: #fff; font-size: 22px; font-weight: 700;
  box-shadow: 0 8px 20px rgba(37,99,235,.35);
}
.login-brand h1 { font-size: 19px; margin: 0 0 4px; letter-spacing: .5px; }
.login-brand p { margin: 0; font-size: 12px; color: #94a3b8; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-btn { width: 100%; letter-spacing: 4px; }
.login-tip { color: #ef4444; font-size: 13px; text-align: center; min-height: 18px; }
.login-foot { margin-top: 22px; text-align: center; font-size: 12px; color: #b0b7c3; }

/* ---------- 布局 ---------- */
.layout { height: 100vh; }
.aside {
  background: #0f172a; transition: width .2s ease; display: flex; flex-direction: column;
  overflow: hidden;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 14px; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand-logo {
  width: 34px; height: 34px; min-width: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff; font-weight: 700;
}
.brand-title { color: #e2e8f0; font-size: 14px; font-weight: 600; }
.brand-sub { color: #64748b; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; }
.menu { border-right: none; background: transparent; flex: 1; padding: 8px 6px; }
.menu .el-menu-item { color: #94a3b8; border-radius: 8px; margin-bottom: 3px; height: 42px; }
.menu .el-menu-item:hover { background: rgba(255,255,255,.06); color: #e2e8f0; }
.menu .el-menu-item.is-active { background: linear-gradient(90deg, rgba(59,130,246,.28), rgba(59,130,246,.06)); color: #fff; }
.menu .el-menu-item.is-active::after { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: #3b82f6; }
.aside-foot { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.06); }
.foot-line { color: #475569; font-size: 11px; }

.header {
  background: #fff; border-bottom: 1px solid #e8ecf3; display: flex; align-items: center;
  justify-content: space-between; height: 56px; padding: 0 18px;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.collapse-btn { cursor: pointer; font-size: 18px; color: #64748b; }
.collapse-btn:hover { color: #2563eb; }
.page-title { font-size: 15px; font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 14px; }
.user-chip { display: flex; align-items: center; gap: 7px; cursor: pointer; outline: none; }
.user-avatar { background: #2563eb; font-size: 12px; }
.user-name { font-size: 13px; color: #334155; }

.main { background: #f2f4f8; padding: 16px; overflow-y: auto; }
.page { display: flex; flex-direction: column; gap: 14px; }

/* ---------- 统计卡 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.stat-card {
  background: #fff; border-radius: 12px; padding: 16px 16px 14px; border: 1px solid #eef1f6;
  position: relative; overflow: hidden;
}
.stat-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.stat-blue::before { background: #3b82f6; }
.stat-green::before { background: #10b981; }
.stat-purple::before { background: #8b5cf6; }
.stat-orange::before { background: #f59e0b; }
.stat-cyan::before { background: #06b6d4; }
.stat-indigo::before { background: #6366f1; }
.stat-label { font-size: 12px; color: #64748b; }
.stat-value { font-size: 26px; font-weight: 700; margin: 6px 0 2px; letter-spacing: .5px; }
.stat-hint { font-size: 11px; color: #a8b0bd; }

/* ---------- 面板 ---------- */
.panel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.panel { border-radius: 12px; border: 1px solid #eef1f6; }
.panel-title { font-size: 14px; font-weight: 600; }
.bar-list { display: flex; flex-direction: column; gap: 11px; min-height: 60px; }
.bar-row { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.bar-name { width: 120px; color: #475569; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; height: 9px; background: #eef2f7; border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, #3b82f6, #60a5fa); transition: width .4s ease; }
.bar-fill.tone-2 { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.bar-fill.tone-3 { background: linear-gradient(90deg, #10b981, #34d399); }
.bar-fill.tone-4 { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.bar-num { width: 46px; text-align: right; color: #334155; font-variant-numeric: tabular-nums; }
.empty-hint { color: #a8b0bd; font-size: 12px; text-align: center; padding: 18px 0; }

/* ---------- 表格 ---------- */
.toolbar-card { border-radius: 12px; border: 1px solid #eef1f6; }
.toolbar-card .el-card__body { padding: 12px 14px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar-spacer { flex: 1; }
.table-card { border-radius: 12px; border: 1px solid #eef1f6; }
.table-card .el-card__body { padding: 4px 4px 0; }
.data-table { font-size: 12.5px; }
.table-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 10px; }
.mono { font-family: "SF Mono", Consolas, "Courier New", monospace; letter-spacing: .3px; }
.muted { color: #a0a8b5; }
.bind-tag { margin: 2px 4px 2px 0; }

.form-dialog .el-divider { margin: 6px 0 14px; }
.form-dialog .el-divider__text { font-size: 12px; color: #64748b; background: #fff; }

.import-box { display: flex; flex-direction: column; gap: 12px; }
.import-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- 响应式 ---------- */
@media (max-width: 1200px) {
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .layout { flex-direction: column; height: auto; min-height: 100vh; }
  .layout > .el-container { flex: 1; width: 100%; min-width: 0; }
  .aside { width: 100% !important; height: auto; flex: none; position: static; }
  .brand { padding: 10px 14px; }
  .brand-sub { display: none; }
  .menu { display: flex; overflow-x: auto; padding: 6px 8px; flex: none; border-right: none; }
  .menu .el-menu-item { flex: 0 0 auto; height: 38px; line-height: 38px; margin-bottom: 0; padding: 0 12px !important; }
  .menu .el-menu-item.is-active::after { display: none; }
  .aside-foot { display: none; }
  .main { width: 100%; padding: 10px; }
  .header { padding: 0 12px; height: 52px; }
  .collapse-btn { display: none; }
  .panel-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar .el-input, .toolbar .el-select { width: 100% !important; }
  .user-name { display: none; }
}
@media (max-width: 560px) {
  .stat-value { font-size: 21px; }
  .login-card { padding: 26px 20px 18px; }
}
