:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
}

/* 侧边栏激活状态 */
.nav-item.active {
    background-color: #eff6ff;
    color: #2563eb;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    margin: 0.25rem 0; /* 增加间距 */
    color: #4b5563;
    border-radius: 0.5rem;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-item:hover:not(.active) {
    background-color: #f3f4f6;
    color: #1f2937;
}

.nav-item i {
    width: 1.5rem;
    margin-right: 0.75rem;
    text-align: center; /* 图标对齐 */
}

/* 内容区域滚动优化 */
#content-area {
    height: calc(100vh - 64px); /* 减去顶栏高度 */
    overflow-y: auto;
    padding: 2rem;
    scrollbar-width: thin;
    scrollbar-color: #e5e7eb transparent;
}

#content-area::-webkit-scrollbar {
    width: 6px;
}

#content-area::-webkit-scrollbar-thumb {
    background-color: #e5e7eb;
    border-radius: 10px;
}

/* 通用表格样式优化 */
table {
    table-layout: fixed;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

td {
    border-bottom: 1px solid #f1f5f9;
}

tr:hover td {
    background-color: #f8fafc;
}

th, td {
    padding: 1rem 1.5rem;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 按钮悬浮效果提升 */
button {
    transition: transform 0.1s active;
}

button:active {
    transform: scale(0.98);
}

/* 卡片阴影增强 */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* 课表样式 */
.schedule-grid {
    display: grid;
    grid-template-columns: 80px repeat(7, minmax(0, 1fr));
    grid-auto-rows: 50px; /* 统一行高，从70px减小 */
    border-top: 1px solid #e5e7eb;
    border-left: 1px solid #e5e7eb;
    background-color: white;
}

.schedule-header {
    background-color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: #475569;
    border-bottom: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    padding: 0.5rem;
}

.schedule-cell {
    height: 50px; /* 固定高度，从70px减小 */
    padding: 2px;
    border-bottom: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    position: relative;
    overflow: hidden; /* 防止内容撑大格子 */
}

.course-card {
    background-color: #eff6ff;
    border-left: 3px solid #3b82f6;
    padding: 4px 6px;
    border-radius: 4px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.course-card .course-name {
    font-weight: 700;
    font-size: 0.75rem;
    color: #1e40af;
    line-height: 1.2;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.course-card .course-info {
    font-size: 0.65rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 弹窗动画 */
#modal-container.show {
    display: flex;
}

#modal-container.show #modal-content {
    transform: scale(1);
    opacity: 1;
}

/* 通知动画 */
.toast {
    animation: slideIn 0.3s ease-out forwards;
    pointer-events: auto;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.fade-out {
    animation: fadeOut 0.3s ease-in forwards;
}

@keyframes fadeOut {
    to {
        transform: translateY(-20px);
        opacity: 0;
    }
}
