/* Course category page. Continues the classroom page's paper-and-ink system,
   then turns each course into a readable, actionable unit. */
.category-page .category-hero {
  margin-bottom: 0;
}

.category-stats {
  grid-template-columns: repeat(2, minmax(82px, 1fr));
}

.category-library {
  padding-top: 24px;
}

.category-library__head {
  border-bottom: 1px solid #dddcc8;
  margin-bottom: 12px;
  padding: 0 2px 9px;
}

.category-library__head h2 {
  color: #4e0d0d;
  font-family: "Songti SC", "SimSun", "宋体", serif;
  font-size: 1.18em;
  font-weight: 600;
  margin: 0;
}

.category-library__head p {
  color: #8a7a6a;
  font-size: 0.82em;
  line-height: 1.5;
  margin: 3px 0 0;
}

.category-courses {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.category-course {
  background-color: rgba(255, 255, 255, 0.76);
  border: 1px solid #d9d9c6;
  border-radius: 11px;
  box-shadow: 0 4px 12px rgba(62, 47, 25, 0.04);
  display: flex;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  position: relative;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.category-course::before {
  background-color: #4a7c59;
  border-radius: 11px 0 0 11px;
  bottom: -1px;
  content: "";
  left: -1px;
  position: absolute;
  top: -1px;
  width: 3px;
}

.category-course:hover {
  border-color: #c8c4aa;
  box-shadow: 0 8px 20px rgba(62, 47, 25, 0.09);
  transform: translateY(-1px);
}

.category-course__number {
  align-items: center;
  background-color: #f2eddd;
  border: 1px solid #ded6bb;
  border-radius: 999px;
  color: #8a7a6a;
  display: flex;
  flex: none;
  font-size: 0.72em;
  font-variant-numeric: tabular-nums;
  height: 34px;
  justify-content: center;
  letter-spacing: 0.04em;
  width: 34px;
}

.category-course__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.category-course__top {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.category-course__top h3 {
  font-family: "Songti SC", "SimSun", "宋体", serif;
  font-size: 1.08em;
  font-weight: 600;
  line-height: 1.45;
  margin: 2px 0 0;
}

.category-course__top h3 a {
  color: #4e0d0d;
  text-decoration: none;
}

.category-course__top h3 a:hover {
  color: #1a5276;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.category-course__lessons {
  align-items: center;
  background-color: #f7f5e9;
  border: 1px solid #e3e0cd;
  border-radius: 999px;
  color: #6b6257;
  display: inline-flex;
  flex: none;
  font-size: 0.75em;
  gap: 5px;
  line-height: 1;
  min-height: 30px;
  padding: 3px 9px;
  white-space: nowrap;
}

.category-course__lessons i {
  color: #4a7c59;
}

.category-course__description {
  color: #5c5347;
  font-size: 0.88em;
  line-height: 1.72;
  margin: 12px 0 18px;
}

.category-course__description--empty {
  color: #9a9184;
  font-style: italic;
}

.category-course__actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.category-course__open,
.category-course__plan {
  align-items: center;
  border-radius: 999px;
  box-sizing: border-box;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 0.78em;
  gap: 6px;
  justify-content: center;
  min-height: 44px;
  padding: 7px 14px;
  text-decoration: none;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.category-course__open {
  background-color: #4a7c59;
  border: 1px solid #4a7c59;
  color: #fff;
}

.category-course__open:hover {
  background-color: #365e42;
  border-color: #365e42;
  color: #fff;
  text-decoration: none;
}

.category-course__plan {
  background-color: #fff;
  border: 1px solid #c7c5b1;
  color: #1a5276;
}

.category-course__plan:hover:not(:disabled) {
  background-color: #f7f5e9;
  border-color: #8e8a70;
  color: #4e0d0d;
  text-decoration: none;
}

.category-course__plan.is-planned {
  background-color: #eef4ea;
  border-color: #9ab191;
  color: #365e42;
}

.category-course__plan:disabled {
  cursor: wait;
  opacity: 0.55;
}

.category-course__open:focus-visible,
.category-course__plan:focus-visible,
.category-course__top h3 a:focus-visible {
  outline: 3px solid rgba(26, 82, 118, 0.35);
  outline-offset: 2px;
}

.category-course__status {
  color: #9b2c2c;
  font-size: 0.76em;
}

.category-empty {
  align-items: center;
  background-color: rgba(255, 255, 255, 0.55);
  border: 1px dashed #cfcdb9;
  border-radius: 10px;
  color: #8a7a6a;
  display: flex;
  flex-direction: column;
  gap: 8px;
  grid-column: 1 / -1;
  padding: 34px 16px;
  text-align: center;
}

.category-empty i {
  color: #b99c60;
  font-size: 1.5em;
}

.category-empty p {
  margin: 0;
}

@media screen and (max-width: 800px) {
  .category-courses {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 420px) {
  .category-course {
    gap: 10px;
    padding: 15px 13px;
  }

  .category-course__number {
    height: 30px;
    width: 30px;
  }

  .category-course__top {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .category-course__description {
    margin-bottom: 14px;
    margin-top: 10px;
  }

  .category-course__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .category-course__open,
  .category-course__plan {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .category-page *,
  .category-page *::before,
  .category-page *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
