/* 定义全局 CSS 变量,默认亮色主题 */
:root {
--background-color: #dfe6e9; /* 页面背景 */
--main-bg-color: #fff; /* 主内容背景 */
--text-color: #000; /* 文字颜色 */
--menu-bold-color: #000; /* 菜单粗体文字 */
--shadow-color: rgba(0, 0, 0, 0.2); /* 阴影 */
--border-color: #ddd; /* 边框 */
--hover-bg-color: #eee; /* 悬停背景 */
--note-clipped-color: #666; /* 剪辑注释文字 */
--note-clipped-border: #ddd; /* 剪辑注释边框 */
--toggle-button-border: #aaa; /* 菜单切换按钮边框 */
--toggle-button-color: #000; /* 菜单切换按钮文字 */
--link-color: #0066cc; /* 链接颜色(浅色主题) */
--link-hover-color: #003366; /* 链接悬停颜色(浅色主题) */
}
/* 暗色主题 */
@media (prefers-color-scheme: dark) {
:root {
--background-color: #2d3436; /* 暗色页面背景 */
--main-bg-color: #1e2729; /* 暗色主内容背景 */
--text-color: #dfe6e9; /* 暗色文字颜色 */
--menu-bold-color: #dfe6e9; /* 暗色菜单粗体文字 */
--shadow-color: rgba(0, 0, 0, 0.5); /* 暗色阴影 */
--border-color: #444; /* 暗色边框 */
--hover-bg-color: #3a3f41; /* 暗色悬停背景 */
--note-clipped-color: #aaa; /* 暗色剪辑注释文字 */
--note-clipped-border: #444; /* 暗色剪辑注释边框 */
--toggle-button-border: #666; /* 暗色菜单切换按钮边框 */
--toggle-button-color: #fff; /* 暗色菜单切换按钮文字 */
--link-color: #76d7ea; /* 链接颜色(深色主题) */
--link-hover-color: #a3e7fc; /* 链接悬停颜色(深色主题) */
}
}
body {
font-family: 'Lucida Grande', 'Lucida Sans Unicode', arial, sans-serif;
background: var(--background-color);
}
#layout {
display: flex;
margin: 0 auto;
}
#menu {
width: 15%;
margin: 60px 5px;
overflow: auto;
color: var(--text-color);
}
#menu p {
margin: 0;
}
#menu>p {
font-weight: bold;
font-size: 110%;
color: var(--menu-bold-color);
}
#menu ul {
padding-left: 20px;
}
/* 菜单中的链接样式 */
#menu a {
color: var(--link-color);
text-decoration: none;
}
#menu a:hover {
color: var(--link-hover-color);
text-decoration: underline;
}
#main {
width: 80%;
max-width: 1500px;
position: relative;
background: var(--main-bg-color);
margin: 60px auto;
box-shadow: 0px 2px 38px var(--shadow-color);
padding: 25px;
overflow: auto;
color: var(--text-color);
}
/* 主内容中的链接样式 */
#main a {
color: var(--link-color);
text-decoration: none;
}
#main a:hover {
color: var(--link-hover-color);
text-decoration: underline;
}
#parentLink {
float: right;
margin-top: 20px;
}
#title {
margin: 0;
padding-top: 10px;
}
img {
max-width: 100%;
}
pre {
white-space: pre-wrap;
word-wrap: anywhere;
}
iframe.pdf-view {
width: 100%;
height: 800px;
}
#toggleMenuButton {
display: none;
position: fixed;
top: 8px;
left: 5px;
width: 1.4em;
border-radius: 5px;
border: 1px solid var(--toggle-button-border);
font-size: 2rem;
z-index: 10;
height: auto;
color: var(--toggle-button-color);
cursor: pointer;
}
#childLinks.grid ul {
list-style-type: none;
display: flex;
flex-wrap: wrap;
padding: 0;
}
#childLinks.grid ul li {
width: 180px;
height: 140px;
padding: 10px;
}
#childLinks.grid ul li a {
display: flex;
flex-direction: column;
height: 100%;
width: 100%;
border: 1px solid var(--border-color);
border-radius: 5px;
justify-content: center;
align-content: center;
text-align: center;
font-size: large;
color: var(--link-color);
text-decoration: none;
}
#childLinks.grid ul li a:hover {
background: var(--hover-bg-color);
color: var(--link-hover-color);
}
#childLinks.list ul {
list-style-type: none;
display: inline-flex;
flex-wrap: wrap;
padding: 0;
margin-top: 5px;
}
#childLinks.list ul li {
margin-right: 20px;
}
#childLinks.list ul li a {
color: var(--link-color);
text-decoration: none;
}
#childLinks.list ul li a:hover {
color: var(--link-hover-color);
text-decoration: underline;
}
#noteClippedFrom {
padding: 10px 0 10px 0;
margin: 20px 0 20px 0;
color: var(--note-clipped-color);
border: 1px solid var(--note-clipped-border);
border-left: 0;
border-right: 0;
}
#toggleMenuButton::after {
position: relative;
top: -2px;
left: 1px;
}
@media (max-width: 48em) {
#layout.showMenu #menu {
display: block;
margin-top: 40px;
}
#toggleMenuButton {
display: block;
}
#layout.showMenu #main {
display: none;
}
#title {
padding-left: 60px;
}
#layout.showMenu #toggleMenuButton::after {
content: "«";
}
#toggleMenuButton::after {
content: "»";
}
#menu {
display: none;
}
}