/* Nội dung › Sách (books/*.js; owner, 2026-10-23, canvas "Wovia Sách", A): covers in a grid, "Tất cả sách" as rows of
   shelves, a shelf's band, text covers in each HSK level's colour, a book opened signed out. Each level is one hue;
   its tint, edge and words come from it and the look's own surface and text, so the dark look follows. */

.bk-tone-l1 { --bk-hue: #2e9e5b; }
.bk-tone-l2 { --bk-hue: #1597a3; }
.bk-tone-l3 { --bk-hue: #3b7bf0; }
.bk-tone-l4 { --bk-hue: #5b5bd6; }
.bk-tone-l5 { --bk-hue: #e07b1a; }
.bk-tone-l6 { --bk-hue: #e04468; }
.bk-tone-none { --bk-hue: var(--wovia-blue); }
.bk-tone-original { --bk-hue: #8b5e3c; }

[class*="bk-tone-"] {
  --bk-tint: color-mix(in srgb, var(--bk-hue) 13%, var(--surface));
  --bk-edge: color-mix(in srgb, var(--bk-hue) 32%, var(--surface));
  --bk-ink: color-mix(in srgb, var(--bk-hue) 72%, var(--text-strong));
}

/* The column's HSK levels under the search, spaced as the other parts. */
.ct-panel > .ct-panel-hsk:not(:empty) {
  padding-top: 18px;
}

/* The list of books: a grid of covers, as the video tabs' grid of thumbnails. */
.ct-cards.is-tab_books {
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 26px 18px;
  padding: 4px 24px 8px;
}

/* A book's card: its cover, its title on up to two lines, its level and length. */
.bk-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.bk-card:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
  border-radius: 10px;
}

/* One line under the cover, which shows the whole title: the level and pages line up along a row. */
.bk-title {
  overflow: hidden;
  color: var(--text-strong);
  font: 600 14px/1.35 "Noto Sans SC", var(--font);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bk-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12.5px;
  white-space: nowrap;
}

.bk-chip {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--bk-tint, var(--pill-bg));
  box-shadow: inset 0 0 0 1.5px var(--bk-edge, var(--edge));
  color: var(--bk-ink, var(--text-muted));
  font: 700 12px/1 var(--font-display);
}

.bk-chip.is-big {
  height: 26px;
  padding: 0 10px;
  font-size: 13px;
}

/* A cover: the picture, or the text cover (the shelf's kind, the title large, the spine on the left). */
.bk-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 5px 10px 10px 5px;
  background: var(--bk-tint);
  box-shadow: inset 9px 0 0 var(--bk-hue), inset 0 0 0 2px var(--bk-edge), 0 3px 0 var(--bk-edge);
}

.bk-cover.is-text {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 9px 10px 17px;
  color: var(--bk-ink);
}

.bk-cover.is-picture {
  box-shadow: 0 0 0 2px var(--edge), 0 3px 0 var(--edge);
}

.bk-cover-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bk-cover-kind {
  font: 700 12px/1.2 var(--font-display);
  letter-spacing: 0.08em;
  opacity: 0.8;
}

.bk-cover-title {
  display: -webkit-box;
  overflow: hidden;
  font: 700 19px/1.25 "Noto Sans SC", var(--font);
  word-break: break-all;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.bk-tone-original .bk-cover-title {
  font-family: "Noto Serif SC", "Noto Sans SC", serif;
}

.bk-cover-audio {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 2px 0 var(--bk-edge);
  color: var(--bk-ink);
}

/* A story in chapters: its cover stacked on two more. */
.bk-cover.is-stacked {
  overflow: visible;
  margin: 0 10px 10px 0;
  width: calc(100% - 10px);
  box-shadow: inset 9px 0 0 var(--bk-hue), inset 0 0 0 2px var(--bk-edge),
    5px 5px 0 -1px var(--surface), 5px 5px 0 1px var(--bk-edge),
    10px 10px 0 -1px var(--surface), 10px 10px 0 1px var(--bk-edge);
}

/* "Tất cả sách" as rows of shelves. */
.bk-shelves {
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding: 8px 24px 32px;
}

.bk-shelves[hidden] {
  display: none;
}

.bk-row-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 12px;
}

.bk-row-title {
  margin: 0;
  color: var(--text-strong);
  font: 700 19px/1.25 var(--font-display);
}

.bk-row-count {
  color: var(--text-muted);
  font-size: 13.5px;
}

.bk-row-more {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  padding: 4px 2px 4px 8px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--accent-soft);
  font: 700 14px/1 var(--font-display);
  white-space: nowrap;
  cursor: pointer;
}

.bk-row-more:hover {
  background: var(--hover);
}

.bk-row-books {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  grid-auto-rows: auto;
  gap: 18px;
}

/* A row shows the books that fit on one line; the shelf itself holds the rest. */
.bk-shelves .bk-row-books {
  grid-template-rows: auto;
  grid-auto-rows: 0;
  row-gap: 0;
  overflow: hidden;
}

.bk-row-books.is-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
}

/* The top of the list: a phone's level chips, a chosen shelf's way back and band. */
.bk-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 8px 24px 4px;
}

.bk-head:empty {
  display: none;
}

.bk-level-chips {
  display: none;
}

.bk-back {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 4px;
  padding: 4px 8px 4px 2px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--accent-soft);
  font: 700 14px/1 var(--font-display);
  cursor: pointer;
}

