测试:游戏地图卡片/styles.css
来自EaseCation Wiki
更多操作
/* ===== 游戏地图卡片 v2 样式(纯 inline-block 方案)===== */
/* ---------- 卡片基础样式 ---------- */
.gm2-card {
display: inline-block; /* 像文字一样排列,超宽自动换行 */
width: 260px;
max-width: 100%;
margin: 6px;
padding: 10px;
text-align: center;
vertical-align: top; /* 多行卡片顶部对齐 */
background: #eef2f7;
border-radius: 8px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
box-sizing: border-box;
/* 已删除 transition / :hover 动画 */
}
/* ---------- 图片区域 ---------- */
.gm2-card-image {
display: block;
height: 110px;
overflow: hidden;
margin-bottom: 8px;
border-radius: 4px;
background: rgba(0, 0, 0, 0.02);
text-align: center;
}
.gm2-card-image span,
.gm2-card-image a,
.gm2-card-image figure {
display: block;
height: 100%;
text-align: center;
}
.gm2-card-image img {
display: block;
max-width: 100%;
max-height: 110px;
margin: 0 auto;
object-fit: contain;
border-radius: 4px;
}
.gm2-card-placeholder {
display: block;
height: 110px;
line-height: 110px;
color: #999;
font-size: 13px;
text-align: center;
}
/* ---------- 标题区域 ---------- */
.gm2-card-title {
display: block;
min-height: 20px;
margin-top: 6px;
padding: 0 4px;
font-size: 14px;
font-weight: 600;
font-family: inherit;
color: #333;
text-align: center;
line-height: 1.4;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 100%;
}
/* ---------- 深色模式 ---------- */
@media screen and (prefers-color-scheme: dark) {
.gm2-card {
background: #2a2a2a;
box-shadow: 0 1px 3px rgba(255, 255, 255, 0.04);
border: 1px solid rgba(255, 255, 255, 0.06);
}
.gm2-card-title {
color: #e0e0e0;
}
.gm2-card-image {
background: rgba(255, 255, 255, 0.03);
}
.gm2-card-placeholder {
color: #666;
}
}
/* ---------- 响应式 ---------- */
@media (max-width: 600px) {
.gm2-card {
width: calc(50% - 12px);
margin: 4px;
}
}