/* ============================================================
   style/shell.css —— 全站外壳：页脚、自绘滚动条、弹窗关闭按钮
   这个文件在所有页面最后引入（index / 推荐 / 账号 / 后台 / Wiki 都能用）。
   ============================================================ */

/* ---------------- 自绘滚动条 ----------------
   隐藏原生滚动条后，用 fixed 的细条自己画：它不占文档流，
   出现/消失都不会把内容挤一下。 */
html.pf-hide-native {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html.pf-hide-native::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.pf-scrollbar {
    position: fixed;
    top: 0;
    right: 4px;
    z-index: 940;
    width: 10px;
    height: 100vh;
    pointer-events: none;
    opacity: 0;
    transition: opacity 200ms ease-out;
}

.pf-scrollbar.is-on { opacity: 1; }

.pf-scrollbar-thumb {
    position: absolute;
    right: 2px;
    width: 6px;
    min-height: 28px;
    background: rgba(23, 29, 38, .20);
    border-radius: 999px;
    pointer-events: auto;
    cursor: grab;
    transition: background-color 160ms ease-out, width 160ms ease-out;
}

.pf-scrollbar:hover .pf-scrollbar-thumb,
.pf-scrollbar.is-drag .pf-scrollbar-thumb {
    width: 8px;
    right: 1px;
    background: rgba(23, 29, 38, .34);
}

.pf-scrollbar.is-drag .pf-scrollbar-thumb { cursor: grabbing; }

@media (max-width: 700px) {
    .pf-scrollbar { display: none; }
}

/* 弹窗自己锁滚动时，滚动条也一起藏起来 */
html.pf-scroll-lock .pf-scrollbar { opacity: 0 !important; }

/* ---------------- 页脚 ----------------
   内容少：靠 margin-top:auto 顶到视口底部；
   内容多：自动落回内容后面，靠 padding 留出间距。
   不再有分割线，颜色也更淡。 */
body.pf-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.pf-shell > .pf-footer { margin-top: auto; }

.pf-footer {
    flex: none;
    margin: 0;
    padding: 44px 26px 22px;
    text-align: right;
    font-size: 12.5px;
    line-height: 1.7;
    color: #A6ABB4;
    background: none;
    border: 0;
}

/* Wiki 页：默认跟正文走（正文末尾），只有内容不满一屏时才固定到右下角 */
body.wiki-body .pf-footer {
    position: static;
    margin: 0;
    padding: 40px 26px 26px;
    font-size: 12px;
    text-align: right;
}

body.wiki-body .pf-footer.is-pinned {
    position: fixed;
    right: 16px;
    bottom: 10px;
    z-index: 30;
    padding: 0;
    font-size: 11.5px;
    opacity: .85;
    pointer-events: none;
}

.pf-footer p { margin: 0; }

.pf-footer a {
    color: #A6ABB4;
    text-decoration: none;
}

.pf-footer a:hover { color: #7C8390; }

/* ---------------- 弹窗统一关闭按钮 ----------------
   放在面板右上角；点遮罩不再关闭，避免误触。 */
.pf-modal-panel { position: relative; }

.pf-modal-x {
    position: absolute;
    top: 12px;
    right: 12px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    color: var(--pf-text-mute, #8A9099);
    background: none;
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    transition: color 140ms ease-out, background-color 140ms ease-out;
}

.pf-modal-x:hover {
    color: var(--pf-text, #171D26);
    background: var(--pf-surface-sub, #F3F5F7);
}

.pf-modal-x:active { transform: scale(.94); }

.pf-modal-x svg { width: 16px; height: 16px; }

/* 顶部已经有按钮的弹窗（全屏编辑器）不需要再叠一个 */
.pf-modal-panel.is-no-x .pf-modal-x { display: none; }
