/* ============================================================
 * NURSX 面板 · 深度通透玻璃皮肤 v15「Deep Glass」
 * ------------------------------------------------------------
 * 加载顺序：… → layout-v14 → layout-v15 → glass-v15（本文件，最后）
 *
 * 三件事：
 *   ① 把底色从「近白」换成「极光网格」——不然后面所有透明度都看不出来：
 *      玻璃只有在有颜色梯度的背景上才成立。
 *   ② 全面降低玻璃面的白色填充、提高模糊与饱和度，并补上内顶高光 /
 *      内底反光 / 极淡描边三层，让面「有厚度」而不是一块半透明白。
 *   ③ 把原先不在玻璃范围内的表面也纳入：页头英雄区、表头表体、
 *      输入控件、弹层遮罩。
 *
 * 覆盖策略：v12 的 --glass-* 定义在 :root，glass-v13 又在
 *          body.has-sidebar / body.auth-body-page 作用域重定义了一次，
 *          所以这里必须用同样（或更具体）的作用域 + 源码序在后，才能盖住。
 *          媒体查询里的同名作用域同样放在文件末尾，避免反过来被盖。
 *
 * 回滚：删除本文件与各页 <link>。
 * ============================================================ */

/* ── 1. 极光网格底色 ─────────────────────────────────────────
 * 仅在没有自定义背景图时接管；用户上传背景（body.user-bg*）仍然优先，
 * 玻璃在照片上依旧是玻璃。
 * `body:not(.user-bg)` 的特异度高于 v10 的 `body`，无需 !important。
 * ------------------------------------------------------------ */
body:not(.user-bg) {
    background-color: #e8ecfb;
    background-image:
        radial-gradient(64% 52% at 8% 2%,   rgba(99, 102, 241, 0.46) 0%, rgba(99, 102, 241, 0) 60%),
        radial-gradient(58% 46% at 96% 6%,  rgba(56, 189, 248, 0.40) 0%, rgba(56, 189, 248, 0) 58%),
        radial-gradient(66% 54% at 84% 96%, rgba(244, 114, 182, 0.30) 0%, rgba(244, 114, 182, 0) 60%),
        radial-gradient(60% 50% at 14% 98%, rgba(45, 212, 191, 0.32) 0%, rgba(45, 212, 191, 0) 58%),
        linear-gradient(168deg, #eef2fe 0%, #e6ebfa 46%, #e9f0fc 100%);
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
}

/* 极光漂移光斑：底色变浓后同步提一点饱和，保持「流动」可感知 */
:root {
    --nd-aurora-1: rgba(99, 102, 241, 0.42);
    --nd-aurora-2: rgba(56, 189, 248, 0.34);
    --nd-aurora-3: rgba(244, 114, 182, 0.20);
}

/* ── 2. 通透玻璃令牌（作用域与 glass-v13 一致，源码序在后 → 生效）── */
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.22);
    --glass-bg-strong: rgba(255, 255, 255, 0.38);
    --glass-border: rgba(255, 255, 255, 0.58);
    --glass-blur: 34px;
    --glass-backdrop: blur(var(--glass-blur)) saturate(190%);
    --glass-shadow: 0 24px 52px -30px rgba(20, 29, 70, 0.42),
                    inset 0 1px 0 rgba(255, 255, 255, 0.72),
                    inset 0 -1px 0 rgba(255, 255, 255, 0.20);
    --glass-shadow-hover: 0 34px 72px -34px rgba(20, 29, 70, 0.48),
                    inset 0 1px 0 rgba(255, 255, 255, 0.85),
                    inset 0 -1px 0 rgba(255, 255, 255, 0.24);
}

/* ── 3. 玻璃面：斜向高光 + 内顶白线 + 极淡描边 ───────────────
 * 比 v13 更透：中间段几乎全透（0.06），只靠高光边和模糊撑出「面」。
 * ------------------------------------------------------------ */
.card, .stat-item, .row-card, .project-item, .modal, .search-bar, .batch-bar,
.alert-box, .alert-info, .alert-warning, .log-row, .tag-filter-bar, .font-dial,
.tilt-card, .record-bar {
    background-image: linear-gradient(148deg,
        rgba(255, 255, 255, 0.50) 0%,
        rgba(255, 255, 255, 0.10) 42%,
        rgba(255, 255, 255, 0.05) 58%,
        rgba(255, 255, 255, 0.28) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78),
                var(--glass-shadow),
                0 0 0 1px rgba(255, 255, 255, 0.34);
}
.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 {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92),
                var(--glass-shadow-hover),
                0 0 0 1px rgba(255, 255, 255, 0.42);
}

