main.css 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. :root {
  2. --background-color: #ffffff;
  3. --secondary-background-color: #f0f0f0;
  4. --text-color: #474747;
  5. --primary-text-color: #474747;
  6. --secondary-text-color: #6c757d;
  7. --muted-text-color: #999;
  8. --highlight-text-color: #dc3545;
  9. --link-color: blue;
  10. --success-color: #28a745;
  11. --warning-color: #ffc107;
  12. --danger-color: #dc3545;
  13. --info-color: #17a2b8;
  14. }
  15. @media (prefers-color-scheme: dark) {
  16. :root {
  17. --background-color: #343a40;
  18. --secondary-background-color: #495057;
  19. --text-color: #f8f9fa;
  20. --primary-text-color: #f8f9fa;
  21. --secondary-text-color: #adb5bd;
  22. --muted-text-color: #6c757d;
  23. --highlight-text-color: #ff6b6b;
  24. --link-color: #66d9ef;
  25. --success-color: #4caf50;
  26. --warning-color: #ffd700;
  27. --danger-color: #ff6b6b;
  28. --info-color: #1abc9c;
  29. }
  30. }
  31. body {
  32. margin: 0;
  33. font-size: 16px;
  34. box-sizing: border-box;
  35. background: var(--secondary-background-color);
  36. color: var(--primary-text-color);
  37. }
  38. p, h1, h2, h3, h4, h5, h6, blockquote, ul, ol, li, pre, code {
  39. margin: 0;
  40. padding: 0;
  41. }
  42. a {
  43. text-decoration: none;
  44. color: var(--link-color);
  45. }
  46. ::-webkit-scrollbar {
  47. display: none;
  48. }
  49. /* 文本格式 文章页 */
  50. .post-item p,
  51. .post-item img,
  52. .post-item ol,
  53. .post-item ul,
  54. .post-item figure,
  55. .post-item pre,
  56. .post-item table {
  57. margin: 10px 0;
  58. }
  59. .post-item h1,
  60. .post-item h2,
  61. .post-item h3,
  62. .post-item h4,
  63. .post-item h5,
  64. .post-item h6 {
  65. margin: 20px 0;
  66. }
  67. .post-item h1,
  68. .post-item h2 {
  69. /*18px*/
  70. font-size: 20px;
  71. }
  72. .post-item h3 {
  73. /*18px*/
  74. font-size: 18px;
  75. }
  76. .post-item h4,
  77. .post-item h5,
  78. .post-item h6 {
  79. /*16px*/
  80. font-size: 16px;
  81. }
  82. .container {
  83. display: flex;
  84. justify-content: center;
  85. align-items: center;
  86. flex-direction: row;
  87. max-width: 980px;
  88. margin-left: auto;
  89. margin-right: auto;
  90. padding: 20px;
  91. gap: 20px;
  92. }
  93. .aside {
  94. width: 200px;
  95. align-self: flex-start;
  96. height: max-content;
  97. background: var(--background-color);
  98. padding: 20px;
  99. border-radius: 12px;
  100. transition: all .3s;
  101. position: sticky;
  102. top: 20px;
  103. }
  104. .aside .avatar-box {
  105. display: flex;
  106. flex-direction: column;
  107. align-items: center;
  108. margin-bottom: 20px;
  109. background: var(--secondary-background-color);
  110. padding: 20px;
  111. line-height: 25px;
  112. border-radius: 12px;
  113. transition: all .3s;
  114. }
  115. .aside .avatar-box .avatar {
  116. width: 100px;
  117. height: 100px;
  118. border-radius: 50%;
  119. margin-bottom: 10px;
  120. background: var(--background-color);
  121. transition: all .3s;
  122. }
  123. .aside .avatar-box .info {
  124. display: flex;
  125. flex-direction: column;
  126. align-items: center;
  127. transition: all .3s;
  128. }
  129. .aside .avatar-box .blogger {
  130. font-size: 18px;
  131. font-weight: bold;
  132. transition: all .3s;
  133. }
  134. .aside .avatar-box .desc {
  135. font-size: 14px;
  136. opacity: 0.7;
  137. text-align: center;
  138. transition: all .3s;
  139. }
  140. .main {
  141. width: 0;
  142. flex: 1;
  143. transition: all .3s;
  144. }
  145. .post-item {
  146. margin-bottom: 20px;
  147. padding: 30px;
  148. background: var(--background-color);
  149. line-height: 30px;
  150. border-radius: 12px;
  151. }
  152. .post-item .title {
  153. margin: 0;
  154. font-size: 20px;
  155. font-weight: bold;
  156. margin-bottom: 10px;
  157. }
  158. .post-item .meta {
  159. font-size: 14px;
  160. opacity: .7;
  161. margin: 10px 0;
  162. }
  163. .post-item .meta span:nth-child(2)::before {
  164. content: "·";
  165. margin: 0 5px;
  166. }
  167. /* archive */
  168. .post-item .archive-item {
  169. display: flex;
  170. justify-content: space-between;
  171. align-items: center;
  172. margin: 10px 0;
  173. }
  174. .post-item .archive-item a {
  175. color: inherit;
  176. }
  177. .post-item .archive-item .time {
  178. opacity: .7;
  179. }
  180. /* tagcloud */
  181. .post-item .tag-cloud a {
  182. color: inherit;
  183. border: 1px solid;
  184. border-radius: 50px;
  185. padding: 0 16px;
  186. display: inline-block;
  187. margin: 3px 0;
  188. margin-right: 6px;
  189. }
  190. .footer {
  191. padding: 20px;
  192. margin: 20px 0;
  193. background: var(--background-color);
  194. border-radius: 12px;
  195. }
  196. @media screen and (max-width: 800px) {
  197. .container {
  198. flex-direction: column;
  199. align-items: center;
  200. padding: 0;
  201. }
  202. .aside {
  203. box-sizing: border-box;
  204. width: 100%;
  205. display: flex;
  206. flex-direction: row;
  207. gap: 10px;
  208. position: sticky;
  209. top: 0;
  210. left: 0;
  211. z-index: 100;
  212. border-radius: 0;
  213. }
  214. .aside .avatar-box {
  215. flex-direction: row;
  216. gap: 10px;
  217. margin: 0;
  218. padding: 5px;
  219. }
  220. .aside .avatar-box .avatar {
  221. width: 50px;
  222. height: 50px;
  223. margin: 0;
  224. }
  225. .aside .avatar-box .info {
  226. align-items: flex-start;
  227. }
  228. .aside .avatar-box .desc {
  229. max-width: 100px;
  230. white-space: nowrap;
  231. overflow: hidden;
  232. text-overflow: ellipsis;
  233. }
  234. .aside .nav {
  235. flex-direction: row;
  236. gap: 5px;
  237. overflow-y: hidden;
  238. overflow-x: auto;
  239. white-space: nowrap;
  240. }
  241. .aside .nav a {
  242. line-height: 50px;
  243. }
  244. .main {
  245. width: 100%;
  246. }
  247. .post-item {
  248. border-radius: 0;
  249. }
  250. .footer {
  251. border-radius: 0;
  252. }
  253. }