/* ----------------------------- 全局滚动条（小 + 主题色） ----------------------------- */
* { scrollbar-width: thin; scrollbar-color: var(--hairline) transparent; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--hairline); border-radius: 3px;
  border: 1px solid transparent; background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--border); border: 1px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-corner { background: transparent; }

/* ============================================================
   shell.css · OS 壳布局样式（Lumen Depth · 流光玻璃 v2）
   ------------------------------------------------------------
   自 docs/desktop-os-enhanced/desktop-os.html 的视觉语言对齐：
   流光层境 / 玻璃拟态 / 柔和弥散阴影 / 悬浮控件。只布局与控件外观，
   主题色一律引用 tokens.css 的语义变量，禁止硬编码颜色。零构建 / 零 CDN。
   v2（本轮）：把壳做成「悬浮在流光桌面上的玻璃」—— 背景环境光晕、任务栏与面板
   改悬浮圆角玻璃、窗口/卡片加内高光与弥散阴影，全面提升精致度。
   ============================================================ */

/* ----------------------------- 启动遮罩 ----------------------------- */
.ll-boot {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column; gap: 14px;
  align-items: center; justify-content: center;
  color: var(--text-2); background: var(--bg);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
/* 关键：shell.js 在 startWorkbench() 里通过 boot.hidden = true 关闭遮罩。
   浏览器默认的 [hidden]{display:none} 是 UA 样式，会被上方 .ll-boot{display:flex}
   这条作者样式覆盖，导致遮罩永不消失、工作台卡在「正在加载」。显式加一条
   [hidden] 规则（与 .ll-desk[hidden]/.ll-dash[hidden]/.ll-start-menu[hidden] 一致）
   才能让 hidden 属性生效。 */
.ll-boot[hidden] { display: none; }
.ll-spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid var(--hairline);
  border-top-color: var(--accent);
  animation: ll-spin 0.9s linear infinite;
  filter: drop-shadow(0 0 10px var(--glow-soft));
}
@keyframes ll-spin { to { transform: rotate(360deg); } }

/* ----------------------------- 桌面（流光环境） ----------------------------- */
.ll-desk {
  position: fixed; inset: 0;
  display: block; overflow: hidden;
  /* 多层径向光晕 + 线性底色，营造「流光层境」的桌面环境，而非平涂灰底。 */
  background:
    radial-gradient(1200px 760px at 84% -10%, rgba(var(--glow-rgb), calc(0.26 * var(--aura-strength))), transparent 58%),
    radial-gradient(980px 720px at 4% 112%, rgba(var(--cool-rgb), calc(0.22 * var(--aura-strength))), transparent 60%),
    radial-gradient(820px 620px at 52% 46%, rgba(var(--accent-rgb), calc(0.10 * var(--aura-strength))), transparent 70%),
    linear-gradient(158deg, var(--bg-2), var(--bg));
}
.ll-desk::after {
  /* 极淡的点阵纹理，增加桌面质感而不喧宾夺主（指针穿透）。 */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image: radial-gradient(circle at center, var(--hairline) 1px, transparent 1.4px);
  background-size: 30px 30px; opacity: 0.5;
}
.ll-desk[hidden] { display: none; }

/* 窗口层（window 面） */
.ll-window-layer {
  position: absolute; inset: 0 0 92px 0; z-index: 1;
  pointer-events: none; /* 子窗口自行开启 */
}

