main.css 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  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. .container {
  50. display: flex;
  51. justify-content: center;
  52. align-items: flex-start;
  53. flex-direction: row;
  54. max-width: 980px;
  55. margin-left: auto;
  56. margin-right: auto;
  57. padding: 20px;
  58. gap: 20px;
  59. }
  60. .aside {
  61. width: 200px;
  62. align-self: flex-start;
  63. height: max-content;
  64. background: var(--background-color);
  65. padding: 20px;
  66. border-radius: 12px;
  67. transition: all .3s;
  68. position: sticky;
  69. top: 20px;
  70. }
  71. .aside .avatar-box {
  72. display: flex;
  73. flex-direction: column;
  74. align-items: center;
  75. margin-bottom: 20px;
  76. background: var(--secondary-background-color);
  77. padding: 20px;
  78. line-height: 25px;
  79. border-radius: 12px;
  80. transition: all .3s;
  81. }
  82. .aside .avatar-box .avatar {
  83. width: 100px;
  84. height: 100px;
  85. border-radius: 50%;
  86. margin-bottom: 10px;
  87. background: var(--background-color);
  88. transition: all .3s;
  89. }
  90. .aside .avatar-box .info {
  91. display: flex;
  92. flex-direction: column;
  93. align-items: center;
  94. transition: all .3s;
  95. }
  96. .aside .avatar-box .blogger {
  97. font-size: 18px;
  98. font-weight: bold;
  99. transition: all .3s;
  100. }
  101. .aside .avatar-box .desc {
  102. font-size: 14px;
  103. opacity: 0.7;
  104. text-align: center;
  105. transition: all .3s;
  106. }
  107. /* 鼠标进入后旋转180度,类开后恢复 */
  108. .avatar:hover {
  109. transform: rotate(720deg);
  110. }
  111. .main {
  112. width: 0;
  113. flex: 1;
  114. transition: all .3s;
  115. }
  116. .footer {
  117. padding: 20px;
  118. margin: 20px 0;
  119. background: var(--background-color);
  120. border-radius: 12px;
  121. }
  122. .post-item p,
  123. .post-item img,
  124. .post-item ol,
  125. .post-item ul,
  126. .post-item figure,
  127. .post-item pre,
  128. .post-item table {
  129. margin: 10px 0;
  130. }
  131. .post-item h1,
  132. .post-item h2,
  133. .post-item h3,
  134. .post-item h4,
  135. .post-item h5,
  136. .post-item h6 {
  137. margin: 20px 0;
  138. }
  139. .post-item h1,
  140. .post-item h2 {
  141. /*18px*/
  142. font-size: 20px;
  143. }
  144. .post-item h3 {
  145. /*18px*/
  146. font-size: 18px;
  147. }
  148. .post-item h4,
  149. .post-item h5,
  150. .post-item h6 {
  151. /*16px*/
  152. font-size: 16px;
  153. }
  154. .post-item {
  155. margin-bottom: 20px;
  156. padding: 30px;
  157. background: var(--background-color);
  158. line-height: 30px;
  159. border-radius: 12px;
  160. }
  161. .post-item .title {
  162. font-size: 20px;
  163. font-weight: bold;
  164. margin: 0 0 10px;
  165. }
  166. .post-item .meta {
  167. font-size: 14px;
  168. opacity: 0.7;
  169. margin: 10px 0;
  170. }
  171. .post-item .meta span:nth-child(2)::before {
  172. content: '·';
  173. margin: 0 5px;
  174. }
  175. .post-item .meta span:nth-child(3)::before {
  176. content: '·';
  177. margin: 0 5px;
  178. }
  179. @media screen and (max-width: 800px) {
  180. .container {
  181. flex-direction: column;
  182. align-items: center;
  183. padding: 0;
  184. }
  185. .aside {
  186. box-sizing: border-box;
  187. width: 100%;
  188. display: flex;
  189. flex-direction: row;
  190. gap: 10px;
  191. position: sticky;
  192. top: 0;
  193. left: 0;
  194. z-index: 100;
  195. border-radius: 0;
  196. }
  197. .aside .avatar-box {
  198. flex-direction: row;
  199. gap: 10px;
  200. margin: 0;
  201. padding: 5px;
  202. }
  203. .aside .avatar-box .avatar {
  204. width: 50px;
  205. height: 50px;
  206. margin: 0;
  207. }
  208. .aside .avatar-box .info {
  209. align-items: flex-start;
  210. }
  211. .aside .avatar-box .desc {
  212. max-width: 100px;
  213. white-space: nowrap;
  214. overflow: hidden;
  215. text-overflow: ellipsis;
  216. }
  217. .aside .nav {
  218. flex-direction: row;
  219. gap: 5px;
  220. overflow-y: hidden;
  221. overflow-x: auto;
  222. white-space: nowrap;
  223. }
  224. .aside .nav a {
  225. line-height: 50px;
  226. }
  227. .main {
  228. width: 100%;
  229. }
  230. .post-item {
  231. border-radius: 0;
  232. }
  233. .footer {
  234. border-radius: 0;
  235. }
  236. }
  237. .p-input {
  238. border: none;
  239. font-size: 20px;
  240. margin-top: 20px;
  241. margin-bottom: 10px;
  242. padding-bottom: 8px;
  243. background: linear-gradient(to right, var(--text-color), var(--text-color)) no-repeat left bottom;
  244. background-size: 10% 2px;
  245. color: var(--text-color);
  246. transition: all 0.3s;
  247. font-weight: bold;
  248. }
  249. .p-input::placeholder {
  250. color: var(--muted-text-color);
  251. letter-spacing: 0;
  252. }
  253. .p-input:focus {
  254. outline: none;
  255. background-size: 100% 2px !important;
  256. text-shadow: var(--secondary-text-color) 0 0 v-bind(titleShadowRadius);
  257. }
  258. .p-input:hover {
  259. background-size: 50% 2px;
  260. text-shadow: var(--secondary-text-color) 0 0 v-bind(titleShadowRadius);
  261. }
  262. .p-input[type="password"] {
  263. letter-spacing: 5px;
  264. font-size: 20px;
  265. }
  266. .p-input-danger {
  267. background: linear-gradient(to right, var(--danger-color), var(--danger-color)) no-repeat left bottom;
  268. background-size: 10% 2px;
  269. }
  270. .p-input-danger::placeholder {
  271. color: var(--danger-color);
  272. letter-spacing: 0;
  273. }
  274. .p-button {
  275. padding: 8px 12px;
  276. cursor: pointer;
  277. background: linear-gradient(to right, var(--text-color), var(--text-color)) no-repeat left bottom;
  278. color: var(--text-color);
  279. background-size: 100% 2px;
  280. font-weight: bold;
  281. transition: all .3s;
  282. }
  283. .p-button:hover {
  284. background-size: 100% 100%;
  285. color: var(--background-color);
  286. }
  287. .p-button-success {
  288. padding: 8px 12px;
  289. cursor: pointer;
  290. background: linear-gradient(to right, var(--success-color), var(--success-color)) no-repeat left bottom;
  291. color: var(--success-color);
  292. background-size: 100% 2px;
  293. font-weight: bold;
  294. transition: all .3s;
  295. }
  296. .p-button-success:hover {
  297. background-size: 100% 100%;
  298. color: var(--text-color);
  299. }
  300. .p-button-disabled {
  301. padding: 8px 12px;
  302. background-size: 100% 2px;
  303. font-weight: bold;
  304. transition: all .3s;
  305. cursor: not-allowed;
  306. color: var(--muted-text-color);
  307. background: linear-gradient(to right, var(--muted-text-color), var(--muted-text-color)) no-repeat left bottom;
  308. background-size: 100% 2px;
  309. }