Files
blog-source/usr/themes/HarmonyHues/assets/css/markdown-style.css
2026-03-04 00:23:03 +08:00

550 lines
11 KiB
CSS
Executable File

@charset "UTF-8";
.markdown-body {
word-break: break-all;
/* table表格样式 */
}
.markdown-body h1 {
position: relative;
margin-top: 1rem;
margin-bottom: 1rem;
font-size: 2rem;
font-weight: 700;
}
.markdown-body h1::before {
content: "";
position: absolute;
top: 0;
left: -0.15rem;
width: 2rem;
height: 2rem;
background-image: linear-gradient(var(--color-primary-light-2), transparent);
opacity: .5;
border-radius: var(--border-radius-circle);
transition: all .3s;
z-index: -1;
bottom: 0;
}
.markdown-body h1::after {
content: "";
position: absolute;
width: 0.5rem;
height: 0.5rem;
background-image: linear-gradient(var(--color-primary-light-1), transparent);
opacity: .5;
border-radius: var(--border-radius-circle);
transition: all .3s;
z-index: -1;
bottom: 0;
}
.markdown-body h1:hover::before {
transform: scale(1.5);
}
.markdown-body h2 {
position: relative;
margin-top: 1rem;
margin-bottom: 1rem;
font-size: 1.5rem;
font-weight: 700;
}
.markdown-body h2::before {
content: "";
position: absolute;
top: 0;
left: -0.15rem;
width: 1.75rem;
height: 1.75rem;
background-image: linear-gradient(var(--color-primary-light-2), transparent);
opacity: .5;
border-radius: var(--border-radius-circle);
transition: all .3s;
z-index: -1;
bottom: 0;
}
.markdown-body h2::after {
content: "";
position: absolute;
width: 0.4375rem;
height: 0.4375rem;
background-image: linear-gradient(var(--color-primary-light-1), transparent);
opacity: .5;
border-radius: var(--border-radius-circle);
transition: all .3s;
z-index: -1;
bottom: 0;
}
.markdown-body h2:hover::before {
transform: scale(1.5);
}
.markdown-body h3 {
position: relative;
margin-top: 1rem;
margin-bottom: 1rem;
font-size: 1.25rem;
font-weight: 700;
}
.markdown-body h3::before {
content: "";
position: absolute;
top: 0;
left: -0.15rem;
width: 1.25rem;
height: 1.25rem;
background-image: linear-gradient(var(--color-primary-light-2), transparent);
opacity: .5;
border-radius: var(--border-radius-circle);
transition: all .3s;
z-index: -1;
bottom: 0.25rem;
}
.markdown-body h3::after {
content: "";
position: absolute;
width: 0.3125rem;
height: 0.3125rem;
background-image: linear-gradient(var(--color-primary-light-1), transparent);
opacity: .5;
border-radius: var(--border-radius-circle);
transition: all .3s;
z-index: -1;
bottom: 0;
}
.markdown-body h3:hover::before {
transform: scale(1.5);
}
.markdown-body h4 {
position: relative;
margin-top: 1rem;
margin-bottom: 1rem;
font-size: 1.125rem;
font-weight: 700;
}
.markdown-body h5 {
position: relative;
margin-top: 1rem;
margin-bottom: 1rem;
font-size: 1rem;
font-weight: 700;
}
.markdown-body h6 {
position: relative;
margin-top: 1rem;
margin-bottom: 1rem;
font-size: 0.875rem;
font-weight: 700;
}
.markdown-body p {
margin: 0;
font-size: 1rem;
line-height: 1.7;
}
.markdown-body a:not([data-fancybox]):not([data-links]):not([data-cloud]) {
color: var(--color-primary);
padding: 0 0.15rem;
outline: 0;
text-decoration: underline dotted 0.2ex;
text-decoration-skip-ink: none;
text-underline-offset: 0.5ex;
-webkit-box-decoration-break: clone;
box-decoration-break: clone;
background: linear-gradient(var(--color-primary-light-5), var(--color-primary-light-5)) no-repeat bottom/100% 0;
transition: background .3s;
}
.markdown-body a:not([data-fancybox]):not([data-links]):not([data-cloud]):hover {
text-decoration: underline;
background-size: 100% 100%;
}
.markdown-body blockquote,
.markdown-body details,
.markdown-body dl,
.markdown-body ol,
.markdown-body pre,
.markdown-body table,
.markdown-body ul {
margin-top: 0.5rem;
margin-bottom: 0.5rem;
}
.markdown-body ul,
.markdown-body ol {
padding-left: 2rem;
line-height: 1.7;
}
.markdown-body ul ul,
.markdown-body ul ol,
.markdown-body ol ul,
.markdown-body ol ol {
margin: 0;
padding-left: 1rem;
}
.markdown-body ol {
list-style-type: decimal;
}
.markdown-body ul {
list-style-type: disc;
}
.markdown-body img {
display: block;
max-width: 100%;
height: auto;
margin: auto;
margin-top: 0.25rem;
margin-bottom: 0.25rem;
border-radius: var(--border-radius-base);
object-fit: cover;
cursor: zoom-in;
cursor: -webkit-zoom-in;
border: var(--border-solid-small);
}
.markdown-body img.emoji-image {
display: inline-block;
width: 1.25rem;
height: 1.25rem;
margin: 0;
border: none;
}
.markdown-body blockquote {
position: relative;
padding: 2rem;
line-height: 1.8;
text-indent: 0;
color: var(--font-color-main-transparent);
border: var(--border-solid-small);
border-radius: var(--border-radius-base);
overflow: hidden;
}
.markdown-body blockquote:before, .markdown-body blockquote:after {
position: absolute;
font-family: Arial, serif;
font-size: 4rem;
font-weight: 700;
color: var(--border-color-main);
}
.markdown-body blockquote:before {
content: "“";
left: 1rem;
top: -1.5rem;
}
.markdown-body blockquote:after {
content: "”";
right: 1rem;
bottom: -3rem;
}
.markdown-body table {
width: 100%;
border-collapse: separate;
border-spacing: 0;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.markdown-body table th,
.markdown-body table td {
padding: 0.5rem 1rem;
border-right: 1px solid rgba(230, 230, 240, 0.75);
border-top: 1px solid rgba(230, 230, 240, 0.75);
letter-spacing: 0;
text-align: left;
vertical-align: top;
}
.markdown-body table tr:nth-child(odd) {
background-color: var(--overlay-color-light-1);
}
.markdown-body table tr:nth-child(even) {
background-color: var(--overlay-color-light-8);
}
.markdown-body table tr:last-child th:first-child {
border-left: 1px solid rgba(230, 230, 240, 0.75);
border-top-left-radius: var(--border-radius-medium);
}
.markdown-body table tr:last-child th:last-child {
border-top-right-radius: var(--border-radius-medium);
}
.markdown-body table tr:last-child td {
border-bottom: 1px solid rgba(230, 230, 240, 0.75);
}
.markdown-body table tr:last-child td:first-child {
border-bottom-left-radius: var(--border-radius-medium);
}
.markdown-body table tr:last-child td:last-child {
border-bottom-right-radius: var(--border-radius-medium);
}
.markdown-body table tr th {
background-color: var(--bg-color-main-dark);
color: var(--bg-color-main);
}
.markdown-body table tr td:first-child {
border-left: 1px solid rgba(230, 230, 240, 0.75);
}
.markdown-body code:not([class^="lang-"]):not([class^="language-"]) {
border-radius: 0.2rem;
background-color: var(--color-primary-light-4);
color: var(--color-primary);
font-size: 1rem;
padding: 0.15rem 0.3rem;
margin: 0 2px;
}
.markdown-body .pre-container {
position: relative;
border: var(--border-solid-small);
border-radius: var(--border-radius-medium);
overflow: hidden;
}
.markdown-body .pre-container .pre-header {
position: relative;
background-color: var(--bg-color-main);
}
.markdown-body .pre-container .pre-header .pre-icon::before {
display: inline-block;
content: '';
width: 12px;
height: 12px;
border-radius: var(--border-radius-circle);
background: #fc625d;
box-shadow: 20px 0 #fdbc40, 40px 0 #35cd4b;
z-index: 1;
}
.markdown-body .pre-container .pre-header .pre-copy {
font-size: 0.85rem;
background-color: transparent;
}
.markdown-body .pre-container pre {
position: relative;
margin: 0;
border-radius: unset;
max-height: 30rem;
}
.markdown-body .pre-container pre code {
font-size: 1rem;
}
.markdown-body .pre-container pre::-webkit-scrollbar {
width: 4px !important;
height: 4px !important;
-webkit-appearance: none;
appearance: none;
}
.markdown-body hr {
border: 0;
padding: 0.15rem;
background: repeating-linear-gradient(135deg, var(--border-color-main) 0px, var(--font-color-main-transparent) 1px, transparent 1px, transparent 6px);
}
.markdown-body video {
max-width: 100%;
height: auto;
vertical-align: middle;
border-radius: var(--border-radius-medium);
border: var(--border-solid-small);
}
.markdown-body iframe {
max-width: 100%;
height: auto;
vertical-align: middle;
border-radius: var(--border-radius-base);
}
/* 短代码样式一些公共样式 */
.short-code-card {
position: relative;
gap: 1rem;
color: var(--font-color-main);
text-decoration: none;
width: 20rem;
max-width: 100%;
min-height: 4rem;
overflow: hidden;
margin: 1rem auto;
z-index: 1;
overflow: hidden;
background: var(--gradient-45deg);
border-radius: var(--border-radius-medium);
box-shadow: var(--shadow-box-small);
border: var(--border-solid-small);
}
.short-code-card:hover {
box-shadow: var(--shadow-inset-box);
}
.short-code-card img,
.short-code-card svg {
width: 4rem;
height: 4rem;
margin: 0;
box-shadow: var(--shadow-nav);
}
/* 短代码-文章Hint样式 */
.hint-content {
--hint-color: var(--success);
--hint-bg: #e1efe5;
position: relative;
display: flex;
flex-direction: row;
gap: 0.5rem;
color: var(--hint-color);
border: 1px solid var(--hint-bg);
border-radius: var(--border-radius-base);
background-color: var(--hint-bg);
transition: all 0.3s ease-in-out;
overflow: hidden;
margin: 0.5rem 0;
}
.hint-content .iconfont {
line-height: 2;
color: var(--hint-color);
vertical-align: middle;
}
.hint-content.hint-info {
--hint-color: var(--font-color-main);
--hint-bg: #eee;
}
.hint-content.hint-warning {
--hint-color: var(--warning);
--hint-bg: #fff7dc;
}
.hint-content.hint-danger {
--hint-color: var(--red);
--hint-bg: #ffeaec;
}
.hint-content:hover {
transform: translateY(-5px);
}
/* 短代码-文章链接样式 */
.to-links-content {
position: relative;
}
.to-links-content a .to-links-text span {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
word-break: break-all;
}
.to-links-content a .to-links-url,
.to-links-content a .icon-lianjie {
color: var(--font-color-muted);
}
/* 短代码-网盘下载样式 */
.cloud-download-box {
position: relative;
}
.cloud-download-box .cloud-download-icon {
flex-shrink: 0;
background-color: var(--bg-color-main);
border-radius: var(--border-radius-medium);
overflow: hidden;
}
.cloud-download-box .cloud-download-info {
width: 100%;
}
.cloud-download-box .cloud-download-info .cloud-download-title a {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
word-break: break-all;
}
.cloud-download-box .cloud-download-info .cloud-download-password {
display: inline-block;
color: var(--font-color-main-light);
}
.cloud-download-box .cloud-download-info .cloud-download-btn span {
color: var(--font-color-main-transparent);
font-size: 0.8rem;
}
.cloud-download-box .cloud-download-info .cloud-download-btn a {
background-color: var(--bg-color-primary);
border-radius: var(--border-radius-medium);
}
/* 折叠框样式 */
.fold-container {
position: relative;
overflow: hidden;
border: var(--border-solid-small);
background: var(--gradient-45deg);
border-radius: var(--border-radius-medium);
}
.fold-container .fold-header {
cursor: pointer;
user-select: none;
background: var(--widget-bg-gradient);
}
.fold-container .fold-header::after {
content: "+";
font-size: 1.25rem;
line-height: 1;
float: right;
}
.fold-container[open] .fold-header::after {
content: "-";
}