@@ -1,565 +0,0 @@
/* markdown.css
默认:明亮 / 白色背景主题
同时提供:.dark .prose 覆盖(如需启用 class-based dark 模式)
依赖:全局定义的 CSS 变量 --color-primary 和 --color-secondary
*/
/* 平滑滚动 */
html {
scroll-behavior : smooth ;
}
/* ---------- 默认: 明亮主题( Light) ---------- */
/* 美化 prose 内容样式 */
. prose {
@ a p p l y t e x t - g r a y - 8 0 0 l e a d i n g - r e l a x e d ;
font-feature-settings :
"kern" 1 ,
"liga" 1 ;
color : inherit ;
}
/* 标题层级 */
. prose h1 {
@ a p p l y t e x t - 4 x l f o n t - b o l d m t - 8 m b - 6 p b - 4 b o r d e r - b b o r d e r - g r a y - 2 0 0 ;
background-image : linear-gradient (
90 deg ,
var ( - - color - primary ) ,
var ( - - color - secondary )
) ;
background-clip : text ;
-webkit- background-clip : text ;
color : transparent ;
background-size : 200 % 200 % ;
animation : gradientShift 3 s ease infinite ;
}
. prose h2 {
@ a p p l y t e x t - 3 x l f o n t - b o l d t e x t - g r a y - 9 0 0 m t - 1 0 m b - 5 p b - 3 b o r d e r - b b o r d e r - g r a y - 2 0 0 r e l a t i v e ;
}
. prose h2 :: before {
content : "" ;
@ a p p l y a b s o l u t e b o t t o m - 0 l e f t - 0 w - 1 2 h - 0 . 5 r o u n d e d - f u l l ;
background-image : linear-gradient (
90 deg ,
var ( - - color - primary ) ,
var ( - - color - secondary )
) ;
}
. prose h3 {
@ a p p l y t e x t - 2 x l f o n t - s e m i b o l d t e x t - g r a y - 8 0 0 m t - 8 m b - 4 ;
color : rgba ( 31 , 41 , 55 , 0.95 ) ;
}
. prose h4 {
@ a p p l y t e x t - x l f o n t - s e m i b o l d t e x t - g r a y - 7 0 0 m t - 7 m b - 3 ;
}
. prose h5 {
@ a p p l y t e x t - l g f o n t - m e d i u m t e x t - g r a y - 7 0 0 m t - 6 m b - 3 ;
}
. prose h6 {
@ a p p l y t e x t - b a s e f o n t - m e d i u m t e x t - g r a y - 6 0 0 m t - 5 m b - 2 i t a l i c ;
}
/* 段落和文本 */
. prose p {
@ a p p l y t e x t - g r a y - 7 0 0 l e a d i n g - r e l a x e d m b - 5 ;
text-align : justify ;
}
. prose strong {
@ a p p l y f o n t - b o l d p x - 1 r o u n d e d ;
background : linear-gradient (
90 deg ,
rgba ( 252 , 239 , 145 , 0.22 ) ,
rgba ( 251 , 158 , 58 , 0.12 )
) ;
color : rgba ( 31 , 41 , 55 , 0.95 ) ;
}
. prose em {
@ a p p l y i t a l i c p x - 1 r o u n d e d ;
color : var ( - - color - secondary ) ;
background : rgba ( 251 , 158 , 58 , 0.08 ) ;
}
. prose del {
@ a p p l y l i n e - t h r o u g h p x - 1 r o u n d e d ;
color : #ef4444 ;
background : rgba ( 239 , 68 , 68 , 0.06 ) ;
}
/* 链接 */
. prose a {
@ a p p l y f o n t - m e d i u m r e l a t i v e t r a n s i t i o n - a l l d u r a t i o n - 3 0 0 ;
color : var ( - - color - secondary ) ;
text-decoration : underline ;
text-underline-offset : 3 px ;
}
. prose a : hover {
color : var ( - - color - primary ) ;
transform : translateY ( 1 px ) ;
}
. prose a :: after {
content : "" ;
@ a p p l y a b s o l u t e b o t t o m - 0 l e f t - 0 w - 0 h - 0 . 5 t r a n s i t i o n - a l l d u r a t i o n - 3 0 0 ;
background : linear-gradient (
90 deg ,
var ( - - color - primary ) ,
var ( - - color - secondary )
) ;
}
. prose a : hover :: after {
@ a p p l y w - f u l l ;
}
/* 外部链接图标 */
. prose a [ href ^ = "http" ] :: before {
content : "↗" ;
@ a p p l y i n l i n e - b l o c k m r - 1 t e x t - x s t r a n s l a t e - y - [ 2 p x ] o p a c i t y - 7 0 ;
}
. prose h1 a ,
. prose h2 a ,
. prose h3 a ,
. prose h4 a ,
. prose h5 a ,
. prose h6 a {
text-decoration : none ;
}
/* 列表 */
. prose ul {
@ a p p l y l i s t - n o n e s p a c e - y - 3 m b - 6 ;
}
. prose ul li {
@ a p p l y r e l a t i v e p l - 6 ;
}
. prose ul li :: before {
content : "" ;
@ a p p l y a b s o l u t e l e f t - 0 t o p - 3 w - 1 . 5 h - 1 . 5 r o u n d e d - f u l l ;
background : var ( - - color - secondary ) ;
}
. prose ol {
@ a p p l y l i s t - d e c i m a l l i s t - i n s i d e s p a c e - y - 3 m b - 6 ;
counter-reset : list-counter ;
}
. prose ol li {
@ a p p l y r e l a t i v e p l - 8 ;
counter-increment : list-counter ;
}
. prose ol li :: before {
content : counter ( list - counter ) ;
@ a p p l y a b s o l u t e l e f t - 0 t o p - 0 w - 6 h - 6 t e x t - w h i t e t e x t - x s r o u n d e d - f u l l f l e x i t e m s - c e n t e r j u s t i f y - c e n t e r f o n t - b o l d ;
background-image : linear-gradient (
135 deg ,
var ( - - color - primary ) ,
var ( - - color - secondary )
) ;
}
/* 代码块(浅色风格) */
. prose pre {
@ a p p l y r o u n d e d - x l p - 6 m y - 8 b o r d e r s h a d o w - s m o v e r f l o w - x - a u t o ;
border : 1 px solid rgba ( 229 , 231 , 235 , 1 ) ; /* gray-200 */
background : linear-gradient ( 180 deg , #ffffff , #f8fafc ) ;
box-shadow : 0 6 px 18 px rgba ( 15 , 23 , 42 , 0.04 ) ;
backdrop-filter : blur ( 6 px ) ;
}
. prose code {
@ a p p l y p x - 2 p y - 1 r o u n d e d t e x t - s m f o n t - m o n o ;
background : rgba ( 243 , 244 , 246 , 0.8 ) ; /* gray-50-ish */
border : 1 px solid rgba ( 229 , 231 , 235 , 1 ) ;
color : #0f172a ;
}
. prose pre code {
@ a p p l y b g - t r a n s p a r e n t p - 0 t e x t - c u r r e n t b o r d e r - n o n e ;
color : #0f172a ;
}
/* 引用块(浅色友好) */
. prose blockquote {
@ a p p l y p l - 6 i t a l i c t e x t - g r a y - 7 0 0 m y - 8 p y - 4 p r - 6 r o u n d e d - r - x l r e l a t i v e o v e r f l o w - h i d d e n ;
border-left : 4 px solid transparent ;
border-image : linear-gradient (
to bottom ,
rgba ( 252 , 239 , 145 , 0.9 ) ,
rgba ( 251 , 158 , 58 , 0.9 )
)
1 ;
background : linear-gradient (
90 deg ,
rgba ( 252 , 239 , 145 , 0.06 ) ,
rgba ( 255 , 255 , 255 , 0 )
) ;
}
. prose blockquote :: before {
content : '"' ;
@ a p p l y a b s o l u t e - t o p - 4 - l e f t - 2 t e x t - 6 x l o p a c i t y - 2 0 f o n t - s e r i f ;
color : var ( - - color - primary ) ;
}
. prose blockquote p {
@ a p p l y m b - 3 last : mb-0 relative z-10 ;
}
/* 图片 */
. prose img {
@ a p p l y r o u n d e d - 2 x l m y - 8 m x - a u t o t r a n s i t i o n - a l l d u r a t i o n - 5 0 0 b o r d e r - 2 ;
border-color : rgba ( 226 , 232 , 240 , 0.6 ) ; /* gray-200 */
box-shadow : 0 10 px 30 px rgba ( 15 , 23 , 42 , 0.04 ) ;
}
. prose img : hover {
@ a p p l y s c a l e - [ 1 . 0 2 ] ;
border-color : var ( - - color - secondary ) ;
}
. prose figure {
@ a p p l y m y - 8 t e x t - c e n t e r ;
}
. prose figcaption {
@ a p p l y t e x t - s m t e x t - g r a y - 5 0 0 m t - 3 i t a l i c ;
}
/* 表格 */
. prose table {
@ a p p l y w - f u l l b o r d e r - c o l l a p s e m y - 8 t e x t - s m r o u n d e d - x l o v e r f l o w - h i d d e n s h a d o w - s m ;
}
. prose thead {
background-image : linear-gradient (
90 deg ,
rgba ( 252 , 239 , 145 , 0.18 ) ,
rgba ( 251 , 158 , 58 , 0.12 )
) ;
}
. prose th {
@ a p p l y b o r d e r p x - 6 p y - 4 t e x t - l e f t f o n t - b o l d t e x t - g r a y - 8 0 0 t e x t - s m u p p e r c a s e t r a c k i n g - w i d e r ;
border-color : rgba ( 226 , 232 , 240 , 0.6 ) ;
background : rgba ( 250 , 250 , 250 , 0.8 ) ;
}
. prose td {
@ a p p l y b o r d e r p x - 6 p y - 4 t e x t - g r a y - 7 0 0 ;
border-color : rgba ( 226 , 232 , 240 , 0.4 ) ;
}
. prose tr : nth-child ( even ) {
@ a p p l y b g - g r a y - 5 0 ;
}
. prose tr : hover {
background : rgba ( 251 , 158 , 58 , 0.06 ) ;
transition : background 0.2 s ;
}
/* 分割线 */
. prose hr {
@ a p p l y b o r d e r - g r a y - 2 0 0 m y - 1 2 r e l a t i v e ;
}
. prose hr :: before {
content : "" ;
@ a p p l y a b s o l u t e t o p - 1 / 2 l e f t - 1 / 2 - t r a n s l a t e - x - 1 / 2 - t r a n s l a t e - y - 1 / 2 w - 8 h - 8 r o u n d e d - f u l l o p a c i t y - 2 0 ;
background-image : linear-gradient (
90 deg ,
var ( - - color - primary ) ,
var ( - - color - secondary )
) ;
}
/* 任务列表( checkbox) */
. prose input [ type = "checkbox" ] {
@ a p p l y m r - 3 r o u n d e d w - 5 h - 5 t r a n s i t i o n - a l l d u r a t i o n - 2 0 0 ;
background : #fff ;
border : 1 px solid rgba ( 226 , 232 , 240 , 0.8 ) ;
}
. prose input [ type = "checkbox" ] : checked {
background-image : linear-gradient (
90 deg ,
var ( - - color - primary ) ,
var ( - - color - secondary )
) ;
border : none ;
}
. prose . task-list-item {
@ a p p l y l i s t - n o n e p l - 0 f l e x i t e m s - s t a r t ;
}
. prose . task-list-item input [ type = "checkbox" ] {
@ a p p l y m t - 0 . 5 f l e x - s h r i n k - 0 ;
}
/* 强调和标记 */
. prose mark {
@ a p p l y p x - 2 p y - 1 r o u n d e d f o n t - m e d i u m ;
background : linear-gradient (
120 deg ,
rgba ( 252 , 239 , 145 , 0.22 ) ,
rgba ( 251 , 158 , 58 , 0.18 )
) ;
color : #8a4b00 ;
}
/* 键盘按键 */
. prose kbd {
@ a p p l y b o r d e r r o u n d e d - l g p x - 3 p y - 1 . 5 t e x t - s m f o n t - m o n o s h a d o w - s m ;
background : rgba ( 247 , 249 , 250 , 0.9 ) ;
border-color : rgba ( 226 , 232 , 240 , 0.8 ) ;
color : #0f172a ;
}
/* 动画定义 */
@ keyframes gradientShift {
0 % ,
100 % {
background-position : 0 % 50 % ;
}
50 % {
background-position : 100 % 50 % ;
}
}
/* 滚动条(浅色) */
. prose pre :: -webkit-scrollbar {
@ a p p l y h - 2 ;
}
. prose pre :: -webkit-scrollbar-track {
@ a p p l y r o u n d e d - f u l l ;
background : rgba ( 243 , 244 , 246 , 0.9 ) ;
}
. prose pre :: -webkit-scrollbar-thumb {
border-radius : 9999 px ;
background-image : linear-gradient (
90 deg ,
var ( - - color - primary ) ,
var ( - - color - secondary )
) ;
}
/* 移动端优化 */
@ media ( max-width : 768px ) {
. prose {
@ a p p l y t e x t - b a s e ;
}
. prose h1 {
@ a p p l y t e x t - 3 x l ;
}
. prose h2 {
@ a p p l y t e x t - 2 x l ;
}
. prose h3 {
@ a p p l y t e x t - x l ;
}
. prose pre {
@ a p p l y p - 4 ;
}
}
/* 打印优化 */
@ media print {
. prose {
@ a p p l y t e x t - b l a c k ;
}
. prose a {
@ a p p l y t e x t - b l a c k n o - u n d e r l i n e ;
}
. prose pre {
@ a p p l y b g - g r a y - 1 0 0 b o r d e r b o r d e r - g r a y - 3 0 0 ;
}
}
/* ---------- 可选:深色模式覆盖(.dark class 优先) ---------- */
/* 如果你使用 Tailwind 的 class-based dark 模式(<html class="dark">) , .dark .prose 会生效 */
/* 也可替换为 @media (prefers-color-scheme: dark) {...} 来自动跟随系统 dark 模式 */
. dark . prose {
@ a p p l y t e x t - g r a y - 2 0 0 ;
color : inherit ;
}
. dark . prose h1 {
border-color : rgba ( 55 , 65 , 81 , 0.5 ) ;
}
. dark . prose h2 {
color : #fff ;
border-color : rgba ( 55 , 65 , 81 , 0.4 ) ;
}
. dark . prose p {
@ a p p l y t e x t - g r a y - 3 0 0 ;
}
. dark . prose pre {
border : 1 px solid rgba ( 55 , 65 , 81 , 0.6 ) ;
background : linear-gradient (
135 deg ,
rgba ( 17 , 24 , 39 , 0.9 ) ,
rgba ( 31 , 41 , 55 , 0.9 )
) ;
box-shadow : 0 8 px 30 px rgba ( 2 , 6 , 23 , 0.6 ) ;
}
. dark . prose code {
background : rgba ( 31 , 41 , 55 , 0.6 ) ;
border : 1 px solid rgba ( 55 , 65 , 81 , 0.5 ) ;
color : #e6eef8 ;
}
. dark . prose blockquote {
border-image : linear-gradient (
to bottom ,
var ( - - color - primary ) ,
var ( - - color - secondary )
)
1 ;
background : linear-gradient (
90 deg ,
rgba ( 255 , 255 , 255 , 0.02 ) ,
rgba ( 255 , 255 , 255 , 0 )
) ;
color : rgba ( 255 , 255 , 255 , 0.9 ) ;
}
. dark . prose table thead {
background-image : linear-gradient (
90 deg ,
rgba ( 252 , 239 , 145 , 0.06 ) ,
rgba ( 251 , 158 , 58 , 0.04 )
) ;
}
. dark . prose tr : nth-child ( even ) {
background : rgba ( 255 , 255 , 255 , 0.02 ) ;
}
. dark . prose td ,
. dark . prose th {
color : rgba ( 255 , 255 , 255 , 0.9 ) ;
}
. dark . prose img {
box-shadow : 0 10 px 30 px rgba ( 2 , 6 , 23 , 0.6 ) ;
border-color : rgba ( 55 , 65 , 81 , 0.5 ) ;
}
. dark . prose kbd {
background : rgba ( 31 , 41 , 55 , 0.7 ) ;
border-color : rgba ( 55 , 65 , 81 , 0.6 ) ;
color : #e6eef8 ;
}
/* 滚动条(深色) */
. dark . prose pre :: -webkit-scrollbar-track {
background : rgba ( 17 , 24 , 39 , 0.8 ) ;
}
. dark . prose pre :: -webkit-scrollbar-thumb {
background-image : linear-gradient (
90 deg ,
var ( - - color - primary ) ,
var ( - - color - secondary )
) ;
}
@ media ( prefers-color-scheme : dark ) {
. prose {
@ a p p l y t e x t - g r a y - 2 0 0 ;
color : inherit ;
}
. prose h1 {
border-color : rgba ( 55 , 65 , 81 , 0.5 ) ;
}
. prose h2 {
color : #fff ;
border-color : rgba ( 55 , 65 , 81 , 0.4 ) ;
}
. prose p {
@ a p p l y t e x t - g r a y - 3 0 0 ;
}
. prose pre {
border : 1 px solid rgba ( 55 , 65 , 81 , 0.6 ) ;
background : linear-gradient (
135 deg ,
rgba ( 17 , 24 , 39 , 0.9 ) ,
rgba ( 31 , 41 , 55 , 0.9 )
) ;
box-shadow : 0 8 px 30 px rgba ( 2 , 6 , 23 , 0.6 ) ;
}
. prose code {
background : rgba ( 31 , 41 , 55 , 0.6 ) ;
border : 1 px solid rgba ( 55 , 65 , 81 , 0.5 ) ;
color : #e6eef8 ;
}
. prose blockquote {
border-image : linear-gradient (
to bottom ,
var ( - - color - primary ) ,
var ( - - color - secondary )
)
1 ;
background : linear-gradient (
90 deg ,
rgba ( 255 , 255 , 255 , 0.02 ) ,
rgba ( 255 , 255 , 255 , 0 )
) ;
color : rgba ( 255 , 255 , 255 , 0.9 ) ;
}
. prose table thead {
background-image : linear-gradient (
90 deg ,
rgba ( 252 , 239 , 145 , 0.06 ) ,
rgba ( 251 , 158 , 58 , 0.04 )
) ;
}
. prose tr : nth-child ( even ) {
background : rgba ( 255 , 255 , 255 , 0.02 ) ;
}
. prose td ,
. prose th {
color : rgba ( 255 , 255 , 255 , 0.9 ) ;
}
. prose img {
box-shadow : 0 10 px 30 px rgba ( 2 , 6 , 23 , 0.6 ) ;
border-color : rgba ( 55 , 65 , 81 , 0.5 ) ;
}
. prose kbd {
background : rgba ( 31 , 41 , 55 , 0.7 ) ;
border-color : rgba ( 55 , 65 , 81 , 0.6 ) ;
color : #e6eef8 ;
}
/* 滚动条(深色) */
. prose pre :: -webkit-scrollbar-track {
background : rgba ( 17 , 24 , 39 , 0.8 ) ;
}
. prose pre :: -webkit-scrollbar-thumb {
background-image : linear-gradient (
90 deg ,
var ( - - color - primary ) ,
var ( - - color - secondary )
) ;
}
}