/* ProGress 管理后台样式 —— Element Plus 主题定制 + 自定义布局 */

/* ========== 主题覆盖 ========== */
:root {
  --pg-brand: #4F46E5;
  --pg-brand-dark: #4338CA;
  --pg-brand-light: #6366F1;
  --pg-success: #10B981;
  --pg-warning: #F59E0B;
  --pg-error: #EF4444;
  --pg-bg: #F8FAFC;
  --pg-surface: #ffffff;
  --pg-border: #E2E8F0;
  --pg-text-1: #0F172A;
  --pg-text-2: #475569;
  --pg-text-3: #94A3B8;
  --pg-grad: linear-gradient(135deg, #4F46E5, #10B981);
  --pg-shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .05);
  --el-color-primary: #4F46E5;
  --el-color-primary-light-3: #7C7AF0;
  --el-color-primary-light-5: #A7A5F7;
  --el-color-primary-light-7: #C7C6FA;
  --el-color-primary-light-8: #DCDBFC;
  --el-color-primary-light-9: #EFEFFD;
  --el-color-primary-dark-2: #3F38B8;
  --el-border-radius-base: 10px;
}

/* ========== 全局 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--pg-bg);
  color: var(--pg-text-1);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* ========== 登录页 ========== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1000px 500px at 85% -10%, rgba(79, 70, 229, .15), transparent 60%),
    radial-gradient(800px 420px at 8% 110%, rgba(16, 185, 129, .12), transparent 60%),
    var(--pg-bg);
}

.login-card {
  width: 420px;
  background: var(--pg-surface);
  border-radius: 20px;
  padding: 44px 40px 32px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .12);
  text-align: center;
}

.login-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 20px;
  background: var(--pg-grad);
  color: #fff;
  font-size: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 28px rgba(79, 70, 229, .35);
}

.login-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: .5px;
  background: var(--pg-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-sub {
  color: var(--pg-text-3);
  font-size: 13px;
  margin: 6px 0 28px;
}

.login-card .el-form-item__label {
  font-weight: 600;
  color: var(--pg-text-2);
}

.login-btn {
  width: 100%;
  height: 46px;
  font-size: 15px;
  font-weight: 700;
  background: var(--pg-grad) !important;
  border: none !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 20px rgba(79, 70, 229, .3);
}

.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(79, 70, 229, .4);
}

/* ========== 主布局 ========== */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 232px;
  background: var(--pg-surface);
  border-right: 1px solid var(--pg-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px 20px;
  border-bottom: 1px solid var(--pg-border);
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--pg-grad);
  color: #fff;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(79, 70, 229, .3);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text strong {
  font-size: 17px;
  font-weight: 800;
  background: var(--pg-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-text span {
  font-size: 11px;
  color: var(--pg-text-3);
  letter-spacing: 2px;
  margin-top: 2px;
}

.nav {
  flex: 1;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--pg-text-2);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: background .15s, color .15s, transform .15s;
  cursor: pointer;
  user-select: none;
}

.nav-item:hover {
  background: #F1F5F9;
  color: var(--pg-text-1);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(79, 70, 229, .12), rgba(16, 185, 129, .08));
  color: var(--pg-brand);
  transform: translateX(2px);
}

.nav-icon {
  width: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-foot {
  padding: 16px;
  border-top: 1px solid var(--pg-border);
}

.admin-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.avatar-dot {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--pg-grad);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(79, 70, 229, .25);
}

.admin-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  min-width: 0;
  flex: 1;
}

.admin-meta strong {
  font-size: 13px;
  color: var(--pg-text-1);
}

