feat(site): upgrade documentation reader with full-book handbooks and search

Compile unabridged bilingual Developer Handbook and Mod Authoring Handbook from repository Markdown with nested list and ordered-list continuation fixes, fix primary button text contrast inside doc sections, and add full-book search, expand-all Ctrl+F mode, active chapter sub-TOC, pushState history, and local file:// link fallback.
This commit is contained in:
N0VAN0M4LY committed 2026-12-03 11:26:11 +08:00
1 parent c265ccbb61
commit fa05f36584
5 files changed
+3794 -594

No files matched your search

+371 -47
View File
@@ -55,6 +55,16 @@ code {
opacity: 0.24;
}
body[data-page='dev-docs'] .bg-stage,
body[data-page='mod-docs'] .bg-stage {
opacity: 0.26;
}
:root[data-mode='light'] body[data-page='dev-docs'] .bg-stage,
:root[data-mode='light'] body[data-page='mod-docs'] .bg-stage {
opacity: 0.14;
}
.bg-slide {
position: absolute;
inset: -3%;
@@ -1041,30 +1051,156 @@ p.lede {
/* ---------------- Documentation Subpages (/dev-docs, /mod-docs) ---------------- */
.wrap-doc {
max-width: 1140px;
max-width: 1180px;
}
.doc-layout {
display: grid;
grid-template-columns: 230px minmax(0, 1fr);
gap: clamp(24px, 4vw, 44px);
grid-template-columns: 276px minmax(0, 1fr);
gap: clamp(24px, 3.8vw, 42px);
align-items: start;
padding: 10px 0 clamp(36px, 6vh, 64px);
}
.doc-toc {
position: sticky;
top: 76px;
padding: 16px;
top: 74px;
max-height: calc(100vh - 92px);
overflow-y: auto;
padding: 15px;
border-radius: var(--r-md);
border: 1px solid var(--border);
background: var(--doc-card);
-webkit-backdrop-filter: blur(14px);
backdrop-filter: blur(14px);
display: flex;
flex-direction: column;
gap: 12px;
}
.doc-tools {
display: flex;
flex-direction: column;
gap: 8px;
}
.doc-search {
position: relative;
}
.doc-search-input {
width: 100%;
height: 34px;
padding: 0 11px;
border-radius: var(--r-sm);
border: 1px solid var(--border-2);
background: var(--glass-2);
color: var(--text);
font-family: var(--font-ui);
font-size: 13px;
outline: none;
transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.doc-search-input::placeholder {
color: var(--text-faint);
}
.doc-search-input:focus {
border-color: var(--accent);
background: var(--surface);
-webkit-backdrop-filter: blur(12px);
backdrop-filter: blur(12px);
}
.doc-search-results {
display: none;
flex-direction: column;
gap: 4px;
margin-top: 6px;
max-height: 280px;
overflow-y: auto;
padding: 6px;
border-radius: var(--r-sm);
border: 1px solid var(--border-2);
background: var(--elev);
box-shadow: var(--shadow-md);
}
.doc-search-results.open {
display: flex;
}
.doc-search-item {
display: flex;
flex-direction: column;
gap: 2px;
padding: 7px 9px;
border-radius: var(--r-xs);
text-decoration: none;
color: var(--text);
border: 1px solid transparent;
transition: background 0.16s var(--ease), border-color 0.16s var(--ease);
}
.doc-search-item:hover {
background: var(--accent-soft);
border-color: rgba(229, 57, 53, 0.35);
}
.doc-search-item-head {
font-size: 12.5px;
font-weight: 600;
color: var(--text);
}
.doc-search-item-chap {
font-family: var(--font-mono);
font-size: 11px;
color: var(--accent);
}
.doc-search-item-snip {
font-size: 12px;
color: var(--text-faint);
line-height: 1.45;
}
.doc-search-empty {
padding: 8px 10px;
font-size: 12.5px;
color: var(--text-faint);
}
.doc-expand-btn {
width: 100%;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
padding: 6px 10px;
border-radius: var(--r-sm);
border: 1px solid var(--border);
background: var(--glass-2);
color: var(--text-dim);
font-family: var(--font-ui);
font-size: 12.5px;
font-weight: 500;
cursor: pointer;
transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.doc-expand-btn:hover {
color: var(--text);
border-color: var(--border-2);
}
.doc-expand-btn.active {
color: #ffffff;
background: var(--accent);
border-color: var(--accent);
}
.doc-toc-title {
margin: 0 0 10px;
margin: 0 0 6px;
font-family: var(--font-mono);
font-size: 11px;
letter-spacing: 0.14em;
@@ -1078,7 +1214,7 @@ p.lede {
gap: 2px;
}
.doc-toc a {
.doc-toc nav > a {
padding: 6px 10px;
border-radius: var(--r-xs);
border-left: 2px solid transparent;
@@ -1089,17 +1225,68 @@ p.lede {
transition: color 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.doc-toc a:hover {
.doc-toc nav > a:hover {
color: var(--text);
background: var(--glass-2);
}
.doc-toc a.active {
.doc-toc nav > a.active {
color: var(--accent);
font-weight: 600;
border-left-color: var(--accent);
background: var(--accent-soft);
}
.doc-subtoc {
display: flex;
flex-direction: column;
gap: 1px;
margin: 2px 0 6px 10px;
padding-left: 8px;
border-left: 1px solid var(--border);
}
.doc-subtoc:empty {
display: none;
}
.doc-subtoc a {
padding: 4px 8px;
border-radius: var(--r-xs);
color: var(--text-faint);
text-decoration: none;
font-size: 12px;
line-height: 1.4;
transition: color 0.18s var(--ease), background 0.18s var(--ease);
}
.doc-subtoc a:hover {
color: var(--text);
background: var(--glass-2);
}
.doc-toc-card {
padding-top: 10px;
border-top: 1px solid var(--border);
font-size: 12px;
color: var(--text-faint);
line-height: 1.55;
}
.doc-toc-card a {
display: inline-flex;
align-items: center;
gap: 4px;
margin-top: 6px;
color: var(--accent);
font-weight: 600;
text-decoration: none;
}
.doc-toc-card a:hover {
text-decoration: underline;
}
.doc-body {
display: flex;
flex-direction: column;
@@ -1109,35 +1296,62 @@ p.lede {
.doc-section {
scroll-margin-top: 80px;
padding: clamp(20px, 3vw, 30px);
padding: clamp(22px, 3.2vw, 34px);
border-radius: var(--r-lg);
border: 1px solid var(--border);
background: var(--card);
-webkit-backdrop-filter: blur(14px);
backdrop-filter: blur(14px);
background: var(--doc-card);
-webkit-backdrop-filter: blur(16px);
backdrop-filter: blur(16px);
box-shadow: var(--shadow-sm);
}
.doc-section h2 {
margin: 0 0 12px;
margin: 0 0 16px;
padding-bottom: 12px;
border-bottom: 1px solid var(--border);
font-family: var(--font-display);
font-size: clamp(20px, 2.4vw, 25px);
font-size: clamp(22px, 2.6vw, 28px);
font-weight: 700;
letter-spacing: -0.01em;
line-height: 1.25;
}
.doc-section h3 {
margin: 22px 0 8px;
font-size: 15.5px;
font-weight: 660;
color: var(--text);
}
.doc-section h3 {
scroll-margin-top: 84px;
margin: 30px 0 12px;
padding-left: 11px;
border-left: 3px solid var(--accent);
font-size: 18px;
font-weight: 700;
line-height: 1.35;
color: var(--text);
}
.doc-section h4 {
scroll-margin-top: 84px;
margin: 22px 0 8px;
font-size: 15.5px;
font-weight: 660;
line-height: 1.4;
color: var(--text);
}
.doc-section h5 {
scroll-margin-top: 84px;
margin: 18px 0 6px;
font-family: var(--font-mono);
font-size: 13.8px;
font-weight: 660;
line-height: 1.45;
color: var(--accent);
}
.doc-section p {
margin: 0 0 12px;
margin: 0 0 13px;
color: var(--text-dim);
font-size: 14.5px;
line-height: 1.75;
line-height: 1.78;
}
.doc-section p:last-child {
@@ -1146,52 +1360,158 @@ p.lede {
.doc-section ul,
.doc-section ol {
margin: 0 0 14px;
padding-left: 1.35em;
margin: 0 0 15px;
padding-left: 1.45em;
color: var(--text-dim);
font-size: 14px;
font-size: 14.3px;
}
.doc-section ul ul,
.doc-section ol ul,
.doc-section ul ol,
.doc-section ol ol {
margin: 6px 0 8px;
padding-left: 1.35em;
}
.doc-section li {
margin-bottom: 6px;
line-height: 1.68;
margin-bottom: 7px;
line-height: 1.72;
}
.doc-section li > .doc-pre,
.doc-section li > blockquote {
margin-top: 10px;
margin-bottom: 12px;
}
.doc-section li strong {
color: var(--text);
}
.doc-section a {
.doc-section a:not(.btn) {
color: var(--accent);
text-decoration: none;
}
.doc-section a:hover {
.doc-section a:not(.btn):hover {
text-decoration: underline;
}
.doc-chapter {
display: none;
}
.doc-chapter.active,
body.doc-expand-all .doc-chapter {
display: block;
animation: tabSwitch 0.32s var(--ease) both;
}
body.doc-expand-all .doc-pager {
display: none;
}
.doc-pager {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
gap: 12px;
margin-top: 28px;
padding-top: 20px;
border-top: 1px solid var(--border);
}
.doc-pager-btn {
display: inline-flex;
flex-direction: column;
align-items: flex-start;
gap: 2px;
padding: 10px 16px;
border-radius: var(--r-sm);
border: 1px solid var(--border);
background: var(--surface);
color: var(--text);
text-decoration: none;
cursor: pointer;
min-width: 180px;
transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.doc-pager-btn.next {
margin-left: auto;
align-items: flex-end;
text-align: right;
}
.doc-pager-btn:hover {
border-color: var(--accent);
transform: translateY(-2px);
}
.doc-pager-label {
font-family: var(--font-mono);
font-size: 11px;
color: var(--text-faint);
letter-spacing: 0.08em;
text-transform: uppercase;
}
.doc-pager-title {
font-size: 13.5px;
font-weight: 600;
color: var(--text);
}
.doc-section blockquote {
margin: 15px 0;
padding: 13px 16px;
border-radius: var(--r-sm);
border: 1px solid color-mix(in srgb, var(--accent-2) 32%, transparent);
border-left: 3px solid var(--accent-2);
background: color-mix(in srgb, var(--accent-2) 8%, transparent);
color: var(--text);
font-size: 13.8px;
line-height: 1.72;
}
.doc-section blockquote p {
color: var(--text);
margin: 0 0 6px;
}
.doc-section blockquote p:last-child {
margin-bottom: 0;
}
.doc-section hr {
border: none;
border-top: 1px solid var(--border);
margin: 26px 0;
}
.doc-callout {
margin: 14px 0;
margin: 15px 0;
padding: 13px 16px;
border-radius: var(--r-sm);
border: 1px solid rgba(229, 57, 53, 0.34);
border-left: 3px solid var(--accent);
background: var(--accent-soft);
font-size: 13.5px;
font-size: 13.8px;
color: var(--text);
line-height: 1.68;
line-height: 1.7;
}
.doc-callout.info {
border-color: rgba(49, 227, 238, 0.30);
border-color: color-mix(in srgb, var(--accent-2) 32%, transparent);
border-left-color: var(--accent-2);
background: rgba(49, 227, 238, 0.08);
background: color-mix(in srgb, var(--accent-2) 8%, transparent);
}
.doc-table-wrap {
width: 100%;
overflow-x: auto;
margin: 14px 0;
margin: 15px 0;
border-radius: var(--r-sm);
border: 1px solid var(--border);
}
@@ -1200,7 +1520,7 @@ p.lede {
width: 100%;
border-collapse: collapse;
font-size: 13.5px;
line-height: 1.6;
line-height: 1.64;
}
.doc-table th,
@@ -1257,15 +1577,15 @@ p.lede {
.doc-pre {
position: relative;
margin: 14px 0;
margin: 15px 0;
border-radius: var(--r-sm);
border: 1px solid var(--border);
background: rgba(7, 10, 12, 0.72);
background: rgba(7, 10, 12, 0.82);
overflow: hidden;
}
:root[data-mode='light'] .doc-pre {
background: #f5f7f9;
background: #f4f6f9;
}
.doc-pre-head {
@@ -1286,7 +1606,7 @@ p.lede {
overflow-x: auto;
font-family: var(--font-mono);
font-size: 12.5px;
line-height: 1.62;
line-height: 1.64;
color: var(--text);
}
@@ -1301,29 +1621,33 @@ p.lede {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-top: 16px;
margin-top: 18px;
}
@media (max-width: 860px) {
@media (max-width: 900px) {
.doc-layout {
grid-template-columns: 1fr;
}
.doc-toc {
position: static;
max-height: none;
}
.doc-toc nav {
flex-direction: row;
flex-wrap: wrap;
gap: 6px;
}
.doc-toc a {
.doc-toc nav > a {
border-left: none;
border: 1px solid var(--border);
padding: 5px 10px;
}
.doc-toc a.active {
.doc-toc nav > a.active {
border-color: var(--accent);
}
.doc-subtoc {
display: none;
}
}
/* ---------------- Community CTA & Scope Banner ---------------- */