/* 基础样式 */
:root {
    --primary-color: #0066cc;
    --border-color: #dee2e6;
    --bg-light: #f8f9fa;
    --text-color: #495057;
    --danger-color: #dc3545;
    --input-height: calc(1.5em + 0.5rem + 2px);
}

/* 响应式基础设置 */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-size: 14px;
    background-color: #f8f9fa;
}

/* 导航栏样式重置 - 修改为只隐藏顶部导航，保留侧边栏 */
nav:not(.sidebar-main), .navbar:not(.sidebar-main) {
    display: none !important; /* 隐藏除sidebar-main外的导航栏 */
}

/* 确保侧边栏导航显示 */
nav.sidebar-main {
    display: block !important;
}

/* 容器响应式布局 */
.container-fluid {
    width: 100%;
    padding: 0;
    margin: 0;
    min-height: 0; /* 移除固定高度 */
    display: flex;
    flex-direction: column;
}

.row {
    margin: 0;
    min-height: 0; /* 移除固定高度 */
    flex: 1;
}

.col-12 {
    padding: 0;
    min-height: 0; /* 移除固定高度 */
    display: flex;
    flex-direction: column;
}

/* 卡片响应式样式 */
.card {
    border: none;
    border-radius: 0;
    margin: 0;
    min-height: 0; /* 移除固定高度 */
    display: flex;
    flex-direction: column;
    box-shadow: none;
}

.card-header {
    display: flex !important; /* 使用 !important 覆盖之前的 display: none */
    justify-content: center !important;
    align-items: center;
    padding: 12px 15px;
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    width: 100%;
}

/* 移除卡片标题的粗体效果 - 增强选择器特异性 */
.card-header h1, 
.card-header h2, 
.card-header h3, 
.card-header h4, 
.card-header h5, 
.card-header h6,
.card-header .h1,
.card-header .h2,
.card-header .h3,
.card-header .h4,
.card-header .h5,
.card-header .h6,
.card-header span,
.card-header div,
.card-header p,
.card .card-header h4,
.card > .card-header > h4,
div.card-header h4,
.card-header > *,
h4.card-title {
    font-weight: normal !important;
    margin: 0;
    text-align: center;
}

/* 确保卡片标题中的span也使用正常字重 */
.card-header span {
    text-align: center;
    font-size: 14px;
    font-weight: normal !important;
    color: var(--text-color);
    margin: 0;
    padding: 0;
    width: 100%;
}

.card-body {
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* 表单组响应式样式 */
.form-group {
    margin-bottom: 1rem;
}

/* 修改表单标签样式 - 移除粗体 */
.form-group label {
    font-weight: normal !important; /* 使用normal或400代替500，添加!important确保覆盖其他样式 */
    color: var(--text-color);
}

/* 表格响应式样式 */
.table-responsive {
    flex: 1; /* 让表格容器填充剩余空间 */
    display: flex;
    flex-direction: column;
    min-height: 0; /* 防止内容溢出 */
    overflow: hidden;
}

.table {
    background-color: white;
    table-layout: auto;
    width: 100%;
    font-size: 14px;
    margin: 0;
    border-collapse: collapse;
}

.table th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #f8f9fa;
    font-size: 14px;
    padding: 0.4rem 0.5rem;
    font-weight: 500;
    text-align: center;
}

/* 响应式表格列宽 */
@media (min-width: 768px) {
    .table th:nth-child(1) { width: 50px; min-width: 50px; }
    .table th:nth-child(2) { width: 60px; min-width: 60px; }
    .table th:nth-child(3) { width: 80px; min-width: 80px; }
    .table th:nth-child(4) { width: 80px; min-width: 80px; }
    .table th:nth-child(5) { width: 80px; min-width: 80px; }
}

.table td {
    vertical-align: middle;
    text-align: center;
    padding: 0.4rem 0.5rem;
    white-space: nowrap;
    font-size: 14px;
}

/* 成绩输入框响应式样式 */
.score-input {
    width: 60px !important;
    text-align: center;
    padding: 0.25rem;
    margin: 0 auto;
    display: inline-block;
    font-size: 14px !important;
}

