:root {
  color-scheme: light;
  --paper: #f6f4ed;
  --ink: #22221e;
  --muted: #646159;
  --line: #c9c5ba;
  --red: #ad3923;
  --serif: "Songti SC","STSong","Noto Serif CJK SC","SimSun",serif;
  --mono: "IBM Plex Mono",Consolas,"SFMono-Regular",monospace;
  --gutter: clamp(20px, 4.4vw, 80px);
  font-family: "PingFang SC","Microsoft YaHei","Noto Sans CJK SC",system-ui,sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.masthead { border-bottom: 1px solid var(--ink); }
.bar, .overview { max-width: 1512px; margin-inline: auto; padding-inline: var(--gutter); }
.bar { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.wordmark { display: inline-flex; align-items: center; gap: 12px; font-weight: 650; font-size: 15px; letter-spacing: .045em; white-space: nowrap; }
.word-divider { color: #a09b8c; margin-inline: 3px; }
.press-mark { height: 31px; width: 31px; background: url('/course-ui/press.svg') center / contain no-repeat; }
#assignments { display: flex; gap: clamp(10px, 2.1vw, 35px); align-self: stretch; align-items: stretch; }
#assignments a { display: flex; align-items: center; position: relative; gap: 5px; white-space: nowrap; font-size: 13px; }
#assignments a:hover, #assignments a[aria-current] { color: var(--red); }
#assignments a[aria-current]::after { position: absolute; inset: auto 0 -1px; border-bottom: 3px solid var(--red); content: ""; }
#assignments small { font: 11px var(--mono); }
body:not(.in-workspace) #assignments .experiment-link { display: none; }
.in-workspace { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.in-workspace .bar { min-height: 52px; }
.in-workspace .masthead { flex: none; }
#workspace { flex: 1; min-height: 0; }
#workspace iframe { width: 100%; height: 100%; border: 0; display: block; background: var(--paper); }
.overview {
  display: grid;
  grid-template-columns: minmax(325px, .82fr) minmax(0, 1.18fr);
  grid-template-rows: auto 1fr;
  gap: 42px clamp(44px, 6vw, 104px);
  padding-top: clamp(30px, 3.6vw, 62px);
  padding-bottom: 42px;
}
.intro { grid-area: 1 / 1; }
.intro h1 {
  font: 700 clamp(64px, 6.5vw, 104px)/1.07 var(--serif);
  letter-spacing: -.055em;
  margin: 0 0 20px -.04em;
}
.period { color: var(--red); }
.intro p { color: #504e46; font-size: 15px; line-height: 1.85; letter-spacing: .015em; margin: 0; }
.catalog { grid-area: 2 / 1; }
.index-heading, .proof-caption { display: flex; align-items: baseline; gap: 13px; }
.index-heading { justify-content: space-between; border-bottom: 2px solid var(--ink); padding-block: 4px 11px; }
.index-heading h2 { font-size: 15px; margin: 0; }
.index-heading span, .drag-note { color: var(--muted); font-size: 12px; }
#catalog-list { list-style: none; padding: 0; margin: 0; }
.entry {
  width: 100%; display: grid; grid-template-columns: 27px 47px 1fr auto; align-items: center;
  text-align: left; gap: 13px; background: transparent; color: var(--ink); border: 0;
  border-bottom: 1px solid var(--line); padding: 11px 6px; cursor: pointer;
}
.entry:hover { background: #eeeae0; }
.entry[aria-pressed="true"] .entry-number, .entry[aria-pressed="true"] .entry-arrow { color: var(--red); }
.entry[aria-pressed="true"] .entry-arrow { transform: none; opacity: 1; }
.entry-number { align-self: center; font: 13px var(--mono); color: var(--muted); }
.entry img { width: 47px; height: 47px; display: block; object-fit: cover; border: 1px solid #0002; }
.entry strong, .entry-meta { display: block; }
.entry strong { font: 700 clamp(17px, 1.4vw, 21px)/1.3 var(--serif); }
.entry-meta { font: 11px/1.4 var(--mono), "Microsoft YaHei", sans-serif; color: var(--muted); margin-top: 4px; }
.entry-arrow { font: 22px/1 system-ui,sans-serif; color: var(--muted); opacity: 0; }
.entry:hover .entry-arrow, .entry:focus-visible .entry-arrow { opacity: 1; }
.proof { grid-area: 1 / 2 / span 2; margin: 0; min-width: 0; align-self: start; }
.proof-mat { padding: clamp(10px, 1.5vw, 23px); background: #e6e3d9; border: 1px solid #c5c0b3; }
.comparison { --split: 42%; position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; background: #fff; }
.comparison img { width: 100%; height: 100%; position: absolute; inset: 0; display: block; object-fit: contain; }
.input-print { clip-path: inset(0 calc(100% - var(--split)) 0 0); }
.split-line { position: absolute; inset: 0 auto 0 var(--split); width: 2px; transform: translateX(-50%); background: var(--red); pointer-events: none; }
.split-handle { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 31px; height: 31px; border: 1px solid var(--red); display: grid; place-items: center; background: var(--paper); color: var(--red); border-radius: 50%; font: bold 16px/1 system-ui,sans-serif; }
.image-label { position: absolute; top: 10px; padding: 3px 8px; font-size: 12px; color: #fff; background: #282722de; }
.original { left: 10px; }
.processed { right: 10px; }
.comparison input { appearance: none; -webkit-appearance: none; position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; margin: 0; background: transparent; border: none; opacity: 0; cursor: ew-resize; touch-action: pan-y; }
.comparison input::-webkit-slider-thumb { -webkit-appearance: none; width: 1px; height: 1px; }
.comparison input::-moz-range-thumb { width: 1px; height: 1px; border: 0; }
.comparison:focus-within { outline: 2px solid var(--red); outline-offset: 3px; }
.proof figcaption { margin-top: 12px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.plate-number { font: 12px/1.4 var(--mono),sans-serif; white-space: nowrap; color: var(--red); }
.proof-caption h2 { font: 700 clamp(17px, 1.5vw, 23px)/1.35 var(--serif); margin: 0; }
.open-proof { display: inline-flex; gap: 20px; align-items: center; flex-shrink: 0; padding: 10px 16px; background: var(--ink); color: var(--paper); font-size: 14px; }
.open-proof:hover { background: var(--red); }
.open-proof span { font: 18px/1 system-ui,sans-serif; }
.load-error { grid-column: 1 / -1; }
@media (min-width: 1100px) and (max-height: 900px) {
  .overview { max-width: min(1512px, calc(138vh + 120px)); }
}
@media (max-width: 950px) {
  .overview { grid-template-columns: minmax(260px,.83fr) minmax(0,1.17fr); column-gap: 32px; row-gap: 28px; }
  .intro h1 { font-size: clamp(54px, 7.5vw, 74px); }
  .entry { gap: 8px; grid-template-columns: 23px 38px 1fr auto; padding-block: 9px; }
  .entry img { width: 38px; height: 38px; }
  .drag-note { display: none; }
}
@media (max-width: 670px) {
  :root { --gutter: 16px; }
  .bar { min-height: 50px; gap: 12px; }
  .press-mark { width: 24px; height: 24px; }
  .wordmark { gap: 8px; font-size: 13px; }
  .in-workspace .bar { min-height: 46px; }
  .in-workspace .wordmark > span:last-child { display: none; }
  #assignments { gap: 14px; }
  #assignments a { font-size: 12px; gap: 3px; }
  #assignments small { display: none; }
  .overview { display: flex; flex-direction: column; gap: 23px; padding-block: 24px 28px; }
  .intro h1 { font-size: clamp(36px,8.8vw,54px); line-height: 1.16; margin: 0 0 9px; }
  .intro h1 br { display: none; }
  .intro p { font-size: 13px; line-height: 1.65; }
  .intro p br { display: none; }
  .proof { width: 100%; }
  .proof-mat { padding: 9px; }
  .proof figcaption { margin-top: 9px; }
  .proof-caption { gap: 9px; }
  .open-proof { padding: 9px 12px; gap: 12px; font-size: 13px; }
  .entry { grid-template-columns: 25px 40px 1fr auto; gap: 10px; }
  .entry img { width: 40px; height: 40px; }
  .entry strong { font-size: 17px; }
}
@media (max-width: 360px) {
  #assignments { gap: 10px; }
  .proof-caption { flex-wrap: wrap; gap: 3px 7px; }
  .proof-caption h2 { font-size: 16px; }
}
