MediaWiki:Common.css
MediaWiki界面页面
更多操作
注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的更改的影响。
- Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5或Ctrl-R(Mac为⌘-R)
- Google Chrome:按Ctrl-Shift-R(Mac为⌘-Shift-R)
- Edge:按住Ctrl的同时单击刷新,或按Ctrl-F5。
/* 电脑端样式 */
.responsive-two-columns .left-col {
width: 320px;
vertical-align: top;
}
.responsive-two-columns .right-col {
vertical-align: top;
padding-left: 20px;
}
/* 新增:响应式图片卡片样式 */
.gallery-card {
position: relative;
width: calc(50% - 5px); /* 一行两个,减去gap的一半 */
max-width: 500px;
text-align: center;
}
.gallery-card-small {
position: relative;
width: calc(50% - 5px);
max-width: 150px;
text-align: center;
}
.gallery-card img,
.gallery-card-small img {
width: 100%;
height: auto;
}
.image-overlay {
position: absolute;
bottom: 30px;
left: 10px;
text-align: left;
background: rgba(0,0,0,0.5);
color: white;
padding: 5px;
border-radius: 4px;
}
.flex-gallery {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
gap: 10px;
align-items: flex-start;
}
/* === 手机端响应式(768px以下) === */
@media screen and (max-width: 768px) {
/* 两栏布局变单栏 */
.responsive-two-columns,
.responsive-two-columns tbody,
.responsive-two-columns tr,
.responsive-two-columns td {
display: block;
width: 100%;
}
.responsive-two-columns .right-col {
padding-left: 0;
margin-top: 20px;
}
.responsive-two-columns img {
max-width: 100%;
height: auto;
}
/* 画廊卡片保持一行两个 */
.gallery-card,
.gallery-card-small {
width: calc(50% - 5px);
max-width: none;
}
/* PVZ导航:改为Flex布局,一行三个 */
.pvz-navigation {
float: none;
max-width: 100%;
width: 100%;
}
.pvz-navigation .nav-table {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 5px;
width: 100%;
}
.pvz-navigation .nav-table tbody {
display: contents; /* 关键!让tbody不影响flex布局 */
}
.pvz-navigation .nav-table tr {
display: contents; /* 关键!让tr不影响flex布局 */
}
.pvz-navigation .nav-table td {
display: block;
flex: 0 0 calc(33.33% - 5px); /* 固定宽度一行三个 */
width: auto !important;
padding: 4px;
box-sizing: border-box;
}
.pvz-navigation .nav-table td img {
width: 100%;
max-width: 120px;
height: auto;
}
.pvz-navigation .nav-title {
font-size: 1.2em;
}
}
/* 超小屏幕(宽度小于480px)时改为一行一个 */
@media screen and (max-width: 480px) {
.gallery-card,
.gallery-card-small {
width: 100%;
}
}
/* 只有带链接且不在card/轮播内的图片才有悬停放大效果 */
a img {
transition: transform 0.3s ease;
}
a img:hover {
transform: scale(1.08);
z-index: 10;
position: relative;
}
/* 精确排除card模板和轮播图 - 不使用慢速选择器 */
.card a img,
.swiper a img,
.carousel a img,
.slider a img,
.owl-carousel a img,
.flexslider a img {
transition: none;
}
.card a img:hover,
.swiper a img:hover,
.carousel a img:hover,
.slider a img:hover,
.owl-carousel a img:hover,
.flexslider a img:hover {
transform: none;
}
/* === 表格响应式:电脑一行5个,手机自动换行 === */
/* 电脑端:保持原样,固定5列 */
@media screen and (min-width: 769px) {
.responsive-fixed-grid {
width: auto;
margin: 0 auto;
table-layout: fixed;
}
.responsive-fixed-grid td {
width: 20%;
padding: 5px;
text-align: center;
box-sizing: border-box;
}
.responsive-fixed-grid td img {
max-width: 100%;
height: auto;
}
}
/* 手机端:表格变成弹性布局,自动换行 */
@media screen and (max-width: 768px) {
.responsive-fixed-grid {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 5px;
width: 100%;
}
.responsive-fixed-grid tbody,
.responsive-fixed-grid tr {
display: contents;
}
.responsive-fixed-grid td {
display: block;
flex: 0 1 auto;
max-width: calc(33.33% - 6px);
width: auto;
padding: 3px;
text-align: center;
box-sizing: border-box;
}
.responsive-fixed-grid td img {
max-width: 100%;
height: auto;
display: block;
}
}
/* 更小屏幕:一行2个 */
@media screen and (max-width: 480px) {
.responsive-fixed-grid td {
max-width: calc(50% - 5px);
}
}
.responsive-img {
width: 100%;
height: auto;
max-width: 750px;
}
/* 让所有图片都能响应式缩放 */
img {
max-width: 100%;
height: auto;
}
.responsive-two-columns {
padding-left: 50px;
box-sizing: border-box;
}
@media screen and (max-width: 768px) {
.responsive-two-columns {
padding-left: 0 !important;
}
}
/* === 首页表格左偏移(仅电脑端)=== */
@media screen and (min-width: 769px) {
.responsive-two-columns {
margin-left: -50px !important;
}
}
.responsive-img img {
max-width: 100%;
height: auto;
}
/* 等级颜色 */
.bronze-user { color: #CD7F32 !important; font-weight: bold; }
.silver-user { color: #0000FF !important; font-weight: bold; }
.platinum-user { color: #EE82EE !important; font-weight: bold; }
.gold-user { color: #FFD700 !important; font-weight: bold; }
.rainbow-user { color: #FFD700 !important; font-weight: bold; }
/* 状态圆点 */
.user-status-dot {
display: inline-block; width: 8px; height: 8px;
border-radius: 50%; margin-left: 4px; vertical-align: middle;
}
.status-online { background-color: #4CAF50; }
.status-away { background-color: #FF9800; }
.status-offline { background-color: #9E9E9E; }
/* 师徒标签 */
.user-tag {
display: inline-block; font-size: 0.75em; padding: 0px 4px;
margin-left: 4px; border-radius: 3px; vertical-align: middle;
font-weight: normal;
}
.user-tag-mentor { background: #4CAF50; color: white; }
.user-tag-newbie { background: #FF9800; color: white; }
/* 等级图标 */
.user-level-icons {
margin-left: 2px; font-size: 0.9em; vertical-align: middle;
white-space: nowrap;
}
/* 卡片筛选隐藏 */
.pvzhe-card.hidden-card { display: none; }
/* 编辑数昵称标签 */
.user-title-tag {
display: inline-block;
font-size: 0.75em;
padding: 1px 5px;
margin-left: 4px;
border-radius: 4px;
vertical-align: middle;
font-weight: normal;
background: #f0f0f0;
color: #555;
white-space: nowrap;
}
/* 版本更新公告弹窗样式 */
.update-notice-content {
font-family: sans-serif;
color: #333;
}
.update-version {
font-size: 22px;
font-weight: bold;
color: #2c3e50;
margin-bottom: 5px;
text-align: center;
}
.update-date {
font-size: 13px;
color: #888;
text-align: center;
margin-bottom: 15px;
}
.update-notice-content ul {
list-style: none;
padding: 0;
}
.update-notice-content ul li {
padding: 6px 0;
border-bottom: 1px solid #eee;
font-size: 15px;
}
/* 返回顶部按钮 */
#back-to-top {
position: fixed;
bottom: 40px;
right: 30px;
background: #4CAF50;
color: #fff;
border: none;
border-radius: 50%;
width: 45px;
height: 45px;
font-size: 22px;
cursor: pointer;
display: none;
z-index: 9999;
box-shadow: 0 2px 10px rgba(0,0,0,0.3);
transition: opacity 0.3s, transform 0.3s;
}
#back-to-top:hover {
background: #45a049;
transform: scale(1.1);
}
/* 私信系统样式 */
.msg-badge {
position: fixed;
bottom: 20px;
left: 20px;
background: #f44336;
color: #fff;
border-radius: 50%;
width: 20px;
height: 20px;
font-size: 12px;
text-align: center;
line-height: 20px;
cursor: pointer;
z-index: 100001;
display: none;
box-shadow: 0 2px 6px rgba(0,0,0,0.3);
animation: msgPulse 2s infinite;
}
@keyframes msgPulse {
0%, 100% { box-shadow: 0 2px 6px rgba(0,0,0,0.3); }
50% { box-shadow: 0 2px 16px rgba(244,67,54,0.6); }
}
.msg-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.5);
z-index: 100000;
display: flex;
align-items: center;
justify-content: center;
}
.msg-box {
background: #fff;
border-radius: 12px;
padding: 25px;
max-width: 500px;
width: 90%;
max-height: 70vh;
overflow-y: auto;
box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}
.msg-item {
border-bottom: 1px solid #eee;
padding: 10px 0;
}
.msg-sender {
font-weight: bold;
color: #333;
}
.msg-time {
font-size: 11px;
color: #999;
margin-left: 8px;
}
.msg-text {
margin-top: 4px;
color: #555;
word-break: break-word;
}
.msg-actions {
margin-top: 4px;
}
.msg-actions button {
font-size: 11px;
padding: 2px 8px;
margin-right: 5px;
cursor: pointer;
border: 1px solid #ccc;
border-radius: 3px;
background: #f9f9f9;
}
.msg-item.unread {
background: #fffde7;
}
.msg-send-btn {
margin-left: 8px;
font-size: 12px;
padding: 2px 10px;
cursor: pointer;
border: 1px solid #4CAF50;
border-radius: 4px;
background: #4CAF50;
color: #fff;
vertical-align: middle;
}
.msg-send-btn:hover {
background: #45a049;
}
.msg-textarea {
width: 100%;
height: 80px;
padding: 8px;
border: 1px solid #ccc;
border-radius: 6px;
resize: vertical;
font-size: 14px;
margin-top: 10px;
box-sizing: border-box;
}
.msg-loading {
text-align: center;
color: #999;
padding: 20px;
}
/* 好友系统 */
.friend-btn {
margin-left: 8px;
font-size: 12px;
padding: 4px 12px;
cursor: pointer;
border: none;
border-radius: 4px;
color: #fff;
vertical-align: middle;
}
.friend-add-btn { background: #4CAF50; }
.friend-add-btn:hover { background: #45a049; }
.friend-added-btn { background: #2196F3; }
.friend-added-btn:hover { background: #1e88e5; }
.friend-pending-btn { background: #FF9800; cursor: not-allowed; }
.friend-accept-btn { background: #4CAF50; font-size: 11px; padding: 2px 8px; cursor: pointer; border: none; color: #fff; border-radius: 3px; margin-right: 5px; }
.friend-reject-btn { background: #f44336; font-size: 11px; padding: 2px 8px; cursor: pointer; border: none; color: #fff; border-radius: 3px; }
.friend-list-item {
display: inline-block;
margin: 4px 8px 4px 0;
padding: 4px 10px;
background: #f5f5f5;
border-radius: 16px;
font-size: 13px;
}
.friend-list-item a { text-decoration: none; }
.friend-list-item .friend-remove {
margin-left: 6px;
color: #999;
cursor: pointer;
font-size: 14px;
}
.friend-list-item .friend-remove:hover { color: #f44336; }
.friend-request-item {
padding: 8px;
border-bottom: 1px solid #eee;
display: flex;
align-items: center;
justify-content: space-between;
}
.friend-overlay {
position: fixed;
top: 0; left: 0;
width: 100%; height: 100%;
background: rgba(0,0,0,0.5);
z-index: 100000;
display: flex;
align-items: center;
justify-content: center;
}
.friend-dialog {
background: #fff;
border-radius: 12px;
padding: 25px;
max-width: 450px;
width: 90%;
max-height: 70vh;
overflow-y: auto;
box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}
.friend-count {
display: inline-block;
background: #e0e0e0;
color: #555;
border-radius: 12px;
padding: 1px 8px;
font-size: 12px;
margin-left: 6px;
}
/* Wiki 宠物 */
.wiki-pet {
position: fixed;
bottom: 20px;
left: 50px;
z-index: 9998;
cursor: pointer;
user-select: none;
transition: transform 0.2s;
}
.wiki-pet img {
width: 100px;
height: auto;
display: block;
image-rendering: auto;
}
.wiki-pet:hover {
transform: scale(1.1);
}
.wiki-pet:active {
transform: scale(0.95);
}
.wiki-pet.petting {
animation: petBounce 0.6s ease;
}
@keyframes petBounce {
0%, 100% { transform: scale(1); }
30% { transform: scale(1.15) translateY(-10px); }
50% { transform: scale(0.95) translateY(0); }
70% { transform: scale(1.05) translateY(-5px); }
}
.wiki-pet.attacking {
animation: petAttack 0.3s ease;
}
@keyframes petAttack {
0% { transform: scale(1) translateX(0); }
50% { transform: scale(1.1) translateX(-30px); }
100% { transform: scale(1) translateX(0); }
}
.pet-tooltip {
position: absolute;
bottom: 130px;
left: 0;
background: rgba(0,0,0,0.8);
color: #fff;
padding: 6px 12px;
border-radius: 12px;
font-size: 12px;
white-space: nowrap;
opacity: 0;
transition: opacity 0.3s;
pointer-events: none;
}
.wiki-pet:hover .pet-tooltip {
opacity: 1;
}
@media screen and (max-width: 768px) {
.wiki-pet {
bottom: 60px;
left: 10px;
}
.wiki-pet img {
width: 70px;
}
}
/* 好感度面板 */
.pet-affection {
position: absolute;
top: -30px;
left: 0;
background: rgba(0,0,0,0.7);
color: #fff;
padding: 3px 8px;
border-radius: 10px;
font-size: 11px;
white-space: nowrap;
opacity: 0;
transition: opacity 0.3s;
}
.wiki-pet:hover .pet-affection {
opacity: 1;
}
/* 好感度飘出 */
.pet-heart {
position: fixed;
pointer-events: none;
animation: floatUp 1.5s ease-out forwards;
font-size: 20px;
z-index: 9999;
}
@keyframes floatUp {
0% { opacity: 1; transform: translateY(0) scale(1); }
100% { opacity: 0; transform: translateY(-60px) scale(1.5); }
}
/* 升级特效 */
.wiki-pet.level-up {
animation: levelUpGlow 0.8s ease;
}
@keyframes levelUpGlow {
0%, 100% { filter: drop-shadow(0 0 5px gold); }
50% { filter: drop-shadow(0 0 20px gold) brightness(1.3); }
}