/* 消课管家 样式 */
:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-bg: #eef2ff;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --ok: #059669;
  --ok-bg: #d1fae5;
  --warn: #d97706;
  --warn-bg: #fef3c7;
  --gray: #6b7280;
  --text: #1f2937;
  --border: #e5e7eb;
  --bg: #f3f4f6;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6;
}

/* ---------- 布局 ---------- */
#app { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; flex-shrink: 0; background: linear-gradient(180deg, #1e1b4b 0%, #312e81 100%);
  color: #c7d2fe; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 10px; background: var(--primary);
  color: #fff; font-size: 20px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.brand-name { color: #fff; font-size: 17px; font-weight: 700; }
.brand-sub { font-size: 11px; opacity: .7; }
#nav { flex: 1; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
#nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 8px;
  color: #c7d2fe; text-decoration: none; font-size: 14px; transition: background .15s;
}
#nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
#nav a.active { background: var(--primary); color: #fff; font-weight: 600; }
#nav .ico { font-size: 16px; width: 20px; text-align: center; }
.sidebar-foot { padding: 14px 18px; font-size: 11px; opacity: .7; line-height: 1.5; }

#main {
  flex: 1; padding: clamp(14px, 1.6vw, 26px) clamp(14px, 1.8vw, 28px);
  min-width: 0;
}

