/* ============ 设计令牌 ============ */
:root {
  --brand: #2563eb;
  --brand-600: #1d4ed8;
  --brand-soft: #eff4ff;

  --bg: #f5f7fb;
  --panel: #ffffff;
  --border: #e9ecf3;
  --border-strong: #dde2ec;

  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;

  --sidebar: #101828;
  --sidebar-2: #0a1020;
  --sidebar-text: #9aa7bd;

  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --purple: #7c3aed;
  --info: #0ea5e9;

  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 4px 18px rgba(15, 23, 42, 0.06);

  /* ---- Element Plus 换肤（必须配套 light-3/5/7/8/9，否则 hover/禁用态发灰）---- */
  --el-color-primary: #2563eb;
  --el-color-primary-light-3: #6690f1;
  --el-color-primary-light-5: #92b2f5;
  --el-color-primary-light-7: #bed0f9;
  --el-color-primary-light-8: #d3e0fb;
  --el-color-primary-light-9: #e9effd;
  --el-color-primary-dark-2: #1d4ed8;

  --el-color-success: #16a34a;
  --el-color-warning: #d97706;
  --el-color-danger: #dc2626;
  --el-color-info: #64748b;

  --el-border-radius-base: 8px;
  --el-border-color: var(--border-strong);
  --el-border-color-light: var(--border);
  --el-border-color-lighter: var(--border);
  --el-text-color-primary: var(--text);
  --el-text-color-regular: var(--text-2);
  --el-text-color-secondary: var(--text-3);
  --el-bg-color: #fff;
  --el-fill-color-light: #f8fafc;
  --el-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--el-font-family);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

#app { height: 100%; }

/* ============ 骨架：深色侧栏 + 白顶栏 ============ */
.shell { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: 232px;
  flex: 0 0 232px;
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  transition: width 0.22s ease, flex-basis 0.22s ease;
  overflow: hidden;
}
.shell.collapsed .sidebar { width: 68px; flex-basis: 68px; }

