astrion-website/demo/site-assets/docs.css

298 lines
8.0 KiB
CSS
Raw 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.

/* ═══════════ 文档页docs.html ═══════════
沿用 site.css 的设计 token--bg-、--text-、--line-、--accent 系列)。
注意CSS 注释文本里绝不能出现星号+斜杠紧邻的序列(如 `--bg-* /` 写在一起),
会提前闭合注释、吞掉紧随其后的整条规则(本次 body padding-top 被吞实踩)。
遵守站点设计纪律:无光晕、无圆角套娃、带文字容器固定高度、内容区不另开滚动容器。 */
body {
padding-top: var(--topbar-h); /* topbar 是 fixed把内容顶下来 */
}
/* 顶栏配套:当前页「文档」高亮;「‹ 首页」桌面隐藏brand 即返回入口),移动端放行显示 */
.docs-nav-current { color: var(--text-1); }
.docs-back-home { display: none; }
.docs-layout {
max-width: var(--page-max);
margin: 0 auto;
padding: 40px 32px 96px;
display: grid;
grid-template-columns: 216px minmax(0, 1fr);
gap: 56px;
}
/* ───── 左侧目录 ───── */
.docs-side {
position: sticky;
top: calc(var(--topbar-h) + 40px);
align-self: start;
}
.docs-side-title {
margin: 0 0 10px;
padding: 0 12px;
font-size: 12px;
font-weight: 600;
letter-spacing: 0.08em;
color: var(--text-3);
text-transform: uppercase;
}
.docs-nav a {
display: block;
height: 36px;
line-height: 36px;
padding: 0 12px;
border-radius: 6px;
font-size: 14px;
color: var(--text-2);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
transition: color 0.15s ease, background-color 0.15s ease;
}
.docs-nav a:hover {
color: var(--text-1);
background: rgba(168, 180, 210, 0.06);
}
.docs-nav a.active {
color: var(--text-1);
background: rgba(168, 180, 210, 0.1);
font-weight: 560;
}
/* 语言切换:目录末尾成员(桌面端竖排项同风格,上方留白分隔;移动端见 @media chips 化) */
.docs-lang-toggle {
display: block;
width: 100%;
margin-top: 14px;
height: 36px;
padding: 0 12px;
background: none;
border: 0;
border-radius: 6px;
font-family: inherit;
font-size: 14px;
color: var(--text-3);
text-align: left;
cursor: pointer;
transition: color 0.15s ease, background-color 0.15s ease;
}
.docs-lang-toggle:hover {
color: var(--text-1);
background: rgba(168, 180, 210, 0.06);
}
/* ───── 右侧内容 ───── */
.docs-content {
max-width: 760px;
font-size: 15px;
line-height: 1.8;
color: var(--text-2);
}
.docs-content > :first-child { margin-top: 0; }
.docs-content h1 {
margin: 0 0 24px;
padding-bottom: 14px;
border-bottom: 1px solid var(--line);
font-size: 27px;
font-weight: 700;
line-height: 1.3;
color: var(--text-1);
}
.docs-content h2 {
margin: 42px 0 14px;
font-size: 20px;
font-weight: 650;
line-height: 1.35;
color: var(--text-1);
}
.docs-content h3 {
margin: 30px 0 10px;
font-size: 16px;
font-weight: 650;
line-height: 1.4;
color: var(--text-1);
}
.docs-content h4 {
margin: 24px 0 8px;
font-size: 15px;
font-weight: 650;
color: var(--text-1);
}
.docs-content p,
.docs-content ul,
.docs-content ol { margin: 0 0 14px; }
/* 列表缩进site.css 第 36 行的 * 通配重置margin:0;padding:0清掉了 ul/ol 的默认
padding-leftoutside 圆点因此跑到内容区左外侧;补回缩进让圆点落在内容区内、文字对齐。 */
.docs-content ul { padding-left: 1.4em; }
.docs-content ol { padding-left: 1.6em; }
.docs-content li { margin: 4px 0; }
.docs-content li::marker { color: var(--text-3); }
.docs-content li > ul,
.docs-content li > ol { margin: 4px 0; }
.docs-content strong { color: var(--text-1); font-weight: 620; }
.docs-content a {
color: var(--accent);
text-decoration: none;
border-bottom: 1px solid transparent;
transition: color 0.15s ease, border-color 0.15s ease;
}
.docs-content a:hover {
color: var(--accent-strong);
border-bottom-color: var(--accent-strong);
}
.docs-content code {
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: 0.88em;
background: rgba(168, 180, 210, 0.1);
padding: 2px 6px;
border-radius: 4px;
color: var(--text-1);
}
.docs-content pre {
margin: 0 0 16px;
padding: 14px 16px;
background: var(--bg-panel);
border: 1px solid var(--line);
border-radius: 8px;
overflow-x: auto;
}
.docs-content pre code {
background: none;
padding: 0;
border-radius: 0;
font-size: 13px;
line-height: 1.7;
color: var(--text-1);
}
/* 引用块:内部 p 若继承段落 margin-bottom 会把块底撑高、竖线随之拉长,
文字视觉偏上(实测上 2px 下 16px块内段落去 marginpadding 上下对称,竖线与文字同高对齐。 */
.docs-content blockquote {
margin: 0 0 14px;
padding: 10px 0 10px 16px;
border-left: 2px solid var(--line-strong);
color: var(--text-3);
}
.docs-content blockquote p { margin: 0; }
.docs-content blockquote p + p { margin-top: 8px; }
.docs-content hr {
margin: 32px 0;
border: 0;
border-top: 1px solid var(--line);
}
.docs-content table {
width: 100%;
margin: 0 0 16px;
border-collapse: collapse;
font-size: 14px;
line-height: 1.6;
}
.docs-content th,
.docs-content td {
padding: 8px 12px;
border-bottom: 1px solid var(--line);
text-align: left;
vertical-align: top;
}
.docs-content th {
color: var(--text-1);
font-weight: 620;
white-space: nowrap;
}
.docs-content img { max-width: 100%; }
/* 表格与代码块的横向滚动条做细窄适配,不暴露原生粗滚动条 */
.docs-content pre::-webkit-scrollbar,
.docs-content table::-webkit-scrollbar { height: 8px; }
.docs-content pre::-webkit-scrollbar-thumb,
.docs-content table::-webkit-scrollbar-thumb {
background: rgba(168, 180, 210, 0.18);
border-radius: 4px;
}
/* 加载与错误占位 */
.docs-loading,
.docs-error {
padding: 48px 0;
font-size: 14px;
color: var(--text-3);
}
.docs-error { color: var(--text-2); }
/* 窄屏:目录折到内容上方,不再分栏;顶栏放行返回入口;表格块内横滚防拶破版面 */
@media (max-width: 860px) {
.docs-layout {
/* 必须 minmax(0,1fr) 而非 1fr1fr = minmax(auto,1fr)grid auto 下限是 min-content
pre/table 的最小内容宽度会撑破列本次移动端正文被右裁实踩0 下限才能压住。 */
grid-template-columns: minmax(0, 1fr);
gap: 20px;
padding: 24px 20px 72px;
}
/* 返回首页site.css 在移动端隐藏全部 .topnav-link0,1,0用更高优先级选择器0,2,0单独放行 */
.topnav .docs-back-home { display: inline-flex; align-items: center; }
/* 目录 = 单行横向滚动 chips 条(原本 inline-block 两行挤压、末项被裁断) */
.docs-side {
position: static;
padding-bottom: 14px;
border-bottom: 1px solid var(--line);
}
.docs-side-title { display: none; }
.docs-nav {
display: flex;
gap: 8px;
overflow-x: auto;
padding-bottom: 2px;
scrollbar-width: none; /* 隐藏横向滚动条 */
}
.docs-nav::-webkit-scrollbar { display: none; }
.docs-nav a {
flex: none;
display: inline-flex;
align-items: center;
height: 32px;
line-height: normal;
padding: 0 12px;
background: var(--bg-panel);
border: 1px solid var(--line);
border-radius: 999px;
white-space: nowrap;
}
.docs-nav a.active {
background: rgba(168, 180, 210, 0.14);
border-color: var(--line-strong);
}
/* 语言切换 = chips 条尾部成员(与 chip 同高同形) */
.docs-lang-toggle {
flex: none;
display: inline-flex;
align-items: center;
width: auto;
margin-top: 0;
height: 32px;
padding: 0 12px;
background: var(--bg-panel);
border: 1px dashed var(--line-strong);
border-radius: 999px;
white-space: nowrap;
}
/* 内容防超宽:长行断词;表格 display:block 后块内横滚(不顶破页面) */
.docs-content { max-width: 100%; overflow-wrap: break-word; }
.docs-content table { display: block; overflow-x: auto; }
.docs-content h1 { font-size: 23px; }
.docs-content h2 { font-size: 18px; }
}