/* 课时记录使用独立只读大表，继承教务深浅主题 token。 */
.lesson-history-dialog {
    width: calc(100vw - 48px);
    height: calc(100dvh - 48px);
    max-width: 1600px;
    max-height: none;
    margin: auto;
    padding: 0;
    overflow: hidden;
    color: var(--academic-text);
    background: var(--academic-panel);
    border: 1px solid var(--academic-line);
    border-radius: 18px;
    box-shadow: var(--academic-shadow);
    font-family: var(--academic-font-body);
}
.lesson-history-dialog[open] { display: flex; flex-direction: column; }
.lesson-history-dialog::backdrop { background: rgba(35, 32, 28, .38); backdrop-filter: blur(5px); }
.lesson-history-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px 30px; border-bottom: 1px solid var(--academic-line); flex-shrink: 0; }
.lesson-history-identity { min-width: 0; }
.lesson-history-identity h2 { margin: 5px 0 6px; font-size: 28px; line-height: 1.3; letter-spacing: -.025em; overflow-wrap: anywhere; }
.lesson-history-identity p { margin: 0; color: var(--academic-muted); font-size: 13px; }
.lesson-history-close { flex-shrink: 0; }
.lesson-history-close span { font-size: 22px; line-height: 1; }
.lesson-history-content { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.lesson-history-content:focus-visible { outline: 2px solid var(--academic-brand); outline-offset: -2px; }
.lesson-history-table { width: 100%; min-width: 800px; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.lesson-history-table caption { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.lesson-history-table th { position: sticky; top: 0; z-index: 1; color: var(--academic-muted); background: var(--academic-panel-raised); text-align: left; font-size: 12px; font-weight: 600; }
.lesson-history-table th, .lesson-history-table td { padding: 16px 20px; border-bottom: 1px solid var(--academic-line); line-height: 1.65; vertical-align: top; }
.lesson-history-table th:first-child, .lesson-history-table td:first-child { padding-left: 30px; }
.lesson-history-table th:first-child { width: 190px; }
.lesson-history-table th:nth-child(3) { width: 120px; }
.lesson-history-table th:nth-child(4), .lesson-history-table th:last-child { width: 160px; }
.lesson-history-table td:nth-child(2), .lesson-history-table td:nth-child(4) { font-weight: 500; white-space: pre-wrap; overflow-wrap: anywhere; }
.lesson-history-table td:first-child, .lesson-history-table td:last-child { font-variant-numeric: tabular-nums; }
.lesson-history-table tbody tr:hover { background: var(--academic-active-tint); }
.lesson-history-type { display: inline-block; padding: 2px 8px; color: var(--academic-muted); background: var(--academic-panel-raised); border: 1px solid var(--academic-line); border-radius: 5px; font-size: 12px; white-space: nowrap; }
/* 整条记录共用警示色，悬停也保留状态；文字沿用主题正文以保证可读性。 */
:root { --lesson-absent-tint: rgba(210, 168, 79, .17); --lesson-overdrawn-tint: rgba(255, 92, 61, .16); }
.theme-light { --lesson-absent-tint: #fff4cc; --lesson-overdrawn-tint: #fce5df; }
.lesson-history-table tbody tr.lesson-record-warning--absent,
.record-table tbody tr.lesson-record-warning--absent,
.student-detail-records li.lesson-record-warning--absent {
    --lesson-warning-color: var(--academic-warn);
    background: var(--lesson-absent-tint);
}
.lesson-history-table tbody tr.lesson-record-warning--overdrawn,
.record-table tbody tr.lesson-record-warning--overdrawn,
.student-detail-records li.lesson-record-warning--overdrawn {
    --lesson-warning-color: var(--academic-danger);
    background: var(--lesson-overdrawn-tint);
}
.lesson-history-table tr[class*="lesson-record-warning--"] td:first-child,
.record-table tr[class*="lesson-record-warning--"] td:first-child { box-shadow: inset 3px 0 var(--lesson-warning-color); }
.student-detail-records li[class*="lesson-record-warning--"] { padding: 12px; border-radius: 6px; box-shadow: inset 3px 0 var(--lesson-warning-color); }
.lesson-history-empty { display: grid; justify-items: center; align-content: center; min-height: 220px; margin: 0; padding: 32px; color: var(--academic-muted); font-size: 14px; line-height: 1.8; text-align: center; overflow-wrap: anywhere; }
.lesson-history-error { margin: 0 0 16px; }
.lesson-history-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 16px 30px; border-top: 1px solid var(--academic-line); flex-shrink: 0; }
.lesson-history-footer p { margin: 0; color: var(--academic-muted); font-size: 13px; }
.lesson-history-pagination { display: flex; align-items: center; gap: 14px; }
.lesson-history-pagination span { color: var(--academic-muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lesson-history-dialog button:disabled { opacity: .45; cursor: default; }
@media (max-width: 680px) {
    .lesson-history-dialog { width: calc(100vw - 16px); height: calc(100dvh - 16px); border-radius: 12px; }
    .lesson-history-header { gap: 12px; padding: 18px; }
    .lesson-history-identity h2 { font-size: 23px; }
    .lesson-history-footer { padding: 14px 18px; }
    .lesson-history-pagination { gap: 10px; }
}