/* ---------- 页面骨架 ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(18px, 2vw, 23px); font-weight: 700; }
.loading, .empty-state { padding: 48px 20px; text-align: center; color: var(--gray); }
.card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: clamp(14px, 1.8vw, 20px) clamp(14px, 2vw, 22px); margin-bottom: 16px;
  border: 1px solid #fff; overflow-x: auto;
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.card-head h2 { font-size: 16px; font-weight: 700; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2 > .card { min-width: 0; overflow-x: auto; }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } }

.stat-card .stat-label { color: var(--gray); font-size: 13px; }
.stat-card .stat-value { font-size: clamp(24px, 2.6vw, 32px); font-weight: 800; margin: 4px 0; color: var(--text); }
.stat-card .stat-unit { font-size: 13px; font-weight: 400; color: var(--gray); margin-left: 4px; }
.stat-card .stat-sub { font-size: 12px; }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .input { max-width: 100%; }
.muted { color: var(--gray); }
.small { font-size: 12px; }
.row-muted td { color: var(--gray); text-decoration: line-through; }
.row-danger td { background: #fff5f5; }

/* ---------- 表单控件 ---------- */
.input {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px;
  background: #fff; color: var(--text); outline: none; font-family: inherit; transition: border .15s, box-shadow .15s;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
textarea.input { resize: vertical; }
select.input { cursor: pointer; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border); background: #fff;
  color: var(--text); font-size: 14px; cursor: pointer; text-decoration: none; font-family: inherit;
  transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: #c7cdd8; 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 { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.92); }
.btn-danger-ghost { color: var(--danger); border-color: #fca5a5; background: #fff; }
.btn-danger-ghost:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 6px; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12px; color: var(--gray); font-weight: 600;
  padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 10px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; overflow-wrap: break-word; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fafafa; }
.empty-cell { text-align: center; color: var(--gray); padding: 32px !important; }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge.g { background: var(--ok-bg); color: var(--ok); }
.badge.r { background: var(--danger-bg); color: var(--danger); }
.badge.o { background: var(--warn-bg); color: var(--warn); }
.badge.b { background: var(--primary-bg); color: var(--primary); }
.badge.gray { background: #f3f4f6; color: var(--gray); }

/* ---------- 弹窗 ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(17,24,39,.45); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto;
}
.modal {
  background: #fff; border-radius: 14px; width: 480px; max-width: 100%;
  box-shadow: 0 20px 50px rgba(0,0,0,.25); animation: pop .18s ease;
}
.modal-wide { width: 680px; }
@keyframes pop { from { transform: translateY(12px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 16px; }
.modal-x { border: none; background: none; font-size: 22px; color: var(--gray); cursor: pointer; line-height: 1; padding: 4px; }
.modal-x:hover { color: var(--text); }
.modal-body { padding: 18px 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.form { display: flex; flex-direction: column; gap: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.form-row label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-row .input { width: 100%; }
.form-row .muted.small { margin-top: 4px; }

.check-list {
  border: 1px solid var(--border); border-radius: 8px; max-height: 240px; overflow-y: auto; margin-top: 6px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 8px; background: #fafafa;
}
.check-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.check-item:hover { background: #eef2ff; }
.check-item input { accent-color: var(--primary); width: 16px; height: 16px; }
.check-name { flex: 1; }

/* ---------- 课时日历(月历) ---------- */
.cal-scroll { overflow-x: auto; }
.cal-grid {
  display: grid; grid-template-columns: repeat(7, minmax(118px, 1fr));
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  background: var(--border); gap: 1px; min-width: 840px;
}
.cal-dow {
  background: #f8f9fc; padding: 8px 10px; text-align: center;
  font-size: 12px; font-weight: 600; color: var(--gray);
}
.cal-cell { background: #fff; min-height: 104px; padding: 6px; cursor: pointer; transition: background .12s; }
.cal-cell:hover { background: #f6f7ff; }
.cal-cell.we { background: #fbfbfd; }
.cal-cell.we:hover { background: #f4f4fb; }
.cal-cell.blank { background: #fafafa; cursor: default; }
.cal-cell.blank:hover { background: #fafafa; }
.cal-cell.sel { box-shadow: inset 0 0 0 2px var(--primary); border-radius: 2px; }
.cal-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 3px; }
.cal-date {
  width: 24px; height: 24px; border-radius: 999px; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: var(--text);
}
.cal-cell.today .cal-date { background: var(--primary); color: #fff; }
.cal-count { font-size: 10px; color: var(--primary); background: var(--primary-bg); border-radius: 999px; padding: 1px 7px; font-weight: 600; }
.cal-chip {
  display: block; width: 100%; text-align: left; font-size: 11px; line-height: 1.4;
  padding: 2px 7px; border-radius: 5px; margin-top: 3px; border: none; cursor: pointer; font-family: inherit;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500;
}
.cal-chip.sched { background: var(--primary-bg); color: #4338ca; }
.cal-chip.sched:hover { background: #e0e7ff; }
.cal-chip.done { background: #d1fae5; color: #047857; }
.cal-chip.done:hover { background: #a7f3d0; }
.cal-more { font-size: 10.5px; color: var(--gray); margin-top: 3px; padding-left: 7px; }
.cal-summary {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 12px 4px 2px; border-top: 1px solid #f3f4f6; margin-top: 10px;
}
.cal-summary b { color: var(--text); }
.cal-legend { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; }
.cal-legend + .cal-legend { margin-left: 0; }
.lc { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.lc.sched { background: var(--primary-bg); border: 1px solid #c7d2fe; }
.lc.done { background: #d1fae5; border: 1px solid #a7f3d0; }

/* ---------- 点名 ---------- */
.att-list { display: flex; flex-direction: column; gap: 8px; }
.att-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: #fafafa;
}
.att-btns { display: flex; gap: 6px; }
.seg {
  padding: 6px 14px; border-radius: 8px; border: 1px solid var(--border); background: #fff;
  cursor: pointer; font-size: 13px; font-family: inherit; color: var(--gray); transition: all .12s;
}
.seg:hover { border-color: var(--primary); color: var(--primary); }
.seg.on.present { background: var(--ok); border-color: var(--ok); color: #fff; }
.seg.on.absent { background: var(--danger); border-color: var(--danger); color: #fff; }
.seg.on.leave { background: var(--warn); border-color: var(--warn); color: #fff; }
.seg-group { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg-group .seg { border: none; border-radius: 0; }
.seg-group .seg.on { background: var(--primary); color: #fff; }
.att-summary { text-align: center; color: var(--primary); font-weight: 600; margin-top: 12px; }

/* ---------- 课次卡片 ---------- */
.date-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.lesson-list { display: flex; flex-direction: column; gap: 10px; }
.lesson-list.wide .card { margin-bottom: 0; }
.lesson-card.done { border: 1px solid #d1fae5; }
.lesson-card-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.lesson-card-actions { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.lesson-time { font-size: 20px; font-weight: 800; color: var(--primary); white-space: nowrap; }
.lesson-time small { font-size: 12px; color: var(--gray); font-weight: 400; }
.lesson-time.big { font-size: 24px; }
.lesson-info { flex: 1; min-width: 180px; }
.lesson-title { font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lesson-row { display: flex; align-items: center; gap: 14px; padding: 10px 4px; border-bottom: 1px solid #f3f4f6; }
.lesson-row:last-child { border-bottom: none; }
.stu-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip {
  background: #f3f4f6; border-radius: 999px; padding: 4px 12px; font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px;
}

/* ---------- 收支概览 ---------- */
.stat-value.profit-pos { color: var(--ok); }
.stat-value.profit-neg { color: var(--danger); }
.finance-strip { display: flex; align-items: center; justify-content: center; gap: clamp(14px, 3vw, 36px); flex-wrap: wrap; padding: 10px 0 4px; }
.fin-item { text-align: center; }
.fin-item span { display: block; font-size: 12px; color: var(--gray); margin-bottom: 4px; }
.fin-item b { font-size: clamp(18px, 2vw, 24px); }
.fin-item b.pos { color: var(--ok); }
.fin-item b.neg { color: var(--danger); }
.fin-op { font-size: 20px; color: var(--gray); font-weight: 300; }
.pos { color: var(--ok); }
.neg { color: var(--danger); }

/* ---------- 分页条 ---------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 16px 0 4px; }
.pager .btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- 学员详情 ---------- */
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 8px; }
.detail-item label { display: block; font-size: 12px; color: var(--gray); margin-bottom: 2px; }
.detail-item.span2 { grid-column: span 3; }
.big { font-size: 22px; color: var(--primary); }
.section-title { margin: 20px 0 10px; font-size: 14px; }

/* ---------- 柱状图 ---------- */
.barchart { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding: 4px 0; }
.barchart-item { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; min-width: 0; }
.barchart-bar {
  background: linear-gradient(180deg, #818cf8, var(--primary)); border-radius: 3px 3px 0 0;
  min-height: 2px; transition: height .3s;
}
.barchart-item:hover .barchart-bar { background: var(--primary-dark); }
.barchart-label { font-size: 9px; color: var(--gray); text-align: center; margin-top: 4px; overflow: hidden; white-space: nowrap; }

/* ---------- Toast ---------- */
#toast-root { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #1f2937; color: #fff; padding: 10px 22px; border-radius: 10px; font-size: 14px;
  opacity: 0; transform: translateY(-8px); transition: all .25s; box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.toast.show { opacity: 1; transform: none; }
.toast.err { background: var(--danger); }

/* ---------- 登录页(品牌分屏) ---------- */
body.is-auth #app { display: block; }
body.is-auth .sidebar { display: none; }
body.is-auth #main { padding: 0; max-width: none; }
.login-shell { display: flex; min-height: 100vh; }

.login-brand {
  position: relative; width: 55%; min-width: 460px; overflow: hidden;
  display: flex; flex-direction: column; color: #e0e7ff;
  background: linear-gradient(158deg, #1e1b4b 0%, #28246e 55%, #3730a3 100%);
}
.lb-pattern {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 36px 36px;
  -webkit-mask-image: radial-gradient(80% 90% at 70% 10%, #000 30%, transparent 100%);
  mask-image: radial-gradient(80% 90% at 70% 10%, #000 30%, transparent 100%);
}
.lb-glow {
  position: absolute; width: 560px; height: 560px; right: -140px; top: -160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,.32) 0%, transparent 65%); pointer-events: none;
}
.lb-watermark {
  position: absolute; left: -60px; bottom: -130px; font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 460px; line-height: 1; font-weight: 700; color: rgba(255,255,255,.045);
  pointer-events: none; user-select: none;
}
.lb-content { position: relative; z-index: 1; display: flex; flex-direction: column; height: 100%;
  padding: 52px 60px; justify-content: space-between; }
.lb-logo { display: flex; align-items: center; gap: 14px; animation: fadeUp .7s .05s ease both; }
.lb-name { color: #fff; font-size: 19px; font-weight: 700; letter-spacing: .02em; }
.lb-sub { font-size: 12px; opacity: .62; margin-top: 2px; }
.lb-hero { margin: auto 0; padding: 48px 0; }
.lb-hero h1 { font-size: 40px; line-height: 1.32; color: #fff; font-weight: 700; letter-spacing: .01em;
  text-wrap: balance; animation: fadeUp .7s .15s ease both; }
.lb-hero h1 em { font-style: normal; color: #a5b4fc; }
.lb-hero p { margin-top: 18px; font-size: 15px; line-height: 1.9; opacity: .72; max-width: 30em; animation: fadeUp .7s .25s ease both; }
.lb-features { list-style: none; display: flex; flex-direction: column; gap: 18px; }
.lb-features li { display: flex; gap: 14px; align-items: flex-start; animation: fadeUp .7s ease both; }
.lb-features li:nth-child(1) { animation-delay: .35s; }
.lb-features li:nth-child(2) { animation-delay: .45s; }
.lb-features li:nth-child(3) { animation-delay: .55s; }
.lbf-icon {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 10px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center; color: #a5b4fc;
}
.lbf-icon svg { width: 19px; height: 19px; }
.lb-features b { display: block; color: #fff; font-size: 14.5px; font-weight: 600; }
.lb-features span { display: block; font-size: 12.5px; opacity: .6; margin-top: 2px; }
.lb-foot { font-size: 12px; opacity: .45; animation: fadeUp .7s .65s ease both; }

.login-main { flex: 1; display: flex; align-items: center; justify-content: center; background: #fff; padding: 48px 40px; }
.login-form { width: 100%; max-width: 350px; animation: fadeUp .7s .2s ease both; }
.login-form h2 { font-size: 26px; font-weight: 700; letter-spacing: .01em; }
.lf-sub { color: var(--gray); margin: 8px 0 34px; }
.lf-field { margin-bottom: 20px; }
.lf-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.lf-box {
  position: relative; display: flex; align-items: center;
  border: 1.5px solid var(--border); border-radius: 11px; background: #fafafc;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.lf-box:focus-within { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(79,70,229,.12); }
.lf-box svg.lf-lead { width: 18px; height: 18px; color: #9ca3af; margin-left: 14px; flex-shrink: 0; transition: color .15s; }
.lf-box:focus-within svg.lf-lead { color: var(--primary); }
.lf-box input { flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  padding: 13px 14px; font-size: 14.5px; color: var(--text); font-family: inherit; }
.lf-box input::placeholder { color: #b0b6c3; }
.lf-eye { border: none; background: none; cursor: pointer; padding: 8px 12px 8px 8px; color: #9ca3af;
  display: flex; align-items: center; border-radius: 8px; }
.lf-eye:hover { color: var(--text); }
.lf-eye svg { width: 18px; height: 18px; }
.lf-error { display: none; background: #fef2f2; color: var(--danger); border: 1px solid #fecaca;
  border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 20px; }
.lf-error.show { display: block; animation: shake .4s ease; }
.lf-submit {
  width: 100%; padding: 14px; margin-top: 6px; border: none; border-radius: 11px; cursor: pointer;
  background: var(--primary); color: #fff; font-size: 15.5px; font-weight: 600;
  letter-spacing: .35em; text-indent: .35em; font-family: inherit;
  box-shadow: 0 8px 20px rgba(79,70,229,.28); transition: background .15s, transform .12s, box-shadow .15s;
}
.lf-submit:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 10px 24px rgba(79,70,229,.34); }
.lf-submit:active { transform: translateY(0); }
.lf-submit:disabled { opacity: .65; cursor: default; transform: none; }
.lf-hint { text-align: center; color: var(--gray); font-size: 12.5px; margin-top: 26px; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes shake { 0%,100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* 用户系统设置"减少动态效果"时,跳过入场动画直接呈现内容 */
@media (prefers-reduced-motion: reduce) {
  .login-brand [class^="lb-"], .login-form { animation: none !important; }
}

@media (max-width: 900px) {
  .login-brand { display: none; }
  .login-main { padding: 32px 22px; }
}

/* ---------- 侧栏用户区 ---------- */
.sidebar-foot { display: flex; flex-direction: column; gap: 7px; align-items: stretch; }
#user-box .user-name { color: #fff; font-weight: 600; font-size: 13px; }
#user-box .user-role { font-size: 11px; opacity: .75; }

/* ---------- 响应式 ---------- */
/* 平板 / 窄笔记本:双栏收单栏,详情网格收紧 */
@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* 平板竖屏 / 大手机:侧栏变顶部横导航,课次卡片纵向堆叠 */
@media (max-width: 800px) {
  #app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  #nav { flex-direction: row; overflow-x: auto; padding: 0 10px 10px; scrollbar-width: thin; }
  #nav a { white-space: nowrap; }
  .sidebar-foot { display: none; }
  #main { padding: 14px; }
  .lesson-card-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .lesson-card-actions { margin-left: 0; width: 100%; }
  .lesson-card-actions .btn { flex: 1; justify-content: center; }
  .lesson-time.big { font-size: 20px; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .detail-item.span2 { grid-column: span 2; }
  .form-grid { grid-template-columns: 1fr; }
  .date-nav { row-gap: 8px; }
  .cal-grid { min-width: 700px; }
}

/* 手机:工具栏输入撑满、按钮加大触区、宽表横向滚动、弹窗近全屏 */
@media (max-width: 620px) {
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head > div { display: flex; flex-wrap: wrap; gap: 8px; }
  .cards { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
  .btn { padding: 8px 12px; font-size: 13px; }
  .btn-sm { padding: 5px 9px; }
  .toolbar { gap: 8px; }
  .toolbar .input, .date-nav .input { width: 100% !important; flex: 1 1 140px; }
  .toolbar span { font-size: 12.5px; }
  .card > .table { min-width: 620px; }   /* 宽表在卡内横向滚动,不压碎列 */
  .att-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .att-btns { justify-content: space-between; }
  .att-btns .seg { flex: 1; text-align: center; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-item.span2 { grid-column: span 1; }
  .check-list { grid-template-columns: 1fr; }
  .barchart { gap: 2px; height: 110px; }
  .modal-overlay { padding: 3vh 10px 10px; }
  .modal, .modal-wide { width: calc(100vw - 20px); }
  .modal-head { padding: 13px 15px; }
  .modal-body { padding: 14px 15px; }
  .login-main { padding: 24px 16px; }
  .login-form h2 { font-size: 22px; }
  .seg-group { width: 100%; }
  .seg-group .seg { flex: 1; }
  .cal-summary { gap: 10px; font-size: 11.5px; }
}

/* 超宽屏(2K+):侧栏稍宽,呼吸感更足 */
@media (min-width: 1800px) {
  .sidebar { width: 240px; }
  .cards { gap: 20px; }
}
