/* 全站体验：顶部加载进度条、回到顶部 / 底部、手机端快速新建（逻辑见 static/js/site-ux.js） */
#siteLoadBar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: var(--z-top); pointer-events: none; opacity: 0; transition: opacity .25s; overflow: hidden; }
#siteLoadBar.on { opacity: 1; }
#siteLoadBar::before { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; border-radius: 3px;
    background: linear-gradient(90deg, rgba(22, 163, 74, 0), #16a34a, #15803d); animation: siteLoad 1.1s ease-in-out infinite; }
@keyframes siteLoad { 0% { left: -40%; } 100% { left: 100%; } }
@media (prefers-reduced-motion: reduce) { #siteLoadBar::before { animation: none; left: 0; width: 100%; opacity: .6; } }

.site-scroll-nav { position: fixed; right: 16px; bottom: calc(20px + var(--sa-bottom)); z-index: var(--z-popover); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.site-scroll-nav button { width: 38px; height: 38px; border-radius: 999px; display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .92); color: #4b5563; border: 1px solid #e5e7eb; box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
    opacity: 0; transform: scale(.8); pointer-events: none; transition: opacity .2s, transform .2s; cursor: pointer; }
.site-scroll-nav button.show { opacity: 1; transform: scale(1); pointer-events: auto; }
.site-scroll-nav button:hover { color: #16a34a; }
.site-scroll-nav svg { width: 18px; height: 18px; }
.site-scroll-nav .site-fab { width: 52px; height: 52px; background: #16a34a; color: #fff; border: 0; box-shadow: 0 8px 20px rgba(22, 163, 74, .35); opacity: 1; transform: none; pointer-events: auto; }
.site-scroll-nav .site-fab:hover { color: #fff; background: #15803d; }
.site-scroll-nav .site-fab svg { width: 22px; height: 22px; }
.site-scroll-nav .site-fab { transition: opacity .2s, transform .2s; }
.site-scroll-nav .site-fab.away { opacity: 0; transform: translateY(24px) scale(.8); pointer-events: none; }
@media (min-width: 768px) { .site-scroll-nav .site-fab { display: none; } }
@media (max-width: 767px) { body.has-site-fab { padding-bottom: 84px; } }
/* 后台「界面标准 → 手机上的「新建」入口」fab：右下角已经有 + 时，顶栏里同样的按钮（data-dup-fab：钱包「记一笔」、网站「新建网站」）手机上不再重复 */
@media (max-width: 767px) { html[data-ui-new-mobile="fab"] body.has-site-fab [data-dup-fab] { display: none !important; } }
html.dark .site-scroll-nav button:not(.site-fab) { background: rgba(15, 23, 42, .92); color: #9ca3af; border-color: #1f2937; }
@media print { #siteLoadBar, .site-scroll-nav { display: none !important; } }
/* 横滑标签栏：还能往哪边滑，哪边渐隐（site-ux.js 的 fadeHint；后台「界面标准 → 横滑标签栏的提示」） */
html:not([data-ui-tabs-hint="page"]) .wl-tabs[data-fade="right"] { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); }
html:not([data-ui-tabs-hint="page"]) .wl-tabs[data-fade="left"] { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 32px), transparent); }
html:not([data-ui-tabs-hint="page"]) .wl-tabs[data-fade="both"] { -webkit-mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent); }

/* 各页面「操作结果」提示（保存成功 / 失败…）始终在站内通知卡片（#hub-toast-stack，z-index 99998）之上：
   刚点的操作的反馈不能被后台推来的通知盖住。仍在顶部加载条之下。 */
#toastContainer, #toast-container, #toast, .wl-toast { z-index: var(--z-toast) !important; }
/* 站内通知卡片（#hub-toast-stack）平时在最上层；有弹窗 / 表单打开时（modal-lock.js 给 html 加 modal-scroll-locked）
   退到遮罩下面，不再盖住正在填写的内容（手机上卡片几乎和屏幕一样宽，会挡住整个表单）。8 秒后照常自动消失。 */
html.modal-scroll-locked #hub-toast-stack { z-index: 1 !important; }
/* 📱 手机底部标签栏（static/js/bottom-nav.js；后台「界面标准 → 手机底部标签栏」tabs）。只在手机上；电脑上不出现 */
.bn-bar, .bn-sheet { display: none; }
@media (max-width: 767px) {
    html.has-bottom-nav .bn-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-sticky); align-items: stretch; justify-content: space-around;
        height: calc(56px + var(--sa-bottom)); padding-bottom: var(--sa-bottom); background: var(--mm-surface, #fff); border-top: 1px solid var(--mm-rule, #e5e7eb); }
    html.dark.has-bottom-nav .bn-bar { background: var(--mm-surface, #111827); border-top-color: var(--mm-rule, #1f2937); }
    .bn-tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--mm-muted, #6b7280); text-decoration: none;
        font-size: calc(10px * var(--ap-scale, 1)); min-width: 0; }
    .bn-tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
    .bn-tab svg { width: 22px; height: 22px; }
    .bn-tab.active { color: var(--mm-action, #16a34a); font-weight: 700; }
    .bn-plus { flex: none; align-self: center; width: 46px; height: 46px; margin: 0 6px; border: 0; border-radius: 999px; background: var(--mm-action, #16a34a); color: var(--mm-on-action, #fff);
        display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px rgba(22, 163, 74, .35); cursor: pointer; }
    .bn-plus svg { width: 24px; height: 24px; stroke-width: 2.4; }
    html.has-bottom-nav body { padding-bottom: calc(64px + var(--sa-bottom)) !important; }
    /* 同一件事只留一个入口：各页右下角自己的「＋」不再显示；回到顶部挪到标签栏上面 */
    html.has-bottom-nav .site-fab, html.has-bottom-nav .compose-fab { display: none !important; }
    html.has-bottom-nav .site-scroll-nav, html.has-bottom-nav .home-scroll-nav { bottom: calc(72px + var(--sa-bottom)) !important; }
    html.has-bottom-nav .bn-sheet:not([hidden]) { display: flex; position: fixed; inset: 0; z-index: var(--z-overlay); background: rgba(0, 0, 0, .4); align-items: flex-end; }
    .bn-sheet-panel { width: 100%; background: var(--mm-surface, #fff); border-radius: 16px 16px 0 0; padding: 8px 8px calc(8px + var(--sa-bottom)); }
    html.dark .bn-sheet-panel { background: var(--mm-surface, #111827); }
    .bn-sheet-item, .bn-sheet-cancel { display: block; width: 100%; text-align: center; padding: 14px; border-radius: 12px; font-size: calc(15px * var(--ap-scale, 1));
        color: inherit; text-decoration: none; background: transparent; border: 0; cursor: pointer; }
    .bn-sheet-item:active { background: rgba(22, 163, 74, .1); }
    .bn-sheet-cancel { margin-top: 4px; color: var(--mm-muted, #6b7280); border-top: 1px solid var(--mm-rule, #f3f4f6); border-radius: 0; }
}
