* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --teal: #50B8B8; --teal-deep: #3D9E9E; --teal-light: #E6F5F5;
  --ink: #243432; --ink-2: #5b6b69; --ink-3: #94a19f;
  --line: #e5ecea; --bg: #F2FAF9; --card: #fff;
  --danger: #c05b4b; --gold: #c9a86a;
}
body { font-family: "Microsoft YaHei", "微软雅黑", -apple-system, sans-serif; color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.6; }
.hidden { display: none !important; }
button, input, textarea, select { font-family: inherit; }

/* 登录 */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg,#F2FAF9,#F7FCFB); }
.login-box { width: 380px; background: #fff; border-radius: 18px; padding: 38px; box-shadow: 0 12px 40px rgba(40,80,75,.12); text-align: center; }
.login-box img { width: 84px; height: 84px; border-radius: 50%; }
.login-box h1 { font-size: 19px; margin: 18px 0 4px; }
.login-box .sub { color: var(--ink-3); font-size: 12px; letter-spacing: 1px; margin-bottom: 26px; }
.login-box input { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; margin-bottom: 14px; outline: none; font-size: 14px; }
.login-box input:focus { border-color: var(--teal); }
.login-box .btn { width: 100%; padding: 12px; border: 0; border-radius: 10px; background: var(--teal); color: #fff; font-size: 15px; cursor: pointer; }
.login-foot { color: var(--ink-3); font-size: 12px; margin-top: 18px; }
.login-foot a { color: var(--teal-deep); text-decoration: none; cursor: pointer; }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; flex-shrink: 0; background: var(--teal); color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px; border-bottom: 1px solid rgba(255,255,255,.25); }
.side-brand img { width: 38px; height: 38px; border-radius: 50%; background: #fff; }
.side-brand .t { font-size: 14px; font-weight: 600; }
.side-brand .s { font-size: 10px; color: rgba(255,255,255,.85); letter-spacing: 1px; }
.nav { flex: 1; padding: 14px 0; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; margin: 2px 10px; border-radius: 8px; cursor: pointer; color: rgba(255,255,255,.9); font-size: 14px; }
.nav-item:hover { background: rgba(255,255,255,.16); color: #fff; }
.nav-item.active { background: #fff; color: var(--teal-deep); font-weight: 600; }
.nav-item .ic { width: 18px; text-align: center; font-size: 16px; }
.side-foot { padding: 16px 18px; border-top: 1px solid rgba(255,255,255,.25); font-size: 12px; color: rgba(255,255,255,.9); }
.side-foot .logout { color: #fff; text-decoration: underline; cursor: pointer; }
.main { flex: 1; min-width: 0; }
.topbar { height: 62px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 28px; justify-content: space-between; position: sticky; top: 0; z-index: 10; }
.topbar h2 { font-size: 17px; font-weight: 600; }
.topbar .u { color: var(--ink-2); font-size: 13px; }
.content { padding: 26px 28px; max-width: 1180px; }

/* 卡片/表格 */
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 22px; margin-bottom: 20px; }
.card-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.card-hd h3 { font-size: 16px; font-weight: 600; }
.toolbar { display: flex; gap: 10px; align-items: center; }
.btn { padding: 9px 16px; border: 0; border-radius: 9px; background: var(--teal); color: #fff; font-size: 13px; cursor: pointer; }
.btn:hover { background: var(--teal-deep); }
.btn.ghost { background: #fff; color: var(--teal-deep); border: 1.5px solid var(--teal); }
.btn.danger { background: var(--danger); }
.btn.sm { padding: 5px 11px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
th { color: var(--ink-3); font-weight: 400; background: #fafcfb; }
tr:last-child td { border-bottom: 0; }
/* 差异着色：不足 1 分钟按方向着色，满 1 分钟统一标红（diff-warn） */
td.over { color: #c0563f; font-weight: 600; }
td.under { color: var(--teal-deep); font-weight: 600; }
td.ok { color: var(--ink-3); }
td.diff-warn { color: #c0392b; font-weight: 700; }
.stat .v.diff-warn { color: #c0392b; }
.stat .v.over { color: #c0563f; }
.stat .v.under { color: var(--teal-deep); }
.tag { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; background: var(--teal-light); color: var(--teal-deep); }
.tag.gray { background: #eef1f0; color: var(--ink-2); }
.tag.gold { background: #f7f0e2; color: #9d7f3f; }
.empty { text-align: center; color: var(--ink-3); padding: 50px; }
.stat-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-bottom: 22px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.stat .v { font-size: 28px; font-weight: 600; color: var(--teal-deep); }
.stat .k { color: var(--ink-3); font-size: 13px; margin-top: 4px; }

/* 表单 / 弹窗 */
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.form-row input, .form-row select { width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 9px; outline: none; font-size: 14px; }
.form-row input:focus { border-color: var(--teal); }
.editor { border: 1.5px solid var(--line); border-radius: 9px; min-height: 130px; padding: 12px; line-height: 1.8; outline: none; font-size: 14px; }
.editor:focus { border-color: var(--teal); }
.editor img { max-width: 100%; height: auto; border-radius: 8px; }
.editor-toolbar { display: flex; gap: 8px; margin-bottom: 8px; }
.modal-mask { position: fixed; inset: 0; z-index: 100; background: rgba(20,32,30,.5); display: flex; align-items: flex-start; justify-content: center; padding: 40px 20px; overflow-y: auto; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 760px; box-shadow: 0 16px 50px rgba(0,0,0,.22); }
.modal.small { max-width: 440px; }
.modal-hd { padding: 18px 24px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-hd h3 { font-size: 16px; }
.modal-hd .x { cursor: pointer; color: var(--ink-3); font-size: 22px; line-height: 1; }
.modal-bd { padding: 22px 24px; }
.modal-ft { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.chapter-edit-item { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; background: #fcfdfd; }
.chapter-edit-item .ce-hd { display: flex; gap: 6px; align-items: center; margin-bottom: 10px; flex-wrap: nowrap; }
.chapter-edit-item .ce-hd .ce-no { flex: 0 0 auto; white-space: nowrap; }
.chapter-edit-item .ce-hd input { flex: 1 1 auto; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.chapter-edit-item .ce-hd select.ce-dur { flex: 0 0 auto; width: 92px; padding: 8px 4px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink-2); }
.chapter-edit-item .ce-hd .ce-icon { flex: 0 0 auto; width: 32px; padding: 8px 0; text-align: center; line-height: 1; }
.rec-group { margin-bottom: 24px; }
.rec-day { font-size: 14px; font-weight: 600; color: var(--teal-deep); padding: 8px 0; border-bottom: 2px solid var(--teal-light); margin-bottom: 8px; }
.chip { font-size: 12px; padding: 1px 8px; border-radius: 6px; background: #eef1f0; color: var(--ink-2); }
.section-tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.section-tabs .tab { padding: 9px 16px; cursor: pointer; color: var(--ink-2); border-bottom: 2px solid transparent; }
.section-tabs .tab.active { color: var(--teal-deep); border-bottom-color: var(--teal); font-weight: 600; }

/* 富文本编辑器 */
.rte { border: 1.5px solid var(--line); border-radius: 9px; overflow: hidden; }
.rte:focus-within { border-color: var(--teal); }
.rte-bar { display: flex; gap: 4px; padding: 6px 8px; background: #fafcfb; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.rte-bar button { min-width: 34px; padding: 5px 9px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); border-radius: 6px; font-size: 13px; cursor: pointer; }
.rte-bar button:hover { border-color: var(--teal); color: var(--teal-deep); }
.rte-body { min-height: 96px; padding: 12px; outline: none; line-height: 1.8; font-size: 14px; }
.rte-body img { max-width: 100%; height: auto; border-radius: 8px; display: block; margin: 8px 0; }

/* 授课记录 - 章节明细 */
.rec-item { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.rec-item-hd { font-size: 13px; color: var(--ink-2); margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.rec-chapters { width: 100%; }
.rec-chapter-row { display: grid; grid-template-columns: 2.4fr 1fr 1fr 0.9fr; gap: 10px; padding: 7px 0; font-size: 13px; align-items: center; border-bottom: 1px solid #f2f6f5; }
.rec-chapter-row:last-child { border-bottom: 0; }
.rec-chapter-row.head { color: var(--ink-3); font-size: 12px; background: #fafcfb; padding: 8px 10px; border-radius: 6px; }
.rec-chapter-row .over { color: #c0563f; font-weight: 600; }
.rec-chapter-row .under { color: var(--teal-deep); font-weight: 600; }
.rec-chapter-row .ok { color: var(--ink-3); }
.rec-chapter-row .diff-warn { color: #c0392b; font-weight: 700; }

/* 授课分析 - 条形图 */
.barchart { display: flex; flex-direction: column; gap: 16px; padding: 6px 0; }
.bc-row { display: grid; grid-template-columns: 130px 1fr 80px; gap: 12px; align-items: center; }
.bc-label { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-bars { display: flex; flex-direction: column; gap: 6px; }
.bc-bar { height: 22px; border-radius: 5px; display: flex; align-items: center; padding-left: 8px; min-width: 2px; transition: width .4s; }
.bc-bar span { font-size: 11px; color: #fff; white-space: nowrap; }
.bc-bar.std { background: #B9CFCB; }
.bc-bar.act { background: var(--teal); }
.bc-diff { font-size: 12px; text-align: right; }
.bc-diff.over { color: #c0563f; font-weight: 600; }
.bc-diff.under { color: var(--teal-deep); font-weight: 600; }
.bc-diff.ok { color: var(--ink-3); }
.chart-note { color: var(--ink-3); font-size: 12px; line-height: 1.7; margin-top: 6px; }

/* 筛选栏（授课记录/授课分析共用） */
.filter-bar { background: #fafcfb; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 18px; }
.filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.filter-row label { font-size: 13px; color: var(--ink-2); min-width: 34px; }
.filter-row select, .filter-row input[type="date"] { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-size: 13px; outline: none; }
.filter-row select:focus, .filter-row input:focus { border-color: var(--teal); }
.date-sep { color: var(--ink-3); }
.quick-range { display: flex; gap: 4px; margin-left: 6px; }
.quick-range button { padding: 7px 12px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); border-radius: 8px; font-size: 12px; cursor: pointer; }
.quick-range button:hover { border-color: var(--teal); color: var(--teal-deep); }
.quick-range button.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.filter-actions { display: flex; align-items: center; gap: 10px; padding-top: 4px; }
.filter-hint { font-size: 12px; color: var(--ink-3); }
.filter-summary { font-size: 13px; color: var(--ink-2); margin-bottom: 12px; }
.hd-tip { font-size: 12px; color: var(--ink-3); font-weight: 400; }

/* 表格滚动：老师多时固定高度内滚动 */
.table-scroll { max-height: 460px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.table-scroll table { min-width: 720px; }
.table-scroll th { position: sticky; top: 0; z-index: 1; }

/* 对比条：灰=标准，青=实际 */
.ratio-cell { display: flex; flex-direction: column; gap: 4px; min-width: 90px; }
.ratio-track { height: 8px; background: #eef2f1; border-radius: 4px; overflow: hidden; }
.ratio-fill { height: 100%; border-radius: 4px; }
.ratio-fill.std { background: #B9CFCB; }
.ratio-fill.act { background: var(--teal); }
