:root {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #24243b;
  background: #f8f8fc;
  font-size: 100%;
  --muted: #5d5e71;
  --line: #e3e2ec;
  --primary: #4c3e92;
  --focus: #6754bc;
  --error: #9d332d;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.shell { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }

.site-header {
  min-height: 86px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.wordmark { display: inline-flex; align-items: center; gap: 11px; font-size: 1rem; font-weight: 700; letter-spacing: .06em; }
.course-mark {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #42357f;
}
.course-mark::before, .course-mark::after {
  position: absolute;
  content: "";
  inset: 10px 6px;
  border: 1px solid #f1ebff;
  border-radius: 50%;
  transform: rotate(-32deg);
}
.course-mark::after { transform: rotate(32deg); }

.lookup-layout {
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  min-height: 510px;
  margin-top: clamp(2rem, 8vh, 5rem);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 14px 48px #2920460a;
}
.intro {
  position: relative;
  isolation: isolate;
  min-width: 0;
  padding: clamp(2rem, 5vw, 3.75rem);
  overflow: hidden;
  background-color: #eeecf9;
  background-image: radial-gradient(circle, #8073ba25 1px, transparent 1.2px), linear-gradient(148deg, #f1effa 15%, #ebe7fb 85%);
  background-size: 19px 19px, auto;
  background-position: center center;
}
.intro-copy { position: relative; z-index: 1; }
.intro h1, .results-heading h1 { font-size: clamp(2rem, 4.2vw, 3rem); font-weight: 750; line-height: 1.25; letter-spacing: -.045em; }
.intro p { margin-top: 1rem; color: #4d486a; font-size: 1rem; line-height: 1.75; }
.torus {
  position: absolute;
  width: 100%;
  height: 65%;
  bottom: 0;
  left: 0;
  pointer-events: none;
}

.lookup-panel { display: grid; align-content: center; padding: clamp(2rem, 5vw, 3.75rem); }
.panel-content { width: 100%; max-width: 25rem; margin-inline: auto; }
.panel-content h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: .5rem; }
.form-hint { color: var(--muted); line-height: 1.6; margin-bottom: 1.75rem; }
.field { margin-bottom: 1.125rem; }
.field label { display: block; font-size: .9375rem; font-weight: 650; margin-bottom: .5rem; }
.field input,
.field select {
  width: 100%;
  height: 49px;
  border: 1px solid #cfcfdd;
  border-radius: 8px;
  padding-inline: .875rem;
  color: inherit;
  background: #fff;
}
.field input::placeholder { color: #76778a; }
.field input:focus, .field select:focus { border-color: var(--focus); }
:focus-visible { outline: 3px solid #6754bc; outline-offset: 3px; }
.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: .6rem 1rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s ease;
}
.button-primary { color: #fff; background: var(--primary); }
.button-primary:hover { background: #3e317c; }
.button-secondary { background: #fff; color: #403482; border-color: #d9d4ec; }
.button-secondary:hover { background: #f1eefb; }
.button[disabled] { cursor: progress; opacity: .7; }
.find-button { width: 100%; min-height: 49px; margin-top: .25rem; }
.search-icon { position: relative; width: 13px; height: 13px; border: 1.5px solid currentColor; border-radius: 50%; margin-right: 3px; }
.search-icon::after { content: ""; position: absolute; width: 6px; height: 1.5px; border-radius: 1px; background: currentColor; top: 10px; left: 9px; transform: rotate(45deg); }
.form-error { margin-block: .25rem .75rem; padding: .625rem .875rem; border-radius: 7px; color: var(--error); background: #fff1ee; font-size: .9375rem; line-height: 1.55; }

.results-view { margin: clamp(2rem, 7vh, 4.25rem) auto 0; max-width: 920px; }
.results-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.results-heading h1 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); overflow-wrap: anywhere; }
.assignment-picker { width: 100%; max-width: 20rem; }
.select-wrap { position: relative; }
.select-wrap select { appearance: none; cursor: pointer; padding-right: 2.25rem; }
.select-wrap::after {
  position: absolute;
  top: calc(50% - 6px);
  right: .95rem;
  width: 8px;
  height: 8px;
  border: solid var(--primary);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  pointer-events: none;
  content: "";
}
.assignment, .empty-state { background: #fff; border: 1px solid var(--line); border-radius: 15px; }
.assignment { padding: 1.5rem; margin-bottom: 1rem; }
.assignment h2 { font-size: 1.25rem; line-height: 1.4; margin-bottom: .875rem; overflow-wrap: anywhere; }
.assignment-file { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1rem; border-top: 1px solid var(--line); padding-block: .75rem; }
.assignment-file:last-child { padding-bottom: 0; }
.file-label { font-weight: 650; }
.file-name { margin-top: .2rem; color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.file-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.file-actions .button { font-size: .875rem; padding-inline: .75rem; }
.file-status { color: var(--muted); font-size: .875rem; }
.empty-state { padding: clamp(1.5rem, 4vw, 2.75rem); }
.empty-state h2 { font-size: 1.25rem; }
.empty-state p { margin-top: .5rem; color: var(--muted); line-height: 1.65; }
.site-footer { margin-block: 2rem; padding-top: 1.125rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; line-height: 1.6; }

@media (max-width: 760px) {
  .shell { width: calc(100% - 32px); }
  .site-header { min-height: 67px; }
  .lookup-layout { grid-template-columns: 1fr; min-height: auto; margin-top: 1.25rem; border-radius: 16px; }
  .intro, .lookup-panel { padding: 1.5rem; }
  .intro { min-height: 155px; }
  .intro p { margin-top: .55rem; max-width: 21rem; }
  .torus { width: 60%; height: 120%; left: auto; right: -15%; bottom: -35%; opacity: .42; }
  .panel-content { max-width: 100%; }
  .site-footer { margin-block: 1.5rem; }
}

@media (max-width: 400px) {
  .intro, .lookup-panel, .assignment { padding: 1.25rem; }
  .assignment-file { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
}
