/* ==========================================================
   desktop.css — 桌面 / 菜单栏 / 程序坞 / 桌面图标 / 浮动层
   ========================================================== */

#desk{
  position:fixed; inset:0;
  overflow:hidden;
  /* 桌面图标尺寸的基准值（prefs.js 按倍数写内联变量覆盖，不在这写档位） */
  --di-cell:82px;
  --di-art:46px;
  --di-label:76px;
}

/* ---------------- 壁纸 ---------------- */
#wallpaper{
  position:absolute; inset:0;
  background: #dfe3e8;
  overflow:hidden;
}
/* 壁纸图形：用 --zx-zoom 抵消界面缩放，
   保证「文字大小」调到特大时壁纸构图不变形 */
.wp-shape{
  position:absolute;
  border-radius:50%;
  filter: blur(0px);
}
.wp-a{
  width: calc(74vw / var(--zx-zoom, 1)); height: calc(74vw / var(--zx-zoom, 1));
  right: calc(-22vw / var(--zx-zoom, 1)); top: calc(-34vw / var(--zx-zoom, 1));
  background: #eef1f4;
  opacity:.95;
}
.wp-b{
  width: calc(62vw / var(--zx-zoom, 1)); height: calc(62vw / var(--zx-zoom, 1));
  left: calc(-20vw / var(--zx-zoom, 1)); bottom: calc(-30vw / var(--zx-zoom, 1));
  background: #cbd4dc;
  opacity:.75;
}
.wp-c{
  width: calc(46vw / var(--zx-zoom, 1)); height: calc(46vw / var(--zx-zoom, 1));
  left: calc(26vw / var(--zx-zoom, 1)); bottom: calc(-34vw / var(--zx-zoom, 1));
  background: #e7e2d9;
  opacity:.65;
}
.wp-grain{
  position:absolute; inset:0;
  opacity:.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* 用户自己上传的图片壁纸：铺满裁剪，装饰图形收起 */
#wallpaper.wall-custom{
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #1a1c1f;
}
#wallpaper.wall-custom .wp-shape,
#wallpaper.wall-custom .wp-grain{ display:none; }

/* ---------------- 菜单栏 ---------------- */
#menu-bar{
  position:absolute; top:0; left:0; right:0; height: var(--menubar-h);
  display:flex; align-items:center; justify-content:space-between;
  padding:0 8px;
  /* 深色透明：让壁纸从栏里透上来，白字。浅色栏浮在深色壁纸上像贴了一条胶带 */
  background: rgba(14,24,38,.42);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  backdrop-filter: blur(26px) saturate(180%);
  box-shadow: inset 0 -.5px 0 rgba(255,255,255,.10);
  font-size:12.5px; color:rgba(255,255,255,.94);
  z-index:9000;
  -webkit-user-select:none; user-select:none;
}
.mb-left,.mb-right{ display:flex; align-items:center; gap:1px; }
.mb-left{ padding-left:2px; }

.mb-brand{
  display:flex; align-items:center; gap:6px;
  height:19px; padding:0 7px 0 5px; border-radius:4px;
  font-weight:600; font-size:12.5px; letter-spacing:.1px;
}
.mb-brand:hover, .mb-item:hover, .mb-menus .mb-menu:hover{ background: rgba(255,255,255,.16); }
.mb-brand.open, .mb-item.open, .mb-menus .mb-menu.open{ background: rgba(255,255,255,.24); }

.brand-mark{
  width:13px; height:13px; border-radius:50%;
  background: #ff6a2b;
  box-shadow: inset 0 0 0 3.2px rgba(255,255,255,.94), inset 0 0 0 6px #ff6a2b;
  position:relative;
}
.brand-mark::after{
  content:""; position:absolute; inset:0; border-radius:50%;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.18);
}

.mb-menus{ display:flex; align-items:center; gap:1px; }
.mb-menu{
  height:19px; padding:0 8px; border-radius:4px;
  font-size:12.5px; color:rgba(255,255,255,.94);
  display:flex; align-items:center;
}

