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

MediaWiki:Common.css:修订间差异

MediaWiki界面页面
删除的内容 添加的内容
XP-jia留言 | 贡献
ds3
标签已被回退
Maintenance script留言 | 贡献
首页样式小幅优化(选择器收敛与中间断点)
 
(未显示2个用户的12个中间版本)
第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;
}
}


/* 2026-01-11: load Mainpage-specific styles from dedicated page */
/* ===========================
横幅标语样式 - 简约版
=========================== */
.banner {
background: #2c3e50;
color: white;
border-radius: 8px;
padding: 20px;
text-align: center;
margin: 20px 0;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}


.banner .chinese-text {
font-size: 24px;
font-weight: 600;
margin-bottom: 8px;
}


/* 全站重定向链接样式 */
.banner .english-text {
.mw-redirect {
font-size: 16px;
color: #008000 !important; /* 使用 hex 颜色值,提高优先级 */
opacity: 0.9;
font-weight: 500;
}
}


/* 重定向链接悬停效果 */
/* ===========================
.mw-redirect:hover {
内容块样式 - 简约版
color: #006400 !important;
=========================== */
text-decoration: underline;
.content-box {
margin: 12px 0;
padding: 20px;
border-radius: 8px;
background: white;
border: 1px solid #e1e5e9;
transition: all 0.2s ease;
}
}


/* 导航框样式迁移至 Template:Navbox/styles.css */
.content-box h2 {
font-size: 1.25rem;
font-weight: 600;
color: #2c3e50;
margin-bottom: 12px;
padding-bottom: 8px;
border-bottom: 2px solid #ecf0f1;
}


/* 语言链接样式 */
.content-box p {
#p-lang ul {
color: #555;
font-size: 0.95rem;
list-style: none;
margin: 0;
padding: 0;
margin: 10px 0;
}
}


#p-lang li {
.content-box:hover {
display: inline-block;
border-color: #bdc3c7;
margin-right: 10px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
}
/* 2026-01-12: 首页样式从 LocalSettings.php 迁移到此处(仅首页生效) */

body.page-Main_Page .banner {
/* ===========================
height: auto !important;
新布局样式
display: flex !important;
=========================== */
flex-direction: column !important;
.section-group {
justify-content: center !important;
display: grid;
align-items: center !important;
grid-template-columns: 2fr 1fr;
background: linear-gradient(135deg, #8B0000, #B22222) !important; /* 改进对比度 */
gap: 20px;
margin: 30px 0;
color: white !important;
font-weight: bold !important;
align-items: start;
border-radius: 12px !important;
padding: 12px 24px !important;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
text-align: center !important;
margin: 20px 0 !important;
}
}


body.page-Main_Page .banner-text {
.section-group.reverse {
margin: 0 !important;
grid-template-columns: 1fr 2fr;
line-height: 1.4 !important;
}
}


body.page-Main_Page .banner .chinese-text {
.featured-card {
grid-row: span 2;
font-size: 24px !important;
font-weight: 700 !important;
}
}


body.page-Main_Page .banner .english-text {
.card-group {
font-size: 16px !important;
display: flex;
font-weight: 500 !important;
flex-direction: column;
opacity: 0.9 !important;
gap: 20px;
}
}


/* 当屏幕宽度大于 768px(如平板和大屏幕设备) */
.featured-card .content-box {
@media screen and (min-width: 768px) {
height: auto;
body.page-Main_Page .banner .chinese-text {
min-height: 300px;
font-size: 28px !important;
display: flex;
}
flex-direction: column;
justify-content: center;
}


body.page-Main_Page .banner .english-text {
.card-group .content-box {
font-size: 18px !important;
flex: 1;
}
min-height: 140px;
}
}


/* 当屏幕宽度小于 480px(如手机设备) */
/* ===========================
@media screen and (max-width: 480px) {
特殊区域样式 - 简约版
body.page-Main_Page .banner .chinese-text {
=========================== */
font-size: 20px !important;
/* 知识掌握模型区域 */
}
.knowledge-model {
border-left: 4px solid #3498db;
background: #f8fbfd;
}


body.page-Main_Page .banner .english-text {
/* 最近更改区域 */
font-size: 14px !important;
.recent-changes {
}
border-left: 4px solid #e74c3c;
}
}


/* 哲学与思想 */
/* 内容块样式 */
body.page-Main_Page .content-box {
.philosophy {
margin: 10px !important;
border-left: 4px solid #3498db;
padding: 20px !important;
background: #f0f8ff;
border-radius: 10px !important;
border: 1px solid #e0e0e0 !important;
-webkit-transition: -webkit-transform 0.3s ease, box-shadow 0.3s ease !important;
transition: transform 0.3s ease, box-shadow 0.3s ease !important;
will-change: transform !important; /* 性能优化 */
backface-visibility: hidden !important; /* 性能优化 */
}
}


body.page-Main_Page .content-box:hover {
/* 文学与艺术 */
-webkit-transform: translateY(-5px) !important;
.literature {
-moz-transform: translateY(-5px) !important;
border-left: 4px solid #9b59b6;
transform: translateY(-5px) !important;
background: #faf8ff;
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.18) !important;
}
}


