2
0

reader.css 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. /* resources/css/reader.css */
  2. /* 基础样式 */
  3. body {
  4. font-family: "Inter", sans-serif;
  5. transition: background-color 0.3s, color 0.3s;
  6. }
  7. .main-container {
  8. display: flex;
  9. gap: 20px;
  10. padding: 20px;
  11. max-width: 1400px;
  12. margin: 0 auto;
  13. }
  14. .toc-sidebar {
  15. width: 250px;
  16. flex-shrink: 0;
  17. display: none;
  18. position: sticky;
  19. top: 0;
  20. height: 100vh;
  21. overflow-y: auto;
  22. overflow-x: hidden;
  23. scrollbar-width: thin;
  24. }
  25. .toc-sidebar .card-body {
  26. height: 100%;
  27. overflow-y: auto;
  28. overflow-x: hidden;
  29. }
  30. .content-area {
  31. flex-grow: 1;
  32. max-width: 100%;
  33. }
  34. .right-sidebar {
  35. width: 300px;
  36. flex-shrink: 0;
  37. display: none;
  38. }
  39. .related-books {
  40. margin-top: 30px;
  41. }
  42. .card-img-container {
  43. height: 150px;
  44. overflow: hidden;
  45. }
  46. .card-img-container img {
  47. width: 100%;
  48. height: 100%;
  49. object-fit: cover;
  50. }
  51. /* 响应式布局 */
  52. @media (max-width: 767px) {
  53. .content-area {
  54. width: 100%;
  55. }
  56. .main-container {
  57. padding: 0;
  58. }
  59. .card {
  60. border: none;
  61. }
  62. }
  63. @media (min-width: 768px) {
  64. .toc-sidebar {
  65. display: block;
  66. }
  67. .content-area {
  68. max-width: calc(100% - 270px);
  69. }
  70. }
  71. @media (min-width: 992px) {
  72. .right-sidebar {
  73. display: block;
  74. }
  75. .content-area {
  76. max-width: calc(100% - 570px);
  77. }
  78. }
  79. /* 暗色模式 */
  80. .dark-mode {
  81. background-color: #1a1a1a;
  82. color: #ffffff;
  83. }
  84. .dark-mode .card {
  85. background-color: #2a2a2a;
  86. border-color: #3a3a3a;
  87. color: #ffffff;
  88. }
  89. .dark-mode .navbar {
  90. background-color: #2a2a2a;
  91. }
  92. .dark-mode .offcanvas {
  93. background-color: #2a2a2a;
  94. color: #ffffff;
  95. }
  96. .dark-mode .offcanvas .nav-link {
  97. color: #ffffff;
  98. }
  99. .dark-mode .toc-sidebar,
  100. .dark-mode .right-sidebar {
  101. background-color: #2a2a2a;
  102. }
  103. /* 目录样式 */
  104. .toc-sidebar ul,
  105. .offcanvas-body ul {
  106. list-style: none;
  107. padding: 0;
  108. }
  109. .toc-sidebar ul li,
  110. .offcanvas-body ul li {
  111. padding: 5px 0;
  112. }
  113. .toc-sidebar ul li a,
  114. .offcanvas-body ul li a {
  115. color: #206bc4;
  116. text-decoration: none;
  117. }
  118. .toc-sidebar ul li a:hover {
  119. text-decoration: none;
  120. }
  121. .offcanvas-body ul li a:hover {
  122. text-decoration: underline;
  123. }
  124. .dark-mode .toc-sidebar ul li a,
  125. .dark-mode .offcanvas-body ul li a {
  126. color: #4dabf7;
  127. }
  128. .toc-level-1 {
  129. padding-left: 0 !important;
  130. }
  131. .toc-level-2 {
  132. padding-left: 16px !important;
  133. }
  134. .toc-level-3 {
  135. padding-left: 24px !important;
  136. }
  137. .toc-level-4 {
  138. padding-left: 36px !important;
  139. }
  140. .toc-disabled {
  141. color: #6c757d;
  142. cursor: not-allowed;
  143. pointer-events: none;
  144. }
  145. .dark-mode .toc-disabled {
  146. color: #adb5bd;
  147. }
  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. .origin {
  182. color: darkred;
  183. }
  184. /* 术语引用样式 */
  185. .term-ref {
  186. cursor: pointer;
  187. text-decoration: underline dotted;
  188. text-underline-offset: 4px;
  189. }
  190. .term_invalid {
  191. color: red;
  192. }
  193. .term-ref:hover {
  194. color: var(--tblr-primary);
  195. }