/* 信息记录窗口的浅色样式；记录内容、只读权限和警示色由既有组件负责。 */
body.theme-light #studentRecordDialog {
    --academic-text: #302e29;
    --academic-muted: #706d65;
    --academic-panel: #FAF9F5;
    --academic-panel-raised: #F5F4ED;
    --academic-line: #dfdcd3;
    --academic-hairline: #e9e6de;
    --academic-brand: #C96442;
    --academic-focus: 0 0 0 3px rgb(201 100 66 / 14%);
    width: min(1440px, calc(100vw - 40px));
    height: calc(100dvh - 40px);
    max-height: calc(100dvh - 40px);
    margin: auto;
    overflow: hidden;
    border: 1px solid #dfdcd3;
    border-radius: 14px;
    color: #302e29;
    background: #FAF9F5;
    box-shadow: 0 22px 72px rgb(48 46 41 / 18%);
}

body.theme-light #studentRecordDialog::backdrop {
    background: rgb(35 32 28 / 28%);
    backdrop-filter: blur(3px);
}

body.theme-light #studentRecordForm {
    padding: 0;
}

body.theme-light #studentRecordForm > header {
    flex: 0 0 auto;
    gap: 16px;
    margin: 0;
    padding: 18px 22px 16px;
    border-bottom: 1px solid #e4e0d7;
    background: #FAF9F5;
}

body.theme-light #studentRecordForm > header > div {
    min-width: 0;
}

body.theme-light #studentRecordForm > header .academic-kicker {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .16em;
}

body.theme-light #studentRecordTitle {
    margin-top: 4px;
    font-family: var(--academic-font-display);
    font-size: 26px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: .02em;
    overflow-wrap: anywhere;
}

body.theme-light #studentRecordDialog
:where(.academic-primary, .academic-secondary, .academic-icon-button, .record-actions button) {
    min-height: 32px;
    padding: 5px 10px;
    border: 1px solid #cfc8ba;
    border-radius: 6px;
    background: #FAF9F5;
    color: #625f58;
    font-family: var(--academic-font-body);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    box-shadow: none;
    transform: none;
}

body.theme-light #studentRecordDialog
:is(.academic-secondary, .academic-icon-button, .record-actions button):hover:not(:disabled) {
    border-color: #bfb5a5;
    background: #F5F4ED;
    color: #302e29;
}

body.theme-light #studentRecordDialog .academic-primary {
    border-color: #C96442;
    background: #C96442;
    color: #fffdf9;
}

body.theme-light #studentRecordDialog .academic-primary:hover:not(:disabled) {
    border-color: #b75a3a;
    background: #b75a3a;
}

body.theme-light #studentRecordDialog .academic-icon-button {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
}

body.theme-light #studentRecordClose { align-items: center; justify-content: center; }
body.theme-light #studentRecordClose svg { width: 15px; height: 15px; stroke-width: 1.75; }

body.theme-light #studentRecordDialog button:disabled {
    opacity: 1;
    border-color: #dfd9ce;
    background: transparent;
    color: #a09a90;
    cursor: default;
}

body.theme-light #studentRecordDialog button:focus-visible {
    outline: 2px solid #C96442;
    outline-offset: 2px;
}

/* 记录类型是一排可横向浏览的短标签，不随窗口宽度拉伸成大按钮。 */
body.theme-light #studentRecordDialog #recordTypeTabs {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 7px;
    min-width: 0;
    margin: 0;
    padding: 12px 22px 10px;
    overflow-x: auto;
    border: 0;
    border-radius: 0;
    background: #FAF9F5;
    scrollbar-width: thin;
    scrollbar-color: #d6d1c5 transparent;
}

body.theme-light #studentRecordDialog #recordTypeTabs button {
    flex: 0 0 auto;
    min-width: 0;
    min-height: 34px;
    padding: 6px 13px;
    white-space: nowrap;
}

body.theme-light #studentRecordDialog #recordTypeTabs button[aria-pressed="true"] {
    border-color: #d9b7a5;
    background: rgb(201 100 66 / 7%);
    color: #a95033;
    font-weight: 600;
}

body.theme-light #studentRecordDialog .record-toolbar {
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 8px 22px 12px;
}

/* 原新增按钮仍使用原监听/权限，作为标签滚动区域的兄弟元素固定在右侧。 */
body.theme-light #studentRecordDialog .record-navigation { flex: 0 0 auto; min-width: 0; }
body.theme-light #studentRecordDialog .record-navigation:has(#recordTypeTabs:not(.hidden)) {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 22px 10px;
}
body.theme-light #studentRecordDialog .record-navigation #recordTypeTabs {
    flex: 1 1 auto;
    padding: 0;
}
body.theme-light #studentRecordDialog .record-navigation:has(#recordTypeTabs:not(.hidden)) .record-toolbar {
    flex: 0 0 auto;
    padding: 0;
    gap: 0;
}
body.theme-light #studentRecordDialog:has(#recordTypeTabs:not(.hidden)) :is(#recordRefreshButton, #recordCountHint),
body.theme-light #studentRecordDialog:has(#recordTypeTabs:not(.hidden)) .record-toolbar:has(#recordAddButton.hidden) { display: none; }

body.theme-light #studentRecordDialog .record-count-hint {
    margin-left: 4px;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

body.theme-light #studentRecordDialog #recordReadOnlyHint {
    flex: 0 0 auto;
    margin: 12px 22px 0;
    padding: 8px 10px;
    border: 1px solid #dfd8ca;
    border-radius: 6px;
    background: #F5F4ED;
    font-size: 12px;
    line-height: 1.6;
}

