打开/关闭菜单
打开/关闭外观设置菜单
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。

MediaWiki:Common.css

MediaWiki界面页面
秋绘君留言 | 贡献2026年4月2日 (四) 01:16的版本 (撤销秋绘君讨论)的修订版本14750

注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的更改的影响。

  • Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5Ctrl-R(Mac为⌘-R
  • Google Chrome:Ctrl-Shift-R(Mac为⌘-Shift-R
  • Edge:按住Ctrl的同时单击刷新,或按Ctrl-F5
/* ==========================================================================
   1. 系统界面清理 & 基础修正
   ========================================================================== */
#ca-viewsource, #ca-history, #ca-talk {
    display: none !important;
}

pre {
    white-space: pre-wrap;
    overflow-wrap: break-word;
}

.wikitable {
    max-width: 100%;
    margin: 1em 0;
}

/* ==========================================================================
   2. 交互组件:黑幕 (Heimu)
   ========================================================================== */
.heimu, .heimu rt {
    background-color: var(--color-base, #252525);
    color: var(--color-base, #252525);
    text-shadow: none;
    transition: color 0.13s linear, background-color 0.13s linear;
    user-select: none;
}
.heimu a, a .heimu, .new .heimu {
    color: var(--color-base, #252525);
}
span.heimu:hover, span.heimu:active {
    background-color: transparent;
    color: var(--color-base--inverted, #ffffff) !important;
    user-select: text;
}
span.heimu:hover a, a:hover span.heimu { color: var(--color-primary, #add8e6) !important; }

/* ==========================================================================
   3. 现代矩形自适应导航 (核心逻辑)
   ========================================================================== */

/* 3.1 基础显隐逻辑 */
.adaptive-nav input[type="radio"] {
    display: none !important;
}

.nav-content {
    display: none; /* 默认隐藏 */
    overflow: hidden;
    background: var(--color-surface-2, rgba(0, 0, 0, 0.05));
    border-radius: 10px;
    animation: slideIn 0.3s ease-out;
}

/* 3.2 现代卡片按钮样式 (参考图风格) */
.nav-text-btn {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* 文字左对齐 */
    height: 64px;
    padding: 0 24px;
    font-weight: bold;
    font-size: 18px;
    color: #fff;
    border-radius: 10px;
    border: none;
    border-bottom: 4px solid rgba(0, 0, 0, 0.3); /* 3D 厚度 */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    background-size: cover;
    background-position: center;
    z-index: 1;
    box-sizing: border-box;
}

/* 左侧深色渐变遮罩:确保文字可读 */
.nav-text-btn::before {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to right, 
        rgba(0, 0, 0, 0.85) 0%, 
        rgba(0, 0, 0, 0.4) 50%, 
        rgba(0, 0, 0, 0) 100%);
    z-index: -1;
    transition: opacity 0.3s;
}

.nav-text-btn span {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 1px;
    position: relative;
    z-index: 2;
}

/* 3.3 背景颜色与图片预留区 */
.btn-bg-1 { background-color: #1a1a1a; background-image: url(''); border-bottom-color: #000; }
.btn-bg-2 { background-color: #1a1a1a; background-image: url(''); border-bottom-color: #000; }
.btn-bg-3 { background-color: #1a1a1a; background-image: url(''); border-bottom-color: #000; }
.btn-bg-4 { background-color: #1a1a1a; background-image: url(''); border-bottom-color: #000; }

/* 3.4 交互反馈 */
.nav-text-btn:hover::before {
    background: linear-gradient(to right, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.2) 60%, rgba(0, 0, 0, 0) 100%);
}

#game-1:checked ~ .nav-module label[for="game-1"],
#game-2:checked ~ .nav-module label[for="game-2"],
#game-3:checked ~ .nav-module label[for="game-3"],
#game-4:checked ~ .nav-module label[for="game-4"] {
    transform: translateY(3px);
    border-bottom-width: 1px;
    filter: brightness(0.9);
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   4. 自适应分屏逻辑 (PC网格 vs 移动端手风琴)
   ========================================================================== */

/* PC端:横向排列按钮,内容横跨整行 */
@media (min-width: 769px) {
    .adaptive-nav {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
        margin: 20px 0;
    }
    .nav-module { display: contents; }
    .nav-text-btn { grid-row: 1; }
    .nav-content { 
        grid-row: 2; 
        grid-column: 1 / 5; 
        margin-top: 10px;
        border: 1px solid var(--border-color-base, rgba(255, 255, 255, 0.1));
    }

    #game-1:checked ~ .nav-module #content-1,
    #game-2:checked ~ .nav-module #content-2,
    #game-3:checked ~ .nav-module #content-3,
    #game-4:checked ~ .nav-module #content-4 {
        display: block;
    }
}

/* 移动端:按钮堆叠,内容就地展开 */
@media (max-width: 768px) {
    .adaptive-nav { display: block; padding: 0 5px; }
    .nav-module { margin-bottom: 8px; }
    .nav-text-btn { width: 100%; }
    .nav-content {
        border-radius: 0 0 10px 10px;
        margin-top: -4px;
        border: 1px solid rgba(0, 0, 0, 0.1);
        border-top: none;
    }

    /* 移动端特殊:由于 display: contents 失效,直接按顺序显示内容 */
    #game-1:checked ~ .nav-module:nth-of-type(1) #content-1,
    #game-2:checked ~ .nav-module:nth-of-type(2) #content-2,
    #game-3:checked ~ .nav-module:nth-of-type(3) #content-3,
    #game-4:checked ~ .nav-module:nth-of-type(4) #content-4 {
        display: block;
    }
}

/* ==========================================================================
   5. 首页网格与内容样式 (原本保留)
   ========================================================================== */
.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.home-card {
    background: var(--color-surface-1);
    border: 1px solid var(--border-color-base);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
}

.nav-sub-text {
    margin-top: 12px;
    font-weight: 600;
    font-size: 14px;
    color: var(--color-base);
}

@keyframes slideIn { 
    from { opacity: 0; transform: translateY(-5px); } 
    to { opacity: 1; transform: translateY(0); } 
}