main.css 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  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. .footer a {
  123. color: inherit;
  124. text-decoration: none;
  125. }
  126. .post-item p,
  127. .post-item img,
  128. .post-item ol,
  129. .post-item ul,
  130. .post-item figure,
  131. .post-item pre,
  132. .post-item table {
  133. margin: 10px 0;
  134. }
  135. .post-item h1,
  136. .post-item h2,
  137. .post-item h3,
  138. .post-item h4,
  139. .post-item h5,
  140. .post-item h6 {
  141. margin: 20px 0;
  142. }
  143. .post-item h1,
  144. .post-item h2 {
  145. /*18px*/
  146. font-size: 20px;
  147. }
  148. .post-item h3 {
  149. /*18px*/
  150. font-size: 18px;
  151. }
  152. .post-item h4,
  153. .post-item h5,
  154. .post-item h6 {
  155. /*16px*/
  156. font-size: 16px;
  157. }
  158. .post-item {
  159. margin-bottom: 20px;
  160. padding: 30px;
  161. background: var(--background-color);
  162. line-height: 30px;
  163. border-radius: 12px;
  164. }
  165. .post-item .title {
  166. font-size: 20px;
  167. font-weight: bold;
  168. margin: 0 0 10px;
  169. }
  170. .post-item .meta {
  171. font-size: 14px;
  172. opacity: 0.7;
  173. margin: 10px 0;
  174. }
  175. .post-item .meta span:nth-child(2)::before {
  176. content: '·';
  177. margin: 0 5px;
  178. }
  179. .post-item .meta span:nth-child(3)::before {
  180. content: '·';
  181. margin: 0 5px;
  182. }
  183. @media screen and (max-width: 800px) {
  184. .container {
  185. flex-direction: column;
  186. align-items: center;
  187. padding: 0;
  188. }
  189. .aside {
  190. box-sizing: border-box;
  191. width: 100%;
  192. display: flex;
  193. flex-direction: row;
  194. gap: 10px;
  195. position: sticky;
  196. top: 0;
  197. left: 0;
  198. z-index: 100;
  199. border-radius: 0;
  200. }
  201. .aside .avatar-box {
  202. flex-direction: row;
  203. gap: 10px;
  204. margin: 0;
  205. padding: 5px;
  206. }
  207. .aside .avatar-box .avatar {
  208. width: 50px;
  209. height: 50px;
  210. margin: 0;
  211. }
  212. .aside .avatar-box .info {
  213. align-items: flex-start;
  214. }
  215. .aside .avatar-box .desc {
  216. max-width: 100px;
  217. white-space: nowrap;
  218. overflow: hidden;
  219. text-overflow: ellipsis;
  220. }
  221. .aside .nav {
  222. flex-direction: row;
  223. gap: 5px;
  224. overflow-y: hidden;
  225. overflow-x: auto;
  226. white-space: nowrap;
  227. }
  228. .aside .nav a {
  229. line-height: 50px;
  230. }
  231. .main {
  232. width: 100%;
  233. }
  234. .post-item {
  235. border-radius: 0;
  236. }
  237. .footer {
  238. border-radius: 0;
  239. }
  240. }
  241. .p-input {
  242. border: none;
  243. font-size: 20px;
  244. margin-top: 20px;
  245. margin-bottom: 10px;
  246. padding-bottom: 8px;
  247. background: linear-gradient(to right, var(--text-color), var(--text-color)) no-repeat left bottom;
  248. background-size: 10% 2px;
  249. color: var(--text-color);
  250. transition: all 0.3s;
  251. font-weight: bold;
  252. }
  253. .p-input::placeholder {
  254. color: var(--muted-text-color);
  255. letter-spacing: 0;
  256. }
  257. .p-input:focus {
  258. outline: none;
  259. background-size: 100% 2px !important;
  260. text-shadow: var(--secondary-text-color) 0 0 v-bind(titleShadowRadius);
  261. }
  262. .p-input:hover {
  263. background-size: 50% 2px;
  264. text-shadow: var(--secondary-text-color) 0 0 v-bind(titleShadowRadius);
  265. }
  266. .p-input[type="password"] {
  267. letter-spacing: 5px;
  268. font-size: 20px;
  269. }
  270. .p-input-danger {
  271. background: linear-gradient(to right, var(--danger-color), var(--danger-color)) no-repeat left bottom;
  272. background-size: 10% 2px;
  273. }
  274. .p-input-danger::placeholder {
  275. color: var(--danger-color);
  276. letter-spacing: 0;
  277. }
  278. .p-button {
  279. padding: 8px 12px;
  280. cursor: pointer;
  281. background: linear-gradient(to right, var(--text-color), var(--text-color)) no-repeat left bottom;
  282. color: var(--text-color);
  283. background-size: 100% 2px;
  284. font-weight: bold;
  285. transition: all .3s;
  286. }
  287. .p-button:hover {
  288. background-size: 100% 100%;
  289. color: var(--background-color);
  290. }
  291. .p-button-success {
  292. padding: 8px 12px;
  293. cursor: pointer;
  294. background: linear-gradient(to right, var(--success-color), var(--success-color)) no-repeat left bottom;
  295. color: var(--success-color);
  296. background-size: 100% 2px;
  297. font-weight: bold;
  298. transition: all .3s;
  299. }
  300. .p-button-success:hover {
  301. background-size: 100% 100%;
  302. color: var(--text-color);
  303. }
  304. .p-button-disabled {
  305. padding: 8px 12px;
  306. background-size: 100% 2px;
  307. font-weight: bold;
  308. transition: all .3s;
  309. cursor: not-allowed;
  310. color: var(--muted-text-color);
  311. background: linear-gradient(to right, var(--muted-text-color), var(--muted-text-color)) no-repeat left bottom;
  312. background-size: 100% 2px;
  313. }