.brand {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  flex: 0 0 64px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}
.brand-mark {
  width: 32px; height: 32px; flex: 0 0 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 15px;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.4);
}
.brand-text { color: #e2e8f0; font-weight: 600; font-size: 15px; letter-spacing: 0.3px; }
.brand-text small { display: block; font-size: 11px; color: #64748b; font-weight: 400; margin-top: 2px; }

.nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.nav::-webkit-scrollbar { width: 4px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 4px; }

.nav-item {
  display: flex; align-items: center; gap: 11px;
  height: 42px; padding: 0 12px; margin-bottom: 4px;
  border-radius: 9px; cursor: pointer;
  color: var(--sidebar-text); font-size: 14px;
  position: relative; white-space: nowrap;
  transition: background 0.16s, color 0.16s;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #e2e8f0; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.95), rgba(37, 99, 235, 0.5));
  color: #fff;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28);
}
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 11px; bottom: 11px;
  width: 3px; border-radius: 0 3px 3px 0; background: #fff;
}
.nav-item .el-icon { font-size: 17px; flex: 0 0 17px; }
.shell.collapsed .nav-item { justify-content: center; padding: 0; }
.shell.collapsed .nav-item span { display: none; }

.nav-foot {
  padding: 12px; border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11px; color: #5b6a84; white-space: nowrap; overflow: hidden;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 64px; flex: 0 0 64px;
  background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 20px 0 16px; gap: 14px;
}
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); cursor: pointer; transition: background 0.16s;
}
.icon-btn:hover { background: #f1f5f9; }
.crumb-title { font-size: 16px; font-weight: 650; letter-spacing: 0.2px; }
.crumb-desc { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-chip {
  display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 6px;
  border-radius: 999px; cursor: pointer; transition: background 0.16s;
}
.user-chip:hover { background: #f1f5f9; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  color: #fff; font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}

.content { flex: 1; overflow-y: auto; padding: 20px; }

/* ============ 面板 / 工具条 / 表格 ============ */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.panel + .panel { margin-top: 16px; }

.panel-head {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 18px; border-bottom: 1px solid var(--border);
}
.panel-title { font-size: 14px; font-weight: 650; }
.panel-sub { font-size: 12px; color: var(--text-3); }

.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 18px; border-bottom: 1px solid var(--border); background: #fcfdff;
}
.toolbar .grow { margin-left: auto; }

.pager { display: flex; justify-content: flex-end; padding: 14px 18px; }

.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

/* 状态 pill */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 500; line-height: 1;
}
.pill .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill-success { background: #e8f7ee; color: #15803d; }
.pill-warning { background: #fef4e6; color: #b45309; }
.pill-danger { background: #fdecec; color: #b91c1c; }
.pill-brand { background: var(--brand-soft); color: var(--brand-600); }
.pill-purple { background: #f3edff; color: #6d28d9; }
.pill-info { background: #e8f5fd; color: #0369a1; }
.pill-neutral { background: #f1f5f9; color: #475569; }

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 1100px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

.stat-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat-card::after {
  content: ""; position: absolute; right: -30px; top: -30px;
  width: 90px; height: 90px; border-radius: 50%; opacity: 0.07; background: currentColor;
}
.stat-label { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 26px; font-weight: 680; margin-top: 8px; letter-spacing: -0.5px; }
.stat-foot { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.tone-brand { color: var(--brand); }
.tone-success { color: var(--success); }
.tone-warning { color: var(--warning); }
.tone-purple { color: var(--purple); }

/* 迷你柱状图（纯 CSS，不引图表库） */
.chart { display: flex; align-items: flex-end; gap: 12px; height: 150px; padding: 8px 4px 0; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart-bar {
  width: 100%; max-width: 44px; border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, #60a5fa, #2563eb); min-height: 3px;
  transition: height 0.4s ease;
  position: relative;
}
.chart-bar.zero { background: #eef2f8; }
.chart-val { font-size: 11px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.chart-day { font-size: 11px; color: var(--text-3); }

/* 图片上传 */
.img-upload .img-box, .img-upload .img-empty {
  width: 100%; height: 88px; border-radius: 8px; overflow: hidden; position: relative;
}
.img-upload .img-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-upload .img-mask {
  position: absolute; inset: 0; background: rgba(15, 23, 42, 0.55);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  opacity: 0; transition: opacity 0.18s;
}
.img-upload .img-box:hover .img-mask { opacity: 1; }
.img-upload .img-empty {
  border: 1px dashed var(--border-strong); background: #fbfcfe;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; color: var(--text-3); font-size: 12px; cursor: pointer;
}
.img-upload .img-empty:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* 课程封面缩略 */
.thumb {
  width: 52px; height: 34px; border-radius: 6px; object-fit: cover;
  background: #eef2f8; display: block;
}
.cell-title { font-weight: 550; }
.cell-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.row-gap { display: flex; align-items: center; gap: 10px; }

/* 登录页 */
.login-wrap {
  height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 15% 10%, #1e3a8a 0%, #0f172a 45%, #080d18 100%);
}
.login-card {
  width: 372px; background: #fff; border-radius: 16px; padding: 30px 28px 26px;
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.45);
}
.login-card h1 { font-size: 19px; margin: 0 0 4px; letter-spacing: 0.3px; }
.login-card p { font-size: 12px; color: var(--text-3); margin: 0 0 22px; }
.login-mark {
  width: 42px; height: 42px; border-radius: 12px; margin-bottom: 16px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.35);
}
.login-tip { font-size: 11px; color: var(--text-3); margin-top: 14px; text-align: center; }

.el-table th.el-table__cell {
  background: #f8fafc !important;
  color: var(--text-2);
  font-weight: 600;
  font-size: 12.5px;
}
.el-table td.el-table__cell { padding: 9px 0; }
.el-table .cell { line-height: 1.5; }

/* 无封面占位 */
.thumb-empty {
  display: flex; align-items: center; justify-content: center;
  color: #b6c2d4; font-size: 16px; background: #f1f5f9;
}
