MediaWiki:Common.css:修订间差异

Plmxs42​(留言 | 贡献)
无编辑摘要
标签:移动版编辑 移动版网页编辑 高级移动版编辑
Plmxs42​(留言 | 贡献)
无编辑摘要
标签:移动版编辑 移动版网页编辑 高级移动版编辑
第1行: 第1行:
/* 这里放置的CSS将应用于所有皮肤 */
/* ===== 时间线年表 ===== */
/* /* ===== 时间线整体样式 ===== */
.timeline-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;margin:0 0 1em}
.timeline {
table.timeline{width:100%;border-collapse:collapse;font-size:0.95em}
    position: relative;
table.timeline th,table.timeline td{border:1px solid #c8ccd1;padding:6px 8px;vertical-align:top}
    max-width: 800px;
table.timeline th{background:#eaecf0;font-weight:bold;white-space:nowrap}
    margin: 0 auto;
table.timeline td.tl-time{white-space:nowrap;width:7em}
    padding: 20px 0;
table.timeline td.tl-source,table.timeline td.tl-topic{width:8em;font-size:0.9em}
}
table.timeline tbody tr:hover td{background:#f8f9fa}
.timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background-color: #1B3A5C;
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
}
.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
    box-sizing: border-box;
}
.timeline-item.left { left: 0; }
.timeline-item.right { left: 50%; }
.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background-color: #FFC107;
    border: 4px solid #00E5FF;
    top: 15px;
    border-radius: 50%;
    z-index: 1;
}
.timeline-item.right::after { left: -10px; }
 
/* ===== 卡片内部样式 ===== */
.timeline-content {
    padding: 15px 20px;
    background-color: #f9f9f9;
    border-radius: 6px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: left !important; /* 强制文字左对齐 */
}


/* ===== 折叠开关:强制 Flex 布局 ===== */
/* ===== 事件信息框 ===== */
.timeline-toggle {
div.event-infobox{float:right;clear:right;width:300px;max-width:100%;box-sizing:border-box;margin:0 0 1em 1.5em;border:1px solid #c8ccd1;background:#f8f9fa;font-size:0.9em;line-height:1.5}
    display: flex !important;  
div.event-infobox .ei-title{background:#eaecf0;border-bottom:1px solid #c8ccd1;padding:8px 10px;font-weight:bold;text-align:center}
    justify-content: space-between !important; /* 标题靠左,箭头靠右 */
div.event-infobox .ei-row{display:flex;border-top:1px solid #eaecf0}
    align-items: flex-start !important;       /* 顶部对齐,防掉落 */
div.event-infobox .ei-row:first-child{border-top:0}
    width: 100% !important;
div.event-infobox .ei-label{flex:0 0 5.5em;padding:6px 8px;background:#f1f3f5;font-weight:bold;color:#54595d}
    text-align: left !important;
div.event-infobox .ei-value{flex:1 1 auto;min-width:0;padding:6px 8px;word-break:break-word}
    cursor: pointer;
    font-weight: bold;
    line-height: 1.5;
    box-sizing: border-box;
}


/* 标题:占据剩余空间,且强制左对齐 */
/* ===== 手机端:信息框通栏、年表可横滑 ===== */
.timeline-title {
@media screen and (max-width:720px){
    flex: 1;
  div.event-infobox{float:none !important;clear:both;width:auto !important;max-width:100% !important;margin:0 0 1em 0 !important}
    text-align: left !important;
  div.event-infobox .ei-label{flex:0 0 4.5em}
    word-break: break-word;
  table.timeline{min-width:620px;font-size:0.9em}
}
}


/* 箭头:绝不压缩,第一行对齐 */
/* ===== 暗色模式(Vector 2022) ===== */
.timeline-arrow {
html.skin-theme-clientpref-night div.event-infobox{background:#27292d;border-color:#54595d}
    flex-shrink: 0; /* 严禁被挤扁或掉落 */
html.skin-theme-clientpref-night div.event-infobox .ei-title{background:#3c4043;border-color:#54595d}
    margin-left: 10px;
html.skin-theme-clientpref-night div.event-infobox .ei-label{background:#33363a;color:#c8ccd1}
    margin-top: 2px; /* 微调使其与第一行文字居中 */
html.skin-theme-clientpref-night div.event-infobox .ei-row{border-color:#3c4043}
    font-size: 0.9em;
html.skin-theme-clientpref-night table.timeline th,html.skin-theme-clientpref-night table.timeline td{border-color:#54595d}
}
html.skin-theme-clientpref-night table.timeline th{background:#3c4043}
 
/* ===== 手机端专属硬核适配 ===== */
@media screen and (max-width: 600px) {
    .timeline::after { left: 20px; } /* 竖线靠左 */
    .timeline-item {
        width: 100% !important;
        left: 0 !important;
        padding-left: 40px !important; /* 给竖线留出空间 */
        padding-right: 10px !important;
    }
    .timeline-item::after {
        left: 10px !important;
        right: auto !important;
    }
    .timeline-content {
        padding: 12px 15px !important;
    }
}