/* ===== 安鑫咨询 · 教培管理后台 ===== */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --success: #16a34a;
  --success-light: #f0fdf4;
  --warning: #d97706;
  --warning-light: #fffbeb;
  --text: #1f2937;
  --text-2: #6b7280;
  --text-3: #9ca3af;
  --border: #e5e7eb;
  --bg: #f5f7fa;
  --card: #ffffff;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
}
.hidden { display: none !important; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ---------- 登录页 ---------- */
.login-view {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eef4ff 0%, #f5f7fa 55%, #fdf2f8 100%);
}
.login-card {
  width: 380px; background: var(--card); border-radius: 16px; padding: 40px 36px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, .12); text-align: center;
}
.login-logo {
  width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: #fff; font-size: 30px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.login-card h1 { font-size: 22px; }
.login-sub { color: var(--text-2); margin: 6px 0 28px; }
.login-card form { text-align: left; }
.login-card label { display: block; font-size: 13px; color: var(--text-2); margin: 14px 0 6px; }
.login-card input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  outline: none; transition: border-color .15s;
}
.login-card input:focus { border-color: var(--primary); }
.login-card .btn { margin-top: 22px; }
.login-tip { margin-top: 16px; font-size: 12px; color: var(--text-3); line-height: 1.6; }

/* ---------- 布局 ---------- */
.app-view { display: flex; min-height: 100vh; }
.sidebar {
  width: 216px; background: var(--card); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px; border-bottom: 1px solid var(--border); }
