/* 上师语露（窍诀）、教证集，将来公案集同用 - one passage per card, words first at reading size.

   Same column and palette as 堪布语露, which this grows out of: serif text ranged
   left, everything about the passage - who said it, where on the site it is
   read in full, which 类 it sits in - on one quiet line under it. */
.hj {
  margin: 0 auto;
  max-width: 1080px;
  padding: 6px 14px 30px;
  text-align: left;
}

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

.hj-head__title {
  color: #4e0d0d;
  font-family: "Songti SC", "SimSun", "宋体", serif;
  font-size: 1.35em;
  margin: 0;
}

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

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

.hj-search {
  align-items: center;
  border: 1px solid #ddddc8;
  border-radius: 999px;
  display: flex;
  gap: 2px;
  margin-top: 8px;
  max-width: 360px;
  padding: 2px 10px 2px 2px;
}

.hj-search:focus-within {
  background-color: #fff;
  border-color: #b9a94a;
}

.hj-search__go {
  background: none;
  border: 0;
  color: #4e0d0d;
  cursor: pointer;
  height: 30px;
  width: 30px;
}

.hj-search .hj-search__input {
  background: transparent;
  border: 0;
  box-shadow: none;
  margin: 0;
  min-width: 0;
  outline: none;
  padding: 4px 0;
  width: 100%;
}

/* The 类 as a wrapping row of quiet chips: sixteen of them fit in two or three
   lines on a phone, and the one being read is the only filled one. */
.hj-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 4px;
}

.hj-cat,
.hj-len {
  border: 1px solid #ddddc8;
  border-radius: 999px;
  color: #4e0d0d;
  font-size: 0.88em;
  padding: 3px 11px;
  text-decoration: none;
}

.hj-cat:hover,
.hj-len:hover {
  border-color: #b9a94a;
  color: #6a1414;
}

.hj-cat.is-on,
.hj-len.is-on {
  background-color: #4e0d0d;
  border-color: #4e0d0d;
  color: #fff;
}

.hj-cat__n,
.hj-len__n {
  font-size: 0.85em;
  font-variant-numeric: tabular-nums;
  margin-left: 4px;
  opacity: 0.65;
}

.hj-cat-note {
  color: #8a7a6a;
  font-size: 0.85em;
  margin: 6px 0 0;
}

.hj-lens {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 0;
}

.hj-len {
  border-style: dashed;
  font-size: 0.82em;
}

.hj-card__text {
  border: 0;
  color: #2b2620;
  font-family: "Songti SC", "SimSun", "宋体", serif;
  font-size: 1.05em;
  line-height: 1.85;
  margin: 0;
  padding: 0;
}

.hj-card__text p {
  margin: 0 0 0.6em;
  text-indent: 2em;
}

.hj-card__text p:last-child {
  margin-bottom: 0;
}

.hj-card__foot {
  align-items: baseline;
  color: #8a7a6a;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.82em;
  gap: 4px 12px;
  margin-top: 10px;
}

.hj-card__speaker {
  color: #6b5d50;
}

.hj-card__source {
  color: #4a7c59;
  text-decoration: none;
}

.hj-card__source:hover {
  text-decoration: underline;
}

.hj-card__tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* 出处一律落在右下：标签、讲解处数在左，出处在右（站长 10-19） */
.hj-card__cite {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  justify-content: flex-end;
  margin-left: auto;
  text-align: right;
}

.hj-tag {
  color: #8a6d2f;
  font-size: 0.85em;
  text-decoration: none;
}

.hj-tag::before {
  content: "#";
  opacity: 0.6;
}

a.hj-tag:hover {
  text-decoration: underline;
}

.hj-empty {
  color: #8a7a6a;
  padding: 24px 0;
}

.hj-back {
  color: #8a7a6a;
  display: inline-block;
  font-size: 0.85em;
  margin-bottom: 4px;
  text-decoration: none;
}

.hj-back:hover {
  color: #4e0d0d;
}

/* 单条页：回本部、回所在的类，两层都给（站长 10-20） */
.hj-crumbs {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 0 14px;
}

/* 今日一条: the one passage written out in full on the front page, on a faint
   ground so it reads as the day's line rather than the first of a list. */
.hj-today {
  background-color: #faf7ec;
  border: 1px solid #ecebdc;
  border-radius: 6px;
  margin: 14px 0 6px;
  padding: 12px 16px 12px;
}

.hj-today__bar {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.hj-today__label {
  color: #8a6d2f;
  font-size: 0.8em;
  letter-spacing: 0.1em;
}

.hj-today__random {
  color: #4a7c59;
  font-size: 0.82em;
  text-decoration: none;
}

.hj-today__title {
  color: #4e0d0d;
  display: block;
  font-family: "Songti SC", "SimSun", "宋体", serif;
  font-size: 1.05em;
  font-weight: 600;
  margin-bottom: 6px;
  text-decoration: none;
}

/* The 类 as a directory: a tile each with its count and the first few titles,
   two to a row on a phone. */
.hj-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}

