/* ============================================================================
 * 巡影织网 · 主题层 V3.0 —— 五套独立设计语言
 * ----------------------------------------------------------------------------
 * 2026-10-28 变更：按产品要求**下线「石墨 graphite」与「深海 ocean」**两款皮肤，
 * 新增「山水 scenery」——一款由风景照 + 程序化风景动画构成的皮肤。
 * 删除时要同步的六处（少一处老用户就会踩到）已全部处理：
 *   theme.css 的 token 块 / skin.css 的结构块 / craft.css 的覆写 /
 *   fonts.css 的注释 / xy-ui.js 的 THEMES 与圆点 / settings.php 的主题卡 /
 *   head.php 内联脚本的旧值兜底。
 *
 * 五套皮肤不再是「换色」，而是五套**独立的设计语言**。
 * 差异落在七个维度，全部由本文件的 token 驱动，style.css 引用变量即完成换肤：
 *
 *   1. 配色系统    —— --neon-* / --dark-* / --text-* / --border-* / --gradient-*
 *   2. 形态刻度    —— --radius-card / --radius-btn / --radius-input / --control-h
 *   3. 字体气质    —— --font-ui / --font-num（专业套用等宽数字，简洁套用系统字）
 *   4. 背景装饰    —— --bg-deco（网格/极光盘/暖阳晕/无装饰）+ body::before/after
 *   5. 辉光强度    —— --glow-strength（0=无光，1=满辉光），专业/简洁套压低
 *   6. 密度        —— --pad-card / --density（scenery 呼吸感最强）
 *   7. 组件异形    —— neon 卡片切角（clip-path）、scenery 宣纸玻璃卡片等
 *
 * 五套定位（用户明确：部分专业性、部分简洁性、部分风格化，提升粘性）：
 *
 *   ▌专业向
 *   neon      赛博指挥舱 —— 主打。动态网格 + 扫描线 + 终端绿辉光 + 等宽数字
 *
 *   ▌简洁向
 *   light     极简白纸  —— 纸面留白：柔影、细边、呼吸感、零装饰
 *
 *   ▌风格化
 *   aurora    深空极光  —— 玻璃拟态：三色极光盘漂移 + 大圆角毛玻璃
 *   sunset    暖阳亲和  —— 超大圆角 + 胶囊按钮 + 暖橙光晕
 *   scenery   山水风景  —— 11 个真实风景场景 + 8 种程序化动画，衬线题签、
 *                          宣纸玻璃卡片、可交互组件数量为其余皮肤 2.5 倍以上
 *
 * 加载顺序：head.php 先 style.css 后本文件 → 本文件优先级更高，可覆盖变量。
 * 防闪烁：head.php 内联脚本在 CSS 解析前把 data-theme 写到 <html>，首屏即正确。
 * ========================================================================== */


/* ============================================================================
 * 基线 token（neon = 默认，不写 data-theme 时生效）
 * style.css 的 :root 已定义基础色，这里补齐形态/字体/装饰 token，
 * 并显式声明一遍，使五套皮肤被覆盖的 token 集合完全对齐、便于对照维护。
 * ========================================================================== */
:root {
    /* —— 形态刻度 —— */
    --radius-card: 14px;
    --radius-btn: 8px;
    --radius-input: 8px;
    --control-h: 40px;

    /* —— 字体气质 V4.0：四级字体栈（display 标题 / ui 正文 / num 数字 / mono 代码）
     * ------------------------------------------------------------------
     * 拉丁字形由 public/fonts/ 下的本地 woff2 提供（见 public/css/fonts.css），
     * 中文一律走系统字体栈 —— 中文字体动辄 5~8MB，绝不能进首屏。
     *
     * 🔴 中文字体栈单独抽成 --font-cjk，五套皮肤共用。
     *    原来每个皮肤里都重复写着 'PingFang SC', 'Microsoft YaHei'，
     *    想加个鸿蒙/MiSans 就得改六处，必然改漏 —— 抽出来只维护一份。
     *
     * 排序依据（按设备影响力）：macOS/iOS 的苹方 → 华为鸿蒙 → 小米 MiSans
     * → 旧版 iOS 冬青 → Windows 雅黑 UI/雅黑 → 开源思源/Noto → Linux 文泉驿。
     * 鸿蒙与 MiSans 都是免费可商用字体，装在对应品牌手机上会自动优先命中。
     * ------------------------------------------------------------------ */
    --font-cjk: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Hiragino Sans GB",
                "Microsoft YaHei UI", "Microsoft YaHei", "Source Han Sans SC",
                "Noto Sans CJK SC", "WenQuanYi Micro Hei", sans-serif;
    --font-cjk-serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC",
                      "STSong", "SimSun", serif;
    --font-display: 'Orbitron', 'Rajdhani', var(--font-cjk);
    --font-ui: 'Rajdhani', var(--font-cjk);
    --font-num: 'Rajdhani', 'JetBrains Mono', 'Consolas', monospace;
    --font-mono: 'JetBrains Mono', 'Consolas', monospace;

    /* —— 辉光强度（0=无 → 1=满）：neon 满辉光 —— */
    --glow-strength: 1;

    /* —— 密度 —— */
    --pad-card: 22px;

    /* —— 布局色 —— */
    --bg-sidebar: linear-gradient(180deg, rgba(8, 8, 18, 0.98), rgba(12, 12, 28, 0.96));
    --header-bg: rgba(10, 10, 22, 0.85);
    --input-bg: rgba(20, 20, 40, 0.6);
    --input-border: rgba(0, 255, 157, 0.25);
    --table-head-bg: rgba(0, 255, 157, 0.08);
    --table-row-hover: rgba(0, 255, 157, 0.06);
    --notice-bg: rgba(0, 255, 157, 0.08);
    --notice-border: rgba(0, 255, 157, 0.35);
    --glass-blur: 20px;
    --glass-opacity: 0.15;
    --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.35);
}


