/* CYDO · 课程表 */

/* ===================== 周次选择（样式不变） ===================== */
.week-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scrollbar-width: thin;
}
.week-chip {
  flex: none;
  width: 56px;
  height: 62px;
  border-radius: 14px;
  border: 1.5px solid transparent;
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}
.week-chip:hover { transform: translateY(-1px); }
.week-chip .n { font-size: 17px; font-weight: 800; }
.week-chip .t { font-size: 11px; color: var(--text-3); }
.week-chip.active { border-color: var(--accent); background: rgba(107, 91, 210, 0.08); }
.week-chip.today .t { color: var(--accent); font-weight: 700; }

/* ===================== 课表表格 ===================== */
.table-scroll {
  overflow-x: auto;
  padding-bottom: 6px;
  margin-top: 8px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.timetable {
  width: 100%;
  min-width: 860px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

/* 表头：星期 + 日期 */
.timetable thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  padding: 12px 8px 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.timetable thead th .th-date {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
}

/* 今天那一列高亮 */
.timetable thead th.is-today {
  color: var(--accent);
}
.timetable thead th.is-today .th-date {
  color: var(--accent);
  font-weight: 700;
}

/* 第一列：时间 */
.timetable .col-time {
  width: 92px;
  min-width: 92px;
}

.timetable tbody th {
  padding: 10px 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  text-align: center;
  white-space: nowrap;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.timetable tbody th .time-end {
  display: block;
  margin-top: 1px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
}

/* 单元格 */
.timetable td {
  padding: 6px;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
  min-width: 104px;
  height: 56px;
}

.timetable tbody tr:last-child th,
.timetable tbody tr:last-child td {
  border-bottom: none;
}

/* 今天的列整体淡高亮 */
.timetable td.is-today {
  background: rgba(107, 91, 210, 0.035);
}

/* 课程块 */
.tt-course {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 7px 8px;
  border: none;
  border-left: 4px solid var(--c);
  border-radius: 10px;
  background: color-mix(in srgb, var(--c) 10%, #fff);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s;
}

.tt-course:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(17, 24, 39, 0.1);
}

.tt-course + .tt-course { margin-top: 4px; }

.tt-course .n {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}
.tt-course .l {
  font-size: 11px;
  color: var(--text-2);
  line-height: 1.3;
}
.tt-course .w {
  font-size: 10px;
  font-weight: 700;
  color: var(--c);
  margin-top: 1px;
}

/* 空格子：点击添加 */
.tt-empty-slot {
  width: 100%;
  height: 100%;
  min-height: 40px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: transparent;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.timetable td:hover .tt-empty-slot {
  background: var(--surface-2);
  color: var(--text-3);
}

/* 整周无课 */
.tt-blank {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

/* ===================== 节次列加强 ===================== */
.timetable tbody th {
  line-height: 1.35;
}

/* 不在任何节次里的课程，单独加一行，标个「加」 */
.timetable tbody tr.row-extra th {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface-2));
}

.period-extra-mark {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 0 4px;
  margin-right: 2px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
}

/* 跨节的课：格子撑满，内容靠上 */
.timetable td[rowspan] {
  vertical-align: top;
}

.timetable td[rowspan] .tt-course {
  height: auto;
}

@media (max-width: 860px) {
  .period-index { width: 44px; }
  .period-time { width: 96px; }
}
