|
| 1 | +/* Chinese-friendly typography and UI refinements */ |
| 2 | + |
| 3 | +/* 1) Base font stack for Simplified Chinese with Latin fallbacks */ |
| 4 | +html { |
| 5 | + -webkit-font-smoothing: antialiased; |
| 6 | + -moz-osx-font-smoothing: grayscale; |
| 7 | + text-rendering: optimizeLegibility; |
| 8 | +} |
| 9 | + |
| 10 | +body { |
| 11 | + font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, |
| 12 | + "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Source Han Sans SC", "Microsoft YaHei", "WenQuanYi Micro Hei", |
| 13 | + "Noto Sans", sans-serif; |
| 14 | + line-height: 1.75; /* slightly taller for Chinese readability */ |
| 15 | + letter-spacing: 0.1px; /* tiny spacing helps mixed CN/EN */ |
| 16 | +} |
| 17 | + |
| 18 | +/* 2) Page width and rhythm tweaks (PaperMod compatible) */ |
| 19 | +.page, |
| 20 | +.post, |
| 21 | +.single, |
| 22 | +.content, |
| 23 | +.main { |
| 24 | + max-width: 860px; /* comfortable measure for mixed CN/EN */ |
| 25 | +} |
| 26 | + |
| 27 | +/* 3) Headings hierarchy with better CJK proportions */ |
| 28 | +h1, h2, h3, h4, h5, h6 { |
| 29 | + font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", |
| 30 | + "Noto Sans CJK SC", "Source Han Sans SC", "Segoe UI", Roboto, Arial, sans-serif; |
| 31 | + line-height: 1.35; |
| 32 | +} |
| 33 | + |
| 34 | +h1 { font-size: 2rem; margin: 1.2em 0 0.6em; } |
| 35 | +h2 { font-size: 1.65rem; margin: 1.1em 0 0.55em; } |
| 36 | +h3 { font-size: 1.35rem; margin: 1em 0 0.5em; } |
| 37 | +h4 { font-size: 1.15rem; margin: 0.9em 0 0.45em; } |
| 38 | + |
| 39 | +/* 4) Paragraph spacing tuned for dense CJK */ |
| 40 | +p, ul, ol { |
| 41 | + margin: 0.8em 0; |
| 42 | +} |
| 43 | + |
| 44 | +/* 5) Better code presentation for CN articles */ |
| 45 | +pre, code, kbd, samp { |
| 46 | + font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; |
| 47 | +} |
| 48 | + |
| 49 | +pre code { |
| 50 | + font-size: 0.9rem; |
| 51 | +} |
| 52 | + |
| 53 | +pre { |
| 54 | + line-height: 1.6; |
| 55 | + border-radius: 8px; |
| 56 | +} |
| 57 | + |
| 58 | +code { |
| 59 | + padding: 0.1em 0.35em; |
| 60 | + border-radius: 4px; |
| 61 | +} |
| 62 | + |
| 63 | +/* 6) Tables with improved readability */ |
| 64 | +table { |
| 65 | + border-collapse: collapse; |
| 66 | + width: 100%; |
| 67 | + margin: 1em 0; |
| 68 | +} |
| 69 | +th, td { |
| 70 | + padding: 0.6em 0.8em; |
| 71 | +} |
| 72 | +thead th { |
| 73 | + border-bottom: 2px solid rgba(0,0,0,0.06); |
| 74 | +} |
| 75 | +tbody tr + tr { |
| 76 | + border-top: 1px solid rgba(0,0,0,0.06); |
| 77 | +} |
| 78 | + |
| 79 | +/* 7) Quote style with CN tone */ |
| 80 | +blockquote { |
| 81 | + border-left: 3px solid rgba(0,0,0,0.12); |
| 82 | + padding: 0.6em 1em; |
| 83 | + color: rgba(0,0,0,0.75); |
| 84 | + background: rgba(0,0,0,0.02); |
| 85 | +} |
| 86 | + |
| 87 | +/* 8) Lists: better indentation and spacing for nested CN lists */ |
| 88 | +ul ul, ol ol, ul ol, ol ul { |
| 89 | + margin-top: 0.4em; |
| 90 | + margin-bottom: 0.4em; |
| 91 | +} |
| 92 | + |
| 93 | +/* 9) Links: subtle underline and hover color */ |
| 94 | +a { |
| 95 | + text-decoration-thickness: 0.08em; |
| 96 | + text-underline-offset: 2px; |
| 97 | +} |
| 98 | + |
| 99 | +a:hover { |
| 100 | + text-decoration-thickness: 0.12em; |
| 101 | +} |
| 102 | + |
| 103 | +/* 10) Images: nicer figure captions spacing */ |
| 104 | +figure { |
| 105 | + margin: 1.2em 0; |
| 106 | +} |
| 107 | +figcaption { |
| 108 | + margin-top: 0.4em; |
| 109 | + color: rgba(0,0,0,0.6); |
| 110 | + font-size: 0.95rem; |
| 111 | +} |
| 112 | + |
| 113 | +/* 11) Home info bullets spacing (PaperMod) */ |
| 114 | +.home-info ul { |
| 115 | + margin: 0.6em 0 0 1.25em; |
| 116 | +} |
| 117 | + |
| 118 | +/* 12) KaTeX line-height alignment in mixed CN */ |
| 119 | +.katex { line-height: 1.3; } |
| 120 | + |
| 121 | +/* 13) Footnotes readability */ |
| 122 | +.footnotes { |
| 123 | + font-size: 0.95rem; |
| 124 | + line-height: 1.6; |
| 125 | +} |
| 126 | +.footnotes hr { margin: 1.2em 0; } |
| 127 | + |
| 128 | +/* 14) Search page input (PaperMod) */ |
| 129 | +input#search-input { |
| 130 | + height: 2.4rem; |
| 131 | + padding: 0 0.8rem; |
| 132 | + border-radius: 8px; |
| 133 | +} |
| 134 | + |
| 135 | +/* 15) Dark mode tuning for contrasts */ |
| 136 | +@media (prefers-color-scheme: dark) { |
| 137 | + blockquote { color: rgba(255,255,255,0.8); background: rgba(255,255,255,0.04); border-left-color: rgba(255,255,255,0.18); } |
| 138 | + thead th { border-bottom-color: rgba(255,255,255,0.16); } |
| 139 | + tbody tr + tr { border-top-color: rgba(255,255,255,0.12); } |
| 140 | + figcaption { color: rgba(255,255,255,0.75); } |
| 141 | +} |
| 142 | + |
| 143 | + |
0 commit comments