library-course.css 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467
  1. /* resources/css/modules/library-course.css
  2. 课程栏目专属样式。
  3. 视觉语言沿用 --wp-* 暖金 token,与 anthology / library-index 一致。
  4. */
  5. /* ══════════════════════════════════════════
  6. 〇、区块通用结构(课程页独立声明,不依赖 library-index.css)
  7. ══════════════════════════════════════════ */
  8. .lib-section {
  9. margin-top: 3rem;
  10. margin-bottom: 0.5rem;
  11. }
  12. .lib-section__header {
  13. display: flex;
  14. align-items: center;
  15. gap: 0.75rem;
  16. margin-bottom: 1rem;
  17. padding-bottom: 0.75rem;
  18. border-bottom: 1px solid var(--wp-border);
  19. }
  20. .lib-section__title {
  21. font-size: 1rem;
  22. font-weight: 600;
  23. color: var(--wp-ink);
  24. margin: 0;
  25. display: flex;
  26. align-items: center;
  27. gap: 0.5rem;
  28. flex: 1;
  29. }
  30. .lib-section__title .ti {
  31. font-size: 1.125rem;
  32. color: var(--wp-brand);
  33. }
  34. .lib-section__more {
  35. font-size: 0.8125rem;
  36. color: var(--wp-brand);
  37. text-decoration: none;
  38. white-space: nowrap;
  39. display: flex;
  40. align-items: center;
  41. gap: 0.25rem;
  42. flex-shrink: 0;
  43. }
  44. .lib-section__more:hover {
  45. text-decoration: underline;
  46. }
  47. /* ══════════════════════════════════════════
  48. 一、统计条
  49. ══════════════════════════════════════════ */
  50. .course-stats {
  51. display: grid;
  52. grid-template-columns: repeat(3, minmax(0, 1fr));
  53. gap: 1rem;
  54. margin-top: 1.5rem;
  55. }
  56. .course-stat {
  57. background: var(--wp-card-bg);
  58. border: 1px solid var(--wp-border);
  59. border-radius: 10px;
  60. padding: 1.25rem 1rem;
  61. text-align: center;
  62. }
  63. .course-stat__value {
  64. font-size: 1.75rem;
  65. font-weight: 700;
  66. color: var(--wp-brand);
  67. line-height: 1.2;
  68. font-variant-numeric: tabular-nums;
  69. }
  70. .course-stat__label {
  71. font-size: 0.75rem;
  72. color: var(--wp-ink-muted);
  73. margin-top: 0.375rem;
  74. }
  75. /* ══════════════════════════════════════════
  76. 二、最新课程卡片网格
  77. ══════════════════════════════════════════ */
  78. .course-grid {
  79. display: grid;
  80. grid-template-columns: repeat(4, minmax(0, 1fr));
  81. gap: 1rem;
  82. }
  83. .course-card {
  84. display: flex;
  85. flex-direction: column;
  86. background: var(--wp-card-bg);
  87. border: 1px solid var(--wp-border);
  88. border-radius: 10px;
  89. overflow: hidden;
  90. text-decoration: none;
  91. color: inherit;
  92. transition:
  93. box-shadow 0.2s,
  94. transform 0.2s;
  95. height: 100%;
  96. }
  97. .course-card:hover {
  98. box-shadow:
  99. 0 8px 24px rgba(200, 134, 10, 0.12),
  100. 0 2px 8px rgba(0, 0, 0, 0.06);
  101. transform: translateY(-2px);
  102. color: inherit;
  103. text-decoration: none;
  104. }
  105. .course-card__cover {
  106. position: relative;
  107. aspect-ratio: 16 / 10;
  108. background-size: cover;
  109. background-position: center;
  110. display: flex;
  111. align-items: center;
  112. justify-content: center;
  113. overflow: hidden;
  114. }
  115. .course-card__cover-img {
  116. width: 100%;
  117. height: 100%;
  118. object-fit: cover;
  119. display: block;
  120. }
  121. .course-card__cover-fallback {
  122. color: rgba(255, 255, 255, 0.92);
  123. font-family: 'Noto Serif SC', 'Noto Serif', Georgia, serif;
  124. font-size: 1.05rem;
  125. font-weight: 600;
  126. padding: 0 1rem;
  127. text-align: center;
  128. line-height: 1.4;
  129. display: -webkit-box;
  130. -webkit-line-clamp: 2;
  131. -webkit-box-orient: vertical;
  132. overflow: hidden;
  133. }
  134. .course-card__body {
  135. padding: 1rem 1.1rem 1.1rem;
  136. display: flex;
  137. flex-direction: column;
  138. gap: 0.5rem;
  139. flex: 1;
  140. }
  141. .course-card__title {
  142. font-family: 'Noto Serif SC', 'Noto Serif', Georgia, serif;
  143. font-size: 1rem;
  144. font-weight: 600;
  145. color: var(--wp-ink);
  146. line-height: 1.4;
  147. margin: 0;
  148. display: -webkit-box;
  149. -webkit-line-clamp: 2;
  150. -webkit-box-orient: vertical;
  151. overflow: hidden;
  152. min-height: 2.8em;
  153. }
  154. .course-card:hover .course-card__title {
  155. color: var(--wp-brand);
  156. }
  157. .course-card__teacher {
  158. min-height: 1.5rem;
  159. }
  160. .course-card__foot {
  161. display: flex;
  162. align-items: center;
  163. gap: 0.75rem;
  164. font-size: 0.75rem;
  165. color: var(--wp-ink-muted);
  166. margin-top: auto;
  167. font-variant-numeric: tabular-nums;
  168. }
  169. /* ══════════════════════════════════════════
  170. 三、状态徽章
  171. ══════════════════════════════════════════ */
  172. .course-badge {
  173. display: inline-flex;
  174. align-items: center;
  175. font-size: 0.6875rem;
  176. font-weight: 600;
  177. line-height: 1;
  178. padding: 4px 9px;
  179. border-radius: 20px;
  180. white-space: nowrap;
  181. }
  182. .course-badge--open {
  183. background: #eaf3de;
  184. color: #3b6d11;
  185. border: 1px solid #c0dd97;
  186. }
  187. .course-badge--closed {
  188. background: #f1efe8;
  189. color: #6b6a64;
  190. border: 1px solid #d8d6cc;
  191. }
  192. .course-card__cover .course-badge {
  193. position: absolute;
  194. top: 0.75rem;
  195. left: 0.75rem;
  196. box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  197. }
  198. /* ══════════════════════════════════════════
  199. 四、横向列表行(开放报名 / 历史课程)
  200. ══════════════════════════════════════════ */
  201. .course-list {
  202. display: grid;
  203. grid-template-columns: 1fr;
  204. gap: 1rem;
  205. }
  206. /* 桌面端改为两列,避免横向卡片过宽、中间留白 */
  207. @media (min-width: 992px) {
  208. .course-list {
  209. grid-template-columns: repeat(2, minmax(0, 1fr));
  210. }
  211. }
  212. .course-row {
  213. display: flex;
  214. align-items: center;
  215. gap: 1rem;
  216. background: var(--wp-card-bg);
  217. border: 1px solid var(--wp-border);
  218. border-radius: 10px;
  219. padding: 0.85rem 1.1rem;
  220. text-decoration: none;
  221. color: inherit;
  222. transition:
  223. box-shadow 0.2s,
  224. transform 0.2s,
  225. border-color 0.2s;
  226. }
  227. .course-row:hover {
  228. box-shadow: 0 6px 20px rgba(200, 134, 10, 0.1);
  229. transform: translateY(-1px);
  230. border-color: var(--wp-brand-light);
  231. color: inherit;
  232. text-decoration: none;
  233. }
  234. .course-row__thumb {
  235. width: 112px;
  236. height: 72px;
  237. flex-shrink: 0;
  238. border-radius: 6px;
  239. overflow: hidden;
  240. background-size: cover;
  241. background-position: center;
  242. display: flex;
  243. align-items: center;
  244. justify-content: center;
  245. }
  246. .course-row__thumb img {
  247. width: 100%;
  248. height: 100%;
  249. object-fit: cover;
  250. display: block;
  251. }
  252. .course-row__thumb span {
  253. color: rgba(255, 255, 255, 0.9);
  254. font-size: 0.72rem;
  255. font-weight: 600;
  256. padding: 0 0.5rem;
  257. text-align: center;
  258. line-height: 1.3;
  259. display: -webkit-box;
  260. -webkit-line-clamp: 2;
  261. -webkit-box-orient: vertical;
  262. overflow: hidden;
  263. }
  264. .course-row__main {
  265. flex: 1;
  266. min-width: 0;
  267. }
  268. .course-row__title {
  269. font-size: 0.95rem;
  270. font-weight: 600;
  271. color: var(--wp-ink);
  272. line-height: 1.4;
  273. margin: 0 0 0.2rem;
  274. white-space: nowrap;
  275. overflow: hidden;
  276. text-overflow: ellipsis;
  277. }
  278. .course-row:hover .course-row__title {
  279. color: var(--wp-brand);
  280. }
  281. .course-row__summary {
  282. font-size: 0.78rem;
  283. color: var(--wp-ink-muted);
  284. line-height: 1.5;
  285. margin-bottom: 0.45rem;
  286. display: -webkit-box;
  287. -webkit-line-clamp: 2;
  288. -webkit-box-orient: vertical;
  289. overflow: hidden;
  290. }
  291. .course-row__meta {
  292. display: flex;
  293. align-items: center;
  294. flex-wrap: wrap;
  295. gap: 0.25rem 0.9rem;
  296. font-size: 0.75rem;
  297. color: var(--wp-ink-muted);
  298. font-variant-numeric: tabular-nums;
  299. }
  300. .course-row__period,
  301. .course-row__members,
  302. .course-row__date {
  303. white-space: nowrap;
  304. }
  305. .course-row__side {
  306. display: flex;
  307. flex-direction: column;
  308. align-items: flex-end;
  309. gap: 0.5rem;
  310. flex-shrink: 0;
  311. }
  312. .course-row__cta {
  313. display: inline-flex;
  314. align-items: center;
  315. gap: 0.15rem;
  316. font-size: 0.78rem;
  317. font-weight: 600;
  318. color: var(--wp-brand);
  319. }
  320. /* ══════════════════════════════════════════
  321. 五、历史课程列表页头部
  322. ══════════════════════════════════════════ */
  323. .course-page-header {
  324. background: linear-gradient(135deg, var(--wp-ink) 0%, #2d2010 100%);
  325. padding: 2.25rem 0 2rem;
  326. position: relative;
  327. overflow: hidden;
  328. }
  329. .course-page-header::before {
  330. content: '课';
  331. font-family: 'Noto Serif SC', serif;
  332. font-size: 16rem;
  333. font-weight: 700;
  334. color: rgba(255, 255, 255, 0.03);
  335. position: absolute;
  336. right: -1rem;
  337. top: -2.5rem;
  338. line-height: 1;
  339. pointer-events: none;
  340. }
  341. .course-page-header h1 {
  342. font-family: 'Noto Serif SC', 'Noto Serif', Georgia, serif;
  343. font-size: 1.75rem;
  344. font-weight: 600;
  345. color: #fff;
  346. margin: 0 0 0.3rem;
  347. letter-spacing: 0.08em;
  348. }
  349. .course-page-header p {
  350. color: rgba(255, 255, 255, 0.45);
  351. font-size: 0.85rem;
  352. margin: 0;
  353. }
  354. .course-count-badge {
  355. background: var(--wp-brand);
  356. color: var(--wp-ink);
  357. font-size: 0.75rem;
  358. font-weight: 700;
  359. padding: 2px 9px;
  360. border-radius: 20px;
  361. margin-left: 0.6rem;
  362. vertical-align: middle;
  363. font-variant-numeric: tabular-nums;
  364. }
  365. /* ══════════════════════════════════════════
  366. 六、响应式
  367. ══════════════════════════════════════════ */
  368. @media (max-width: 1199px) {
  369. .course-grid {
  370. grid-template-columns: repeat(3, minmax(0, 1fr));
  371. }
  372. }
  373. @media (max-width: 991px) {
  374. .course-grid {
  375. grid-template-columns: repeat(2, minmax(0, 1fr));
  376. }
  377. }
  378. @media (max-width: 575px) {
  379. .course-grid {
  380. grid-template-columns: 1fr;
  381. }
  382. .course-stats {
  383. gap: 0.5rem;
  384. }
  385. .course-stat {
  386. padding: 0.9rem 0.5rem;
  387. }
  388. .course-stat__value {
  389. font-size: 1.4rem;
  390. }
  391. .course-row {
  392. gap: 0.75rem;
  393. padding: 0.75rem;
  394. }
  395. .course-row__thumb {
  396. width: 84px;
  397. height: 56px;
  398. }
  399. .course-row__summary {
  400. display: none;
  401. }
  402. .course-row__side {
  403. gap: 0.4rem;
  404. }
  405. }