/* ============================================================
 * NURSX 面板 · 全透明玻璃皮肤 v16「Aurora Glass」
 * ------------------------------------------------------------
 * 加载顺序：… → layout-v15 → glass-v15 → layout-v16 → glass-v16（本文件，最后）
 *
 * 目标：让「玻璃」成为整个面板的主视觉，而不只是卡片上的一层薄雾。
 *   ① 新配色极光底 —— 玻璃只有在有颜色梯度的背景上才成立；
 *   ② 三层玻璃分级（外壳 / 内容 / 控件），每一层都带内顶高光、
 *      内底反光与极淡描边，让面「有厚度」而不只是一块半透明白；
 *   ③ 覆盖面从卡片扩到：侧栏、顶栏、页头指令条、工具栏、行列表、
 *      表头表体、输入控件、按钮、状态徽标、弹层遮罩、聊天卡片；
 *   ④ 可用性优先：内容面改用「半透明填充 ＋ 白色内高光」造厚度
 *      （底 .22 ＋ 渐变 .40/.10/.04/.28），正文（#0f172a）在最饱和的
 *      极光区也 ≥ 11:1、次级文字（#4e5a74）≥ 4.5:1；外壳层更透
 *      （.28 ~ .60）但导航标题为深色粗体，且每个导航片自带一层更实的
 *      玻璃底；同时把内联写死的浅灰文字（#8b9ab0 / #9aa8bc / #7b8aa0）
 *      压深到可读值，并统一键盘焦点环；
 *   ⑤ 滚动性能（v16.1 修正）：随页面滚动的面一律不挂 backdrop-filter。
 *      背景是 background-attachment: fixed，滚动中模糊面背后的采样区
 *      不断变化，重采样掉帧时整块面会渲染成纯白 —— 即用户看到的
 *      「大量白片」。只有真正视口锚定的面（侧栏 / 顶栏 / 认证壳 /
 *      模态家族）保留真模糊。
 *   ⑥ 降级：窄屏 / 触屏进一步收缩模糊面（内容面显式 none，只提亮
 *      填充）；不支持 backdrop-filter 时按层降级（外壳实心、内容半透），
 *      而不是一律刷白。
*
 * 偏好开关：给 <body> 加 nd-glass-all 可让内容面重新挂上模糊
 *          （观感更「玻璃」，但触屏滚动可能掉帧）——见文末 §15。
 *
 * 层级说明：本文件在 v15 之后，同名作用域「源码序在后即生效」，因此
 *          body.has-sidebar:not(.user-bg…) / body.auth-body-page 这两处
 *          令牌重定义能盖住 v13 与 v15 的定义，无需 !important。
 *
 * 未接管：body.user-bg-clear（完全通透档）。该档会把面板文字整体翻白，
 *        再叠浅色玻璃会直接毁掉对比度；沿用其原有表现更安全。
 *
 * 回滚：删除本文件与各页 <link>。
 * ============================================================ */

/* ── 1. 极光底色（新配色）───────────────────────────────────
 * body::before / ::after 的漂移光斑由 glass-v13 提供，这里只换色板，
 * 不去抢占那两个伪元素。
 * ------------------------------------------------------------ */
:root {
    --nd-aurora-1: rgba(79, 122, 245, 0.44);   /* 靛蓝 */
    --nd-aurora-2: rgba(45, 212, 191, 0.34);   /* 青绿 */
    --nd-aurora-3: rgba(168, 85, 247, 0.24);   /* 紫 */
    --nd-aurora-4: rgba(251, 146, 60, 0.18);   /* 暖橙 */
}

