MediaWiki:Common.css

From yangwa
Revision as of 08:37, 11 April 2025 by Yangwalab (talk | contribs)

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
/* === 首页专用:将顶部导航整体移到底部 === */
body.page-Main_Page #mw-head,
body.page-Main_Page #p-personal,
body.page-Main_Page #mw-navigation,
body.page-Main_Page #mw-panel {
  position: fixed !important;
  bottom: 0 !important;
  top: auto !important;
  width: 100%;
  z-index: 999;
  background-color: #f8f9fa;
  padding: 10px 20px;
  display: flex !important;
  justify-content: center;
  align-items: center;
  gap: 30px;
  border-top: 1px solid #ddd;
  box-shadow: 0 -2px 5px rgba(0,0,0,0.05);
}

/* 首页:隐藏顶部空白 */
body.page-Main_Page {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* 首页:logo 居中显示并缩放适当 */
body.page-Main_Page .mw-wiki-logo {
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-position: center center !important;
  width: 80px !important;
  height: 80px !important;
  order: -1;
  margin-right: 20px;
}

/* 隐藏 logo 旁边文字 */
body.page-Main_Page .mw-logo-wordmark {
  display: none !important;
}

/* 首页:避免页面内容被底部遮挡 */
body.page-Main_Page #content {
  margin-bottom: 120px !important;
}

/* 首页:将顶部导航固定到底部 */
body.page-Main_Page #mw-head-base,
body.page-Main_Page #mw-panel,
body.page-Main_Page #mw-head,
body.page-Main_Page #p-personal,
body.page-Main_Page #mw-navigation {
  position: fixed !important;
  top: auto !important;
  bottom: 0 !important;
  width: 100%;
  z-index: 999;
  background-color: #f8f9fa;
  padding: 10px 20px;
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 -2px 5px rgba(0,0,0,0.05);
}

/* 首页:内容区底部留白避免被遮挡 */
body.page-Main_Page #content {
  margin-bottom: 150px !important;
}

/* 首页:隐藏 logo 文字(wordmark) */
body.page-Main_Page .mw-logo-wordmark {
  display: none !important;
}

/* 首页:logo 样式优化 */
body.page-Main_Page .mw-wiki-logo {
  background-size: contain !important;
  width: 70px !important;
  height: 70px !important;
  background-repeat: no-repeat !important;
  background-position: center;
}