.mb-item{
  display:flex; align-items:center; gap:5px;
  height:19px; padding:0 7px; border-radius:4px;
  font-size:12px; color:rgba(255,255,255,.94);
}
.mb-item .ic{ width:13.5px; height:13.5px; stroke-width:1.3; }
.mb-clock{ font-variant-numeric: tabular-nums; letter-spacing:.1px; }
.mb-sync .sync-ok{ color:#5ee08c; }
.mb-sync.syncing .ic{ color:#7cc0ff; animation: spin 1.1s linear infinite; }
@keyframes spin{ to{ transform: rotate(360deg); } }

.mb-alert{ position:relative; }
/* 红点要让开图标本体：压在上面等于把铃铛挡了 */
.alert-dot{
  position:absolute; top:-1px; right:-2px;
  min-width:11px; height:11px; padding:0 3px;
  border-radius:6px; background: var(--red); color:#fff;
  font-size:8px; font-weight:650; line-height:11px; text-align:center;
  box-shadow: 0 0 0 1.5px rgba(14,24,38,.72);
}

.mb-account{ gap:5px; padding-right:6px; }
.ic-caret{ width:9px; height:9px; stroke-width:1.8; color: rgba(255,255,255,.55); }

/* 这两处文字由 app-kit 定义（深色字），在深色栏里要提权盖回来 */
#menu-bar .mb-appname{ color:rgba(255,255,255,.94); }
#menu-bar .acc-name{ color:rgba(255,255,255,.94); }
#menu-bar .brand-text{ letter-spacing:.2px; }

/* ---------------- 下拉菜单 ---------------- */
.menu-pop{
  position:fixed; z-index:9500;
  min-width:196px; padding:4px;
  background: var(--material-pop);
  -webkit-backdrop-filter: blur(34px) saturate(180%);
  backdrop-filter: blur(34px) saturate(180%);
  border-radius:7px;
  box-shadow: var(--sh-pop);
  font-size:13px;
}
.menu-pop[hidden]{ display:none; }
.mp-item{
  display:flex; align-items:center; gap:8px;
  height:23px; padding:0 9px; border-radius:4px;
  font-size:13px; color:#1d1d1f; width:100%;
}
.mp-item .mp-key{ margin-left:auto; font-size:11.5px; color: var(--ink-3); letter-spacing:.4px; }
.mp-item:hover{ background: var(--accent); color:#fff; }
.mp-item:hover .mp-key{ color: rgba(255,255,255,.72); }
.mp-item.disabled{ color: var(--ink-4); pointer-events:none; }
.mp-item.checked::before{
  content:"✓"; position:absolute; margin-left:-13px; font-size:11px;
}
.mp-item{ position:relative; }
.mp-sep{ height:.5px; background: rgba(0,0,0,.11); margin:4px 8px; }
.mp-head{ font-size:11px; color: var(--ink-3); padding:3px 9px 4px; }

/* ---------------- 桌面图标 ----------------
   尺寸全部由三个变量驱动，档位由 prefs.js 写在 #desk 的内联样式上：
     --di-cell   图标格宽度（决定列宽）
     --di-art    图标本体边长
     --di-label  名称标签最大宽度
   这样「显示 → 图标大小」只改三个数，不碰任何布局代码。 */
#desktop-icons{
  position:absolute;
  top: calc(var(--menubar-h) + 10px);
  right: 10px;
  height: calc(100% - var(--menubar-h) - var(--dock-h) - 46px);
  display:flex; flex-direction:row-reverse; align-items:flex-start;
  gap: 0;
  z-index:5;
}
/* 每列竖向排；列数由 desktop.js 量完高度后决定（装不下就向左再开一列） */
.di-col{
  height:100%;
  display:flex; flex-direction:column;
  gap:4px 0;
  min-width: var(--di-cell);
}
.dicon{
  width:var(--di-cell); padding:4px 2px 5px; border-radius:7px;
  display:flex; flex-direction:column; align-items:center; gap:3px;
  cursor:default; flex:0 0 auto;
}
.dicon:hover .di-art{ filter:brightness(1.04); }
.dicon.sel{ background:rgba(255,255,255,.20); box-shadow:inset 0 0 0 .5px rgba(255,255,255,.26); }
.di-art{
  width:var(--di-art); height:var(--di-art);
  border-radius:calc(var(--di-art) * .25);
  display:flex; align-items:center; justify-content:center; position:relative;
  box-shadow:0 3px 9px rgba(0,0,0,.28), inset 0 0 0 .5px rgba(255,255,255,.16);
}
.di-art.app-icon svg{ width:calc(var(--di-art) * .52); height:calc(var(--di-art) * .52); }
.di-label{
  font-size:11px; line-height:1.2; text-align:center; color:#fff;
  text-shadow:0 1px 2px rgba(0,0,0,.5);
  max-width:var(--di-label); padding:0 3px; border-radius:3px;
  word-break:break-all;
}
.dicon.sel .di-label{ background:var(--accent); text-shadow:none; }

/* 文件型图标（纸张造型） */
.file-art{ background:transparent; box-shadow:none; }
.file-art .fa-body{
  width:calc(var(--di-art) * .83); height:var(--di-art);
  background:#fff; border-radius:5px;
  box-shadow:0 3px 9px rgba(0,0,0,.28), 0 0 0 .5px rgba(0,0,0,.08);
  display:flex; align-items:flex-end; justify-content:center;
  padding-bottom:6px; overflow:hidden;
}
.file-art .fa-ext{ font-size:8.5px; font-weight:700; letter-spacing:.3px; color:#8e8e93; text-transform:uppercase; }
.file-art .fa-tab{ position:absolute; left:50%; transform:translateX(-50%); top:9px; width:24px; height:4px; border-radius:2px; opacity:.92; }

/* 换成自己的图片壁纸时，白色名称要压得住照片 */
#desk[data-wall="custom"] .di-label{
  text-shadow:0 1px 3px rgba(0,0,0,.8), 0 0 3px rgba(0,0,0,.55);
}

/* ---------------- 程序坞 ---------------- */
#dock-wrap{
  position:absolute; left:50%; bottom: var(--dock-bottom);
  transform: translateX(-50%);
  z-index:8800;
  transition: bottom .22s cubic-bezier(.22,.61,.36,1);
}
#dock{
  display:flex; align-items:flex-end; gap:6px;
  height: 68px;
  padding: 0 7px 6px;
  border-radius: 22px;
  background: var(--material-dock);
  -webkit-backdrop-filter: blur(30px) saturate(190%);
  backdrop-filter: blur(30px) saturate(190%);
  box-shadow: var(--sh-dock);
  border: .5px solid rgba(255,255,255,.5);
}.dock-item{
  flex:0 0 auto;
  align-self:flex-end;
  margin-bottom:2px;
}
.dock-item .dock-art{
  width:100%; height:100%; border-radius:24%;
  display:flex; align-items:center; justify-content:center;
  box-shadow: 0 3px 7px rgba(0,0,0,.20), inset 0 .5px 0 rgba(255,255,255,.45);
  overflow:hidden;
}
.dock-item .dock-art svg{ width:30px; height:30px; fill:none; stroke:#fff; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.dock-item .dock-dot{
  position:absolute; bottom:-5px; left:50%; transform:translateX(-50%);
  width:4px; height:4px; border-radius:50%;
  background: rgba(0,0,0,.55); opacity:0;
}
.dock-item.running .dock-dot{ opacity:1; }
.dock-sep{ width:1px; height:40px; background: rgba(0,0,0,.13); margin:0 3px 8px; flex:0 0 auto; align-self:flex-end; }