/* ############################################################################
 * ▌ 皮肤一：neon —— 赛博指挥舱（主打 · 专业）
 * ############################################################################
 * 设计语言：这是「巡影织网」的品牌主场。深空黑底 + 终端绿辉光 +
 * 动态网格 + 顶部扫描线 + 等宽数字 + 卡片切角，营造「安全作战指挥室」质感。
 * 装饰与动效全集中在 style.css 末尾的「指挥舱层」（ neon 专属，见该处注释）。
 * ========================================================================== */
html:not([data-theme]),
html[data-theme="neon"] {
    --font-display: 'Orbitron', 'Rajdhani', var(--font-cjk);
    --font-ui: 'Rajdhani', var(--font-cjk);
    --font-num: 'Rajdhani', 'JetBrains Mono', 'Consolas', monospace;
    /* neon 专属等宽：JetBrains Mono 的方直切角最贴赛博朋克 */
    --font-mono: 'JetBrains Mono', 'Consolas', monospace;
    --glow-strength: 1;

    /* —— 粒子配色：数据流星图（供 xy-particles.js 读取）—— */
    --particle-1: #00ff9d;
    --particle-2: #00f5ff;
    --particle-line: rgba(0, 255, 157, 0.14);
}


/* ############################################################################
 * ▌ 皮肤二：light —— 极简白纸（简洁）
 * ############################################################################
 * 设计语言：纸面留白。白底 + 灰发丝边 + 双层柔影 + 零装饰 + 呼吸感排版。
 * 靠「留白与层级」取胜，不用任何发光——这是给「对外展示/新用户」的友好面。
 * 主色用克制的蓝青，取代霓虹绿，避免「黑客风」。
 * ========================================================================== */