body:not(.user-bg) {
    background-color: #e9eefb;
    background-image:
        radial-gradient(58% 46% at 4% 0%,   rgba(79, 122, 245, 0.44) 0%, rgba(79, 122, 245, 0) 62%),
        radial-gradient(52% 42% at 98% 4%,  rgba(45, 212, 191, 0.34) 0%, rgba(45, 212, 191, 0) 60%),
        radial-gradient(62% 50% at 90% 98%, rgba(168, 85, 247, 0.26) 0%, rgba(168, 85, 247, 0) 62%),
        radial-gradient(56% 46% at 8% 100%, rgba(251, 146, 60, 0.20) 0%, rgba(251, 146, 60, 0) 60%),
        linear-gradient(172deg, #f1f5ff 0%, #e7ecfb 48%, #eef3fd 100%);
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
}

/* ── 2. 玻璃令牌（与 v13/v15 同作用域，源码序在后 → 生效）────── */
body.has-sidebar:not(.user-bg):not(.user-bg-sheer):not(.user-bg-clear),
body.auth-body-page {
    --glass-bg: rgba(255, 255, 255, 0.58);
    --glass-bg-strong: rgba(255, 255, 255, 0.80);
    --glass-border: rgba(255, 255, 255, 0.60);
    --glass-blur: 30px;
    --glass-backdrop: blur(var(--glass-blur)) saturate(180%);
    --glass-shadow: 0 22px 48px -30px rgba(20, 29, 70, 0.40),
                    inset 0 1px 0 rgba(255, 255, 255, 0.74),
                    inset 0 -1px 0 rgba(255, 255, 255, 0.18);
    --glass-shadow-hover: 0 32px 64px -32px rgba(20, 29, 70, 0.46),
                    inset 0 1px 0 rgba(255, 255, 255, 0.88),
                    inset 0 -1px 0 rgba(255, 255, 255, 0.22);

    /* 玻璃上的文字：次级色压深，保证小字也过 AA */
    --ink-2: #3f4a5e;
    --ink-3: #4e5a74;
    --line: rgba(126, 140, 175, 0.26);
    --line-strong: rgba(110, 124, 160, 0.38);
}

/* ── 3. 外壳层：侧栏 / 顶栏（更透，靠内高光撑出「面」）───────── */
body.has-sidebar:not(.user-bg):not(.user-bg-sheer):not(.user-bg-clear) .sidebar {
    background-color: rgba(255, 255, 255, 0.32);
    background-image: linear-gradient(158deg,
        rgba(255, 255, 255, 0.34) 0%,
        rgba(255, 255, 255, 0.14) 54%,
        rgba(255, 255, 255, 0.26) 100%);
    backdrop-filter: blur(26px) saturate(170%);
    -webkit-backdrop-filter: blur(26px) saturate(170%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.70),
                inset 0 0 0 1px rgba(255, 255, 255, 0.36),
                0 0 0 1px rgba(126, 140, 175, 0.10),
                0 30px 60px -40px rgba(20, 29, 70, 0.44);
}

body.has-sidebar:not(.user-bg):not(.user-bg-sheer):not(.user-bg-clear) .topbar {
    background-color: rgba(255, 255, 255, 0.28);
    background-image: linear-gradient(120deg,
        rgba(255, 255, 255, 0.40) 0%,
        rgba(255, 255, 255, 0.16) 58%,
        rgba(255, 255, 255, 0.30) 100%);
    backdrop-filter: var(--glass-backdrop);
    -webkit-backdrop-filter: var(--glass-backdrop);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.70),
                inset 0 0 0 1px rgba(255, 255, 255, 0.34),
                0 0 0 1px rgba(126, 140, 175, 0.10),
                0 20px 44px -32px rgba(20, 29, 70, 0.42);
}

