/* ============================================================
   Admin · 蓝紫渐变主题样式
   作者: zhxyadmin · 仅依赖 Element Plus 默认变量
   ============================================================ */

:root {
  --gp-primary: #6366f1;
  --gp-primary-2: #8b5cf6;
  --gp-primary-3: #a855f7;
  --gp-grad: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gp-grad-soft: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
  --gp-sidebar-bg: #1e1b3a;
  --gp-sidebar-bg-2: #2d2a52;
  --gp-text: #1f2937;
  --gp-text-muted: #6b7280;
  --gp-border: #eef0f6;
  --gp-bg: #f5f6fb;
  --gp-card-shadow: 0 10px 30px -12px rgba(70, 80, 130, 0.18);
  --gp-header-h: 64px;
  --gp-sidebar-w: 230px;
  --gp-sidebar-w-collapsed: 64px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--gp-text);
  background: var(--gp-bg);
  -webkit-font-smoothing: antialiased;
}

/* 自定义滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(99, 102, 241, .25); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99, 102, 241, .45); }

/* ===== 全局过渡 + 渐变文字 ===== */
.fade-enter-active, .fade-leave-active { transition: opacity .25s ease, transform .25s ease; }
.fade-enter-from { opacity: 0; transform: translateY(8px); }
.fade-leave-to { opacity: 0; transform: translateY(-8px); }

.text-gradient {
  background: var(--gp-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ============================================================
   登录页 login.html
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.login-page::before,
.login-page::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .55;
  pointer-events: none;
}
.login-page::before {
  width: 480px; height: 480px;
  background: #8b5cf6;
  top: -120px; left: -120px;
}
.login-page::after {
  width: 540px; height: 540px;
  background: #4f46e5;
  bottom: -160px; right: -160px;
}
.login-card {
  position: relative;
  z-index: 2;
  width: 400px;
  padding: 40px 36px 32px;
  background: rgba(255, 255, 255, .95);
  border-radius: 18px;
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, .35);
  backdrop-filter: blur(20px);
  animation: loginIn .55s cubic-bezier(.22, .61, .36, 1);
}
@keyframes loginIn {
  from { opacity: 0; transform: translateY(20px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.login-brand .logo {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--gp-grad);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  box-shadow: 0 6px 14px -4px rgba(118, 75, 162, .55);
}
.login-brand .name { font-size: 18px; font-weight: 600; }
.login-subtitle { color: var(--gp-text-muted); font-size: 13px; margin: 4px 0 28px; }
.login-form .el-input__wrapper {
  border-radius: 10px !important;
  padding: 4px 12px !important;
}
.login-form .el-button--primary {
  width: 100%;
  height: 42px;
  border-radius: 10px;
  font-weight: 500;
  letter-spacing: 2px;
  background: var(--gp-grad);
  border: none;
}
.login-form .el-button--primary:hover { opacity: .92; }
.login-tip {
  margin-top: 18px;
  font-size: 12px;
  color: var(--gp-text-muted);
  text-align: center;
}

/* ============================================================
   主框架 layout
   ============================================================ */
.admin-layout { height: 100vh; display: flex; overflow: hidden; }

/* 侧边栏 */
.admin-sidebar {
  width: var(--gp-sidebar-w);
  height: 100vh;
  background: linear-gradient(180deg, var(--gp-sidebar-bg) 0%, var(--gp-sidebar-bg-2) 100%);
  color: #c7cbe0;
  display: flex;
  flex-direction: column;
  transition: width .28s cubic-bezier(.4, 0, .2, 1);
  overflow: hidden;
  position: relative;
  z-index: 10;
  box-shadow: 4px 0 24px -8px rgba(20, 16, 60, .35);
}
.admin-sidebar.is-collapsed { width: var(--gp-sidebar-w-collapsed); }

.sidebar-brand {
  height: var(--gp-header-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  white-space: nowrap;
}
.sidebar-brand .logo {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--gp-grad);
  display: grid; place-items: center;
  flex-shrink: 0;
  box-shadow: 0 6px 14px -4px rgba(118, 75, 162, .6);
}
.sidebar-brand .name { transition: opacity .2s; }
.is-collapsed .sidebar-brand .name { opacity: 0; }

.sidebar-menu {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar-menu::-webkit-scrollbar { width: 4px; }
.sidebar-menu::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); }

/* 自定义菜单样式 */
.sidebar-menu > .menu-item {
  height: 42px;
  line-height: 42px;
  border-radius: 8px;
  margin: 2px 0;
  padding: 0 14px;
  color: #b5b9d4;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background .22s, color .22s;
  user-select: none;
}
.sidebar-menu > .menu-item:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff;
}
.sidebar-menu > .menu-item.active {
  background: #4f46e5;
  color: #fff;
}
.sidebar-menu > .menu-item .el-icon {
  color: inherit;
  font-size: 18px;
  margin-right: 10px;
  flex-shrink: 0;
}
.sidebar-menu > .menu-item .arrow {
  margin-left: auto;
  font-size: 14px;
  transition: transform .2s;
}
.sidebar-menu > .menu-item .arrow.is-opened {
  transform: rotate(180deg);
}
.sub-menu-title.active {
  background: rgba(79, 70, 229, .15) !important;
  color: #fff !important;
}
.sub-menu-items {
  overflow: hidden;
  padding-left: 36px;
}
.sub-menu-items .menu-item {
  height: 42px;
  line-height: 42px;
  border-radius: 8px;
  margin: 2px 0;
  padding: 0 14px;
  color: #b5b9d4;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background .22s, color .22s;
  user-select: none;
}
.sub-menu-items .menu-item:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff;
}
.sub-menu-items .menu-item.active {
  background: #4f46e5;
  color: #fff;
}
.sub-menu-items .menu-item .el-icon {
  color: inherit;
  font-size: 18px;
  margin-right: 10px;
  flex-shrink: 0;
}