/* 长按拖动排序：被提起的那枚跟手并抬起来，其它图标给它让位 */
#dock.editing .dock-item{ transition:transform .18s cubic-bezier(.22,.61,.36,1); }
#dock.editing .dock-item.lifted{ transition:none; z-index:30;
  filter:drop-shadow(0 10px 18px rgba(0,0,0,.34)); cursor:grabbing; }
#dock.editing .dock-sep{ opacity:.4; }

/* 悬停气泡的样式统一在 app-kit.css（坞的成品样式都在那一份里） */

/* Dock 最小化缩略 */
.dock-mini{
  width:100%; height:100%; border-radius:24%;
  background:#f2f2f5; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.14), 0 3px 7px rgba(0,0,0,.18);
  display:flex; flex-direction:column; gap:2px; padding:5px 4px; overflow:hidden;
}
.dock-mini i{ display:block; height:2px; border-radius:1px; background: rgba(0,0,0,.18); }
.dock-mini i:first-child{ height:5px; background: rgba(0,0,0,.10); }

/* ---------------- 桌面组件（自由摆放的卡片 + 一枚入口） ----------------
   这一块的两条设计约束，改样式时别破坏：

   ① 卡片不许有外层容器。以前是「一块白面板里套白卡片」，两层白
      叠在深色壁纸上就是一块白砖，跟桌面完全不相干。现在每个卡片
      自己就是玻璃：低透明度 + 强模糊 + 一圈极淡高光，壁纸透上来，
      看起来是「浮在桌上的信息」而不是「贴在桌上的窗口」。
   ② 视觉只有一套。所有卡片都由 widgets.js 用同一段结构渲染，功能
      只提供数据。想改组件长相，只改这里。
   ------------------------------------------------------------------- */
