MediaWiki:Common.css
外观
注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的更改的影响。
- Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5或Ctrl-R(Mac为⌘-R)
- Google Chrome:按Ctrl-Shift-R(Mac为⌘-Shift-R)
- Edge:按住Ctrl的同时单击刷新,或按Ctrl-F5。
.ccw-topbar {
--ccw-bg: #252930;
--ccw-accent: #4c8dff;
--ccw-accent-hover: #3b78e6;
--ccw-field: #343a45;
--ccw-h: 60px;
background: var(--ccw-bg);
border-radius: 10px;
margin: 0 0 1em;
font-size: 15px;
box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.ccw-topbar-inner {
display: flex;
align-items: center;
gap: 24px;
height: var(--ccw-h);
padding: 0 20px;
}
.ccw-topbar a,
.ccw-topbar a:visited,
.ccw-topbar a.new { color: #e8eaed; text-decoration: none; }
/* Logo */
.ccw-logo { display: flex; align-items: center; gap: 10px; flex: none; font-size: 20px; font-weight: 700; white-space: nowrap; }
.ccw-logo a { color: #fff !important; }
.ccw-logo img { display: block; }
/* 导航:悬停时底部出现高亮条 */
.ccw-nav { display: flex; align-items: stretch; align-self: stretch; flex: none; }
.ccw-nav a {
position: relative;
display: flex;
align-items: center;
padding: 0 16px;
white-space: nowrap;
transition: color .15s, background .15s;
}
.ccw-nav a::after {
content: "";
position: absolute;
left: 16px; right: 16px; bottom: 0;
height: 3px;
border-radius: 3px 3px 0 0;
background: var(--ccw-accent);
transform: scaleX(0);
transition: transform .18s;
}
.ccw-nav a:hover { color: #fff; background: rgba(255,255,255,.05); }
.ccw-nav a:hover::after { transform: scaleX(1); }
/* 搜索区(InputBox) */
.ccw-search { flex: 1; max-width: 380px; margin-left: auto; }
.ccw-search .mw-inputbox-centered { margin: 0 !important; padding: 0 !important; border: 0 !important; background: none !important; text-align: left !important; }
.ccw-search form { position: relative; display: flex; align-items: center; margin: 0; }
.ccw-search .mw-inputbox-input { flex: 1; margin: 0; }
.ccw-search input.searchboxInput,
.ccw-search input[type=search],
.ccw-search input[type=text] {
width: 100% !important;
box-sizing: border-box;
height: 38px;
padding: 0 64px 0 18px;
border: 1px solid transparent;
border-radius: 19px;
background: var(--ccw-field);
color: #fff;
font-size: 14px;
outline: none;
box-shadow: none;
transition: border-color .15s, background .15s;
}
.ccw-search input.searchboxInput::placeholder { color: #8b919c; }
.ccw-search input.searchboxInput:focus {
border-color: var(--ccw-accent);
background: #2c313b;
}
/* 搜索按钮:叠在输入框右侧 */
.ccw-search input[type=submit],
.ccw-search button {
position: absolute;
right: 4px; top: 50%;
transform: translateY(-50%);
height: 30px;
padding: 0 14px;
border: 0;
border-radius: 15px;
background: var(--ccw-accent);
color: #fff;
font-size: 13px;
font-weight: 600;
line-height: 30px;
cursor: pointer;
box-shadow: none;
transition: background .15s;
}
.ccw-search input[type=submit]:hover,
.ccw-search button:hover { background: var(--ccw-accent-hover); }
.ccw-search br { display: none; }
/* 右侧用户区 */
.ccw-user { display: flex; align-items: center; gap: 10px; flex: none; white-space: nowrap; }
.ccw-user a { padding: 7px 16px; border-radius: 18px; transition: background .15s; }
.ccw-user a:first-child:hover { background: rgba(255,255,255,.1); }
.ccw-user a:last-child { background: var(--ccw-accent); color: #fff !important; font-weight: 600; }
.ccw-user a:last-child:hover { background: var(--ccw-accent-hover); }
/* 响应式 */
@media (max-width: 1000px) {
.ccw-nav { display: none; }
}
@media (max-width: 640px) {
.ccw-topbar-inner { gap: 12px; padding: 0 12px; }
.ccw-logo { font-size: 17px; }
.ccw-user a:first-child { display: none; }
}