/* 外壳上的次级文字（品牌副名 / 退出登录 / 面包屑）需要更深一档 */
.sb-brand small { color: #3b465e; }
.sb-out { color: #3f4a5e; }
.tbc-b { color: #3f4a5e; }
.tbc-s { color: rgba(78, 90, 116, 0.62); }
.tbc-g { color: #2f3a52; }

/* 导航片 / 侧栏控件：整片玻璃，选中态保持品牌渐变以保证「一眼可见」
 * ⚠ 不在已挂 blur 的外壳里再套一层 blur：嵌套的 backdrop-filter 会各自
 * 建立一个 backdrop root，一个侧栏就是十几个待重绘的模糊层，滚动时
 * 最容易闪成白片。这里只用「半透明填充 ＋ 白色描边」分层。 */
.sb-item {
    background-color: rgba(255, 255, 255, 0.28);
    background-image: linear-gradient(120deg,
        rgba(255, 255, 255, 0.44) 0%,
        rgba(255, 255, 255, 0.16) 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.38),
                inset 0 1px 0 rgba(255, 255, 255, 0.50);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.sb-item:hover {
    background-color: rgba(255, 255, 255, 0.56);
    background-image: none;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.66),
                inset 0 1px 0 rgba(255, 255, 255, 0.78);
}
.sb-item.active {
    background: var(--brand-grad, linear-gradient(135deg, #4f46e5, #7c3aed));
    box-shadow: 0 14px 30px -16px var(--brand-glow, rgba(79, 70, 229, 0.4)),
                inset 0 1px 0 rgba(255, 255, 255, 0.40);
}
.sb-item.active .sb-ico,
.sb-item.active .sb-tx { color: #fff; }

.sb-user {
    background-color: rgba(255, 255, 255, 0.26);
    background-image: linear-gradient(120deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.10));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.40);
}
/* 外壳内的小按钮：不叠加嵌套模糊（理由同上） */
.sb-close, .tb-menu, .tb-mini {
    background-color: rgba(255, 255, 255, 0.50);
    border-color: rgba(255, 255, 255, 0.55);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.bg-fab {
    background-color: rgba(255, 255, 255, 0.62);
    border-color: rgba(255, 255, 255, 0.48);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* 侧栏滚动条：细一点，别在玻璃上留下一道深色带 */
.sb-nav { scrollbar-width: thin; scrollbar-color: rgba(120, 132, 168, 0.34) transparent; }
.sb-nav::-webkit-scrollbar { width: 8px; }
.sb-nav::-webkit-scrollbar-track { background: transparent; }
.sb-nav::-webkit-scrollbar-thumb {
    background: rgba(120, 132, 168, 0.34);
    border-radius: 99px;
}

/* ── 4a. 内容层（随页面滚动）：只用半透明填充，不挂 blur ─────
 * ⚠ 滚动稳定性：会随页面一起滚动的面一律不挂 backdrop-filter。
 * body 的背景是 background-attachment: fixed（glass-v13/v15/v16），
 * 滚动中这些面背后的采样区不断变化，浏览器需要反复重采样；一旦合成
 * 层在重绘间隙丢帧，就会把整块面渲染成纯白（用户看到的「白片」）。
 * 这里改用「半透明底 ＋ 白色渐变 ＋ 内高光」做出玻璃厚度，像素结果
 * 完全确定，不依赖重采样。
 * 不透明度：底 .22 ＋ 渐变 .40/.10/.04/.28，叠合后约 .30 ~ .53；
 * 即使压在最饱和的极光区上，正文（#0f172a）≥ 11:1，次级文字
 * （#4e5a74）≥ 4.5:1，仍是可读的玻璃，而不是一块白板。
 * ------------------------------------------------------------ */
.card, .stat-item, .row-card, .project-item, .search-bar, .batch-bar,
.alert-box, .alert-info, .alert-warning, .log-row, .tag-filter-bar, .font-dial,
.tilt-card, .record-bar, .card-row, .tag-chip, .c-room, .c-input, .c-fcard, .c-bubble {
    background-color: rgba(255, 255, 255, 0.22);
    background-image: linear-gradient(146deg,
        rgba(255, 255, 255, 0.40) 0%,
        rgba(255, 255, 255, 0.10) 46%,
        rgba(255, 255, 255, 0.04) 64%,
        rgba(255, 255, 255, 0.28) 100%);
    border-color: rgba(255, 255, 255, 0.50);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86),
                inset 0 0 0 1px rgba(255, 255, 255, 0.42),
                0 0 0 1px rgba(126, 140, 175, 0.10),
                0 22px 46px -32px rgba(20, 29, 70, 0.40);
}

/* ── 4b. 视口锚定的浮层：不随内容滚动，可以放心用真模糊 ──────
 * 模态 / 上传弹层 / 认证卡 / 自动补全面板的位置由视口或输入框锚定，
 * 背后采样区在滚动时不参与重绘，保留 blur 是安全的。
 * ------------------------------------------------------------ */
.modal, .upload-modal, .auth-card, .autocomplete-panel {
    background-color: rgba(255, 255, 255, 0.62);
    background-image: linear-gradient(146deg,
        rgba(255, 255, 255, 0.74) 0%,
        rgba(255, 255, 255, 0.44) 46%,
        rgba(255, 255, 255, 0.40) 64%,
        rgba(255, 255, 255, 0.68) 100%);
    border-color: rgba(255, 255, 255, 0.54);
    backdrop-filter: blur(18px) saturate(165%);
    -webkit-backdrop-filter: blur(18px) saturate(165%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86),
                inset 0 0 0 1px rgba(255, 255, 255, 0.42),
                0 0 0 1px rgba(126, 140, 175, 0.10),
                0 22px 46px -32px rgba(20, 29, 70, 0.40);
}
.card:hover, .stat-item:hover, .row-card:hover, .project-item:hover,
.search-bar:hover, .batch-bar:hover, .alert-box:hover, .alert-info:hover,
.alert-warning:hover, .log-row:hover, .tag-chip:hover, .c-fcard:hover {
    border-color: rgba(255, 255, 255, 0.70);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.94),
                inset 0 0 0 1px rgba(255, 255, 255, 0.52),
                0 0 0 1px rgba(126, 140, 175, 0.14),
                0 32px 62px -34px rgba(20, 29, 70, 0.46);
}

/* 统计卡的顶部品牌条与数字：拉深一档，玻璃底上更清楚 */
.stat-item::before { opacity: 0.95; }
.stat-item .num { color: #101a33; }
.stat-item .label { color: #3f4a5e; }

/* 卡片内的浅色分隔（标题下沿、行列表分隔）改用玻璃描边 */
.card h3, .card h4, .card h5 { color: #14203c; }
.card p { color: #3f4a5e; }

/* 行列表：键（左）加深、值（右）保持主色，行间加一道玻璃描边 */
.rc-k { color: #4e5a74; }
.rc-v { color: #1c2740; }
.row-card { border-radius: 14px; }
.rc-id { color: #4e5a74; }

/* ── 5. 表格：表头更亮一档，斑马纹用「更透 / 更实」交替 ────── */
.card table th {
    background-color: rgba(255, 255, 255, 0.62);
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.34));
    color: #22304c;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.70),
                inset 0 -1px 0 rgba(126, 140, 175, 0.22);
}
.card table td { color: #1c2740; }
.card table tbody tr:nth-child(even) td { background-color: rgba(255, 255, 255, 0.16); }
.card table tbody tr:hover td { background-color: rgba(255, 255, 255, 0.46); }

/* ── 6. 输入控件：薄白玻璃，聚焦整块提起 ─────────────────────
 * 输入框在文档流里，同样不挂 blur（理由见 4a）。
 * ------------------------------------------------------------ */
input[type="text"], input[type="password"], input[type="number"], input[type="email"],
input[type="search"], input[type="url"], input[type="tel"], select, textarea {
    background-color: rgba(255, 255, 255, 0.56);
    background-image: linear-gradient(160deg, rgba(255, 255, 255, 0.30), rgba(255, 255, 255, 0.10));
    border-color: rgba(140, 154, 188, 0.42);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.66),
                0 3px 12px -9px rgba(20, 29, 70, 0.42);
}
input[type="text"]:focus, input[type="password"]:focus, input[type="number"]:focus,
input[type="email"]:focus, input[type="search"]:focus, input[type="url"]:focus,
input[type="tel"]:focus, select:focus, textarea:focus {
    background-color: rgba(255, 255, 255, 0.84);
    background-image: none;
    border-color: var(--brand, #4f46e5);
    backdrop-filter: none;            /* 覆盖 glass-v15 §4 聚焦态的 blur(20px) */
    -webkit-backdrop-filter: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18),
                inset 0 1px 0 rgba(255, 255, 255, 0.80);
}
input[type="file"] {
    background-color: rgba(255, 255, 255, 0.44);
    border: 1px dashed rgba(140, 154, 188, 0.50);
    border-radius: var(--radius-s, 13px);
    padding: 8px 10px;
}
::placeholder { color: rgba(78, 90, 116, 0.72); }

/* ── 7. 按钮：主色 / 危险色保持实心鲜艳（关键动作必须一眼可见），
 *      次级按钮改成玻璃片。 ------------------------------------ */
.btn-action, .login-btn, .btn-select-mode.active {
    background: var(--brand-grad, linear-gradient(135deg, #4f46e5, #7c3aed));
    color: #fff;
    box-shadow: 0 12px 26px -14px rgba(79, 70, 229, 0.55),
                inset 0 1px 0 rgba(255, 255, 255, 0.32);
}
.btn-danger {
    background-color: rgba(220, 38, 38, 0.92);
    border-color: rgba(220, 38, 38, 0.30);
    color: #fff;
    box-shadow: 0 10px 22px -14px rgba(220, 38, 38, 0.50),
                inset 0 1px 0 rgba(255, 255, 255, 0.26);
}
.btn-warning {
    background-color: rgba(217, 119, 6, 0.92);
    border-color: rgba(217, 119, 6, 0.30);
    color: #fff;
    box-shadow: 0 10px 22px -14px rgba(217, 119, 6, 0.50);
}
.btn-success {
    background-color: rgba(21, 128, 61, 0.92);
    border-color: rgba(21, 128, 61, 0.30);
    color: #fff;
    box-shadow: 0 10px 22px -14px rgba(21, 128, 61, 0.50);
}
.btn-secondary, .btn-info, .btn-copy, .btn-select-mode, .btn-select-all, .btn {
    background-color: rgba(255, 255, 255, 0.50);
    background-image: linear-gradient(150deg, rgba(255, 255, 255, 0.44), rgba(255, 255, 255, 0.16));
    border-color: rgba(140, 154, 188, 0.42);
    color: #23408f;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.70);
}
.btn-secondary:hover, .btn-info:hover, .btn-copy:hover,
.btn-select-mode:hover, .btn-select-all:hover {
    background-color: rgba(255, 255, 255, 0.72);
    background-image: none;
    border-color: rgba(110, 124, 160, 0.50);
    color: #1b3178;
}

/* 状态徽标 / 小控件 / 分段控件：只保留半透明填充，不挂 blur
 * —— 这些元素在列表里成片出现，是「大量白片」的主要来源。
 * 补进 .tag-deletable / .font-dial .fd-btn / .tabs / .role-switch：
 * v12 与 v13 给它们挂了 8~14px 模糊，且都在文档流里。 */
.pst, .star-btn, .sw, .tag-chip, .rc-pill, .svip-badge, .c-tag, .c-chip, .c-st,
.password-toggle, .bg-seg-opt, .bg-mode-opt, .tag-deletable, .font-dial .fd-btn,
.tabs, .role-switch {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* 选项卡 / 角色切换：玻璃片拼成的分段控件（同样不挂 blur） */
.tabs button, .role-switch button {
    background-color: rgba(255, 255, 255, 0.34);
    border-color: rgba(255, 255, 255, 0.46);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.tabs button.active, .role-switch button.active {
    background: var(--brand-grad, linear-gradient(135deg, #4f46e5, #7c3aed));
    color: #fff;
    box-shadow: 0 10px 22px -14px rgba(79, 70, 229, 0.5);
}

/* ── 8. 弹层：遮罩整体磨砂，弹层本身仍是玻璃 ───────────────── */
.modal-overlay {
    background-color: rgba(15, 23, 42, 0.34);
    backdrop-filter: blur(12px) saturate(130%);
    -webkit-backdrop-filter: blur(12px) saturate(130%);
}
.upload-overlay {
    background-color: rgba(15, 23, 42, 0.38);
    backdrop-filter: blur(12px) saturate(130%);
    -webkit-backdrop-filter: blur(12px) saturate(130%);
}

/* ── 9. 认证页（登录 / 注册 / 绑定）：整体玻璃，与外壳同色系 ── */
body.auth-body-page .auth-shell {
    background-color: rgba(255, 255, 255, 0.30);
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.50), rgba(255, 255, 255, 0.22));
    border-color: rgba(255, 255, 255, 0.58);
    backdrop-filter: blur(24px) saturate(170%);
    -webkit-backdrop-filter: blur(24px) saturate(170%);
    box-shadow: 0 34px 76px -44px rgba(15, 23, 42, 0.34),
                0 0 0 1px rgba(126, 140, 175, 0.10),
                inset 0 1px 0 rgba(255, 255, 255, 0.66);
}

/* ── 10. 内联写死的颜色：外科式纠正 ─────────────────────────
 * 样式表里的 !important 胜过元素上的行内声明（行内声明没有 !important），
 * 所以下面几条能盖住 PHP 里拼进 style="" 的硬编码值。
 * ------------------------------------------------------------ */

/* 近白不透明面板 → 玻璃面 */
[style*="#fafcff"], [style*="#f8fafd"], [style*="#fafbfe"], [style*="#eef2f9"] {
    background-color: rgba(255, 255, 255, 0.44) !important;
    background-image: none !important;
}
[style*="background:#fff;"] {
    background-color: rgba(255, 255, 255, 0.52) !important;
    background-image: none !important;
}
/* 冷灰描边 → 中性描边（玻璃边只保留白色内高光） */
[style*="#d9e2f0"], [style*="#e5edf7"] {
    border-color: rgba(140, 154, 188, 0.38) !important;
}
/* 浅灰次要文字 → 压深到可读值 */
[style*="#8b9ab0"], [style*="#9aa8bc"], [style*="#7b8aa0"], [style*="#9ca3af"] {
    color: #4e5a74 !important;
}
/* 硬编码的靛蓝主按钮 → 统一品牌渐变 */
[style*="background:#4f5fd0"] {
    background: var(--brand-grad, linear-gradient(135deg, #4f46e5, #7c3aed)) !important;
    box-shadow: 0 12px 26px -14px rgba(79, 70, 229, 0.52) !important;
}
/* 纯色琥珀告警条 → 玻璃化琥珀 */
[style*="#fff7e6"] {
    background: rgba(245, 158, 11, 0.16) !important;
    border-color: rgba(180, 83, 9, 0.38) !important;
    color: #7c4a03 !important;
}

/* ── 11. 无障碍：键盘焦点环（深浅背景都可见）───────────────── */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--brand, #4f46e5);
    outline-offset: 2px;
}
.sb-item:focus-visible,
.card table a:focus-visible { outline-offset: -2px; }
/* 触屏不显示焦点环，避免点击后残留 */
@media (hover: none) {
    :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
        outline: none;
    }
}

/* ── 12. 窄屏 / 触屏：只保留外壳与浮层的模糊，内容面靠填充 ────
 * 触屏滚动掉帧更严重，而 v13 §12 本来就刻意关掉了内容面的 blur；
 * 这里不再把它要回来（v16 先前版本用 !important 重新打开，是本次
 * 「白片」在移动端的放大器）。内容面统一显式置 none，只把填充提亮
 * 保证可读性。
 * ------------------------------------------------------------ */
@media (max-width: 900px), (hover: none) and (pointer: coarse) {
    body.has-sidebar:not(.user-bg):not(.user-bg-sheer):not(.user-bg-clear) .sidebar,
    body.has-sidebar:not(.user-bg):not(.user-bg-sheer):not(.user-bg-clear) .topbar,
    body.auth-body-page .auth-shell,
    .modal, .upload-modal, .auth-card, .autocomplete-panel {
        backdrop-filter: blur(13px) saturate(155%) !important;
        -webkit-backdrop-filter: blur(13px) saturate(155%) !important;
    }

    .card, .stat-item, .row-card, .project-item, .search-bar, .batch-bar,
    .alert-box, .alert-info, .alert-warning, .log-row, .tag-filter-bar, .font-dial,
    .tilt-card, .record-bar, .card-row, .tag-chip, .tag-deletable, .c-room,
    .c-input, .c-fcard, .c-bubble, .page-head, .btn-secondary, .btn-info, .btn-copy,
    .btn-select-mode, .btn-select-all, .font-dial .fd-btn,
    .tabs, .tabs button, .role-switch, .role-switch button {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    body.has-sidebar:not(.user-bg):not(.user-bg-sheer):not(.user-bg-clear) .sidebar {
        background-color: rgba(255, 255, 255, 0.60);
        background-image: linear-gradient(158deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.46));
    }
    body.has-sidebar:not(.user-bg):not(.user-bg-sheer):not(.user-bg-clear) .topbar {
        background-color: rgba(255, 255, 255, 0.62);
        background-image: linear-gradient(120deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.48));
    }
    .card, .stat-item, .row-card, .project-item, .search-bar, .batch-bar,
    .alert-box, .alert-info, .alert-warning, .log-row, .tag-filter-bar, .font-dial,
    .tilt-card, .record-bar, .card-row, .tag-chip, .c-room, .c-input, .c-fcard, .c-bubble {
        background-color: rgba(255, 255, 255, 0.34);
        background-image: linear-gradient(146deg,
            rgba(255, 255, 255, 0.52) 0%,
            rgba(255, 255, 255, 0.20) 50%,
            rgba(255, 255, 255, 0.12) 66%,
            rgba(255, 255, 255, 0.40) 100%);
    }
    input[type="text"], input[type="password"], input[type="number"], input[type="email"],
    input[type="search"], input[type="url"], input[type="tel"], select, textarea {
        background-color: rgba(255, 255, 255, 0.78) !important;
        background-image: none !important;
    }
    .sb-item {
        background-color: rgba(255, 255, 255, 0.46);
        background-image: none;
    }
}

/* ── 13. 不支持 backdrop-filter：分层降级，而不是一律刷白 ─────
 * 外壳与浮层要遮住滚到底下的内容 → 保持接近不透明；
 * 内容面没有模糊托底也没关系，半透明填充在纯渐变底上依然清晰，
 * 一律刷成 0.92 白才是「白片」在旧浏览器上的成因。
 * ------------------------------------------------------------ */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    body:not(.user-bg) {
        background-image: linear-gradient(172deg, #eef2fd 0%, #e6ecfa 100%);
    }
    /* 外壳 + 视口锚定浮层：接近实心 */
    body.has-sidebar .sidebar,
    body.has-sidebar .topbar,
    body.auth-body-page .auth-shell,
    .modal, .upload-modal, .auth-card, .autocomplete-panel {
        background-color: rgba(255, 255, 255, 0.92);
        background-image: none;
    }
    /* 内容面：半透明填充，保持「玻璃」而不是「白板」 */
    .card, .stat-item, .row-card, .project-item, .search-bar, .batch-bar,
    .alert-box, .alert-info, .alert-warning, .log-row, .tag-filter-bar, .font-dial,
    .tilt-card, .record-bar, .card-row, .tag-chip, .c-room, .c-input, .c-fcard,
    .c-bubble, .page-head {
        background-color: rgba(255, 255, 255, 0.58);
        background-image: none;
    }
    .sb-item { background-color: rgba(255, 255, 255, 0.72); background-image: none; }
    input[type="text"], input[type="password"], input[type="number"], input[type="email"],
    input[type="search"], input[type="url"], input[type="tel"], select, textarea {
        background-color: rgba(255, 255, 255, 0.94);
        background-image: none;
    }
}

/* ── 14. 无障碍：减弱动态效果 ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .card, .stat-item, .row-card, .project-item, .search-bar, .batch-bar,
    .alert-box, .btn-action, .btn-secondary, .btn-info, .btn-danger,
    .btn-success, .btn-warning, .sb-item, .tag-chip { transition: none; }
}

/* ── 15. 偏好开关：内容面重新挂模糊（观感优先）───────────────
 * 默认关闭：内容面不挂 blur 是滚动稳定的前提。
 * 需要「更玻璃」的观感时，给 <body> 加 class="nd-glass-all"：
 *     <body class="has-sidebar nd-glass-all">
 * 恢复后滚动中可能出现重绘抖动，触屏设备不建议开启。
 * ------------------------------------------------------------ */
body.nd-glass-all:not(.user-bg) .card,
body.nd-glass-all:not(.user-bg) .stat-item,
body.nd-glass-all:not(.user-bg) .row-card,
body.nd-glass-all:not(.user-bg) .project-item,
body.nd-glass-all:not(.user-bg) .search-bar,
body.nd-glass-all:not(.user-bg) .batch-bar,
body.nd-glass-all:not(.user-bg) .alert-box,
body.nd-glass-all:not(.user-bg) .alert-info,
body.nd-glass-all:not(.user-bg) .alert-warning,
body.nd-glass-all:not(.user-bg) .log-row,
body.nd-glass-all:not(.user-bg) .tag-filter-bar,
body.nd-glass-all:not(.user-bg) .font-dial,
body.nd-glass-all:not(.user-bg) .tilt-card,
body.nd-glass-all:not(.user-bg) .record-bar,
body.nd-glass-all:not(.user-bg) .card-row,
body.nd-glass-all:not(.user-bg) .c-room,
body.nd-glass-all:not(.user-bg) .c-input,
body.nd-glass-all:not(.user-bg) .c-fcard,
body.nd-glass-all:not(.user-bg) .c-bubble,
body.nd-glass-all:not(.user-bg) .page-head {
    backdrop-filter: blur(16px) saturate(165%);
    -webkit-backdrop-filter: blur(16px) saturate(165%);
}
