rbpu_datasheet/doc_builder/themes/datasheet.css

292 lines
8.0 KiB
CSS
Raw Normal View History

2026-07-18 00:51:43 +08:00
/* ============================================================
Datasheet Theme 芯片数据手册风格
============================================================ */
:root {
--bg: #fff;
--text: #1a1a1a;
--text-muted: #555;
--heading: #000;
--accent: #003d7c;
--accent-light: #e8f0f8;
--th-bg: #e9ecf0;
--th-border: #c0c4c8;
--stripe: #f7f8f9;
--cover-bg: #003d7c;
--cover-text: #fff;
--link: #005da0;
--note-bg: #f5f7fa;
--note-border: #003d7c;
--font-body: "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", Georgia, serif;
--font-heading: "Noto Sans CJK SC", "Source Han Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
--font-mono: "Cascadia Code", "Fira Code", Consolas, monospace;
--size: 14px;
--line: 1.7;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: var(--size); }
body {
font-family: var(--font-body);
font-size: 1rem;
line-height: var(--line);
color: var(--text);
background: var(--bg);
max-width: 900px;
margin: 0 auto;
padding: 2em 2.5em;
}
/* ---------- Cover ---------- */
.cover-page {
background: linear-gradient(160deg, var(--cover-bg) 0%, #002244 100%);
color: var(--cover-text);
text-align: center;
padding: 80px 40px;
margin: -2em -2.5em 3em -2.5em;
border-radius: 0 0 8px 8px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-height: 95vh;
}
.cover-page .product-family {
font-family: var(--font-heading);
font-size: 0.9rem;
letter-spacing: 0.3em;
text-transform: uppercase;
opacity: 0.7;
margin-bottom: 40px;
}
.cover-page h1 {
font-family: var(--font-heading);
font-size: 2.4rem;
font-weight: 700;
line-height: 1.35;
margin-bottom: 20px;
color: var(--cover-text);
border: none;
padding: 0;
}
.cover-page .subtitle {
font-family: var(--font-heading);
font-size: 1.1rem;
font-weight: 300;
opacity: 0.8;
margin-bottom: 48px;
}
.cover-page .feature-list {
list-style: none;
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
margin: 0 auto 48px;
padding: 0;
}
.cover-page .feature-list li {
font-family: var(--font-heading);
font-size: 0.95rem;
padding: 6px 24px;
border: 1px solid rgba(255,255,255,0.2);
border-radius: 4px;
width: 280px;
}
.cover-page .cover-meta {
margin-top: auto;
font-size: 0.85rem;
opacity: 0.55;
padding-top: 40px;
}
.cover-page .cover-meta p { text-align: center; margin: 4px 0; }
/* ---------- Headings ---------- */
h1 {
font-family: var(--font-heading);
font-size: 1.5rem;
font-weight: 700;
color: var(--heading);
margin: 2em 0 0.8em;
padding-bottom: 6px;
border-bottom: 2px solid var(--accent);
}
h2 {
font-family: var(--font-heading);
font-size: 1.25rem;
font-weight: 700;
color: var(--accent);
margin: 1.5em 0 0.6em;
padding-bottom: 4px;
border-bottom: 1px solid var(--th-border);
}
h3 {
font-family: var(--font-heading);
font-size: 1.1rem;
font-weight: 600;
color: var(--heading);
margin: 1.2em 0 0.5em;
}
h4 {
font-family: var(--font-heading);
font-size: 1rem;
font-weight: 600;
color: var(--text);
margin: 1em 0 0.4em;
}
/* ---------- Body ---------- */
p { margin: 0.6em 0; text-align: justify; }
ul, ol { margin: 0.6em 0; padding-left: 2em; }
li { margin: 2px 0; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
/* ---------- Tables ---------- */
table {
width: 100%;
border-collapse: collapse;
margin: 1em 0;
font-size: 0.92rem;
}
thead th {
background-color: var(--th-bg);
font-family: var(--font-heading);
font-weight: 600;
font-size: 0.88rem;
text-align: left;
padding: 6px 10px;
border: 1px solid var(--th-border);
border-bottom: 2px solid var(--accent);
white-space: nowrap;
}
tbody td {
padding: 5px 10px;
border: 1px solid var(--th-border);
vertical-align: top;
}
tbody tr:nth-child(even) { background-color: var(--stripe); }
table.compact { font-size: 0.82rem; }
table.compact thead th { font-size: 0.8rem; padding: 3px 7px; }
table.compact tbody td { padding: 3px 7px; }
td.addr, td.bits, td.reset-val { font-family: var(--font-mono); font-size: 0.85em; white-space: nowrap; }
td.bits { text-align: center; }
/* Permissions */
.perm-rw { color: #1a7a1a; font-weight: 600; }
.perm-ro { color: #b8860b; font-weight: 600; }
.perm-wc { color: #8b0000; font-weight: 600; }
/* ---------- Code ---------- */
code {
font-family: var(--font-mono);
font-size: 0.9em;
background: var(--note-bg);
padding: 1px 5px;
border-radius: 2px;
border: 1px solid var(--th-border);
}
pre {
font-family: var(--font-mono);
font-size: 0.82rem;
background: var(--note-bg);
border: 1px solid var(--th-border);
border-left: 3px solid var(--accent);
padding: 12px;
margin: 1em 0;
overflow-x: auto;
line-height: 1.5;
}
pre code { background: none; padding: 0; border: none; font-size: inherit; }
/* ---------- Figures ---------- */
figure { margin: 1.5em auto; text-align: center; max-width: 100%; }
figure img { max-width: 100%; height: auto; }
figure figcaption {
font-family: var(--font-heading);
font-size: 0.88rem;
color: var(--text-muted);
margin-top: 6px;
}
p img { max-width: 100%; height: auto; display: block; margin: 1em auto; }
/* ---------- Blockquote / Notes ---------- */
blockquote {
margin: 1em 0;
padding: 10px 16px;
border-left: 4px solid var(--note-border);
background: var(--note-bg);
font-size: 0.92rem;
}
/* ---------- TOC ---------- */
.toc { margin-bottom: 2em; }
.toc h2 { font-size: 1.4rem; border-bottom: 2px solid var(--accent); }
.toc-list { list-style: none; padding: 0; }
.toc-list li {
padding: 4px 0;
border-bottom: 1px dotted var(--th-border);
display: flex;
justify-content: space-between;
}
.toc-list li a { flex: 1; }
/* ---------- Sidebar (screen only) ---------- */
@media screen and (min-width: 1200px) {
body { padding-left: 260px; max-width: 1100px; }
.screen-toc {
position: fixed;
left: max(0px, calc((100vw - 1100px) / 2 - 240px));
top: 0;
width: 220px;
height: 100vh;
overflow-y: auto;
background: var(--note-bg);
border-right: 1px solid var(--th-border);
padding: 16px 12px;
font-size: 0.78rem;
z-index: 100;
}
.cover-page { margin-left: calc(-2em - 260px + 2.5em); }
}
@media screen and (max-width: 1199px) {
.screen-toc { display: none; }
}
.screen-toc ul { list-style: none; padding: 0; }
.screen-toc li { margin: 3px 0; line-height: 1.4; }
.screen-toc a { color: var(--text); display: block; padding: 2px 5px; border-radius: 2px; }
.screen-toc a:hover { background: var(--accent-light); text-decoration: none; }
/* ---------- Register summary ---------- */
.reg-summary { font-size: 0.9rem; }
.reg-summary strong { margin-right: 4px; }
.reg-summary code { margin-right: 12px; }
/* ---------- Warning ---------- */
.warning {
background: #fff3cd;
border: 1px solid #ffc107;
padding: 10px;
margin: 10px 0;
border-radius: 3px;
}
/* ---------- Utility ---------- */
.text-center { text-align: center; }
.text-mono { font-family: var(--font-mono); }
.page-break { margin: 2em 0; }
/* ---------- Auto-numbering ---------- */
body.auto-numbering { counter-reset: section; }
body.auto-numbering h1 { counter-increment: section; counter-reset: subsection; }
body.auto-numbering h1::before { content: counter(section) ". "; }
body.auto-numbering h2 { counter-increment: subsection; counter-reset: subsubsection; }
body.auto-numbering h2::before { content: counter(section) "." counter(subsection) " "; }
body.auto-numbering h3 { counter-increment: subsubsection; }
body.auto-numbering h3::before { content: counter(section) "." counter(subsection) "." counter(subsubsection) " "; }