/* ----------------------------- 窗口 ----------------------------- */
.ll-window {
  position: absolute; pointer-events: auto;
  display: flex; flex-direction: column;
  min-width: 300px; min-height: 200px;
  background: var(--surface-glass);
  backdrop-filter: blur(var(--blur-frame)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur-frame)) saturate(140%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--elev-3), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.ll-window::before {
  /* 顶部一道柔和高光，强化玻璃质感。 */
  content: ""; position: absolute; inset: 0 0 auto 0; height: 64px; pointer-events: none;
  background: linear-gradient(180deg, var(--surface-2), transparent);
  opacity: 0.7;
}
.ll-window.normal { width: 560px; height: 400px; }
.ll-window.maximized { inset: 0 0 92px 0; width: auto; height: auto; border-radius: 0; }
.ll-window.fullscreen { inset: 0; width: auto; height: auto; border-radius: 0; z-index: 600; }
.ll-window.active { border-color: var(--ring); box-shadow: var(--elev-3), 0 0 0 1px var(--ring), 0 0 40px var(--glow-soft); }
.ll-window.snap-left  { left: 12px; top: 12px; bottom: 104px; width: calc(50% - 24px); height: auto; }
.ll-window.snap-right { right: 12px; top: 12px; bottom: 104px; width: calc(50% - 24px); height: auto; }
.ll-window-head {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 14px; cursor: move; user-select: none;
  border-bottom: 1px solid var(--hairline);
}
.ll-window-title { font-weight: 600; font-size: 13.5px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ll-window-btns { display: flex; gap: 8px; }
.ll-win-btn {
  width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--hairline);
  background: var(--surface-1); color: var(--text-2); cursor: pointer; font-size: 12px; line-height: 1;
  display: grid; place-items: center; transition: var(--dur-1) var(--ease-out);
}
.ll-win-btn:hover { background: var(--highlight); color: var(--text); transform: translateY(-1px); }
.ll-win-btn.close:hover { background: var(--red); color: #fff; border-color: transparent; }
.ll-window-body { position: relative; z-index: 1; flex: 1; overflow: hidden; background: var(--bg-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.ll-window-body iframe { width: 100%; height: 100%; border: 0; display: block; background: var(--bg-2); }
.ll-resize {
  position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; z-index: 2;
  cursor: nwse-resize; background:
    linear-gradient(135deg, transparent 50%, var(--text-3) 50%, var(--text-3) 62%, transparent 62%);
  opacity: 0.5;
}
.ll-resize:hover { opacity: 0.9; }

/* dash（右侧悬浮面板） */
.ll-dash {
  position: absolute; top: 14px; right: 14px; bottom: 92px; width: 332px;
  padding: 14px; display: flex; flex-direction: column; gap: 12px;
  overflow-y: auto; z-index: 150;
  background: var(--glass); backdrop-filter: blur(var(--blur-frame)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur-frame)) saturate(140%);
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  box-shadow: var(--elev-3), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.ll-dash[hidden] { display: none; }
.ll-dash-card {
  background: var(--surface-1); border: 1px solid var(--hairline);
  border-radius: var(--radius-md); overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.ll-dash-card-iframe { width: 100%; border: 0; display: block; background: var(--bg-2); }

/* desk（桌面浮动组件） */
.ll-desk-widgets { position: absolute; inset: 0 0 92px 0; pointer-events: none; z-index: 150; }
.ll-desk-widgets[hidden] { display: none; }
.ll-dw-card {
  position: absolute; pointer-events: auto; width: 248px;
  background: var(--surface-glass); backdrop-filter: blur(var(--blur-float)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur-float)) saturate(140%);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--elev-2), 0 0 28px var(--glow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.ll-dw-card.dragging { box-shadow: var(--elev-3), 0 0 36px var(--glow-soft); opacity: 0.97; transform: scale(1.02); }
.ll-dw-head { cursor: move; padding: 8px 10px; font-size: 12px; color: var(--text-2);
  border-bottom: 1px solid var(--hairline); user-select: none; display: flex; align-items: center; gap: 6px; }
.ll-dw-head::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--glow); }
.ll-dw-body iframe { width: 100%; border: 0; display: block; background: var(--bg-2); }

/* ----------------------------- 任务栏（悬浮玻璃胶囊） ----------------------------- */
.ll-taskbar {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  width: min(760px, calc(100% - 32px)); height: 56px;
  display: flex; align-items: center; gap: 10px; padding: 0 14px; z-index: 400;
  background: var(--taskbar); backdrop-filter: blur(var(--blur-frame)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--blur-frame)) saturate(150%);
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  box-shadow: var(--elev-3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.ll-start {
  height: 40px; padding: 0 18px; border-radius: var(--radius-pill);
  border: 1px solid var(--hairline); background: var(--surface-1);
  color: var(--text); font-weight: 600; cursor: pointer; font-size: 13.5px;
  display: flex; align-items: center; gap: 8px;
  background-image: linear-gradient(135deg, var(--highlight), transparent 70%);
  transition: var(--dur-1) var(--ease-out);
}
.ll-start::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 10px var(--glow); }
.ll-start:hover { background: var(--highlight); transform: translateY(-1px); box-shadow: 0 6px 18px var(--glow-soft); }
.ll-task-items { display: flex; gap: 8px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.ll-task-items::-webkit-scrollbar { display: none; }
.ll-task-item {
  height: 42px; min-width: 42px; padding: 0 14px; border-radius: var(--radius-md);
  border: 1px solid transparent; background: var(--surface-1); color: var(--text-2);
  cursor: pointer; display: flex; align-items: center; gap: 7px; font-size: 13px; white-space: nowrap;
  transition: var(--dur-1) var(--ease-out);
}
.ll-task-item:hover { background: var(--surface-2); color: var(--text); transform: translateY(-1px); }
.ll-task-item.active { background: var(--highlight); color: var(--text); border-color: var(--ring); box-shadow: 0 4px 14px var(--glow-soft); }
.ll-tray { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.ll-tray-btn {
  height: 40px; padding: 0 14px; border-radius: var(--radius-pill);
  border: 1px solid var(--hairline); background: var(--surface-1); color: var(--text);
  cursor: pointer; font-size: 13px; display: flex; align-items: center; gap: 6px;
  transition: var(--dur-1) var(--ease-out);
}
.ll-tray-btn:hover { background: var(--highlight); transform: translateY(-1px); }

/* ----------------------------- 开始菜单（玻璃卡 + 应用磁贴） ----------------------------- */
.ll-start-menu {
  position: absolute; left: 14px; bottom: 92px; width: 348px; max-height: 72vh; overflow-y: auto;
  z-index: 500; padding: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  background: var(--surface-glass); backdrop-filter: blur(var(--blur-frame)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--blur-frame)) saturate(150%);
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  box-shadow: var(--elev-3), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: ll-pop var(--dur-2) var(--ease-out);
}
@keyframes ll-pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.ll-start-menu[hidden] { display: none; }
.ll-app-tile {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  padding: 14px; border-radius: var(--radius-md); border: 1px solid var(--hairline);
  background: var(--surface-1); color: var(--text); cursor: pointer; text-align: left;
  transition: var(--dur-1) var(--ease-out);
}
.ll-app-tile::before {
  content: ""; width: 34px; height: 34px; border-radius: 11px; margin-bottom: 2px;
  background-image: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 4px 12px var(--glow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.ll-app-tile:hover { background: var(--highlight); border-color: var(--ring); transform: translateY(-2px); box-shadow: var(--elev-2); }
.ll-app-tile .ll-app-name { font-weight: 600; font-size: 13.5px; }
.ll-app-tile .ll-app-desc { font-size: 11px; color: var(--text-3); line-height: 1.4; }
.ll-app-tile .ll-app-surfaces { font-size: 10px; color: var(--accent-2); letter-spacing: 1px; text-transform: uppercase; }
.ll-start-section { grid-column: 1 / -1; font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 1.5px; margin: 6px 2px 0; display: flex; align-items: center; gap: 8px; }
.ll-start-section::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }

/* ----------------------------- 公开首页 / 通用控件 ----------------------------- */
.ll-card {
  background: var(--surface-glass); backdrop-filter: blur(var(--blur-frame));
  -webkit-backdrop-filter: blur(var(--blur-frame));
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--elev-2), inset 0 1px 0 rgba(255, 255, 255, 0.06); padding: 18px;
}
.ll-btn {
  border: 1px solid var(--hairline); background: var(--surface-1); color: var(--text);
  border-radius: var(--radius-md); padding: 9px 16px; cursor: pointer; font-size: 13px;
  transition: var(--dur-1) var(--ease-out); font-weight: 500;
}
.ll-btn:hover { background: var(--surface-2); transform: translateY(-1px); }
.ll-btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--text-on-accent); border-color: transparent; font-weight: 600; box-shadow: 0 6px 18px var(--glow-soft); }
.ll-btn.primary:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 10px 26px var(--glow); }
.ll-input {
  flex: 1; min-width: 0; padding: 10px 14px; border-radius: var(--radius-md);
  border: 1px solid var(--border); background: var(--bg-2); color: var(--text); font-size: 13.5px;
  transition: var(--dur-1) var(--ease-out);
}
.ll-input::placeholder { color: var(--text-3); }
.ll-input:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px var(--highlight), 0 0 16px var(--glow-soft); }

