/* ========== Reset & Base ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #2f9e8f;
  --primary-light: #e2f5f1;
  --primary-dark: #1f7d70;
  --success: #34b27b;
  --warning: #f5a623;
  --error: #ef5b5b;
  --bg: #f5f8fa;
  --bg-white: #fff;
  --border: #e8eef2;
  --text: #22303c;
  --text-secondary: #5b6b7a;
  --text-muted: #93a1ad;
  --sidebar-width: 240px;
  --sidebar-bg: #14222e;
  --sidebar-text: #9fb0bf;
  --sidebar-active: #2f9e8f;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16,42,67,.04), 0 8px 24px rgba(16,42,67,.06);
  --shadow-lg: 0 12px 32px rgba(16,42,67,.12);
  --transition: all .2s ease;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}

/* ========== Layout ========== */
.app-wrapper {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ========== Sidebar ========== */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: var(--transition);
}

.sidebar-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

.sidebar-logo .logo-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.nav-section { margin-bottom: 8px; }

.nav-section-title {
  padding: 8px 24px 4px;
  font-size: 12px;
  color: rgba(255,255,255,.35);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 24px;
  color: var(--sidebar-text);
  cursor: pointer;
  transition: var(--transition);
  border-left: 3px solid transparent;
  font-size: 14px;
}

.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.active {
  color: #fff;
  background: rgba(22,119,255,.15);
  border-left-color: var(--primary);
}

.nav-item .nav-icon { font-size: 18px; width: 20px; text-align: center; }

/* ========== Main Content ========== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

.top-bar {
  height: 56px;
  min-height: 56px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 50;
}

.top-bar .breadcrumb {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.top-bar .user-info {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-secondary);
}

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

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

/* ========== View Container ========== */
.view { display: none; }
.view.active { display: block; }

/* ========== Stats Cards ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.stat-icon.blue { background: #e6f4ff; color: #1677ff; }
.stat-icon.green { background: #f6ffed; color: #52c41a; }
.stat-icon.orange { background: #fff7e6; color: #fa8c16; }
.stat-icon.purple { background: #f9f0ff; color: #722ed1; }

.stat-info { flex: 1; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1.2; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ========== Panel / Section ========== */
.panel {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.panel-title { font-size: 16px; font-weight: 600; }

.panel-body { padding: 20px; }

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  background: #fff;
  color: var(--text);
  white-space: nowrap;
}

