/* ============ 基础 ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body, #app { height: 100%; }
body {
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--el-bg-color-page); color: var(--el-text-color-primary);
  transition: background .25s ease;
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(144, 147, 153, .35); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(144, 147, 153, .6); }
html.dark ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); }

.boot-loading { height: 100vh; display: flex; align-items: center; justify-content: center; color: var(--el-color-primary); }

/* ============ 登录页 ============ */
.login-page {
  position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center;
  overflow: hidden; background: linear-gradient(135deg, #1f2d3d 0%, #263445 45%, #3a506b 100%);
}
.login-page::before, .login-page::after {
  content: ''; position: absolute; width: 440px; height: 440px; border-radius: 50%;
  filter: blur(90px); opacity: .4;
}
.login-page::before { left: -120px; top: -120px; background: #409eff; }
.login-page::after { right: -140px; bottom: -140px; background: #e6a23c; }
.login-card {
  position: relative; z-index: 1; width: 400px; padding: 44px 40px 36px;
  background: var(--el-bg-color); border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.login-logo { text-align: center; margin-bottom: 12px; }
.login-logo img { width: 68px; height: 68px; object-fit: contain; border-radius: 16px; box-shadow: 0 4px 16px rgba(0, 0, 0, .15); }
.login-title { text-align: center; font-size: 19px; font-weight: 700; letter-spacing: 1px; margin-bottom: 6px; }
.login-sub { text-align: center; color: var(--el-text-color-secondary); font-size: 12px; letter-spacing: 6px; margin-bottom: 28px; }
.login-err { color: var(--el-color-danger); font-size: 13px; margin-bottom: 12px; }
.login-footer { position: absolute; bottom: 22px; left: 0; right: 0; text-align: center; color: rgba(255, 255, 255, .45); font-size: 12px; z-index: 1; }

/* ============ 布局 ============ */
.layout { height: 100vh; }
.sidebar {
  background: var(--el-bg-color);
  border-right: 1px solid var(--el-border-color-lighter);
  overflow-x: hidden; transition: width .25s ease;
}
.logo-box {
  display: flex; align-items: center; justify-content: center; gap: 8px; height: 60px;
  overflow: hidden; color: var(--el-text-color-primary); font-weight: 600; font-size: 15px;
  letter-spacing: 2px; border-bottom: 1px solid var(--el-border-color-lighter); flex-shrink: 0;
}
.logo-box img { height: 30px; max-width: 110px; object-fit: contain; border-radius: 6px; }

.sidebar .el-menu { border-right: none; padding: 6px 10px 14px; background: transparent; }
.sidebar .el-menu-item-group__title {
  padding: 14px 0 4px 10px; font-size: 11px; letter-spacing: 2px;
  color: var(--el-text-color-secondary);
}
.sidebar .el-menu-item {
  position: relative; height: 38px; line-height: 38px; margin: 2px 0;
  border-radius: 8px; color: var(--el-text-color-regular); font-size: 14px;
}
.sidebar .el-menu-item:hover { background: var(--el-fill-color-light); color: var(--el-text-color-primary); }
.sidebar .el-menu-item.is-active {
  background: var(--el-color-primary-light-9); color: var(--el-color-primary); font-weight: 600;
}
.sidebar .el-menu-item.is-active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 16px; border-radius: 2px; background: var(--el-color-primary);
}
.sidebar .el-menu--collapse .el-menu-item-group__title { display: none; }
.sidebar .el-menu--collapse .el-menu-item { padding: 0 !important; }

.right-pane { min-width: 0; }
.topbar {
  position: relative; height: 60px; background: var(--el-bg-color); display: flex; align-items: center;
  justify-content: space-between; border-bottom: 1px solid var(--el-border-color-light);
  box-shadow: 0 1px 8px rgba(0, 0, 0, .04); z-index: 6; transition: background .25s ease;
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-app {
  font-size: 17px; font-weight: 600; letter-spacing: 1px;
  color: var(--el-text-color-primary); white-space: nowrap;
}
.topbar-right { display: flex; align-items: center; }
.admin-name { color: var(--el-text-color-regular); font-size: 13px; margin: 0 4px 0 8px; }
.user-chip { display: flex; align-items: center; cursor: pointer; outline: none; }
.user-avatar { background: var(--el-color-primary); }
.main { background: var(--el-bg-color-page); padding: 18px; overflow-y: auto; transition: background .25s ease; }

/* ============ 主题选择 ============ */
.theme-label { font-size: 13px; color: var(--el-text-color-regular); margin-bottom: 10px; font-weight: 600; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch {
  width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid transparent; transition: transform .15s ease;
  box-shadow: inset 0 0 0 2px var(--el-bg-color);
}
.swatch:hover { transform: scale(1.15); }
.swatch.active { border-color: var(--el-text-color-primary); }

/* ============ 卡片 & 统计 ============ */
.el-card { border-radius: 10px; }
.el-dialog { border-radius: 12px; }
.el-dialog__body { padding-top: 10px; }
.stat-card { cursor: default; transition: transform .2s ease, box-shadow .2s ease; }
.stat-card:hover { transform: translateY(-3px); }
.stat-inner { display: flex; align-items: center; gap: 14px; }
.stat-icon {
  width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; box-shadow: 0 4px 10px rgba(0, 0, 0, .12);
}
.stat-icon.c-blue   { background: linear-gradient(135deg, #6db6ff, #3a8ee6); }
.stat-icon.c-green  { background: linear-gradient(135deg, #95d475, #529b2e); }
.stat-icon.c-orange { background: linear-gradient(135deg, #f3d19e, #e6a23c); }
.stat-icon.c-red    { background: linear-gradient(135deg, #fab6b6, #f56c6c); }
.stat-icon.c-purple { background: linear-gradient(135deg, #a58cf2, #7c3aed); }
.stat-icon.c-cyan   { background: linear-gradient(135deg, #7ddbd6, #13c2c2); }
.stat-label { color: var(--el-text-color-secondary); font-size: 13px; }
.stat-value {
  font-size: 22px; font-weight: 700; margin-top: 4px;
  color: var(--el-text-color-primary); font-variant-numeric: tabular-nums;
}
.stat-value.amount { color: var(--el-color-primary); }

/* ============ 表格 & 分页 ============ */
.el-table { --el-table-header-bg-color: var(--el-fill-color-light); }
.el-table th.el-table__cell { font-weight: 600; }
.muted { color: var(--el-text-color-secondary); font-size: 12px; }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.pager { display: flex; justify-content: flex-end; margin-top: 14px; }

/* ============ 图片 ============ */
.thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; display: block; }
.upload-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; width: 100%; }
.img-list { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.img-item { position: relative; display: inline-block; }
.img-del {
  position: absolute; top: -7px; right: -7px; width: 18px; height: 18px; line-height: 16px;
  text-align: center; background: var(--el-color-danger); color: #fff; border-radius: 50%;
  cursor: pointer; font-size: 12px; z-index: 2;
}

/* ============ 趋势图 ============ */
.trend-chart { display: flex; align-items: flex-end; gap: 12px; height: 200px; padding: 12px 4px 0; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.trend-bar {
  width: 60%; max-width: 42px; border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--el-color-primary-light-3), var(--el-color-primary));
  transition: height .4s ease;
}
.trend-lbl { font-size: 12px; color: var(--el-text-color-secondary); margin-top: 6px; }
.trend-tip { font-size: 11px; color: var(--el-text-color-regular); margin-bottom: 4px; white-space: nowrap; }

/* ============ 视图切换动效 ============ */
.view-fade-enter-active, .view-fade-leave-active { transition: opacity .18s ease, transform .18s ease; }
.view-fade-enter-from { opacity: 0; transform: translateY(8px); }
.view-fade-leave-to { opacity: 0; }
