/* 维实课堂 管理后台样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --sidebar-bg: #1e2530;
  --sidebar-active: #2d8cf0;
  --accent: #2d8cf0;
  --accent-dark: #1f6fc4;
  --text: #1f2d3d;
  --muted: #8492a6;
  --border: #e4e8ee;
  --bg: #f4f6f9;
  --danger: #e34d59;
  --ok: #18a058;
  --warn: #e6a23c;
}
html, body { height: 100%; }
body {
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px; color: var(--text); background: var(--bg);
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ---------- 登录 ---------- */
.login-wrap {
  height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e2530 0%, #2d3b52 100%);
}
.login-card {
  width: 360px; background: #fff; border-radius: 10px; padding: 34px 32px;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.login-brand { margin-bottom: 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.login-brand .brand-logo { width: 200px; height: auto; border-radius: 12px; }
.login-brand .brand-text { font-size: 14px; font-weight: 400; color: var(--muted); }
.login-card label { display: block; margin-bottom: 16px; }
.login-card label span { display: block; color: var(--muted); margin-bottom: 6px; font-size: 13px; }
.login-err { color: var(--danger); min-height: 18px; margin-top: 12px; font-size: 13px; text-align: center; }

/* ---------- 布局 ---------- */
.layout { display: flex; height: 100vh; }
.sidebar {
  width: 208px; background: var(--sidebar-bg); color: #c8d0dc; flex-shrink: 0;
  display: flex; flex-direction: column; overflow-y: auto;
}
.brand { padding: 18px 16px 14px; border-bottom: 1px solid rgba(255,255,255,.08); text-align: center; }
.brand .brand-logo { width: 128px; height: auto; border-radius: 8px; background: #fff; }
.nav { padding: 10px 0; flex: 1; }
.nav-item {
  display: flex; align-items: center; padding: 11px 20px; color: #c8d0dc;
  font-size: 14px; border-left: 3px solid transparent; cursor: pointer;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: rgba(45,140,240,.18); border-left-color: var(--sidebar-active); color: #fff; }
.nav-icon { width: 26px; text-align: center; margin-right: 8px; }
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  height: 58px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px; flex-shrink: 0;
}
.page-title { font-size: 17px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.user-name { font-weight: 600; }
.user-role { color: var(--accent); background: rgba(45,140,240,.1); padding: 2px 10px; border-radius: 12px; font-size: 12px; }
.content { flex: 1; overflow-y: auto; padding: 24px; }
.page-loading, .error-box { color: var(--muted); padding: 40px; text-align: center; }

/* ---------- 通用 ---------- */
.btn {
  display: inline-block; border: 1px solid var(--border); background: #fff; color: var(--text);
  padding: 7px 14px; border-radius: 6px; font-size: 14px; text-align: center;
}
.btn:hover { background: #f7f9fc; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.94); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: #f0f2f5; }
.btn-sm { padding: 4px 10px; font-size: 13px; border-radius: 5px; }
.btn-block { width: 100%; padding: 10px; font-size: 15px; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.input, select.input, textarea.input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
  outline: none; transition: border-color .15s; background: #fff;
}
.input:focus { border-color: var(--accent); }
textarea.input { resize: vertical; min-height: 74px; line-height: 1.5; }
label .input { margin-top: 6px; }
label { display: block; margin-bottom: 14px; color: var(--text); }

/* 面板 / 卡片 */
.panel { background: #fff; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 20px; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 600;
}
.panel-head .toolbar { display: flex; gap: 10px; align-items: center; font-weight: 400; }
.panel-body { padding: 16px 18px; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 18px; }
.stat-card .num { font-size: 30px; font-weight: 700; color: var(--accent); margin: 6px 0 2px; }
.stat-card .lab { color: var(--muted); font-size: 13px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.tbl th { background: #f8f9fc; color: var(--muted); font-weight: 600; font-size: 13px; }
.tbl tr:hover td { background: #fafbfd; }
.tbl .actions { display: flex; gap: 6px; flex-wrap: wrap; }

.pagination { display: flex; align-items: center; gap: 10px; padding: 14px 4px 4px; color: var(--muted); font-size: 13px; }
.pagination button { min-width: 30px; }

/* 徽章 */
.badge { display: inline-block; padding: 2px 9px; border-radius: 12px; font-size: 12px; }
.badge-green { background: #e3f7ec; color: #18a058; }
.badge-red { background: #fde8e9; color: #e34d59; }
.badge-blue { background: #e6f1fd; color: #2d8cf0; }
.badge-gray { background: #eef0f4; color: #6b7686; }
.badge-orange { background: #fdf0e2; color: #e6a23c; }

/* 模态框 */
.modal-mask {
  display: none; position: fixed; inset: 0; background: rgba(15,23,42,.45);
  align-items: flex-start; justify-content: center; padding: 60px 16px; z-index: 100; overflow-y: auto;
}
.modal { background: #fff; border-radius: 10px; width: 480px; max-width: 100%; box-shadow: 0 18px 50px rgba(0,0,0,.25); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 16px; }
.modal-x { border: none; background: none; font-size: 22px; color: var(--muted); line-height: 1; }
.modal-body { padding: 18px 20px; max-height: 65vh; overflow-y: auto; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--border); text-align: right; display: flex; gap: 10px; justify-content: flex-end; }

/* 提示 */
#toast-box { position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #fff; border-left: 4px solid var(--ok); padding: 11px 16px; border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.12); opacity: 0; transform: translateX(20px); transition: all .25s; }
.toast.show { opacity: 1; transform: translateX(0); }
.toast.err { border-left-color: var(--danger); }

/* 工具类 */
.flex { display: flex; gap: 10px; align-items: center; }
.between { justify-content: space-between; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.muted { color: var(--muted); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.section-title { font-weight: 600; margin: 18px 0 10px; }
.empty { text-align: center; color: var(--muted); padding: 34px 0; }

/* 签到状态颜色 */
.st-present { color: var(--ok); }
.st-absent { color: var(--danger); }
.st-leave { color: var(--warn); }

/* 列表（转介绍等） */
ul.simple-list { list-style: none; }
.simple-list li { padding: 9px 0; border-bottom: 1px dashed var(--border); }

/* 课次选择列表（签到） */
.sess-list { display: flex; flex-direction: column; gap: 8px; }
.sess-item {
  display: flex; gap: 16px; align-items: center; border: 1px solid var(--border);
  border-radius: 6px; padding: 10px 14px; background: #fff; text-align: left; font-size: 14px;
}
.sess-item:hover { border-color: var(--accent); }
.sess-item.sel { border-color: var(--accent); background: #f0f7ff; }
.sess-item .small { font-size: 12px; }
