:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: #171717;
  background: #f5f1e8;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  letter-spacing: 0;
}

.home-page {
  min-height: 100vh;
  background: #f5f1e8;
}

.home-main {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.course-entry {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  max-width: 100%;
  padding: 18px 22px;
  border: 1px solid #1d1d1d;
  border-radius: 6px;
  color: #171717;
  background: #fffdf8;
  font-size: clamp(20px, 5vw, 30px);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 6px 6px 0 #171717;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.course-entry:hover,
.course-entry:focus-visible {
  transform: translate(3px, 3px);
  box-shadow: 3px 3px 0 #171717;
  outline: none;
}

.course-icon {
  font-size: 1.25em;
}

.reader-page {
  height: 100vh;
  overflow: hidden;
  background: #f7f8fa;
}

.reader-header {
  height: 58px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid #d9dde3;
  background: #fff;
}

.reader-header h1 {
  margin: 0;
  overflow: hidden;
  font-size: 17px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.back-link {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #171717;
  font-size: 24px;
  text-decoration: none;
}

.downloads {
  position: relative;
}

.downloads summary {
  padding: 9px 12px;
  border: 1px solid #c7ccd2;
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  list-style: none;
  font-size: 14px;
}

.downloads summary::-webkit-details-marker {
  display: none;
}

.downloads nav {
  position: absolute;
  z-index: 10;
  top: calc(100% + 8px);
  right: 0;
  width: min(240px, calc(100vw - 32px));
  padding: 6px;
  border: 1px solid #d9dde3;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 12px 28px rgb(22 27 34 / 16%);
}

.downloads nav a {
  display: block;
  padding: 10px;
  border-radius: 4px;
  color: #171717;
  font-size: 14px;
  text-decoration: none;
}

.downloads nav a:hover,
.downloads nav a:focus-visible {
  background: #f0f2f5;
  outline: none;
}

.document-shell {
  height: calc(100vh - 58px);
}

.pdf-viewer {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.pdf-fallback {
  display: grid;
  min-height: 50vh;
  place-items: center;
  padding: 24px;
  text-align: center;
}

@media (max-width: 560px) {
  .reader-header {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 0 10px;
  }

  .reader-header h1 {
    font-size: 15px;
  }

  .downloads summary {
    padding-inline: 9px;
    font-size: 13px;
  }
}
