2
0

_reader.css 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. /* resources/css/modules/_reader.css
  2. 全站阅读页专属样式。
  3. 来源:原 resources/css/reader.css(旧)+ reader 重构新增内容合并。
  4. 以旧 reader.css 内容为准,新增部分追加在末尾。
  5. */
  6. /* ══════════════════════════════════════════
  7. 一、基础
  8. ══════════════════════════════════════════ */
  9. body {
  10. font-family: 'Inter', sans-serif;
  11. transition:
  12. background-color 0.3s,
  13. color 0.3s;
  14. }
  15. /* ══════════════════════════════════════════
  16. 二、主布局容器
  17. ══════════════════════════════════════════ */
  18. .main-container {
  19. display: flex;
  20. gap: 20px;
  21. padding: 20px;
  22. max-width: 1400px;
  23. margin: 0 auto;
  24. }
  25. /* ── TOC 侧边栏(左) ── */
  26. .toc-sidebar {
  27. width: 250px;
  28. flex-shrink: 0;
  29. display: none;
  30. position: sticky;
  31. top: 0;
  32. height: 100vh;
  33. overflow-y: auto;
  34. overflow-x: hidden;
  35. scrollbar-width: thin;
  36. }
  37. .toc-sidebar .card-body {
  38. height: 100%;
  39. overflow-y: auto;
  40. overflow-x: hidden;
  41. }
  42. /* ── 正文区(中)── */
  43. .content-area {
  44. flex: 1; /* 替代原 flex-grow:1,配合 min-width 防止收缩 */
  45. min-width: 0; /* 修复:内容较窄时列不收缩 */
  46. }
  47. /* ── 右侧边栏 ── */
  48. .right-sidebar {
  49. width: 220px; /* 收窄,原 300px 偏宽 */
  50. flex-shrink: 0;
  51. display: none;
  52. }
  53. .related-books {
  54. margin-top: 30px;
  55. }
  56. .card-img-container {
  57. height: 150px;
  58. overflow: hidden;
  59. }
  60. .card-img-container img {
  61. width: 100%;
  62. height: 100%;
  63. object-fit: cover;
  64. }
  65. /* ══════════════════════════════════════════
  66. 三、响应式
  67. ══════════════════════════════════════════ */
  68. @media (max-width: 767px) {
  69. .content-area {
  70. width: 100%;
  71. }
  72. .main-container {
  73. padding: 0;
  74. }
  75. .card {
  76. border: none;
  77. }
  78. }
  79. @media (min-width: 768px) {
  80. .toc-sidebar {
  81. display: block;
  82. }
  83. /* content-area 不设 max-width,由 flex:1 + min-width:0 自动占满剩余空间 */
  84. }
  85. @media (min-width: 992px) {
  86. .right-sidebar {
  87. display: block;
  88. }
  89. /* 同上,不限制 max-width */
  90. }
  91. /* ══════════════════════════════════════════
  92. 四、暗色模式
  93. ══════════════════════════════════════════ */
  94. .dark-mode {
  95. background-color: #1a1a1a;
  96. color: #ffffff;
  97. }
  98. .dark-mode .card {
  99. background-color: #2a2a2a;
  100. border-color: #3a3a3a;
  101. color: #ffffff;
  102. }
  103. .dark-mode .navbar {
  104. background-color: #2a2a2a;
  105. }
  106. .dark-mode .offcanvas {
  107. background-color: #2a2a2a;
  108. color: #ffffff;
  109. }
  110. .dark-mode .offcanvas .nav-link {
  111. color: #ffffff;
  112. }
  113. .dark-mode .toc-sidebar,
  114. .dark-mode .right-sidebar {
  115. background-color: #2a2a2a;
  116. }
  117. /* ══════════════════════════════════════════
  118. 五、目录样式(wiki toc 风格)
  119. ══════════════════════════════════════════ */
  120. .toc-sidebar ul,
  121. .offcanvas-body ul {
  122. list-style: none;
  123. padding: 0;
  124. }
  125. .toc-sidebar ul li,
  126. .offcanvas-body ul li {
  127. padding: 5px 0;
  128. }
  129. .toc-sidebar ul li a,
  130. .offcanvas-body ul li a {
  131. color: #206bc4;
  132. text-decoration: none;
  133. }
  134. .toc-sidebar ul li a:hover {
  135. text-decoration: none;
  136. }
  137. .offcanvas-body ul li a:hover {
  138. text-decoration: underline;
  139. }
  140. .dark-mode .toc-sidebar ul li a,
  141. .dark-mode .offcanvas-body ul li a {
  142. color: #4dabf7;
  143. }
  144. .toc-level-1 {
  145. padding-left: 0 !important;
  146. }
  147. .toc-level-2 {
  148. padding-left: 16px !important;
  149. }
  150. .toc-level-3 {
  151. padding-left: 24px !important;
  152. }
  153. .toc-level-4 {
  154. padding-left: 36px !important;
  155. }
  156. .toc-disabled {
  157. color: #6c757d;
  158. cursor: not-allowed;
  159. pointer-events: none;
  160. }
  161. .dark-mode .toc-disabled {
  162. color: #adb5bd;
  163. }
  164. .toc_item {
  165. white-space: nowrap;
  166. overflow: hidden;
  167. text-overflow: ellipsis;
  168. }
  169. .toc_item:hover {
  170. color: #206bc4 !important;
  171. background: rgba(32, 107, 196, 0.15);
  172. border-radius: 2px;
  173. cursor: pointer;
  174. }
  175. .toc_item a,
  176. .toc_item span {
  177. display: block;
  178. width: 100%;
  179. white-space: nowrap;
  180. overflow: hidden;
  181. text-overflow: ellipsis;
  182. }
  183. .toc-active {
  184. color: #206bc4 !important;
  185. font-weight: 600;
  186. background: rgba(32, 107, 196, 0.08);
  187. border-left: 3px solid #206bc4;
  188. border-radius: 2px;
  189. cursor: default;
  190. pointer-events: none;
  191. }
  192. .dark-mode .toc-active {
  193. color: #4dabf7 !important;
  194. background: rgba(77, 171, 247, 0.1);
  195. border-left-color: #4dabf7;
  196. }
  197. /* ══════════════════════════════════════════
  198. 六、正文内容
  199. ══════════════════════════════════════════ */
  200. /* 术语引用 */
  201. .term-ref {
  202. cursor: pointer;
  203. text-decoration: underline dotted;
  204. text-underline-offset: 4px;
  205. }
  206. .term-ref:hover {
  207. color: var(--tblr-primary);
  208. }
  209. .term_invalid {
  210. color: red;
  211. }
  212. /* ══════════════════════════════════════════
  213. 七、Navbar 图标尺寸修正
  214. ti 图标显式设定字号,防止继承后偏小
  215. ══════════════════════════════════════════ */
  216. .navbar .nav-link .ti {
  217. font-size: 1.125rem;
  218. vertical-align: middle;
  219. }
  220. /* ══════════════════════════════════════════
  221. 八、版本卡片(右侧边栏,wiki 侧边栏同款)
  222. ══════════════════════════════════════════ */
  223. .reader-channel-card {
  224. background: var(--tblr-bg-surface);
  225. border: 1px solid var(--tblr-border-color);
  226. border-radius: var(--tblr-border-radius-lg);
  227. padding: 1rem 1.125rem;
  228. margin-bottom: 1rem;
  229. }
  230. .dark-mode .reader-channel-card {
  231. background-color: #2a2a2a;
  232. border-color: #3a3a3a;
  233. }
  234. .reader-channel-title {
  235. font-size: 0.6875rem;
  236. font-weight: 500;
  237. letter-spacing: 0.05em;
  238. text-transform: uppercase;
  239. color: var(--tblr-secondary);
  240. margin-bottom: 0.75rem;
  241. }
  242. .reader-channel-list {
  243. list-style: none;
  244. padding: 0;
  245. margin: 0;
  246. }
  247. .reader-channel-list li {
  248. margin-bottom: 2px;
  249. }
  250. .reader-channel-list a {
  251. display: block;
  252. font-size: 0.8125rem;
  253. color: var(--tblr-body-color);
  254. text-decoration: none;
  255. padding: 5px 8px;
  256. border-radius: var(--tblr-border-radius);
  257. transition: background 0.12s;
  258. }
  259. .reader-channel-list a:hover {
  260. background: var(--tblr-bg-surface-secondary);
  261. }
  262. .reader-channel-list a.active {
  263. background: var(--tblr-bg-surface-secondary);
  264. font-weight: 500;
  265. color: var(--tblr-primary);
  266. }
  267. .reader-channel-lang {
  268. font-size: 0.75rem;
  269. color: var(--tblr-secondary);
  270. display: block;
  271. }