_reader.css 7.5 KB

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