:root {
  --sidebar-width: 264px;
  --ink: #27262b;
  --muted: #66636d;
  --faint: #8c8992;
  --line: #dedce3;
  --line-strong: #c9c6d0;
  --paper: #ffffff;
  --sidebar: #f5f6fa;
  --soft: #f8f8fb;
  --purple: #5c3c92;
  --purple-dark: #45276f;
  --purple-soft: #eee8f7;
  --green: #2f7a5c;
  --shadow: 0 10px 30px rgba(35, 24, 54, 0.07);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 78px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.65;
}

a { color: var(--purple); }
a:hover { color: var(--purple-dark); }
button, input { font: inherit; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 12px;
  padding: 8px 12px;
  background: var(--purple-dark);
  color: #fff;
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
}

.brand {
  min-height: 118px;
  display: flex;
  align-items: center;
  padding: 28px 27px 24px;
  border-bottom: 1px solid var(--line);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  background: var(--purple);
  color: #fff;
  border-radius: 5px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: -1px;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.25;
}

.brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.menu-button { display: none; }

.side-nav {
  padding: 20px 0;
}

.nav-link {
  position: relative;
  display: block;
  padding: 10px 28px;
  color: #4d4a53;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.nav-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 3px;
  background: transparent;
}

.nav-link:hover,
.nav-link.active {
  color: var(--purple);
  background: #eeedf3;
}

.nav-link.active::before { background: var(--purple); }

.sidebar-footer {
  margin-top: auto;
  padding: 24px 28px 28px;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--line);
}

.sidebar-footer p { margin: 0 0 3px; color: var(--faint); }
.sidebar-footer strong,
.sidebar-footer span { display: block; }
.sidebar-footer strong { color: var(--ink); }

