/* Atum study-room theme: scoped to non-exam chrome and the main library home. */
body:not(.is-exam-view) {
  background: #e8edf1;
  color: #27211d;
}

body:not(.is-exam-view) .sidebar {
  grid-template-columns: minmax(290px, 0.72fr) minmax(510px, 1fr) minmax(150px, 0.42fr);
  gap: 18px;
  width: min(2160px, calc(100% - clamp(36px, 4vw, 72px)));
  min-height: 76px;
  margin: 18px auto 0;
  padding: 10px 18px;
  border: 0;
  border-radius: 8px;
  background: #2b2725;
  color: #ffffff;
  box-shadow: 0 4px 8px rgba(39, 33, 29, 0.16);
}

body:not(.is-exam-view) .brand {
  gap: 12px;
}

body:not(.is-exam-view) .brand-mark {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 7px;
  background: #ad4438;
  color: #ffffff;
  box-shadow: none;
  font-size: 23px;
}

body:not(.is-exam-view) .brand strong {
  max-width: none;
  color: #ffffff;
  font-size: 21px;
  line-height: 1.12;
}

body:not(.is-exam-view) .brand-copy > span {
  color: #d8d1ca;
  font-size: 12px;
  font-weight: 700;
}

body:not(.is-exam-view) .nav-list {
  gap: 7px;
}

body:not(.is-exam-view) .nav-item {
  min-width: 82px;
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #d8d1ca;
  font-size: 13px;
  font-weight: 800;
}

body:not(.is-exam-view) .nav-item:hover {
  background: #3a3431;
  color: #ffffff;
  transform: none;
}

body:not(.is-exam-view) .nav-item.active {
  background: #ad4438;
  color: #ffffff;
}

body:not(.is-exam-view) .nav-item:focus-visible,
body:not(.is-exam-view) .account-box button:focus-visible {
  outline: 3px solid #f2bd63;
  outline-offset: 2px;
}

body:not(.is-exam-view) .account-name {
  color: #ffffff;
}

body:not(.is-exam-view) .account-box #loginOpenButton,
body:not(.is-exam-view).app-access-locked .account-box #loginOpenButton {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  background: #f2bd63;
  color: #27211d;
  box-shadow: none;
  font-weight: 900;
}

body:not(.is-exam-view).app-access-locked .account-box #loginOpenButton::after {
  color: #27211d;
  font-size: 15px;
}

body[data-view="library"] .main {
  padding: 14px max(clamp(18px, 2vw, 36px), calc((100vw - 2160px) / 2)) 64px;
}

body[data-view="library"] .topbar {
  display: none;
}

body[data-view="library"]:not(.is-module-library) #libraryView.view.active {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "hero"
    "navigator"
    "toolbar"
    "grid";
  gap: 13px;
  align-items: start;
}

body[data-view="library"]:not(.is-module-library) .library-hero {
  grid-area: hero;
  display: grid;
  grid-template-columns: minmax(420px, 38%) minmax(0, 62%);
  gap: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #fbfaf7;
  box-shadow: 0 4px 8px rgba(39, 33, 29, 0.11);
  overflow: hidden;
}

body[data-view="library"]:not(.is-module-library) .library-hero-copy {
  display: flex;
  min-height: 262px !important;
  height: 262px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 28px 36px !important;
  border: 0;
  border-radius: 0;
  background: #fbfaf7 !important;
  box-shadow: none;
}

body[data-view="library"]:not(.is-module-library) .library-kicker {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #ad4438;
  font-size: 12px;
  font-weight: 900;
}

body[data-view="library"]:not(.is-module-library) .library-hero h2 {
  margin: 10px 0 8px;
  color: #27211d;
  font-family: Georgia, "SimSun", "Songti SC", serif;
  font-size: 38px;
  line-height: 1.16;
  letter-spacing: 0;
}

body[data-view="library"]:not(.is-module-library) .library-hero p {
  max-width: 42em;
  margin: 0;
  color: #655e57;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.55;
}

body[data-view="library"]:not(.is-module-library) .hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: min(390px, 100%);
  margin-top: 18px;
}

body[data-view="library"]:not(.is-module-library) .hero-stats div {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #d5cec4;
  border-radius: 6px;
  background: #f0ede6;
}

body[data-view="library"]:not(.is-module-library) .hero-stats strong {
  color: #ad4438;
  font-size: 19px;
  line-height: 1;
}

