main.scss 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782
  1. @charset "UTF-8";
  2. @import "font";
  3. @import "reset";
  4. @import "dark";
  5. body {
  6. padding: 0 !important;
  7. margin: 0 !important;
  8. position: relative;
  9. font-size: 15px;
  10. font-weight: normal;
  11. overflow-x: hidden !important;
  12. overflow-y: auto !important;
  13. color: var(--bs-body-color);
  14. transition: all 1s ease;
  15. }
  16. .blog-body {
  17. // 导航栏
  18. .navbar {
  19. --bs-navbar-padding-x: 0;
  20. --bs-navbar-padding-y: 0;
  21. transition: .3s ease-out;
  22. box-shadow: 0 .5rem 1rem rgba(18, 38, 63, .05);
  23. border: 1px solid rgba(17, 24, 39, .1);
  24. .container-fluid {
  25. height: 3rem;
  26. .nav-toggle,
  27. .nav-search-button {
  28. width: 2.5rem;
  29. height: 100%;
  30. }
  31. }
  32. }
  33. .sidebar-banner {
  34. position: relative;
  35. background-image: url("../images/wallhaven-qr9jml.jpg");
  36. background-position-x: center;
  37. background-position-y: center;
  38. background-size: cover;
  39. min-height: 120px;
  40. width: 100%;
  41. overflow: hidden;
  42. border-top-right-radius: 6px;
  43. border-top-left-radius: 6px;
  44. &::after {
  45. content: "";
  46. width: 100%;
  47. height: 40%;
  48. position: absolute;
  49. bottom: 0;
  50. left: 0;
  51. background: linear-gradient(to top, var(--bs-white), transparent);
  52. }
  53. }
  54. .sidebar-avatar {
  55. position: absolute;
  56. left: 50%;
  57. transform: translateX(-50%) translateY(-50%);
  58. border: rgba(255, 255, 255, .4) 4px solid;
  59. width: 68px;
  60. height: 68px;
  61. border-radius: 50%;
  62. }
  63. .sidebar-sign {
  64. padding-left: .75rem;
  65. padding-right: .75rem;
  66. margin-bottom: 1rem;
  67. font-size: .875rem;
  68. line-height: 1.5rem;
  69. letter-spacing: .05em;
  70. text-align: center;
  71. }
  72. // 侧边导航
  73. .offcanvas {
  74. height: 100vh;
  75. max-width: 78%;
  76. &.offcanvas-start {
  77. top: -1px;
  78. left: -1px;
  79. }
  80. .offcanvas-body {
  81. padding: 0;
  82. }
  83. }
  84. // 英雄
  85. .hero-box {
  86. position: relative;
  87. height: 730px;
  88. background-image: url("../images/acg.jpg");
  89. background-position-x: center;
  90. background-position-y: center;
  91. background-size: cover;
  92. &::before {
  93. content: "";
  94. position: absolute;
  95. top: 0;
  96. left: 0;
  97. width: 100%;
  98. height: 100%;
  99. background: rgba(0, 0, 0, .2);
  100. }
  101. }
  102. .mode_switcher {
  103. &.my_switcher {
  104. &:hover {
  105. right: 0;
  106. }
  107. position: fixed;
  108. right: -50px;
  109. top: 100px;
  110. z-index: 9999999;
  111. transition: 0.3s;
  112. button {
  113. display: flex;
  114. font-size: 20px;
  115. background: #5F2DED;
  116. padding: 10px;
  117. line-height: 20px;
  118. border-top-left-radius: 10px;
  119. border-bottom-left-radius: 10px;
  120. width: 90px;
  121. box-shadow: 0px 6px 34px rgba(215, 216, 222, 0.15);
  122. border: none;
  123. }
  124. }
  125. }
  126. // 主
  127. .main-wrap {
  128. // 文章列表
  129. .article-list {
  130. .article-item {
  131. display: flex;
  132. overflow: hidden;
  133. position: relative;
  134. background-color: #fff;
  135. height: 10rem;
  136. border-radius: var(--bs-border-radius);
  137. border-width: 1px;
  138. margin-bottom: 1rem;
  139. .blur-img {
  140. z-index: 0;
  141. img {
  142. object-fit: cover;
  143. position: absolute;
  144. top: 0;
  145. right: 0;
  146. bottom: 0;
  147. left: 0;
  148. width: 100%;
  149. height: 14.5rem;
  150. transform: scale(1.55);
  151. }
  152. }
  153. &.flex-row-reverse {
  154. .article-img {
  155. clip-path: polygon(6% 0, 100% 0, 100% 100%, 0 100%);
  156. }
  157. }
  158. .article-img {
  159. z-index: 10;
  160. margin: 0;
  161. width: 33.333333%;
  162. border-width: 0;
  163. clip-path: polygon(0 0, 100% 0, 94% 100%, 0 100%);
  164. .article-left-img {
  165. object-fit: cover;
  166. background-position: center;
  167. background-size: cover;
  168. width: 100%;
  169. height: 100%;
  170. }
  171. }
  172. .article-ctx {
  173. display: flex;
  174. z-index: 10;
  175. padding: 1.25rem 1rem;
  176. color: #fff;
  177. flex-direction: column;
  178. justify-content: space-between;
  179. width: 100%;
  180. background-color: rgba(0, 0, 0, .35);
  181. .article-info {
  182. display: flex;
  183. font-size: .75rem;
  184. line-height: 1rem;
  185. justify-content: space-between;
  186. letter-spacing: .06rem;
  187. text-shadow: 0 .1875rem .3125rem rgba(0, 0, 0, .3);
  188. }
  189. .article-title {
  190. font-weight: 700;
  191. display: -webkit-box;
  192. -webkit-box-orient: vertical;
  193. -webkit-line-clamp: 1;
  194. font-size: 20px;
  195. line-height: 1.75rem;
  196. letter-spacing: .05em;
  197. color: #fff;
  198. overflow: hidden;
  199. }
  200. .article-description {
  201. display: -webkit-box;
  202. -webkit-box-orient: vertical;
  203. -webkit-line-clamp: 2;
  204. font-size: 12px;
  205. text-indent: 2em;
  206. line-height: 1.5rem;
  207. word-break: break-all;
  208. overflow: hidden;
  209. color: #fff;
  210. }
  211. }
  212. }
  213. }
  214. // 下一页按钮
  215. #NextButton {
  216. width: auto;
  217. padding-left: 3rem;
  218. padding-right: 3rem;
  219. }
  220. // 详情
  221. .article-detail {
  222. .tag {
  223. .tag-item {
  224. color: #0d6efd !important;
  225. background-color: rgba(13, 110, 253, .1) !important;
  226. }
  227. }
  228. .typography {
  229. color: #2c2e3b;
  230. font-size: 15px;
  231. line-height: 1.5;
  232. }
  233. .copyright {
  234. padding: 1rem;
  235. margin-top: 1.5rem;
  236. line-height: 1.5rem;
  237. border-radius: .25rem;
  238. .copyright-text {
  239. word-break: break-all;
  240. }
  241. }
  242. }
  243. .ssbox {
  244. .ss-list {
  245. padding-left: 0;
  246. .ss-content {
  247. .ss-datetime {
  248. display: flex;
  249. width: 16px;
  250. line-height: 18px;
  251. font-size: 18px;
  252. text-align: center;
  253. border-right: 1px solid var(--bs-border-color);
  254. padding: 0 22px 8px 0;
  255. float: left;
  256. margin-right: 1rem;
  257. overflow: hidden;
  258. max-height: 100px;
  259. }
  260. .ss-data-content {
  261. margin: 0 0 0 3.2rem;
  262. min-height: 88px;
  263. p {
  264. }
  265. }
  266. }
  267. }
  268. }
  269. .pigeonhole {
  270. .icon {
  271. width: auto;
  272. height: auto;
  273. font-size: 12px;
  274. }
  275. .accordion-button:focus {
  276. box-shadow: none;
  277. }
  278. .accordion-item {
  279. margin-bottom: 10px;
  280. &:last-child {
  281. margin-bottom: 0;
  282. }
  283. &:not(:first-of-type) {
  284. border-top: 1px solid var(--bs-border-color);
  285. }
  286. }
  287. }
  288. .comment-list {
  289. display: flex;
  290. flex-direction: column;
  291. align-self: stretch;
  292. padding: 0px;
  293. margin: 0px;
  294. flex: 1 1 auto;
  295. gap: 1.5rem;
  296. .content {
  297. font-size: 14px;
  298. .comment-text {
  299. font-size: 14px;
  300. line-height: 1.5;
  301. background-color: rgb(244, 246, 251);
  302. overflow-wrap: break-word;
  303. word-break: break-all;
  304. margin: 0.5rem 0px;
  305. padding: 0.5rem 0.75rem;
  306. border-radius: 2px;
  307. }
  308. }
  309. .comment-di {
  310. .comment-inner {
  311. img {
  312. width: 45px;
  313. height: 45px;
  314. border-radius: 999px;
  315. }
  316. }
  317. }
  318. .comment-quote {
  319. padding-left: 2rem;
  320. }
  321. .common-child {
  322. .common-child-item {
  323. margin-top: 1rem;
  324. .avatar {
  325. width: 35px;
  326. height: 35px;
  327. border-radius: 999px;
  328. }
  329. }
  330. }
  331. }
  332. .friendship-links {
  333. .friend-link-card {
  334. transition: transform 0.3s ease, box-shadow 0.3s ease;
  335. &:hover {
  336. transform: translateY(-5px);
  337. box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  338. }
  339. }
  340. .friend-link-avatar {
  341. width: 80px;
  342. height: 80px;
  343. object-fit: cover;
  344. border: 3px solid rgba(13, 110, 253, 0.2);
  345. }
  346. .card {
  347. border-radius: var(--bs-border-radius);
  348. border: 1px solid var(--bs-border-color);
  349. }
  350. .card-header {
  351. background-color: rgba(0, 0, 0, 0.03);
  352. border-bottom: 1px solid var(--bs-border-color);
  353. }
  354. }
  355. }
  356. // 工具
  357. .tools {
  358. display: none;
  359. position: fixed;
  360. right: 1.25rem;
  361. bottom: 1.25rem;
  362. z-index: 1045;
  363. margin-top: .25rem;
  364. flex-direction: column;
  365. .backup-btn {
  366. cursor: pointer;
  367. width: 50px;
  368. height: 50px;
  369. line-height: 50px;
  370. background-color: var(--bs-secondary-bg);
  371. right: 20px;
  372. bottom: 60px;
  373. text-align: center;
  374. overflow: hidden;
  375. border-radius: 50px;
  376. z-index: 9811 !important;
  377. position: fixed;
  378. display: block;
  379. box-shadow: 0px 10px 50px rgba(13, 38, 59, 0.15);
  380. i {
  381. width: 100%;
  382. display: block;
  383. line-height: 50px;
  384. font-size: 20px;
  385. transition: 0.5s;
  386. }
  387. }
  388. }
  389. .footer {
  390. border-top-width: 1px;
  391. border-top-style: solid;
  392. border-color: var(--bs-border-color);
  393. line-height: 1.8rem;
  394. letter-spacing: .3px;
  395. }
  396. }
  397. // media
  398. @media screen and (max-width: 576px) {
  399. .blog-body {
  400. .hero-box {
  401. height: 20rem;
  402. }
  403. .main-wrap {
  404. .ssbox {
  405. .ss-list {
  406. padding-left: 0;
  407. .ss-data-content {
  408. margin: 0 0 0 2.5rem
  409. }
  410. }
  411. }
  412. }
  413. }
  414. }
  415. @media screen and (min-width: 768px) {
  416. .blog-body {
  417. .main-wrap {
  418. .article-list {
  419. .article-item {
  420. background-color: #000;
  421. border-width: 0;
  422. height: 14.5rem;
  423. .blur-img {
  424. img {
  425. filter: blur(1.875rem) brightness(.75);
  426. }
  427. }
  428. .article-ctx {
  429. background-color: unset;
  430. padding: 3rem 2rem;
  431. width: 66.666667%;
  432. }
  433. }
  434. }
  435. }
  436. }
  437. }
  438. // 字体
  439. [class^="fa-"], [class*=" fa-"] {
  440. vertical-align: middle;
  441. }
  442. // 工具
  443. img {
  444. display: block;
  445. max-width: 100%;
  446. height: auto;
  447. vertical-align: middle;
  448. }
  449. .has-img {
  450. backdrop-filter: blur(8px)
  451. }
  452. .bg-blur {
  453. background: rgba(255, 255, 255, .9);
  454. -webkit-backdrop-filter: saturate(200%) blur(20px);
  455. backdrop-filter: saturate(200%) blur(20px);
  456. }
  457. .text-xs {
  458. font-size: .75rem;
  459. }
  460. .icon {
  461. font-size: 1rem;
  462. width: 1rem;
  463. height: 1rem;
  464. fill: currentColor;
  465. overflow: hidden;
  466. flex-shrink: 0;
  467. }
  468. // 滚动条
  469. :root {
  470. scroll-behavior: auto;
  471. }
  472. html, body {
  473. &::-webkit-scrollbar {
  474. width: 6px;
  475. height: 6px;
  476. }
  477. &::-webkit-scrollbar-corner {
  478. background: unset;
  479. }
  480. &::-webkit-scrollbar-thumb {
  481. background: rgba(135, 135, 135, .4);
  482. border-radius: 6px;
  483. }
  484. &::-webkit-scrollbar-track {
  485. background: rgba(135, 135, 135, .1);
  486. }
  487. }
  488. .dark {
  489. html, body {
  490. &::-webkit-scrollbar-thumb {
  491. background: rgba(135, 135, 135, .6);
  492. }
  493. &::-webkit-scrollbar-track {
  494. background: rgba(135, 135, 135, .2); // 添加暗色模式下的轨道背景
  495. }
  496. }
  497. }
  498. // 在文件末尾添加以下样式
  499. .blog-body {
  500. // 文章详情页优化
  501. .article-detail {
  502. // 文章元信息
  503. .article-meta {
  504. background-color: var(--bs-light);
  505. padding: 0.75rem 1rem;
  506. border-radius: 0.375rem;
  507. margin: 1rem 0;
  508. .meta-item {
  509. display: flex;
  510. align-items: center;
  511. gap: 0.5rem;
  512. }
  513. }
  514. // 标签区域
  515. .tag {
  516. .tag-item {
  517. color: #0d6efd !important;
  518. background-color: rgba(13, 110, 253, .1) !important;
  519. text-decoration: none;
  520. &:hover {
  521. background-color: rgba(13, 110, 253, .2) !important;
  522. }
  523. }
  524. }
  525. // 版权信息
  526. .copyright {
  527. padding: 1rem;
  528. margin-top: 1.5rem;
  529. line-height: 1.5rem;
  530. border-radius: .25rem;
  531. background-color: var(--bs-light);
  532. .copyright-text {
  533. word-break: break-all;
  534. }
  535. }
  536. }
  537. // 目录导航样式
  538. .toc-container {
  539. position: sticky;
  540. top: 100px;
  541. max-height: calc(100vh - 120px);
  542. overflow-y: auto;
  543. padding: 1rem 0;
  544. .toc-header {
  545. padding: 0.5rem 1rem;
  546. font-weight: 600;
  547. border-bottom: 1px solid var(--bs-border-color);
  548. margin-bottom: 0.5rem;
  549. }
  550. .toc-nav {
  551. a {
  552. display: block;
  553. color: var(--bs-secondary-color);
  554. text-decoration: none;
  555. padding: 0.25rem 1rem;
  556. border-left: 2px solid transparent;
  557. transition: all 0.2s;
  558. font-size: 0.875rem;
  559. &:hover {
  560. color: var(--bs-primary);
  561. border-left-color: var(--bs-primary);
  562. background-color: rgba(13, 110, 253, 0.05);
  563. }
  564. &.active {
  565. color: var(--bs-primary);
  566. border-left-color: var(--bs-primary);
  567. font-weight: 500;
  568. }
  569. }
  570. }
  571. }
  572. // 分享区域
  573. .share-section {
  574. padding: 1rem 0;
  575. .share-button {
  576. display: inline-flex;
  577. align-items: center;
  578. justify-content: center;
  579. width: 36px;
  580. height: 36px;
  581. border-radius: 50%;
  582. color: var(--bs-body-color);
  583. background-color: var(--bs-light);
  584. transition: all 0.3s;
  585. &:hover {
  586. background-color: var(--bs-primary);
  587. color: white;
  588. }
  589. }
  590. }
  591. // 文章导航
  592. .article-navigation {
  593. .prev-article,
  594. .next-article {
  595. flex: 1;
  596. a {
  597. color: var(--bs-body-color);
  598. text-decoration: none;
  599. &:hover {
  600. color: var(--bs-primary);
  601. }
  602. }
  603. }
  604. }
  605. // 评论区域
  606. .comments-section {
  607. .comment-form {
  608. background-color: var(--bs-light);
  609. padding: 1.5rem;
  610. border-radius: 0.375rem;
  611. }
  612. .comment-item {
  613. padding: 1rem 0;
  614. &:not(:last-child) {
  615. border-bottom: 1px solid var(--bs-border-color);
  616. }
  617. }
  618. }
  619. }
  620. // 滚动条样式优化
  621. .toc-container::-webkit-scrollbar {
  622. width: 6px;
  623. }
  624. .toc-container::-webkit-scrollbar-thumb {
  625. background: rgba(135, 135, 135, .4);
  626. border-radius: 6px;
  627. }
  628. .toc-container::-webkit-scrollbar-track {
  629. background: rgba(135, 135, 135, .1);
  630. }
  631. // 响应式优化
  632. @media (max-width: 991.98px) {
  633. .toc-container {
  634. position: static;
  635. max-height: none;
  636. overflow-y: visible;
  637. margin-top: 1.5rem;
  638. }
  639. }
  640. /* 评论区域样式 */
  641. .comments-section {
  642. margin-top: 2rem;
  643. }
  644. .comment-item {
  645. padding: 1rem 0;
  646. }
  647. .comment-item:not(:last-child) {
  648. border-bottom: 1px solid #eee;
  649. }
  650. .comment-form .form-control {
  651. border-radius: 0.375rem;
  652. }
  653. .comment-form .btn {
  654. border-radius: 0.375rem;
  655. }
  656. /* 回复评论的样式 */
  657. .comment-item .comment-item {
  658. padding-left: 1rem;
  659. margin-top: 1rem;
  660. }
  661. /* 响应式调整 */
  662. @media (max-width: 768px) {
  663. .comment-item .comment-item {
  664. margin-left: 1rem;
  665. }
  666. }