.bk-back:hover {
  background: var(--hover);
}

.bk-band {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  background: var(--bk-tint);
  box-shadow: inset 0 0 0 var(--edge-px) var(--bk-edge), 0 var(--card-lip-px) 0 var(--bk-edge);
  color: var(--bk-ink);
}

.bk-band-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.bk-band-title {
  margin: 0;
  font: 700 22px/1.2 var(--font-display);
}

.bk-band-count {
  font-size: 14px;
  opacity: 0.85;
}

/* A shelf's mark: its level's number, or its kind's icon, on its tint. */
.bk-mark {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--bk-tint);
  box-shadow: inset 0 0 0 2px var(--bk-edge);
  color: var(--bk-ink);
  font: 700 12px/1 var(--font-display);
}

.bk-mark.is-big {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  font-size: 21px;
  font-family: var(--font-number);
  font-weight: 800;
}

.pl-list-picture.bk-mark {
  border-radius: 7px;
}

/* A book opened signed out: the book, what reading it gives, the way in, the list's other books. */
.bk-preview {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: min(980px, 100% - 48px);
  margin: 32px auto;
}

.bk-preview-card {
  display: flex;
  gap: 36px;
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
}

.bk-preview-cover {
  flex: none;
  width: 200px;
}

.bk-preview-cover .bk-cover-title {
  font-size: 28px;
}

.bk-preview-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.bk-preview-title {
  margin: 0;
  color: var(--text-strong);
  font: 700 32px/1.25 "Noto Sans SC", var(--font);
}

.bk-preview-author {
  margin: -6px 0 0;
  color: var(--text-muted);
  font-size: 15px;
}

.bk-preview-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bk-preview-lead {
  margin: 6px 0 0;
  color: var(--text-strong);
  font: 700 14px/1.3 var(--font-display);
}

.bk-preview-gains {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bk-preview-gains li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  text-wrap: balance;
}

.bk-gain-icon {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--chip);
  box-shadow: var(--chip-shadow);
  color: var(--chip-text);
}

.bk-preview-actions {
  margin-top: 8px;
}

.bk-preview-actions .btn-primary {
  height: 44px;
  padding: 0 22px;
  margin-bottom: var(--lip-px);
}

.bk-preview-more .bk-row-title {
  margin-bottom: 12px;
}

.bk-preview-more .bk-row-books {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

/* A phone: the level chips over the list, three covers a row, a shelf's row scrolls sideways. */
@media (max-width: 600px) {
  .ct-cards.is-tab_books {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px 12px;
    padding: 4px 16px 8px;
  }

  .bk-cover-title {
    font-size: 15px;
  }

  /* A phone's narrow cover keeps its title and leaves the shelf's kind out. */
  .bk-cover-kind {
    visibility: hidden;
  }

  .bk-title {
    font-size: 13px;
  }

  .bk-head {
    padding: 10px 16px 2px;
  }

  .bk-level-chips {
    display: flex;
    gap: 6px;
    margin: 0 -16px;
    padding: 0 16px 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .bk-level-chip {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 13px 0 10px;
    border: 0;
    border-radius: 17px;
    background: var(--surface);
    box-shadow: inset 0 0 0 var(--edge-px) var(--edge);
    color: var(--text-label);
    font: 700 13px/1 var(--font-display);
    white-space: nowrap;
  }

  .bk-level-chip.is-on {
    background: var(--chip);
    box-shadow: var(--chip-shadow);
    color: var(--chip-text);
  }

  .bk-level-chip .bk-mark {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    font-size: 12px;
  }

  .bk-shelves {
    gap: 24px;
    padding: 6px 16px 24px;
  }

  .bk-row-title {
    font-size: 17px;
  }

  .bk-shelves .bk-row-books {
    display: flex;
    gap: 12px;
    margin: 0 -16px;
    padding: 0 16px 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .bk-shelves .bk-row-books > .bk-card {
    flex: none;
    width: 104px;
  }

  .bk-band {
    padding: 12px 14px;
  }

  .bk-band-title {
    font-size: 19px;
  }

  .bk-preview {
    width: auto;
    margin: 16px;
  }

  .bk-preview-card {
    flex-direction: column;
    gap: 18px;
    padding: 18px;
  }

  .bk-preview-cover {
    width: 140px;
  }

  .bk-preview-title {
    font-size: 26px;
  }

  .bk-preview-more .bk-row-books {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
