/* ============ 水木篮球学院 · PC 网页总后台 ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --brand: #B41C24; --brand2: #FF6B2C;
  --bg: #F4F6FA; --card: #fff; --line: #E5E9F0;
  --txt: #243044; --txt2: #6B7688; --txt3: #9AA5B5;
  --blue: #2E86DE; --green: #1BAA6E; --orange: #FF9F43; --purple: #8E44AD; --red: #E74C3C;
  --sidebar-w: 232px;
}
html, body { height: 100%; }
body { font: 14px/1.6 "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif; color: var(--txt); background: var(--bg); }
.hidden { display: none !important; }
a { color: var(--blue); text-decoration: none; }

/* ---------- 登录页 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #8E141B 0%, #B41C24 45%, #E8541E 100%); }
.login-card { width: 880px; display: flex; border-radius: 18px; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.login-brand { flex: 1; background: linear-gradient(160deg, rgba(0,0,0,.22), rgba(0,0,0,.42)); color: #fff; padding: 64px 48px; display: flex; flex-direction: column; justify-content: center; }
.login-logo { width: 160px; height: auto; display: block; margin-bottom: 18px; filter: drop-shadow(0 4px 18px rgba(0,0,0,.35)); }
.login-title { font-size: 34px; font-weight: 800; margin-top: 16px; letter-spacing: 2px; }
.login-sub { opacity: .82; margin-top: 10px; font-size: 14px; }
.login-form { width: 360px; background: #fff; padding: 56px 44px; }
.login-form label { display: block; font-size: 13px; color: var(--txt2); margin: 14px 0 6px; }
.login-form input { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; font-size: 14px; outline: none; }
.login-form input:focus { border-color: var(--brand); }
.login-form .btn { margin-top: 26px; height: 44px; font-size: 16px; }
.login-tip { margin-top: 18px; font-size: 12px; color: var(--txt3); line-height: 1.7; }
/* 备案页脚：固定在登录页底部（ICP 备案号 + 公安联网备案号） */
.beian-footer { position: fixed; left: 0; right: 0; bottom: 10px; text-align: center; font-size: 12px; }
.beian-footer a { color: rgba(255,255,255,.72); text-decoration: none; margin: 0 12px; }
.beian-footer a:hover { color: #fff; text-decoration: underline; }

/* ---------- 布局 ---------- */
.app-wrap { display: flex; height: 100vh; }
.sidebar { width: var(--sidebar-w); background: #1D2635; color: #C7D0DE; display: flex; flex-direction: column; flex-shrink: 0; overflow-y: auto; }
.side-brand { padding: 18px 16px 14px; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 10px; }
.side-brand-logo { width: 34px; height: auto; flex: 0 0 34px; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0,0,0,.4)); }
.side-brand .t { font-size: 16px; font-weight: 800; letter-spacing: 1px; line-height: 1.2; }
.side-brand .s { font-size: 11px; opacity: .55; margin-top: 3px; }
.side-group { font-size: 11px; color: #6E7A8C; padding: 16px 18px 6px; letter-spacing: 2px; }
.side-item { display: flex; align-items: center; gap: 10px; padding: 10px 18px; cursor: pointer; font-size: 14px; border-left: 3px solid transparent; }
.side-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-item.active { background: rgba(180,28,36,.28); color: #fff; border-left-color: var(--brand2); }
.side-item .ico { width: 20px; text-align: center; }
.side-foot { margin-top: auto; padding: 14px 18px; font-size: 11px; color: #5E6A7C; border-top: 1px solid rgba(255,255,255,.08); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 58px; background: var(--card); border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 24px; gap: 14px; flex-shrink: 0; }
.topbar .crumb { font-size: 15px; font-weight: 700; }
.topbar .sync { font-size: 12px; color: var(--txt3); margin-left: 8px; }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 13px; color: var(--txt2); }
.role-tag { font-size: 11px; padding: 2px 10px; border-radius: 20px; background: #FDECEC; color: var(--brand); margin-left: 6px; }
.page { flex: 1; overflow-y: auto; padding: 22px 26px 60px; }

/* ---------- 通用组件 ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 16px; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: var(--txt); font-size: 13px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--blue); color: var(--blue); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: #D22730; color: #fff; border-color: #D22730; }
.btn-danger { background: #fff; border-color: #F1B9BB; color: var(--red); }
.btn-danger:hover { background: #FDF0F0; border-color: var(--red); color: var(--red); }
.btn-sm { height: 26px; padding: 0 10px; font-size: 12px; border-radius: 5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; justify-content: center; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin-bottom: 18px; }
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card-title .sub { font-size: 12px; color: var(--txt3); font-weight: 400; margin-left: 8px; }
.card-title .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: 1fr 1fr 1fr; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g5 { grid-template-columns: repeat(5, 1fr); }
.g6 { grid-template-columns: repeat(6, 1fr); }

.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.kpi .v { font-size: 26px; font-weight: 800; }
.kpi .l { font-size: 12px; color: var(--txt2); margin-top: 2px; }
.kpi .d { font-size: 11px; margin-top: 6px; }
.kpi .up { color: var(--green); } .kpi .down { color: var(--red); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; color: var(--txt2); font-weight: 600; padding: 9px 10px; background: #F8FAFC; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover { color: var(--brand); }
.tbl th.sortable .sort-ind { font-size: 10px; margin-left: 3px; opacity: .55; font-weight: 400; }
.tbl th.sortable.sort-on { color: var(--brand); }
.tbl th.sortable.sort-on .sort-ind { opacity: 1; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid #EFF2F7; vertical-align: middle; }
.tbl tr:hover td { background: #FAFBFE; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-wrap { overflow-x: auto; }

.tag { display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 20px; background: #EEF2F8; color: var(--txt2); white-space: nowrap; }
.tag.red { background: #FDECEC; color: var(--brand); }
.tag.blue { background: #E8F1FC; color: var(--blue); }
.tag.green { background: #E6F7F0; color: var(--green); }
.tag.orange { background: #FEF3E6; color: #C77A16; }
.tag.purple { background: #F3EAF9; color: var(--purple); }
.tag.gray { background: #F0F2F5; color: var(--txt3); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select { height: 32px; border: 1px solid var(--line); border-radius: 7px; padding: 0 10px; font-size: 13px; outline: none; background: #fff; }
.toolbar input:focus, .toolbar select:focus { border-color: var(--blue); }
.toolbar .grow { flex: 1; }
/* 工具栏多选下拉（课程筛选） */
.msel { position: relative; display: inline-block; }
.msel-btn { white-space: nowrap; }
.msel-panel { display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; min-width: 210px; max-height: 280px; overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(36,48,68,.14); padding: 6px 0; }
.msel-head { display: flex; gap: 14px; padding: 4px 12px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.msel-head a { color: var(--blue); cursor: pointer; font-size: 12px; text-decoration: none; }
.msel-item { display: flex; align-items: center; gap: 8px; padding: 6px 12px; font-size: 13px; cursor: pointer; white-space: nowrap; color: var(--txt); }
.msel-item:hover { background: var(--bg); }
.msel-item input { width: 15px; height: 15px; accent-color: var(--brand); margin: 0; }
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-top: 12px; font-size: 12px; color: var(--txt2); }

.chart { width: 100%; height: 320px; }
.chart-sm { width: 100%; height: 260px; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(20,28,44,.5); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: #fff; border-radius: 14px; width: 640px; max-width: 94vw; max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { width: 900px; }
.modal-head { display: flex; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--line); font-size: 16px; font-weight: 700; }
.modal-head .x { margin-left: auto; cursor: pointer; color: var(--txt3); font-size: 20px; }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.form-item { margin-bottom: 13px; }
.form-item label { display: block; font-size: 12px; color: var(--txt2); margin-bottom: 5px; }
.form-item input, .form-item select, .form-item textarea { width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 7px; padding: 0 10px; font-size: 13px; outline: none; }
.form-item textarea { height: auto; padding: 8px 10px; line-height: 1.6; }
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { border-color: var(--blue); }
.form-row { display: flex; gap: 12px; }
.form-row .form-item { flex: 1; }

.toast { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); background: #243044; color: #fff; padding: 10px 22px; border-radius: 30px; font-size: 13px; z-index: 200; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.ok { background: var(--green); }
.toast.err { background: var(--red); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab { padding: 9px 18px; cursor: pointer; font-size: 14px; color: var(--txt2); border-bottom: 2px solid transparent; }
.tab:hover { color: var(--txt); }
.tab.active { color: var(--brand); font-weight: 700; border-bottom-color: var(--brand); }

/* 排课周历 */
.week-grid { display: grid; grid-template-columns: 96px repeat(7, 1fr); gap: 6px; }
.wk-head { text-align: center; font-size: 12px; color: var(--txt2); padding: 8px 0; background: #F8FAFC; border-radius: 8px; }
.wk-time { font-size: 12px; color: var(--txt3); display: flex; align-items: center; justify-content: center; }
.wk-cell { min-height: 120px; background: #FAFBFE; border: 1px dashed var(--line); border-radius: 8px; padding: 6px; display: flex; flex-direction: column; gap: 6px; }
.wk-cell.today { background: #FFF8F0; border-color: #FFD3B0; }
.wk-chip { font-size: 12px; border-radius: 7px; padding: 6px 8px; color: #fff; cursor: grab; line-height: 1.45; }
.wk-chip b { display: block; font-size: 12px; }
.wk-chip .m { opacity: .85; font-size: 11px; }
.wk-cell.dragover { border-color: var(--brand); background: #FDF0F0; }

.empty { text-align: center; color: var(--txt3); padding: 40px 0; font-size: 13px; }
.hint { font-size: 12px; color: var(--txt3); line-height: 1.7; }
.danger-zone { margin-top: 16px; padding: 12px 14px; background: #FDF0F0; border: 1px solid #F1B9BB; border-radius: 8px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.danger-zone-t { font-size: 12px; font-weight: 600; color: var(--red); padding-right: 6px; border-right: 1px solid #F1B9BB; }
.danger-zone-hint { font-size: 12px; color: var(--txt3); flex: 1; min-width: 200px; }
.alert-item { display: flex; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: #fff; }
.alert-item .sev { font-size: 11px; padding: 2px 9px; border-radius: 20px; height: fit-content; white-space: nowrap; }
.sev.high { background: #FDECEC; color: var(--red); }
.sev.mid { background: #FEF3E6; color: #C77A16; }
.sev.low { background: #E8F1FC; color: var(--blue); }
.alert-item .btn { margin-left: auto; align-self: center; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #CDD5E0; border-radius: 8px; }
.stu-link { color: var(--brand); text-decoration: none; border-bottom: 1px dashed transparent; }
.stu-link:hover { border-bottom-color: var(--brand); }
.stu-link::before { content: '👤 '; font-size: 12px; }

/* ============ 现场考勤消课面板 ============ */
.tag.navy { background: #E9EEF8; color: #344967; }
.chk-res-item { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; cursor: pointer; background: var(--bg); }
.chk-res-item:hover { border-color: var(--brand); background: #FDF6F6; }
.chk-card { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; cursor: pointer; background: #fff; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chk-card:hover { border-color: var(--brand); }
.chk-card.off { opacity: .55; cursor: not-allowed; background: var(--bg); }
.chk-card .hint { flex-basis: 100%; }

/* ============ 周课表色块点击菜单 ============ */
.chip-menu { position: fixed; z-index: 3000; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(15, 23, 42, .16); padding: 8px; display: flex; flex-direction: column; gap: 6px; width: 170px; }
.chip-menu-t { font-size: 12px; color: var(--txt2); padding: 2px 6px 6px; border-bottom: 1px solid var(--line); margin-bottom: 2px; word-break: break-all; }
.chip-menu .btn { justify-content: center; }

/* 校区图片管理 */
.cp-thumb { width: 56px; height: 40px; object-fit: cover; border-radius: 4px; cursor: pointer; vertical-align: middle; }
.cp-imgs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cp-imgs .hint { align-self: center; }
.cp-img-cell { position: relative; }
.cp-img-cell img { width: 84px; height: 62px; object-fit: cover; border-radius: 6px; border: 1px solid #E3E7EF; display: block; }
.cp-img-del { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; line-height: 16px; text-align: center; background: #B41C24; color: #fff; border-radius: 50%; font-size: 11px; cursor: pointer; }

/* 考勤记录 · 按课节汇总展开明细 */
.att-exp > td { padding: 0; background: #F7F8FB; }
.tbl-inner { margin: 10px 12px; width: calc(100% - 24px); }