/* 顶栏 */
.admin-header {
  height: var(--gp-header-h);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  box-shadow: 0 2px 12px -4px rgba(60, 70, 120, .12);
  position: relative;
  z-index: 5;
}
.admin-header .left { display: flex; align-items: center; gap: 14px; }
.admin-header .collapse-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  cursor: pointer;
  font-size: 18px;
  color: var(--gp-text-muted);
  transition: all .2s;
}
.admin-header .collapse-btn:hover {
  background: #f3f4fa;
  color: var(--gp-primary);
}
.breadcrumb { font-size: 14px; }
.breadcrumb .el-breadcrumb__item { font-weight: 500; }

.header-right { display: flex; align-items: center; gap: 8px; }
.header-action {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid; place-items: center;
  cursor: pointer;
  color: var(--gp-text-muted);
  font-size: 18px;
  transition: all .2s;
  position: relative;
}
.header-action:hover { background: #f3f4fa; color: var(--gp-primary); }
.header-action .badge {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 2px #fff;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  border-radius: 22px;
  cursor: pointer;
  transition: background .2s;
}
.user-chip:hover { background: #f3f4fa; }
.user-chip .avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--gp-grad);
  color: #fff;
  display: grid; place-items: center;
  font-size: 13px;
  font-weight: 600;
}
.user-chip .meta { line-height: 1.2; }
.user-chip .meta .name { font-size: 13px; font-weight: 600; color: var(--gp-text); }
.user-chip .meta .role { font-size: 11px; color: var(--gp-text-muted); }

/* 主内容区 */
.admin-main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: var(--gp-bg);
}
.admin-content { padding: 20px 22px 32px; }

/* 通用页面头 */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.page-head .title { font-size: 18px; font-weight: 600; }
.page-head .desc { font-size: 12px; color: var(--gp-text-muted); margin-top: 2px; }

/* 通用卡片 */
.gp-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--gp-card-shadow);
  border: 1px solid var(--gp-border);
}
.gp-card .body { padding: 18px 20px; }

/* 统计卡片 */
.stat-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 20px 22px;
  color: #fff;
  box-shadow: 0 14px 32px -14px rgba(80, 70, 160, .45);
  transition: transform .25s, box-shadow .25s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 18px 36px -14px rgba(80, 70, 160, .55); }
.stat-card.g1 { background: linear-gradient(135deg, #667eea, #764ba2); }
.stat-card.g2 { background: linear-gradient(135deg, #f093fb, #f5576c); }
.stat-card.g3 { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.stat-card.g4 { background: linear-gradient(135deg, #43e97b, #38f9d7); color: #064e3c; }
.stat-card .icon-bg {
  position: absolute;
  right: -10px; top: -10px;
  width: 90px; height: 90px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
}
.stat-card .label { font-size: 13px; opacity: .9; }
.stat-card .value { font-size: 28px; font-weight: 700; margin-top: 6px; }
.stat-card .delta { font-size: 12px; margin-top: 8px; opacity: .9; }

/* 通用搜索栏 */
.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 12px;
  background: #fafbff;
  border: 1px solid var(--gp-border);
  margin-bottom: 16px;
}
.search-bar .el-input__wrapper,
.search-bar .el-select__wrapper { background: #fff; }

/* 表格工具条 */
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.table-toolbar .left { display: flex; gap: 8px; }

/* 让 Element Plus 表格更精致 */
.el-table {
  --el-table-border-color: var(--gp-border);
  --el-table-header-bg-color: #f7f8fc;
  --el-table-header-text-color: #4b5563;
  border-radius: 12px;
  overflow: hidden;
}
.el-table th.el-table__cell {
  font-weight: 600;
  font-size: 13px;
}
.el-table .cell { font-size: 13px; }

/* 分页 */
.pagination-wrap {
  display: flex;
  justify-content: flex-end;
  padding: 14px 4px 0;
}

/* 标签状态点 */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot.green { background: #10b981; }
.dot.red { background: #ef4444; }
.dot.orange { background: #f59e0b; }
.dot.gray { background: #9ca3af; }

/* 空状态 */
.empty-tip { padding: 40px 0; text-align: center; color: var(--gp-text-muted); font-size: 13px; }

/* 弹窗圆角 */
.el-dialog { border-radius: 16px !important; overflow: hidden; }
.el-dialog__header { margin-right: 0 !important; padding: 18px 22px !important; border-bottom: 1px solid var(--gp-border); }
.el-dialog__body { padding: 22px !important; }
.el-dialog__footer { padding: 14px 22px 18px !important; border-top: 1px solid var(--gp-border); }

/* 按钮 */
.el-button--primary {
  background: var(--gp-grad) !important;
  border: none !important;
}
.el-button--primary:hover { opacity: .92; }

/* 响应式 */
@media (max-width: 768px) {
  .admin-sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); z-index: 50; }
  .admin-sidebar.mobile-show { transform: translateX(0); }
  .stat-card .value { font-size: 22px; }
  .admin-content { padding: 14px 12px 24px; }
}
