/* ============ 陈老师的工作台 全局样式 ============ */
:root {
  --bg: #f0f6ff; --card: #fff; --ink: #0f172a; --muted: #64748b;
  --line: #dbe7f7; --brand: #2563eb; --brand2: #1d4ed8;
  --ok: #16a34a; --warn: #d97706; --bad: #dc2626;
  --radius: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px; }
h1 { font-size: 22px; margin: 14px 0; } h2 { font-size: 17px; margin: 4px 0 12px; }
h3 { font-size: 16px; margin: 6px 0; }
a { color: var(--brand); text-decoration: none; }
code { background: #eef2ff; padding: 1px 6px; border-radius: 6px; }
hr { border: none; border-top: 1px solid var(--line); margin: 16px 0; }

.container { max-width: 1120px; margin: 0 auto; padding: 18px; }
.mcontainer { max-width: 560px; margin: 0 auto; padding: 14px; }
.foot { text-align: center; color: #94a3b8; font-size: 12px; padding: 26px 0 30px; }

/* ---- 顶栏 ---- */
.topbar { display: flex; align-items: center; gap: 18px; padding: 10px 20px;
  background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 800; font-size: 17px; color: var(--ink); }
.navlinks { flex: 1; display: flex; gap: 14px; }
.who { color: var(--muted); margin-right: 8px; }

/* ---- 卡片与布局 ---- */
.card { background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; margin-bottom: 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04),
              0 6px 18px rgba(15, 23, 42, .04); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid2 > .card { margin-bottom: 0; } .grid2 { margin-bottom: 18px; }
.cards3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px; margin-bottom: 20px; }
.pagehead { display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; }
.crumb { color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 40px; }

/* ---- 表格 ---- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line);
  vertical-align: middle; }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }
tr:hover td { background: #f8fafc; }
.mtable td, .mtable th { padding: 10px 8px; }

/* ---- 表单 ---- */
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
input, select, textarea { width: 100%; padding: 9px 11px; margin-top: 4px;
  border: 1px solid #cbd5e1; border-radius: 9px; font-size: 14px;
  font-family: inherit; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid #bfdbfe; border-color: var(--brand); }
textarea { resize: vertical; }
.formrow { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.formrow input, .formrow select, .formrow button { margin-top: 0; }
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px 18px; align-items: end; }
.formgrid .clsbox { grid-column: 1 / -1; }
fieldset.clsbox { border: 1px dashed var(--line); border-radius: 10px;
  padding: 10px; display: flex; gap: 14px; flex-wrap: wrap; }
fieldset.clsbox legend { font-size: 12px; color: var(--muted); padding: 0 6px; }
.chk { display: inline-flex; align-items: center; gap: 5px; color: var(--ink);
  font-size: 14px; margin: 0; }
.chk input { width: auto; margin: 0; }
.inlineform { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
.inlineform input, .inlineform select { width: auto; margin: 0; }
.importbox input[type=file] { margin: 8px 0; }
details summary { cursor: pointer; color: var(--brand); padding: 6px 0; user-select: none; }
.smalltip { font-size: 13px; }

/* ---- 按钮 ---- */
.btn { display: inline-block; padding: 8px 15px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: 14px; cursor: pointer; transition: .15s; }
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand2); color: #fff; }
.btn.accent { background: #7c3aed; border-color: #7c3aed; color: #fff; }
.btn.accent:hover { background: #6d28d9; color: #fff; }
.btn.danger { background: #fef2f2; border-color: #fecaca; color: var(--bad); }
.btn.danger:hover { background: var(--bad); color: #fff; }
.btn.soft { background: #e9f0fc; border-color: #cddcf7; color: #2b5cc4;
  font-weight: 600; }
.btn.soft:hover { background: #dbe7fb; border-color: #b4cbf2; color: var(--brand2); }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 11px; font-size: 13px; }
.btn.tiny { padding: 3px 9px; font-size: 12px; }
.btn.big { padding: 11px 22px; font-size: 16px; }
.huge { width: 100%; font-size: 20px; padding: 16px; margin-top: 10px; }
button:disabled { opacity: .55; cursor: wait; }

/* ---- 徽标/状态 ---- */
.pill { display: inline-block; padding: 3px 11px; border-radius: 999px;
  font-size: 13px; font-weight: 600; margin-right: 4px; }
.pill.big { font-size: 16px; padding: 7px 20px; }
.pill.ok, .at-present { background: #dcfce7; color: var(--ok); }
.pill.warn, .at-late { background: #fef3c7; color: var(--warn); }
.pill.bad, .at-absent { background: #fee2e2; color: var(--bad); }
.pill.gray, .at-leave { background: #e2e8f0; color: #475569; }
.pill.blue { background: #dbeafe; color: var(--brand); }
.st-planned { background: #e2e8f0; color: #475569; }
.st-live { background: #dcfce7; color: var(--ok); animation: pulse 2s infinite; }
.st-finished { background: #fef3c7; color: var(--warn); }
.st-ended { background: #fee2e2; color: var(--bad); }
@keyframes pulse { 50% { opacity: .65; } }
.muted { color: var(--muted); }
.flash { padding: 11px 16px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; }
.flash.ok { background: #dcfce7; color: #166534; }
.flash.error { background: #fee2e2; color: #991b1b; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 42px;
  background: #0f172a; color: #fff; padding: 11px 22px; border-radius: 999px;
  font-size: 14px; z-index: 99; box-shadow: 0 8px 24px rgba(0,0,0,.25); }

/* ---- 登录页 ---- */
.authpage { display: flex; min-height: 92vh; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #eaf3ff, #f5f9ff 55%, #fdfcff); }
.login-card { max-width: 400px; width: 92%; text-align: center; padding: 34px 30px; }
.login-card h1 { margin: 0; } .login-card .sub { color: var(--muted); margin-top: 4px; }
.login-card form { text-align: left; margin-top: 18px; }
.login-card .btn { width: 100%; margin-top: 6px; }
.hint { margin-top: 18px; text-align: left; font-size: 13px; color: var(--muted); }
.hint ul { padding-left: 18px; margin: 8px 0; }
.icp-footer { position: fixed; bottom: 6px; left: 0; width: 100%;
  text-align: center; color: var(--muted); font-size: 12px;
  pointer-events: none; z-index: 5; }

/* ---- 教师课程卡片 ---- */
.coursecard { color: var(--ink); transition: .15s; }
.coursecard:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(37,99,235,.12); }
.statrow { display: flex; gap: 16px; margin: 10px 0 4px; color: var(--muted); font-size: 13px; }
.statrow b { color: var(--ink); font-size: 16px; }
.nextline { font-size: 13px; color: var(--brand); margin: 6px 0 0; }
.newcourse summary { font-weight: 600; }

/* ---- 点名舞台 ---- */
.rcresult { border: 2px solid #bbf7d0; background: #f0fdf4; border-radius: 12px;
  padding: 16px; text-align: center; margin-bottom: 12px; }
.rcresult .formrow { justify-content: center; margin-top: 10px; }
.recentbox { margin-top: 14px; font-size: 13px; }
.recentbox ul { margin: 6px 0; padding-left: 18px; color: var(--muted); }
.setcell { white-space: nowrap; }
.setcell select { width: 110px; display: inline-block; margin-right: 6px; padding: 5px 7px; }

/* ---- 学生移动端 ---- */
.mcards { display: grid; gap: 14px; }
.mcard { padding: 18px; }
.coursemini h3 { margin-bottom: 2px; }
.ratewrap { display: flex; align-items: center; gap: 14px; margin: 12px 0; }
.rateball { width: 64px; height: 64px; border-radius: 50%; background: #dbeafe;
  color: var(--brand); display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.backlink { display: inline-block; margin: 4px 0 8px; color: var(--muted); }
.signin-card { text-align: center; padding: 34px 22px; }
.sigicon { font-size: 52px; margin: 0; }
.sigicon.ok { filter: hue-rotate(0); }
.alreadybox { margin-top: 16px; display: grid; gap: 10px; justify-items: center; }
.errbox { background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
  border-radius: 10px; padding: 16px; margin-top: 14px; }

/* ---- P1：数字码 / 白板 / 报表 / 点名管理 ---- */
.bigcode { font-family: Consolas, "Courier New", monospace; font-size: 42px;
  font-weight: 800; letter-spacing: 6px; color: var(--ink); background: #f8fafc;
  border: 2px dashed #cbd5e1; border-radius: 12px; text-align: center;
  padding: 10px 6px; margin: 8px 0; user-select: all; }
.wb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px; margin-top: 12px; }
.wb-tile { padding: 20px 8px 14px; font-size: 19px; font-weight: 700;
  border-radius: 14px; border: 2px solid var(--line); background: #fff;
  color: var(--ink); cursor: pointer; display: flex; flex-direction: column;
  align-items: center; transition: .15s; font-family: inherit; }
.wb-tile:hover:not(:disabled) { border-color: var(--brand); color: var(--brand);
  transform: translateY(-2px); }
.wb-tile.done { background: #f0fdf4; border-color: #bbf7d0; color: var(--ok);
  cursor: default; }
.wb-tile small { font-weight: 600; font-size: 13px; min-height: 18px; }
.wb-confirm { position: fixed; left: 50%; bottom: 15%; transform: translateX(-50%);
  width: min(380px, 92vw); text-align: center; z-index: 50;
  box-shadow: 0 16px 48px rgba(0,0,0,.25); }
.wc-status { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.wc-status .btn.big { margin-top: 0; }
/* 白板状态色：与考勤口径一致（绿=到/橙=迟到/红=旷课/蓝=请假） */
.st-att-present { background: #f0fdf4; border-color: #bbf7d0; color: var(--ok); }
.st-att-present:hover { background: var(--ok); border-color: var(--ok); color: #fff; }
.st-att-late { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.st-att-late:hover { background: #b45309; border-color: #b45309; color: #fff; }
.st-att-absent { background: #fef2f2; border-color: #fecaca; color: var(--bad); }
.st-att-absent:hover { background: var(--bad); border-color: var(--bad); color: #fff; }
.st-att-leave { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.st-att-leave:hover { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.chart { width: 100%; height: auto; max-height: 200px; }
.rcmgr input, .rcmgr select { width: auto; padding: 5px 8px; font-size: 13px; }
.rcmgr .rc-note { width: 220px; }
.big-input { font-size: 30px !important; text-align: center;
  letter-spacing: 12px; }
.smalllink { font-size: 13px; font-weight: 400; margin-left: 10px; }

/* ---- P2：画像 / 预警 / 成绩 / 审计 ---- */
.namelink { color: var(--ink); font-weight: 600; border-bottom: 1px dashed #cbd5e1; }
.namelink:hover { color: var(--brand); }
.profile-head { display: flex; gap: 18px; align-items: center; }
.avatar { width: 64px; height: 64px; border-radius: 50%; background: #dbeafe;
  color: var(--brand); font-size: 28px; font-weight: 800; flex: none;
  display: inline-flex; align-items: center; justify-content: center; }
.dotstrip { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.dot { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.d-present { background: #22c55e; } .d-late { background: #f59e0b; }
.d-absent { background: #ef4444; } .d-leave { background: #94a3b8; }
.d-none { background: #e2e8f0; }
.bad-text { color: var(--bad); }

/* ---- 弹窗（新建课程等） ---- */
.modal-overlay { position: fixed; inset: 0; z-index: 60;
  background: rgba(255, 255, 255, .6); backdrop-filter: blur(7px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; }
.hidden { display: none !important; }
.modal-overlay.hidden { display: none; }
.modal-card { width: min(720px, 96vw); max-height: 88vh; overflow-y: auto;
  margin: 0; border-radius: 18px; padding: 22px 24px 24px;
  border: 1px solid var(--line);
  box-shadow: 0 32px 80px rgba(2, 8, 23, .16), 0 4px 16px rgba(2, 8, 23, .08);
  animation: rise .26s cubic-bezier(.21, .8, .32, 1.1); }
.modal-card.accent { overflow: hidden; }
.modal-card.accent::before { content: ''; display: block; height: 4px;
  margin: -22px -24px 20px;
  background: linear-gradient(90deg, #2563eb, #7c3aed 55%, #ec4899); }
.modal-head { display: flex; justify-content: space-between;
  align-items: center; gap: 12px; margin: 0 0 18px; }
.modal-head h2 { letter-spacing: .5px; }
.modal-head .btn.ghost.small { font-size: 13px; padding: 4px 10px; }
@keyframes rise { from { transform: translateY(18px) scale(.97); opacity: 0; } }

/* ---- P3：系统管理分页 + 统一弹窗组件 ---- */
.ui-mini { width: min(400px, 94vw); }
.ui-mini2 { width: min(540px, 94vw); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 16px; }
.modulecard { text-align: center; color: var(--ink); transition: .15s; }
.modulecard:hover { transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(37, 99, 235, .12); border-color: #c7d7f5; }
.mcicon { font-size: 40px; margin: 6px 0 2px; }
.modulecard h3 { margin: 2px 0 6px; }
.modulecard .muted { font-size: 13px; }

/* ---- 状态对话框（确认 / 输入 / 提示）---- */
.ui-dlg { text-align: center; padding: 6px 4px 2px; }
.ui-btns { display: flex; gap: 12px; margin-top: 24px; }

/* ---- 弹窗内部留白 ---- */
.modal-card > form, .modal-card > .importbox { padding-top: 8px; }
.formgrid .clsbox { margin: 4px 0 2px; padding: 14px; }
.modal-card .btn.big, .modal-card button.big { margin-top: 14px; }
.importbox input[type=file] { margin: 4px 0 12px; }
.importbox textarea { margin-bottom: 16px; }
.importbox .modal-actions { margin-top: 2px; }
.ui-icon { width: 66px; height: 66px; border-radius: 50%; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 800; color: #fff;
  box-shadow: 0 10px 22px rgba(15, 23, 42, .18); }
.ui-icon.ok { background: linear-gradient(135deg, #34d399, #059669);
  box-shadow: 0 10px 22px rgba(5, 150, 105, .35); }
.ui-icon.warn { background: linear-gradient(135deg, #fbbf24, #d97706);
  box-shadow: 0 10px 22px rgba(217, 119, 6, .32); }
.ui-icon.danger { background: linear-gradient(135deg, #f87171, #dc2626);
  box-shadow: 0 10px 22px rgba(220, 38, 38, .32); }
.ui-icon.info { background: linear-gradient(135deg, #60a5fa, #2563eb);
  box-shadow: 0 10px 22px rgba(37, 99, 235, .32); }
.ui-icon.question { background: linear-gradient(135deg, #a78bfa, #7c3aed);
  box-shadow: 0 10px 22px rgba(124, 58, 237, .3); }
.ui-title { font-size: 19px; margin: 0 0 6px; letter-spacing: .5px; }
.ui-msg { color: var(--muted); margin: 0 0 18px; line-height: 1.65;
  font-size: 14.5px; white-space: pre-line; }
.ui-label { text-align: left; font-size: 13.5px; color: var(--muted);
  margin-top: 2px; }
.ui-err { color: var(--bad); font-size: 13px; margin: 6px 0 0;
  text-align: left; }
.ui-btns .btn { flex: 1; padding: 11px 0; font-size: 15px;
  border-radius: 11px; }
.hidden.shake, input.shake { animation: shake .36s; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); } }

/* ---- 响应式 ---- */
@media (max-width: 860px) {
  .grid2 { grid-template-columns: 1fr; }
  table { font-size: 13px; }
}
