打开/关闭菜单
打开/关闭外观设置菜单
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。

MediaWiki:Common.css:修订间差异

MediaWiki界面页面
删除的内容 添加的内容
XP-jia留言 | 贡献
ds7
标签已被回退
XP-jia留言 | 贡献
还原
标签手工回退
第1行: 第1行:
/* 全局字体设置,覆盖东亚语言 */
/* ===========================
全局字体设置
=========================== */
body {
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
"Noto Sans", "Noto Sans CJK SC", "Noto Sans CJK TC", "Noto Sans JP",
"Noto Sans", "Noto Sans CJK SC", "Noto Sans CJK TC", "Noto Sans JP",
"Noto Sans KR", sans-serif, "PingFang SC", "Hiragino Sans GB",
"Noto Sans KR", sans-serif, "PingFang SC", "Hiragino Sans GB",
"Microsoft YaHei", "WenQuanYi Micro Hei", "SimSun", "SimHei",
"Microsoft YaHei", "WenQuanYi Micro Hei", "SimSun", "SimHei",
"Songti SC", "KaiTi", "MingLiU", "PMingLiU", "Microsoft JhengHei", "Malgun Gothic";
"Songti SC", "KaiTi", "MingLiU", "PMingLiU", "Microsoft JhengHei", "Malgun Gothic";
background-color: #f8f9fa;
line-height: 1.6;
color: #333;
margin: 0;
padding: 0;
}
}


/* 横幅标语 */
/* ===========================
横幅标语样式
=========================== */
.banner {
.banner {
height: auto;
background: #2c3e50;
display: flex;
color: white;
flex-direction: column;
border-radius: 8px;
justify-content: center;
padding: 20px;
text-align: center;
align-items: center; /* 居中对齐 */
background: linear-gradient(to right, #b30000, #cc3300); /* 渐变背景 */
margin: 20px 0;
color: white; /* 白色字体,提升对比度 */
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
font-weight: bold;
border-radius: 12px; /* 圆角优化 */
padding: 12px 24px; /* 增加上下 padding */
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); /* 更柔和的阴影 */
text-align: center;
}
}

.banner-text {
margin: 0;
line-height: 1.4; /* 让文本更易读 */
}

.banner .chinese-text {
.banner .chinese-text {
font-size: 24px;
font-size: 24px; /* 默认大小 */
font-weight: 600;
font-weight: 700;
margin-bottom: 8px;
}
}

.banner .english-text {
.banner .english-text {
font-size: 16px;
font-size: 16px; /* 默认大小 */
font-weight: 500;
opacity: 0.9;
opacity: 0.9;
}
}


/* 当屏幕宽度大于 768px(如平板和大屏幕设备) */
/* ===========================
@media screen and (min-width: 768px) {
基础内容块样式
.banner .chinese-text {
=========================== */
font-size: 28px;
.content-box {
}
margin: 12px 0;

padding: 20px;
.banner .english-text {
border-radius: 8px;
font-size: 18px;
background: white;
}
border: 1px solid #e1e5e9;
transition: all 0.2s ease;
}
}

.content-box h2 {
/* 当屏幕宽度小于 480px(如手机设备) */
font-size: 1.25rem;
@media screen and (max-width: 480px) {
font-weight: 600;
.banner .chinese-text {
color: #2c3e50;
font-size: 20px;
margin-bottom: 12px;
}
padding-bottom: 8px;

border-bottom: 2px solid #ecf0f1;
.banner .english-text {
font-size: 14px;
}
}
}

