| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313 |
- /* resources/css/modules/_reader.css
- 全站阅读页专属样式。
- 来源:原 resources/css/reader.css(旧)+ reader 重构新增内容合并。
- 以旧 reader.css 内容为准,新增部分追加在末尾。
- */
- /* ══════════════════════════════════════════
- 一、基础
- ══════════════════════════════════════════ */
- body {
- font-family: "Inter", sans-serif;
- transition: background-color 0.3s, color 0.3s;
- }
- /* ══════════════════════════════════════════
- 二、主布局容器
- ══════════════════════════════════════════ */
- .main-container {
- display: flex;
- gap: 20px;
- padding: 20px;
- max-width: 1400px;
- margin: 0 auto;
- }
- /* ── TOC 侧边栏(左) ── */
- .toc-sidebar {
- width: 250px;
- flex-shrink: 0;
- display: none;
- position: sticky;
- top: 0;
- height: 100vh;
- overflow-y: auto;
- overflow-x: hidden;
- scrollbar-width: thin;
- }
- .toc-sidebar .card-body {
- height: 100%;
- overflow-y: auto;
- overflow-x: hidden;
- }
- /* ── 正文区(中)── */
- .content-area {
- flex: 1; /* 替代原 flex-grow:1,配合 min-width 防止收缩 */
- min-width: 0; /* 修复:内容较窄时列不收缩 */
- }
- /* ── 右侧边栏 ── */
- .right-sidebar {
- width: 220px; /* 收窄,原 300px 偏宽 */
- flex-shrink: 0;
- display: none;
- }
- .related-books {
- margin-top: 30px;
- }
- .card-img-container {
- height: 150px;
- overflow: hidden;
- }
- .card-img-container img {
- width: 100%;
- height: 100%;
- object-fit: cover;
- }
- /* ══════════════════════════════════════════
- 三、响应式
- ══════════════════════════════════════════ */
- @media (max-width: 767px) {
- .content-area {
- width: 100%;
- }
- .main-container {
- padding: 0;
- }
- .card {
- border: none;
- }
- }
- @media (min-width: 768px) {
- .toc-sidebar {
- display: block;
- }
- /* content-area 不设 max-width,由 flex:1 + min-width:0 自动占满剩余空间 */
- }
- @media (min-width: 992px) {
- .right-sidebar {
- display: block;
- }
- /* 同上,不限制 max-width */
- }
- /* ══════════════════════════════════════════
- 四、暗色模式
- ══════════════════════════════════════════ */
- .dark-mode {
- background-color: #1a1a1a;
- color: #ffffff;
- }
- .dark-mode .card {
- background-color: #2a2a2a;
- border-color: #3a3a3a;
- color: #ffffff;
- }
- .dark-mode .navbar {
- background-color: #2a2a2a;
- }
- .dark-mode .offcanvas {
- background-color: #2a2a2a;
- color: #ffffff;
- }
- .dark-mode .offcanvas .nav-link {
- color: #ffffff;
- }
- .dark-mode .toc-sidebar,
- .dark-mode .right-sidebar {
- background-color: #2a2a2a;
- }
- /* ══════════════════════════════════════════
- 五、目录样式(wiki toc 风格)
- ══════════════════════════════════════════ */
- .toc-sidebar ul,
- .offcanvas-body ul {
- list-style: none;
- padding: 0;
- }
- .toc-sidebar ul li,
- .offcanvas-body ul li {
- padding: 5px 0;
- }
- .toc-sidebar ul li a,
- .offcanvas-body ul li a {
- color: #206bc4;
- text-decoration: none;
- }
- .toc-sidebar ul li a:hover { text-decoration: none; }
- .offcanvas-body ul li a:hover { text-decoration: underline; }
- .dark-mode .toc-sidebar ul li a,
- .dark-mode .offcanvas-body ul li a {
- color: #4dabf7;
- }
- .toc-level-1 { padding-left: 0 !important; }
- .toc-level-2 { padding-left: 16px !important; }
- .toc-level-3 { padding-left: 24px !important; }
- .toc-level-4 { padding-left: 36px !important; }
- .toc-disabled {
- color: #6c757d;
- cursor: not-allowed;
- pointer-events: none;
- }
- .dark-mode .toc-disabled { color: #adb5bd; }
- .toc_item {
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .toc_item:hover {
- color: #206bc4 !important;
- background: rgba(32, 107, 196, 0.15);
- border-radius: 2px;
- cursor: pointer;
- }
- .toc_item a,
- .toc_item span {
- display: block;
- width: 100%;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .toc-active {
- color: #206bc4 !important;
- font-weight: 600;
- background: rgba(32, 107, 196, 0.08);
- border-left: 3px solid #206bc4;
- border-radius: 2px;
- cursor: default;
- pointer-events: none;
- }
- .dark-mode .toc-active {
- color: #4dabf7 !important;
- background: rgba(77, 171, 247, 0.1);
- border-left-color: #4dabf7;
- }
- /* ══════════════════════════════════════════
- 六、正文内容
- ══════════════════════════════════════════ */
- .origin {
- color: darkred;
- }
- /* 术语引用 */
- .term-ref {
- cursor: pointer;
- text-decoration: underline dotted;
- text-underline-offset: 4px;
- }
- .term-ref:hover {
- color: var(--tblr-primary);
- }
- .term_invalid {
- color: red;
- }
- /* ══════════════════════════════════════════
- 七、Navbar 图标尺寸修正
- ti 图标显式设定字号,防止继承后偏小
- ══════════════════════════════════════════ */
- .navbar .nav-link .ti {
- font-size: 1.125rem;
- vertical-align: middle;
- }
- /* ══════════════════════════════════════════
- 八、版本卡片(右侧边栏,wiki 侧边栏同款)
- ══════════════════════════════════════════ */
- .reader-channel-card {
- background: var(--tblr-bg-surface);
- border: 1px solid var(--tblr-border-color);
- border-radius: var(--tblr-border-radius-lg);
- padding: 1rem 1.125rem;
- margin-bottom: 1rem;
- }
- .dark-mode .reader-channel-card {
- background-color: #2a2a2a;
- border-color: #3a3a3a;
- }
- .reader-channel-title {
- font-size: 0.6875rem;
- font-weight: 500;
- letter-spacing: 0.05em;
- text-transform: uppercase;
- color: var(--tblr-secondary);
- margin-bottom: 0.75rem;
- }
- .reader-channel-list {
- list-style: none;
- padding: 0;
- margin: 0;
- }
- .reader-channel-list li {
- margin-bottom: 2px;
- }
- .reader-channel-list a {
- display: block;
- font-size: 0.8125rem;
- color: var(--tblr-body-color);
- text-decoration: none;
- padding: 5px 8px;
- border-radius: var(--tblr-border-radius);
- transition: background 0.12s;
- }
- .reader-channel-list a:hover {
- background: var(--tblr-bg-surface-secondary);
- }
- .reader-channel-list a.active {
- background: var(--tblr-bg-surface-secondary);
- font-weight: 500;
- color: var(--tblr-primary);
- }
- .reader-channel-lang {
- font-size: 0.75rem;
- color: var(--tblr-secondary);
- display: block;
- }
|