.admin-meta span {
  font-size: 11px;
  color: var(--pg-text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-btn {
  width: 100%;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--pg-bg);
}

.topbar {
  height: 64px;
  background: var(--pg-surface);
  border-bottom: 1px solid var(--pg-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--pg-text-1);
}

.topbar-right {
  display: flex;
  gap: 8px;
}

.content {
  padding: 24px 28px 40px;
}

/* ========== 数据看板 ========== */
.stat-grid {
  margin-bottom: 16px;
}

.stat-card {
  background: var(--pg-surface);
  border-radius: 14px;
  padding: 22px;
  box-shadow: var(--pg-shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform .18s, box-shadow .18s;
  height: 100%;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-body {
  flex: 1;
  min-width: 0;
}

.stat-num {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--pg-text-1);
}

.stat-label {
  font-size: 12px;
  color: var(--pg-text-3);
  margin-top: 3px;
}

.stat-extra {
  font-size: 11px;
  color: var(--pg-success);
  margin-top: 3px;
  font-weight: 600;
}

/* ========== 通用面板 ========== */
.panel {
  margin-bottom: 16px;
  border-radius: 14px !important;
  border: none !important;
  box-shadow: var(--pg-shadow) !important;
}

.panel .el-card__header {
  padding: 14px 20px;
  border-bottom: 1px solid #F1F5F9;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-head strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--pg-text-1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.panel-head strong .el-icon {
  color: var(--pg-brand);
}

.panel-head .link {
  font-size: 12px;
  color: var(--pg-brand);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.panel-head .link:hover {
  text-decoration: underline;
}

/* ========== 用户小列表 ========== */
.mini-list {
  display: flex;
  flex-direction: column;
}

.mini-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px solid #F1F5F9;
}

.mini-row:last-child {
  border-bottom: none;
}

.mini-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mini-meta {
  flex: 1;
  min-width: 0;
}

.mini-meta strong {
  display: block;
  font-size: 13px;
  color: var(--pg-text-1);
}

.mini-meta span {
  font-size: 11px;
  color: var(--pg-text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.mini-time {
  font-size: 11px;
  color: var(--pg-text-3);
  white-space: nowrap;
}

/* ========== 单元格 ========== */
.user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cell-name {
  color: var(--pg-text-1);
  font-weight: 600;
}

.cell-sub {
  font-size: 11px;
  color: var(--pg-text-3);
  margin-top: 2px;
}

/* ========== 工具条 / 分页 ========== */
.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.pager-wrap {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.status-chips .el-radio-button__inner {
  border-radius: 999px !important;
  border: 1px solid var(--pg-border) !important;
  padding: 8px 18px;
}

.status-chips .el-radio-button__original-radio:checked + .el-radio-button__inner {
  background: var(--pg-brand);
  border-color: var(--pg-brand) !important;
  color: #fff;
  box-shadow: none !important;
}

/* ========== 系统配置 ========== */
.settings-card {
  margin-bottom: 16px;
}

.field-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.field-row .el-input,
.field-row .el-input-number {
  flex: 1;
}

.form-hint {
  font-size: 11px;
  color: var(--pg-text-3);
  margin-top: 6px;
  line-height: 1.6;
}

.form-hint a {
  color: var(--pg-brand);
  text-decoration: none;
}

.form-hint a:hover {
  text-decoration: underline;
}

.form-hint strong {
  color: var(--pg-text-2);
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding: 16px 20px;
  background: var(--pg-surface);
  border-radius: 12px;
  box-shadow: var(--pg-shadow);
}

/* ========== Element Plus 微调 ========== */
.el-table {
  font-size: 13px;
}

.el-table th.el-table__cell {
  background: #FAFCFF !important;
  color: var(--pg-text-3);
  font-weight: 600;
  font-size: 12px;
}

.el-tag {
  border-radius: 999px;
  font-weight: 600;
}

.el-progress__text {
  font-size: 12px !important;
  color: var(--pg-text-2);
}

.el-pagination {
  justify-content: flex-end;
}

.el-card {
  border-radius: 14px;
  border: none;
}

.el-form-item__label {
  font-weight: 600;
  color: var(--pg-text-2);
}

/* ========== 响应式 ========== */
@media (max-width: 1100px) {
  .sidebar {
    width: 200px;
  }
  .content {
    padding: 20px;
  }
}

@media (max-width: 768px) {
  .layout {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .nav {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 8px;
  }
  .nav-item {
    padding: 8px 12px;
    font-size: 13px;
  }
  .brand,
  .sidebar-foot {
    display: none;
  }
  .topbar {
    padding: 0 16px;
  }
  .content {
    padding: 16px;
  }
}
