“MediaWiki:Common.css”的版本间的差异
来自部落与弯刀Wiki
Skyswordkill(讨论 | 贡献) |
Skyswordkill(讨论 | 贡献) |
||
| 第89行: | 第89行: | ||
} | } | ||
| − | /* | + | /* --- 桌面端目录样式 --- */ |
#toc { | #toc { | ||
position: fixed; | position: fixed; | ||
| 第104行: | 第104行: | ||
z-index: 999; | z-index: 999; | ||
font-size: 14px; | font-size: 14px; | ||
| + | transition: opacity 0.3s ease, visibility 0.3s ease; | ||
} | } | ||
| − | /* | + | /* 正文右边距:仅桌面端增加 */ |
| − | #bodyContent, .mw-parser-output { | + | @media screen and (min-width: 769px) { |
| − | + | #bodyContent, .mw-parser-output { | |
| + | margin-right: 320px; | ||
| + | } | ||
} | } | ||
| − | /* | + | /* 当前章节高亮 */ |
#toc a.active-section { | #toc a.active-section { | ||
font-weight: bold; | font-weight: bold; | ||
| 第117行: | 第120行: | ||
} | } | ||
| − | /* | + | /* 移动端隐藏目录 + 显示按钮 */ |
@media screen and (max-width: 768px) { | @media screen and (max-width: 768px) { | ||
#toc { | #toc { | ||
display: none; | display: none; | ||
| + | } | ||
| + | |||
| + | #toc-toggle-btn { | ||
| + | position: fixed; | ||
| + | bottom: 20px; | ||
| + | right: 20px; | ||
| + | background-color: #722; | ||
| + | color: #fff; | ||
| + | padding: 8px 12px; | ||
| + | border-radius: 6px; | ||
| + | font-size: 14px; | ||
| + | z-index: 1000; | ||
| + | cursor: pointer; | ||
| + | } | ||
| + | |||
| + | /* 显示状态下强制显示目录 */ | ||
| + | #toc.toc-visible { | ||
| + | display: block; | ||
| + | position: fixed; | ||
| + | top: 60px; | ||
| + | right: 10px; | ||
| + | width: 90%; | ||
| + | max-height: 60vh; | ||
| + | overflow-y: auto; | ||
| + | z-index: 999; | ||
| + | border: 1px solid #aaa; | ||
| + | background-color: #fff; | ||
| + | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); | ||
} | } | ||
} | } | ||
2025年6月10日 (二) 18:54的版本
/* 这里放置的CSS将应用于所有皮肤 */
/* 背景与整体字体优化 */
body {
background: #fdfdfd;
font-family: "Helvetica Neue", "Microsoft YaHei", sans-serif;
font-size: 15px;
color: #333;
}
/* 顶部条颜色统一 */
#mw-page-base, #mw-head-base, #mw-head, #mw-panel {
background-color: #722;
}
/* 页面标题样式 */
#firstHeading {
font-size: 26px;
font-weight: bold;
border-bottom: 2px solid #aaa;
padding-bottom: 10px;
margin-bottom: 20px;
}
/* 修改内容框边距与间距 */
#bodyContent {
line-height: 1.7;
padding: 20px;
}
/* 美化目录(TOC) */
.toc {
background-color: #f9f9f9;
border: 1px solid #ccc;
padding: 10px 15px;
border-radius: 6px;
font-size: 14px;
}
/* TOC标题粗体显示 */
.toc .toctitle {
font-weight: bold;
}
/* 表格样式美化 */
table.wikitable {
border-collapse: collapse;
border: 1px solid #ccc;
background: #fff;
}
table.wikitable th, table.wikitable td {
border: 1px solid #ccc;
padding: 8px 12px;
}
/* 链接颜色统一 */
a {
color: #005a9c;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
/* 编辑按钮优化 */
.mw-editsection {
font-size: 12px;
margin-left: 10px;
}
.mw-editsection a {
color: #999;
}
.mw-editsection a:hover {
color: #000;
}
/* 页面底部信息栏隐藏(可选) */
#footer {
display: none;
}
/* 左侧导航栏字体与间距优化 */
#mw-panel {
font-size: 14px;
padding-top: 15px;
}
#mw-panel .portal {
margin-bottom: 20px;
}
/* --- 桌面端目录样式 --- */
#toc {
position: fixed;
top: 100px;
right: 30px;
width: 260px;
max-height: 80vh;
overflow-y: auto;
background-color: #fdfdfd;
border: 1px solid #ccc;
padding: 12px 16px;
border-radius: 8px;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
z-index: 999;
font-size: 14px;
transition: opacity 0.3s ease, visibility 0.3s ease;
}
/* 正文右边距:仅桌面端增加 */
@media screen and (min-width: 769px) {
#bodyContent, .mw-parser-output {
margin-right: 320px;
}
}
/* 当前章节高亮 */
#toc a.active-section {
font-weight: bold;
color: #c00 !important;
}
/* 移动端隐藏目录 + 显示按钮 */
@media screen and (max-width: 768px) {
#toc {
display: none;
}
#toc-toggle-btn {
position: fixed;
bottom: 20px;
right: 20px;
background-color: #722;
color: #fff;
padding: 8px 12px;
border-radius: 6px;
font-size: 14px;
z-index: 1000;
cursor: pointer;
}
/* 显示状态下强制显示目录 */
#toc.toc-visible {
display: block;
position: fixed;
top: 60px;
right: 10px;
width: 90%;
max-height: 60vh;
overflow-y: auto;
z-index: 999;
border: 1px solid #aaa;
background-color: #fff;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
}