/* 插件内通用（iframe 内引用） */
.ll-plugin-body { margin: 0; padding: 14px; font-family: var(--font-sans); color: var(--text); background: var(--bg-2); min-height: 100%; }
.ll-app { display: flex; flex-direction: column; gap: 12px; height: 100%; }
.ll-app-head { display: flex; align-items: center; gap: 8px; }
.ll-app-head h2 { margin: 0; font-size: 15px; }
.ll-badge { background: var(--highlight); color: var(--accent); border-radius: var(--radius-pill); padding: 2px 10px; font-size: 12px; font-weight: 600; }
.ll-row { display: flex; gap: 8px; }
.ll-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; flex: 1; }
.ll-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-md);
  background: var(--surface-1); border: 1px solid var(--hairline); transition: var(--dur-1) var(--ease-out); }
.ll-list li:hover { background: var(--surface-2); }
.ll-list li.done .ll-label { text-decoration: line-through; color: var(--text-3); }
.ll-label { flex: 1; font-size: 13.5px; }
.ll-link-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-md);
  background: var(--surface-1); border: 1px solid var(--hairline); transition: var(--dur-1) var(--ease-out); }
.ll-link-item:hover { background: var(--surface-2); border-color: var(--ring); }
.ll-link-item a { color: var(--accent); text-decoration: none; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.ll-link-item a:hover { text-decoration: underline; }
.ll-clock-time { font-size: 30px; font-weight: 700; letter-spacing: 1px; color: var(--text); font-variant-numeric: tabular-nums; text-shadow: 0 0 18px var(--glow-soft); }
.ll-clock-date { font-size: 12px; color: var(--text-2); }
.ll-icon-btn { border: 1px solid transparent; background: transparent; color: var(--text-3); cursor: pointer; padding: 3px 7px; border-radius: 8px; transition: var(--dur-1) var(--ease-out); }
.ll-icon-btn:hover { color: var(--text); background: var(--surface-2); }