body[data-view="library"]:not(.is-module-library) .hero-stats span {
  margin-top: 4px;
  color: #655e57;
  font-size: 10px;
  font-weight: 700;
}

body[data-view="library"]:not(.is-module-library) .library-hero-preview {
  position: relative;
  display: block;
  width: 100%;
  height: 262px !important;
  min-height: 262px !important;
  max-height: 262px !important;
  align-self: stretch;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #2b2725 url("./ui-assets/atum-study-room.webp") center 67% / cover no-repeat !important;
  box-shadow: none;
  overflow: hidden;
}

body[data-view="library"]:not(.is-module-library) .library-hero-preview > * {
  display: none !important;
}

body[data-view="library"]:not(.is-module-library) .library-hero-preview::after {
  content: "今晚，完成一套真题";
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 8px 11px;
  border-radius: 5px;
  background: rgba(43, 39, 37, 0.92);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

body[data-view="library"]:not(.is-module-library) .library-feature-row {
  display: none !important;
}

body[data-view="library"]:not(.is-module-library) .paper-navigator {
  grid-area: navigator;
  gap: 12px 16px;
  margin: 0;
  padding: 12px 16px;
  border: 1px solid #cbc4ba;
  border-radius: 8px !important;
  background: #fbfaf7;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body[data-view="library"]:not(.is-module-library) .navigator-title strong {
  color: #27211d;
  font-size: 15px;
}

body[data-view="library"]:not(.is-module-library) .navigator-title span,
body[data-view="library"]:not(.is-module-library) .select-label {
  color: #655e57;
}

body[data-view="library"]:not(.is-module-library) .book-tab,
body[data-view="library"]:not(.is-module-library) .test-tab {
  height: 34px;
  border: 1px solid #d5cec4;
  border-radius: 5px;
  background: #f0ede6;
  color: #403936;
  box-shadow: none;
}

body[data-view="library"]:not(.is-module-library) .book-tab.active,
body[data-view="library"]:not(.is-module-library) .test-tab.active {
  border-color: #ad4438;
  background: #ad4438;
  color: #ffffff;
  box-shadow: none;
}

body[data-view="library"]:not(.is-module-library) .library-select-label select {
  height: 40px;
  border-color: #d5cec4;
  border-radius: 6px;
  background: #ffffff;
  color: #27211d;
}

body[data-view="library"]:not(.is-module-library) .segmented {
  min-width: min(500px, 100%);
  gap: 4px;
  padding: 4px;
  border: 1px solid #d5cec4;
  border-radius: 7px;
  background: #ece8df;
}

body[data-view="library"]:not(.is-module-library) .segment {
  min-width: 84px;
  height: 40px;
  border-radius: 5px;
  color: #655e57;
  font-size: 13px;
}

body[data-view="library"]:not(.is-module-library) .segment.active {
  background: #ffffff;
  color: #27211d;
  box-shadow: none;
}

body[data-view="library"]:not(.is-module-library) .toolbar {
  grid-area: toolbar;
  min-height: 58px;
  margin: 0;
  padding: 10px 16px;
  border: 1px solid #cbc4ba;
  border-radius: 8px !important;
  background: #fbfaf7;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body[data-view="library"]:not(.is-module-library) .search-box.wide {
  width: min(430px, 100%);
}

body[data-view="library"]:not(.is-module-library) .search-box input {
  border-color: #d5cec4;
  border-radius: 6px;
  background: #ffffff;
  color: #27211d;
}

body[data-view="library"]:not(.is-module-library) .library-grid.test-card-grid {
  grid-area: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

body[data-view="library"]:not(.is-module-library) .test-paper-card {
  min-width: 0;
  min-height: 286px;
  gap: 12px;
  padding: 16px;
  border: 1px solid #cbc4ba;
  border-radius: 8px;
  background: #fbfaf7;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: border-color 150ms ease, background-color 150ms ease;
}

body[data-view="library"]:not(.is-module-library) .test-paper-card:hover {
  border-color: #9e9488;
  background: #ffffff;
  box-shadow: none;
  transform: none;
}

body[data-view="library"]:not(.is-module-library) .test-paper-card-head {
  min-height: 57px;
}

body[data-view="library"]:not(.is-module-library) .test-paper-card-head h2 {
  color: #27211d;
  font-size: 18px;
  line-height: 1.2;
}

body[data-view="library"]:not(.is-module-library) .test-paper-card-head p {
  margin-top: 5px;
  color: #655e57;
  font-size: 11px;
  line-height: 1.45;
}

body[data-view="library"]:not(.is-module-library) .test-paper-card .badge {
  padding: 6px 9px;
  border: 0;
  border-radius: 999px;
  background: #ece8df;
  color: #7a4635;
  font-size: 10px;
  box-shadow: none;
}

body[data-view="library"]:not(.is-module-library) .test-paper-actions {
  gap: 10px;
}

body[data-view="library"]:not(.is-module-library) .test-paper-mock-button {
  min-height: 44px;
  border-radius: 6px;
  background: #ad4438;
  box-shadow: none;
  font-size: 14px;
}

body[data-view="library"]:not(.is-module-library) .test-paper-mock-button:hover {
  background: #91382f;
}

body[data-view="library"]:not(.is-module-library) .test-paper-module-grid {
  gap: 8px;
}

body[data-view="library"]:not(.is-module-library) .test-paper-module-button {
  min-height: 54px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #f0ede6;
  color: #27211d;
  font-size: 13px;
}

body[data-view="library"]:not(.is-module-library) .test-paper-module-button:hover {
  border-color: #cbc4ba;
  background: #ffffff;
  color: #ad4438;
}

body[data-view="library"]:not(.is-module-library) .test-paper-module-button span {
  color: #655e57;
  font-size: 10px;
}

@media (max-width: 1260px) {
  body:not(.is-exam-view) .sidebar {
    grid-template-columns: minmax(250px, 0.75fr) minmax(430px, 1fr) minmax(140px, 0.4fr);
    width: min(1180px, calc(100% - 36px));
  }

  body:not(.is-exam-view) .nav-item {
    min-width: 68px;
    padding-inline: 10px;
  }

  body[data-view="library"] .main {
    padding-inline: 18px;
  }

  body[data-view="library"]:not(.is-module-library) .library-grid.test-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  body:not(.is-exam-view) .sidebar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand account"
      "nav nav";
    gap: 10px 14px;
    width: calc(100% - 28px);
    padding: 12px 14px;
  }

  body:not(.is-exam-view) .nav-list {
    justify-self: stretch;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  body:not(.is-exam-view) .nav-item {
    flex: 0 0 auto;
  }

  body[data-view="library"]:not(.is-module-library) .library-hero {
    grid-template-columns: 1fr;
  }

  body[data-view="library"]:not(.is-module-library) .library-hero-copy {
    height: auto;
    min-height: 230px !important;
    padding: 26px 28px !important;
  }

  body[data-view="library"]:not(.is-module-library) .library-hero-preview {
    height: 220px !important;
    min-height: 220px !important;
    max-height: 220px !important;
  }

  body[data-view="library"]:not(.is-module-library) .paper-navigator {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas:
      "books"
      "tests"
      "type"
      "modules" !important;
  }

  body[data-view="library"]:not(.is-module-library) .segmented {
    justify-self: stretch;
    min-width: 0;
    overflow-x: auto;
  }
}

@media (max-width: 620px) {
  body:not(.is-exam-view) .sidebar {
    width: calc(100% - 20px);
    margin-top: 10px;
  }

  body:not(.is-exam-view) .brand-mark {
    width: 42px;
    height: 42px;
    font-size: 20px;
  }

  body:not(.is-exam-view) .brand strong {
    font-size: 17px;
  }

  body:not(.is-exam-view) .brand-copy > span {
    font-size: 10px;
  }

  body:not(.is-exam-view) .nav-list {
    gap: 4px;
    overflow-x: visible;
  }

  body:not(.is-exam-view) .nav-item {
    min-width: 60px;
    height: 40px;
    padding-inline: 6px;
    font-size: 12px;
  }

  body:not(.is-exam-view).app-access-locked .account-box #loginOpenButton {
    min-height: 40px;
    padding-inline: 12px;
  }

  body[data-view="library"] .main {
    padding: 12px 10px 44px;
  }

  body[data-view="library"]:not(.is-module-library) .library-hero h2 {
    font-size: 32px;
  }

  body[data-view="library"]:not(.is-module-library) .hero-stats {
    width: 100%;
  }

  body[data-view="library"]:not(.is-module-library) .navigator-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  body[data-view="library"]:not(.is-module-library) .navigator-title {
    flex-basis: auto;
  }

  body[data-view="library"]:not(.is-module-library) .book-nav,
  body[data-view="library"]:not(.is-module-library) .test-nav {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  body[data-view="library"]:not(.is-module-library) .library-grid.test-card-grid {
    grid-template-columns: 1fr;
  }
}
