body {
    background-color: #f8f9fa;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    transition: box-shadow 0.3s ease;
    overflow: visible;
}

.card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: #e9ecef;
    font-weight: 600;
    border-bottom: 1px solid #dee2e6;
}

.btn {
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.form-control,
.form-select {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
}

.table tbody tr {
    transition: background-color 0.3s ease;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.modal-content {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
}

.nav-tabs {
    border-bottom: 2px solid #dee2e6;
}

.nav-tabs .nav-link {
    color: #495057;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    color: #667eea;
    background-color: transparent;
}

.nav-tabs .nav-link.active {
    color: #667eea;
    background-color: white;
    border-bottom: 3px solid #667eea;
    font-weight: 600;
}

.tab-content {
    background: white;
    border: 1px solid #dee2e6;
    border-top: none;
    padding: 20px;
    border-radius: 0 0 0.375rem 0.375rem;
}

.alert {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pagination {
    margin-top: 20px;
}

.page-link {
    color: #667eea;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    margin: 0 0.25rem;
    transition: all 0.3s ease;
}

.page-link:hover {
    background-color: #667eea;
    border-color: #667eea;
    color: white;
}

.page-item.active .page-link {
    background-color: #667eea;
    border-color: #667eea;
}

.badge {
    padding: 0.5em 0.75em;
    border-radius: 0.375rem;
    font-weight: 500;
}

.dropdown-menu {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dropdown-item {
    padding: 0.5rem 1.25rem;
    transition: background-color 0.3s ease;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
}

.spinner-border {
    width: 1rem;
    height: 1rem;
}

.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.btn-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
}

.btn-gradient:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    color: white;
}

.shadow-sm {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.shadow-md {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.shadow-lg {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.rounded-lg {
    border-radius: 0.5rem;
}

.rounded-xl {
    border-radius: 0.75rem;
}

.transition-all {
    transition: all 0.3s ease;
}

.cursor-pointer {
    cursor: pointer;
}

.no-select {
    user-select: none;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.scrollbar-thin::-webkit-scrollbar {
    width: 6px;
}

.scrollbar-thin::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background: #555;
}

@media (max-width: 768px) {
    .card {
        margin-bottom: 1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* 基础设置 & 课程管理 - 美化样式 */
.system-card {
    border: none;
    border-radius: 0.75rem;
    overflow-x: hidden;
    overflow-y: visible;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease;
}

.system-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.system-card .card-header {
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #e9ecef;
}

.system-card .card-header i {
    font-size: 0.95rem;
}

.system-card .card-body {
    padding: 0.75rem 1rem;
}

.system-card .table thead th {
    font-size: 0.82rem;
    padding: 0.45rem 0.6rem;
    background-color: #fafbfc;
    border-bottom-width: 1px;
}

.system-card .table tbody td {
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
    vertical-align: middle;
}

.form-label-sm {
    font-size: 0.8rem;
    margin-bottom: 0;
}

/* 馆所概览统计卡片 */
.stat-card {
    border: none;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.stat-card.bg-gradient-primary {
    background: linear-gradient(135deg, #4e73df 0%, #6f42c1 100%);
}

.stat-card.bg-gradient-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.stat-card.bg-gradient-info {
    background: linear-gradient(135deg, #17a2b8 0%, #6610f2 100%);
}

.stat-card.bg-gradient-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    opacity: 0.9;
}

.stat-card .card-body {
    padding: 1rem;
}

.form-label.required::after {
    content: " *";
    color: #dc3545;
}

.class-table-wrapper {
    position: relative;
    overflow-x: auto;
    overflow-y: visible;
    width: 100%;
    max-height: none;
}

.class-table-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 10px;
}

.class-table-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.class-table-wrapper::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.class-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.class-table-container {
    overflow-y: auto;
    overflow-x: auto;
    max-height: calc(100vh - 280px - 180px);
    padding-bottom: 20px;
}

.class-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #f8f9fa;
}

.class-table {
    margin-bottom: 0;
    border-bottom: none;
}

.class-table td:first-child,
.class-table th:first-child {
    position: sticky;
    left: 0;
    z-index: 20;
    background-color: #f8f9fa;
    border-right: 2px solid #dee2e6;
}

.class-table thead th:first-child {
    z-index: 30;
}

/* 时间格子样式 - 每个15分钟格子高度30px */
.class-table > tbody > tr > td,
.class-table > thead > tr > th,
table.class-table td,
table.class-table th {
    height: 30px !important;
    min-height: 30px !important;
    padding: 2px 8px !important;
    box-sizing: border-box;
}

.time-slot {
    height: 30px !important;
    min-height: 30px !important;
    font-size: 12px !important;
    white-space: nowrap;
}

.class-table .class-cell-content {
    font-size: 0.75rem;
    line-height: 1.3;
}

.class-stats-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 180px;
    overflow-y: auto;
    overflow-x: hidden;
    border-top: 1px solid #dee2e6;
    background-color: #fff;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    padding: 10px 15px;
}

/* 自动填充只读字段样式 - 醒目版本 */
.readonly-field {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: 2px solid #4a50d6 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
    cursor: not-allowed;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4) !important;
    text-align: center;
}

.readonly-field::placeholder {
    color: rgba(255, 255, 255, 0.7) !important;
}

.readonly-field:focus {
    border-color: #4a50d6 !important;
    box-shadow: 0 0 0 0.3rem rgba(102, 126, 234, 0.4) !important;
    outline: none !important;
}

/* 自动填充字段标签样式 */
.auto-fill-label {
    color: #667eea !important;
    font-weight: 600 !important;
}

/* 课程教室多选卡片样式 */
.room-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.room-checkbox-item {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.room-checkbox-item:hover {
    background-color: #e8f0fe;
    border-color: #667eea;
}

.room-checkbox-item.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

.room-checkbox-item input[type="checkbox"] {
    display: none;
}

.room-checkbox-item .room-icon {
    margin-right: 6px;
    font-size: 0.9rem;
}

.room-checkbox-item .room-name {
    font-size: 0.85rem;
    font-weight: 500;
}

.room-checkbox-item .room-capacity {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-left: 4px;
}

.room-checkbox-item.selected .room-capacity {
    opacity: 0.9;
}

/* 只读字段变化时的闪烁动画 */
@keyframes fieldFlash {
    0% { background-color: #e8f0fe; }
    50% { background-color: #d4e5fc; }
    100% { background-color: #e8f0fe; }
}

.auto-fill {
    animation: fieldFlash 0.5s ease;
}