card-book.css 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. /* resources/css/components/card-book.css
  2. 书籍封面组件(.book-cover)+ 纵向书籍卡片(.card-book)。
  3. .book-cover 从 anthology.css 提取,供 anthology / tipitaka 共用。
  4. */
  5. /* ══════════════════════════════════════════
  6. 一、书籍封面(.book-cover)
  7. ══════════════════════════════════════════ */
  8. .book-cover {
  9. position: relative;
  10. overflow: hidden;
  11. display: flex;
  12. flex-direction: column;
  13. align-items: center;
  14. justify-content: center;
  15. }
  16. /* 尺寸 */
  17. .book-cover--sm {
  18. width: 34px;
  19. min-width: 34px;
  20. height: 46px;
  21. }
  22. .book-cover--md {
  23. width: 130px;
  24. min-width: 130px;
  25. height: 180px;
  26. }
  27. .book-cover--lg {
  28. width: 155px;
  29. min-width: 155px;
  30. height: 215px;
  31. border-radius: 3px 9px 9px 3px;
  32. }
  33. /* 3D 书脊 */
  34. .book-cover--3d {
  35. box-shadow:
  36. -4px 0 0 rgba(0, 0, 0, 0.3),
  37. -6px 4px 14px rgba(0, 0, 0, 0.4),
  38. 4px 4px 18px rgba(0, 0, 0, 0.3);
  39. }
  40. .book-cover--3d::before {
  41. content: '';
  42. position: absolute;
  43. left: 0;
  44. top: 0;
  45. bottom: 0;
  46. width: 13px;
  47. background: linear-gradient(
  48. to right,
  49. rgba(0, 0, 0, 0.4),
  50. rgba(0, 0, 0, 0.1)
  51. );
  52. border-radius: 3px 0 0 3px;
  53. z-index: 2;
  54. }
  55. /* 纹理叠加 */
  56. .book-cover::after {
  57. content: '';
  58. position: absolute;
  59. inset: 0;
  60. background: repeating-linear-gradient(
  61. 45deg,
  62. transparent,
  63. transparent 8px,
  64. rgba(255, 255, 255, 0.015) 8px,
  65. rgba(255, 255, 255, 0.015) 9px
  66. );
  67. z-index: 1;
  68. }
  69. /* 图片封面 */
  70. .book-cover__img {
  71. position: absolute;
  72. inset: 0;
  73. width: 100%;
  74. height: 100%;
  75. object-fit: cover;
  76. }
  77. /* 文字封面 */
  78. .book-cover__text {
  79. position: relative;
  80. z-index: 3;
  81. text-align: center;
  82. padding: 0 0.5rem;
  83. }
  84. .book-cover__title {
  85. font-family: 'Noto Serif SC', 'Noto Serif', Georgia, serif;
  86. font-size: 1rem;
  87. font-weight: 600;
  88. color: #fff;
  89. line-height: 1.6;
  90. letter-spacing: 0.12em;
  91. word-break: break-all;
  92. }
  93. .book-cover--sm .book-cover__title {
  94. font-size: 0.6rem;
  95. letter-spacing: 0.04em;
  96. line-height: 1.3;
  97. }
  98. .book-cover__divider {
  99. width: 28px;
  100. height: 1px;
  101. background: var(--wp-brand);
  102. margin: 0.5rem auto;
  103. }
  104. .book-cover__subtitle {
  105. font-size: 0.65rem;
  106. color: rgba(255, 255, 255, 0.45);
  107. letter-spacing: 0.04em;
  108. }
  109. /* ══════════════════════════════════════════
  110. 二、纵向书籍卡片(.card-book)
  111. tipitaka 列表页使用
  112. ══════════════════════════════════════════ */
  113. .card-book {
  114. transition:
  115. transform 0.2s,
  116. box-shadow 0.2s;
  117. }
  118. .card-book:hover {
  119. transform: translateY(-2px);
  120. box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  121. }
  122. .card-book__link {
  123. display: block;
  124. text-decoration: none;
  125. color: inherit;
  126. }
  127. .card-book__link:hover {
  128. text-decoration: none;
  129. color: inherit;
  130. }
  131. /* 封面撑满卡片宽度 */
  132. .card-book .book-cover--md {
  133. width: 100%;
  134. min-width: unset;
  135. height: 200px;
  136. border-radius: var(--tblr-border-radius);
  137. }
  138. @media (max-width: 768px) {
  139. .card-book .book-cover--md {
  140. height: 150px;
  141. }
  142. }
  143. .card-book__info {
  144. padding: 0.75rem 0 0;
  145. }
  146. .card-book__title {
  147. font-size: 0.9375rem;
  148. font-weight: 600;
  149. color: var(--tblr-body-color);
  150. margin-bottom: 0.25rem;
  151. line-height: 1.4;
  152. display: -webkit-box;
  153. -webkit-line-clamp: 2;
  154. -webkit-box-orient: vertical;
  155. overflow: hidden;
  156. }
  157. .card-book:hover .card-book__title {
  158. color: var(--tblr-primary);
  159. }
  160. .card-book__author,
  161. .card-book__publisher {
  162. font-size: 0.8125rem;
  163. color: var(--tblr-secondary);
  164. margin-bottom: 0.25rem;
  165. }
  166. .card-book__publisher-link {
  167. color: var(--tblr-primary);
  168. text-decoration: none;
  169. }
  170. .card-book__publisher-link:hover {
  171. text-decoration: underline;
  172. }
  173. .card-book__badges {
  174. display: flex;
  175. flex-wrap: wrap;
  176. gap: 4px;
  177. margin-top: 0.375rem;
  178. }
  179. .card-book__badge {
  180. display: inline-block;
  181. padding: 2px 8px;
  182. background: var(--tblr-bg-surface-secondary);
  183. border: 1px solid var(--tblr-border-color);
  184. border-radius: 20px;
  185. font-size: 0.6875rem;
  186. color: var(--tblr-secondary);
  187. }
  188. /* ══════════════════════════════════════════
  189. 三、书籍网格
  190. ══════════════════════════════════════════ */
  191. .book-grid {
  192. display: grid;
  193. grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  194. gap: 1.25rem;
  195. }
  196. @media (max-width: 575px) {
  197. .book-grid {
  198. grid-template-columns: repeat(2, 1fr);
  199. gap: 0.875rem;
  200. }
  201. }