Skip to content

Commit dc91e20

Browse files
committed
fix: 改善關閉按鈕在手機上的位置
- 使用 fixed 定位取代 sticky - 調整按鈕位置到右上角固定位置 - 加大按鈕尺寸提升觸控體驗 - 增加手機專用響應式樣式 - 優化陰影效果增強視覺層次
1 parent 6938a83 commit dc91e20

1 file changed

Lines changed: 25 additions & 10 deletions

File tree

style.css

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -660,24 +660,23 @@ body {
660660
}
661661

662662
.markdown-close {
663-
position: sticky;
664-
top: 15px;
665-
float: right;
666-
margin: -30px -30px 20px 20px;
667-
width: 30px;
668-
height: 30px;
663+
position: fixed;
664+
top: 70px;
665+
right: 20px;
666+
width: 36px;
667+
height: 36px;
669668
cursor: pointer;
670-
background: rgba(60, 60, 67, 0.9);
671-
border-radius: 15px;
669+
background: rgba(60, 60, 67, 0.95);
670+
border-radius: 18px;
672671
display: flex;
673672
align-items: center;
674673
justify-content: center;
675-
z-index: 1001;
674+
z-index: 1002;
676675
transition: all 0.2s ease;
677676
border: none;
678677
outline: none;
679678
padding: 0;
680-
box-shadow: 0 2px 8px rgba(0,0,0,0.2);
679+
box-shadow: 0 4px 12px rgba(0,0,0,0.3);
681680
font-size: 0;
682681
line-height: 0;
683682
}
@@ -715,6 +714,22 @@ body {
715714
transform: scale(0.96);
716715
}
717716

717+
@media (max-width: 768px) {
718+
.markdown-close {
719+
top: 20px;
720+
right: 15px;
721+
width: 32px;
722+
height: 32px;
723+
border-radius: 16px;
724+
}
725+
726+
.markdown-content {
727+
margin: 20px auto;
728+
padding: 30px 20px;
729+
width: 95%;
730+
max-height: 95vh;
731+
}
732+
}
718733

719734
/* Markdown 渲染樣式 */
720735
.markdown-content h1 {

0 commit comments

Comments
 (0)