/* 一门讲记课的学习资料页（course_notes.html）。暖纸色同课程页；本站的课用绿，公众号文章用墨色。 */

.cnotes {
  max-width: 760px;
}

/* 宽屏两栏（学习资料两页）：页面放宽，说明文字仍控行长。 */
.cnotes--wide {
  max-width: 1080px;
}

.cnotes__head p {
  max-width: 46em;
}

/* 窄屏一栏：整门课的资料在前，工具条停在头上，再是各课。 */
.cnotes__layout {
  display: flex;
  flex-direction: column;
}

.cnotes__main {
  display: contents;
}

.cnotes__layout .cnotes__wide {
  order: -1;
}

/* 筛种类时脚本把不对的藏起来；下面几条 display 不能盖过它。 */
.cnotes [hidden] {
  display: none !important;
}

.cnotes__head h1 {
  color: #4e0d0d;
  font-family: "Songti SC", "Noto Serif CJK SC", SimSun, serif;
  font-size: 1.7em;
  line-height: 1.3;
  margin: 4px 0 6px;
  text-wrap: balance;
}

.cnotes__lead {
  color: #5f5849;
  font-size: 16px;
  line-height: 1.7;
  margin: 0;
}

.cnotes__lead a {
  color: #3d6849;
}

.cnotes__stats {
  color: #453f33;
  display: flex;
  flex-wrap: wrap;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  gap: 2px 18px;
  margin: 10px 0 0;
}

.cnotes__stats b {
  color: #4e0d0d;
  font-family: "Songti SC", "Noto Serif CJK SC", SimSun, serif;
  font-size: 1.12em;
}

.cnotes__wide {
  background: #f7f4e9;
  border: 1px solid #e9e2cc;
  border-radius: 10px;
  margin-top: 18px;
  padding: 12px 16px;
}

.cnotes__wide h2 {
  color: #2f2a1f;
  font-size: 17px;
  margin: 0 0 4px;
}