body.page-Main_Page .content-box:focus {
/* 管理与人文 */
outline: 2px solid #0066cc !important; /* 可访问性改进 */
.management {
outline-offset: 2px !important;
border-left: 4px solid #d35400;
background: #fff8f0;
}
}


body.page-Main_Page .content-box h2 {
/* 技术与数据 */
position: relative !important;
.technology {
padding-bottom: 10px !important;
border-left: 4px solid #2ecc71;
margin-bottom: 10px !important;
background: #f0fff8;
border-bottom: 2px solid red !important;
color: #333333 !important;
}
}


body.page-Main_Page .content-box p {
/* 工程与实践 */
line-height: 1.6 !important;
.engineering {
color: #666666 !important;
border-left: 4px solid #e67e22;
background: #fffaf0;
}
}


/* 软件与系统 */
/* Flex 容器 */
body.page-Main_Page .flex-container {
.software {
display: flex !important;
border-left: 4px solid #34495e;
justify-content: space-between !important;
background: #f8f9fa;
gap: 20px !important;
flex-wrap: wrap !important;
}
}


body.page-Main_Page .flex-container .content-box {
/* 数据与智能 */
flex: 1 !important;
.data-intelligence {
min-width: 300px !important;
border-left: 4px solid #1abc9c;
max-width: 33.33% !important;
background: #f0fffc;
box-sizing: border-box !important;
}
}
/* 中等屏幕优化 */

@media (max-width: 900px) {
/* 学习与成长 */
body.page-Main_Page .flex-container .content-box {
.learning {
max-width: 50% !important;
border-left: 4px solid #f39c12;
}
background: #fffcf0;
}
}


/* 竞赛与创造 */
.competition {
border-left: 4px solid #c0392b;
background: #fff0f0;
}


/* 站点与结构 */
/* 移动端优化 */
@media (max-width: 768px) {
.site-structure {
body.page-Main_Page .flex-container {
border-left: 4px solid #7f8c8d;
flex-direction: column !important;
background: #f5f5f5;
gap: 15px !important; /* 统一间距 */
}
}


body.page-Main_Page .flex-container .content-box {
/* ===========================
max-width: 100% !important; /* 移除限制 */
导航框样式 - 简约版
width: 100% !important;
=========================== */
margin-bottom: 0 !important; /* 统一使用 gap */
.nav-container {
}
background: #f8f9fa;
border-radius: 6px;
padding: 12px;
margin: 12px 0;
border: 1px solid #e9ecef;
}


body.page-Main_Page .banner .chinese-text,
.nav-container a {
body.page-Main_Page .banner .english-text {
color: #2980b9;
text-decoration: none;
text-align: center !important;
}
transition: color 0.2s ease;
}


body.page-Main_Page .banner .chinese-text {
.nav-container a:hover {
font-size: 20px !important;
color: #1a5276;
}
text-decoration: underline;
}


body.page-Main_Page .banner .english-text {
/* ===========================
font-size: 14px !important;
特殊样式
}
=========================== */
.mw-redirect {
color: #27ae60;
}
}


/* 为减少动画的用户提供支持 */
/* ===========================
@media (prefers-reduced-motion: reduce) {
响应式设计 - 简约版
body.page-Main_Page .content-box {
=========================== */
-webkit-transition: none !important;
transition: none !important;
}


body.page-Main_Page .content-box:hover {
/* 平板设备 */
-webkit-transform: none !important;
@media screen and (max-width: 1024px) {
-moz-transform: none !important;
.section-group,
transform: none !important;
.section-group.reverse {
grid-template-columns: 1fr;
gap: 16px;
}
.featured-card {
grid-row: auto;
}
.card-group {
flex-direction: row;
}
}
}
}


/* 暗色模式覆盖(Citizen: night) */
/* 手机设备 */
.skin-theme-clientpref-night body.page-Main_Page .banner {
@media screen and (max-width: 768px) {
background: linear-gradient(135deg, #3a0c0c, #5a1a1a) !important;
.section-group,
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45) !important;
.section-group.reverse {
}
grid-template-columns: 1fr;
gap: 16px;
}
.card-group {
flex-direction: column;
}
.content-box {
padding: 16px;
margin: 8px 0;
}


.skin-theme-clientpref-night body.page-Main_Page .content-box {
.banner {
border-color: #2f2f2f !important;
padding: 16px;
background-color: #1c1c1c !important;
margin: 16px 0;
}
}


.skin-theme-clientpref-night body.page-Main_Page .content-box:hover {
.banner .chinese-text {
box-shadow: 0 10px 22px rgba(0, 0, 0, 0.5) !important;
font-size: 20px;
}
}


.skin-theme-clientpref-night body.page-Main_Page .content-box:focus {
.banner .english-text {
outline-color: #5ea0ff !important;
font-size: 14px;
}
}
}


.skin-theme-clientpref-night body.page-Main_Page .content-box h2 {
/* 小屏手机设备 */
border-bottom-color: #b94a4a !important;
@media screen and (max-width: 480px) {
color: #ffffff !important;
.content-box {
}
padding: 14px;
}


.content-box h2 {
.skin-theme-clientpref-night body.page-Main_Page .content-box p {
color: #cccccc !important;
font-size: 1.1rem;
}

.banner .chinese-text {
font-size: 18px;
}
.featured-card .content-box {
min-height: 250px;
}
}
}