/* 浅色班级详情与表单。抽屉的坐标、尺寸和隐藏状态继续由原控制器管理。 */
body.theme-light :is(#classDetailView, #classFormDialog, #classStudentDialog) {
    --academic-text: #302e29;
    --academic-muted: #706d65;
    --academic-panel: #FAF9F5;
    --academic-panel-raised: #F5F4ED;
    --academic-line: #dfdcd3;
    --academic-hairline: #e9e6de;
    --academic-brand: #C96442;
    --academic-active-tint: rgb(201 100 66 / 8%);
    --academic-hover-tint: #F5F4ED;
    --academic-focus: 0 0 0 3px rgb(201 100 66 / 14%);
    color: #302e29;
    background: #FAF9F5;
    border-color: #dfdcd3;
    border-radius: 12px;
    box-shadow: 0 18px 52px rgb(48 46 41 / 16%);
}

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

body.theme-light :is(#classDetailView, #classFormDialog, #classStudentDialog)
:is(.academic-primary, .academic-secondary, .academic-icon-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 :is(#classDetailView, #classFormDialog, #classStudentDialog)
:is(.academic-secondary, .academic-icon-button):hover:not(:disabled) {
    border-color: #bfb5a5;
    background: #F5F4ED;
    color: #302e29;
}

body.theme-light :is(#classDetailView, #classFormDialog, #classStudentDialog) .academic-primary {
    border-color: #C96442;
    background: #C96442;
    color: #fffdf9;
}

body.theme-light :is(#classDetailView, #classFormDialog, #classStudentDialog) .academic-primary:hover:not(:disabled) {
    border-color: #b75a3a;
    background: #b75a3a;
}

body.theme-light :is(#classDetailView, #classFormDialog, #classStudentDialog) .academic-icon-button {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
}

body.theme-light :is(#classDetailView, #classFormDialog, #classStudentDialog) .academic-icon-button svg {
    width: 15px;
    height: 15px;
    stroke-width: 1.75;
}

body.theme-light :is(#classDetailView, #classFormDialog, #classStudentDialog) button:disabled {
    opacity: 1;
    border-color: #dfd9ce;
    background: transparent;
    color: #a09a90;
    cursor: default;
}

body.theme-light :is(#classDetailView, #classFormDialog, #classStudentDialog) button:focus-visible {
    outline: 2px solid #C96442;
    outline-offset: 2px;
}

body.theme-light :is(#classDetailView, #classFormDialog, #classStudentDialog) .academic-kicker {
    color: #706d65;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .16em;
}

body.theme-light #classDetailView .class-drawer-header {
    gap: 12px;
    padding: 16px 18px 14px;
    border-bottom-color: #e4e0d7;
    background: #FAF9F5;
}

body.theme-light #classDetailView .class-drawer-header-title h3 {
    font-family: var(--academic-font-display);
    font-size: 25px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: .015em;
}

body.theme-light #classDetailView .class-drawer-header-title p {
    margin-top: 5px;
    color: #706d65;
    font-size: 12px;
}

body.theme-light #classDetailView .class-drawer-header .module-actions {
    gap: 6px;
}

body.theme-light #classDetailView .class-drawer-body {
    padding: 14px 18px 18px;
    background: #F5F4ED;
    scrollbar-color: #d6d1c5 transparent;
}

body.theme-light #classDetailView .class-drawer-section-heading {
    gap: 8px;
    margin-bottom: 12px;
}

body.theme-light #classDetailView .class-drawer-section-heading h4 {
    color: #302e29;
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Heiti SC', sans-serif;
    font-size: 13px;
    font-weight: 700;
}

body.theme-light #classDetailView .class-drawer-section-heading small {
    color: #706d65;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

body.theme-light #classDetailView .class-detail-student-list {
    gap: 10px;
}

body.theme-light #classDetailView .class-detail-student-card {
    gap: 10px;
    padding: 12px;
    border: 1px solid #d8d2c6;
    border-radius: 8px;
    background: #FAF9F5;
    box-shadow: none;
    transform: none;
}

body.theme-light #classDetailView .class-detail-student-card:hover {
    border-color: #c4b7a4;
    background: #FAF9F5;
    box-shadow: none;
    transform: none;
}

body.theme-light #classDetailView .class-detail-student-card:focus-visible {
    outline: 2px solid #C96442;
    outline-offset: 2px;
}

body.theme-light #classDetailView .class-detail-student-card > header {
    gap: 8px;
}

body.theme-light #classDetailView .class-detail-student-card header strong {
    color: #302e29;
    font-size: 14px;
    font-weight: 600;
}

body.theme-light #classDetailView .class-detail-student-avatar {
    width: 30px;
    height: 30px;
    border: 1px solid #e3d9cc;
    border-radius: 8px;
    background: #F5F4ED;
    color: #9a6551;
    font-size: 13px;
}

body.theme-light #classDetailView .class-detail-student-status {
    border: 1px solid #dcd5c8;
    border-radius: 5px;
    background: #F5F4ED;
    color: #706d65;
    font-size: 10px;
}

body.theme-light #classDetailView .class-detail-student-facts {
    gap: 6px;
    padding: 9px;
    border-radius: 6px;
    background: #F5F4ED;
}