.cnotes__plain {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cnotes__plain li {
  align-items: baseline;
  border-top: 1px dashed #e2dcc6;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.cnotes__plain li:first-child {
  border-top: 0;
}

.cnotes__plain a {
  color: #2f2a1f;
  flex: 1;
  font-size: 16px;
  line-height: 1.6;
  min-height: 44px;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 8px 0;
  text-decoration: none;
}

.cnotes__plain a:hover,
.cnotes__plain a:focus-visible {
  color: #4e0d0d;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cnotes__from {
  color: #766857;
  font-size: 13.5px;
  white-space: nowrap;
}

.cnotes__more summary {
  color: #6b6455;
  cursor: pointer;
  font-size: 15px;
  min-height: 44px;
  padding: 8px 0;
}

/* 筛种类、跳课号：滚下去也在头上。 */
/* 底色同页面（外层是白底上一层半透明灰：rgba(192,189,189,.357) 叠白）。 */
.cnotes__tools {
  background: #e8e7e7;
  border-bottom: 1px solid #e2dcc6;
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.cnotes__kinds {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cnotes__chip {
  background: #fbfaf3;
  border: 1px solid #dedbc7;
  border-radius: 999px;
  color: #2f2a1f;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  min-height: 40px;
  padding: 4px 12px;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}

.cnotes__chip:hover {
  border-color: #9b9277;
}

.cnotes__chip[aria-pressed="true"] {
  background: #4e0d0d;
  border-color: #4e0d0d;
  color: #fffdf8;
}

.cnotes__chip small {
  margin-left: 3px;
  opacity: 0.72;
}

.cnotes__jump {
  align-items: center;
  display: flex;
  font-size: 15px;
  gap: 4px;
}

.cnotes__jump input {
  background: #fff;
  border: 1px solid #dedbc7;
  border-radius: 8px;
  font: inherit;
  min-height: 36px;
  text-align: center;
  width: 4.2em;
}

.cnotes__jump button {
  background: #fff;
  border: 1px solid #4e0d0d;
  border-radius: 8px;
  color: #4e0d0d;
  cursor: pointer;
  font: inherit;
  min-height: 36px;
  padding: 2px 14px;
}

.cnotes__lessons {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cnotes__lesson {
  border-bottom: 1px solid #ede7d5;
}

.cnotes__lesson summary {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: 3.2rem 1fr auto;
  list-style: none;
  min-height: 56px;
  padding: 10px 4px;
}

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

.cnotes__lesson summary:hover {
  background: #f7f4e9;
}

.cnotes__lesson summary:focus-visible {
  outline: 2px solid #4e0d0d;
  outline-offset: -2px;
}

/* 跳过来的那一课，sticky 工具栏不遮住它。 */
.cnotes__lesson details {
  scroll-margin-top: 170px;
}

.cnotes__num {
  color: #4e0d0d;
  font-family: "Songti SC", "Noto Serif CJK SC", SimSun, serif;
  font-size: 1.45em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: right;
}

.cnotes__num small {
  color: #766857;
  display: block;
  font-family: inherit;
  font-size: 12px;
  margin-top: 3px;
}

.cnotes__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.cnotes__tag {
  background: #f7f4e9;
  border: 1px solid #ede7d5;
  border-radius: 6px;
  color: #5f5849;
  font-size: 13.5px;
  padding: 2px 8px;
  white-space: nowrap;
}

.cnotes__tag--on {
  background: #f4e7df;
  border-color: transparent;
  color: #4e0d0d;
}

.cnotes__count {
  color: #5f5849;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cnotes__count::after {
  content: "›";
  display: inline-block;
  margin-left: 8px;
  transition: transform 0.2s ease;
}

.cnotes__lesson details[open] .cnotes__count::after {
  transform: rotate(90deg);
}

.cnotes__body {
  display: grid;
  gap: 12px;
  padding: 0 4px 16px 4.2rem;
}

.cnotes__site {
  align-items: center;
  background: #e6efe6;
  border-radius: 8px;
  color: #3d6849;
  display: inline-flex;
  font-size: 15px;
  justify-self: start;
  min-height: 40px;
  padding: 4px 12px;
  text-decoration: none;
}

.cnotes__site:hover,
.cnotes__site:focus-visible {
  text-decoration: underline;
}

.cnotes__group h3 {
  color: #4e0d0d;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin: 0;
}

.cnotes__none {
  color: #6b6455;
  padding: 24px 0;
  text-align: center;
}

.cnotes__note {
  border-top: 1px solid #e2dcc6;
  color: #766857;
  font-size: 13.5px;
  line-height: 1.6;
  margin-top: 28px;
  padding-top: 10px;
}

@media screen and (max-width: 560px) {
  /* 种类一行横着滑、跳课号并在同一行右头，头上的工具栏只占一行。 */
  .cnotes__tools {
    align-items: center;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .cnotes__kinds {
    flex-wrap: nowrap;
    mask-image: linear-gradient(to right, #000 85%, transparent);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .cnotes__jump label,
  .cnotes__jump span {
    clip: rect(0 0 0 0);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
  }

  .cnotes__jump input {
    width: 3.4em;
  }

  .cnotes__jump button {
    padding: 2px 10px;
  }

  .cnotes__wide {
    padding: 10px 14px;
  }

  .cnotes__chip {
    flex: none;
  }

  .cnotes__lesson details {
    scroll-margin-top: 110px;
  }

  .cnotes__head h1 {
    font-size: 1.4em;
  }

  .cnotes__lesson summary {
    grid-template-columns: 2.6rem 1fr;
    row-gap: 6px;
  }

  .cnotes__count {
    grid-column: 2;
  }

  .cnotes__body {
    padding-left: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cnotes__chip,
  .cnotes__card .cnotes__tag,
  .cnotes__count::after {
    transition: none;
  }
}

/* 资源工具 › 学习资料：一门课一张卡片，宽屏两栏。 */
.cnotes__courses {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
}

.cnotes__courses > li.cnotes__card {
  align-content: start;
  background: #fbfaf3;
  border: 1px solid #dedbc7;
  border-radius: 10px;
  color: #2f2a1f;
  display: grid;
  gap: 6px;
  padding: 14px 16px 16px;
}

.cnotes__card h2 {
  font-size: inherit;
  font-weight: inherit;
  margin: 0;
}

.cnotes__card p {
  margin: 0;
}

.cnotes__card .cnotes__course-title {
  text-decoration: none;
}

.cnotes__card .cnotes__course-title:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.cnotes__card .cnotes__tags {
  gap: 6px;
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
}

.cnotes__card .cnotes__tag {
  align-items: center;
  color: #3d362a;
  display: inline-flex;
  min-height: 36px;
  padding: 0 10px;
  text-decoration: none;
  transition:
    border-color 0.15s ease,
    color 0.15s ease;
}

.cnotes__card .cnotes__tag:hover {
  border-color: #9b9277;
  color: #4e0d0d;
}

.cnotes__card a:focus-visible {
  outline: 2px solid #4e0d0d;
  outline-offset: 2px;
}

.cnotes__index-kinds {
  margin-top: 16px;
}

.cnotes__index-kinds .cnotes__chip {
  align-items: center;
  display: inline-flex;
  min-height: 44px;
  text-decoration: none;
}

.cnotes__index-kinds .cnotes__chip[aria-current="page"] {
  background: #4e0d0d;
  border-color: #4e0d0d;
  color: #fffdf8;
}

.cnotes__course-top {
  align-items: baseline;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.cnotes__course-total {
  color: #5f5849;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cnotes__course-total b {
  color: #4e0d0d;
  font-family: "Songti SC", "Noto Serif CJK SC", SimSun, serif;
  font-size: 1.25em;
}

.cnotes__few {
  border-top: 1px solid #e2dcc6;
  margin-top: 28px;
  padding-top: 14px;
}

.cnotes__few h2 {
  color: #2f2a1f;
  font-size: 17px;
  margin: 0 0 6px;
}

.cnotes__few ul {
  display: grid;
  gap: 0 24px;
  grid-template-columns: minmax(0, 1fr);
  list-style: none;
  margin: 0;
  padding: 0;
}

.cnotes__few a {
  align-items: baseline;
  font-size: 16px;
  border-bottom: 1px dashed #e2dcc6;
  color: #2f2a1f;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-height: 44px;
  padding: 10px 2px;
  text-decoration: none;
}

.cnotes__few a:hover,
.cnotes__few a:focus-visible {
  color: #4e0d0d;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cnotes__few small {
  color: #766857;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cnotes__course-title {
  color: #4e0d0d;
  font-family: "Songti SC", "Noto Serif CJK SC", SimSun, serif;
  font-size: 1.25em;
  font-weight: 600;
}

.cnotes__course-meta {
  color: #5f5849;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

@media screen and (min-width: 720px) {
  .cnotes__courses {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cnotes__few ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media screen and (min-width: 1024px) {
  .cnotes__few ul {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  /* 一门课的页：左栏筛种类、跳课号，随页停住；右栏整门课的资料和各课。 */
  .cnotes__layout {
    align-items: start;
    display: grid;
    gap: 32px;
    grid-template-columns: 216px minmax(0, 1fr);
    margin-top: 20px;
  }

  .cnotes__main {
    display: block;
  }

  .cnotes__layout .cnotes__wide {
    margin-top: 0;
  }

  .cnotes__layout .cnotes__lessons {
    margin-top: 12px;
  }

  .cnotes__tools {
    background: none;
    border-bottom: 0;
    gap: 16px;
    margin-top: 0;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 0;
    top: 16px;
  }

  .cnotes__lesson details {
    scroll-margin-top: 16px;
  }
}
