Files
blogflare/src/app.css
T
2026-09-12 08:17:48 +08:00

1601 lines
30 KiB
CSS

@import 'highlight.js/styles/github.css';
:root {
--bg-color: #ffffff;
--text-color: rgba(0, 0, 0, 0.86);
--text-muted: rgba(0, 0, 0, 0.6);
--border-color: rgba(0, 0, 0, 0.05);
--header-bg: #000000;
--header-bg-blur: rgba(0, 0, 0, 0.85);
--header-text: #ffffff;
--header-text-hover: #ffffff;
--accent-color: #419b38;
--font-sans:
'Open Sans', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft Yahei', 'WenQuanYi Micro Hei',
'Segoe UI Emoji', 'Segoe UI Symbol', Helvetica, Arial, -apple-system, system-ui, sans-serif;
--font-serif: 'Noto Serif SC', var(--font-sans);
--layout-width: 860px;
--hero-height: 40vh;
}
* {
box-sizing: border-box;
}
html {
font-size: 16px;
}
body {
margin: 0;
padding: 0;
font-family: var(--font-sans);
background-color: var(--bg-color);
color: var(--text-color);
line-height: 1.8;
}
.frontend-layout {
display: flex;
flex-direction: column;
min-height: 100vh;
}
.frontend-layout > main {
flex: 1 0 auto;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: var(--font-sans);
color: var(--title-color);
font-weight: 600;
margin-top: 1.5em;
margin-bottom: 1em;
}
a {
color: inherit;
text-decoration: none;
transition: opacity 0.2s;
}
a:hover {
opacity: 0.7;
}
/* Base Layout */
.wrapper,
.container {
max-width: var(--layout-width);
margin: 0 auto;
padding: 0 20px;
}
@media screen and (min-width: 1024px) {
.wrapper.wide,
.container.wide {
max-width: 1024px;
}
}
/* Header (VOID style - dark glass, centered links) */
.header {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 58px;
background-color: var(--header-bg);
color: var(--header-text);
z-index: 1000;
transform: translateZ(0);
transition: box-shadow 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
@supports (backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px)) {
.header {
background-color: var(--header-bg-blur);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
}
}
.header.scrolled {
box-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
}
.header .container {
display: flex;
justify-content: center; /* Center the navigation */
align-items: center;
height: 100%;
max-width: 100%;
margin: 0 auto;
padding: 0 20px;
position: relative;
}
.header .brand {
font-weight: 600;
font-size: 1.7rem;
letter-spacing: 0.075rem;
color: var(--header-text);
position: absolute;
left: 20px;
z-index: 10;
text-decoration: none;
}
.header nav {
display: flex;
height: 100%;
justify-content: center;
flex: 1;
}
.header nav a {
display: flex;
align-items: center;
justify-content: center;
color: var(--header-text);
font-size: 1rem;
padding: 0.3rem 0.55rem;
height: 100%;
transition: 0.3s;
position: relative;
}
.header nav a:hover {
color: var(--header-text-hover);
background-color: rgba(255, 255, 255, 0.12);
}
.header nav a.active,
.header nav .nav-dropdown-trigger.active {
font-weight: 600;
color: var(--header-text-hover);
background-color: rgba(255, 255, 255, 0.08);
}
.header nav a.active::after,
.header nav .nav-dropdown-trigger.active::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 2px;
background-color: var(--accent-color, #419b38);
transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
/* Header Dropdown Menu Styles */
.header nav .nav-dropdown {
position: relative;
display: flex;
align-items: center;
height: 100%;
}
.header nav .nav-dropdown-trigger {
display: flex;
align-items: center;
justify-content: center;
color: var(--header-text);
font-size: 1rem;
padding: 0.3rem 0.55rem;
height: 100%;
transition: 0.3s;
cursor: pointer;
position: relative;
}
.header nav .nav-dropdown-trigger:hover,
.header nav .nav-dropdown:hover .nav-dropdown-trigger {
color: var(--header-text-hover);
background-color: rgba(255, 255, 255, 0.12);
}
.header nav .dropdown-menu {
position: absolute;
top: 100%;
left: 0;
min-width: 120px;
background-color: var(--header-bg, #000000);
border: 1px solid rgba(255, 255, 255, 0.15);
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
opacity: 0;
pointer-events: none;
transform: translateY(-4px);
transition:
opacity 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94),
transform 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94);
z-index: 1100;
padding: 4px 0;
}
.header nav .nav-dropdown:hover .dropdown-menu {
opacity: 1;
pointer-events: auto;
transform: translateY(0);
}
.header nav .dropdown-menu a {
display: block;
padding: 8px 16px;
height: auto;
color: var(--header-text);
font-size: 0.9rem;
white-space: nowrap;
justify-content: flex-start;
}
.header nav .dropdown-menu a:hover {
background-color: rgba(255, 255, 255, 0.15);
color: var(--header-text-hover);
}
/* Mobile Hamburger Menu */
.mobile-menu-btn {
display: none;
background: none;
border: none;
cursor: pointer;
padding: 10px;
z-index: 1100;
color: var(--header-text);
}
@media screen and (max-width: 767px) {
.header .container {
justify-content: space-between;
}
.header .brand {
position: static;
z-index: 1100;
}
.mobile-menu-btn {
display: block;
}
.header nav {
position: absolute;
top: 58px;
left: 0;
width: 100%;
height: auto;
max-height: 0;
overflow: hidden;
flex-direction: column;
background-color: var(--header-bg);
transition: max-height 0.3s ease;
justify-content: flex-start;
}
@supports (backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px)) {
.header nav {
background-color: var(--header-bg-blur);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
}
}
.header nav.open {
max-height: 400px;
overflow-y: auto;
padding-bottom: 10px;
}
.header nav a,
.header nav .nav-dropdown-trigger {
width: 100%;
height: auto;
padding: 15px 20px;
font-size: 1.1rem;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
justify-content: flex-start;
}
.header nav .nav-dropdown {
flex-direction: column;
align-items: flex-start;
width: 100%;
height: auto;
}
.header nav .dropdown-menu {
position: static;
width: 100%;
box-shadow: none;
border: none;
background-color: rgba(255, 255, 255, 0.05);
opacity: 1;
pointer-events: auto;
transform: none;
display: none;
}
.header nav .nav-dropdown:hover .dropdown-menu {
display: block;
}
.header nav a.active::after,
.header nav .nav-dropdown-trigger.active::after {
top: 0;
bottom: 0;
left: 0;
right: auto;
width: 4px;
height: 100%;
}
}
/* DoIt Style Home Profile */
.home-profile {
text-align: center;
padding: calc(58px + 8vh) 0 2rem;
animation: fade-in 1s ease-out;
}
.home-avatar {
padding: 0.5rem;
}
.home-avatar img {
display: inline-block;
width: 8rem;
height: auto;
margin: 0 auto;
border-radius: 100%;
box-shadow: 0 0 0 0.3618em rgba(0, 0, 0, 0.05);
transition: all 0.4s ease;
}
.home-avatar img:hover {
transform: translateY(-0.75rem);
}
.home-title {
font-size: 1.5rem;
font-weight: bold;
margin: 0;
padding: 0.5rem;
color: var(--title-color);
}
.home-subtitle {
font-size: 1rem;
font-weight: normal;
margin: 0;
padding: 0.5rem;
color: var(--text-muted);
}
@keyframes fade-in {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* Post List & Grid Layout */
.post-list {
display: grid;
grid-template-columns: 1fr;
gap: 30px;
margin: 2rem 0;
}
/* Single column toggle */
body.single-col .post-list {
grid-template-columns: 1fr;
}
@media screen and (max-width: 767px) {
.post-list {
grid-template-columns: 1fr;
}
}
.card-link {
display: block;
width: 100%;
max-width: 640px;
margin: 0 auto;
}
.card {
padding-bottom: 30px;
background-color: transparent;
display: flex;
flex-direction: column;
}
@media screen and (max-width: 767px) {
.card {
border-bottom: 1px solid var(--border-color);
}
}
@media screen and (min-width: 767px) {
.card {
padding-bottom: 0;
border: 2px solid var(--text-color);
border-bottom: 2px solid var(--text-color);
transition: 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) border-color;
}
.card .content-wrap {
padding: 20px;
}
.card-link:hover .card {
border-color: var(--accent-color);
}
}
.card .title {
font-size: 1.4rem;
font-weight: bold;
margin: 0 0 0.6rem 0;
color: var(--text-color);
line-height: 1.35;
transition: 0.2s color;
}
@media screen and (min-width: 767px) {
.card .title {
font-size: 1.45rem;
}
.card-link:hover .title {
color: var(--accent-color) !important;
}
}
.card .post-meta-index {
color: rgba(0, 0, 0, 0.125);
font-size: 14px;
font-weight: bold;
font-family:
-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell',
'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
text-transform: uppercase;
margin-bottom: 3px;
}
.card .excerpt {
margin-top: 0.6rem;
margin-bottom: 0;
flex-grow: 1;
}
.card .full-link {
border-bottom: 1px solid rgba(0, 0, 0, 0.2);
transition: 0.3s;
}
.card-link:hover .full-link {
border-bottom-color: var(--accent-color);
color: var(--accent-color);
}
/* Article Detail */
.article-detail {
padding: 2rem 0 4rem 0;
}
@keyframes float-down {
0% {
opacity: 0;
transform: translateY(-18px);
}
100% {
opacity: 1;
transform: translateY(0);
}
}
.banner-title {
position: relative;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 40px 20px 24px;
animation: float-down 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}
@media screen and (max-width: 767px) {
.banner-title {
padding: 30px 1rem 16px;
}
}
.banner-title .post-title {
text-align: center;
font-weight: 600;
word-break: break-word;
font-size: 1.6rem;
line-height: 1.4;
margin: 0 0 0.5rem;
color: var(--title-color);
}
@media screen and (max-width: 767px) {
.banner-title .post-title {
font-size: 1.3rem;
}
}
.banner-title .post-meta {
text-align: center;
font-size: 14px;
font-weight: 300;
margin-bottom: 0;
color: var(--text-color);
}
.banner-title .post-meta a {
border-bottom: 1px solid rgba(0, 0, 0, 0.2);
transition: 0.3s;
}
.banner-title .post-meta a:hover {
border-bottom-color: var(--accent-color);
color: var(--accent-color);
}
.article-content {
font:
400 18px/1.75 'Open Sans',
var(--font-sans);
word-break: break-word;
}
.article-content p {
margin: 0.92em 0;
}
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
font-family: var(--font-sans);
position: relative;
}
.article-content h1 {
font-size: 1.3em;
font-weight: 600;
margin: 1.1em 0 0.36em;
}
.article-content > h1 {
margin-top: 0;
font-size: 1.3em;
}
.article-content h2 {
font-size: 1.2em;
font-weight: 600;
margin: 1.005em 0 0.375em;
padding-left: 14px;
border-left: 5px solid var(--accent-color);
line-height: 1.4;
background: linear-gradient(to right, rgba(65, 155, 56, 0.08) 0%, transparent 100%);
padding-top: 4px;
padding-bottom: 4px;
}
.article-content h3 {
font-size: 1.05em;
font-weight: 600;
margin: 1em 0 0.2925em;
display: flex;
align-items: center;
}
.article-content h3::before {
content: '#';
color: var(--accent-color);
margin-right: 8px;
font-weight: 600;
font-size: 1.05em;
}
.article-content h4 {
font-size: 1em;
margin: 1em 0 0.35em;
position: relative;
padding-left: 12px;
}
.article-content h4::before {
content: '';
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 4px;
height: 4px;
border-radius: 50%;
background-color: var(--accent-color);
}
.article-content h5,
.article-content h6 {
font-size: 1em;
margin: 1em 0 0.35em;
}
.article-content h6 {
font-weight: 500;
}
.article-content a:not([data-fancybox='gallery']):not(.post-like):not(.edit-button) {
word-wrap: break-word;
word-break: break-all;
border-bottom: 1px solid rgba(0, 0, 0, 0.2);
transition: border-color 0.2s;
text-decoration: none;
}
.article-content a:not([data-fancybox='gallery']):not(.post-like):not(.edit-button):hover {
border-color: #000;
opacity: 1;
}
.article-content img {
max-width: 100%;
height: auto;
display: block;
margin: 0 auto;
}
/* 适配 VOID 的图文混排结构 (figure + figcaption) */
.article-content figure {
margin: 1.5rem 0;
text-align: center;
}
.article-content figcaption {
font-size: 0.9rem;
color: #888;
margin-top: 0.5rem;
}
/* ========== DoIt 代码块样式 ========== */
.highlight,
.code-block {
font-family:
'Fira Code', 'Source Code Pro', Consolas, 'Microsoft YaHei', Menlo, Monaco, 'Courier New',
monospace;
font-size: 0.875rem;
}
.code-block code,
.code-block pre {
background-color: #f5f5f5 !important;
font-family: inherit;
}
.code-block {
margin: 0.5rem 0;
border-radius: 0;
overflow: hidden;
}
/* 标题栏 — 高度与 admonition-title 精确对齐 */
.code-block-header {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
background-color: #ededed;
font-size: 1rem;
}
.code-block-title-btn {
margin: 0;
display: flex;
align-items: center;
flex: 1;
background: none;
border: none;
cursor: pointer;
padding: 0.25rem 2rem;
color: inherit;
font: inherit;
position: relative;
}
/* 箭头图标 — 与 admonition 完全一致的绝对定位和间距 */
.code-block-title-btn .chevron-icon {
font-size: 0.9rem;
width: 0.85em;
height: 0.85em;
position: absolute;
top: 0.6rem;
left: 0.75rem;
transition: transform 0.3s ease-in-out;
}
.code-block.is-open .code-block-title-btn .chevron-icon {
transform: rotate(90deg);
}
.code-block-title-btn .code-title {
user-select: none;
display: block;
line-height: 1.6;
}
/* 右侧按钮区 */
.code-header-actions {
display: flex;
align-items: center;
}
.code-header-actions button,
.code-header-actions .ellipsis-icon {
background: none;
border: none;
cursor: pointer;
user-select: none;
margin-inline: 0.5rem;
padding: 0;
color: inherit;
display: flex;
align-items: center;
justify-content: center;
line-height: 1;
}
.code-header-actions button span {
display: flex;
align-items: center;
justify-content: center;
line-height: 1;
}
.code-header-actions .check-icon {
display: none;
}
.code-header-actions svg {
display: block;
}
/* 操作按钮:默认隐藏,展开时显示 */
.code-header-actions .action-icon {
display: none;
}
.code-block.is-open .code-header-actions .action-icon {
display: flex;
}
/* 省略号:默认显示,展开时隐藏 */
.code-header-actions .ellipsis-icon {
display: flex;
}
.code-block.is-open .code-header-actions .ellipsis-icon {
display: none;
}
/* 按钮激活态(行号/换行开启时高亮) */
.code-header-actions button.is-active {
color: #2d809a;
}
.code-header-actions button:hover {
color: #2d809a;
}
/* pre */
.code-block pre {
display: block;
margin: 0;
padding: 0;
border-radius: 0;
}
.code-block .code-pre {
counter-reset: codeblock;
}
/* code — max-height + padding 同时过渡,收缩彻底无残留 */
.code-block pre code {
display: block !important;
margin: 0;
max-height: 0;
padding: 0;
transition:
max-height 0.3s ease-out,
padding 0.3s ease-out;
overflow: hidden;
line-height: 1.6;
}
/* 覆盖 highlight.js github.css 的默认白色背景 */
.code-block pre code.hljs {
padding: 0.8rem 0.75rem;
background: #f5f5f5 !important;
overflow-x: auto;
}
.code-block.is-closed pre code.hljs {
padding-top: 0 !important;
padding-bottom: 0 !important;
overflow: hidden !important; /* 防止横向滚动条撑开高度导致“半行内容”残留 */
}
/* ---- 行号功能 ---- */
.code-block.show-line-numbers pre code .code-line::before {
counter-increment: codeblock;
content: counter(codeblock);
display: inline-block;
min-width: 2.5ch;
text-align: right;
margin-right: 0.75rem;
color: #8c8fa1;
user-select: none;
}
/* ---- 换行功能 ---- */
.code-block.is-wrap pre code {
white-space: pre-wrap;
word-break: break-all;
}
.article-content code:not(pre code) {
background-color: rgba(0, 0, 0, 0.05);
border-radius: 4px;
padding: 0.2em 0.4em;
font-size: 85%;
color: #e96900;
font-family:
'Fira Code', 'Source Code Pro', Consolas, 'Microsoft YaHei', Menlo, Monaco, 'Courier New',
monospace;
}
.badge {
background-color: rgba(0, 0, 0, 0.05);
border-radius: 4px;
padding: 0.2em 0.4em;
font-size: 85%;
font-family:
'Fira Code', 'Source Code Pro', Consolas, 'Microsoft YaHei', Menlo, Monaco, 'Courier New',
monospace;
color: #e96900;
border: none;
display: inline-block;
}
.article-content blockquote {
margin: 1.5em 0;
padding: 0.5rem 1rem;
border-left: 0.25rem solid #6bd6fd;
background-color: rgba(107, 214, 253, 0.2);
color: var(--text-color);
}
/* Admonitions (DoIt style - full 14 types) */
.admonition {
position: relative;
margin: 1rem 0;
padding: 0 0.75rem;
border-left: 0.25rem solid transparent;
font-family: var(--font-sans);
}
.admonition .details-content {
max-height: 0;
overflow: hidden;
transition: max-height 0.3s ease-out;
}
.admonition.open .details-content {
/* maxHeight is dynamically set by JS */
}
.admonition .admonition-title {
font-weight: bold;
margin: 0 -0.75rem;
padding: 0.25rem 1.8rem;
border-bottom: 1px solid transparent;
font-size: 1rem;
line-height: 1.6;
display: flex;
align-items: center;
cursor: pointer;
list-style: none;
}
.admonition .admonition-title::-webkit-details-marker {
display: none;
}
.admonition .admonition-title::after {
content: '';
position: absolute;
right: 0.75rem;
top: 0.85rem;
width: 0.4rem;
height: 0.4rem;
border-right: 2px solid currentColor;
border-bottom: 2px solid currentColor;
transform: rotate(-45deg);
transition: transform 0.2s ease-in-out;
opacity: 0.6;
}
.admonition.open .admonition-title::after {
transform: rotate(45deg);
top: 0.7rem;
}
.admonition .details-content {
padding: 0;
}
.admonition .admonition-content {
padding: 0.5rem 0.75rem;
}
.admonition .admonition-content > p:first-child {
margin-top: 0;
}
.admonition .admonition-content > p:last-child {
margin-bottom: 0;
}
.admonition span.icon > svg {
font-size: 0.9rem;
position: absolute;
top: 0.6rem;
left: 0.4rem;
}
.admonition p {
font-family: var(--font-sans);
font-size: 0.95rem;
line-height: 1.6;
margin-bottom: 0;
color: var(--text-color);
}
.admonition:last-child {
margin-bottom: 0.75rem;
}
/* 1. note */
.admonition.note {
border-left-color: #448aff;
background-color: rgba(68, 138, 255, 0.1);
}
.admonition.note .admonition-title {
border-bottom-color: rgba(68, 138, 255, 0.1);
background-color: rgba(68, 138, 255, 0.25);
}
.admonition.note.open .admonition-title {
background-color: rgba(68, 138, 255, 0.1);
}
.admonition.note span.icon > svg {
color: #448aff;
}
/* 2. abstract */
.admonition.abstract {
border-left-color: #00b0ff;
background-color: rgba(0, 176, 255, 0.1);
}
.admonition.abstract .admonition-title {
border-bottom-color: rgba(0, 176, 255, 0.1);
background-color: rgba(0, 176, 255, 0.25);
}
.admonition.abstract.open .admonition-title {
background-color: rgba(0, 176, 255, 0.1);
}
.admonition.abstract span.icon > svg {
color: #00b0ff;
}
/* 3. info */
.admonition.info {
border-left-color: #00b8d4;
background-color: rgba(0, 184, 212, 0.1);
}
.admonition.info .admonition-title {
border-bottom-color: rgba(0, 184, 212, 0.1);
background-color: rgba(0, 184, 212, 0.25);
}
.admonition.info.open .admonition-title {
background-color: rgba(0, 184, 212, 0.1);
}
.admonition.info span.icon > svg {
color: #00b8d4;
}
/* 4. tip */
.admonition.tip {
border-left-color: #00bfa5;
background-color: rgba(0, 191, 165, 0.1);
}
.admonition.tip .admonition-title {
border-bottom-color: rgba(0, 191, 165, 0.1);
background-color: rgba(0, 191, 165, 0.25);
}
.admonition.tip.open .admonition-title {
background-color: rgba(0, 191, 165, 0.1);
}
.admonition.tip span.icon > svg {
color: #00bfa5;
}
/* 5. success */
.admonition.success {
border-left-color: #00c853;
background-color: rgba(0, 200, 83, 0.1);
}
.admonition.success .admonition-title {
border-bottom-color: rgba(0, 200, 83, 0.1);
background-color: rgba(0, 200, 83, 0.25);
}
.admonition.success.open .admonition-title {
background-color: rgba(0, 200, 83, 0.1);
}
.admonition.success span.icon > svg {
color: #00c853;
}
/* 6. question */
.admonition.question {
border-left-color: #64dd17;
background-color: rgba(100, 221, 23, 0.1);
}
.admonition.question .admonition-title {
border-bottom-color: rgba(100, 221, 23, 0.1);
background-color: rgba(100, 221, 23, 0.25);
}
.admonition.question.open .admonition-title {
background-color: rgba(100, 221, 23, 0.1);
}
.admonition.question span.icon > svg {
color: #64dd17;
}
/* 7. warning */
.admonition.warning {
border-left-color: #ff9100;
background-color: rgba(255, 145, 0, 0.1);
}
.admonition.warning .admonition-title {
border-bottom-color: rgba(255, 145, 0, 0.1);
background-color: rgba(255, 145, 0, 0.25);
}
.admonition.warning.open .admonition-title {
background-color: rgba(255, 145, 0, 0.1);
}
.admonition.warning span.icon > svg {
color: #ff9100;
}
/* 8. failure */
.admonition.failure {
border-left-color: #ff5252;
background-color: rgba(255, 82, 82, 0.1);
}
.admonition.failure .admonition-title {
border-bottom-color: rgba(255, 82, 82, 0.1);
background-color: rgba(255, 82, 82, 0.25);
}
.admonition.failure.open .admonition-title {
background-color: rgba(255, 82, 82, 0.1);
}
.admonition.failure span.icon > svg {
color: #ff5252;
}
/* 9. danger */
.admonition.danger {
border-left-color: #ff1744;
background-color: rgba(255, 23, 68, 0.1);
}
.admonition.danger .admonition-title {
border-bottom-color: rgba(255, 23, 68, 0.1);
background-color: rgba(255, 23, 68, 0.25);
}
.admonition.danger.open .admonition-title {
background-color: rgba(255, 23, 68, 0.1);
}
.admonition.danger span.icon > svg {
color: #ff1744;
}
/* 10. bug */
.admonition.bug {
border-left-color: #f50057;
background-color: rgba(245, 0, 87, 0.1);
}
.admonition.bug .admonition-title {
border-bottom-color: rgba(245, 0, 87, 0.1);
background-color: rgba(245, 0, 87, 0.25);
}
.admonition.bug.open .admonition-title {
background-color: rgba(245, 0, 87, 0.1);
}
.admonition.bug span.icon > svg {
color: #f50057;
}
/* 11. example */
.admonition.example {
border-left-color: #651fff;
background-color: rgba(101, 31, 255, 0.1);
}
.admonition.example .admonition-title {
border-bottom-color: rgba(101, 31, 255, 0.1);
background-color: rgba(101, 31, 255, 0.25);
}
.admonition.example.open .admonition-title {
background-color: rgba(101, 31, 255, 0.1);
}
.admonition.example span.icon > svg {
color: #651fff;
}
/* 12. quote */
.admonition.quote {
border-left-color: #9e9e9e;
background-color: rgba(159, 159, 159, 0.1);
}
.admonition.quote .admonition-title {
border-bottom-color: rgba(159, 159, 159, 0.1);
background-color: rgba(159, 159, 159, 0.25);
}
.admonition.quote.open .admonition-title {
background-color: rgba(159, 159, 159, 0.1);
}
.admonition.quote span.icon > svg {
color: #9e9e9e;
}
/* 13. important */
.admonition.important {
border-left-color: #8957e5;
background-color: rgba(137, 87, 229, 0.1);
}
.admonition.important .admonition-title {
border-bottom-color: rgba(137, 87, 229, 0.1);
background-color: rgba(137, 87, 229, 0.25);
}
.admonition.important.open .admonition-title {
background-color: rgba(137, 87, 229, 0.1);
}
.admonition.important span.icon > svg {
color: #8957e5;
}
/* 14. caution */
.admonition.caution {
border-left-color: #da3633;
background-color: rgba(218, 54, 51, 0.1);
}
.admonition.caution .admonition-title {
border-bottom-color: rgba(218, 54, 51, 0.1);
background-color: rgba(218, 54, 51, 0.25);
}
.admonition.caution.open .admonition-title {
background-color: rgba(218, 54, 51, 0.1);
}
.admonition.caution span.icon > svg {
color: #da3633;
}
/* Footer */
footer {
position: relative;
background-color: #000;
padding-bottom: 1.5rem;
margin-top: 4rem;
}
footer .container {
display: flex;
}
footer section {
flex: 1;
position: relative;
margin: 1rem 0.5rem 0 0.5rem;
}
footer section:nth-child(2) {
text-align: right;
}
footer section,
footer section * {
color: #ddd;
font-weight: 300;
text-decoration: none;
}
footer section p {
line-height: 1.5;
margin: 0.5rem 0;
font-size: 16px;
}
footer section p:first-child {
margin-top: 1rem;
}
@media screen and (max-width: 767px) {
footer .container {
flex-direction: column;
}
footer section:nth-child(2) {
margin-top: 0.5rem;
text-align: left;
}
footer section:nth-child(2) p:nth-child(1) {
margin-top: 0;
}
}
/* Floating Controllers */
#ctrler-panel {
position: fixed;
right: 1.5rem;
bottom: 1.5rem;
z-index: 100;
display: flex;
flex-direction: column;
transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.ctrler-item a {
display: flex;
align-items: center;
justify-content: center;
width: 40px;
height: 40px;
background-color: #111;
color: #cececf;
transition: 0.3s;
}
@media (hover: hover) {
.ctrler-item a:hover {
background-color: var(--accent-color);
opacity: 1;
}
}
/* ========== VOID 风格 TOC (侧栏目录) ========== */
.toc-mask {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(0, 0, 0, 0.4);
z-index: 3;
opacity: 0;
visibility: hidden;
transition:
opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
visibility 0s 0.3s;
display: block;
}
@media screen and (max-width: 1199.5px) {
.sidebar-show .toc-mask {
opacity: 1;
visibility: visible;
transition: opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
}
.TOC {
position: fixed;
top: 0;
bottom: 0;
z-index: 4;
overflow: auto;
-webkit-overflow-scrolling: touch;
width: 280px;
right: -280px;
background-color: #111; /* VOID style dark background */
box-shadow: -2px 0 8px rgba(0, 0, 0, 0.05);
padding: 1rem;
padding-right: 0;
padding-top: 60px;
transition: right 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.TOC::-webkit-scrollbar {
display: none;
}
.TOC::before {
content: 'Contents';
position: absolute;
left: 0;
top: 0;
line-height: 60px;
height: 60px;
width: 100%;
font-size: 20px;
font-weight: 600;
text-transform: uppercase;
text-align: center;
color: #fff;
box-sizing: border-box;
}
.sidebar-show .TOC {
right: 0;
}
/* 目录内容列表样式 */
.TOC .toc-list {
position: relative;
list-style: none;
padding-left: 0;
margin: 0;
line-height: 2.1;
}
.TOC .toc-list .toc-list {
position: unset;
padding-left: 1rem;
}
.TOC .is-collapsible {
max-height: 1000px;
overflow: hidden;
transition: all 300ms ease-in-out;
}
.TOC .is-collapsed {
max-height: 0;
}
.TOC li a {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
display: block;
width: 100%;
position: relative;
color: #b0b0b0; /* VOID style dark text */
transition: color 0.2s;
text-decoration: none;
}
.TOC li a:hover,
.TOC li a.is-active-link {
color: #419b38;
opacity: 1;
}
.TOC li a.is-active-link {
font-weight: 700;
}
.TOC .is-active-link::before {
content: '';
background-color: rgba(0, 0, 0, 0.3); /* VOID style dark highlight */
display: block;
height: 2.1rem;
left: -1rem;
top: 0;
position: absolute;
width: calc(100% + 1rem);
border-left: 2px solid #419b38;
z-index: -1;
box-sizing: border-box;
}
@media screen and (min-width: 1199.5px) {
.TOC .toc-link:hover::before {
content: '';
background-color: rgba(0, 0, 0, 0.3);
display: block;
height: 2.1rem;
left: -1rem;
top: 0;
position: absolute;
width: calc(100% + 1rem);
border-left: 2px solid #419b38;
z-index: -1;
box-sizing: border-box;
}
}
/* 主体偏移 */
@media screen and (min-width: 1199.5px) {
div.contents-wrap,
.header nav,
footer,
footer .container.wide {
transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.sidebar-show div.contents-wrap,
.sidebar-show .header nav,
.sidebar-show footer {
transform: translateX(-140px);
}
.sidebar-show footer .container.wide {
max-width: 860px;
}
}
@media screen and (max-width: 1199.5px) {
div.contents-wrap {
transition: opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
}
/* 展开/关闭按钮 */
#toggle-toc {
position: fixed;
right: 1.5rem;
bottom: calc(1.5rem + 40px); /* Exactly above the go-top button */
width: 40px;
height: 40px;
background-color: #111;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
z-index: 101;
transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
color: #cececf;
}
@media (hover: hover) {
#toggle-toc:hover {
background-color: var(--accent-color);
}
}
#toggle-toc svg,
.ctrler-item svg {
width: 20px;
height: 20px;
transition: transform 0.3s;
}
.sidebar-show #toggle-toc svg {
transform: rotate(180deg);
}
@media screen and (min-width: 1199.5px) {
.sidebar-show #toggle-toc,
.sidebar-show #ctrler-panel {
right: 300px;
}
}
/* Tags Styling (VOID style) */
.tags {
margin: 1.5rem 0;
padding-top: 1.125rem;
padding-bottom: calc(1.125rem - 5px);
border-top: 1px solid rgba(0, 0, 0, 0.08);
border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.tags .tag-item {
font-size: 15px;
font-family: 'Open Sans', var(--font-sans);
margin-right: 12px;
margin-bottom: 5px;
display: inline-block;
border: none !important;
opacity: 0.6;
text-decoration: none;
color: var(--text-color);
transition: opacity 0.3s;
}
.tags .tag-item:hover {
opacity: 1;
}
.tags .tag-item::before {
content: '#';
margin-right: 2px;
}
.post-cover {
width: 100%;
height: auto;
overflow: hidden;
border-bottom: none;
}
.post-cover img {
width: 100%;
height: auto;
display: block;
border-radius: 0;
}
.article-content.has-cover .content-wrap {
padding-top: 20px;
}
.detail-cover {
height: auto;
border-bottom: none;
border-radius: 0;
margin-bottom: 30px;
}
.detail-cover img {
width: 100%;
height: auto;
object-fit: contain;
border-radius: 0;
}
/* 打印优化 */
@media print {
/* 强制浏览器打印背景颜色和图片,并移除所有阴影(解决分页处的奇怪阴影) */
* {
-webkit-print-color-adjust: exact !important;
print-color-adjust: exact !important;
box-shadow: none !important;
text-shadow: none !important;
}
/* 隐藏目录、浮动按钮面板、页脚、顶栏导航、代码块操作按钮及目录切换按钮 */
.TOC,
#ctrler-panel,
#toggle-toc,
footer,
header nav,
header .mobile-menu-btn,
.code-header-actions {
display: none !important;
}
/* 顶栏仅在第一页显示,使用浅灰色背景以区分正文,同时节省墨水 */
.header {
position: static !important;
background-color: #f3f4f6 !important; /* 浅灰色背景 */
color: black !important;
border-bottom: 2px solid #e5e7eb !important;
}
.header a,
.header .brand {
color: black !important;
}
/* 在顶栏的站点名称后追加版权声明 */
.header .brand::after {
content: ' - 本站所有内容仅用于教学,未经作者允许,不得以任何其他形式使用';
font-size: 14px;
font-weight: normal;
margin-left: 10px;
}
/* 移除主容器为了悬浮顶栏而预留的顶部内边距 */
main {
padding-top: 0 !important;
}
}