html[data-theme="light"] {
    color-scheme: light;
    --dark-bg: #eef1f6;
    --bg-sidebar: linear-gradient(180deg, #ffffff, #f3f5fa);
    --dark-surface: #ffffff;
    --dark-card: #ffffff;
    --dark-card-hover: #f5f7fb;
    --border-subtle: rgba(15, 23, 42, 0.10);
    --border-glow: rgba(14, 165, 233, 0.35);
    --input-bg: #ffffff;
    --input-border: rgba(15, 23, 42, 0.18);
    --header-bg: rgba(255, 255, 255, 0.85);
    --table-head-bg: rgba(14, 165, 233, 0.08);
    --table-row-hover: rgba(14, 165, 233, 0.06);
    --notice-bg: rgba(14, 165, 233, 0.08);
    --notice-border: rgba(14, 165, 233, 0.35);
    --glass-blur: 12px;
    --glass-opacity: 0.65;
    /* 白底用「近距小阴影 + 远距大模糊」两段，比单层更精致不发灰 */
    --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.08);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --neon-green: #0ea5e9;
    --neon-green-glow: rgba(14, 165, 233, 0.25);
    --neon-cyan: #06b6d4;
    --neon-cyan-glow: rgba(6, 182, 212, 0.22);
    --neon-purple: #6366f1;
    --neon-purple-glow: rgba(99, 102, 241, 0.22);
    --neon-pink: #ec4899;
    --neon-pink-glow: rgba(236, 72, 153, 0.20);
    --neon-red: #ef4444;
    --neon-red-glow: rgba(239, 68, 68, 0.22);
    --neon-orange: #f59e0b;
    --neon-orange-glow: rgba(245, 158, 11, 0.22);
    --neon-yellow: #eab308;
    --neon-yellow-glow: rgba(234, 179, 8, 0.22);

    --gradient-primary: linear-gradient(135deg, #0ea5e9, #06b6d4);
    --gradient-danger: linear-gradient(135deg, #ef4444, #dc2626);
    --gradient-warning: linear-gradient(135deg, #eab308, #f59e0b);
    --gradient-info: linear-gradient(135deg, #06b6d4, #6366f1);

    /* —— 白纸形态 token：小圆角 + 柔影 + 零辉光 + 宽松呼吸 —— */
    --radius-card: 12px;
    --radius-btn: 8px;
    --radius-input: 8px;
    --pad-card: 24px;
    --glow-strength: 0;
    /* —— 白纸字体：Lora 衬线（纸墨感）× Inter 中性正文 × IBM Plex Mono 数字 ——
     *    🔴 原来标题栈里**只有中文宋体**，没有衬线拉丁字体：中英混排时
     *    英文走 SimSun 自带的那个很糙的拉丁字形，一半衬线一半怪。
     *    现在 Lora 管拉丁、宋体栈管中文，两边都是衬线，混排才统一。 */
    --font-display: 'Lora', var(--font-cjk-serif);
    --font-ui: 'Inter', var(--font-cjk);
    --font-num: 'IBM Plex Mono', 'Consolas', monospace;
    --font-mono: 'IBM Plex Mono', 'Consolas', monospace;
    /* 无粒子：零装饰纪律 */
}


/* ############################################################################
 * ▌ 皮肤三：aurora —— 深空极光（风格化 · 玻璃拟态）
 * ############################################################################
 * 设计语言：玻璃拟态。大圆角（20px）+ 重模糊（28px）+ 半透明毛玻璃卡片 +
 * 蓝/紫/青三色极光盘在背景缓慢漂移。卡片像浮在星云上的玻璃，最有「氛围感」。
 * ========================================================================== */
html[data-theme="aurora"] {
    --dark-bg: #070b1a;
    --bg-sidebar: linear-gradient(180deg, rgba(10, 15, 35, 0.98), rgba(14, 20, 45, 0.96));
    --dark-surface: rgba(10, 15, 35, 0.95);
    --dark-card: rgba(16, 22, 48, 0.7);
    --dark-card-hover: rgba(24, 32, 66, 0.85);
    --border-subtle: rgba(94, 149, 245, 0.14);
    --border-glow: rgba(94, 149, 245, 0.5);
    --input-bg: rgba(24, 34, 72, 0.45);
    --input-border: rgba(140, 170, 255, 0.22);
    --header-bg: rgba(10, 15, 35, 0.85);
    --table-head-bg: rgba(94, 149, 245, 0.10);
    --table-row-hover: rgba(94, 149, 245, 0.07);
    --notice-bg: rgba(94, 149, 245, 0.08);
    --notice-border: rgba(94, 149, 245, 0.35);
    --glass-blur: 28px;
    --glass-opacity: 0.18;
    --shadow-card: 0 12px 40px rgba(2, 6, 23, 0.55);

    --text-primary: #eaf0ff;
    --text-secondary: rgba(234, 240, 255, 0.78);
    --text-muted: rgba(234, 240, 255, 0.42);

    --neon-green: #5e95f5;
    --neon-green-glow: rgba(94, 149, 245, 0.55);
    --neon-cyan: #22d3ee;
    --neon-cyan-glow: rgba(34, 211, 238, 0.45);
    --neon-purple: #a855f7;
    --neon-purple-glow: rgba(168, 85, 247, 0.45);
    --neon-pink: #f472b6;
    --neon-pink-glow: rgba(244, 114, 182, 0.40);
    --neon-red: #fb7185;
    --neon-red-glow: rgba(251, 113, 133, 0.45);
    --neon-orange: #fbbf24;
    --neon-orange-glow: rgba(251, 191, 36, 0.40);
    --neon-yellow: #fde047;
    --neon-yellow-glow: rgba(253, 224, 71, 0.40);

    --gradient-primary: linear-gradient(135deg, #5e95f5, #22d3ee);
    --gradient-danger: linear-gradient(135deg, #fb7185, #e11d48);
    --gradient-warning: linear-gradient(135deg, #fde047, #fbbf24);
    --gradient-info: linear-gradient(135deg, #22d3ee, #a855f7);

    /* —— 极光形态 token：大圆角 + 重玻璃 + 中辉光 —— */
    --radius-card: 20px;
    --radius-btn: 14px;
    --radius-input: 14px;
    --glow-strength: 0.7;

    /* —— 极光字体：Outfit 圆润现代（与玻璃拟态同气质）
     *    等宽改用 Fira Code：它的 => >= != 有真连字，日志页扫读更快 —— */
    --font-display: 'Outfit', var(--font-cjk);
    --font-ui: 'Outfit', var(--font-cjk);
    --font-num: 'Outfit', 'JetBrains Mono', 'Consolas', monospace;
    --font-mono: 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;

    /* —— 粒子配色：极光尘埃（三色）—— */
    --particle-1: #5e95f5;
    --particle-2: #a855f7;
    --particle-line: rgba(34, 211, 238, 0.10);
}


/* ############################################################################
 * ▌ 皮肤四：sunset —— 暖阳亲和（风格化）
 * ############################################################################
 * 设计语言：超大圆角（22px）+ 胶囊按钮（999px）+ 暖橙/玫粉光晕。
 * 最「软」的一套——亲和力强，给「被安全术语吓到的新用户」一个温暖入口。
 * ========================================================================== */
html[data-theme="sunset"] {
    --dark-bg: #140d0a;
    --bg-sidebar: linear-gradient(180deg, rgba(26, 16, 12, 0.98), rgba(34, 20, 14, 0.96));
    --dark-surface: rgba(26, 16, 12, 0.95);
    --dark-card: rgba(38, 24, 18, 0.7);
    --dark-card-hover: rgba(50, 32, 22, 0.85);
    --border-subtle: rgba(255, 153, 0, 0.14);
    --border-glow: rgba(255, 153, 0, 0.45);
    --input-bg: rgba(58, 36, 24, 0.50);
    --input-border: rgba(255, 170, 80, 0.24);
    --header-bg: rgba(26, 16, 12, 0.85);
    --table-head-bg: rgba(255, 153, 0, 0.10);
    --table-row-hover: rgba(255, 153, 0, 0.07);
    --notice-bg: rgba(255, 153, 0, 0.08);
    --notice-border: rgba(255, 153, 0, 0.35);
    --glass-blur: 18px;
    --glass-opacity: 0.18;
    --shadow-card: 0 14px 40px rgba(20, 8, 2, 0.60);

    --text-primary: #fff4ec;
    --text-secondary: rgba(255, 244, 236, 0.78);
    --text-muted: rgba(255, 244, 236, 0.42);

    --neon-green: #ff9f43;
    --neon-green-glow: rgba(255, 159, 67, 0.50);
    --neon-cyan: #ffd166;
    --neon-cyan-glow: rgba(255, 209, 102, 0.40);
    --neon-purple: #c084fc;
    --neon-purple-glow: rgba(192, 132, 252, 0.40);
    --neon-pink: #ff6b9d;
    --neon-pink-glow: rgba(255, 107, 157, 0.40);
    --neon-red: #ff5252;
    --neon-red-glow: rgba(255, 82, 82, 0.45);
    --neon-orange: #ff8c42;
    --neon-orange-glow: rgba(255, 140, 66, 0.45);
    --neon-yellow: #ffd166;
    --neon-yellow-glow: rgba(255, 209, 102, 0.40);

    --gradient-primary: linear-gradient(135deg, #ff9f43, #ffd166);
    --gradient-danger: linear-gradient(135deg, #ff5252, #e11d48);
    --gradient-warning: linear-gradient(135deg, #ffd166, #ff8c42);
    --gradient-info: linear-gradient(135deg, #ffd166, #c084fc);

    /* —— 暖阳形态 token：超大圆角 + 胶囊按钮 + 中辉光 + 宽松 —— */
    --radius-card: 22px;
    --radius-btn: 999px;
    --radius-input: 14px;
    --pad-card: 26px;
    --glow-strength: 0.7;

    /* —— 暖阳字体：Nunito 圆角无衬线（与胶囊组件同气质）
     *    等宽改用 Space Mono：打字体感的等宽，复古味最正 —— */
    --font-display: 'Nunito', var(--font-cjk);
    --font-ui: 'Nunito', var(--font-cjk);
    --font-num: 'Space Mono', 'JetBrains Mono', 'Consolas', monospace;
    --font-mono: 'Space Mono', 'Consolas', monospace;

    /* —— 粒子配色：黄昏光尘 —— */
    --particle-1: #ffb45e;
    --particle-2: #ff8fa3;
    --particle-line: rgba(255, 159, 67, 0.10);
}


/* ############################################################################
 * ▌ 皮肤五：scenery —— 山水风景（风格化 · 照片 + 程序化动画）
 * ############################################################################
 * 设计语言：把「一幅正在呼吸的风景」铺在整个后台底下。
 *   · 背景不是一张贴图，而是 11 个真实风景场景（海岸/山谷/雪岭/雨林/水下/
 *     云海/湖畔/竹林/峡湾/戈壁/梯田），每个场景再叠 8 种程序化动画原语
 *     （雾气 / 雨丝 / 飘雪 / 气泡 / 光柱 / 星空 / 水光 / 日晕）；
 *   · 字体走「衬线题签 + 人文无衬线正文」：标题用 Lora + 宋体系，像画卷题字；
 *     正文仍用 Inter + 苹方，保证密集数据的可读性（这是后台，不是宣传页）；
 *   · 组件是「宣纸玻璃」：半透明、大圆角、极淡描边、内高光，不做切角也不做
 *     胶囊，投影全部低饱和、无彩色光晕。
 * 结构层见 skin.css，场景层与控制台见 skin-scenery.css。
 * ========================================================================== */
html[data-theme="scenery"] {
    --dark-bg: #0b1620;
    --bg-sidebar: linear-gradient(180deg, rgba(9, 20, 28, 0.92), rgba(9, 20, 28, 0.62));
    --dark-surface: rgba(12, 26, 36, 0.84);
    --dark-card: rgba(20, 38, 48, 0.58);
    --dark-card-hover: rgba(28, 50, 62, 0.70);
    --border-subtle: rgba(255, 255, 255, 0.10);
    --border-glow: rgba(127, 208, 184, 0.52);
    --input-bg: rgba(255, 255, 255, 0.06);
    --input-border: rgba(255, 255, 255, 0.16);
    --header-bg: rgba(9, 20, 28, 0.76);
    --table-head-bg: rgba(255, 255, 255, 0.05);
    --table-row-hover: rgba(255, 255, 255, 0.06);
    --notice-bg: rgba(127, 208, 184, 0.09);
    --notice-border: rgba(127, 208, 184, 0.32);
    --glass-blur: 18px;
    --glass-opacity: 0.58;
    --shadow-card: 0 18px 46px rgba(3, 10, 16, 0.42);

    /* —— 文字：暖白纸色，不用纯白（纯白压在照片上会发灰） —— */
    --text-primary: #f4f1e8;
    --text-secondary: rgba(238, 244, 241, 0.78);
    --text-muted: rgba(238, 244, 241, 0.56);   /* 照片底比纯色底更吃对比，实测 4.86:1 */

    /* —— 自然色板：松石青主色 / 琥珀次色 / 枫红危险 —— */
    --neon-green: #7fd0b8;
    --neon-green-glow: rgba(127, 208, 184, 0.42);
    --neon-cyan: #8ec9d8;
    --neon-cyan-glow: rgba(142, 201, 216, 0.38);
    --neon-purple: #b9a0d0;
    --neon-purple-glow: rgba(185, 160, 208, 0.34);
    --neon-pink: #e6a3b5;
    --neon-pink-glow: rgba(230, 163, 181, 0.32);
    --neon-red: #e2836b;
    --neon-red-glow: rgba(226, 131, 107, 0.40);
    --neon-orange: #e8b96a;
    --neon-orange-glow: rgba(232, 185, 106, 0.38);
    --neon-yellow: #edcf8c;
    --neon-yellow-glow: rgba(237, 207, 140, 0.36);

    --gradient-primary: linear-gradient(135deg, #7fd0b8, #4f9fb8);
    --gradient-danger: linear-gradient(135deg, #e2836b, #c1553f);
    --gradient-warning: linear-gradient(135deg, #f0c987, #dda24f);
    --gradient-info: linear-gradient(135deg, #8ec9d8, #6fa8c8);

    /* —— 形态：大圆角、宽松、低辉光（辉光交给风景本身） —— */
    --radius-card: 18px;
    --radius-btn: 12px;
    --radius-input: 12px;
    --control-h: 40px;
    --pad-card: 24px;
    --glow-strength: 0.3;

    /* —— 字体：画卷题签（衬线）+ 呼吸感正文（几何无衬线）+ 等宽数字
     *    · 标题   Lora（拉丁衬线）× 宋体系（中文衬线）—— 中英都是衬线才不割裂；
     *    · 正文   Manrope —— 开口大、字面疏朗，与风景的留白感同源；
     *             （light 用 Inter，同为无衬线但骨架更紧、更「文档」，两者区分得开）
     *    · 数字   JetBrains Mono —— 监控台必须列对齐，这条是硬约束，不为气质让步 —— */
    --font-display: 'Lora', var(--font-cjk-serif);
    --font-ui: 'Manrope', var(--font-cjk);
    --font-num: 'JetBrains Mono', 'Manrope', 'Consolas', monospace;
    --font-mono: 'JetBrains Mono', 'Consolas', monospace;

    /* —— 粒子：近白微青的空气浮尘（控制台里可关）—— */
    --particle-1: #e8f2ee;
    --particle-2: #cfe4dd;
    --particle-line: rgba(232, 242, 238, 0.07);
}

/* —— 登录页随风景皮肤联动（照片由 login.php 自己提供，这里只对齐色板） —— */
html[data-theme="scenery"] .xy-wrap {
    --xy-bg-0: #0b1620;
    --xy-bg-1: #16303a;
    --xy-panel: rgba(12, 26, 36, 0.86);
    --xy-line: rgba(255, 255, 255, 0.16);
    --xy-accent: #7fd0b8;
    --xy-accent-2: #e8b96a;
    --xy-fg: #f4f1e8;
    --xy-fg-2: #b6c6c2;
}

/* —— 徽标底色：纸白半透 + 极低彩度 —— */
html[data-theme="scenery"] .xy-badge.ok,
html[data-theme="scenery"] .xy-badge.new,
html[data-theme="scenery"] .xy-badge.info,
html[data-theme="scenery"] .xy-file-ext { background: rgba(127, 208, 184, 0.16); }
html[data-theme="scenery"] .xy-badge.changed { background: rgba(232, 185, 106, 0.16); }
html[data-theme="scenery"] .xy-badge.danger  { background: rgba(226, 131, 107, 0.18); }
html[data-theme="scenery"] .xy-badge.muted   { background: rgba(255, 255, 255, 0.10); }
html[data-theme="scenery"] .xy-file-row.is-changed .xy-file-ext { background: rgba(232, 185, 106, 0.16); }
html[data-theme="scenery"] .xy-file-row.is-new .xy-file-ext     { background: rgba(127, 208, 184, 0.16); }


/* ############################################################################
 * 导航布局层（折叠 / 顶部 / 右侧三态）—— 与皮肤无关，保持原有行为
 * ========================================================================== */

/* —— 折叠（纯图标模式）—— */
html[data-nav-collapsed="1"] .sidebar {
    width: 64px;
    flex: 0 0 64px;
    padding-left: 8px;
    padding-right: 8px;
}
html[data-nav-collapsed="1"] .sidebar .brand-text,
html[data-nav-collapsed="1"] .sidebar .nav-label,
html[data-nav-collapsed="1"] .sidebar .sidebar-footer .nav-label {
    display: none;
}
html[data-nav-collapsed="1"] .sidebar .brand-sub { display: none; }
html[data-nav-collapsed="1"] .sidebar .sidebar-brand {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}
html[data-nav-collapsed="1"] .sidebar .sidebar-collapse {
    position: absolute;
    top: 58px; left: 50%; transform: translateX(-50%);
    margin-left: 0;
}
html[data-nav-collapsed="1"] .sidebar .sidebar-collapse.is-collapsed {
    transform: translateX(-50%) rotate(180deg);
}
html[data-nav-collapsed="1"] .sidebar-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}
html[data-nav-collapsed="1"] .sidebar-link .nav-icon { font-size: 19px; }
html[data-nav-collapsed="1"] .app-main { margin-left: 64px; }

/* —— 右侧导航 —— */
html[data-nav="right"] .sidebar {
    left: auto;
    right: 0;
    border-right: none;
    border-left: 1px solid var(--border-subtle);
}
html[data-nav="right"] .app-main {
    margin-left: 0;
    margin-right: var(--sidebar-w);
}
html[data-nav="right"][data-nav-collapsed="1"] .app-main {
    margin-right: 64px;
    margin-left: 0;
}
html[data-nav="right"][data-nav-collapsed="1"] .sidebar .sidebar-collapse { left: 50%; }

/* —— 顶部导航 —— */
html[data-nav="top"] .sidebar {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: auto;
    width: 100%;
    flex-direction: row;
    align-items: center;
    height: 60px;
    padding: 0 18px;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    z-index: 1000;
}
html[data-nav="top"] .sidebar .sidebar-brand {
    border-bottom: none;
    margin-bottom: 0;
    padding: 0 16px 0 0;
}
html[data-nav="top"] .sidebar .sidebar-nav {
    flex-direction: row;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    flex: 1 1 auto;
}
html[data-nav="top"] .sidebar .sidebar-link {
    padding: 8px 12px;
    white-space: nowrap;
}
html[data-nav="top"] .sidebar .sidebar-footer {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    margin-left: auto;
}
html[data-nav="top"] .app-main {
    margin-left: 0;
    margin-top: 60px;
}
html[data-nav="top"] .topbar {
    top: 60px;
    z-index: 980;
}
html[data-nav="top"] .sidebar-toggle { display: none !important; }
html[data-nav="top"] .topbar .header-top .logo-section { display: none; }
html[data-nav="top"] .sidebar-overlay.show { display: block; }
html[data-nav="top"][data-nav-collapsed="1"] .sidebar { width: 100%; flex: 0 0 60px; }
html[data-nav="top"][data-nav-collapsed="1"] .app-main { margin-left: 0; }
html[data-nav="top"][data-nav-collapsed="1"] .sidebar .sidebar-collapse {
    position: static; transform: none; margin-left: auto;
}
html[data-nav="top"][data-nav-collapsed="1"] .sidebar .sidebar-collapse.is-collapsed {
    transform: rotate(180deg);
}
@media (max-width: 900px) {
    html[data-nav="top"] .sidebar { transform: none; }
    html[data-nav="top"] .sidebar-toggle { display: none; }
    html[data-nav="top"] .app-main { margin-left: 0; }
}

/* —— 顶部导航：分组侧栏改横向下拉（2026-10-28 修）——
 * 原 .xy-ngroup/.xy-nbody 只有竖排规则，放进 60px 横向条里会散架（"排版不正常"）。
 * 改为：组头常驻横条，悬停/点击展开为下方的下拉面板。 */
html[data-nav="top"] .sidebar,
html[data-nav="top"] .sidebar-nav { overflow: visible; }
html[data-nav="top"] .xy-ngroup {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: stretch;
}
html[data-nav="top"] .xy-nhead {
    white-space: nowrap;
    border-radius: 8px;
    padding: 0 10px;
    height: 40px;
}
html[data-nav="top"] .xy-nhead__caret,
html[data-nav="top"] .xy-nhead__dot { display: none; }
html[data-nav="top"] .xy-nbody {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 208px;
    padding: 6px;
    background: var(--dark-surface, #10101e);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
    z-index: 1200;
    display: none;
}
html[data-nav="top"] .xy-ngroup.is-open .xy-nbody,
html[data-nav="top"] .xy-ngroup:hover .xy-nbody { display: block; }
html[data-nav="top"] .xy-nbody__in { display: flex; flex-direction: column; gap: 2px; }
html[data-nav="top"] .sidebar-link { justify-content: flex-start; white-space: nowrap; padding: 9px 12px; }

/* 🔴 顶栏回到文档流：原 position:fixed; top:60px 会与下方内容重叠，
   表现为"游离深色条压在内容上"。改 static 后自然把内容推到它下方。 */
html[data-nav="top"] .topbar { position: static; top: auto; }


/* ############################################################################
 * 浅色皮肤可读性补强（ targeted 覆盖，不伤暗色皮肤）
 * ========================================================================== */
html[data-theme="light"] body {
    background-image: none;
    background-color: var(--dark-bg);
}
html[data-theme="light"] .sidebar {
    box-shadow: 0 0 24px rgba(15, 23, 42, 0.08);
}
html[data-theme="light"] .topbar {
    background: var(--header-bg);
    backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--border-subtle);
}
html[data-theme="light"] .card,
html[data-theme="light"] .stat-card,
html[data-theme="light"] .panel {
    border: 1px solid var(--border-subtle);
}
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
    color: var(--text-primary);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
}


/* ############################################################################
 * 交互组件样式（与皮肤无关的基础件）：二次确认弹层 / Toast / 新手引导
 * 皮肤专属的视觉精修在 style.css 末尾的「指挥舱层」按皮肤覆盖。
 * ========================================================================== */

/* —— 二次确认弹层 —— */
.xy-confirm-overlay {
    position: fixed; inset: 0; z-index: 5000;
    background: rgba(0, 0, 0, 0.5);
    display: flex; align-items: center; justify-content: center;
    animation: xy-fade .18s ease;
}
.xy-confirm-box {
    width: min(420px, 90vw);
    background: var(--dark-surface);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-card);
    padding: 22px 24px;
    box-shadow: var(--shadow-card);
    color: var(--text-primary);
}
.xy-confirm-box.danger {
    border-color: var(--neon-red);
    /* 2026-10-25：原来写 `0 0 24px var(--neon-red-glow)` —— 零偏移彩色光晕，
       craft-floor V2 判定为"伪深度"（只发光不产生距离感）。
       改成带偏移的红色投影 + 一圈内描边，既保留危险语义又真的"浮起来"。 */
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.22),
                0 14px 36px rgba(239, 68, 68, 0.20),
                inset 0 0 0 1px color-mix(in srgb, var(--neon-red) 26%, transparent);
}
.xy-confirm-title { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.xy-confirm-msg { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 18px; }
.xy-confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* —— 按钮基础 —— */
.xy-btn {
    border: none; cursor: pointer; border-radius: var(--radius-btn);
    padding: 9px 18px; font-size: 14px; font-weight: 600;
    transition: filter .2s ease, box-shadow .2s ease, color .2s ease, border-color .2s ease, background-color .2s ease, transform .2s ease; font-family: inherit;
    min-height: var(--control-h);
}
.xy-btn-primary { background: var(--gradient-primary); color: #04121a; }
.xy-btn-primary:hover { filter: brightness(1.08); box-shadow: 0 0 calc(16px * var(--glow-strength)) var(--neon-green-glow); }
.xy-btn-danger { background: var(--gradient-danger); color: #fff; }
.xy-btn-danger:hover { filter: brightness(1.08); box-shadow: 0 0 calc(16px * var(--glow-strength)) var(--neon-red-glow); }
.xy-btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border-subtle); }
.xy-btn-ghost:hover { color: var(--text-primary); border-color: var(--border-glow); }

/* —— Toast ——
 * 🔴 2026-10-25：旧的一套（容器 .xy-toast + 条目 .xy-toast-item）已删除。
 *    原因：它与 craft.css 的 .xy-toast（条目）**同名不同义**，后加载的 craft.css
 *    把 opacity:0 覆盖到容器上，导致旧 XY.toast 的反馈完全不可见（32 处调用点）。
 *    Toast 现在只有一条渲染路径：XY_CRAFT.toast（样式见 craft.css 第六节）。
 *    另外旧的 .xy-toast-item 用 border-left: 4px 色条 —— craft-floor 禁令
 *    （彩色 border-left 强调），一并去掉。
 */


/* —— 新手引导 —— */
.xy-tour-overlay { position: fixed; inset: 0; z-index: 5500; background: rgba(0,0,0,0.55); }
.xy-tour-spot {
    position: fixed; z-index: 5501; border-radius: 10px;
    box-shadow: 0 0 0 3px var(--neon-green), 0 0 0 9999px rgba(0,0,0,0.55);
    pointer-events: none;
}
.xy-tour-tip {
    position: fixed; z-index: 5502; width: min(340px, 88vw);
    background: var(--dark-surface); color: var(--text-primary);
    border: 1px solid var(--border-glow); border-radius: var(--radius-card);
    padding: 18px 20px; box-shadow: var(--shadow-card);
}
.xy-tour-step { font-size: 12px; color: var(--neon-cyan); letter-spacing: 1px; margin-bottom: 6px; }
.xy-tour-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.xy-tour-body { font-size: 14px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 16px; }
.xy-tour-actions { display: flex; justify-content: flex-end; gap: 8px; }

@keyframes xy-fade { from { opacity: 0; } to { opacity: 1; } }


/* ############################################################################
 * 顶栏皮肤速切胶囊（2026-10-17 V2 精修）
 * 圆点配色与各皮肤主色对齐，悬浮气泡读出 JS 写入的 title。
 * ========================================================================== */
.xy-theme-quick {
    display: inline-flex; align-items: center; gap: 9px; margin-left: 14px;
    padding: 4px 10px; border-radius: 999px;
    background: rgba(127, 127, 127, 0.08);
    border: 1px solid var(--border-subtle);
}
.xy-theme-dot {
    position: relative;
    /* 命中区 24×24（WCAG 2.2 AA 2.5.8 的指针目标下限），视觉圆点仍是 21px ——
       由 ::before 画，inset 1.5px 内缩，所以外观完全没变，只是可点范围变大了。
       原来自己就是 21px，五个点横排时鼠标要点中全靠运气。 */
    width: 24px; height: 24px;
    padding: 0;
    border: 0;
    background: none;
    border-radius: 50%;
    cursor: pointer;
}
.xy-theme-dot::before {
    content: "";
    position: absolute;
    inset: 1.5px;                      /* 24 - 1.5*2 = 21，视觉尺寸不变 */
    border-radius: 50%;
    border: 2px solid var(--border-subtle);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.xy-theme-dot:hover::before { transform: scale(1.14); }
.xy-theme-dot.active::before {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px var(--border-glow), 0 0 10px var(--border-glow),
                inset 0 0 0 1px rgba(255, 255, 255, 0.25);
    transform: scale(1.12);
}
.xy-theme-dot::after {
    content: attr(title);
    position: absolute; top: calc(100% + 7px); left: 50%;
    transform: translateX(-50%) translateY(-3px);
    padding: 3px 8px; border-radius: 6px; white-space: nowrap;
    font-size: 12px; font-weight: 600; letter-spacing: .5px;
    color: var(--text-primary); background: var(--dark-surface);
    border: 1px solid var(--border-glow);
    box-shadow: var(--shadow-card);
    opacity: 0; pointer-events: none;
    transition: opacity .16s ease, transform .16s ease;
    z-index: 1200;
}
.xy-theme-dot:hover::after,
.xy-theme-dot:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.xy-theme-dot:focus-visible { outline: none; }
/* 五套皮肤速切圆点：与各自主色对齐，一眼可辨
   （底色挪到 ::before 上 —— 元素本体已是透明的 24px 命中区） */
.xy-theme-dot.theme-neon::before { background: linear-gradient(135deg, #00ff9d, #00f5ff); }
.xy-theme-dot.theme-light::before { background: linear-gradient(135deg, #0ea5e9, #cbd5e1); }
.xy-theme-dot.theme-scenery::before { background: linear-gradient(135deg, #7fd0b8, #e8b96a); }
.xy-theme-dot.theme-aurora::before { background: linear-gradient(135deg, #5e95f5, #a855f7); }
.xy-theme-dot.theme-sunset::before { background: linear-gradient(135deg, #ff9f43, #ff6b9d); }


/* ############################################################################
 * 登录页（.xy-wrap）随皮肤联动
 * ========================================================================== */
html[data-theme="light"] .xy-wrap {
    --xy-bg-0:#f1f4f9; --xy-bg-1:#dde5f0;
    --xy-panel:#ffffff; --xy-line:rgba(15,23,42,.12);
    --xy-accent:#0ea5e9; --xy-accent-2:#06b6d4;
    --xy-fg:#0f172a; --xy-fg-2:#475569;
    background:
        radial-gradient(1100px 620px at 12% 18%, #e4ebf5 0%, rgba(228,235,245,0) 62%),
        linear-gradient(158deg, #f1f4f9 0%, #e7edf5 58%, #f1f4f9 100%);
}
html[data-theme="aurora"] .xy-wrap {
    --xy-bg-0:#070b1a; --xy-bg-1:#15224a;
    --xy-panel:#10162f; --xy-line:rgba(94,149,245,.25);
    --xy-accent:#22d3ee; --xy-accent-2:#5e95f5;
    --xy-fg:#eaf0ff; --xy-fg-2:#9fb0d8;
    background:
        radial-gradient(1100px 620px at 12% 18%, #15224a 0%, rgba(21,34,74,0) 62%),
        linear-gradient(158deg, #070b1a 0%, #0c1430 58%, #070b1a 100%);
}
html[data-theme="sunset"] .xy-wrap {
    --xy-bg-0:#140d0a; --xy-bg-1:#3a2416;
    --xy-panel:#261812; --xy-line:rgba(255,153,0,.22);
    --xy-accent:#ff9f43; --xy-accent-2:#ffd166;
    --xy-fg:#fff4ec; --xy-fg-2:#e3c4b0;
    background:
        radial-gradient(1100px 620px at 12% 18%, #3a2416 0%, rgba(58,36,22,0) 62%),
        linear-gradient(158deg, #140d0a 0%, #241710 58%, #140d0a 100%);
}


/* ############################################################################
 * 徽标 / 图标底色按皮肤校正
 * style.css 的 .xy-badge / .xy-file-ext 底色用默认 neon 的低透明霓虹色，
 * 换肤后会与文字色割裂。按皮肤改写成「当前皮肤主色 + 低透明度」。
 * ========================================================================== */
html[data-theme="light"] .xy-badge.ok,
html[data-theme="light"] .xy-badge.new,
html[data-theme="light"] .xy-badge.info,
html[data-theme="light"] .xy-file-ext { background: rgba(14, 165, 233, 0.10); }
html[data-theme="light"] .xy-badge.changed { background: rgba(245, 158, 11, 0.12); }
html[data-theme="light"] .xy-badge.danger  { background: rgba(239, 68, 68, 0.12); }
html[data-theme="light"] .xy-badge.muted   { background: rgba(100, 116, 139, 0.12); }
html[data-theme="light"] .xy-file-row.is-changed .xy-file-ext { background: rgba(245, 158, 11, 0.12); }
html[data-theme="light"] .xy-file-row.is-new .xy-file-ext     { background: rgba(14, 165, 233, 0.12); }



html[data-theme="aurora"] .xy-badge.ok,
html[data-theme="aurora"] .xy-badge.new,
html[data-theme="aurora"] .xy-badge.info,
html[data-theme="aurora"] .xy-file-ext { background: rgba(34, 211, 238, 0.12); }
html[data-theme="aurora"] .xy-badge.changed { background: rgba(253, 224, 71, 0.12); }
html[data-theme="aurora"] .xy-badge.danger  { background: rgba(251, 113, 133, 0.12); }
html[data-theme="aurora"] .xy-badge.muted   { background: rgba(148, 163, 184, 0.14); }
html[data-theme="aurora"] .xy-file-row.is-changed .xy-file-ext { background: rgba(253, 224, 71, 0.12); }
html[data-theme="aurora"] .xy-file-row.is-new .xy-file-ext     { background: rgba(34, 211, 238, 0.12); }

html[data-theme="sunset"] .xy-badge.ok,
html[data-theme="sunset"] .xy-badge.new,
html[data-theme="sunset"] .xy-badge.info,
html[data-theme="sunset"] .xy-file-ext { background: rgba(255, 209, 102, 0.12); }
html[data-theme="sunset"] .xy-badge.changed { background: rgba(251, 191, 36, 0.14); }
html[data-theme="sunset"] .xy-badge.danger  { background: rgba(251, 113, 133, 0.14); }
html[data-theme="sunset"] .xy-badge.muted   { background: rgba(148, 163, 184, 0.14); }
html[data-theme="sunset"] .xy-file-row.is-changed .xy-file-ext { background: rgba(251, 191, 36, 0.14); }
html[data-theme="sunset"] .xy-file-row.is-new .xy-file-ext     { background: rgba(255, 209, 102, 0.14); }
