/* 课表页样式 - 周视图网格 */

/* 覆盖 common.css 的 body padding-bottom，课表页自己管理高度 */
body {
    padding-bottom: 0 !important;
    margin: 0 !important;
    background: #fff;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ====== 顶部栏：周切换 + 操作按钮 ====== */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
    z-index: 20;
}

.week-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.week-nav i {
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.15s;
}

.week-nav i:hover {
    background: #f3f4f6;
}

.week-label {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    cursor: pointer;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.top-actions i {
    font-size: 15px;
    color: #6b7280;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 8px;
    transition: background 0.15s;
}

.top-actions i:hover {
    background: #f3f4f6;
    color: #374151;
}

/* 悬浮菜单 */
.floating-menu {
    position: fixed;
    top: 52px;
    right: 12px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    padding: 6px 0;
    z-index: 1000;
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.floating-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.floating-menu .menu-item {
    display: flex;
    align-items: center;
    padding: 11px 18px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.floating-menu .menu-item:hover {
    background: #f9fafb;
}

.floating-menu .menu-item i {
    font-size: 15px;
    color: #374151;
    margin-right: 10px;
    width: 18px;
    text-align: center;
}

.floating-menu .menu-item span {
    font-size: 14px;
    color: #374151;
}

/* ====== 课表网格 - CSS Grid ====== */
.timetable-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    min-height: 0;
}

/* 星期头 */
.timetable-header {
    display: grid;
    grid-template-columns: 40px repeat(7, 1fr);
    background: #fff;
    border-bottom: 2px solid #e5e7eb;
    flex-shrink: 0;
}

.th-corner {
    border-right: 1px solid #e5e7eb;
}

.th-day {
    text-align: center;
    padding: 6px 0 4px;
    border-right: 1px solid #f0f0f0;
}

.th-day:last-child {
    border-right: none;
}

.th-day.today .th-day-name {
    color: #4F6EF7;
    font-weight: 600;
}

.th-day.today .th-date {
    background: #4F6EF7;
    color: #fff;
    border-radius: 10px;
    display: inline-block;
    min-width: 22px;
    padding: 0 4px;
    line-height: 18px;
}

.th-day-name {
    font-size: 11px;
    color: #9ca3af;
    margin-bottom: 1px;
}

.th-date {
    font-size: 12px;
    color: #374151;
    font-weight: 500;
}

/* 课表网格主体 - 可滚动区域 */
.timetable-grid {
    display: grid;
    grid-template-columns: 40px repeat(7, 1fr);
    grid-template-rows: repeat(12, 56px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    background: #fff;
}

/* 左侧节次列 */
.sec-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
    grid-column: 1;
}

.sec-num {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    line-height: 1;
}

.sec-time-start {
    font-size: 6px;
    color: #b0b0b0;
    margin-top: 1px;
    line-height: 1;
    text-align: center;
}

.sec-time-end {
    font-size: 6px;
    color: #b0b0b0;
    line-height: 1;
    text-align: center;
}

/* 每个格子（无课程时） */
.grid-cell {
    border-right: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    background: #fafbfc;
}

/* 课程色块 - 跨行显示 */
.course-block {
    background: var(--c2);
    border-left: 3px solid var(--c1);
    border-radius: 0 6px 6px 0;
    padding: 4px 6px;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: opacity 0.15s;
    z-index: 5;
    box-sizing: border-box;
    border-right: none;
    border-bottom: none;
}

.course-block:active {
    opacity: 0.75;
}

.cb-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--c1);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all;
}

.cb-location {
    font-size: 10px;
    color: rgba(0,0,0,0.45);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cb-teacher {
    font-size: 10px;
    color: rgba(0,0,0,0.45);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ====== 课程详情弹窗 ====== */
.course-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.course-modal.show {
    opacity: 1;
    visibility: visible;
}

.course-modal-content {
    background: #fff;
    border-radius: 16px;
    width: 85%;
    max-width: 340px;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.25s ease;
}

.course-modal.show .course-modal-content {
    transform: scale(1);
}

.cmd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #f0f0f0;
}

.cmd-name {
    font-size: 17px;
    font-weight: 600;
    color: #1f2937;
}

.cmd-close {
    font-size: 18px;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
}

.cmd-body {
    padding: 16px 20px 20px;
}

.cmd-row {
    display: flex;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    color: #4b5563;
}

.cmd-row i {
    width: 24px;
    color: #9ca3af;
    margin-right: 10px;
    text-align: center;
    font-size: 14px;
}

/* 提示信息 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(17, 24, 39, 0.85);
    color: white;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 1001;
    animation: fadeIn 0.2s ease;
    backdrop-filter: blur(4px);
}

/* 底部导航在课表页也保持毛玻璃悬浮样式 */
.bottom-nav {
    position: fixed !important;
    bottom: 16px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: rgba(255, 255, 255, 0.72) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-radius: 24px !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08), 0 0 1px rgba(0, 0, 0, 0.1) !important;
    flex-shrink: 0;
    min-width: 220px;
    max-width: 300px;
    height: 56px;
    padding: 8px 24px 6px !important;
    margin: 0 !important;
}