.input-group-sm {
    width: auto;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

/* 警告提示响应式样式 */
.alert {
    padding: 10px 15px;
    margin-bottom: 15px;
    font-size: 14px;
}

/* 表格容器响应式高度 */
.table-container {
    height: auto;
    max-height: calc(100vh - 120px); /* 动态计算最大高度 */
    overflow-y: auto;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    border-top: none;
}

/* 按钮响应式样式 */
.btn-save {
    min-width: 100px;
    font-size: 14px;
}

/* 验证反馈响应式样式 */
.invalid-feedback {
    display: none;
    color: #dc3545;
    font-size: 12px;
}

input.is-invalid + .invalid-feedback {
    display: block;
}

/* 课程头部响应式样式 */
.course-header {
    min-width: 80px;
    width: auto;
}

/* 下拉框整体样式缩小 - 使用更强的选择器 */
.select-container .form-group select.form-control,
select.form-control {
    height: 32px !important;
    padding: 4px 8px !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    border-radius: 4px !important;
}

/* 选择容器响应式布局 */
.select-container {
    border-top: none;
    margin: 0;
    padding: 10px 20px;
    background-color: #fff;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.select-container .form-group {
    margin-bottom: 0;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.select-container .form-group label {
    margin-bottom: 0;
    margin-right: 10px;
    font-size: 14px;
    white-space: nowrap;
    color: var(--text-color);
    font-weight: normal;
}

/* 特别处理第一个标签（年级录入） */
.select-container .form-group:first-child label {
    font-size: 16px;
    color: var(--text-color);
    font-weight: normal;
    opacity: 1;
}

.select-container .form-group select {
    width: auto;
    min-width: 120px;
    max-width: 200px;
}

/* 课程按钮样式 */
.select-container .form-group button.btn {
    margin-top: 0;
    height: 32px;
    min-width: 80px;
    font-size: 13px;
    padding: 4px 12px;
}

/* 课程选择对话框样式 */
.course-checkboxes {
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
}

.course-checkboxes .form-check {
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 4px;
    background-color: #f8f9fa;
    transition: all 0.2s ease;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.course-checkboxes .form-check:hover {
    background-color: #e9ecef;
}

.course-checkboxes .form-check-input {
    margin: 0;
    position: relative;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

.course-checkboxes .form-check-label {
    margin-left: 8px;
    user-select: none;
    cursor: pointer;
    font-size: 14px;
    padding-left: 4px;
    flex: 1;
}

.selected-count {
    color: #666;
    font-size: 14px;
    padding: 8px;
    text-align: right;
}

/* 模态框样式调整 */
.modal-title {
    font-size: 14px;
    font-weight: 500;
}

.modal-body {
    font-size: 14px;
}

.modal-footer .btn {
    font-size: 14px;
}

/* 课程选择对话框的提示文字 */
.modal-body .alert {
    font-size: 14px;
    padding: 8px 12px;
    margin-bottom: 12px;
}

/* 已选择数量文字 */
.selected-count {
    color: #666;
    font-size: 14px;
    padding: 6px;
    text-align: right;
}

/* 表格内的输入框样式 */
.table .form-control {
    font-size: 14px;
    height: calc(1.5em + 0.5rem + 2px);
    padding: 0.25rem 0.5rem;
}

/* 保存按钮样式 */
.card-footer .btn {
    font-size: 14px;
    padding: 0.375rem 0.75rem;
}

/* 批量录入模态框样式 */
#batchScoreModal .form-control {
    font-size: 14px;
    height: calc(1.5em + 0.75rem + 2px);
}

#batchScoreModal .form-text {
    font-size: 12px;
}

/* 已存在成绩的输入框样式 */
.score-input.existing-score {
    color: #0066cc;
    font-weight: 500;
}

/* 表格标题样式 */
.table-title {
    text-align: center;
    padding: 10px 15px;
    background-color: #fff;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    margin: 0;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 40px; /* 固定高度确保垂直居中 */
}

/* 表格标题文本容器 */
.table-title span {
    display: inline-block;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    padding: 0 10px;
}

/* 移动设备优化 */
@media (max-width: 576px) {
    html {
        font-size: 14px;
    }
    
    .card {
        margin: 0;
        border-radius: 0 0 4px 4px;
    }
    
    .container-fluid {
        padding: 0;
    }
    
    body {
        padding-top: 0 !important;
    }
    
    .score-input {
        width: 45px !important;
        padding: 0.125rem;
    }
    
    .select-container {
        padding: 8px 15px;
        gap: 10px;
    }
    
    .select-container .form-group {
        width: 100%;
    }
    
    .select-container .form-group label {
        font-size: 13px;
    }
    
    .select-container .form-group:first-child label {
        font-size: 15px;
    }
    
    .select-container .form-group select {
        flex: 1;
        width: 100%;
        min-width: unset;
        max-width: none;
        font-size: 13px;
    }
    
    .table-container {
        max-height: calc(100vh - 100px); /* 移动设备减小上方预留空间 */
        margin: 0;
    }
    
    .btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .course-checkboxes .form-check {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .course-checkboxes .form-check-input {
        width: 14px;
        height: 14px;
    }
    
    .course-checkboxes .form-check-label {
        font-size: 13px;
    }
    
    .modal-title {
        font-size: 13px;
    }
    
    .modal-body {
        font-size: 13px;
    }
    
    .modal-body .alert {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .selected-count {
        font-size: 13px;
    }
    
    .modal-footer .btn {
        font-size: 13px;
    }
    
    .card-header {
        padding: 10px;
    }
    .card-header span {
        font-size: 12px;
    }
    
    .table th, .table td {
        font-size: 13px;
        padding: 0.35rem 0.4rem;
    }
    
    .table-title {
        font-size: 12px;
        padding: 8px 10px;
        height: 36px;
    }
}

/* 平板设备优化 */
@media (min-width: 577px) and (max-width: 991px) {
    .container-fluid {
        padding: 0;
    }
    
    body {
        padding-top: 0 !important;
    }
    
    .select-container {
        padding: 10px 15px;
        gap: 10px;
    }
    
    .select-container .form-group {
        flex: 0 0 auto;
    }
    
    .select-container .form-group label {
        font-size: 14px;
    }
    
    .select-container .form-group:first-child label {
        font-size: 15px;
    }
    
    .select-container .form-group select {
        width: 140px;
        min-width: unset;
        font-size: 14px;
    }
    
    .table-container {
        max-height: calc(100vh - 110px); /* 平板设备适中的预留空间 */
    }
    
    .course-checkboxes .form-check {
        font-size: 14px;
    }
    
    .course-checkboxes .form-check-label {
        font-size: 14px;
    }
    
    .modal-title {
        font-size: 14px;
    }
    
    .modal-body {
        font-size: 14px;
    }
    
    .modal-body .alert {
        font-size: 14px;
    }
    
    .selected-count {
        font-size: 14px;
    }
    
    .modal-footer .btn {
        font-size: 14px;
    }
    
    .card {
        border-radius: 0 0 6px 6px;  /* 平板设备使用中等大小的圆角 */
    }
    
    .card-header {
        padding: 11px;
    }
    .card-header span {
        font-size: 13px;
    }
    
    .table th, .table td {
        font-size: 14px;
        padding: 0.375rem 0.45rem;
    }
    
    .table-title {
        font-size: 13px;
        padding: 9px 12px;
        height: 38px;
    }
}

/* 大屏幕优化 */
@media (min-width: 992px) {
    .container-fluid {
        padding: 0;
    }
    
    body {
        padding-top: 0 !important;
    }
    
    .table-container {
        max-height: 600px; /* 大屏幕上的最大高度 */
    }
    
    .select-container .form-group label {
        font-size: 14px;
    }
    
    .select-container .form-group:first-child label {
        font-size: 16px;
    }
    
    .select-container .form-group select {
        width: 160px;
        font-size: 14px;
    }
    
    .course-checkboxes .form-check {
        font-size: 14px;
    }
    
    .course-checkboxes .form-check-label {
        font-size: 14px;
    }
}

/* 打印样式优化 */
@media print {
    .table-container {
        max-height: none;
        overflow: visible;
    }
    
    .no-print {
        display: none !important;
    }
    
    .table th {
        position: static;
    }
}

/* 表格列宽样式补充 */
.table th[style*="width: 50px"] {
    width: 50px !important;
    min-width: 50px !important;
}

.table th[style*="width: 60px"] {
    width: 60px !important;
    min-width: 60px !important;
}

.table th[style*="width: 80px"] {
    width: 80px !important;
    min-width: 80px !important;
}

/* 可排序表头样式 */
.sortable-header {
    cursor: pointer !important;
}

/* 表格容器显示控制 */
#student-table-container[style*="display: none"] {
    display: none !important;
}

/* 文本对齐补充 */
.text-center {
    text-align: center !important;
}

/* 表格内容垂直对齐 */
.table td.text-center {
    vertical-align: middle !important;
}

/* 卡片内边距补充 */
.card-body.p-0 {
    padding: 0 !important;
}

/* 表格边距补充 */
.table.mb-0 {
    margin-bottom: 0 !important;
}

/* 选中计数边距 */
.selected-count.mt-3 {
    margin-top: 1rem !important;
}

/* 模态框样式补充 */
.modal-dialog-scrollable {
    max-height: calc(100vh - 60px);
}

/* 加载动画样式 */
.fa-spinner.fa-spin {
    display: inline-block;
    animation: fa-spin 2s infinite linear;
}

/* 表格行悬停效果 */
.table-hover tbody tr:hover {
    background-color: rgba(0,0,0,.075);
}

/* 禁用元素样式 */
.form-control:disabled {
    background-color: #e9ecef;
    opacity: 1;
}

/* 关闭按钮样式 */
.close {
    float: right;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    opacity: .5;
}

.close:hover {
    color: #000;
    text-decoration: none;
    opacity: .75;
}

/* 表格内容布局补充 */
.table-container {
    position: relative;
    width: 100%;
}

/* 输入框组样式补充 */
.input-group-sm > .form-control {
    height: calc(1.5em + .5rem + 2px);
    padding: .25rem .5rem;
    font-size: .875rem;
    line-height: 1.5;
    border-radius: .2rem;
}

/* 警告提示样式补充 */
.alert-dismissible {
    padding-right: 4rem;
}

.alert-dismissible .close {
    position: absolute;
    top: 0;
    right: 0;
    padding: .75rem 1.25rem;
    color: inherit;
}

/* 模态框标题样式补充 */
.modal-title {
    margin-bottom: 0;
    line-height: 1.5;
}

/* 表单验证反馈补充 */
.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: .25rem;
    font-size: 80%;
    color: #dc3545;
}

.form-control.is-invalid ~ .invalid-feedback {
    display: block;
}

/* 背景色样式补充 */
.bg-light {
    background-color: #f8f9fa !important;
}

/* 文本颜色补充 */
.text-danger {
    color: #dc3545 !important;
}

.text-muted {
    color: #6c757d !important;
}

/* 边框样式补充 */
.border-0 {
    border: 0 !important;
}

/* 圆角样式补充 */
.rounded-0 {
    border-radius: 0 !important;
}

/* 阴影效果补充 */
.shadow-none {
    box-shadow: none !important;
}

/* 打印样式补充 */
@media print {
    .no-print {
        display: none !important;
    }
}

/* 课程等级设置页面样式 */
.form-loading {
    opacity: 0.6;
    pointer-events: none;
}

.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.grade-table {
    margin-top: 20px;
}

.delete-grade {
    color: #dc3545;
    cursor: pointer;
}

.delete-grade:hover {
    text-decoration: underline;
}

.table th {
    background-color: #f8f9fa;
}

/* 课程等级设置模态窗口样式 */
.modal-content {
    border: 1px solid rgba(0,0,0,.2);
    box-shadow: 0 3px 9px rgba(0,0,0,.5);
}

.modal-header {
    cursor: move;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
}

.modal-title {
    margin: 0;
    line-height: 1.5;
}

.modal-header .close {
    padding: 1rem;
    margin: -1rem -1rem -1rem auto;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    opacity: .5;
    cursor: pointer;
}

.modal-header .close:hover {
    opacity: .75;
}

.modal-backdrop {
    display: none;
}

.modal {
    background: transparent;
}

/* 侧边栏菜单图标与文字水平对齐 */
.nav-drawer > li > a > i {
    position: absolute;
    left: 15px;
    top: 50% !important;
    transform: translateY(-50%) !important;
    line-height: 1 !important;
}

.nav-drawer li a {
    line-height: 20px !important;
    display: flex;
    align-items: center;
} 