:root {
  --ink: #203230;
  --muted: #788480;
  --line: #dfe6df;
  --paper: #edf1ed;
  --paper-soft: #f3f5f2;
  --surface: #fbfcfa;
  --forest: #245b55;
  --forest-deep: #194844;
  --shadow: 0 14px 38px rgba(27, 59, 52, .07);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 8% -8%, rgba(90, 145, 125, .11), transparent 30rem),
    radial-gradient(circle at 98% 16%, rgba(235, 213, 154, .12), transparent 24rem),
    linear-gradient(180deg, #edf1ed, #f1f4f1 55%, #f4f6f3);
  color: var(--ink);
}

button,
select {
  font: inherit;
}

button {
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(198, 210, 200, .72);
  background: rgba(244, 247, 243, .88);
  backdrop-filter: blur(18px) saturate(1.15);
}

.topbar-inner {
  display: flex;
  width: min(1280px, calc(100% - 40px));
  min-height: 78px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  color: #f7fbf8;
  background: linear-gradient(145deg, #326f67, #1d4d48);
  box-shadow: 0 8px 20px rgba(29, 77, 72, .18);
  font-size: 15px;
  font-weight: 520;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 520;
  letter-spacing: -.025em;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-wrap: pretty;
}

.week-chip {
  padding: 7px 11px;
  border: 1px solid #cad8ce;
  border-radius: 999px;
  color: #275a53;
  background: rgba(231, 241, 234, .9);
  font-size: 11px;
  font-weight: 450;
  white-space: nowrap;
}

main {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 32px;
}

.week-toolbar {
  display: grid;
  align-items: center;
  grid-template-columns: 42px minmax(0, 1fr) 42px auto;
  gap: 10px;
  margin-bottom: 16px;
  padding: 13px 15px;
  border: 1px solid rgba(213, 222, 213, .92);
  border-radius: 17px;
  background: rgba(251, 252, 250, .82);
  box-shadow: var(--shadow);
}

.week-arrow {
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 1px solid #dce5dc;
  border-radius: 12px;
  color: #5d7169;
  background: #f7f9f6;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.week-arrow:hover {
  color: var(--forest);
  border-color: #bdcec2;
}

.week-arrow:disabled {
  opacity: .32;
  cursor: default;
}

.week-current {
  display: grid;
  align-items: center;
  grid-template-columns: auto auto 1fr;
  gap: 10px;
}

.week-kicker {
  color: #809087;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .14em;
}

.week-select-wrap {
  display: inline-flex;
}

.week-select-wrap select {
  min-height: 34px;
  padding: 0 28px 0 10px;
  border: 1px solid #dbe4db;
  border-radius: 9px;
  outline: none;
  color: var(--ink);
  background: #f8faf7;
  font-size: 13px;
  font-weight: 470;
}

.week-select-wrap select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(36, 91, 85, .1), 0 0 0 6px rgba(36, 91, 85, .035);
}

.week-dates {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.current-week-button {
  padding: 8px 11px;
  border: 1px solid #c8d8cb;
  border-radius: 9px;
  color: #2c635b;
  background: #eef5ef;
  font-size: 11px;
  cursor: pointer;
}

.week-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.day-column {
  display: flex;
  min-height: 430px;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(215, 224, 216, .88);
  border-radius: 16px;
  background: rgba(250, 252, 249, .78);
  box-shadow: 0 7px 22px rgba(33, 62, 55, .035);
}

.day-column.is-today {
  border-color: rgba(80, 133, 114, .45);
  box-shadow:
    0 0 0 3px rgba(52, 111, 95, .06),
    0 12px 30px rgba(33, 62, 55, .07);
}

.day-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  padding: 13px 12px 11px;
  border-bottom: 1px solid rgba(220, 227, 220, .82);
}

.day-heading strong {
  font-size: 12px;
  font-weight: 500;
}

.day-heading span {
  color: var(--muted);
  font-size: 9px;
}

.is-today .day-heading {
  color: var(--forest);
  background: rgba(228, 240, 231, .62);
}

.course-stack {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 9px;
}

.course-card {
  position: relative;
  padding: 12px 11px 12px 14px;
  overflow: hidden;
  border: 1px solid rgba(213, 222, 213, .8);
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .94), rgba(247, 249, 246, .9)),
    #fbfcfa;
}

.course-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent, #5c8f7b);
  content: "";
}

.course-time {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  margin-bottom: 7px;
  color: #6f8178;
  font-size: 9px;
}

.course-time b {
  color: var(--accent, #4c7969);
  font-weight: 560;
}

.course-card h3 {
  margin: 0 0 8px;
  color: #253935;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  text-wrap: pretty;
}

.course-meta {
  display: grid;
  gap: 4px;
  color: #75827d;
  font-size: 9px;
  line-height: 1.45;
}

.course-meta span {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  text-wrap: pretty;
}

.course-meta i {
  width: 4px;
  height: 4px;
  margin-top: .45em;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #9dad9f;
}

.empty-day {
  display: grid;
  flex: 1;
  min-height: 150px;
  place-items: center;
  padding: 20px;
  color: #a3ada7;
  font-size: 10px;
}

.page-footer {
  display: flex;
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0 2px calc(24px + env(safe-area-inset-bottom));
  justify-content: space-between;
  gap: 16px;
  color: #8b9791;
  font-size: 9px;
}

@media (max-width: 1050px) {
  .week-board {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .day-column {
    min-height: 250px;
  }
}

@media (max-width: 700px) {
  body {
    padding-bottom: 8px;
  }

  .topbar-inner {
    width: calc(100% - 28px);
    min-height: 66px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  .brand h1 {
    font-size: 16px;
  }

  .brand p {
    font-size: 10px;
  }

  .week-chip {
    padding: 6px 9px;
    font-size: 10px;
  }

  main {
    width: calc(100% - 24px);
    padding-top: 14px;
  }

  .week-toolbar {
    position: sticky;
    top: 74px;
    z-index: 10;
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    gap: 7px;
    margin-bottom: 11px;
    padding: 9px;
    border-radius: 14px;
  }

  .week-arrow {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 21px;
  }

  .week-current {
    grid-template-columns: auto 1fr;
    gap: 7px;
  }

  .week-kicker {
    display: none;
  }

  .week-dates {
    grid-column: 1 / -1;
    font-size: 9px;
  }

  .week-select-wrap select {
    min-height: 31px;
    font-size: 12px;
  }

  .current-week-button {
    grid-column: 1 / -1;
    justify-self: end;
    padding: 5px 8px;
    font-size: 9px;
  }

  .week-board {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .day-column {
    min-height: 0;
    border-radius: 14px;
  }

  .day-heading {
    padding: 11px 13px;
  }

  .day-heading strong {
    font-size: 13px;
  }

  .day-heading span {
    font-size: 10px;
  }

  .course-stack {
    gap: 7px;
    padding: 8px;
  }

  .course-card {
    padding: 13px 13px 13px 16px;
  }

  .course-time {
    margin-bottom: 8px;
    font-size: 10px;
  }

  .course-card h3 {
    margin-bottom: 9px;
    font-size: 15px;
  }

  .course-meta {
    grid-template-columns: 1fr 1fr;
    gap: 7px 12px;
    font-size: 10px;
  }

  .empty-day {
    min-height: 70px;
    padding: 14px;
    font-size: 10px;
  }

  .page-footer {
    width: calc(100% - 28px);
    flex-direction: column;
    gap: 4px;
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