body.theme-light #classDetailView .class-detail-student-facts span {
    color: #49463f;
    font-size: 12px;
    line-height: 1.55;
}

body.theme-light #classDetailView .class-detail-student-facts small {
    color: #706d65;
    font-size: 11px;
}

body.theme-light #classDetailView .class-detail-student-actions {
    padding-top: 0;
    gap: 6px;
}

body.theme-light #classDetailView .class-detail-student-actions button {
    min-height: 30px;
    padding: 4px 7px;
    font-size: 11px;
}

body.theme-light #classDetailView .class-drawer-body[data-student-drop-state="valid"] {
    outline: 2px solid #C96442;
    outline-offset: -3px;
    background: rgb(201 100 66 / 8%);
}

body.theme-light :is(#classFormDialog, #classStudentDialog) {
    width: min(900px, calc(100vw - 32px));
    max-height: calc(100dvh - 40px);
}

body.theme-light :is(#classFormDialog, #classStudentDialog) > form {
    padding: 20px 22px;
}

body.theme-light :is(#classFormDialog, #classStudentDialog) form > header {
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom-color: #e4e0d7;
}

body.theme-light :is(#classFormDialog, #classStudentDialog) form > header h2 {
    margin-top: 4px;
    font-family: var(--academic-font-display);
    font-size: 26px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: .02em;
}

body.theme-light #classFormDialog .student-form-grid {
    gap: 14px 12px;
    margin: 0;
}

body.theme-light #classFormDialog .student-form-grid label {
    min-width: 0;
    gap: 6px;
}

body.theme-light #classFormDialog .student-form-grid label > span {
    color: #625f58;
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Heiti SC', sans-serif;
    font-size: 12px;
    font-weight: 600;
}

body.theme-light #classFormDialog .student-form-grid.edit-mode label.key-field:not(.field-invalid) {
    padding: 0;
    background: transparent;
    box-shadow: none;
}

body.theme-light #classFormDialog :is(input, select, textarea),
body.theme-light #classStudentDialog .search-field input {
    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 #classFormDialog select[multiple] {
    min-height: 150px;
    padding: 6px;
}

body.theme-light #classFormDialog select[multiple] option {
    padding: 5px 8px;
}

body.theme-light #classFormDialog :is(input, textarea)[readonly],
body.theme-light #classFormDialog :is(input, select, textarea):disabled {
    border-color: #ded8cc;
    background: #F5F4ED;
    color: #777168;
}

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

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

body.theme-light #classFormDialog .student-form-grid label.field-invalid > span {
    color: var(--academic-danger);
}

body.theme-light :is(#classFormDialog, #classStudentDialog) form > footer {
    gap: 8px;
    margin-top: 18px;
    padding-top: 14px;
    border-top-color: #e4e0d7;
}

body.theme-light #classStudentDialog .class-student-grid {
    gap: 12px;
}

body.theme-light #classStudentDialog .class-student-panel {
    padding: 14px;
    border-color: #e0dacf;
    border-radius: 8px;
    background: #F5F4ED;
}

body.theme-light #classStudentDialog .class-student-panel-heading {
    gap: 10px;
    margin-bottom: 10px;
}

body.theme-light #classStudentDialog .class-student-panel-heading h3 {
    color: #302e29;
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Heiti SC', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0;
}

body.theme-light #classStudentDialog .class-student-panel-heading p,
body.theme-light #classStudentDialog .student-sync-status {
    font-size: 12px;
    line-height: 1.6;
}

body.theme-light #classStudentDialog .search-field input {
    padding-left: 36px;
}

body.theme-light #classStudentDialog .class-student-list {
    gap: 8px;
    margin-top: 10px;
    scrollbar-width: thin;
    scrollbar-color: #d6d1c5 transparent;
}

body.theme-light #classStudentDialog .class-student-card {
    gap: 10px;
    padding: 11px 12px;
    border-color: #d8d2c6;
    border-radius: 6px;
    background: #FAF9F5;
    box-shadow: none;
}

body.theme-light #classStudentDialog .class-student-card:hover {
    border-color: #c4b7a4;
    box-shadow: none;
}

body.theme-light #classStudentDialog .class-student-card strong {
    font-size: 13px;
    font-weight: 600;
}

body.theme-light #classStudentDialog .class-student-card span {
    font-size: 12px;
    line-height: 1.5;
}

@media (max-width: 700px) {
    body.theme-light :is(#classFormDialog, #classStudentDialog) {
        width: calc(100vw - 16px);
        max-height: calc(100dvh - 16px);
        border-radius: 10px;
    }
    body.theme-light :is(#classFormDialog, #classStudentDialog) > form { padding: 16px; }
    body.theme-light :is(#classFormDialog, #classStudentDialog) form > header h2 { font-size: 24px; }
    body.theme-light #classFormDialog .student-form-grid { gap: 12px; }
    body.theme-light #classStudentDialog .class-student-panel { padding: 12px; }
    body.theme-light #classDetailView .class-drawer-header { padding: 14px; }
    body.theme-light #classDetailView .class-drawer-body { padding: 12px 14px 14px; }
    body.theme-light #classDetailView .class-drawer-header-title h3 { font-size: 23px; }
}
