@charset "UTF-8"; @import "font"; @import "reset"; @import "dark"; body { padding: 0 !important; margin: 0 !important; position: relative; font-size: 15px; font-weight: normal; overflow-x: hidden !important; overflow-y: auto !important; color: var(--bs-body-color); transition: all 1s ease; } .blog-body { // 导航栏 .navbar { --bs-navbar-padding-x: 0; --bs-navbar-padding-y: 0; transition: .3s ease-out; box-shadow: 0 .5rem 1rem rgba(18, 38, 63, .05); border: 1px solid rgba(17, 24, 39, .1); .container-fluid { height: 3rem; .nav-toggle, .nav-search-button { width: 2.5rem; height: 100%; } } } .sidebar-banner { position: relative; background-image: url("../images/wallhaven-qr9jml.jpg"); background-position-x: center; background-position-y: center; background-size: cover; min-height: 120px; width: 100%; overflow: hidden; border-top-right-radius: 6px; border-top-left-radius: 6px; &::after { content: ""; width: 100%; height: 40%; position: absolute; bottom: 0; left: 0; background: linear-gradient(to top, var(--bs-white), transparent); } } .sidebar-avatar { position: absolute; left: 50%; transform: translateX(-50%) translateY(-50%); border: rgba(255, 255, 255, .4) 4px solid; width: 68px; height: 68px; border-radius: 50%; } .sidebar-sign { padding-left: .75rem; padding-right: .75rem; margin-bottom: 1rem; font-size: .875rem; line-height: 1.5rem; letter-spacing: .05em; text-align: center; } // 侧边导航 .offcanvas { height: 100vh; max-width: 78%; &.offcanvas-start { top: -1px; left: -1px; } .offcanvas-body { padding: 0; } } // 英雄 .hero-box { position: relative; height: 730px; background-image: url("../images/acg.jpg"); background-position-x: center; background-position-y: center; background-size: cover; &::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, .2); } } .mode_switcher { &.my_switcher { &:hover { right: 0; } position: fixed; right: -50px; top: 100px; z-index: 9999999; transition: 0.3s; button { display: flex; font-size: 20px; background: #5F2DED; padding: 10px; line-height: 20px; border-top-left-radius: 10px; border-bottom-left-radius: 10px; width: 90px; box-shadow: 0px 6px 34px rgba(215, 216, 222, 0.15); border: none; } } } // 主 .main-wrap { // 文章列表 .article-list { .article-item { display: flex; overflow: hidden; position: relative; background-color: #fff; height: 10rem; border-radius: var(--bs-border-radius); border-width: 1px; margin-bottom: 1rem; .blur-img { z-index: 0; img { object-fit: cover; position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 14.5rem; transform: scale(1.55); } } &.flex-row-reverse { .article-img { clip-path: polygon(6% 0, 100% 0, 100% 100%, 0 100%); } } .article-img { z-index: 10; margin: 0; width: 33.333333%; border-width: 0; clip-path: polygon(0 0, 100% 0, 94% 100%, 0 100%); .article-left-img { object-fit: cover; background-position: center; background-size: cover; width: 100%; height: 100%; } } .article-ctx { display: flex; z-index: 10; padding: 1.25rem 1rem; color: #fff; flex-direction: column; justify-content: space-between; width: 100%; background-color: rgba(0, 0, 0, .35); .article-info { display: flex; font-size: .75rem; line-height: 1rem; justify-content: space-between; letter-spacing: .06rem; text-shadow: 0 .1875rem .3125rem rgba(0, 0, 0, .3); } .article-title { font-weight: 700; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; font-size: 20px; line-height: 1.75rem; letter-spacing: .05em; color: #fff; overflow: hidden; } .article-description { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 12px; text-indent: 2em; line-height: 1.5rem; word-break: break-all; overflow: hidden; color: #fff; } } } } // 下一页按钮 #NextButton { width: auto; padding-left: 3rem; padding-right: 3rem; } // 详情 .article-detail { .tag { .tag-item { color: #0d6efd !important; background-color: rgba(13, 110, 253, .1) !important; } } .typography { color: #2c2e3b; font-size: 15px; line-height: 1.5; } .copyright { padding: 1rem; margin-top: 1.5rem; line-height: 1.5rem; border-radius: .25rem; .copyright-text { word-break: break-all; } } } .ssbox { .ss-list { padding-left: 0; .ss-content { .ss-datetime { display: flex; width: 16px; line-height: 18px; font-size: 18px; text-align: center; border-right: 1px solid var(--bs-border-color); padding: 0 22px 8px 0; float: left; margin-right: 1rem; overflow: hidden; max-height: 100px; } .ss-data-content { margin: 0 0 0 3.2rem; min-height: 88px; p { } } } } } .pigeonhole { .icon { width: auto; height: auto; font-size: 12px; } .accordion-button:focus { box-shadow: none; } .accordion-item { margin-bottom: 10px; &:last-child { margin-bottom: 0; } &:not(:first-of-type) { border-top: 1px solid var(--bs-border-color); } } } .comment-list { display: flex; flex-direction: column; align-self: stretch; padding: 0px; margin: 0px; flex: 1 1 auto; gap: 1.5rem; .content { font-size: 14px; .comment-text { font-size: 14px; line-height: 1.5; background-color: rgb(244, 246, 251); overflow-wrap: break-word; word-break: break-all; margin: 0.5rem 0px; padding: 0.5rem 0.75rem; border-radius: 2px; } } .comment-di { .comment-inner { img { width: 45px; height: 45px; border-radius: 999px; } } } .comment-quote { padding-left: 2rem; } .common-child { .common-child-item { margin-top: 1rem; .avatar { width: 35px; height: 35px; border-radius: 999px; } } } } .friendship-links { .friend-link-card { transition: transform 0.3s ease, box-shadow 0.3s ease; &:hover { transform: translateY(-5px); box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15); } } .friend-link-avatar { width: 80px; height: 80px; object-fit: cover; border: 3px solid rgba(13, 110, 253, 0.2); } .card { border-radius: var(--bs-border-radius); border: 1px solid var(--bs-border-color); } .card-header { background-color: rgba(0, 0, 0, 0.03); border-bottom: 1px solid var(--bs-border-color); } } } // 工具 .tools { display: none; position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 1045; margin-top: .25rem; flex-direction: column; .backup-btn { cursor: pointer; width: 50px; height: 50px; line-height: 50px; background-color: var(--bs-secondary-bg); right: 20px; bottom: 60px; text-align: center; overflow: hidden; border-radius: 50px; z-index: 9811 !important; position: fixed; display: block; box-shadow: 0px 10px 50px rgba(13, 38, 59, 0.15); i { width: 100%; display: block; line-height: 50px; font-size: 20px; transition: 0.5s; } } } .footer { border-top-width: 1px; border-top-style: solid; border-color: var(--bs-border-color); line-height: 1.8rem; letter-spacing: .3px; } } // media @media screen and (max-width: 576px) { .blog-body { .hero-box { height: 20rem; } .main-wrap { .ssbox { .ss-list { padding-left: 0; .ss-data-content { margin: 0 0 0 2.5rem } } } } } } @media screen and (min-width: 768px) { .blog-body { .main-wrap { .article-list { .article-item { background-color: #000; border-width: 0; height: 14.5rem; .blur-img { img { filter: blur(1.875rem) brightness(.75); } } .article-ctx { background-color: unset; padding: 3rem 2rem; width: 66.666667%; } } } } } } // 字体 [class^="fa-"], [class*=" fa-"] { vertical-align: middle; } // 工具 img { display: block; max-width: 100%; height: auto; vertical-align: middle; } .has-img { backdrop-filter: blur(8px) } .bg-blur { background: rgba(255, 255, 255, .9); -webkit-backdrop-filter: saturate(200%) blur(20px); backdrop-filter: saturate(200%) blur(20px); } .text-xs { font-size: .75rem; } .icon { font-size: 1rem; width: 1rem; height: 1rem; fill: currentColor; overflow: hidden; flex-shrink: 0; } // 滚动条 :root { scroll-behavior: auto; } html, body { &::-webkit-scrollbar { width: 6px; height: 6px; } &::-webkit-scrollbar-corner { background: unset; } &::-webkit-scrollbar-thumb { background: rgba(135, 135, 135, .4); border-radius: 6px; } &::-webkit-scrollbar-track { background: rgba(135, 135, 135, .1); } } .dark { html, body { &::-webkit-scrollbar-thumb { background: rgba(135, 135, 135, .6); } &::-webkit-scrollbar-track { background: rgba(135, 135, 135, .2); // 添加暗色模式下的轨道背景 } } } // 在文件末尾添加以下样式 .blog-body { // 文章详情页优化 .article-detail { // 文章元信息 .article-meta { background-color: var(--bs-light); padding: 0.75rem 1rem; border-radius: 0.375rem; margin: 1rem 0; .meta-item { display: flex; align-items: center; gap: 0.5rem; } } // 标签区域 .tag { .tag-item { color: #0d6efd !important; background-color: rgba(13, 110, 253, .1) !important; text-decoration: none; &:hover { background-color: rgba(13, 110, 253, .2) !important; } } } // 版权信息 .copyright { padding: 1rem; margin-top: 1.5rem; line-height: 1.5rem; border-radius: .25rem; background-color: var(--bs-light); .copyright-text { word-break: break-all; } } } // 目录导航样式 .toc-container { position: sticky; top: 100px; max-height: calc(100vh - 120px); overflow-y: auto; padding: 1rem 0; .toc-header { padding: 0.5rem 1rem; font-weight: 600; border-bottom: 1px solid var(--bs-border-color); margin-bottom: 0.5rem; } .toc-nav { a { display: block; color: var(--bs-secondary-color); text-decoration: none; padding: 0.25rem 1rem; border-left: 2px solid transparent; transition: all 0.2s; font-size: 0.875rem; &:hover { color: var(--bs-primary); border-left-color: var(--bs-primary); background-color: rgba(13, 110, 253, 0.05); } &.active { color: var(--bs-primary); border-left-color: var(--bs-primary); font-weight: 500; } } } } // 分享区域 .share-section { padding: 1rem 0; .share-button { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; color: var(--bs-body-color); background-color: var(--bs-light); transition: all 0.3s; &:hover { background-color: var(--bs-primary); color: white; } } } // 文章导航 .article-navigation { .prev-article, .next-article { flex: 1; a { color: var(--bs-body-color); text-decoration: none; &:hover { color: var(--bs-primary); } } } } // 评论区域 .comments-section { .comment-form { background-color: var(--bs-light); padding: 1.5rem; border-radius: 0.375rem; } .comment-item { padding: 1rem 0; &:not(:last-child) { border-bottom: 1px solid var(--bs-border-color); } } } } // 滚动条样式优化 .toc-container::-webkit-scrollbar { width: 6px; } .toc-container::-webkit-scrollbar-thumb { background: rgba(135, 135, 135, .4); border-radius: 6px; } .toc-container::-webkit-scrollbar-track { background: rgba(135, 135, 135, .1); } // 响应式优化 @media (max-width: 991.98px) { .toc-container { position: static; max-height: none; overflow-y: visible; margin-top: 1.5rem; } } /* 评论区域样式 */ .comments-section { margin-top: 2rem; } .comment-item { padding: 1rem 0; } .comment-item:not(:last-child) { border-bottom: 1px solid #eee; } .comment-form .form-control { border-radius: 0.375rem; } .comment-form .btn { border-radius: 0.375rem; } /* 回复评论的样式 */ .comment-item .comment-item { padding-left: 1rem; margin-top: 1rem; } /* 响应式调整 */ @media (max-width: 768px) { .comment-item .comment-item { margin-left: 1rem; } }