:root {
    --primary: #6c5ce7;
    --bg: #f8f9fd;
    --card-bg: #ffffff;
    --text: #2d3436;
    --border: #edf2f7;
    --header-h: 120px;
    --col-w: 100px;
    --row-h: 80px;
    --time-w: 60px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { 
    font-family: 'Noto Sans SC', sans-serif; 
    margin: 0; background: var(--bg); color: var(--text);
    height: 100vh; overflow: hidden;
}

/* 顶部毛玻璃导航 */
.glass-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    padding: 12px;
    border-bottom: 1px solid var(--border);
    position: fixed; top: 0; width: 100%; z-index: 1000;
}

.header-top { display: flex; justify-content: space-between; margin-bottom: 12px; }
#scheduleSelect {
    border: none; background: transparent; font-size: 1.2rem; font-weight: 700; outline: none;
}

.button-group { display: flex; gap: 8px; padding-bottom: 4px; overflow-x: auto; }
.button-group::-webkit-scrollbar { display: none; }
button {
    padding: 6px 14px; border-radius: 8px; border: none; font-size: 13px;
    background: #fff; border: 1px solid var(--border); cursor: pointer; white-space: nowrap;
}
button.primary { background: var(--primary); color: #fff; }
button.danger { color: #ff7675; }

/* 课表核心容器 */
.timetable-wrapper {
    margin-top: var(--header-h);
    height: calc(100vh - var(--header-h));
    overflow: auto;
}

.timetable-grid {
    display: grid;
    /* 第一列固定宽度，其余7列平分或固定 */
    grid-template-columns: var(--time-w) repeat(7, minmax(var(--col-w), 1fr));
    width: max-content;
    min-width: 100%;
}

/* 单元格基础样式 */
.cell {
    height: var(--row-h);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: #fff;
    display: flex; align-items: center; justify-content: center;
}

/* 顶部星期栏：随课表左右滑动，但上下滚动时固定在顶部 */
.week-header {
    position: sticky; top: 0; z-index: 100;
    background: #f1f2f6; font-weight: 700; font-size: 14px; color: #636e72;
}

/* 左侧时间列：随课表上下滑动，但左右滚动时固定在左侧 */
.time-cell {
    position: sticky; left: 0; z-index: 90;
    background: #f8f9fa; font-size: 12px; color: #b2bec3; font-weight: 500;
}

/* 左上角交叉点：双向固定 */
.corner-cell {
    position: sticky; top: 0; left: 0; z-index: 110;
    background: #f1f2f6;
}

textarea {
    width: 100%; height: 100%; border: none; padding: 8px;
    resize: none; font-size: 13px; text-align: center; background: transparent;
}
textarea[readonly] { pointer-events: none; }

/* 手机端适配 */
@media (max-width: 600px) {
    :root { --col-w: 85px; --row-h: 90px; --header-h: 110px; }
}