/* 学生与教师工作区共享暖纸风格；其他模块继续使用原有主题。 */
body.theme-light:has(:is(#academicModuleStudents, #academicModuleTeachers).active:not(.hidden)) {
    background: #FAF9F5;
}

.theme-light :is(#academicModuleStudents, #academicModuleTeachers) {
    --academic-workspace-inset: 20px;
    --academic-text: #302e29;
    --academic-muted: #706d65;
    --academic-line: #dfdcd3;
    --academic-hairline: #e9e6de;
    --academic-brand: #C96442;
    --academic-focus: 0 0 0 3px rgb(201 100 66 / 14%);
    --aa-body-font-size: 13px;
    --academic-column-_seq: 72px;
    --academic-column-realName: 100px;
    --academic-column-remainingLessons: 96px;
    --academic-column-purchasedLessons: 84px;
    --academic-column-studentStage: 96px;
    --academic-column-paymentProgress: 152px;
    --academic-column-assignedTeacherName: 100px;
    --academic-column-currentClassName: 112px;
    --academic-column-qualificationStatus: 80px;
    --academic-column-age: 80px;
    --academic-column-gender: 80px;
    --academic-column-studentCategory: 80px;
    --academic-column-grade: 80px;
    --academic-column-school: 150px;
    --academic-column-entryDate: 120px;
    --academic-column-studentLearningStatus: 80px;
    --academic-column-studentPaymentMethod: 96px;
    --academic-column-classroom: 80px;
    --academic-column-institutionName: 140px;
    --academic-column-actions: 296px;
    padding: 18px var(--academic-workspace-inset) 10px;
    background: #F5F4ED;
}

.theme-light #academicModuleTeachers {
    --academic-table-min-width: 0px;
    --academic-column-_seq: 56px;
    --academic-column-realName: 112px;
    --academic-column-username: 140px;
    --academic-column-contactInfo: 144px;
    --academic-column-teacherCode: 80px;
    --academic-column-teacherEmploymentType: 88px;
    --academic-column-teacherSubject: 80px;
    --academic-column-teacherWorkStatus: 88px;
    --academic-column-teacherEntryDate: 120px;
    --academic-column-onlineStudentCount: 84px;
    --academic-column-offlineStudentCount: 84px;
    --academic-column-onlineClassCount: 84px;
    --academic-column-offlineClassCount: 84px;
    --academic-column-previousMonthLessonCount: 84px;
    --academic-column-currentMonthLessonCount: 84px;
    --academic-column-actions: 96px;
}

.theme-light :is(#academicModuleStudents, #academicModuleTeachers) > .module-heading {
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 0;
}

.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .academic-kicker {
    color: #706d65;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .2em;
}

.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .module-heading h2 {
    margin-top: 3px;
    font-size: 26px;
    font-weight: 500;
    letter-spacing: .04em;
}

.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .module-actions { gap: 6px; }
.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .academic-icon-button {
    width: 36px;
    min-height: 36px;
    background: transparent;
    border-color: transparent;
    color: #706d65;
}

.theme-light :is(#academicModuleStudents, #academicModuleTeachers) :is(.academic-primary, .academic-secondary, .academic-icon-button) {
    box-shadow: none;
    transform: none;
    font-weight: 500;
}

.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .academic-primary {
    min-height: 34px;
    padding: 0 12px;
    border-color: #C96442;
    border-radius: 8px;
    background: #C96442;
    color: #fffdf9;
}

