feat(editor): refine toc hierarchy and search scope

This commit is contained in:
xin61
2026-07-07 15:48:45 +08:00
parent 0aa568636d
commit 9b5c55688a
7 changed files with 530 additions and 137 deletions
+75 -4
View File
@@ -351,6 +351,8 @@ button.primary:hover,
.searchbox {
padding: 12px;
border-bottom: 1px solid var(--line);
display: grid;
gap: 8px;
}
.searchbox input {
@@ -362,6 +364,30 @@ button.primary:hover,
background: #ffffff;
}
.searchScope {
display: grid;
grid-template-columns: 1fr 1fr;
border: 1px solid var(--line);
border-radius: 6px;
overflow: hidden;
background: #ffffff;
}
.searchScope button {
min-height: 30px;
border: 0;
border-radius: 0;
background: transparent;
color: var(--muted);
padding: 3px 8px;
font-size: 13px;
}
.searchScope button.active {
background: var(--accent);
color: #ffffff;
}
.stats {
padding: 8px 12px;
color: var(--muted);
@@ -432,7 +458,8 @@ button.primary:hover,
}
.tocChapterButton,
.tocPartButton {
.tocPartButton,
.tocImageButton {
width: 100%;
display: grid;
grid-template-columns: minmax(0, 1fr) auto;
@@ -453,23 +480,37 @@ button.primary:hover,
font-weight: 600;
}
.tocPartButton {
.tocPartButton,
.tocImageButton {
margin-left: 24px;
width: calc(100% - 24px);
color: var(--muted);
}
.tocImageButton {
padding-left: 14px;
font-size: 13px;
}
.tocImageButton .tocTitle::before {
content: "插图 · ";
color: var(--accent);
font-weight: 600;
}
.tocChapterRow:hover,
.tocChapterRow.active,
.tocChapterButton:hover,
.tocToggle:hover,
.tocPartButton:hover {
.tocPartButton:hover,
.tocImageButton:hover {
background: #eef3f6;
}
.tocChapterRow.active,
.tocChapterButton.active,
.tocPartButton.active {
.tocPartButton.active,
.tocImageButton.active {
background: var(--accent-soft);
color: var(--accent-strong);
}
@@ -524,6 +565,15 @@ button.primary:hover,
color: var(--warn);
}
.emptyRowItem {
color: var(--muted);
cursor: default;
}
.emptyRowItem:hover {
background: transparent;
}
.imageRowItem {
cursor: default;
}
@@ -570,6 +620,11 @@ button.primary:hover,
background: #f4f6f8;
}
.readerPane,
.editorPane {
transition: margin-left 160ms ease;
}
.readerHeader {
position: sticky;
top: 0;
@@ -667,6 +722,11 @@ button.primary:hover,
text-align: center;
}
.inlineImageFigure {
margin: 18px auto 30px;
padding-top: 8px;
}
.imageChapterFigure img {
display: block;
max-width: 100%;
@@ -973,6 +1033,17 @@ textarea {
display: none !important;
}
@media (min-width: 1041px) {
body.sidebarOpen .readerPane,
body.sidebarOpen .editorPane {
margin-left: 380px;
}
body.sidebarOpen .sidebar {
box-shadow: none;
}
}
@media (min-width: 1320px) {
body.quickOpen .readingFlow {
margin-left: 56px;