style.css 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  1. /* ==================== 全局重置 ==================== */
  2. *,
  3. *::before,
  4. *::after {
  5. box-sizing: border-box;
  6. margin: 0;
  7. padding: 0;
  8. }
  9. html {
  10. font-size: 16px;
  11. scroll-behavior: smooth;
  12. }
  13. body {
  14. font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  15. background-color: #f8fafc;
  16. color: #1a202c;
  17. line-height: 1.6;
  18. min-height: 100vh;
  19. display: flex;
  20. flex-direction: column;
  21. }
  22. /* ==================== 导航栏 ==================== */
  23. .navbar {
  24. position: sticky;
  25. top: 0;
  26. z-index: 100;
  27. background: rgba(255, 255, 255, 0.85);
  28. backdrop-filter: blur(12px);
  29. -webkit-backdrop-filter: blur(12px);
  30. border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  31. padding: 0.75rem 1.5rem;
  32. }
  33. .nav-container {
  34. max-width: 1200px;
  35. margin: 0 auto;
  36. display: flex;
  37. align-items: center;
  38. justify-content: space-between;
  39. }
  40. .nav-brand {
  41. font-size: 1.25rem;
  42. font-weight: 700;
  43. color: #2d3748;
  44. text-decoration: none;
  45. }
  46. .nav-links {
  47. list-style: none;
  48. display: flex;
  49. gap: 1.5rem;
  50. }
  51. .nav-links a {
  52. text-decoration: none;
  53. color: #4a5568;
  54. font-weight: 500;
  55. transition: color 0.2s;
  56. }
  57. .nav-links a:hover {
  58. color: #3182ce;
  59. }
  60. /* ==================== 主内容区 ==================== */
  61. .main-content {
  62. flex: 1;
  63. max-width: 1200px;
  64. margin: 2rem auto;
  65. padding: 0 1.5rem;
  66. width: 100%;
  67. }
  68. /* ==================== 瀑布流布局 ==================== */
  69. .waterfall {
  70. display: grid;
  71. grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  72. gap: 1.5rem;
  73. }
  74. /* ==================== 卡片 ==================== */
  75. .card {
  76. background: #ffffff;
  77. border-radius: 20px;
  78. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  79. overflow: hidden;
  80. transition: transform 0.2s ease, box-shadow 0.2s ease;
  81. display: flex;
  82. flex-direction: column;
  83. }
  84. .card:hover {
  85. transform: translateY(-4px);
  86. box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  87. }
  88. .card-image {
  89. width: 100%;
  90. height: 180px;
  91. overflow: hidden;
  92. }
  93. .card-image img {
  94. width: 100%;
  95. height: 100%;
  96. object-fit: cover;
  97. display: block;
  98. }
  99. .card-body {
  100. padding: 1.25rem;
  101. flex: 1;
  102. display: flex;
  103. flex-direction: column;
  104. }
  105. .card-title {
  106. font-size: 1.25rem;
  107. font-weight: 700;
  108. margin-bottom: 0.5rem;
  109. line-height: 1.3;
  110. }
  111. .card-title a {
  112. color: #2d3748;
  113. text-decoration: none;
  114. transition: color 0.2s;
  115. }
  116. .card-title a:hover {
  117. color: #3182ce;
  118. }
  119. .card-date {
  120. display: block;
  121. font-size: 0.875rem;
  122. color: #a0aec0;
  123. margin-bottom: 0.75rem;
  124. }
  125. .card-summary {
  126. color: #718096;
  127. font-size: 0.9375rem;
  128. line-height: 1.6;
  129. flex: 1;
  130. margin-bottom: 1rem;
  131. }
  132. .card-link {
  133. color: #3182ce;
  134. text-decoration: none;
  135. font-weight: 500;
  136. font-size: 0.9375rem;
  137. transition: color 0.2s;
  138. align-self: flex-start;
  139. }
  140. .card-link:hover {
  141. color: #2b6cb0;
  142. }
  143. /* ==================== 空状态 ==================== */
  144. .empty-state {
  145. grid-column: 1 / -1;
  146. text-align: center;
  147. padding: 4rem 1rem;
  148. color: #a0aec0;
  149. font-size: 1.125rem;
  150. }
  151. .empty-state a {
  152. color: #3182ce;
  153. text-decoration: none;
  154. }
  155. /* ==================== 上传表单 ==================== */
  156. .upload-container {
  157. max-width: 600px;
  158. margin: 0 auto;
  159. }
  160. .upload-container h1 {
  161. margin-bottom: 1.5rem;
  162. font-size: 1.75rem;
  163. font-weight: 700;
  164. }
  165. .upload-form {
  166. display: flex;
  167. flex-direction: column;
  168. gap: 1.25rem;
  169. }
  170. .form-group {
  171. display: flex;
  172. flex-direction: column;
  173. gap: 0.5rem;
  174. }
  175. .form-group label {
  176. font-weight: 600;
  177. color: #2d3748;
  178. }
  179. .form-group input[type="text"],
  180. .form-group input[type="file"] {
  181. padding: 0.625rem 0.75rem;
  182. border: 1px solid #e2e8f0;
  183. border-radius: 8px;
  184. font-size: 1rem;
  185. transition: border-color 0.2s;
  186. }
  187. .form-group input[type="text"]:focus,
  188. .form-group input[type="file"]:focus {
  189. outline: none;
  190. border-color: #3182ce;
  191. box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
  192. }
  193. /* ==================== 按钮 ==================== */
  194. .btn {
  195. display: inline-block;
  196. padding: 0.625rem 1.25rem;
  197. border: none;
  198. border-radius: 8px;
  199. font-size: 1rem;
  200. font-weight: 600;
  201. cursor: pointer;
  202. transition: background-color 0.2s, transform 0.1s;
  203. }
  204. .btn:active {
  205. transform: scale(0.98);
  206. }
  207. .btn-primary {
  208. background-color: #3182ce;
  209. color: #ffffff;
  210. }
  211. .btn-primary:hover {
  212. background-color: #2b6cb0;
  213. }
  214. .btn-danger {
  215. background-color: #e53e3e;
  216. color: #ffffff;
  217. }
  218. .btn-danger:hover {
  219. background-color: #c53030;
  220. }
  221. /* ==================== 管理页面表格 ==================== */
  222. .admin-container {
  223. max-width: 900px;
  224. margin: 0 auto;
  225. }
  226. .admin-container h1 {
  227. margin-bottom: 1.5rem;
  228. font-size: 1.75rem;
  229. font-weight: 700;
  230. }
  231. .admin-table {
  232. width: 100%;
  233. border-collapse: collapse;
  234. background: #ffffff;
  235. border-radius: 12px;
  236. overflow: hidden;
  237. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  238. }
  239. .admin-table th,
  240. .admin-table td {
  241. padding: 0.75rem 1rem;
  242. text-align: left;
  243. border-bottom: 1px solid #e2e8f0;
  244. }
  245. .admin-table th {
  246. background-color: #f7fafc;
  247. font-weight: 600;
  248. color: #4a5568;
  249. font-size: 0.875rem;
  250. text-transform: uppercase;
  251. letter-spacing: 0.05em;
  252. }
  253. .admin-table td a {
  254. color: #3182ce;
  255. text-decoration: none;
  256. }
  257. .admin-table td a:hover {
  258. text-decoration: underline;
  259. }
  260. /* ==================== 页脚 ==================== */
  261. .footer {
  262. text-align: center;
  263. padding: 1.5rem;
  264. color: #a0aec0;
  265. font-size: 0.875rem;
  266. border-top: 1px solid #e2e8f0;
  267. margin-top: auto;
  268. }
  269. /* ==================== 响应式 ==================== */
  270. @media (max-width: 768px) {
  271. .waterfall {
  272. grid-template-columns: 1fr;
  273. }
  274. .navbar {
  275. padding: 0.5rem 1rem;
  276. }
  277. .nav-links {
  278. gap: 1rem;
  279. }
  280. .main-content {
  281. padding: 0 1rem;
  282. }
  283. }
  284. /* ==================== 代码高亮(Pygments 默认主题) ==================== */
  285. .codehilite {
  286. background: #f7fafc;
  287. border-radius: 8px;
  288. padding: 1rem;
  289. overflow-x: auto;
  290. margin: 1rem 0;
  291. }
  292. .codehilite pre {
  293. margin: 0;
  294. font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  295. font-size: 0.875rem;
  296. line-height: 1.5;
  297. }