.content-box p {
/* 内容块样式 */
color: #555;
.content-box {
font-size: 0.95rem;
margin: 0 0 12px 0;
margin: 10px;
padding: 20px;
border-radius: 10px;
border: 1px solid #e0e0e0;
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
}

.content-box:hover {
.content-box:hover {
transform: translateY(-5px);
border-color: #bdc3c7;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}
}


.content-box h2 {
/* ===========================
position: relative;
布局样式
padding-bottom: 10px;
=========================== */
margin-bottom: 10px;
.content-section {
border-bottom: 2px solid red;
margin: 20px 0;
}
.wide-box {
width: 100%;
box-sizing: border-box;
}
.two-column-section {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 20px;
margin: 20px 0;
}
.highlight-box {
background: #f8f9fa;
border-left: 4px solid #2ecc71;
}
.highlight-box h2 {
border-bottom-color: #d5f4e6;
}
}


.content-box p {
/* 导航容器 */
line-height: 1.6;
.nav-container {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 20px;
margin-top: 15px;
}
.nav-column {
padding: 15px;
background: rgba(0,0,0,0.02);
border-radius: 6px;
border: 1px solid #f1f2f6;
}
.nav-column strong {
color: #2c3e50;
margin-bottom: 8px;
display: block;
font-size: 0.95rem;
}
}


/* 子分类布局 */
/* Flex 容器 */
.sub-categories {
.flex-container {
display: grid;
display: flex;
justify-content: space-between;
grid-template-columns: 1fr 1fr;
gap: 15px;
gap: 20px;
margin-top: 10px;
}
.sub-categories > div {
padding: 12px;
background: rgba(0,0,0,0.02);
border-radius: 6px;
border: 1px solid #f1f2f6;
}
.sub-categories strong {
color: #2c3e50;
display: block;
margin-bottom: 6px;
font-size: 0.9rem;
}
}


.flex-container .content-box {
/* 三栏内容 */
flex: 1;
.three-column-content {
max-width: 33.33%;
display: grid;
box-sizing: border-box;
grid-template-columns: 1fr 1fr 1fr;
gap: 20px;
text-align: center;
margin-top: 15px;
}
.three-column-content > div {
padding: 15px;
background: white;
border-radius: 6px;
border: 1px solid #e1e5e9;
transition: all 0.2s ease;
}
.three-column-content > div:hover {
border-color: #3498db;
}
.three-column-content strong {
color: #2c3e50;
display: block;
margin-bottom: 8px;
}
}


/* 两栏内容 */
/* 移动端优化 */
@media (max-width: 768px) {
.two-column-content {
.flex-container {
display: grid;
flex-direction: column;
grid-template-columns: 1fr 1fr;
}
gap: 20px;
margin-top: 15px;
}
.two-column-content > div {
padding: 15px;
background: rgba(0,0,0,0.02);
border-radius: 6px;
border: 1px solid #f1f2f6;
}
.two-column-content strong {
color: #2c3e50;
display: block;
margin-bottom: 8px;
}


.flex-container .content-box {
/* 站点链接 */
max-width: 100%;
.site-links {
margin-bottom: 20px;
display: grid;
}
grid-template-columns: 1fr 1fr 1fr;
gap: 15px;
margin-top: 15px;
text-align: center;
}
.site-links > div {
padding: 12px;
background: white;
border: 1px solid #e1e5e9;
border-radius: 6px;
transition: all 0.2s ease;
}
.site-links > div:hover {
border-color: #3498db;
}
.site-links strong {
color: #2c3e50;
display: block;
margin-bottom: 6px;
font-size: 0.9rem;
}


.banner .chinese-text,
/* ===========================
.banner .english-text {
特殊区域样式
text-align: center;
=========================== */
font-size: 18px;
.content-section.main-focus .content-box {
}
border-left: 4px solid #3498db;

background: #f8fbfd;
.banner .english-text {
}
font-size: 14px;
.two-column-section .content-box:nth-child(1) {
}
border-left: 4px solid #9b59b6;
}
.two-column-section .content-box:nth-child(2) {
border-left: 4px solid #e67e22;
}
.content-box:nth-last-child(3) {
border-left: 4px solid #34495e;
}
.content-box:nth-last-child(2) {
border-left: 4px solid #7f8c8d;
}
.content-box:last-of-type {
border-left: 4px solid #e74c3c;
}
}


/* 让重定向的内链变成绿色 */
/* ===========================
链接样式
=========================== */
.content-box a {
color: #2980b9;
text-decoration: none;
transition: color 0.2s ease;
}
.content-box a:hover {
color: #1a5276;
text-decoration: underline;
}
.mw-redirect {
.mw-redirect {
color: #27ae60;
color: green;
font-weight: 500;
}

/* ===========================
响应式设计
=========================== */
@media screen and (max-width: 1024px) {
.two-column-section {
grid-template-columns: 1fr;
}
.nav-container,
.two-column-content {
grid-template-columns: 1fr;
}
.three-column-content,
.site-links {
grid-template-columns: 1fr 1fr;
}
.sub-categories {
grid-template-columns: 1fr;
}
}
@media screen and (max-width: 768px) {
.content-box {
padding: 16px;
margin: 8px 0;
}
.banner {
padding: 16px;
margin: 16px 0;
}
.banner .chinese-text {
font-size: 20px;
}
.banner .english-text {
font-size: 14px;
}
.three-column-content,
.site-links {
grid-template-columns: 1fr;
}
.three-column-content > div,
.site-links > div {
margin-bottom: 10px;
}
.nav-column,
.sub-categories > div {
padding: 12px;
}
}
@media screen and (max-width: 480px) {
.content-box {
padding: 14px;
}
.content-box h2 {
font-size: 1.1rem;
}
.banner .chinese-text {
font-size: 18px;
}
.nav-container,
.two-column-content,
.three-column-content,
.site-links,
.sub-categories {
grid-template-columns: 1fr;
gap: 12px;
}
.nav-column,
.two-column-content > div,
.three-column-content > div,
.site-links > div,
.sub-categories > div {
padding: 12px;
}
}

/* ===========================
打印样式
=========================== */
@media print {
.banner {
background: #fff !important;
color: #000 !important;
border: 1px solid #000;
}
.content-box {
border: 1px solid #000;
box-shadow: none !important;
}
.nav-column,
.two-column-content > div,
.three-column-content > div,
.site-links > div,
.sub-categories > div {
background: #fff !important;
border: 1px solid #ddd;
}
}
}