body.theme-light #studentRecordDialog .record-table-shell {
    min-height: 80px;
    margin: 0 22px 18px;
    border: 1px solid #e4e0d7;
    border-radius: 8px;
    background: #FAF9F5;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #d6d1c5 transparent;
}

body.theme-light #studentRecordDialog .record-table {
    min-width: 640px;
}

body.theme-light #studentRecordDialog .record-table th {
    z-index: 1;
    height: 38px;
    padding: 9px 12px;
    border-bottom: 1px solid #dfd9ce;
    background: #F5F4ED;
    color: #302e29;
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Heiti SC', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
}

body.theme-light #studentRecordDialog .record-table td {
    height: 42px;
    padding: 9px 12px;
    border-bottom-color: #e9e6de;
    font-size: 13px;
    line-height: 1.6;
}

/* 不给单元格或警示行设置底色/阴影，保留欠费红、缺课黄和首列状态条。 */
body.theme-light #studentRecordDialog .record-table tbody tr:not([class*="lesson-record-warning--"]):hover {
    background: #F5F4ED;
}

body.theme-light #studentRecordDialog .record-actions {
    display: table-cell;
    white-space: nowrap;
    vertical-align: middle;
}

body.theme-light #studentRecordDialog .record-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    min-height: 30px;
    padding: 0;
    border-color: #d8d2c6;
}
body.theme-light #studentRecordDialog .record-actions button + button { margin-left: 6px; }
body.theme-light #studentRecordDialog .record-actions svg { width: 14px; height: 14px; stroke-width: 1.75; }
body.theme-light #studentRecordDialog .record-actions button[data-record-action="delete"]:hover:not(:disabled) {
    color: #A23D2E;
    background: #FAEEE8;
    border-color: #E2C3B8;
}

body.theme-light #studentRecordDialog #recordStateMessage {
    flex: 0 1 auto;
    max-height: 20dvh;
    overflow: auto;
    margin: 0 22px 16px;
    padding: 12px;
    border-color: #dfdcd3;
    background: #F5F4ED;
    font-size: 13px;
}

body.theme-light #studentRecordDialog #recordFormArea {
    max-height: min(42dvh, 360px);
    margin: 0 22px 18px;
    padding: 14px 16px;
    border-color: #dcd6ca;
    border-radius: 8px;
    background: #F5F4ED;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #d6d1c5 transparent;
}

body.theme-light #studentRecordDialog #recordFormFields {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
}

body.theme-light #studentRecordDialog #recordFormFields label {
    min-width: 0;
    gap: 6px;
}

body.theme-light #studentRecordDialog #recordFormFields label > span {
    color: #625f58;
    font-size: 12px;
}

body.theme-light #studentRecordDialog #recordFormFields :is(input:not([type="checkbox"]), select, textarea) {
    min-width: 0;
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid #c8c1b4;
    border-radius: 6px;
    background: #FAF9F5;
    color: #302e29;
    font-family: var(--academic-font-body);
    font-size: 13px;
}

body.theme-light #studentRecordDialog #recordFormFields input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: #C96442;
}

body.theme-light #studentRecordDialog #recordFormFields :is(input, select, textarea):focus-visible {
    outline: 2px solid #C96442;
    outline-offset: 2px;
}

body.theme-light #studentRecordDialog #recordFormFields label.field-invalid :is(input, select, textarea),
body.theme-light #studentRecordDialog #recordFormFields :is(input, select, textarea)[aria-invalid="true"] {
    border-color: var(--academic-danger);
    outline-color: var(--academic-danger);
}

body.theme-light #studentRecordDialog #recordFormFields label.field-invalid > span {
    color: var(--academic-danger);
}

body.theme-light #studentRecordDialog .record-form-actions {
    gap: 8px;
    margin-top: 12px;
}

@media (max-width: 1000px) {
    body.theme-light #studentRecordDialog #recordFormFields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    body.theme-light #studentRecordDialog {
        width: calc(100vw - 16px);
        height: calc(100dvh - 16px);
        max-height: calc(100dvh - 16px);
        border-radius: 10px;
    }
    body.theme-light #studentRecordForm > header { padding: 16px; }
    body.theme-light #studentRecordTitle { font-size: 23px; }
    body.theme-light #studentRecordDialog #recordTypeTabs { padding: 10px 16px 8px; }
    body.theme-light #studentRecordDialog .record-navigation:has(#recordTypeTabs:not(.hidden)) { gap: 8px; padding: 10px 16px 8px; }
    body.theme-light #studentRecordDialog #recordTypeTabs button { padding-inline: 11px; }
    body.theme-light #studentRecordDialog .record-toolbar { padding: 8px 16px 10px; }
    body.theme-light #studentRecordDialog .record-table-shell { margin: 0 12px 12px; }
    body.theme-light #studentRecordDialog #recordReadOnlyHint { margin-inline: 16px; }
    body.theme-light #studentRecordDialog #recordStateMessage { margin: 0 12px 12px; }
    body.theme-light #studentRecordDialog #recordFormArea { margin: 0 12px 12px; padding: 12px; }
    body.theme-light #studentRecordDialog #recordFormFields { grid-template-columns: 1fr; }
    body.theme-light #studentRecordDialog #recordFormFields .wide { grid-column: 1 / -1; }
}

@media (max-height: 600px) {
    body.theme-light #studentRecordForm > header { padding-block: 12px; }
    body.theme-light #studentRecordDialog #recordFormArea { max-height: 34dvh; }
}
