/* 模拟书架：仅作用于内置样章与个人书库。 */
html, body { height: auto; min-height: 100%; overflow-x: clip; }
body { min-height: 100vh; }

.shelf-surface {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-3);
  box-shadow: 0 4px 18px color-mix(in srgb, var(--ink) 7%, transparent);
}
.shelf-section .book-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-rows: 238px;
  justify-items: center;
  align-items: start;
  gap: 20px;
  padding: 24px 24px 26px;
  background: repeating-linear-gradient(to bottom,
    transparent 0 212px, #bbad91 212px 216px,
    #d7ccb5 216px 226px, transparent 226px 258px);
}
.shelf-section .book-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(100%, 154px);
  min-width: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.shelf-section .book-card:hover { transform: translateY(-5px); }
.shelf-section .bc-cover {
  width: 100%;
  height: 188px;
  flex: none;
  border-radius: 2px 7px 7px 2px;
  padding: 14px 12px;
  font-size: 16px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16), 1px 2px 4px rgba(54, 44, 29, .22);
}

/* 首页重排后的书架节奏：标题与层板共享同一行距，书影不再悬空。 */
.shelf-section .book-grid { padding-top: 24px; padding-bottom: 28px; }
.shelf-section .book-card:hover { transform: translateY(-3px); }
.shelf-section .bc-title { padding-top: 15px; }
.shelf-section .bc-sub { color: var(--ink-3); }
@media (max-width: 880px) { .shelf-section .book-grid { padding-top: 24px; padding-bottom: 26px; } }
.shelf-section .bc-cover::before {
  content: '';
  position: absolute;
  inset: 12px 12px 12px 14px;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 1px 4px 4px 1px;
  pointer-events: none;
}
.shelf-section .bc-cover::after { width: 8px; background: rgba(0, 0, 0, .17); }
.shelf-section .bc-cover span { max-height: 154px; line-height: 1.7; }
.shelf-section .bc-c0 { background: #345e66; }
.shelf-section .bc-c1 { background: #856956; }
.shelf-section .bc-c2 { background: #637b63; }
.shelf-section .bc-c3 { background: #514e68; writing-mode: horizontal-tb; }
.shelf-section .bc-c4 { background: #986f55; }
.shelf-section .bc-c5 { background: #50646c; }
.shelf-section .bc-c3 span { max-height: none; text-align: center; line-height: 1.35; letter-spacing: .04em; }
.shelf-section .bc-text { background: #345e66; }
.shelf-section .bc-epub { background: #65745e; }
.shelf-section .bc-pdf { background: #925f4e; }
.shelf-section .bc-title { padding: 18px 2px 3px; font-size: 13px; font-weight: 650; line-height: 1.4; }
.shelf-section .bc-sub { padding: 0 2px; font-size: 11px; }
.shelf-section .bc-title, .shelf-section .bc-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.shelf-section .bc-del { opacity: 1; top: 7px; right: 7px; }

@media (max-width: 880px) {
  .shelf-section .book-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 214px;
    gap: 20px 12px;
    padding: 24px 17px 26px;
    background: repeating-linear-gradient(to bottom,
      transparent 0 188px, #bbad91 188px 192px,
      #d7ccb5 192px 202px, transparent 202px 234px);
  }
  .shelf-section .bc-cover { height: 164px; font-size: 14px; }
  .shelf-section .bc-title { padding-top: 14px; }
}
@media (max-width: 560px) {
  .shelf-section .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 14px; }
  .shelf-section .book-card { width: min(100%, 146px); }
}
