Files

196 lines
5.7 KiB
CSS
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/* ============================================================
html-doc · 通用深色主题
人类可读 HTML 文档的统一表现层。生成单文件文档时,把本文件
全部内容内联进 <style>。design tokens 集中在 :root改配色只动这里。
============================================================ */
:root {
--bg: #0f1115;
--panel: #171a21;
--panel-2: #1e222b;
--border: #2a2f3a;
--text: #d7dbe2;
--text-dim: #9aa1ad;
--accent: #5aa9ff;
--accent-2: #7ee0a2;
--warn: #ffb454;
--danger: #ff6b6b;
--code-bg: #11141a;
--mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
margin: 0;
background: var(--bg);
color: var(--text);
font-family: var(--sans);
line-height: 1.6;
font-size: 15px;
}
/* ---------- 布局:侧边目录 + 正文 ---------- */
.layout { display: flex; align-items: flex-start; }
nav.toc {
position: sticky;
top: 0;
align-self: flex-start;
width: 260px;
height: 100vh;
overflow-y: auto;
background: var(--panel);
border-right: 1px solid var(--border);
padding: 20px 16px;
flex-shrink: 0;
}
nav.toc h2 {
font-size: 13px;
text-transform: uppercase;
letter-spacing: 0.08em;
color: var(--text-dim);
margin: 0 0 12px;
}
nav.toc a {
display: block;
color: var(--text);
text-decoration: none;
padding: 6px 10px;
border-radius: 6px;
font-size: 14px;
margin-bottom: 2px;
}
nav.toc a:hover { background: var(--panel-2); color: var(--accent); }
nav.toc a .cn { color: var(--text-dim); font-size: 12px; margin-left: 6px; }
nav.toc .sep { height: 1px; background: var(--border); margin: 12px 4px; }
main {
flex: 1;
max-width: 1080px;
margin: 0 auto;
padding: 40px 48px 120px;
min-width: 0;
}
/* ---------- 标题与正文 ---------- */
header.page-head { margin-bottom: 32px; }
header.page-head h1 { font-size: 30px; margin: 0 0 8px; }
header.page-head p.sub { color: var(--text-dim); margin: 0; }
h2.section {
font-size: 24px;
margin: 48px 0 6px;
padding-top: 12px;
border-top: 1px solid var(--border);
}
h2.section:first-of-type { border-top: none; }
h3 { font-size: 19px; margin: 32px 0 10px; }
.file-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.file-title code { font-size: 18px; }
.cnname { color: var(--text-dim); font-size: 15px; }
p { margin: 10px 0; }
a.link { color: var(--accent); }
.muted { color: var(--text-dim); }
/* ---------- 代码 ---------- */
code {
font-family: var(--mono);
background: var(--code-bg);
border: 1px solid var(--border);
border-radius: 4px;
padding: 1px 5px;
font-size: 13px;
color: #e6c07b;
}
pre {
background: var(--code-bg);
border: 1px solid var(--border);
border-radius: 8px;
padding: 14px 16px;
overflow-x: auto;
font-family: var(--mono);
font-size: 13px;
line-height: 1.55;
}
pre code { background: none; border: none; padding: 0; color: var(--text); }
/* ---------- 表格 ---------- */
table {
width: 100%;
border-collapse: collapse;
margin: 14px 0 6px;
background: var(--panel);
border: 1px solid var(--border);
border-radius: 8px;
overflow: hidden;
font-size: 14px;
}
thead th {
text-align: left;
background: var(--panel-2);
color: var(--text-dim);
font-weight: 600;
padding: 10px 12px;
border-bottom: 1px solid var(--border);
white-space: nowrap;
}
tbody td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--panel-2); }
td.type { color: var(--warn); font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
/* ---------- 徽标(语义色)---------- */
.badge {
display: inline-block;
font-size: 11px;
padding: 1px 7px;
border-radius: 999px;
border: 1px solid var(--border);
white-space: nowrap;
line-height: 1.5;
}
.badge.accent { background: rgba(90,169,255,0.14); color: var(--accent); border-color: rgba(90,169,255,0.4); }
.badge.ok { background: rgba(126,224,162,0.12); color: var(--accent-2); border-color: rgba(126,224,162,0.35); }
.badge.warn { background: rgba(255,180,84,0.10); color: var(--warn); border-color: rgba(255,180,84,0.3); }
.badge.danger { background: rgba(255,107,107,0.12); color: var(--danger); border-color: rgba(255,107,107,0.4); }
.badge.muted { background: rgba(154,161,173,0.10); color: var(--text-dim); }
/* ---------- 提示框 ---------- */
.callout {
border-left: 3px solid var(--accent);
background: var(--panel);
border-radius: 0 8px 8px 0;
padding: 12px 16px;
margin: 16px 0;
}
.callout.warn { border-left-color: var(--warn); }
.callout.danger { border-left-color: var(--danger); }
.callout.ok { border-left-color: var(--accent-2); }
.callout .t { font-weight: 600; margin-bottom: 4px; }
/* ---------- 通用 pill / 标签 ---------- */
.tag {
display: inline-block;
background: var(--panel-2);
border: 1px solid var(--border);
border-radius: 6px;
padding: 3px 9px;
font-family: var(--mono);
font-size: 12.5px;
color: var(--accent);
margin: 4px 6px 4px 0;
}
/* ---------- 图例 / 列表 ---------- */
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin: 10px 0 0; font-size: 13px; color: var(--text-dim); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
ul.tight { margin: 8px 0; padding-left: 22px; }
ul.tight li { margin: 3px 0; }
footer { margin-top: 60px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--text-dim); font-size: 13px; }
@media (max-width: 860px) {
nav.toc { display: none; }
main { padding: 24px 18px 80px; }
}