/**
 * 书房 · Apple Books 风格书架
 */
body.page-bg:has(.bs-page--library) .site-breadcrumb {
  margin-bottom: 0.35rem;
}

.bs-page--library {
  flex: 1;
  min-height: 0;
  background: #fff;
}

.bs-library {
  flex: 1;
  padding-top: 0.25rem;
  padding-bottom: 2rem;
}

.bs-library-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1.35rem;
}

.bs-library-kicker {
  margin: 0 0 0.15rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(11, 11, 11, 0.42);
}

.bs-library-title {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #0b0b0b;
}

.bs-library-desc {
  margin: 0.35rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: rgba(11, 11, 11, 0.55);
}

.bs-library-hint {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: rgba(11, 11, 11, 0.45);
}

.bs-import-panel {
  margin-bottom: 1.25rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  background: #fafafa;
  overflow: hidden;
}

.bs-import-summary {
  cursor: pointer;
  list-style: none;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0b0b0b;
  user-select: none;
}

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

.bs-import-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.bs-import-desc {
  margin: 0.75rem 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: rgba(11, 11, 11, 0.55);
}

.bs-import-desc code {
  font-size: 0.75rem;
  background: #fff;
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
}

.bs-import-textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #fff;
  resize: vertical;
  min-height: 6rem;
}

.bs-import-textarea:focus {
  outline: none;
  border-color: rgba(0, 0, 0, 0.35);
}

.bs-import-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.65rem;
}

.bs-import-btn {
  border: 0;
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  background: #0b0b0b;
  color: #fff;
  cursor: pointer;
}

.bs-import-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.bs-import-status {
  font-size: 0.8125rem;
  color: rgba(11, 11, 11, 0.5);
}

.bs-import-log {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 0.75rem;
  line-height: 1.45;
  white-space: pre-wrap;
  color: rgba(11, 11, 11, 0.72);
}

.bs-import-log.hidden {
  display: none;
}

.bs-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 1.35rem 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .bs-shelf {
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
    gap: 1.75rem 1.35rem;
  }
}

@media (min-width: 1024px) {
  .bs-shelf {
    grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  }
}

.bs-book-card-wrap {
  min-width: 0;
}

.bs-book-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
  outline: none;
}

.bs-book-cover-shell {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(145deg, #f5f5f7 0%, #ececef 100%);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.06),
    0 8px 24px rgba(0, 0, 0, 0.08);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

@media (hover: hover) {
  .bs-book-card:hover .bs-book-cover-shell,
  .bs-book-card:focus-visible .bs-book-cover-shell {
    transform: translateY(-3px) scale(1.015);
    box-shadow:
      0 2px 4px rgba(0, 0, 0, 0.06),
      0 14px 32px rgba(0, 0, 0, 0.12);
  }
}

.bs-book-cover {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bs-book-progress {
  position: absolute;
  right: 0.45rem;
  bottom: 0.45rem;
  min-width: 2rem;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(8px);
}

.bs-book-card--started .bs-book-cover-shell::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: #ff375f;
  transform-origin: left;
}

.bs-book-meta {
  min-width: 0;
}

.bs-book-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: #0b0b0b;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bs-book-author {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: rgba(11, 11, 11, 0.52);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bs-book-subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.6875rem;
  line-height: 1.35;
  color: rgba(11, 11, 11, 0.4);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bs-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 3rem 1rem 4rem;
}

.bs-empty-cover {
  width: 6.5rem;
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  background: linear-gradient(145deg, #f5f5f7, #e8e8ed);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  margin-bottom: 1.25rem;
}

.bs-empty-title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: #0b0b0b;
}

.bs-empty-desc {
  margin: 0;
  max-width: 22rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: rgba(11, 11, 11, 0.55);
}

.bs-empty-desc code {
  font-size: 0.8125rem;
  background: #f5f5f7;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}