.brand-logo {
  width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: #fff; font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.brand-text { font-weight: 600; font-size: 15px; line-height: 1.2; }
.brand-text small { display: block; font-size: 11px; color: var(--text-3); font-weight: 400; margin-top: 2px; }
.nav { flex: 1; overflow-y: auto; padding: 10px 8px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
  color: var(--text-2); cursor: pointer; margin-bottom: 2px; font-size: 14px;
  transition: background .15s, color .15s; border: none; background: none; width: 100%; text-align: left;
}
.nav-item:hover { background: #f3f4f6; color: var(--text); }
.nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 500; }
.nav-item .nav-icon { width: 18px; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto; background: var(--danger); color: #fff; font-size: 11px;
  border-radius: 999px; padding: 1px 7px; font-weight: 500;
}
.sidebar-footer { padding: 12px 16px; border-top: 1px solid var(--border); }
.admin-name { font-size: 13px; color: var(--text-2); display: block; margin-bottom: 8px; }
.footer-btns { display: flex; gap: 8px; }
.main { flex: 1; margin-left: 216px; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  background: var(--card); border-bottom: 1px solid var(--border);
  padding: 14px 28px; position: sticky; top: 0; z-index: 10;
}
.page-title { font-size: 18px; font-weight: 600; }
.page-desc { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.page-content { padding: 24px 28px; flex: 1; }

/* ---------- 卡片与统计 ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); }
.card-pad { padding: 20px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { padding: 18px 20px; display: flex; align-items: center; gap: 14px; }
.stat-icon {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.stat-icon.blue { background: var(--primary-light); }
.stat-icon.green { background: var(--success-light); }
.stat-icon.orange { background: var(--warning-light); }
.stat-icon.red { background: var(--danger-light); }
.stat-icon.purple { background: #f5f3ff; }
.stat-value { font-size: 22px; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--text-2); margin-top: 4px; }

/* ---------- 工具栏与表格 ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; font-size: 12px; color: var(--text-2); font-weight: 500;
  padding: 10px 14px; border-bottom: 1px solid var(--border); background: #fafbfc; white-space: nowrap;
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafbfc; }
.muted { color: var(--text-3); }
.nowrap { white-space: nowrap; }
.strong { font-weight: 600; }
.money { font-weight: 600; color: #b45309; }
.empty { text-align: center; padding: 48px 0; color: var(--text-3); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); cursor: pointer; font-size: 13px;
  transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: #d1d5db; background: #f9fafb; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-danger { color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: var(--danger-light); border-color: var(--danger); }
.btn-success { color: var(--success); border-color: #bbf7d0; }
.btn-success:hover { background: var(--success-light); border-color: var(--success); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-ghost { border-color: transparent; color: var(--text-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 表单 ---------- */
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.form-row label .req { color: var(--danger); margin-right: 2px; }
.input, .select, .textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  outline: none; transition: border-color .15s; background: #fff; color: var(--text);
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); }
.textarea { resize: vertical; min-height: 84px; }
.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-hint { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.vp-ctrl { display: flex; gap: 8px; align-items: center; }
.vp-ctrl .input, .vp-ctrl .select { flex: 1; }
.vp-ctrl .btn-sm { flex: none; margin-left: 0; }
.option-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.option-row .input { flex: 1; }
.radio-cell { display: flex; align-items: center; gap: 4px; }

/* ---------- 标签 / 徽章 ---------- */
.tag {
  display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.tag-blue { background: var(--primary-light); color: var(--primary); }
.tag-green { background: var(--success-light); color: var(--success); }
.tag-orange { background: var(--warning-light); color: var(--warning); }
.tag-red { background: var(--danger-light); color: var(--danger); }
.tag-gray { background: #f3f4f6; color: var(--text-2); }

/* ---------- 页签 ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab {
  padding: 9px 16px; border: none; background: none; cursor: pointer; font-size: 14px;
  color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(17, 24, 39, .45);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 24px;
  animation: fadeIn .15s ease;
}
.modal {
  background: var(--card); border-radius: 14px; width: 560px; max-width: 100%;
  max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: 0 20px 50px rgba(16, 24, 40, .25); animation: slideUp .18s ease;
}
.modal.wide { width: 760px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close { border: none; background: none; font-size: 20px; color: var(--text-3); cursor: pointer; padding: 0 4px; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(14px); } }

/* ---------- Toast ---------- */
#toast-root { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); z-index: 200; }
.toast {
  padding: 10px 20px; border-radius: 8px; color: #fff; font-size: 13px; margin-bottom: 8px;
  box-shadow: 0 8px 20px rgba(16, 24, 40, .18); animation: slideDown .2s ease;
}
.toast-success { background: #111827; }
.toast-error { background: var(--danger); }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } }

/* ---------- 审核卡片 ---------- */
.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.review-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.review-card .r-head { display: flex; justify-content: space-between; align-items: flex-start; }
.review-card .r-course { font-weight: 600; }
.review-card .r-meta { font-size: 13px; color: var(--text-2); line-height: 1.8; }
.review-shot {
  width: 100%; height: 180px; border: 1px solid var(--border); border-radius: 8px;
  object-fit: cover; cursor: zoom-in; background: #fafbfc;
}
.review-actions { display: flex; gap: 8px; }
.review-actions .btn { flex: 1; }

/* ---------- 问卷结果条 ---------- */
.vote-bar-row { margin-bottom: 12px; }
.vote-bar-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.vote-bar-track { height: 10px; background: #f3f4f6; border-radius: 999px; overflow: hidden; }
.vote-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), #60a5fa); border-radius: 999px; transition: width .4s; }

/* ---------- 其他 ---------- */
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1000px) { .grid-2col { grid-template-columns: 1fr; } }
.quick-links { display: flex; flex-direction: column; gap: 8px; }
.quick-link {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--border); text-decoration: none; color: var(--text); transition: all .15s;
}
.quick-link:hover { border-color: var(--primary); background: var(--primary-light); }
.q-icon { font-size: 20px; }
.q-name { display: block; font-weight: 600; font-size: 14px; }
.q-sub { display: block; font-size: 12px; color: var(--text-2); margin-top: 2px; }
.q-arrow { margin-left: auto; color: var(--text-3); font-size: 18px; }
.tips-list { padding-left: 18px; line-height: 2.1; color: var(--text-2); font-size: 13px; }
.tips-list b { color: var(--text); }
.qr-preview { width: 220px; height: 220px; border: 1px solid var(--border); border-radius: 10px; object-fit: contain; background: #fff; }
.qr-preview { width: 220px; height: 220px; border: 1px solid var(--border); border-radius: 10px; object-fit: contain; background: #fff; }
.search-input { width: 240px; }
.checkbox-list {
  max-height: 300px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px;
}
.checkbox-list label { display: flex; align-items: center; gap: 8px; padding: 6px 0; cursor: pointer; font-size: 13px; }
.member-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; background: #f3f4f6;
  border-radius: 999px; padding: 3px 6px 3px 10px; font-size: 12px;
}
.chip button { border: none; background: none; color: var(--text-3); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }
.chip button:hover { color: var(--danger); }
.text-right { text-align: right; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; align-items: center; gap: 10px; }
.shot-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); cursor: zoom-in; }

@media (max-width: 900px) {
  .sidebar { width: 64px; }
  .brand-text, .nav-item span:not(.nav-icon), .sidebar-footer { display: none; }
  .main { margin-left: 64px; }
}

/* ===== 用户管理 / 课程目录 / 班级学生管理 补充样式 ===== */
.tag-purple { background: #f3e8ff; color: #7e22ce; }

.catalog-list { display: flex; flex-direction: column; gap: 8px; }
.catalog-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px; border: 1px solid var(--border); border-radius: 8px; background: #fff;
}
.catalog-row .input { flex: 1; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

.select-all-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; margin-bottom: 6px;
  background: var(--primary-light); border-radius: 8px;
  font-size: 13px; font-weight: 600; color: var(--primary);
  cursor: pointer; user-select: none;
}
.checkbox-list.member-box {
  max-height: 240px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px;
}
.checkbox-list label { border-bottom: 1px solid var(--border); }
.checkbox-list label:last-child { border-bottom: none; }
.btn-block { width: 100%; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
input:disabled, select:disabled { background: var(--bg); color: var(--muted); cursor: not-allowed; }

/* 虚拟支付页：内联 code 与按钮 */
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; background: #f3f4f6; color: #374151;
  padding: 2px 6px; border-radius: 4px; word-break: break-all;
}
.form-row .btn-sm { margin-left: 8px; padding: 4px 10px; font-size: 12px; }
