index.blade.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. @extends('library.layouts.app')
  2. @section('title', '文集 · 巴利书库')
  3. @push('styles')
  4. <link rel="preconnect" href="https://fonts.googleapis.com">
  5. <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700&family=Noto+Sans+SC:wght@300;400;500&display=swap" rel="stylesheet">
  6. <style>
  7. :root {
  8. --sf: #c8860a;
  9. --sf-light: #f5e6c8;
  10. --sf-pale: #fdf8f0;
  11. --ink: #1a1208;
  12. --ink-soft: #4a3f2f;
  13. --ink-muted: #8a7a68;
  14. --bdr: #e8ddd0;
  15. --card-bg: #fffdf9;
  16. }
  17. body { background: var(--sf-pale) !important; font-family: 'Noto Sans SC', sans-serif; }
  18. /* Page header */
  19. .anthology-page-header {
  20. background: linear-gradient(135deg, var(--ink) 0%, #2d2010 100%);
  21. padding: 2.25rem 0 2rem;
  22. position: relative;
  23. overflow: hidden;
  24. margin-bottom: 0;
  25. }
  26. .anthology-page-header::before {
  27. content: '藏';
  28. font-family: 'Noto Serif SC', serif;
  29. font-size: 16rem;
  30. font-weight: 700;
  31. color: rgba(255,255,255,0.03);
  32. position: absolute;
  33. right: -1rem;
  34. top: -2.5rem;
  35. line-height: 1;
  36. pointer-events: none;
  37. }
  38. .anthology-page-header h1 {
  39. font-family: 'Noto Serif SC', serif;
  40. font-size: 1.75rem;
  41. font-weight: 600;
  42. color: #fff;
  43. margin: 0 0 0.3rem;
  44. letter-spacing: 0.08em;
  45. }
  46. .anthology-page-header p { color: rgba(255,255,255,0.45); font-size: 0.85rem; margin: 0; }
  47. .result-badge {
  48. background: var(--sf);
  49. color: var(--ink);
  50. font-size: 0.75rem;
  51. font-weight: 700;
  52. padding: 2px 9px;
  53. border-radius: 20px;
  54. margin-left: 0.6rem;
  55. vertical-align: middle;
  56. }
  57. /* Card */
  58. .anthology-card {
  59. background: var(--card-bg);
  60. border: 1px solid var(--bdr);
  61. border-radius: 10px;
  62. overflow: hidden;
  63. display: flex;
  64. transition: box-shadow .25s, transform .25s;
  65. margin-bottom: 1.1rem;
  66. text-decoration: none;
  67. color: inherit;
  68. }
  69. .anthology-card:hover {
  70. box-shadow: 0 8px 28px rgba(200,134,10,.12), 0 2px 8px rgba(0,0,0,.06);
  71. transform: translateY(-2px);
  72. color: inherit;
  73. text-decoration: none;
  74. }
  75. .card-cover {
  76. width: 130px;
  77. min-width: 130px;
  78. display: flex;
  79. flex-direction: column;
  80. align-items: center;
  81. justify-content: center;
  82. padding: 1.1rem 0.7rem;
  83. position: relative;
  84. overflow: hidden;
  85. }
  86. .card-cover img {
  87. width: 100%;
  88. height: 100%;
  89. object-fit: cover;
  90. position: absolute;
  91. inset: 0;
  92. }
  93. .card-cover::after {
  94. content: '';
  95. position: absolute;
  96. inset: 0;
  97. background: repeating-linear-gradient(45deg, transparent, transparent 8px, rgba(255,255,255,.015) 8px, rgba(255,255,255,.015) 9px);
  98. }
  99. .cover-text-wrap { position: relative; z-index: 1; text-align: center; }
  100. .cover-title {
  101. font-family: 'Noto Serif SC', serif;
  102. font-size: 1rem;
  103. font-weight: 600;
  104. color: #fff;
  105. line-height: 1.6;
  106. letter-spacing: .12em;
  107. word-break: break-all;
  108. }
  109. .cover-divider { width: 28px; height: 1px; background: var(--sf); margin: .5rem auto; }
  110. .cover-sub { font-size: .65rem; color: rgba(255,255,255,.45); letter-spacing: .04em; }
  111. .card-body-inner { padding: 1.1rem 1.4rem; flex: 1; display: flex; flex-direction: column; }
  112. .card-main-title {
  113. font-family: 'Noto Serif SC', serif;
  114. font-size: 1.1rem;
  115. font-weight: 600;
  116. color: var(--ink);
  117. margin-bottom: .35rem;
  118. line-height: 1.4;
  119. }
  120. .anthology-card:hover .card-main-title { color: var(--sf); }
  121. .card-desc { font-size: .8rem; color: var(--ink-muted); margin-bottom: .65rem; line-height: 1.65; }
  122. .card-author { display: flex; align-items: center; gap: .45rem; margin-bottom: .7rem; }
  123. .a-avatar {
  124. width: 24px; height: 24px; border-radius: 50%;
  125. display: flex; align-items: center; justify-content: center;
  126. font-size: .65rem; font-weight: 700; color: #fff; flex-shrink: 0;
  127. }
  128. .a-avatar-img {
  129. width: 24px; height: 24px; border-radius: 50%;
  130. object-fit: cover; flex-shrink: 0;
  131. }
  132. .a-name { font-size: .8rem; color: var(--ink-soft); font-weight: 500; }
  133. .chapter-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: auto; }
  134. .c-tag {
  135. font-size: .7rem; color: var(--ink-muted);
  136. background: var(--sf-light); border: 1px solid var(--bdr);
  137. padding: 1px 7px; border-radius: 4px; white-space: nowrap;
  138. }
  139. .c-tag.more { background: transparent; border-color: transparent; color: var(--sf); }
  140. .card-meta-row {
  141. display: flex; align-items: center; gap: .85rem;
  142. margin-top: .65rem; padding-top: .65rem;
  143. border-top: 1px solid var(--bdr);
  144. }
  145. .meta-it { font-size: .72rem; color: var(--ink-muted); display: flex; align-items: center; gap: .25rem; }
  146. /* Pagination — force horizontal */
  147. .anthology-pagination .pagination {
  148. display: flex !important;
  149. flex-direction: row !important;
  150. flex-wrap: wrap;
  151. gap: 3px;
  152. justify-content: center;
  153. list-style: none;
  154. padding: 0;
  155. margin: 0;
  156. }
  157. .anthology-pagination .page-item { display: inline-block; }
  158. .anthology-pagination .page-item .page-link {
  159. border: 1px solid var(--bdr);
  160. color: var(--ink-soft);
  161. font-size: .82rem;
  162. padding: 5px 11px;
  163. background: var(--card-bg);
  164. border-radius: 5px;
  165. display: inline-block;
  166. line-height: 1.5;
  167. text-decoration: none;
  168. }
  169. .anthology-pagination .page-item.active .page-link { background: var(--sf); border-color: var(--sf); color: #fff; }
  170. .anthology-pagination .page-item .page-link:hover { background: var(--sf-light); color: var(--sf); }
  171. .anthology-pagination .page-item.disabled .page-link { opacity: .45; pointer-events: none; }
  172. /* Sidebar */
  173. .sidebar-box {
  174. background: var(--card-bg);
  175. border: 1px solid var(--bdr);
  176. border-radius: 10px;
  177. overflow: hidden;
  178. margin-bottom: 1.1rem;
  179. }
  180. .sb-header {
  181. padding: .75rem 1.15rem;
  182. border-bottom: 1px solid var(--bdr);
  183. font-family: 'Noto Serif SC', serif;
  184. font-size: .875rem;
  185. font-weight: 600;
  186. color: var(--ink-soft);
  187. letter-spacing: .04em;
  188. display: flex;
  189. align-items: center;
  190. gap: .45rem;
  191. }
  192. .sb-header::before {
  193. content: '';
  194. display: block;
  195. width: 3px;
  196. height: 13px;
  197. background: var(--sf);
  198. border-radius: 2px;
  199. }
  200. .author-ul { list-style: none; padding: .35rem 0; margin: 0; }
  201. .author-ul li a {
  202. display: flex; align-items: center; gap: .6rem;
  203. padding: .45rem 1.15rem;
  204. text-decoration: none;
  205. transition: background .15s;
  206. }
  207. .author-ul li a:hover { background: var(--sf-pale); }
  208. .au-avatar {
  209. width: 28px; height: 28px; border-radius: 50%;
  210. display: flex; align-items: center; justify-content: center;
  211. font-size: .68rem; font-weight: 700; color: #fff; flex-shrink: 0;
  212. }
  213. .au-avatar-img {
  214. width: 28px; height: 28px; border-radius: 50%;
  215. object-fit: cover; flex-shrink: 0;
  216. }
  217. .au-name { font-size: .8rem; color: var(--ink-soft); font-weight: 500; display: block; }
  218. .au-count { font-size: .7rem; color: var(--ink-muted); }
  219. /* Search */
  220. .search-wrap { background: var(--card-bg); border: 1px solid var(--bdr); border-radius: 10px; padding: .85rem 1.1rem; margin-bottom: 1.1rem; }
  221. .search-input {
  222. width: 100%;
  223. border: 1px solid var(--bdr);
  224. border-radius: 6px;
  225. padding: .45rem .9rem;
  226. font-size: .83rem;
  227. font-family: 'Noto Sans SC', sans-serif;
  228. background: var(--sf-pale);
  229. color: var(--ink);
  230. outline: none;
  231. transition: border-color .2s;
  232. }
  233. .search-input:focus { border-color: var(--sf); background: #fff; }
  234. .search-input::placeholder { color: var(--ink-muted); }
  235. @media (max-width:768px) {
  236. .anthology-card { flex-direction: column; }
  237. .card-cover { width: 100%; min-width: unset; height: 90px; }
  238. }
  239. </style>
  240. @endpush
  241. @section('content')
  242. <div class="anthology-page-header">
  243. <div class="container-xl">
  244. <h1>文集 <span class="result-badge">{{ $total }}</span></h1>
  245. <p>经论注疏 · 禅修指引 · 法义探讨</p>
  246. </div>
  247. </div>
  248. <div class="page-body" style="background: var(--sf-pale);">
  249. <div class="container-xl">
  250. <div class="row mt-3">
  251. {{-- Left --}}
  252. <div class="col-lg-9">
  253. @forelse($anthologies as $item)
  254. <a href="{{ route('library.anthology.show', $item['id']) }}" class="anthology-card">
  255. {{-- Cover --}}
  256. <div class="card-cover" style="{{ $item['cover_image'] ? '' : 'background: ' . $item['cover_gradient'] }}">
  257. @if($item['cover_image'])
  258. <img src="{{ $item['cover_image'] }}" alt="{{ $item['title'] }}">
  259. @else
  260. <div class="cover-text-wrap">
  261. <div class="cover-title">{{ $item['title'] }}</div>
  262. <div class="cover-divider"></div>
  263. <div class="cover-sub">{{ $item['subtitle'] ?? '' }}</div>
  264. </div>
  265. @endif
  266. </div>
  267. {{-- Body --}}
  268. <div class="card-body-inner">
  269. <div class="card-main-title">{{ $item['title'] }}</div>
  270. @if(!empty($item['description']))
  271. <div class="card-desc">{{ $item['description'] }}</div>
  272. @endif
  273. <div class="card-author">
  274. @if(!empty($item['author']['avatar']))
  275. <img src="{{ $item['author']['avatar'] }}" class="a-avatar-img" alt="">
  276. @else
  277. <div class="a-avatar" style="background: {{ $item['author']['color'] }}">
  278. {{ $item['author']['initials'] }}
  279. </div>
  280. @endif
  281. <span class="a-name">{{ $item['author']['name'] }}</span>
  282. </div>
  283. <div class="chapter-tags">
  284. @foreach(array_slice($item['chapters'], 0, 4) as $ch)
  285. <span class="c-tag" title="{{ $ch }}">{{ mb_strimwidth($ch, 0, 14, '…') }}</span>
  286. @endforeach
  287. @if($item['children_number'] > 4)
  288. <span class="c-tag more">+{{ $item['children_number'] - 4 }} 章</span>
  289. @endif
  290. </div>
  291. <div class="card-meta-row">
  292. <span class="meta-it">
  293. <i class="ti ti-calendar" style="font-size:.82rem;"></i>
  294. {{ $item['updated_at'] }}
  295. </span>
  296. <span class="meta-it">
  297. <i class="ti ti-file-text" style="font-size:.82rem;"></i>
  298. {{ $item['children_number'] }} 章节
  299. </span>
  300. </div>
  301. </div>
  302. </a>
  303. @empty
  304. <div class="text-center py-5 text-muted">暂无文集</div>
  305. @endforelse
  306. {{-- Pagination --}}
  307. <div class="d-flex justify-content-center mt-3 anthology-pagination">
  308. {{ $anthologies->links('library.anthology.pagination') }}
  309. </div>
  310. </div>{{-- /col --}}
  311. {{-- Sidebar --}}
  312. <div class="col-lg-3">
  313. <div class="search-wrap">
  314. <input type="text" class="search-input" placeholder="搜索文集…">
  315. </div>
  316. <div class="sidebar-box">
  317. <div class="sb-header">作者</div>
  318. <ul class="author-ul">
  319. @foreach($authors as $author)
  320. <li>
  321. <a href="#">
  322. @if(!empty($author['avatar']))
  323. <img src="{{ $author['avatar'] }}" class="au-avatar-img" alt="">
  324. @else
  325. <div class="au-avatar" style="background: {{ $author['color'] }}">{{ $author['initials'] }}</div>
  326. @endif
  327. <div>
  328. <span class="au-name">{{ $author['name'] }}</span>
  329. <span class="au-count">{{ $author['count'] }} 篇文集</span>
  330. </div>
  331. </a>
  332. </li>
  333. @endforeach
  334. </ul>
  335. </div>
  336. </div>
  337. </div>
  338. </div>
  339. </div>
  340. @endsection