style.css 6.0 KB

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