.page { margin-left: var(--sidebar-width); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 0 clamp(28px, 5vw, 72px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.search {
  width: min(330px, 40vw);
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--faint);
}

.search span {
  font-size: 21px;
  line-height: 1;
  transform: rotate(-15deg);
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
}

.search input::placeholder { color: #9a97a0; }

.top-links {
  display: flex;
  align-items: center;
  gap: 22px;
  white-space: nowrap;
}

.top-links a {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.top-links a:last-child {
  padding: 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--purple);
}

#main-content {
  width: min(1120px, calc(100% - 64px));
  margin: 0 auto;
  padding: 0 0 48px;
}

.anchor-section { scroll-margin-top: 84px; }

.hero {
  padding: 66px 0 52px;
  border-bottom: 1px solid var(--line-strong);
}

.eyebrow,
.kicker,
.card-label {
  margin: 0;
  color: var(--purple);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

h1, h2, h3 {
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  color: #242128;
}

h1 {
  max-width: 760px;
  margin: 10px 0 14px;
  font-size: clamp(42px, 6vw, 68px);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.lead {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  max-width: 780px;
  margin-top: 38px;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.hero-meta div {
  padding: 14px 18px;
  border-right: 1px solid var(--line);
}

.hero-meta div:last-child { border-right: 0; }
.hero-meta span, .hero-meta strong { display: block; }
.hero-meta span { color: var(--faint); font-size: 11px; }
.hero-meta strong { margin-top: 2px; font-size: 13px; }

section:not(.hero) { padding-top: 50px; }

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.section-heading h2 {
  margin: 3px 0 0;
  font-size: 29px;
  line-height: 1.2;
}

.notice-list {
  border-top: 1px solid var(--line-strong);
}

.notice-list article {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 22px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.notice-list time {
  color: var(--purple);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.notice-list h3 {
  margin: -3px 0 3px;
  font-size: 16px;
}

.notice-list p { margin: 0; color: var(--muted); font-size: 13px; }

.progress-card {
  width: 230px;
  padding: 12px 14px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.progress-card > div:first-child {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}

.progress-card strong { font-size: 12px; }

.progress-track {
  height: 4px;
  margin: 8px 0 6px;
  overflow: hidden;
  background: #e2dfea;
  border-radius: 20px;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--green);
  transition: width 180ms ease;
}

.progress-card button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  font-size: 10px;
}

.progress-card button:hover { color: var(--purple); }

.schedule-note {
  margin-bottom: 14px;
  padding: 11px 14px;
  background: var(--purple-soft);
  color: #534761;
  border-left: 3px solid var(--purple);
  font-size: 12px;
}

.table-scroll {
  overflow-x: auto;
  border-top: 2px solid var(--purple);
}

.calendar {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  table-layout: fixed;
}

.calendar th {
  padding: 10px 12px;
  background: #f3f2f6;
  color: #55515c;
  border-bottom: 1px solid var(--line-strong);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
}

.calendar th:nth-child(1) { width: 7%; }
.calendar th:nth-child(2) { width: 11%; }
.calendar th:nth-child(3) { width: 35%; }
.calendar th:nth-child(4) { width: 21%; }
.calendar th:nth-child(5) { width: 21%; }
.calendar th:nth-child(6) { width: 5%; text-align: center; }

.calendar td {
  padding: 13px 12px;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.calendar tbody tr:nth-child(even) { background: #fbfbfd; }
.calendar tbody tr:hover { background: #f6f3fa; }
.calendar tbody tr.week-start td { border-top: 2px solid #cfc9d8; }
.calendar tbody tr.is-complete { opacity: 0.62; }
.calendar tbody tr.is-complete .topic-title { text-decoration: line-through; }

.week-cell {
  color: var(--purple);
  font-weight: 700;
  white-space: nowrap;
}

.date-cell {
  color: var(--muted);
  white-space: nowrap;
}

.week-cell {
  background: #f3f2f6;
  border-right: 1px solid var(--line);
  text-align: center;
  vertical-align: middle !important;
}

.topic-title {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-weight: 650;
  font-size: 13px;
}

.topic-subtitle { color: var(--faint); font-size: 11px; }

.material-links {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.material-links a,
.card-links a {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  background: #fff;
  color: var(--purple);
  border: 1px solid #cec5dc;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 650;
  text-decoration: none;
}

.material-links a:hover,
.card-links a:hover {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
}

.lecture-note-link,
.lecture-note-pending {
  display: inline-flex;
  align-items: center;
  margin-top: 7px;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
}

.lecture-note-link {
  color: #fff;
  border: 1px solid var(--green);
  background: var(--green);
}

.lecture-note-link:hover {
  color: #fff;
  background: #245f48;
}

.lecture-note-pending {
  color: var(--faint);
  border: 1px dashed var(--line-strong);
  background: var(--soft);
}

.discussion-cell,
.coursework-cell { color: #56525b; }

.workstream-cell {
  position: relative;
  padding: 0 6px !important;
}

.coursework-fallback {
  padding: 13px 6px;
}

.workstream-stack {
  position: absolute;
  inset: 0 6px;
  display: flex;
  flex-direction: column;
}

.workstream-block {
  flex: 1 1 0;
  display: flex;
  min-height: 68px;
  flex-direction: column;
  justify-content: center;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-top-width: 0;
  border-bottom-width: 0;
  border-radius: 0;
  color: inherit;
  text-decoration: none;
}

.workstream-block.is-start {
  margin-top: 6px;
  border-top-width: 1px;
  border-radius: 6px 6px 0 0;
}

.workstream-block.is-end {
  margin-bottom: 6px;
  border-bottom-width: 1px;
  border-radius: 0 0 6px 6px;
}

.workstream-block.is-start.is-end {
  border-radius: 6px;
}

.workstream-block strong {
  color: inherit;
  font-size: 11px;
  line-height: 1.35;
}

.workstream-block small {
  display: block;
  margin-top: 4px;
  color: inherit;
  font-size: 9px;
  line-height: 1.35;
  opacity: .78;
}

.workstream-block > span {
  margin-top: 5px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 8px;
  letter-spacing: .03em;
  opacity: .62;
}

.workstream-block.is-homework {
  color: #245b49;
  background: #dff2ea;
  border-color: #9dcfbc;
}

.workstream-block.is-project {
  color: #623a84;
  background: #ece3f5;
  border-color: #c8b2dc;
}

.workstream-block:hover {
  color: inherit;
  filter: brightness(.97);
}

.cell-note {
  display: block;
  margin-top: 4px;
  color: var(--faint);
  font-size: 10px;
}

.done-column,
.done-cell { text-align: center !important; }

.done-cell input {
  width: 15px;
  height: 15px;
  accent-color: var(--green);
  cursor: pointer;
}

.empty-state {
  padding: 24px;
  background: var(--soft);
  color: var(--muted);
  text-align: center;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.assignment-card,
.project-card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 5px;
  box-shadow: 0 0 0 rgba(0,0,0,0);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.assignment-card:hover,
.project-card:hover {
  transform: translateY(-2px);
  border-color: #c9bed8;
  box-shadow: var(--shadow);
}

.assignment-card { padding: 18px 16px 16px; }

.assignment-card .card-number,
.project-card .card-number {
  color: #c4bdca;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  line-height: 1;
}

.assignment-card h3 {
  min-height: 48px;
  margin: 15px 0 12px;
  font-size: 15px;
  line-height: 1.35;
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.project-card {
  min-height: 245px;
  padding: 25px 26px;
  overflow: hidden;
}

.project-card .card-number {
  position: absolute;
  top: 22px;
  right: 25px;
  font-size: 48px;
  color: #ece9ef;
}

.project-card h3 {
  max-width: 75%;
  margin: 18px 0 10px;
  font-size: 22px;
  line-height: 1.25;
}

.project-card > p:not(.card-label) {
  max-width: 86%;
  min-height: 52px;
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
}

.quick-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line);
}

.quick-links a {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 18px 20px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.quick-links a:hover { background: var(--soft); }
.quick-links strong { min-width: 43px; color: var(--purple); font-size: 16px; }
.quick-links span { color: var(--muted); font-size: 12px; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 58px;
  padding-top: 20px;
  color: var(--faint);
  border-top: 1px solid var(--line);
  font-size: 11px;
}

footer p { margin: 0; }
footer a { text-decoration: none; }

@media (max-width: 1020px) {
  .resource-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 780px) {
  :root { --sidebar-width: 0px; }

  .sidebar {
    right: 0;
    bottom: auto;
    width: 100%;
    min-height: 64px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand {
    min-height: 64px;
    justify-content: space-between;
    padding: 9px 18px;
  }

  .brand-mark { width: 38px; height: 38px; }
  .brand strong { font-size: 17px; }

  .menu-button {
    width: 40px;
    height: 40px;
    display: grid;
    place-content: center;
    gap: 4px;
    border: 0;
    background: transparent;
    cursor: pointer;
  }

  .menu-button span {
    width: 20px;
    height: 2px;
    display: block;
    background: var(--ink);
  }

  .side-nav {
    display: none;
    padding: 8px 0 14px;
    border-top: 1px solid var(--line);
  }

  .sidebar.open .side-nav { display: block; }
  .sidebar-footer { display: none; }
  .page { margin: 64px 0 0; }
  .topbar { position: static; min-height: 58px; padding: 0 18px; }
  .top-links a:first-child { display: none; }
  .search { width: 58%; }
  #main-content { width: min(100% - 36px, 1120px); }
  .hero { padding-top: 42px; }
  h1 { font-size: clamp(38px, 12vw, 58px); }
  .hero-meta { grid-template-columns: 1fr; }
  .hero-meta div { border-right: 0; border-bottom: 1px solid var(--line); }
  .hero-meta div:last-child { border-bottom: 0; }
  .section-heading.split { align-items: flex-start; }
  .resource-grid { grid-template-columns: repeat(2, 1fr); }
  .project-grid { grid-template-columns: 1fr; }
  .quick-links { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .top-links a:last-child { padding: 6px 8px; font-size: 10px; }
  .lead { font-size: 15px; }
  section:not(.hero) { padding-top: 42px; }
  .section-heading.split { display: block; }
  .progress-card { width: 100%; margin-top: 14px; }
  .notice-list article { grid-template-columns: 62px 1fr; gap: 12px; }
  .resource-grid { grid-template-columns: 1fr; }
  .assignment-card h3 { min-height: 0; }
  .quick-links { grid-template-columns: 1fr; }
  footer { display: block; }
  footer a { display: block; margin-top: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