/* 表格：表头更亮一档，斑马纹改成「更透 / 更实」的交替而不是灰底色 */
.card table th {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.30));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.60);
}
.card table tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.16); }
.card table tbody tr:hover td { background: rgba(255, 255, 255, 0.44); }

/* ── 4. 输入控件：更薄的白，聚焦时整块提起 ─────────────────── */
input[type="text"], input[type="password"], input[type="number"], input[type="email"],
input[type="search"], input[type="url"], input[type="tel"], select, textarea {
    background: rgba(255, 255, 255, 0.38);
    backdrop-filter: blur(16px) saturate(170%);
    -webkit-backdrop-filter: blur(16px) saturate(170%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62),
                0 3px 12px -8px 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: rgba(255, 255, 255, 0.66);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}
input[type="file"] { background: rgba(255, 255, 255, 0.30); }

/* ── 5. 侧栏 / 顶栏：岛式玻璃（自带外投影，不再是贴边分隔线）── */
body.has-sidebar:not(.user-bg):not(.user-bg-sheer):not(.user-bg-clear) .sidebar {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0.24));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.70),
                inset 0 0 0 1px rgba(255, 255, 255, 0.42),
                0 30px 60px -40px rgba(20, 29, 70, 0.45);
}
body.has-sidebar:not(.user-bg):not(.user-bg-sheer):not(.user-bg-clear) .topbar {
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0.28));
    backdrop-filter: var(--glass-backdrop);
    -webkit-backdrop-filter: var(--glass-backdrop);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72),
                0 0 0 1px rgba(255, 255, 255, 0.38),
                0 20px 44px -32px rgba(20, 29, 70, 0.45);
}

/* 导航项：更透的玻璃片 */
.sb-item {
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.30), rgba(255, 255, 255, 0.07));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.34),
                inset 0 1px 0 rgba(255, 255, 255, 0.44);
}
.sb-item:hover {
    background: rgba(255, 255, 255, 0.62);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.62),
                inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

/* ── 6. 弹层遮罩：整体磨砂，弹层本身仍是玻璃 ───────────────── */
.modal-overlay {
    background-color: rgba(18, 26, 58, 0.28);
    backdrop-filter: blur(10px) saturate(130%);
    -webkit-backdrop-filter: blur(10px) saturate(130%);
}

/* ── 7. 触屏 / 窄屏降级 ─────────────────────────────────────
 * 大半径 backdrop-filter 在低端移动 GPU 上很贵；窄屏与触屏把填充提回
 * 半实心、半径减半，观感仍是玻璃，但不再反复重采样。
 * 放在文件末尾，确保盖住上面同名作用域的声明。
 * ------------------------------------------------------------ */
@media (max-width: 900px), (hover: none) and (pointer: coarse) {
    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.62);
        --glass-bg-strong: rgba(255, 255, 255, 0.80);
        --glass-blur: 16px;
        --glass-backdrop: blur(var(--glass-blur)) saturate(150%);
    }
    .card, .stat-item, .row-card, .project-item, .modal, .search-bar, .batch-bar,
    .alert-box, .alert-info, .alert-warning, .log-row, .tag-filter-bar, .font-dial,
    .tilt-card, .record-bar {
        background-image: linear-gradient(148deg,
            rgba(255, 255, 255, 0.62) 0%,
            rgba(255, 255, 255, 0.34) 50%,
            rgba(255, 255, 255, 0.50) 100%);
    }
    body.has-sidebar:not(.user-bg):not(.user-bg-sheer):not(.user-bg-clear) .sidebar {
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.58));
    }
    body.has-sidebar:not(.user-bg):not(.user-bg-sheer):not(.user-bg-clear) .topbar {
        background: linear-gradient(120deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.60));
    }
}

/* ── 8. 不支持 backdrop-filter 的浏览器：退回半实心，别让文字糊在背景上 ── */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    body:not(.user-bg) { background-image: none; background-color: #eef1fb; }
    .card, .stat-item, .row-card, .project-item, .modal, .search-bar, .batch-bar,
    .alert-box, .alert-info, .alert-warning, .log-row, .tag-filter-bar,
    .tilt-card, .record-bar, .page-head {
        background-color: rgba(255, 255, 255, 0.88);
    }
}

/* ── 9. 无障碍：减弱动态效果 ──────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .card, .stat-item, .row-card, .project-item, .modal, .page-head { transition: none; }
}
