:root {
  --primary: #2a2e80;
  --primary-soft: #eef0fa;
  --accent: #f59e0b;
  --bg: #f4f6fa;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
}

#app {
  height: 100%;
}

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2a2e80 0%, #4c55c8 60%, #6f78e0 100%);
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 16px;
  padding: 32px 32px 28px;
  box-shadow: 0 20px 48px -20px rgba(15, 23, 42, 0.45);
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.5px;
}

.login-sub {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.login-tip {
  margin-top: 18px;
  font-size: 12px;
  color: var(--muted);
  background: var(--primary-soft);
  border-radius: 8px;
  padding: 10px 12px;
  line-height: 1.7;
}

/* ---------- 布局 ---------- */
.layout {
  height: 100%;
}

.sidebar {
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  height: 60px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  color: var(--primary);
  font-size: 16px;
}

.sidebar-logo .dot {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2a2e80, #6f78e0);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.header {
  height: 60px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.header .title {
  font-size: 16px;
  font-weight: 600;
}

.header .user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.role-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.role-tag.area {
  background: #fff5e6;
  color: #b45309;
}

.main {
  padding: 18px;
  overflow: auto;
  background: var(--bg);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ---------- 数据卡片 ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: var(--primary-soft);
  color: var(--primary);
}

.stat-icon.accent {
  background: #fff5e6;
  color: var(--accent);
}

.stat-icon.green {
  background: #e7f7ef;
  color: #10b981;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.chart {
  width: 100%;
  height: 300px;
}

.tnum {
  font-variant-numeric: tabular-nums;
}

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

/* =====================================================
 * Uiverse 风格交互增强（品牌色定制）
 * 技法来源 uiverse.io：高光扫过按钮 / 按压反馈 / 浮起卡片
 *                 微光骨架屏 / 浮动标签输入 / 水波纹
 * ===================================================== */

/* ---------- 1. 高光扫过按钮（shine sweep） ---------- */
.el-button {
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.el-button:active {
  transform: scale(0.96);
}

.el-button--primary {
  box-shadow: 0 4px 14px -4px rgba(42, 46, 128, 0.45);
}

.el-button--primary:hover {
  box-shadow: 0 6px 20px -4px rgba(42, 46, 128, 0.55);
  transform: translateY(-1px);
}

/* 扫光条：hover 时斜向掠过 */
.el-button--primary::after {
  content: '';
  position: absolute;
  top: -60%;
  left: -80%;
  width: 40%;
  height: 220%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.45) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-25deg) translateX(0);
  transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.el-button--primary:hover::after {
  left: 130%;
}

/* 危险/警告按钮的轻量扫光 */
.el-button--danger::after,
.el-button--warning::after {
  content: '';
  position: absolute;
  top: -60%;
  left: -80%;
  width: 40%;
  height: 220%;
  background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.35) 50%, rgba(255, 255, 255, 0) 100%);
  transform: skewX(-25deg) translateX(0);
  transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.el-button--danger:hover::after,
.el-button--warning:hover::after {
  left: 130%;
}

/* ---------- 2. 水波纹（ripple，点击处扩散） ---------- */
.ui-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: scale(0);
  animation: ui-ripple 0.6s ease-out forwards;
  pointer-events: none;
}

.el-button--default .ui-ripple,
.el-button.is-text .ui-ripple,
.el-button.is-plain .ui-ripple {
  background: rgba(42, 46, 128, 0.18);
}

@keyframes ui-ripple {
  to {
    transform: scale(2.6);
    opacity: 0;
  }
}

/* ---------- 3. 浮起卡片（hover lift） ---------- */
.card,
.stat-card {
  transition:
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.3s;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px -14px rgba(15, 23, 42, 0.16);
  border-color: #c7cdea;
}

.stat-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 18px 36px -16px rgba(42, 46, 128, 0.22);
  border-color: #c7cdea;
}

/* 看板卡片依次入场的错峰动画 */
.stat-grid .stat-card {
  animation: card-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}
.stat-grid .stat-card:nth-child(1) { animation-delay: 0.02s; }
.stat-grid .stat-card:nth-child(2) { animation-delay: 0.08s; }
.stat-grid .stat-card:nth-child(3) { animation-delay: 0.14s; }
.stat-grid .stat-card:nth-child(4) { animation-delay: 0.2s; }

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 4. 微光骨架屏（shimmer skeleton） ---------- */
.sk-block {
  border-radius: 8px;
  background: linear-gradient(90deg, #eceff4 25%, #f7f9fc 37%, #eceff4 63%);
  background-size: 400% 100%;
  animation: sk-shimmer 1.4s ease infinite;
}

.sk-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 6px;
  border-bottom: 1px solid var(--border);
}

.sk-row:last-child {
  border-bottom: none;
}

.sk-bar {
  height: 14px;
  border-radius: 7px;
}

@keyframes sk-shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

/* ---------- 5. 浮动标签输入（floating label） ---------- */
/* 聚焦时 placeholder 上浮缩小并染品牌色 */
.el-input__inner::placeholder {
  transition:
    transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    font-size 0.25s,
    color 0.25s;
  transform-origin: left center;
}

.el-input__inner:focus::placeholder {
  transform: translateY(-13px) scale(0.82);
  color: var(--primary);
  opacity: 0.9;
}

/* 输入框聚焦时的柔光描边 */
.el-input__inner {
  transition:
    border-color 0.25s,
    box-shadow 0.25s;
}

.el-input__inner:focus {
  box-shadow: 0 0 0 3px rgba(42, 46, 128, 0.12);
}

/* ---------- 6. 开关 / 标签 / 表格行微交互 ---------- */
.el-switch__core,
.el-switch__action {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.el-switch.is-checked .el-switch__core {
  box-shadow: 0 2px 10px -2px rgba(42, 46, 128, 0.5);
}

.el-tag {
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.el-tag:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px -3px rgba(15, 23, 42, 0.2);
}

.el-table__row {
  transition: background-color 0.2s;
}

/* ---------- 7. 侧边菜单滑动指示条 ---------- */
.el-menu-item {
  position: relative;
  transition:
    color 0.25s,
    background-color 0.25s;
}

.el-menu-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 0;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--primary), #6f78e0);
  transform: translateY(-50%);
  transition: height 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.el-menu-item.is-active::before,
.el-menu-item:hover::before {
  height: 64%;
}

/* ---------- 8. 登录卡入场浮起 ---------- */
.login-card {
  animation: login-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes login-in {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 9. 对话框入场 ---------- */
.el-dialog {
  animation: dialog-in 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(-18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 10. 数字滚动强调（看板数值） ---------- */
.stat-value {
  animation: value-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes value-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