#widget-layer{ position:absolute; inset:0; pointer-events:none; z-index:20;
  /* 玻璃色板只在这里调：想更透 / 更淡，改这两个值即可，卡片和面板都跟着变 */
  --wg-bg:rgba(26,29,35,.44);
  --wg-bg-hi:rgba(30,34,41,.56);
}
.wg-stage{ position:absolute; inset:0; pointer-events:none; }
.wg-stage[hidden]{ display:none; }

/* 入口：一枚深色玻璃胶囊。
   早先是「白底 + 黑字 + 边框」，在照片壁纸上就是一块贴上去的网页按钮，
   现在反过来做：底色比壁纸更暗、靠模糊吃壁纸的颜色，只在边缘留一道
   极淡的高光——它属于桌面，不像控件。平时半透明，鼠标靠近才亮起来。 */
/* 一颗胶囊两段：左「组件」展开/收起，右「齿轮」进管理面板。
   安静是默认状态：不悬停时压成一层淡影，鼠标靠近才浮起来。
   淡影只靠底色 alpha 表达，绝不叠 opacity——两层相乘会让背后的组件标题透上来。 */
.wg-fab-wrap{
  position:absolute; left:18px; top:calc(var(--menubar-h) + 12px); z-index:40;
  pointer-events:auto; display:flex; align-items:center; height:28px;
  border-radius:14px; background:rgba(22,24,29,.50);
  -webkit-backdrop-filter:blur(28px) saturate(175%);
  backdrop-filter:blur(28px) saturate(175%);
  box-shadow:0 1px 1px rgba(0,0,0,.04), 0 5px 16px rgba(0,0,0,.12),
             inset 0 .5px 0 rgba(255,255,255,.12), inset 0 0 0 .5px rgba(255,255,255,.08);
  color:rgba(255,255,255,.74); font-size:11.5px; font-weight:550; letter-spacing:.2px;
  transition:background .18s, box-shadow .18s, transform .18s, color .18s;
}
.wg-fab-wrap:hover{ background:rgba(30,33,40,.94); color:#fff; transform:translateY(-1px);
  box-shadow:0 2px 4px rgba(0,0,0,.10), 0 10px 24px rgba(0,0,0,.22),
             inset 0 .5px 0 rgba(255,255,255,.22), inset 0 0 0 .5px rgba(255,255,255,.14); }
.wg-fab-wrap:active{ transform:translateY(0) scale(.98); }
/* 面板开着时保持亮，不让「正在操作」的对象也隐进背景 */
.wg-fab-wrap.on{ background:rgba(30,33,40,.94); color:#fff;
  box-shadow:0 2px 4px rgba(0,0,0,.10), 0 10px 24px rgba(0,0,0,.24),
             inset 0 .5px 0 rgba(255,255,255,.24), inset 0 0 0 .5px rgba(255,255,255,.16); }

