:root {
  color-scheme: light;
  --ink: #142b3c;
  --muted: #7b8790;
  --line: #dedfe1;
  --blue: #003f7b;
  --blue-soft: #eff8fd;
  --green: #59c34f;
  --green-soft: #eef9ed;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: #fff; }
button, a { font: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }

.app-shell { width: min(100%, 640px); min-height: 100vh; margin: 0 auto; padding: 16px 28px 88px; background: #fff; }
.notice { min-height: 34px; display: flex; align-items: center; gap: 8px; margin: 0 0 18px; padding: 7px 12px; color: #238c39; background: #eff9ed; border-radius: 7px; font-size: 12px; }
.notice-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #5ac95b; }

.day-heading { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.day-number { margin: 0 0 3px; font-size: 16px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; color: #0044a3; font-size: 26px; line-height: 1.25; }
h1 span { color: #4cbbff; font-size: 30px; }
h1.done { color: #65cf3c; }
.mascot { width: auto; height: 98px; flex: 0 0 auto; object-fit: contain; }
.mascot-button { position: relative; flex: 0 0 auto; padding: 0; border: 0; background: transparent; }
.mascot-button .mascot { display: block; }
.mascot-hint { position: absolute; z-index: 3; top: 50%; left: -60%; padding: 4px 16px; border: 1px solid #fcd34d; border-radius: 4px; background: #fef08abf; color: #1f2937; font-size: 10px; line-height: 1.5; white-space: nowrap; transform: translateY(-50%); }
.mascot-hint[hidden], .feature-card[hidden] { display: none; }

.feature-card { min-height: 70px; display: grid; grid-template-columns: 28px 1fr 18px; align-items: center; gap: 10px; margin: 13px 0 14px; padding: 12px 14px; border: 1px solid #dedfe1; border-radius: 12px; }
.feature-icon { color: #a1aab0; font-size: 20px; text-align: center; }
.feature-copy strong { display: block; margin-bottom: 4px; color: var(--blue); font-size: 14px; font-weight: 500; }
.feature-copy small { display: block; color: #536578; font-size: 11px; line-height: 1.4; }
.feature-arrow { color: #536578; font-size: 24px; text-align: right; }

.category-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 8px; color: #818991; font-size: 12px; }
#progressText { color: #8c9ba2; font-size: 11px; }
.exercise-list { display: grid; gap: 9px; }
.exercise-card { min-height: 58px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; transition: border-color .15s, background .15s; }
.exercise-card:hover { border-color: #a7c9dc; background: #fcfeff; }
.exercise-main { min-width: 0; display: grid; grid-template-columns: 25px minmax(0, 1fr); align-items: center; gap: 9px; }
.exercise-icon { width: 24px; height: 24px; }
.exercise-copy { min-width: 0; }
.exercise-type { display: none; }
.exercise-title { display: block; overflow: hidden; color: var(--blue); font-size: 14px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.exercise-card[data-done="false"] { border-color: #b8e4ff; background: #f7fcff; }
.exercise-card[data-done="false"]:hover { border-color: #a7d7e7; background: #eaf8fd; }
.exercise-status { display: grid; place-items: center; width: 28px; min-height: 37px; padding: 0; border: 0; background: transparent; }
.exercise-status img { width: 20px; height: 20px; }
.exercise-status.done { width: 40px; align-self: end; margin: -3px -2px -9px 0; }
.exercise-status.done img { width: 40px; height: 43px; }

.utility-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 15px; }
.utility-buttons a, .utility-buttons button { min-height: 34px; display: grid; place-items: center; padding: 5px 8px; border: 1px solid #e0e3e6; border-radius: 6px; background: #fafbfc; color: inherit; font: inherit; font-size: 11px; }
.utility-buttons a:hover, .utility-buttons button:hover { border-color: #b5d6e5; color: var(--blue); }
.completion-banner { display: flex; gap: 10px; align-items: center; margin-top: 17px; padding: 12px 0; color: #5aa44e; font-size: 12px; }
.completion-banner[hidden] { display: none; }
.completion-banner p { margin: 4px 0 0; color: #87969c; font-size: 10px; }
.completion-sparkle { color: #65c950; font-size: 20px; }

.schedule-section { margin-top: 38px; padding-top: 24px; border-top: 1px solid #edf0f2; scroll-margin-top: 16px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-heading h2 { margin-bottom: 6px; font-size: 19px; }
.section-heading p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.eyebrow { margin: 0 0 5px; color: var(--muted); font-size: 12px; }
.schedule-count { padding: 6px 10px; color: var(--blue); background: var(--blue-soft); border-radius: 6px; font-size: 12px; }
.module-legend { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0; }
.legend-chip { padding: 5px 8px; color: #5b6870; background: #f2f5f6; border-radius: 99px; font-size: 10px; }
.day-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.day-button { min-height: 47px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: white; text-align: center; }
.day-button span { display: block; font-size: 13px; font-weight: 600; }
.day-button small { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; }
.day-button.active { color: white; background: #39add4; border-color: #39add4; }
.day-button.active small { color: #e5f6fc; }
.day-button.complete:not(.active) { border-color: #b9e3bf; background: #f6fcf6; }
.day-button.complete:not(.active) small { color: #42964d; }
.day-button.menu:not(.active) { color: #805aa0; border-color: #ddcfeb; background: #f8f3fc; }
.day-button.menu:not(.active):not(.complete) small { color: #9375ac; }
.day-button.menu.active { border-color: #9b76bc; background: #9b76bc; }
.day-button.menu.active small { color: #f7efff; }
#calendarDialog { width: min(94vw, 580px); max-height: 90vh; padding: 20px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); }
#calendarDialog::backdrop { background: #142b3c66; }
.calendar-heading, .calendar-month { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.calendar-heading h2 { margin: 0; font-size: 20px; }
.calendar-heading button, .calendar-month button { border: 0; background: transparent; color: var(--blue); padding: 8px 12px; font-size: 24px; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; text-align: center; }
.calendar-weekdays { margin: 12px 0; color: var(--muted); font-size: 12px; }
.calendar-day { min-height: 52px; border: 1px solid #edf0f2; border-radius: 7px; background: white; color: var(--ink); }
.calendar-day small { display: block; min-height: 12px; font-size: 10px; color: #299bd0; }
.calendar-day.complete { background: var(--green-soft); }
.calendar-day.complete small { color: #368e40; }
.calendar-day.selected { border: 2px solid #4cbbff; }
.calendar-note { margin: 12px 0; font-size: 11px; color: var(--muted); }
#calendarRecords h3 { margin: 18px 0 10px; font-size: 14px; }
#calendarRecords p { font-size: 12px; color: var(--muted); }
.calendar-record { display: block; padding: 12px 0; border-bottom: 1px solid #edf0f2; font-size: 12px; line-height: 1.6; }

.bottom-nav { position: fixed; z-index: 2; left: 50%; bottom: 0; width: min(100%, 640px); display: grid; grid-template-columns: repeat(2, 1fr); padding: 7px 10px max(8px, env(safe-area-inset-bottom)); border-top: 1px solid #edf0f2; background: #fff; transform: translateX(-50%); }
.bottom-nav a { display: grid; justify-items: center; gap: 2px; color: #a2acb2; }
.bottom-nav a span { width: 32px; height: 27px; display: grid; place-items: center; border-radius: 50%; font-size: 19px; }
.bottom-nav small { font-size: 10px; }
.bottom-nav img { width: 20px; height: 20px; opacity: .55; }
.bottom-nav a.active { color: var(--blue); }
.bottom-nav a.active span { color: white; background: #36ace0; }
.bottom-nav a.active img { filter: brightness(0) invert(1); opacity: 1; }

.course-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0 28px; }
.course-list-heading p { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.course-list-heading img { width: 100px; height: 76px; object-fit: contain; }
.course-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.course-card { display: flex; flex-direction: column; padding: 16px 14px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.course-card.current { border-color: #b8e4ff; background: #f7fcff; }
.course-card:hover, .course-card:focus-visible { outline: 2px solid #b8e4ff; outline-offset: 3px; }
.course-card-heading { display: flex; align-items: center; gap: 8px; }
.course-card-heading img { width: 22px; height: 22px; flex: 0 0 auto; }
.course-card h2 { flex: 1; margin: 0; color: var(--blue); font-size: 17px; font-weight: 500; }
.course-current { padding: 4px 8px; border-radius: 5px; background: #e5f5ff; color: #299bd0; font-size: 11px; }
.course-description { flex: 1; margin: 12px 0; color: #536578; font-size: 12px; line-height: 1.6; }
.course-info { display: flex; flex-wrap: wrap; gap: 8px; }
.course-info span { padding: 5px 8px; border-radius: 5px; background: #f0f5f8; color: var(--muted); font-size: 11px; }
.course-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid #edf0f2; color: #299bd0; font-size: 12px; }
.course-card-footer > span:last-child { display: flex; align-items: center; gap: 4px; }
.course-card-footer img { width: 16px; height: 16px; }
.course-resource { display: block; margin-top: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 6px; color: var(--blue); font-size: 14px; }

@media (max-width: 520px) {
  .app-shell { padding: 14px 16px 82px; }
  .notice { margin-bottom: 14px; }
  .day-heading { min-height: 72px; }
  h1 { font-size: 24px; }
  .mascot { width: auto; height: 88px; }
  .feature-card { min-height: 66px; margin-top: 9px; padding: 10px; }
  .feature-copy small { font-size: 10px; }
  .exercise-card { min-height: 55px; padding: 8px 9px; }
  .exercise-title { font-size: 13px; }
  .exercise-status.done { margin-bottom: -8px; }
  .day-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 359px) {
  .course-list { grid-template-columns: 1fr; }
}
.effort-versions { display: flex; gap: 4px; margin-bottom: 18px; padding: 4px; border-radius: 8px; background: #f1f9fd; }
.effort-versions[hidden] { display: none; }
.effort-versions a { flex: 1; padding: 10px 4px; border-radius: 6px; color: #658392; text-align: center; text-decoration: none; font-size: 14px; }
.effort-versions a[aria-current="page"] { color: #fff; background: #4cbbff; }
