:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-synthesis: none;
  --ink: #172632;
  --muted: #61717d;
  --line: #dbe4e9;
  --soft-line: #eaf0f3;
  --paper: #ffffff;
  --canvas: #f4f7f9;
  --primary: #174f76;
  --primary-soft: #eaf4f8;
  --accent: #17867c;
  --complete: #56736f;
  --shadow: 0 10px 30px rgba(26, 54, 72, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, #edf4f7 0, var(--canvas) 220px),
    var(--canvas);
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.page-shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 28px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.12em;
}

h1 {
  margin: 0;
  font-size: clamp(1.65rem, 4vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.today-badge {
  flex: 0 0 auto;
  padding: 9px 13px;
  border: 1px solid rgba(23, 79, 118, 0.15);
  border-radius: 10px;
  color: var(--primary);
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
  font-weight: 650;
  backdrop-filter: blur(8px);
}

.week-panel {
  margin-bottom: 20px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.week-navigation {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) auto minmax(92px, 1fr);
  align-items: center;
  gap: 18px;
}

.nav-button,
.current-week-button {
  border: 0;
  cursor: pointer;
}

.nav-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  padding: 9px 11px;
  border-radius: 9px;
  color: var(--primary);
  background: transparent;
  font-size: 0.92rem;
  font-weight: 650;
}

.nav-button:last-child {
  justify-self: end;
}

.nav-button:hover,
.nav-button:focus-visible {
  background: var(--primary-soft);
  outline: none;
}

.week-heading {
  text-align: center;
}

.week-range {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 750;
}

.current-week-button {
  margin-top: 5px;
  padding: 3px 7px;
  border-radius: 6px;
  color: var(--accent);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 650;
}

.current-week-button[hidden] {
  display: none;
}

.current-week-button:hover,
.current-week-button:focus-visible {
  background: #e7f6f3;
  outline: none;
}

.progress-row {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr);
  align-items: center;
  gap: 18px;
  margin-top: 19px;
  padding-top: 17px;
  border-top: 1px solid var(--soft-line);
}

.progress-text {
  min-width: 108px;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf0;
}

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

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

.day-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
}

.day-card.is-today {
  border-color: rgba(23, 134, 124, 0.56);
  box-shadow: 0 0 0 2px rgba(23, 134, 124, 0.08);
}

.day-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.day-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 17px;
  border-bottom: 1px solid var(--soft-line);
  background: #fbfcfd;
}

.day-card.is-today .day-heading {
  background: #f0f8f7;
}

.day-heading h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
}

.day-date {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.today-label {
  margin-left: 7px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #0b6e66;
  background: #dff2ef;
  font-size: 0.73rem;
  font-weight: 700;
  vertical-align: 1px;
}

.course-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.course-item + .course-item {
  border-top: 1px solid var(--soft-line);
}

.course-label {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-height: 88px;
  padding: 16px 17px;
  cursor: pointer;
}

.course-label:hover {
  background: #f8fafb;
}

.course-label:has(input:focus-visible) {
  outline: 3px solid rgba(23, 79, 118, 0.18);
  outline-offset: -3px;
}

.course-check {
  appearance: none;
  width: 22px;
  height: 22px;
  margin: 0;
  border: 2px solid #9aaab4;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.course-check:checked {
  border-color: var(--accent);
  background-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' d='m5 10.3 3.1 3.1L15 6.7'/%3E%3C/svg%3E");
}

.course-main {
  min-width: 0;
}

.course-name {
  display: block;
  margin-bottom: 6px;
  overflow-wrap: anywhere;
  font-size: 1rem;
  font-weight: 720;
  line-height: 1.45;
}

.course-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.course-time {
  align-self: center;
  color: var(--primary);
  font-size: 0.86rem;
  font-weight: 720;
  white-space: nowrap;
}

.course-item.is-complete .course-name {
  color: var(--complete);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.course-item.is-complete .course-time,
.course-item.is-complete .course-meta {
  color: #81908e;
}

footer {
  padding: 22px 4px 0;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

footer p {
  margin: 0;
}

@media (max-width: 700px) {
  .page-shell {
    width: min(100% - 22px, 560px);
    padding-top: 24px;
  }

  .topbar {
    align-items: center;
    margin-bottom: 20px;
  }

  .today-badge {
    font-size: 0.78rem;
  }

  .week-panel {
    padding: 17px 14px;
    border-radius: 15px;
  }

  .week-navigation {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 8px;
  }

  .nav-button {
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 1.15rem;
  }

  .nav-button span:not([aria-hidden="true"]) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .week-range {
    font-size: 0.96rem;
  }

  .progress-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .schedule {
    grid-template-columns: 1fr;
  }

  .day-card:last-child:nth-child(odd) {
    grid-column: auto;
  }

  .course-label {
    grid-template-columns: 24px minmax(0, 1fr);
    min-height: 92px;
  }

  .course-time {
    grid-column: 2;
    grid-row: 2;
    margin-top: -5px;
  }
}

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