:root {
  --sidebar-w: 232px;
  --primary: #0d6efd;
  --bg: #f5f7fa;
}

body { background: var(--bg); font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif; }

/* ---------- 整体布局 ---------- */
.app-layout { display: flex; min-height: 100vh; }

.app-sidebar {
  width: var(--sidebar-w);
  background: #1e293b;
  color: #cbd5e1;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 1030;
  transition: transform .25s ease;
}
.sidebar-brand {
  padding: 18px 20px;
  font-weight: 700;
  color: #fff;
  font-size: 1.02rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  line-height: 1.4;
}
.sidebar-brand small { display: block; font-weight: 400; color: #94a3b8; font-size: .75rem; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  color: #cbd5e1; text-decoration: none;
  padding: 10px 14px; border-radius: 8px; margin-bottom: 4px;
  font-size: .95rem; transition: background .15s, color .15s;
}
.sidebar-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-nav a.active { background: var(--primary); color: #fff; font-weight: 600; }
.sidebar-nav .icon { font-size: 1.1rem; width: 22px; text-align: center; }
.sidebar-foot { padding: 12px 16px; font-size: .72rem; color: #64748b; border-top: 1px solid rgba(255,255,255,.08); }

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

.app-topbar {
  background: #fff; border-bottom: 1px solid #e5e7eb;
  padding: 10px 20px; display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 1020;
}
.app-topbar .user-info { margin-left: auto; color: #475569; font-size: .92rem; }
.app-topbar .user-info .badge { margin-left: 6px; }

.app-content { flex: 1; padding: 20px; }
.app-footer { padding: 16px 20px; text-align: center; font-size: .8rem; color: #98a2b3; line-height: 1.7; border-top: 1px solid #eef0f3; background: #fff; }
.app-footer a { color: #98a2b3; text-decoration: none; }
.app-footer a:hover { color: var(--primary); }

#sidebarToggle { display: none; border: none; background: transparent; font-size: 1.4rem; color: #334155; }
.sidebar-backdrop { display: none; }

/* ---------- 卡片与统计 ---------- */
.card-stat { border: none; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.card-stat .num { font-size: 1.9rem; font-weight: 700; color: var(--primary); }
.card-stat .lbl { color: #6b7280; font-size: .85rem; }
.chart-box { position: relative; height: 260px; }

/* ---------- 登录页 ---------- */
.login-card { max-width: 420px; margin: 8vh auto; border: none; border-radius: 14px; box-shadow: 0 4px 20px rgba(0,0,0,.08); }
.login-footer { max-width: 420px; margin: 0 auto; }

/* ---------- 表格 ---------- */
.table td, .table th { vertical-align: middle; }
.badge-role { font-size: .85rem; }

/* ---------- 课程 ---------- */
.lesson-card { border: none; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.06); transition: transform .15s; }
.lesson-card:hover { transform: translateY(-2px); }
.lesson-card .badge-tool { font-size: .72rem; }

/* ---------- 响应式 ---------- */
@media (max-width: 991.98px) {
  .app-sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); }
  .app-sidebar.show { transform: translateX(0); }
  .sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1025; }
  #sidebarToggle { display: inline-block; }
}