@media (max-width: 480px) {
  .hj-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.hj-tile {
  min-width: 0;
  border: 1px solid #ecebdc;
  border-radius: 6px;
  padding: 10px 12px;
}

.hj-tile__head {
  align-items: baseline;
  display: flex;
  gap: 6px;
  justify-content: space-between;
  text-decoration: none;
}

.hj-tile__title {
  color: #4e0d0d;
  font-family: "Songti SC", "SimSun", "宋体", serif;
  font-weight: 600;
}

.hj-tile__n {
  color: #8a7a6a;
  flex: none;
  font-size: 0.78em;
  font-variant-numeric: tabular-nums;
}

.hj-tile__samples {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
}

.hj-tile__samples li {
  font-size: 0.82em;
  line-height: 1.6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hj-tile__samples a {
  color: #6b5d50;
  text-decoration: none;
}

.hj-tile__samples a:hover {
  color: #4e0d0d;
}

.hj-group {
  margin-top: 18px;
  scroll-margin-top: 84px;
}

.hj-group__title {
  border-bottom: 1px solid #ddddc8;
  color: #4e0d0d;
  font-family: "Songti SC", "SimSun", "宋体", serif;
  font-size: 1em;
  font-weight: 600;
  margin: 0;
  padding-bottom: 4px;
}

.hj-group__n {
  color: #8a7a6a;
  font-size: 0.8em;
  font-weight: 400;
  margin-left: 6px;
}

.hj-group__note {
  color: #8a7a6a;
  font-size: 0.82em;
  margin: 4px 0 0;
}

/* A row: the title, then the words themselves. A longer passage stops at eight
   lines under a fade until 展开全文 opens it. */
.hj-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hj-row {
  border-bottom: 1px solid #f0efe3;
  padding: 14px 0 12px;
}

.hj-row__title {
  color: #4e0d0d;
  display: inline-block;
  font-family: "Songti SC", "SimSun", "宋体", serif;
  font-weight: 600;
  margin-bottom: 6px;
  text-decoration: none;
}

.hj-row__title:hover {
  text-decoration: underline;
}

.hj-row.is-clamped:not(.is-open) .hj-row__text {
  -webkit-mask-image: linear-gradient(#000 85%, transparent);
  mask-image: linear-gradient(#000 85%, transparent);
  max-height: calc(1.85em * 8);
  overflow: hidden;
}

.hj-row__more {
  background: none;
  border: 0;
  color: #4a7c59;
  cursor: pointer;
  font-size: 0.85em;
  margin-top: 2px;
  padding: 2px 0;
}

.hj-row__more:hover {
  text-decoration: underline;
}

.hj-row__more:focus-visible {
  outline: 2px solid #b9a94a;
  outline-offset: 2px;
}

.hj-one {
  padding: 14px 0 6px;
}

.hj-one__cats {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 14px;
}

.hj-pn {
  border-top: 1px solid #ecebdc;
  display: flex;
  font-size: 0.88em;
  gap: 12px;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 10px;
}

/* 上一条/下一条: a small label over the verse line, both muted, so the pair reads as
   navigation and not as two more links in the green of the sources above. */
.hj-pn a {
  color: #6b5d50;
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  text-decoration: none;
}

.hj-pn a:hover {
  color: #4e0d0d;
}

.hj-pn__label {
  color: #8a7a6a;
  font-size: 0.85em;
}

.hj-pn__next {
  align-items: flex-end;
  text-align: right;
}

/* 长行的条目标题是一整句：上一条、下一条只留一行，多的用省略号（站长 10-19） */
.hj-pn__title {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hj-related {
  margin-top: 22px;
}

.hj-related__list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
}

.hj-related__list li {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 5px 0;
}

.hj-related__list a {
  color: #4e0d0d;
  font-family: "Songti SC", "SimSun", "宋体", serif;
  font-size: 0.95em;
  text-decoration: none;
}

.hj-related__list a:hover {
  text-decoration: underline;
}

.hj-related__why {
  display: inline-flex;
  font-size: 0.8em;
  gap: 6px;
}

/* 单条页 is one passage read through: a narrower column keeps its lines short. */
.hj--one {
  max-width: 860px;
}

/* 侧面 directory over a paged category, and the pager rows. */
.hj-jumps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 12px;
}

.hj-jump {
  color: #4a7c59;
  font-size: 0.88em;
  text-decoration: none;
}

.hj-jump:hover {
  color: #4e0d0d;
}

.hj-pager {
  color: #8a7a6a;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.88em;
  gap: 14px;
  justify-content: center;
  margin: 20px 0 8px;
}

.hj-pager--top {
  justify-content: flex-start;
  margin: 14px 0 0;
}

.hj-pager a {
  color: #4a7c59;
  text-decoration: none;
}

.hj-pager a:hover {
  color: #4e0d0d;
}

/* 教证集: a verse is set as verse - each line flush, no first-line indent - and
   its row links through to the 堪布's explanations beneath it on its own page. */
.hj-verse p {
  text-indent: 0;
  margin-bottom: 0.15em;
}

/* 颂居中；经文、长行照常靠左（站长 10-19） */
.hj-verse--center {
  text-align: center;
}

/* 今日一条的出处照书上引文的写法：「——」起头，颂居中也落在卡片右下（站长 10-19） */
.hj-today__quote {
  margin: 0;
}

.hj-today__quote .hj-card__foot {
  justify-content: flex-end;
}

.hj-row__verse {
  color: inherit;
  display: block;
  text-decoration: none;
}

.hj-row__verse:hover .hj-verse {
  color: #4e0d0d;
}

.hj-card__origin {
  border: 1px solid #ddddc8;
  border-radius: 999px;
  color: #8a7a6a;
  font-size: 0.85em;
  line-height: 1.5;
  margin-left: 6px;
  padding: 0 6px;
  white-space: nowrap;
}

.hj-card__notes {
  color: #6b5d50;
  text-decoration: none;
}

.hj-card__notes:hover {
  color: #4e0d0d;
}

/* 单条页的出处：颂文底下右侧一行，「——作者《经论》」后跟一个小字的去处 */
.hj-one__cite {
  align-items: baseline;
  font-size: 1em;
}

.hj-one__open {
  color: #4a7c59;
  font-size: 0.85em;
}

/* 按经论: one row per 经论, its 品 laid out in columns as a table of contents -
   name left, count right - each one a way into that 品 on the 经论's page. */
.hj-group__title--next {
  margin-top: 26px;
}

.hj-works {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
}

.hj-work {
  border-bottom: 1px solid #ecebdc;
  padding: 10px 0 12px;
}

.hj-work:last-child {
  border-bottom: 0;
}

.hj-work__head {
  align-items: baseline;
  border-radius: 4px;
  display: flex;
  gap: 10px;
  margin-inline: -8px;
  padding: 4px 8px;
  text-decoration: none;
  transition: background-color 0.15s;
}

/* 整行是链接：悬停整条铺底色、书名画线（站长 10-19 嫌只给「全部」画线不显眼） */
.hj-work__head:hover {
  background-color: #f8f6ea;
}

.hj-work__head:hover .hj-tile__title {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.hj-work__all {
  color: #4a7c59;
  font-size: 0.8em;
  margin-left: auto;
}

.hj-work__head:hover .hj-work__all {
  color: #2f5e3c;
  text-decoration: underline;
}

.hj-work__chapters {
  display: grid;
  gap: 0 24px;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
}

.hj-work__chapters a {
  align-items: baseline;
  border-bottom: 1px dotted #e4e2cf;
  color: #6b5d50;
  display: flex;
  font-size: 0.85em;
  gap: 8px;
  justify-content: space-between;
  line-height: 2;
  text-decoration: none;
}

.hj-work__chapters a:hover {
  color: #4e0d0d;
}

.hj-work__chapter {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hj-work__n {
  color: #a39482;
  flex: none;
  font-size: 0.9em;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 480px) {
  .hj-work__chapters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 14px;
  }
}

/* 首页按经论只列常引的：一格一部，有品的点开看品目录（站长 10-20：444 部全铺太长）。 */
.hj-wgrid {
  align-items: start;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

@media (max-width: 480px) {
  .hj-wgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.hj-wtile {
  border: 1px solid #ecebdc;
  border-radius: 6px;
  min-width: 0;
  padding: 8px 10px;
}

.hj-wtile .hj-tile__title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hj-wtile .hj-tile__head:hover .hj-tile__title {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.hj-wtile__more summary {
  color: #4a7c59;
  cursor: pointer;
  font-size: 0.8em;
  margin-top: 4px;
}

/* 点开品目录的那格占满一行，品名排几栏 */
.hj-wtile:has(.hj-wtile__more[open]) {
  grid-column: 1 / -1;
}

.hj-wall {
  margin: 12px 0 0;
  text-align: right;
}

.hj-wall a {
  color: #4a7c59;
  font-size: 0.9em;
  text-decoration: none;
}

.hj-wall a:hover {
  text-decoration: underline;
}

/* 全部经论页：名字左、条数右，几栏排开，筛的时候就地藏起。 */
.hj-wlist {
  display: grid;
  gap: 0 24px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
}

.hj-wlist a {
  align-items: baseline;
  border-bottom: 1px dotted #e4e2cf;
  color: #4e0d0d;
  display: flex;
  font-size: 0.92em;
  gap: 8px;
  justify-content: space-between;
  line-height: 2.1;
  text-decoration: none;
}

.hj-wlist a:hover .hj-work__chapter {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.hj-notes {
  margin-top: 22px;
}

.hj-notes__list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
}

.hj-note {
  border-top: 1px solid #eeeedd;
  padding: 10px 0;
}

.hj-note__text {
  border: 0;
  color: #3b342c;
  font-size: 0.95em;
  line-height: 1.8;
  margin: 0 0 4px;
  padding: 0;
}

.hj-note__text p {
  margin: 0;
}

.hj-note__foot {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.82em;
  gap: 2px 0;
}

.hj-note__foot .hj-card__origin {
  font-size: 0.9em;
}