.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { color: var(--error); border-color: var(--error); }
.btn-danger:hover { background: #fff1f0; }
.btn-success { color: #fff; background: var(--success); border-color: var(--success); }
.btn-warning { color: #fff; background: #fa8c16; border-color: #fa8c16; }
.btn-warning:hover { background: #d46b08; }
.btn-info { color: #fff; background: #1890ff; border-color: #1890ff; }
.btn-info:hover { background: #096dd9; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-group { display: flex; gap: 8px; }

/* ========== Tables ========== */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th, .data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  background: #fafafa;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.data-table tr:hover td { background: #fafafa; }
.data-table .actions { display: flex; gap: 6px; }

/* ========== Tags ========== */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.tag-blue { background: #e6f4ff; color: #1677ff; }
.tag-green { background: #f6ffed; color: #52c41a; }
.tag-orange { background: #fff7e6; color: #fa8c16; }
.tag-red { background: #fff1f0; color: #ff4d4f; }
.tag-gray { background: #f5f5f5; color: #666; }

/* ========== Forms ========== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(22,119,255,.15); }
.form-textarea { resize: vertical; min-height: 80px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.form-inline {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.form-inline .form-group { margin-bottom: 0; }
.form-inline .form-input, .form-inline .form-select { width: 180px; }

/* ========== Modal ========== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  justify-content: center;
  align-items: flex-start;
  padding-top: 80px;
}

.modal-overlay.show { display: flex; }

.modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 30px rgba(0,0,0,.15);
  width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: modalIn .2s ease;
}

.modal.large { width: 760px; }

@keyframes modalIn { from { opacity: 0; transform: translateY(-20px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-title { font-size: 16px; font-weight: 600; }

.modal-close {
  width: 32px; height: 32px;
  border: none; background: none;
  font-size: 20px; cursor: pointer;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}

.modal-close:hover { background: #f5f5f5; color: var(--text); }

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ========== Permission Selector ========== */
.permission-section { margin-bottom: 12px; }
.permission-section-title { font-weight: 600; font-size: 13px; margin-bottom: 8px; color: var(--text-secondary); }
.permission-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.permission-chip {
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  transition: var(--transition);
}
.permission-chip:hover { border-color: var(--primary); }
.permission-chip.active { background: var(--primary-light); border-color: var(--primary); color: var(--primary); font-weight: 500; }

/* ========== Question Editor ========== */
.question-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  background: #fafafa;
}

.question-card .question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.question-num { font-weight: 600; color: var(--primary); }

.option-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.option-row .form-input { flex: 1; }

/* ========== Tree ========== */
.tree-node { padding-left: 8px; }
.tree-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
}

.tree-item:hover { background: #f0f0f0; }
.tree-item.active { background: var(--primary-light); color: var(--primary); font-weight: 500; }

.tree-children { display: none; padding-left: 16px; }
.tree-children.show { display: block; }

.tree-toggle { font-size: 12px; transition: transform .2s; cursor: pointer; width: 16px; text-align: center; color: var(--text-muted); }
.tree-toggle.open { transform: rotate(90deg); }

.tree-badge { font-size: 12px; color: var(--text-muted); margin-left: auto; }

/* ========== Quick Action Grid ========== */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.quick-action-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  border: 2px solid transparent;
}

.quick-action-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.quick-action-card .icon {
  font-size: 32px;
  margin-bottom: 10px;
}

.quick-action-card .title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.quick-action-card .desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* ========== Toast ========== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  font-size: 14px;
  animation: slideIn .3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

@keyframes slideIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--error); }
.toast.warning { border-left: 3px solid var(--warning); }

/* ========== Empty State ========== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .icon { font-size: 48px; margin-bottom: 12px; opacity: .4; }
.empty-state .text { font-size: 14px; }

/* ========== Progress Bar ========== */
.progress-bar {
  height: 6px;
  background: #f0f0f0;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--primary);
  transition: width .3s ease;
}

.progress-fill.green { background: var(--success); }
.progress-fill.orange { background: var(--warning); }

/* ========== Toolbar ========== */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

/* ========== Confirm Dialog ========== */
.confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 3200;
  justify-content: center;
  align-items: center;
}

.confirm-overlay.show { display: flex; }

.confirm-dialog {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 30px rgba(0,0,0,.15);
  width: 400px;
  max-width: calc(100vw - 40px);
  max-height: 86vh;
  overflow-y: auto;
  padding: 24px;
  text-align: center;
  animation: modalIn .2s ease;
}

.confirm-dialog .icon { font-size: 48px; margin-bottom: 12px; }
.confirm-dialog .message { font-size: 15px; margin-bottom: 20px; color: var(--text); word-break: break-word; }

/* ========== Detail View ========== */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.detail-item { padding: 8px 0; }
.detail-label { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.detail-value { font-size: 14px; color: var(--text); }

/* ========== Search ========== */
.search-box {
  position: relative;
  width: 240px;
}

.search-box .icon {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

.search-box .form-input { padding-left: 32px; }

/* ========== Video Player ========== */
.modal.video-modal { width: 880px; max-width: 95vw; }

.video-wrapper {
  position: relative;
  width: 100%;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

.video-wrapper video {
  width: 100%;
  max-height: 480px;
  display: block;
  background: #000;
}

/* 全屏播放：容器与视频撑满整个屏幕 */
.video-wrapper:fullscreen,
.video-wrapper:-webkit-full-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  border-radius: 0;
}
.video-wrapper:fullscreen video,
.video-wrapper:-webkit-full-screen video {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
}

.video-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #1a1a2e;
  border-radius: 0 0 8px 8px;
}

.speed-control {
  display: flex;
  align-items: center;
  gap: 6px;
}

.speed-label {
  color: #ccc;
  font-size: 13px;
  white-space: nowrap;
}

.speed-btn {
  padding: 4px 12px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 16px;
  background: transparent;
  color: #ccc;
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}

.speed-btn:hover { border-color: #1677ff; color: #fff; }
.speed-btn.active { background: #1677ff; border-color: #1677ff; color: #fff; font-weight: 600; }

.video-info {
  padding: 16px 0 0;
}

/* 全屏按钮：默认隐藏，仅移动端（≤768px）显示，保证 PC 端界面零变动 */
.video-fullscreen-btn { display: none; }

/* ===== 自建播放控制条（替换原生 controls：进度条只读，不可拖动/点击） ===== */
.vp-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 26px 14px 10px;
  background: linear-gradient(to top, rgba(0,0,0,.82), rgba(0,0,0,.45) 55%, transparent);
  z-index: 3;
  user-select: none;
}
.vp-btn {
  flex: 0 0 auto;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%;
  background: rgba(255,255,255,.14);
  color: #fff; font-size: 13px; line-height: 1;
  cursor: pointer;
  transition: background .15s;
}
.vp-btn:hover { background: rgba(255,255,255,.28); }
.vp-time {
  flex: 0 0 auto;
  color: rgba(255,255,255,.9);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* 进度条：只展示，不接收任何指针事件 → 无法点击/拖拽/双击跳转 */
.vp-track {
  position: relative;
  flex: 1 1 auto;
  height: 4px;
  min-width: 40px;
  border-radius: 2px;
  background: rgba(255,255,255,.24);
  pointer-events: none;
  cursor: default;
}
.vp-buffer {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 0;
  background: rgba(255,255,255,.32);
  border-radius: 2px;
}
.vp-played {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 0;
  background: var(--primary);
  border-radius: 2px;
}
.vp-knob {
  position: absolute; top: 50%; left: 0;
  width: 9px; height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.25);
}
.vp-lock {
  flex: 0 0 auto;
  color: rgba(255,255,255,.6);
  font-size: 11px;
  white-space: nowrap;
}
.vp-vol { flex: 0 0 auto; width: 68px; height: 4px; accent-color: var(--primary); cursor: pointer; }
.vp-bigplay {
  position: absolute;
  top: 50%; left: 50%;
  width: 58px; height: 58px;
  margin: -29px 0 0 -29px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(0,0,0,.5);
  color: #fff;
  font-size: 22px;
  padding-left: 4px;
  cursor: pointer;
  z-index: 2;
  transition: background .15s;
}
.vp-bigplay:hover { background: rgba(0,0,0,.7); }
.video-rule-hint {
  color: #7b8794;
  font-size: 12px;
  white-space: nowrap;
}

.video-info h3 { font-size: 18px; margin-bottom: 8px; }
.video-info .meta { display: flex; gap: 16px; color: var(--text-muted); font-size: 13px; margin-bottom: 12px; }
.video-info .meta span { display: flex; align-items: center; gap: 4px; }
.video-info .desc { color: var(--text-secondary); font-size: 14px; line-height: 1.6; }

.course-link {
  color: var(--primary);
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}

.course-link:hover { text-decoration: underline; color: var(--primary-dark); }

.doc-viewer {
  width: 100%;
  min-height: 400px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  background: #fafafa;
  line-height: 1.8;
  color: var(--text);
}

.doc-viewer h3 { margin-bottom: 12px; }
.doc-viewer p { margin-bottom: 10px; }

/* ========== Login Page ========== */
.login-overlay {
  display: flex;
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  width: 400px;
  padding: 40px 36px;
  animation: modalIn .3s ease;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .logo-icon {
  width: 64px; height: 64px;
  background: var(--primary);
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 12px;
}

.login-logo h1 { font-size: 22px; font-weight: 700; color: var(--text); }
.login-logo p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.login-form .form-group { margin-bottom: 20px; }

.login-hint {
  background: #f6f8fa;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-top: 16px;
}

.login-hint strong { color: var(--primary); }

.login-btn {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
}

.login-btn:hover { background: var(--primary-dark); }

/* ========== Role Badge ========== */
.role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 8px;
}

.role-badge.admin { background: #fff1f0; color: #ff4d4f; }
.role-badge.user { background: #e6f4ff; color: #1677ff; }

/* ========== User Dropdown ========== */
.user-dropdown {
  position: relative;
  cursor: pointer;
}

.user-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  padding: 8px 0;
  display: none;
  z-index: 100;
}

.user-dropdown-menu.show { display: block; }

.user-dropdown-item {
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-dropdown-item:hover { background: #f5f5f5; }
.user-dropdown-item.danger { color: var(--error); }

/* ========== Exam Taking ========== */
.exam-page {
  max-width: 800px;
  margin: 0 auto;
}

.exam-header {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.exam-timer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.exam-timer.warning { color: var(--error); }

.exam-question-list {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}

.exam-question-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.exam-question-item:last-child { border-bottom: none; }

.exam-question-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.exam-question-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.exam-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 4px;
}

.exam-option:hover { background: #f5f5f5; }
.exam-option input[type="radio"],
.exam-option input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }

.exam-textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  min-height: 100px;
  resize: vertical;
  outline: none;
  font-family: inherit;
}

.exam-textarea:focus { border-color: var(--primary); }

.exam-submit-bar {
  text-align: center;
  padding: 20px 0;
}

.exam-result {
  text-align: center;
  padding: 40px 20px;
}

.exam-result .score {
  font-size: 48px;
  font-weight: 700;
  margin: 16px 0;
}

.exam-result .score.pass { color: var(--success); }
.exam-result .score.fail { color: var(--error); }

.exam-result-icon { font-size: 64px; }

/* ========== Fill-in-the-blank Input ========== */
.exam-fill-input {
  width: 100%;
  padding: 10px 14px;
  border: 2px dashed var(--border);
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
  transition: var(--transition);
  background: #fafafa;
}

.exam-fill-input:focus {
  border-color: var(--primary);
  border-style: solid;
  background: #fff;
}

.exam-fill-input.correct-answer {
  border-color: var(--success);
  background: #f6ffed;
}

.exam-fill-input.wrong-answer {
  border-color: var(--error);
  background: #fff1f0;
}

/* ========== Grading Panel ========== */
.grade-header {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 24px;
  margin-bottom: 16px;
}

.grade-header .info-row {
  display: flex;
  gap: 24px;
  font-size: 14px;
}

.grade-header .info-row span {
  color: var(--text-secondary);
}

.grade-essay-item {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

.grade-essay-item .q-header {
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.grade-essay-item .q-header .score-tag {
  margin-left: auto;
  font-size: 13px;
  color: var(--primary);
}

.grade-answer-section {
  background: #f6f8fa;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 8px;
}

.grade-answer-section .label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 600;
}

.grade-answer-section .content {
  font-size: 14px;
  color: var(--text);
  white-space: pre-wrap;
}

.grade-reference-section {
  background: #f0f8ff;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 12px;
}

.grade-reference-section .label {
  font-size: 12px;
  color: var(--primary);
  margin-bottom: 4px;
  font-weight: 600;
}

.grade-reference-section .content {
  font-size: 14px;
  color: var(--text);
}

.grade-score-input {
  display: flex;
  align-items: center;
  gap: 8px;
}

.grade-score-input input {
  width: 80px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
  text-align: center;
}

.grade-score-input .max-score {
  color: var(--text-muted);
  font-size: 13px;
}

.grade-comment-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  margin-top: 8px;
  resize: vertical;
  min-height: 50px;
}

/* ========== Exam Record Sub-tabs ========== */
.exam-rec-subview { display: none; }
.exam-rec-subview.active { display: block; }

/* ========== Tab Subviews (Exam/DC/Task/Cert) ========== */
.exam-subview { display: none; }
.exam-subview.active { display: block; }
.dc-subview { display: none; }
.dc-subview.active { display: block; }
.task-subview { display: none; }
.task-subview.active { display: block; }
.org-subview { display: none; }
.org-subview.active { display: block; }

/* ========== Employee Search & Select ========== */
.emp-search-results { display: none; border: 1px solid #e0e0e0; border-radius: 6px; max-height: 220px; overflow-y: auto; margin-top: 6px; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.emp-search-item { padding: 8px 12px; font-size: 13px; cursor: pointer; border-bottom: 1px solid #f5f5f5; }
.emp-search-item:hover { background: #f0f7ff; }
.emp-selected { margin-top: 8px; }
.emp-chip { display: inline-flex !important; align-items: center; gap: 4px; }
.emp-chip-x { cursor: pointer; font-size: 13px; color: #999; padding: 0 2px; }
.emp-chip-x:hover { color: #ff4d4f; }

/* ========== Permission Section (new clean UI) ========== */
.perm-section { background: #fafbfc; border: 1px solid #e8e8e8; border-radius: 8px; padding: 16px; margin-top: 8px; }
.perm-section-title { display: flex; align-items: center; gap: 10px; font-weight: 600; color: #333; margin-bottom: 14px; font-size: 14px; }
.perm-bar { display: inline-block; width: 3px; height: 14px; background: #1677ff; border-radius: 2px; }
.perm-radio-group { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }
.perm-radio { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; color: #333; }
.perm-radio input { accent-color: #1677ff; width: 16px; height: 16px; }
.perm-partial-area { margin-top: 10px; padding-top: 10px; border-top: 1px dashed #e0e0e0; }
.perm-summary { font-size: 12px; color: #999; }
.perm-selected-preview { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.perm-selected-preview .permission-chip { font-size: 12px; background: #e8f4ff; color: #1677ff; border-color: #91caff; cursor: default; }

/* ========== Member Picker ========== */
.picker-tabs { display: flex; gap: 0; border-bottom: 2px solid #f0f0f0; margin-bottom: 16px; }
.picker-tab { padding: 10px 24px; background: none; border: none; cursor: pointer; font-size: 14px; color: #888; position: relative; }
.picker-tab.active { color: #1677ff; font-weight: 600; }
.picker-tab.active::after { content: ''; position: absolute; bottom: -2px; left: 0; right: 0; height: 2px; background: #1677ff; }
.picker-tab:hover:not(.active) { color: #333; }
.picker-pane { display: none; }
.picker-pane.active { display: block; }
#memberPickerModal { z-index: 2500 !important; }
.picker-select-count { font-size: 12px; color: #666; white-space: nowrap; }
.picker-select-count strong { color: #1677ff; font-size: 15px; }
.picker-emp-list { max-height: 300px; overflow-y: auto; padding: 4px; border: 1px solid #f0f0f0; border-radius: 6px; }
.picker-emp-list .permission-chip { display: inline-flex; align-items: center; gap: 4px; }
.chip-sub { font-size: 11px; color: #999; font-weight: 400; }

/* ========== Badge ========== */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--error);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  margin-left: 4px;
  vertical-align: middle;
}

/* ========== Grade Status Tags ========== */
.tag-auto { background: #e6f7ff; color: #1890ff; border: 1px solid #91d5ff; }
.tag-manual { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.tag-pending { background: #fff7e6; color: #fa8c16; border: 1px solid #ffd591; }
.tag-partial { background: #fff0f6; color: #eb2f96; border: 1px solid #ffadd2; }

/* ========== Make-up Exam Styles ========== */
.makeup-status-pending { color: var(--warning); font-weight: 600; }
.makeup-status-completed { color: var(--success); font-weight: 600; }
.makeup-status-expired { color: var(--text-muted); }

/* ========== Exam Time Window ========== */
.exam-time-window {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.exam-time-window.expired {
  color: var(--error);
}

.exam-time-window.upcoming {
  color: var(--primary);
}

.exam-not-available {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  background: #fff1f0;
  color: var(--error);
}

/* ========== Task Management ========== */
.task-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  margin-bottom: 16px;
  border-left: 4px solid var(--primary);
  transition: var(--transition);
}

.task-card:hover { box-shadow: var(--shadow-lg); }

.task-card.overdue { border-left-color: var(--error); }
.task-card.completed { border-left-color: var(--success); }
.task-card.cancelled { border-left-color: var(--text-muted); opacity: 0.7; }

.task-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.task-card-title { font-size: 16px; font-weight: 600; }

.task-card-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.task-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.task-progress-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.task-course-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.task-course-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #fafafa;
  border-radius: 6px;
  font-size: 13px;
}

.task-course-item .status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.done { background: var(--success); }
.status-dot.progress { background: var(--warning); }
.status-dot.none { background: #d9d9d9; }

.task-course-item .course-name {
  flex: 1;
  color: var(--text);
}

.task-course-item .course-status {
  font-size: 12px;
}

.task-progress-summary {
  display: flex;
  align-items: center;
  gap: 12px;
}

.task-progress-summary .progress-bar {
  flex: 1;
  min-width: 80px;
  height: 8px;
}

.task-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* Task Detail Progress Table */
.progress-table-wrapper { overflow-x: auto; }

.task-filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* Task stats row */
.task-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

/* Deadline warning */
.deadline-warning { color: var(--error); font-weight: 600; }
.deadline-normal { color: var(--text-muted); }
.deadline-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

/* ========== Certificate Management ========== */
.cert-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.cert-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
}

.cert-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

.cert-card-preview {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.cert-card-preview.cert-gold { background: linear-gradient(135deg, #fef9e7 0%, #fdebd0 50%, #f9e79f 100%); }
.cert-card-preview.cert-blue  { background: linear-gradient(135deg, #ebf5fb 0%, #d4e6f1 50%, #aed6f1 100%); }
.cert-card-preview.cert-red  { background: linear-gradient(135deg, #fdedec 0%, #fadbd8 50%, #f5b7b1 100%); }

.cert-preview-icon { font-size: 48px; opacity: 0.6; }

.cert-card-body { padding: 16px; }

.cert-card-body .cert-name { font-size: 16px; font-weight: 600; margin-bottom: 6px; }

.cert-card-body .cert-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 12px; flex-wrap: wrap; }

.cert-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.cert-actions { display: flex; gap: 6px; margin-top: 10px; }

/* Full Certificate Preview */
.certificate-preview-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,.6);
  z-index: 11000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 40px 20px;
}

.certificate-preview-overlay.hidden { display: none; }

.certificate-preview-container {
  max-width: 800px;
  width: 100%;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  overflow: hidden;
}

.certificate-preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: #f8f9fa;
  border-bottom: 1px solid var(--border);
}

.certificate-preview-toolbar .btns { display: flex; gap: 8px; }

/* Certificate Print Area */
.certificate-doc {
  padding: 40px 60px;
  text-align: center;
  position: relative;
  min-height: 500px;
}

.certificate-doc.gold-theme {
  background: linear-gradient(to bottom, #fefdf5 0%, #fdf6e3 50%, #fefdf5 100%);
  border: 12px double #c9a84c;
  color: #5d4e37;
}

.certificate-doc.blue-theme {
  background: linear-gradient(to bottom, #f8fbff 0%, #e8f0fe 50%, #f8fbff 100%);
  border: 12px double #2563eb;
  color: #1e3a5f;
}

.certificate-doc.red-theme {
  background: linear-gradient(to bottom, #fff8f8 0%, #fde8e8 50%, #fff8f8 100%);
  border: 12px double #c62828;
  color: #5f2121;
}

.certificate-doc .cert-ornament-top {
  font-size: 36px;
  letter-spacing: 12px;
  margin-bottom: 10px;
  opacity: 0.5;
}

.certificate-doc .cert-org {
  font-size: 14px;
  letter-spacing: 6px;
  text-transform: uppercase;
  margin-bottom: 8px;
  opacity: 0.7;
}

.certificate-doc .cert-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 6px;
  margin-bottom: 20px;
}

.certificate-doc .cert-divider {
  width: 200px;
  height: 2px;
  margin: 0 auto 20px;
}

.gold-theme .cert-divider { background: linear-gradient(to right, transparent, #c9a84c, transparent); }
.blue-theme .cert-divider  { background: linear-gradient(to right, transparent, #2563eb, transparent); }
.red-theme .cert-divider   { background: linear-gradient(to right, transparent, #c62828, transparent); }

.certificate-doc .cert-body-text {
  font-size: 16px;
  line-height: 2;
  margin-bottom: 24px;
}

.certificate-doc .cert-recipient {
  font-size: 28px;
  font-weight: 700;
  padding: 8px 24px;
  display: inline-block;
  margin: 8px 0;
  border-bottom: 2px solid;
}

.gold-theme .cert-recipient { border-color: #c9a84c; }
.blue-theme .cert-recipient  { border-color: #2563eb; }
.red-theme .cert-recipient   { border-color: #c62828; }

.certificate-doc .cert-course-name {
  font-size: 18px;
  font-weight: 600;
}

.certificate-doc .cert-date-row {
  display: flex;
  justify-content: center;
  gap: 80px;
  margin-top: 30px;
  font-size: 14px;
}

.certificate-doc .cert-date-row div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.certificate-doc .cert-date-row .date-value {
  font-size: 16px;
  font-weight: 600;
  padding: 4px 16px;
  border-bottom: 1px solid;
}

.certificate-doc .cert-seal {
  position: absolute;
  bottom: 50px;
  right: 80px;
  width: 100px;
  height: 100px;
  border: 3px solid;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  opacity: 0.6;
  transform: rotate(-15deg);
  line-height: 1.4;
}

.certificate-doc .cert-id {
  position: absolute;
  bottom: 30px;
  left: 60px;
  font-size: 11px;
  opacity: 0.4;
}

/* Certificate issue modal */
.cert-issue-employee-list {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
}

.cert-issue-employee-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}

.cert-issue-employee-list label:hover { background: var(--primary-light); }

/* My certificates list */
.my-cert-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* ========== Responsive ========== */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-actions { grid-template-columns: repeat(3, 1fr); }
  .task-stats-row { grid-template-columns: repeat(2, 1fr); }
  .cert-grid, .my-cert-grid { grid-template-columns: repeat(2, 1fr); }
  .cert-stats-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar { width: 60px; min-width: 60px; }
  .sidebar-logo span, .nav-section-title, .nav-item span:last-child { display: none; }
  .nav-item { justify-content: center; padding: 14px 0; }
  .form-row { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .cert-grid, .my-cert-grid { grid-template-columns: 1fr; }
  .cert-stats-row { grid-template-columns: 1fr 1fr; }
  .certificate-doc { padding: 24px 20px; }
  .certificate-doc .cert-title { font-size: 22px; }
  .certificate-doc .cert-recipient { font-size: 22px; }
  .certificate-doc .cert-date-row { gap: 20px; flex-wrap: wrap; }
  .certificate-doc .cert-seal { bottom: 30px; right: 20px; width: 70px; height: 70px; font-size: 10px; }
}

/* ============ WeChat Work Login ============ */
.btn-wechat-login { display: inline-flex; align-items: center; gap: 8px; padding: 10px 24px; border: 1px solid #07c160; background: #07c160; color: #fff; border-radius: 6px; font-size: 14px; cursor: pointer; transition: all .2s; font-weight: 500; }
.btn-wechat-login:hover { background: #06ad56; border-color: #06ad56; }
.wechat-icon { font-size: 18px; }
.demo-badge { display: inline-block; background: #ff9800; color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 3px; font-weight: 600; margin-left: 4px; }
.wechat-hint { font-size: 11px; color: #999; margin-top: 6px; }
.wechat-auth-content { width: 440px; max-width: 90vw; }
.wechat-stage { padding: 24px; text-align: center; }
.wechat-stage.hidden { display: none; }
.wechat-qr-placeholder { padding: 20px; text-align: center; }
.qr-hint { font-size: 14px; color: #333; margin-top: 12px; }
.qr-demo-hint { font-size: 12px; color: #ff9800; font-weight: 500; }
.wechat-auth-footer { border-top: 1px solid #f0f0f0; padding: 12px 20px; display: flex; justify-content: center; }
#wechat-auth-modal { z-index: 3000 !important; }

/* ========== Dashboard Panel Link ========== */
.panel-more-link { font-size: 12px; color: #1677ff; text-decoration: none; cursor: pointer; }
.panel-more-link:hover { color: #40a9ff; }

/* ========== Training Archive ========== */
.archive-employee-info { display: flex; align-items: baseline; gap: 12px; padding: 8px 0 14px; border-bottom: 1px solid #f0f0f0; margin-bottom: 6px; }
.archive-employee-info span { color: #888; font-size: 13px; }
.archive-section { margin-bottom: 18px; }
.archive-section-title { font-weight: 700; color: #333; margin-bottom: 8px; padding-left: 10px; border-left: 3px solid #1677ff; font-size: 14px; }
.archive-item { padding: 8px 12px; border: 1px solid #f0f0f0; border-radius: 6px; margin-bottom: 6px; background: #fafbfc; }
.archive-item-main { font-size: 13px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.archive-item-sub { font-size: 12px; color: #999; margin-top: 3px; }

/* ========== 后端同步状态 Chip ========== */
.sync-chip { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 11px; margin-right: 8px; vertical-align: middle; }
.sync-ok { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.sync-syncing { background: #e6f7ff; color: #1890ff; border: 1px solid #91d5ff; }
.sync-offline { background: #fff7e6; color: #fa8c16; border: 1px solid #ffd591; }
.sync-idle { background: #f5f5f5; color: #999; border: 1px solid #e0e0e0; }

/* ========== 一键导入横幅 ========== */
.import-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 20px; background: linear-gradient(90deg, #e6f7ff, #f0f9ff); border-bottom: 1px solid #91d5ff; flex-wrap: wrap; }
.import-banner-text { font-size: 13px; color: #333; }
.import-banner-actions { display: flex; gap: 8px; }

/* ========== 题目内容下划线增强 ========== */
.fill-underline {
  display: inline-block;
  min-width: 80px;
  border-bottom: 1.5px dashed #1677ff;
  color: #1677ff;
  letter-spacing: 1px;
  padding: 0 2px;
}

/* ============================================================
   ★★★★★ 移动端响应式适配（以下为新增代码，不改动任何原有规则）★★★★★
   说明：
   1) 桌面端（>768px）行为完全不变，本区块仅在小屏下生效
   2) 断点：≤768px 手机（汉堡菜单+单列）；≤480px 小屏手机微调
   3) 原 CSS 末尾的 768px「窄侧边栏」规则会被本区块覆盖（后者优先）
   ============================================================ */

/* ---- 汉堡按钮 & 侧边栏遮罩（默认隐藏，手机宽度显示）---- */
.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border: none;
  background: transparent;
  font-size: 22px;
  color: var(--text);
  cursor: pointer;
  border-radius: 8px;
  flex-shrink: 0;
}
.hamburger-btn:active { background: #f0f0f0; }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 999;
  opacity: 0;
  transition: opacity .25s ease;
}
.sidebar-backdrop.show { display: block; opacity: 1; }

/* ============ 手机端（≤768px）============ */
@media (max-width: 768px) {

  /* ---- 1. 侧边栏折叠为抽屉式汉堡菜单 ---- */
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: min(264px, 84vw);
    min-width: 0;
    transform: translateX(-100%);
    transition: transform .28s ease;
    z-index: 1000;
    box-shadow: 2px 0 16px rgba(0,0,0,.18);
  }
  .sidebar.open { transform: translateX(0); }
  /* 恢复被原 768px 规则隐藏的文字（抽屉里需要完整菜单文字） */
  .sidebar-logo span, .nav-section-title, .nav-item span:last-child { display: block; }
  .nav-item { justify-content: flex-start; padding: 13px 22px; }
  .nav-item .nav-icon { width: 22px; }
  .nav-section-title { display: block; }

  /* 汉堡按钮显示 */
  .hamburger-btn { display: inline-flex; }

  /* ---- 2. 主内容区占满宽度 ---- */
  .main-content { width: 100%; }
  .top-bar { padding: 0 12px; height: 52px; min-height: 52px; gap: 8px; }
  .top-bar .breadcrumb { font-size: 14px; }
  .top-bar .user-info { gap: 8px; }
  /* 顶栏精简：手机端隐藏用户名与角色徽章，仅保留头像下拉 */
  .top-bar .user-info > span#currentUserName,
  .top-bar .user-info > .role-badge { display: none; }
  .user-avatar { width: 32px; height: 32px; }
  .page-content { padding: 12px; }

  /* ---- 3. 网格类：自动换行/单列 ---- */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
  .stat-card { padding: 14px; gap: 10px; }
  .stat-icon { width: 40px; height: 40px; font-size: 20px; border-radius: 10px; }
  .stat-value { font-size: 22px; }
  .stat-label { font-size: 12px; }
  .quick-actions { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
  .quick-action-card { padding: 16px 12px; }
  .quick-action-card .icon { font-size: 26px; }
  .task-stats-row, .cert-stats-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cert-grid, .my-cert-grid { grid-template-columns: 1fr; gap: 14px; }
  .cert-card-preview { height: 120px; }

  /* ---- 4. 工具栏 / 筛选区：纵向堆叠，控件全宽 ---- */
  .toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .toolbar .btn-group { flex-wrap: wrap; }
  .form-inline { flex-direction: column; align-items: stretch; gap: 10px; }
  .form-inline .form-group { width: 100%; margin-bottom: 0; }
  .form-inline .form-input, .form-inline .form-select,
  .toolbar .form-input, .toolbar .form-select { width: 100%; min-width: 0; }
  .search-box { width: 100%; }
  .task-filter-bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .task-filter-bar .form-input, .task-filter-bar .form-select { width: 100% !important; min-width: 0 !important; }

  /* ---- 5. 表格自适应：手机下转卡片式，禁止横向滚动 ---- */
  .panel-body { overflow-x: visible !important; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table thead { display: none; }
  .data-table tr {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px 14px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
  }
  .data-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    border: none;
    padding: 8px 2px;
    font-size: 13px;
    text-align: right;
  }
  /* 列名：由 JS 注入的 data-label 提供 */
  .data-table td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    flex-shrink: 0;
    text-align: left;
  }
  /* 操作列：右对齐换行，不显示列名 */
  .data-table td.actions {
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 10px;
    margin-top: 6px;
    border-top: 1px dashed var(--border);
  }
  .data-table td.actions::before { display: none; }
  .data-table tr:hover td { background: transparent; }

  /* ---- 6. 按钮 / 触控区域放大 ---- */
  .btn { min-height: 40px; padding: 9px 18px; font-size: 14px; }
  .btn-sm { min-height: 32px; padding: 6px 12px; font-size: 13px; }
  .btn-group { flex-wrap: wrap; }
  .nav-item { min-height: 46px; }
  .modal-close { width: 38px; height: 38px; font-size: 22px; }

  /* ---- 7. 表单控件适配 ---- */
  .form-input, .form-select { min-height: 42px; font-size: 15px; }
  .form-textarea { min-height: 90px; font-size: 15px; }
  .form-row { gap: 10px; }
  .form-label { font-size: 14px; }
  .permission-chip { padding: 7px 14px; font-size: 14px; }
  .emp-chip { padding: 6px 10px; font-size: 13px; }

  /* ---- 8. 弹窗：底部抽屉式，全宽 ---- */
  .modal-overlay { padding-top: 0; align-items: flex-end; justify-content: center; }
  .modal, .modal.large, .modal.video-modal {
    width: 100%;
    max-width: 100vw;
    max-height: 92vh;
    border-radius: 14px 14px 0 0;
  }
  .modal-header { padding: 14px 16px; }
  .modal-body { padding: 16px; }
  .modal-footer { padding: 12px 16px; }
  .confirm-dialog { width: calc(100vw - 40px); max-width: 400px; padding: 22px 16px; max-height: 86vh; overflow-y: auto; }
  .wechat-auth-content { width: calc(100vw - 32px); max-width: 420px; }

  /* ---- 9. 登录页适配 ---- */
  .login-card { width: calc(100vw - 32px); max-width: 400px; padding: 28px 22px; }
  .login-logo { margin-bottom: 24px; }
  .login-logo .logo-icon { width: 56px; height: 56px; font-size: 28px; }
  .login-logo h1 { font-size: 19px; }
  .login-btn { min-height: 48px; font-size: 15px; }

  /* ---- 10. 视频播放器自适应 ---- */
  .video-wrapper video { max-height: 40vh; }
  .video-fullscreen-btn { display: inline-block; }
  .video-controls { flex-wrap: wrap; padding: 10px 12px; gap: 8px; }
  /* 小屏控制条：去掉音量滑块与“不可拖动”文字，保留播放/时间/进度/静音/全屏 */
  .vp-bar { gap: 8px; padding: 22px 10px 8px; }
  .vp-vol { display: none; }
  .vp-lock { font-size: 12px; }
  .vp-lock-txt { display: none; }
  .vp-btn { width: 28px; height: 28px; font-size: 12px; }
  .vp-time { font-size: 11px; }
  .vp-bigplay { width: 48px; height: 48px; margin: -24px 0 0 -24px; font-size: 18px; }
  .video-rule-hint { display: none; }
  .video-info .meta { flex-wrap: wrap; gap: 6px 14px; }
  .video-info h3 { font-size: 16px; }
  .doc-viewer { min-height: 260px; padding: 16px; }

  /* ---- 11. 考试 / 批改页面 ---- */
  .exam-question-list { padding: 16px; }
  .exam-question-title { font-size: 14px; }
  .exam-question-num { width: 26px; height: 26px; font-size: 12px; }
  .exam-option { padding: 12px 10px; }
  .exam-option input[type="radio"], .exam-option input[type="checkbox"] { width: 20px; height: 20px; }
  .exam-textarea, .exam-fill-input { font-size: 15px; }
  .exam-timer { font-size: 13px; }
  .grade-header { padding: 14px 16px; }
  .grade-header .info-row { flex-wrap: wrap; gap: 10px; }
  .grade-essay-item { padding: 16px; }
  .grade-score-input input { min-height: 38px; }
  .exam-result .score { font-size: 40px; }

  /* ---- 12. 其他：toast / 导入横幅 / 空状态 ---- */
  .toast-container { top: 10px; right: 12px; left: 12px; align-items: stretch; }
  .toast { padding: 12px 14px; font-size: 13px; }
  .import-banner { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px 14px; }
  .import-banner-actions { justify-content: flex-end; }
  .empty-state { padding: 40px 16px; }
  .empty-state .icon { font-size: 40px; }
  .cert-issue-employee-list label { padding: 12px 10px; font-size: 14px; }
  .detail-grid { gap: 8px; }
  .emp-search-results { max-height: 260px; }
}

/* ============ 小屏手机（≤480px）============ */
@media (max-width: 480px) {
  .stats-grid, .quick-actions { grid-template-columns: 1fr; }
  .task-stats-row, .cert-stats-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-icon { width: 36px; height: 36px; font-size: 18px; }
  .stat-value { font-size: 20px; }
  .video-controls .speed-btn { padding: 6px 10px; }
}

/* ============================================================
   ★★★★★ 返回上一级控件（以下为新增代码，不改动任何原有规则）★★★★★
   1) .back-btn  —— 页面头部（top-bar）左上角的视图级返回按钮，仅二级及以上页面显示
   2) .modal-back-btn —— 弹窗/详情/编辑/答题/预览页 header 内的返回按钮（由 JS 注入）
   桌面与手机均生效；手机端加大触控区域并隐藏文字只保留箭头
   ============================================================ */

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
  margin-right: 10px;
  transition: var(--transition);
  white-space: nowrap;
}
.back-btn:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }
.back-arrow { font-size: 16px; line-height: 1; }

.modal-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border: none;
  background: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  flex-shrink: 0;
  margin-right: 4px;
  transition: var(--transition);
}
.modal-back-btn:hover { background: #f5f5f5; color: var(--text); }

/* 手机端：返回按钮适配触屏，箭头图标加大、隐藏文字 */
@media (max-width: 768px) {
  .back-btn {
    min-width: 40px;
    min-height: 40px;
    padding: 8px 10px;
    font-size: 15px;
    margin-right: 4px;
    justify-content: center;
  }
  .back-btn .back-text { display: none; }
  .back-arrow { font-size: 18px; }
  .modal-back-btn { width: 40px; height: 40px; font-size: 20px; margin-right: 2px; }
}

/* ==================== 线下培训业务（独立模块） ==================== */
.badge-green { background: #2e9e4f; }
.badge-red { background: #e0524a; }
.badge-gray { background: #9aa3af; }

.offline-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.offline-card {
  border: 1px solid var(--border, #e6e8eb); border-radius: 10px; padding: 14px 16px; background: #fff;
  display: flex; flex-direction: column; gap: 6px; transition: box-shadow .15s, transform .15s;
}
.offline-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.offline-card .oc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.offline-card .oc-title { font-weight: 600; font-size: 15px; }
.offline-card .oc-meta { font-size: 13px; color: #5a6472; line-height: 1.5; }
.offline-card .oc-code { font-size: 13px; color: #333; margin-top: 2px; }
.offline-card .oc-code b { font-size: 16px; letter-spacing: 2px; color: var(--primary, #1677ff); }
.offline-card .oc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* 线下培训管理：手风琴（默认收起，仅显示标题，点击展开） */
.offline-acc { border: 1px solid var(--border, #e6e8eb); border-radius: 10px; background: #fff; overflow: hidden; transition: box-shadow .15s; }
.offline-acc + .offline-acc { margin-top: 10px; }
.offline-acc:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.oa-head { display: flex; align-items: center; justify-content: flex-start; gap: 8px; padding: 13px 16px; cursor: pointer; user-select: none; }
.oa-head.open { background: #f5f8ff; }
.oa-title { font-weight: 600; font-size: 15px; color: #1f2733; }
.oa-caret { font-size: 11px; color: #8a93a0; transition: transform .15s; flex: none; margin-left: auto; }
.oa-body { padding: 0 16px 14px; border-top: 1px solid #eef0f2; display: flex; flex-direction: column; gap: 6px; }
.oa-status { margin-top: 10px; }
.offline-acc .oc-meta { font-size: 13px; color: #5a6472; line-height: 1.5; }
.offline-acc .oc-code { font-size: 13px; color: #333; margin-top: 2px; }
.offline-acc .oc-code b { font-size: 16px; letter-spacing: 2px; color: var(--primary, #1677ff); }
.offline-acc .oc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.type-badge {
  display: inline-block; padding: 1px 8px; border-radius: 9px; font-size: 11px; font-weight: 600;
  background: #e8f0ff; color: #1677ff; border: 1px solid #bcd4ff;
}

.signin-code-row { display: flex; gap: 8px; align-items: center; }
.signin-code-row .form-input { flex: 1; letter-spacing: 3px; font-size: 16px; }

.offline-participant-box { display: grid; grid-template-columns: 1fr; gap: 16px; border: 1px solid #e6e8eb; border-radius: 10px; padding: 12px; }
.opb-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.opb-title { font-weight: 600; font-size: 13px; color: #333; }
.opb-search { margin-bottom: 2px; }
.opb-list { max-height: 200px; overflow: auto; border: 1px solid #eef0f2; border-radius: 8px; padding: 4px; background: #fafbfc; }
.user-opt { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.user-opt:hover { background: #eef4ff; }
.user-opt input { flex: none; }
.uo-name { font-size: 13px; }
.uo-meta { font-size: 12px; color: #98a0ab; margin-left: auto; }
.opb-empty { color: #98a0ab; font-size: 13px; padding: 8px; text-align: center; }
.opb-count { font-size: 13px; color: #1677ff; font-weight: 600; margin-top: 8px; }
.opb-upload { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.opb-upload input[type="file"] { flex: 1 1 160px; min-width: 0; font-size: 13px; padding: 6px; border: 1px solid #e6e8eb; border-radius: 8px; background: #fff; }
.opb-import-preview { max-height: 160px; overflow: auto; border: 1px solid #eef0f2; border-radius: 8px; background: #fafbfc; padding: 6px; display: none; }
.opb-import-preview:not(:empty) { display: block; }
.oip-head { font-size: 12px; font-weight: 600; color: #2e9e4f; margin-bottom: 4px; }
.oip-row { font-size: 12px; color: #5a6472; padding: 3px 4px; border-bottom: 1px dashed #eef0f2; }
.oip-row:last-child { border-bottom: none; }

.qr-img { width: 220px; height: 220px; }
.code-display { font-size: 22px; letter-spacing: 6px; font-weight: 700; color: #1677ff; margin-top: 10px; }

.offline-records-summary { font-size: 13px; color: #5a6472; margin-bottom: 12px; }

.signin-detail { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.signin-detail .sd-title { font-size: 17px; font-weight: 700; }
.signin-result { padding: 12px; border-radius: 8px; font-size: 14px; text-align: center; margin-top: 6px; }
.signin-result.ok { background: #eafaf0; color: #2e9e4f; border: 1px solid #b7e8c8; }
.signin-result.warn { background: #fff7e6; color: #d48806; border: 1px solid #ffe0a3; }
.btn-block { display: block; width: 100%; }

/* 详情页：培训内容 / 培训备注 转为有序列表、每条一行 */
.oc-block { margin: 4px 0; }
.oc-block-title { font-size: 13px; color: #5a6472; font-weight: 600; margin-bottom: 2px; }
.offline-lines { margin: 2px 0 2px 20px; padding: 0; }
.offline-lines li { font-size: 13px; color: #3a4250; line-height: 1.6; }

/* 移动端适配：参训人员双栏在手机上堆叠 */
@media (max-width: 768px) {
  .offline-participant-box { grid-template-columns: 1fr; }
  .offline-grid { grid-template-columns: 1fr; }
  .signin-code-row { flex-wrap: wrap; }
  .signin-code-row .form-input { width: 100%; }
  .qr-img { width: 200px; height: 200px; }
}

/* 通讯录：已禁用员工行 */
.contact-disabled td { color: #b0b0b0; background: #fafafa; }
.contact-disabled td strong { color: #888; }

/* 通讯录：员工查看弹窗 */
.view-row { display: flex; padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
.view-row .view-label { width: 100px; color: #999; flex: none; }
.view-row .view-value { flex: 1; color: #333; }

/* 通讯录：批量导入预览（无效行标灰） */
.contact-import-invalid td { color: #b0b0b0; background: #fafafa; }

/* ============================================================
   清新极简主题（仅视觉，不改变任何功能/结构/逻辑）
   ============================================================ */
/* ---------- 侧边栏 ---------- */
.sidebar {
  background: linear-gradient(180deg, #17263b 0%, #101c2b 100%);
  box-shadow: 2px 0 16px rgba(16,42,67,.08);
}
.sidebar-logo .logo-icon {
  background: linear-gradient(135deg, #3cb6a6, #2f9e8f);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(47,158,143,.35);
}
.nav-section-title { color: rgba(255,255,255,.38); letter-spacing: 1.5px; }
.nav-item {
  border-radius: 10px;
  margin: 2px 12px;
  padding: 10px 14px;
  border-left: none;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active {
  background: linear-gradient(135deg, rgba(47,158,143,.28), rgba(47,158,143,.12));
  border-left: none;
  color: #fff;
}
.nav-item.active .nav-icon { color: #4fd0be; }

/* ---------- 顶部栏 ---------- */
.top-bar {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #eef2f6;
  box-shadow: 0 1px 8px rgba(16,42,67,.04);
}
.user-avatar {
  background: linear-gradient(135deg, #3cb6a6, #2f9e8f);
  box-shadow: 0 2px 8px rgba(47,158,143,.3);
}

/* ---------- 面板 / 卡片 ---------- */
.panel {
  border-radius: 14px;
  border: 1px solid rgba(232,238,242,.85);
  box-shadow: var(--shadow);
}
.panel-header { padding: 18px 22px; }
.panel-title { font-weight: 600; letter-spacing: .2px; }
.panel-body { padding: 22px; }

.stat-card {
  border-radius: 14px;
  border: 1px solid rgba(232,238,242,.85);
  box-shadow: var(--shadow);
}
.stat-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.stat-icon { border-radius: 12px; }
.stat-icon.blue   { background: #e2f5f1; color: #2f9e8f; }
.stat-icon.green  { background: #e8f7ee; color: #2c9d6f; }
.stat-icon.orange { background: #fdf3e3; color: #e08c16; }
.stat-icon.purple { background: #f1edfb; color: #7a5cd0; }

.quick-action-card {
  border-radius: 14px;
  border: 1px solid rgba(232,238,242,.85);
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.quick-action-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.quick-action-card .icon { border-radius: 12px; }

.task-card { border-radius: 14px; box-shadow: var(--shadow); }
.task-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

.cert-card { border-radius: 14px; box-shadow: var(--shadow); }
.cert-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.cert-card-preview { border-radius: 12px 12px 0 0; }

.offline-card, .offline-acc { border-radius: 14px; box-shadow: var(--shadow); }
.offline-acc { border: 1px solid rgba(232,238,242,.85); }
.oa-head { border-radius: 14px; }
.oa-head.open { background: #f2faf8; }

/* ---------- 按钮 ---------- */
.btn { border-radius: 8px; font-weight: 500; }
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, #3cb6a6, #2f9e8f);
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(47,158,143,.25);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #2f9e8f, #1f7d70);
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(47,158,143,.32);
}
.btn-danger:hover { background: #fdf0f0; }
.btn-success {
  background: linear-gradient(135deg, #3ec483, #2c9d6f);
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(44,157,111,.22);
}
.btn-success:hover { background: linear-gradient(135deg, #2c9d6f, #238a60); border-color: transparent; }
.btn-warning {
  background: linear-gradient(135deg, #f7b14a, #e08c16);
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(224,140,22,.22);
}
.btn-warning:hover { background: linear-gradient(135deg, #e08c16, #c97a10); border-color: transparent; }
.btn-info {
  background: linear-gradient(135deg, #5aa9f5, #2f7fe0);
  border-color: transparent;
}
.btn-info:hover { background: linear-gradient(135deg, #2f7fe0, #1f6bc9); border-color: transparent; }

/* ---------- 表格 ---------- */
.data-table th {
  background: #f6fafb;
  font-weight: 600;
  color: #5b6b7a;
  letter-spacing: .3px;
}
.data-table th, .data-table td { border-bottom: 1px solid #eef2f6; }
.data-table tr:hover td { background: #f1faf8; }

/* ---------- 标签 / 徽章 ---------- */
.tag { border-radius: 6px; font-weight: 500; }
.tag-blue   { background: #e2f5f1; color: #2f9e8f; }
.tag-green  { background: #e8f7ee; color: #2c9d6f; }
.tag-orange { background: #fdf3e3; color: #e08c16; }
.tag-red    { background: #fdf0f0; color: #e05555; }
.tag-gray   { background: #f2f5f7; color: #7c8b99; }
.badge { border-radius: 999px; }
.badge-green { background: #e8f7ee; color: #2c9d6f; }
.badge-red   { background: #fdf0f0; color: #e05555; }
.badge-gray  { background: #f2f5f7; color: #7c8b99; }
.type-badge { border-radius: 999px; }

/* ---------- 表单 ---------- */
.form-input, .form-select, .form-textarea {
  border-radius: 8px;
  background: #fbfdfe;
  border-color: #dfe7ec;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.form-input:hover, .form-select:hover, .form-textarea:hover { border-color: #c9d6de; }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(47,158,143,.13);
}
.form-label { font-weight: 600; }
.form-hint { color: var(--text-muted); }

/* ---------- 弹窗 ---------- */
.modal-overlay { background: rgba(15,34,48,.4); backdrop-filter: blur(3px); }
.modal {
  border-radius: 16px;
  box-shadow: 0 18px 52px rgba(16,42,67,.18);
  border: 1px solid rgba(232,238,242,.6);
}
.modal-header { border-bottom: 1px solid #eef2f6; }
.modal-title { font-weight: 600; letter-spacing: .2px; }
.modal-close:hover { background: #f0f5f7; color: var(--text); border-radius: 8px; }
.modal-footer { border-top: 1px solid #eef2f6; }

/* ---------- 权限选择 / 用户选项 ---------- */
.permission-chip { border-radius: 999px; }
.permission-chip.active {
  background: #e2f5f1;
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(47,158,143,.18);
}
.user-opt { border-radius: 10px; transition: var(--transition); }
.user-opt:hover { background: #f1faf8; }

/* ---------- 登录页 ---------- */
.login-overlay { background: linear-gradient(160deg, #e7f3f0 0%, #f3f8f7 55%, #e9f0f6 100%); }
.login-card {
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.95);
  box-shadow: 0 20px 60px rgba(16,42,67,.16);
  backdrop-filter: blur(6px);
}
.login-card .form-input { border-radius: 10px; }

/* ---------- 工具条 / 搜索 ---------- */
.toolbar { border-radius: 12px; }
.search-box .form-input { border-radius: 999px; }
.search-box { border-radius: 999px; }

/* ---------- 空状态 ---------- */
.empty-state { border-radius: 12px; }

/* ---------- 视频播放控制条 ---------- */
.video-controls { border-radius: 0 0 12px 12px; }
.speed-btn { border-radius: 8px; }

/* ---------- 证书 / 任务 / 线下等内部小卡片 ---------- */
.cert-issue-emp-cb + span, .offline-user-cb + span { transition: var(--transition); }

/* ============================================================
   「我的学习」导航分组（可展开/收起下拉，功能不变）
   ============================================================ */
.nav-group { margin-bottom: 4px; }
.nav-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 24px;
  color: var(--sidebar-text);
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
  user-select: none;
}
.nav-group-title:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-group-title .nav-icon { font-size: 18px; width: 20px; text-align: center; }
.nav-group-caret { margin-left: auto; font-size: 11px; color: rgba(255,255,255,.45); transition: var(--transition); }
.nav-group-body .nav-item { padding-left: 46px; margin-left: 0; margin-right: 0; }
.nav-group-body .nav-item .nav-icon { font-size: 15px; }

/* 移动端折叠侧边栏（≤768px）：分组强制展开、仅显示图标 */
@media (max-width: 768px) {
  .nav-group-body { display: block !important; }
  .nav-group-title { justify-content: center; padding: 14px 0; }
  .nav-group-title .nav-icon { font-size: 18px; }
  .nav-group-name, .nav-group-caret { display: none; }
}

/* 移动端折叠侧边栏：分组子项还原为图标居中 */
@media (max-width: 768px) {
  .nav-group-body .nav-item { padding-left: 0; }
}

/* ============================================================
   组织架构：节点操作按钮（新增子部门 / 重命名 / 删除）
   ============================================================ */
.tree-ops { display: none; align-items: center; gap: 2px; margin-left: 2px; }
.tree-item:hover .tree-ops { display: flex; }
.tree-ops button {
  border: none; background: transparent; cursor: pointer;
  font-size: 12px; line-height: 1; padding: 3px 4px; border-radius: 4px;
  color: #64748b; transition: background .15s, color .15s;
}
.tree-ops button:hover { background: rgba(47,158,143,.14); color: #2f9e8f; }
.tree-ops button.del:hover { background: #fdf0f0; color: #e05555; }