/* 两段共用同一块玻璃底，中间一条细缝提示「这里是另一个动作」 */
.wg-fab{ display:flex; align-items:center; gap:6px; height:28px; padding:0 8px 0 9px;
  border:0; border-radius:14px 0 0 14px; background:transparent;
  color:inherit; font:inherit; letter-spacing:inherit; cursor:pointer; }
.wg-fab-ico{ display:flex; position:relative; }
.wg-fab-ico svg{ width:13.5px; height:13.5px; fill:none; stroke:currentColor;
  stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.wg-fab-label{ line-height:1; }

/* 设置段：只剩一枚齿轮，靠分隔线和留白融入同一颗胶囊；hover 才浮出圆形底 */
.wg-fab-set{ display:flex; align-items:center; justify-content:center;
  width:30px; height:28px; padding:0;
  border:0; border-left:.5px solid rgba(255,255,255,.13); border-radius:0 14px 14px 0;
  background:transparent; color:inherit; cursor:pointer;
  transition:color .15s, background .15s; }
.wg-fab-set:hover{ color:#fff; }
.wg-fab-set:hover .wg-fab-set-ico{ background:rgba(255,255,255,.13); }
.wg-fab-set-ico{ display:flex; align-items:center; justify-content:center;
  width:19px; height:19px; border-radius:50%; transition:background .15s; }
.wg-fab-set-ico svg{ width:12px; height:12px; fill:none; stroke:currentColor;
  stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }

/* 收起态：比默认再淡一档，图标上划一道斜杠——「这些组件现在看不到」 */
.wg-fab-wrap.off{ background:rgba(22,24,29,.34); color:rgba(255,255,255,.52); }
.wg-fab-wrap.off:hover{ background:rgba(30,33,40,.90); color:#fff; }
.wg-fab-wrap.off .wg-fab-ico::after{
  content:""; position:absolute; left:-2px; right:-2px; top:50%; height:1.3px;
  background:currentColor; opacity:.8; border-radius:1px; transform:rotate(-40deg);
}

/* ---- 卡片：一块玻璃，没有壳 ---- */
.wg-card{
  position:absolute; width:236px; pointer-events:auto; outline:none;
  padding:10px 11px 11px; border-radius:14px;
  background:var(--wg-bg);
  -webkit-backdrop-filter:blur(30px) saturate(165%);
  backdrop-filter:blur(30px) saturate(165%);
  box-shadow:0 1px 2px rgba(0,0,0,.10), 0 12px 30px rgba(0,0,0,.20),
             inset 0 0 0 .5px rgba(255,255,255,.10);
  color:rgba(255,255,255,.94);
  cursor:grab; touch-action:none;
  -webkit-user-select:none; user-select:none;
  transition:background .16s, box-shadow .16s, transform .12s;
}
.wg-card:hover{ background:var(--wg-bg-hi);
  box-shadow:0 2px 4px rgba(0,0,0,.12), 0 16px 38px rgba(0,0,0,.26),
             inset 0 0 0 .5px rgba(255,255,255,.14); }
.wg-card:focus-visible{ box-shadow:0 0 0 2px rgba(120,170,255,.75), 0 12px 30px rgba(0,0,0,.20); }
.wg-card.drag{ cursor:grabbing; transform:scale(1.02);
  box-shadow:0 22px 50px rgba(0,0,0,.34), inset 0 0 0 .5px rgba(255,255,255,.18); }

.wc-top{ display:flex; align-items:center; gap:6px; }
.wc-ico{ width:16px; height:16px; border-radius:5px; flex:0 0 auto; display:flex; align-items:center; justify-content:center;
  box-shadow:inset 0 0 0 .5px rgba(255,255,255,.22); }
.wc-ico svg{ width:10.5px; height:10.5px; fill:none; stroke:#fff; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.wc-name{ font-size:11.5px; font-weight:600; color:rgba(255,255,255,.94); }
.wc-badge{ margin-left:auto; font-size:9px; color:rgba(255,255,255,.58); background:rgba(255,255,255,.10);
  padding:0 5px; line-height:15px; border-radius:6px; }

.wc-big{ display:flex; align-items:baseline; gap:6px; margin-top:5px; }
.wc-big b{ font-size:21px; font-weight:650; letter-spacing:-.5px; line-height:1.2; color:#fff; font-variant-numeric:tabular-nums; }
.wc-big em{ font-style:normal; font-size:10.5px; font-weight:600; color:rgba(255,255,255,.6); }
.wc-big em.up{ color:#ff7a72; }    /* 涨 → 红（国内习惯） */
.wc-big em.down{ color:#5ad07f; }  /* 跌 → 绿 */
.wc-big em.bad{ color:#ff7a72; }

.wc-lead{ margin-top:6px; font-size:12.5px; font-weight:600; color:#fff; letter-spacing:.1px; }

.wc-rows{ margin-top:5px; }
.wc-row{ display:flex; align-items:baseline; gap:6px; font-size:10.5px; line-height:1.85; color:rgba(255,255,255,.52); }
.wc-row b{ margin-left:auto; max-width:62%; text-align:right; font-weight:600; color:rgba(255,255,255,.90);
  font-variant-numeric:tabular-nums; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.wc-row em{ font-style:normal; min-width:42px; text-align:right; color:rgba(255,255,255,.5); font-variant-numeric:tabular-nums; }

.wc-foot{ margin-top:7px; padding:5px 7px; border-radius:7px; font-size:10.5px; line-height:1.5;
  background:rgba(255,255,255,.08); color:rgba(255,255,255,.86); }
.wc-foot.bad{ background:rgba(255,92,84,.16); color:#ffb9b4; }
.wc-foot.warn{ background:rgba(255,163,72,.16); color:#ffd2a4; }

.wc-raw{ margin-top:6px; }

/* 一个组件都没有时：不留空壳，给一块可点的虚线 */
.wg-empty{ position:absolute; left:18px; top:calc(var(--menubar-h) + 53px); width:236px;
  padding:20px 10px 18px; text-align:center; border:.5px dashed rgba(255,255,255,.28);
  border-radius:14px; font-size:11px; line-height:1.9; color:rgba(255,255,255,.62);
  background:rgba(26,29,35,.22); pointer-events:auto; }
.wg-add{ margin-top:7px; border:.5px solid rgba(255,255,255,.30); background:rgba(255,255,255,.10);
  border-radius:8px; padding:5px 14px; font-size:11.5px; font-weight:500; color:#fff; cursor:pointer; }
.wg-add:hover{ background:rgba(255,255,255,.20); }

/* ---------------- 编辑面板（点入口弹出，增删 + 整理都在这里） ----------------
   唯一的增删入口。卡片上不挂 ×，避免「两个地方都能改」的分裂。 */
.wg-lib{
  position:absolute; left:18px; top:calc(var(--menubar-h) + 49px); width:300px; z-index:41;
  pointer-events:auto;
  background:rgba(28,31,37,.80);
  -webkit-backdrop-filter:blur(36px) saturate(180%);
  backdrop-filter:blur(36px) saturate(180%);
  border-radius:14px; padding:9px;
  box-shadow:0 0 0 .5px rgba(255,255,255,.10), 0 20px 50px rgba(0,0,0,.42);
  color:rgba(255,255,255,.94);
}
/* 不放入场动画：这一层要能被截图/回归测试直接验，不透明的首帧更可靠 */
.wg-lib[hidden]{ display:none; }
.wgl-head{ display:flex; align-items:center; gap:7px; padding:1px 3px 8px; }
.wgl-head b{ font-size:12.5px; color:#fff; }
.wgl-head span{ font-size:9.5px; color:rgba(255,255,255,.46); }
.wgl-done{ margin-left:auto; height:22px; padding:0 10px; border:0; border-radius:6px; cursor:pointer;
  background:rgba(255,255,255,.12); color:#fff; font-size:11px; font-weight:500; }
.wgl-done:hover{ background:rgba(255,255,255,.20); }
.wgl-body{ max-height:min(56vh, 400px); overflow:auto; overscroll-behavior:contain; scrollbar-width:none; }
.wgl-body::-webkit-scrollbar{ display:none; }
.wgl-item{ display:flex; align-items:center; gap:8px; padding:7px 6px; border-radius:9px; cursor:pointer; }
.wgl-item:hover{ background:rgba(255,255,255,.07); }
.wgl-ico{ width:26px; height:26px; border-radius:7px; flex:0 0 auto; display:flex; align-items:center; justify-content:center;
  box-shadow:inset 0 0 0 .5px rgba(255,255,255,.20); }
.wgl-ico svg{ width:14px; height:14px; fill:none; stroke:#fff; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
.wgl-txt{ min-width:0; }
.wgl-txt b{ display:block; font-size:11.5px; font-weight:600; color:#fff; }
.wgl-txt span{ display:block; margin-top:1px; font-size:9.5px; color:rgba(255,255,255,.46);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.wgl-item .switch{ margin-left:auto; flex:0 0 auto; }
.wgl-foot{ margin-top:6px; padding:8px 3px 1px;
  border-top:.5px solid rgba(255,255,255,.10); font-size:9.5px; line-height:1.6;
  color:rgba(255,255,255,.42); }
.wgl-acts{ display:flex; gap:6px; margin-bottom:6px; }
.wgl-btn{ height:24px; padding:0 11px; border:.5px solid rgba(255,255,255,.22); border-radius:7px;
  background:rgba(255,255,255,.06); color:rgba(255,255,255,.88); font-size:11px; font-weight:500; cursor:pointer;
  transition:background .14s, border-color .14s; }
.wgl-btn:hover{ background:rgba(255,255,255,.14); }
.wgl-btn.primary{ background:rgba(10,108,255,.78); border-color:rgba(10,108,255,.9); color:#fff; }
.wgl-btn.primary:hover{ background:rgba(10,108,255,.92); }

/* 对齐整理：位置要「滑」过去，不能瞬移，否则看不出是整理还是重排 */
.wg-stage.aligning .wg-card{
  transition:left .32s cubic-bezier(.22,.61,.36,1), top .32s cubic-bezier(.22,.61,.36,1),
             background .16s, box-shadow .16s;
}
/* 展开时卡片轻微下落 */
.wg-stage.pop .wg-card{ animation:wg-pop .26s cubic-bezier(.22,.61,.36,1) both; }
@keyframes wg-pop{
  from{ opacity:0; transform:translateY(-4px) scale(.985); }
  to  { opacity:1; transform:none; }
}

/* 深色面板里的开关：浅色轨道 + 白点，打开时蓝底。
   注意 app-kit.css 后加载，基础 .switch 用的是 left 而不是 transform，
   所以这里两个状态都要显式写 left，否则白点会跑出轨道外。 */
.wg-lib .switch{ position:relative; width:30px; height:18px; border:0; border-radius:9px; padding:0;
  background:rgba(255,255,255,.20); cursor:pointer; transition:background .16s; }
.wg-lib .switch::after{ content:""; position:absolute; top:2px; left:2px; width:14px; height:14px;
  border-radius:50%; background:#fff; box-shadow:0 1px 2px rgba(0,0,0,.30);
  transition:left .16s, transform .16s; }
.wg-lib .switch.on{ background:#0a6cff; }
.wg-lib .switch.on::after{ left:2px; transform:translateX(12px); }

/* 窄屏：卡片宽度收一点，面板不出右边 */
@media (max-width: 720px){
  .wg-card{ width:206px; }
  .wg-empty{ width:206px; }
  .wg-lib{ width:min(300px, calc(100vw - 36px)); }
}

/* ---------------- Toast ---------------- */
#toast-stack{
  position:absolute; top: calc(var(--menubar-h) + 10px); left:50%; transform:translateX(-50%);
  display:flex; flex-direction:column; gap:8px; align-items:center;
  z-index:9600; pointer-events:none;
}
.toast{
  display:flex; align-items:center; gap:9px;
  min-width: 210px; max-width: 380px;
  padding:9px 13px;
  background: rgba(255,255,255,.92);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border-radius:11px;
  box-shadow: 0 0 0 .5px rgba(0,0,0,.10), 0 10px 26px rgba(0,0,0,.16);
  font-size:12.5px; color:#1d1d1f;
  animation: toastIn .26s cubic-bezier(.2,1,.3,1);
}
.toast.out{ animation: toastOut .2s ease forwards; }
@keyframes toastIn{ from{ opacity:0; transform: translateY(-10px) scale(.97); } }
@keyframes toastOut{ to{ opacity:0; transform: translateY(-8px) scale(.98); } }
.toast .t-ic{
  width:17px; height:17px; border-radius:50%; flex:0 0 auto;
  display:flex; align-items:center; justify-content:center;
  font-size:11px; font-weight:700; color:#fff;
}
.toast.ok .t-ic{ background: #34c759; }
.toast.info .t-ic{ background: var(--accent); }
.toast.warn .t-ic{ background: #ff9f0a; }
.toast.err .t-ic{ background: #ff3b30; }
.toast .t-text{ line-height:1.4; }

/* ---------------- 弹窗 ---------------- */
#modal-layer{
  position:absolute; inset:0; z-index:9400;
  display:none; align-items:center; justify-content:center;
  background: rgba(0,0,0,.16);
}
#modal-layer.on{ display:flex; }
.modal{
  width: 420px; max-width: calc(100% - 80px); max-height: 82%;
  background: var(--win-bg);
  border-radius: 12px; overflow:hidden;
  box-shadow: 0 0 0 .5px rgba(0,0,0,.14), 0 26px 60px rgba(0,0,0,.28);
  animation: modalIn .22s cubic-bezier(.2,1,.3,1);
  display:flex; flex-direction:column;
}
@keyframes modalIn{ from{ opacity:0; transform: scale(.97) translateY(6px); } }
.modal-head{
  padding:13px 16px 10px; display:flex; align-items:center; gap:8px;
}
.modal-head h3{ margin:0; font-size:13.5px; font-weight:600; }
.modal-body{ padding: 2px 16px 14px; overflow:auto; font-size:12.5px; }
.modal-foot{
  padding:10px 16px; display:flex; justify-content:flex-end; gap:8px;
  border-top:.5px solid var(--line); background: var(--win-bg-soft);
}
/* 轻量确认：像系统对话框，只问一句，不写说明书 */
.modal-slim{ width:340px; animation:none; }
.modal-slim .modal-head{ padding:14px 18px 2px; }
.modal-slim .modal-head h3{ font-size:12.5px; }
.modal-slim .modal-body{ padding:0 18px 14px; font-size:11.5px; line-height:1.6;
  color:var(--ink-2); }
.modal-slim .modal-foot{ padding:8px 18px 10px; gap:7px; }
.modal-slim .modal-foot .btn{ height:26px; padding:0 13px; font-size:11.5px;
  border-radius:6px; }
.form-row{ display:flex; align-items:center; gap:10px; margin-bottom:9px; }
.form-row > label{ width:74px; flex:0 0 auto; font-size:12px; color: var(--ink-2); text-align:right; }
.form-row > .ctl{ flex:1; display:flex; gap:6px; }
.form-row .field{ width:100%; }

/* ---------------- 右键菜单 ---------------- */
.ctx-menu{
  position:absolute; z-index:9600;
  min-width: 168px; padding:4px;
  background: rgba(250,250,252,.94);
  -webkit-backdrop-filter: blur(28px);
  backdrop-filter: blur(28px);
  border-radius:7px;
  box-shadow: var(--sh-pop);
  font-size:12.5px;
}
.ctx-menu[hidden]{ display:none; }

/* 右键菜单只有一层：没有子菜单，也没有悬停箭头 */
.mp-item .mp-label{ flex:1 1 auto; min-width:0; text-align:left; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* ---------------- 缩放适配 ----------------
   卡片宽度只由「屏幕够不够宽」决定，写在组件区块的媒体查询里；
   这里不再按视口另设一档，避免两条规则打架导致宽窄屏错乱。 */
