MediaWiki:Common.css
来自Age Of History 2 Chinese Wiki
注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的更改的影响。
- Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5或Ctrl-R(Mac为⌘-R)
- Google Chrome:按Ctrl-Shift-R(Mac为⌘-Shift-R)
- Edge:按住Ctrl的同时单击刷新,或按Ctrl-F5。
/* 全局扫描线效果CSS - 基于Media维基样式 */
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@100;300;400;500;700;900&display=swap");
:root {
/* ===保留原始颜色方案=== */
--link-color: #0645ad;
--link-color-active: #faa700;
--custom-background-blue: #ccf;
--custom-background-cyan: #cef;
--custom-background-green: #cfc;
--custom-background-gray: #d2d2d2;
--custom-background-grey: var(--custom-background-gray);
--custom-background-magenta: #fdf;
--custom-background-orange: #fdb;
--custom-background-purple: #ecf;
--custom-background-red: #fcc;
--custom-background-yellow: #ffc;
--custom-border-blue: #36e;
--custom-border-cyan: #9df;
--custom-border-green: #5d5;
--custom-border-gray: #bbb;
--custom-border-grey: var(--custom-border-gray);
--custom-border-magenta: #f9f;
--custom-border-orange: #f90;
--custom-border-purple: #96c;
--custom-border-red: #e44;
--custom-border-yellow: #fc3;
/* ===新增字体设置=== */
--body-font: "Noto Sans SC", "Microsoft YaHei", "微软雅黑", Verdana, Geneva, sans-serif, STXihei, "华文细黑";
--UI-font: "Noto Sans SC", "方体", "PingFang SC", "黑体", "Heiti SC", "Microsoft JhengHei UI", sans-serif;
--title-font: var(--body-font);
/* ===扫描线效果设置=== */
--scanline-color: rgba(0, 0, 0, 0.03);
--scanline-size: 2px;
--scanline-timing: 10s;
/* ===风格迁移基础设置=== */
--base-font-size: 0.9375rem;
--swatch-primary: 133, 0, 5;
--swatch-primary-darker: 100, 46, 44;
--swatch-primary-darkest: 100, 3, 15;
--black-monochrome: 12, 12, 12;
--white-monochrome: 252, 252, 252;
}
/* ===全局扫描线效果=== */
body::before {
content: "";
display: block;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 9999;
/* 创建扫描线效果 */
background: repeating-linear-gradient(
0deg,
transparent,
transparent calc(var(--scanline-size) - 1px),
var(--scanline-color) var(--scanline-size)
);
/* 添加动画 */
animation: scanlines var(--scanline-timing) linear infinite;
}
@keyframes scanlines {
0% {
transform: translateY(0);
}
100% {
transform: translateY(var(--scanline-size));
}
}
/* 全局基础设置 */
html, body {
margin: 0;
padding: 0;
font-family: var(--body-font);
font-size: var(--base-font-size);
line-height: 1.6;
background-color: #fcfcfc;
color: rgb(var(--black-monochrome));
}
/* 细微的CRT屏幕模拟 - 非常轻微以保持可读性 */
body::after {
content: "";
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
background: radial-gradient(ellipse at center, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 95%, rgba(0,0,0,0.05) 100%);
z-index: 9998;
}
/* 链接样式优化 */
a {
color: var(--link-color);
text-decoration: none;
transition: color 0.2s ease-in-out;
}
a:hover, a:focus {
color: var(--link-color-active);
text-decoration: underline;
}
a:visited {
color: #0b0080;
}
/* 标题样式优化 */
h1, h2, h3, h4, h5, h6 {
font-family: var(--title-font);
font-weight: 500;
line-height: 1.3;
margin: 1em 0 0.5em;
}
h1 {
font-size: 1.8rem;
border-bottom: 1px solid rgba(var(--swatch-primary), 0.2);
}
/* 保留原infobox样式并增强 */
.notaninfobox {
position: relative;
clear: right;
margin: 0 0 1em 1em;
width: 350px;
font-size: 90%;
background-color: var(--custom-table-background);
float: right;
border: 1px solid var(--custom-border-gray);
padding: 2px;
overflow: auto;
z-index: 1;
overflow-wrap: anywhere;
box-shadow: 0 2px 4px rgba(0,0,0,0.05);
transition: box-shadow 0.3s ease;
}
.notaninfobox:hover {
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.notaninfobox > .infobox-title {
font-weight: bold;
text-align: center;
font-size: 120%;
background-color: #BCD4F5;
padding: 4px;
}
/* 黑幕效果增强 */
.heimu,
.heimu rt {
--heimu-color: #252525;
--heimu-text-color: #fff;
background-color: var(--heimu-color);
transition: color 0.2s ease-in-out;
}
.heimu,
.heimu a,
a .heimu,
a.new .heimu,
span.heimu a:visited {
color: var(--heimu-color);
text-shadow: none;
}
span.heimu:hover,
span.heimu:active {
color: var(--heimu-text-color);
}
/* 响应式调整 */
@media all and (max-width: 511px) {
.notaninfobox {
float: none;
margin-left: 0;
width: auto;
}
/* 在小屏幕上减弱扫描线效果以提高可读性 */
:root {
--scanline-color: rgba(0, 0, 0, 0.02);
--scanline-size: 3px;
}
}
/* 列表样式 */
ul, ol {
padding-left: 2em;
margin: 1em 0;
}
li {
margin: 0.3em 0;
}
/* 表格样式优化 */
table {
border-collapse: collapse;
border-spacing: 0;
margin: 1em 0;
}
table th {
background-color: var(--custom-table-header-background);
font-weight: bold;
text-align: center;
padding: 6px;
}
table td {
padding: 4px 6px;
border: 1px solid var(--custom-border-gray);
}
/* 图片样式 */
img {
max-width: 100%;
height: auto;
}
/* 代码和预格式化文本 */
pre, code {
font-family: Consolas, "Courier New", monospace;
background-color: var(--custom-code-background);
padding: 1px 3px;
border-radius: 2px;
}
pre {
padding: 8px;
overflow-x: auto;
line-height: 1.4;
border: 1px solid rgba(var(--black-monochrome), 0.1);
}
/* 引用样式 */
blockquote {
margin: 1em 0;
padding: 0.5em 1em;
border-left: 3px solid rgba(var(--swatch-primary), 0.5);
background-color: rgba(var(--white-monochrome), 0.5);
}
/* 输入元素样式 */
input, button, select, textarea {
font-family: var(--UI-font);
font-size: 0.9rem;
padding: 4px 8px;
border: 1px solid var(--custom-border-gray);
border-radius: 3px;
}
button, input[type="button"], input[type="submit"] {
background-color: #f8f9fa;
cursor: pointer;
transition: background-color 0.2s;
}
button:hover, input[type="button"]:hover, input[type="submit"]:hover {
background-color: #eaecf0;
}
/* 选中文本样式 */
::selection {
background: rgba(var(--swatch-primary), 0.25);
text-shadow: none;
}
/* 滚动条样式 */
::-webkit-scrollbar {
width: 10px;
height: 10px;
}
::-webkit-scrollbar-track {
background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
background: #c1c1c1;
border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
background: #a1a1a1;
}
/* 导航框样式优化 */
table.navbox {
border: 1px solid #aaa;
clear: both;
margin: auto;
padding: 1px;
text-align: center;
width: 100%;
background: var(--theme-card-background-color, #fdfdfd);
}
table.navbox + table.navbox {
margin-top: -1px;
}
.navbox-title,
.navbox-abovebelow,
table.navbox th {
padding-left: 1em;
padding-right: 1em;
text-align: center;
background: none repeat scroll 0 0 #a5e4a5;
}
.navbox-group {
font-weight: 700;
white-space: nowrap;
}
/* 修复移动端样式 */
@media only screen and (max-width: 759px) {
.infotable {
width: 90%;
float: none;
margin: 0 auto;
}
.navbox-title > div {
display: none;
}
.navbox-group,
.navbox-group > div {
padding-left: 0 !important;
padding-right: 0 !important;
text-align: center;
}
}
/* 打印样式 - 移除打印时的扫描线效果 */
@media print {
body::before, body::after {
display: none;
}
}
Loading comments...