.theme-light :is(#academicModuleStudents, #academicModuleTeachers) :is(#studentAddButton, #teacherAddButton) { margin-left: 12px; }
.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .academic-primary:hover { background: #b75a3a; }
.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .academic-secondary {
    min-height: 34px;
    padding: 6px 12px;
    background: transparent;
    border-color: #dfdcd3;
    border-radius: 8px;
    color: #625f58;
}

.theme-light :is(#academicModuleStudents, #academicModuleTeachers) :is(.academic-secondary, .academic-icon-button):hover:not(:disabled) {
    background: #F5F4ED;
    border-color: #d8d3c7;
    color: #302e29;
}

.theme-light :is(#academicModuleStudents, #academicModuleTeachers) > .student-toolbar {
    grid-template-columns: minmax(220px, 1fr) auto auto auto;
    gap: 8px;
    margin: 0 0 10px;
}

.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .search-field input {
    height: 36px;
    background: #FAF9F5;
    border-color: #dfdcd3;
    border-radius: 8px;
    font-size: 13px;
}

.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .search-field input::placeholder { color: #706d65; }
.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .filter-template-bar { margin: 0; padding: 0 0 8px; }
.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .filter-template-bar:has(.filter-template-list:empty) { display: none; }
.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .filter-template-list { gap: 6px; }
.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .filter-template-item {
    min-width: 0;
    max-width: 240px;
    height: 32px;
    border-radius: 6px;
    background: #FAF9F5;
    box-shadow: none;
}
.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .filter-template-item.is-active { border-color: #c8ad99; }
.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .filter-template-apply { flex-direction: row; align-items: center; padding: 4px 10px; font-size: 12px; }
.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .filter-template-name { font-weight: 500; }
.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .filter-template-summary { display: none; }
.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .filter-template-actions { padding: 0 3px; gap: 2px; }
.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .filter-template-action { width: 24px; height: 24px; border-radius: 4px; }
.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .filter-template-action svg { width: 14px; height: 14px; }
.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .filter-template-apply:focus-visible,
.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .filter-template-action:focus-visible { outline: 2px solid #C96442; outline-offset: -2px; }
.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .advanced-filters {
    margin-top: 0;
    background: #F5F4ED;
    box-shadow: none;
    border-color: #e5e1d7;
}

.theme-light :is(#academicModuleStudents, #academicModuleTeachers) > .student-table-shell {
    border: 1px solid #e4e0d7;
    border-radius: 10px;
    background: #FAF9F5;
    box-shadow: none;
    scrollbar-color: #d6d1c5 transparent;
    scrollbar-width: thin;
}

/* 名单横向铺满模块；标题与筛选保留内边距，宽表仍在容器内滚动。 */
.theme-light :is(#academicModuleStudents, #academicModuleTeachers) > .student-table-shell {
    width: calc(100% + 2 * var(--academic-workspace-inset));
    margin-inline: calc(-1 * var(--academic-workspace-inset));
    border-inline: 0;
    border-radius: 0;
}

.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .student-table th {
    height: 38px;
    padding: 8px 10px;
    background: #F5F4ED;
    color: #302e29;
    border: 0;
    border-bottom: 1px solid #e4e0d7;
    font-size: 12px;
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Heiti SC', sans-serif;
    font-weight: 700;
    letter-spacing: 0;
}

.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .student-table th :is(.header-content, button) {
    font-family: inherit;
    font-weight: inherit;
    color: inherit;
}

/* 保留拖拽把手与排序按钮，仅降低把手的视觉权重。 */
.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .student-table th .header-content { gap: 4px; }
.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .student-table th .drag-handle,
.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .student-table th .drag-handle svg { width: 12px; }
.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .student-table th .drag-handle { opacity: .28; }
.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .student-table th:hover .drag-handle { opacity: .8; }
.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .student-table th[data-field] { background: #F5F4ED; }
.theme-light #academicModuleStudents .student-table th { cursor: default; }
.theme-light #academicModuleStudents .student-table .drag-handle { cursor: grab; touch-action: none; }
.theme-light #academicModuleStudents .student-table th:is([data-field="realName"], [data-field="actions"]) .drag-handle { display: none; }
.theme-light #academicModuleStudents .student-table th.dragging-source {
    background: #ece7dc;
    border: 0;
    border-bottom: 1px solid #d6cbbb;
    border-radius: 0;
    color: #302e29;
    box-shadow: none;
    transform: none;
    cursor: grabbing;
}
.theme-light #academicModuleStudents .student-table th:is(.drop-left, .drop-right) { background: #eeeae0; }
.theme-light #academicModuleStudents .student-table tbody tr td.column-drag-source { background: #efebe2; }
/* 插入提示只占表头高度；提示文字说明实际落点，不再贯穿整个名单。 */
body.theme-light .column-insert-line {
    width: 2px;
    background: #a99881;
    border-radius: 1px;
    box-shadow: none;
    z-index: 40;
}
body.theme-light .column-insert-line::before {
    content: '';
    position: absolute;
    width: 5px;
    height: 5px;
    left: -1.5px;
    top: -2px;
    background: #a99881;
    border-radius: 50%;
}
body.theme-light .column-insert-line::after {
    content: attr(data-label);
    position: absolute;
    top: calc(100% + 6px);
    left: 8px;
    padding: 5px 8px;
    border: 1px solid #d9d2c7;
    border-radius: 5px;
    background: #FAF9F5;
    color: #625f58;
    font: 11px/1.5 var(--academic-font-body);
    white-space: nowrap;
}
body.theme-light .column-insert-line.label-left::after { left: auto; right: 8px; }
.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .student-table tbody td {
    height: 44px;
    padding: 6px 10px;
    border: 0;
    border-bottom: 1px solid #eeeae2;
    border-radius: 0;
    background: #FAF9F5;
    color: #49463f;
    box-shadow: none;
    transform: none;
}

/* 固定列必须使用不透明底色，避免横向滚动时内容叠字。 */
.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .student-table tbody td[data-field="realName"],
.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .student-table tbody td[data-field="actions"] {
    background: #FAF9F5;
    border-left: 0;
    border-right: 0;
}

.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .student-table tbody td[data-field="realName"] {
    color: #302e29;
    font-weight: 600;
}

.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .student-table tbody tr:is(:hover, :focus, :focus-within) td {
    background: #F5F4ED;
    color: #302e29;
    border-color: #eeeae2;
    box-shadow: none;
    transform: none;
}

.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .academic-cell-value {
    min-height: 30px;
    padding: 3px 6px;
    border: 1px solid #c8c1b4;
    border-radius: 5px;
    background: #F5F4ED;
    color: inherit;
}

.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .student-card-row .academic-cell-value:hover,
.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .student-card-row .academic-cell-value:focus-visible {
    background: #FAF9F5;
    border-color: #C96442;
}

.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .student-actions { gap: 6px; }
.theme-light #academicModuleTeachers .student-actions button {
    border: 1px solid #c8c1b4;
    background: #F5F4ED;
    color: #49463f;
    border-radius: 5px;
    transform: none;
}

.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .student-actions .student-action-text {
    height: 30px;
    padding: 0 7px;
    border: 1px solid #c8c1b4;
    background: #F5F4ED;
    color: #49463f;
    border-radius: 5px;
    transform: none;
}

.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .student-card-row .student-actions button:hover {
    border-color: #C96442;
    background: #FAF9F5;
    color: #302e29;
}

.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .student-card-row .student-actions button[data-action="delete"]:hover {
    color: #a23d2e;
    background: #faeee8;
    border-color: #eacdc3;
}

.theme-light :is(#academicModuleStudents, #academicModuleTeachers) :is(button, a, input):focus-visible {
    outline: 2px solid #C96442;
    outline-offset: 2px;
}

.theme-light :is(#academicModuleStudents, #academicModuleTeachers) > .student-pagination {
    flex-direction: row;
    align-items: center;
    margin-top: 8px;
    padding-top: 0;
    color: #706d65;
    font-size: 12px;
}

.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .student-pagination .academic-secondary {
    min-height: 34px;
    border-color: #c8c1b4;
    background: #FAF9F5;
    font-size: 12px;
}

.theme-light :is(#academicModuleStudents, #academicModuleTeachers) .student-pagination .academic-secondary:disabled {
    opacity: 1;
    border-color: #d8d2c5;
    color: #a09a90;
    background: transparent;
}

@media (max-width: 1100px) {
    .theme-light :is(#academicModuleStudents, #academicModuleTeachers) { --academic-workspace-inset: 16px; padding: 16px var(--academic-workspace-inset) 10px; }
    .theme-light :is(#academicModuleStudents, #academicModuleTeachers) > .student-toolbar { grid-template-columns: 1fr auto auto; }
    .theme-light :is(#academicModuleStudents, #academicModuleTeachers) .student-toolbar .search-field { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
    .theme-light :is(#academicModuleStudents, #academicModuleTeachers) { --academic-workspace-inset: 12px; padding: 14px var(--academic-workspace-inset) 10px; }
    .theme-light :is(#academicModuleStudents, #academicModuleTeachers) > .module-heading { padding-bottom: 12px; flex-direction: row; }
    .theme-light :is(#academicModuleStudents, #academicModuleTeachers) .module-heading h2 { font-size: 24px; }
    .theme-light :is(#academicModuleStudents, #academicModuleTeachers) .student-table tbody td { height: 44px; }
}

@media (max-width: 540px) {
    .theme-light :is(#academicModuleStudents, #academicModuleTeachers) > .module-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
    .theme-light :is(#academicModuleStudents, #academicModuleTeachers) .module-actions { width: 100%; }
    .theme-light :is(#academicModuleStudents, #academicModuleTeachers) :is(#studentAddButton, #teacherAddButton) { margin-left: auto; }
    .theme-light :is(#academicModuleStudents, #academicModuleTeachers) > .student-toolbar { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
    .theme-light :is(#academicModuleStudents, #academicModuleTeachers) .student-toolbar .academic-secondary { padding: 6px; font-size: 11px; gap: 4px; }
    /* 窄屏让所有列正常滚动，避免两端固定列挤占整个可读区域。 */
    .theme-light :is(#academicModuleStudents, #academicModuleTeachers) .student-table tbody td[data-field] { position: static; }
    .theme-light :is(#academicModuleStudents, #academicModuleTeachers) .student-table th[data-field] { left: auto; right: auto; }
}
