/* 本站文字资源目录 - 20 categories, 530 courses, 3492 lessons.

   It used to be a plus-sign tree built on its own JavaScript, everything closed,
   with no counts to tell a reader whether a branch held one lesson or two
   hundred, and a search box that assembled its own URL. The tree is now nested
   <details>, every level says how much it holds, and the categories double as
   filter chips so the common move - "show me 中观" - is one click. */
.cat-page {
  margin: 0 auto;
  max-width: 900px;
  padding: 0 14px;
  text-align: left;
}

.cat-head {
  border-bottom: 1px solid #ddddc8;
  padding-bottom: 10px;
}

.cat-head__title {
  color: #4e0d0d;
  font-size: 1.3em;
}

.cat-head__meta {
  color: #8a7a6a;
  font-size: 0.85em;
  margin-top: 4px;
}

.cat-head__meta strong {
  color: #4a7c59;
  font-weight: 600;
}

.cat-head__sep {
  opacity: 0.5;
  padding: 0 6px;
}

.cat-search {
  display: flex;
  gap: 8px;
  padding: 12px 0 4px;
}

/* forms_styling.css dresses every input for a stacked form. Give the box and its
   button one height so the bar reads as one control. */
.cat-search input[type="search"] {
  box-sizing: border-box;
  flex: 1 1 auto;
  font-size: 0.95em;
  height: 38px;
  min-width: 0;
  width: 100%;
}

/* `.styled-button` carries its own vertical padding, which sat the label below
   centre once the bar gave the button a fixed height. */
.cat-search__go {
  align-items: center;
  box-sizing: border-box;
  display: inline-flex;
  flex: none;
  gap: 6px;
  height: 38px;
  justify-content: center;
  line-height: 1;
  padding-bottom: 0;
  padding-top: 0;
  white-space: nowrap;
}

.cat-facets {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 0;
}

.cat-facets__label {
  color: #8a8a78;
  flex: none;
  font-size: 0.82em;
  width: 2.6em;
}

/* Name first, count second and quieter: you read the category, then check how
   much is in it. */
.cat-chip small {
  opacity: 0.7;
  padding-left: 3px;
}

/* What arrived this week, on one line rather than a numbered paragraph. */
.cat-recent {
  align-items: baseline;
  border-top: 1px dashed #e2e0cd;
  color: #8a8a78;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.85em;
  gap: 4px 10px;
  padding: 8px 0;
}

.cat-recent__label {
  flex: none;
}

.cat-recent__item {
  color: #4a7c59;
  text-decoration: none;
}

.cat-recent__item:hover {
  text-decoration: underline;
}

.cat-toolbar {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding-bottom: 8px;
}

.cat-toolbar__btn {
  background-color: rgba(255, 255, 255, 0.55);
  border: 1px solid #ccc;
  border-radius: 12px;
  color: #1a5276;
  cursor: pointer;
  font-size: 0.82em;
  line-height: 1.5;
  padding: 2px 10px;
}

.cat-toolbar__btn:hover {
  border-color: #8a8a72;
}

/* A category is a white panel; a course is a row inside it. Two levels of nesting
   is as deep as this goes, so the depth is drawn once, with a left rule, rather
   than by indenting each level 32px. */
.cat-cat {
  background-color: #fff;
  border: 1px solid #d9d9c6;
  border-left: 3px solid #e4e2cf;
  border-radius: 8px;
  margin-bottom: 6px;
}

.cat-cat[open] {
  border-left-color: #4a7c59;
}

.cat-cat__head,
.cat-course__head {
  align-items: baseline;
  cursor: pointer;
  display: flex;
  gap: 10px;
  list-style: none;
  padding: 9px 14px;
  user-select: none;
}

/* Safari still draws the default triangle through ::-webkit-details-marker. */
.cat-cat__head::-webkit-details-marker,
.cat-course__head::-webkit-details-marker {
  display: none;
}

/* One caret, drawn by us so it can turn rather than swap + for -. */
.cat-cat__head::before,
.cat-course__head::before {
  color: #b0b09c;
  content: "\203A";
  flex: none;
  font-size: 1.1em;
  line-height: 1;
  transition: transform 0.15s ease;
}

.cat-cat[open] > .cat-cat__head::before,
.cat-course[open] > .cat-course__head::before {
  transform: rotate(90deg);
}

.cat-cat__head:hover,
.cat-course__head:hover {
  background-color: #fbfbf4;
}

.cat-cat__head {
  border-radius: 6px;
}

.cat-cat__title {
  color: #4e0d0d;
  font-family: "Songti SC", "SimSun", "宋体", serif;
  font-size: 1.08em;
}

.cat-cat__count,
.cat-course__count {
  color: #b0b09c;
  font-size: 0.8em;
  margin-left: auto;
  white-space: nowrap;
}

.cat-course {
  border-top: 1px solid #f0efe2;
  margin-left: 14px;
}

.cat-course__head {
  padding: 7px 14px 7px 0;
}

.cat-course__title {
  color: #1a5276;
  line-height: 1.5;
}

/* The lessons wrap instead of stacking: a course of 201 of them was 201 rows of
   near-identical text, and each label is a few characters once the repeated
   course name is stripped off it. */
.cat-lessons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0 14px 12px 14px;
}

.cat-lessons li {
  align-items: baseline;
  display: flex;
  gap: 3px;
  max-width: 100%;
}

.cat-lesson {
  background-color: rgba(255, 255, 255, 0.5);
  border: 1px solid #e2e0cd;
  border-radius: 10px;
  color: #4a7c59;
  display: inline-block;
  font-size: 0.88em;
  max-width: 100%;
  overflow: hidden;
  padding: 2px 10px;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The stand-in shown before the lessons arrive - and the way through when the
   fetch never happens at all. */
.cat-lesson--fallback {
  color: #8a8a78;
}

.cat-lesson:hover {
  background-color: #fff;
  border-color: #4a7c59;
  text-decoration: none;
}

.cat-lesson mark,
.cat-cat__title mark,
.cat-course__title mark {
  background-color: #f6e7a8;
  color: inherit;
  padding: 0 1px;
}

.cat-lesson__read {
  flex: none;
  font-size: 0.75em;
}

.cat-empty {
  background-color: #fff;
  border: 1px dashed #d0d0ba;
  border-radius: 10px;
  padding: 26px 18px;
  text-align: center;
}

.cat-empty__lead {
  color: #6f6f5e;
  font-size: 1.02em;
  margin: 0;
}

.cat-empty__hint {
  color: #9a9a88;
  font-size: 0.85em;
  margin: 6px 0 12px;
}

@media screen and (max-width: 600px) {
  .cat-facets__label {
    width: auto;
  }

  .cat-course {
    margin-left: 8px;
  }

  .cat-lessons {
    padding-left: 8px;
  }
}
