/* =============================================================================
   FantasyOS · Cyberpunk Desktop Environment (fd-desktop.css)
   深渊黑 + 霓虹青/洋红 + HUD 战术切角 + 多窗口管理器 + 小组件 + 响应式手机主屏
   ============================================================================= */

:root {
  --os-cyan: #00f0ff;
  --os-magenta: #ff007f;
  --os-amber: #ffe600;
  --os-purple: #8b5cf6;
  --os-emerald: #10b981;
  --os-bg: #03050a;
  --os-surface: rgba(7, 11, 20, 0.88);
  --os-surface-solid: #080d18;
  --os-border: rgba(0, 240, 255, 0.22);
  --os-border-active: rgba(0, 240, 255, 0.78);
  --os-topbar-h: 36px;
  --os-dock-h: 64px;
}

/* 当处于桌面模式时隐藏经典网页框架，让桌面独占全屏视口 */
html.fd-desktop-active body.fd-apple {
  overflow: hidden !important;
  height: 100dvh !important;
  min-height: 100dvh !important;
}

html.fd-desktop-active .fd-app-window > .fd-bar,
html.fd-desktop-active .fd-app-window > .fd-app-body > #sidebar,
html.fd-desktop-active .fd-app-window > .fd-app-body > #mobileSidebarOverlay,
html.fd-desktop-active .fd-app-window > .fd-foot {
  display: none !important;
}

html.fd-desktop-active .fd-app-window,
html.fd-desktop-active .fd-app-body,
html.fd-desktop-active .fd-app-body > main {
  height: 100dvh !important;
  min-height: 100dvh !important;
  width: 100vw !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* 让小奇桌宠在桌面模式下默认站在任务栏上方，不阻挡 Dock，也不影响拖动时的 inline style 覆盖 */
html.fd-desktop-active #aiFabDock {
  bottom: 84px;
  right: 22px;
  z-index: 8600;
}

/* 主容器 */
.fd-os-root {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  background: var(--os-bg);
  color: #e2e8f0;
  font-family: "JetBrains Mono", "SF Pro Display", "Inter", "PingFang SC", "Microsoft YaHei", monospace, sans-serif;
  user-select: none;
  overflow: hidden;
}

/* ── 壁纸主题层 ─────────────────────────────────────────────────────────────── */
.fd-os-wallpaper {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  transition: background 0.4s ease;
}

.fd-os-live-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.fd-os-cosmos-gl {
  opacity: 0;
  transition: opacity 0.45s ease;
}
.fd-os-cosmos-gl.is-active {
  opacity: 1;
}

/* 纯客户端自定义本地动态壁纸（视频/GIF/图片） */
.fd-os-custom-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  pointer-events: none;
}
.fd-os-custom-media.is-active {
  display: block;
}

.fd-os-root[data-wallpaper="custom"] .fd-os-wallpaper {
  background-color: #02040a;
}

/* 0. 默认：真实宇宙深空模拟 */
.fd-os-root[data-wallpaper="cosmos"] .fd-os-wallpaper {
  background-color: #010207;
  background-image:
    radial-gradient(ellipse 90% 70% at 32% 65%, rgba(28, 42, 78, 0.24), transparent 70%),
    radial-gradient(ellipse 75% 60% at 72% 28%, rgba(76, 29, 95, 0.16), transparent 68%);
}

/* 1. 赛博矩阵 */
.fd-os-root[data-wallpaper="cyber-grid"] .fd-os-wallpaper {
  background-color: #03050a;
  background-image:
    radial-gradient(ellipse 65% 420px at 18% 12%, rgba(0, 240, 255, 0.16), transparent 70%),
    radial-gradient(ellipse 55% 440px at 86% 24%, rgba(255, 0, 127, 0.14), transparent 70%),
    radial-gradient(ellipse 50% 380px at 52% 90%, rgba(139, 92, 246, 0.14), transparent 70%),
    linear-gradient(rgba(0, 240, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.055) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 42px 42px, 42px 42px;
}

/* 2. 骇客绿矩阵 */
.fd-os-root[data-wallpaper="matrix-pulse"] .fd-os-wallpaper {
  background-color: #020806;
  background-image:
    radial-gradient(ellipse 60% 450px at 30% 20%, rgba(16, 185, 129, 0.18), transparent 70%),
    radial-gradient(ellipse 55% 400px at 80% 80%, rgba(0, 240, 255, 0.12), transparent 70%),
    linear-gradient(rgba(16, 185, 129, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 185, 129, 0.06) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 34px 34px, 34px 34px;
}

/* 3. 合成波紫霞 */
.fd-os-root[data-wallpaper="neon-aurora"] .fd-os-wallpaper {
  background-color: #080412;
  background-image:
    radial-gradient(ellipse 70% 450px at 50% 15%, rgba(255, 0, 127, 0.2), transparent 70%),
    radial-gradient(ellipse 60% 420px at 20% 85%, rgba(139, 92, 246, 0.22), transparent 70%),
    radial-gradient(ellipse 50% 380px at 85% 75%, rgba(0, 240, 255, 0.15), transparent 70%),
    linear-gradient(rgba(255, 0, 127, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.04) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 48px 48px, 48px 48px;
}

/* 4. 极简黑曜 */
.fd-os-root[data-wallpaper="minimal-void"] .fd-os-wallpaper {
  background-color: #030508;
  background-image:
    radial-gradient(circle at 50% 45%, rgba(0, 240, 255, 0.06), transparent 65%);
}

/* 扫描线叠加 */
.fd-os-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0px,
    rgba(255, 255, 255, 0) 2px,
    rgba(0, 0, 0, 0.22) 3px,
    rgba(0, 0, 0, 0.22) 4px
  );
  opacity: 0.45;
  pointer-events: none;
}

.fd-os-root[data-scanlines="off"] .fd-os-scanlines {
  display: none;
}

.fd-os-watermark {
  position: absolute;
  right: 340px;
  bottom: 84px;
  text-align: right;
  pointer-events: none;
  opacity: 0.16;
  letter-spacing: 0.18em;
}

/* ── 顶部系统菜单栏 (Top HUD Bar) ─────────────────────────────────────────── */
.fd-os-topbar {
  position: relative;
  z-index: 9000;
  height: var(--os-topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: rgba(5, 8, 16, 0.88);
  border-bottom: 1px solid rgba(0, 240, 255, 0.35);
  box-shadow: 0 2px 18px rgba(0, 240, 255, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  font-size: 12px;
  flex-shrink: 0;
  gap: 8px;
}

.fd-os-top-left,
.fd-os-top-right {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.fd-os-top-center {
  flex: 1;
  max-width: 380px;
  display: flex;
  justify-content: center;
}

.fd-os-brand-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: #fff;
  font-weight: 700;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.fd-os-brand-btn:hover {
  background: rgba(0, 240, 255, 0.22);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.35);
}

.fd-os-top-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.fd-os-top-pill:hover {
  background: rgba(0, 240, 255, 0.14);
  border-color: rgba(0, 240, 255, 0.45);
  color: #fff;
}

.fd-os-top-pill.is-accent {
  background: rgba(255, 0, 127, 0.14);
  border-color: rgba(255, 0, 127, 0.42);
  color: #f9a8d4;
}

.fd-os-top-pill.is-accent:hover {
  background: rgba(255, 0, 127, 0.25);
  color: #fff;
}

.fd-os-spotlight-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 6px;
  background: rgba(2, 6, 14, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.26);
  color: #67e8f9;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fd-os-spotlight-trigger:hover {
  border-color: var(--os-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.22);
}

.fd-os-kbd {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.28);
  color: #a5f3fc;
}

.fd-os-clock {
  font-variant-numeric: tabular-nums;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(0, 240, 255, 0.07);
  border: 1px solid rgba(0, 240, 255, 0.2);
  color: #a5f3fc;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* ── 中央桌面工作台区域 ─────────────────────────────────────────────────────── */
.fd-os-stage {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

.fd-os-canvas {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  padding: 14px;
}

/* 桌面图标容器（支持绝对坐标自由拖动 & 自动排列） */
.fd-os-icons-layer {
  position: relative;
  width: 100%;
  height: calc(100% - 68px);
}

.fd-os-icon {
  position: absolute;
  width: 102px;
  padding: 10px 6px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
  touch-action: none;
}

.fd-os-icon:hover {
  background: rgba(0, 240, 255, 0.1);
  border-color: rgba(0, 240, 255, 0.38);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.fd-os-icon.is-selected {
  background: rgba(0, 240, 255, 0.18);
  border-color: rgba(0, 240, 255, 0.72);
  box-shadow: 0 0 22px rgba(0, 240, 255, 0.28);
}

.fd-os-icon.is-dragging {
  opacity: 0.88;
  z-index: 500;
  transform: scale(1.06);
  transition: none;
}

.fd-os-icon-glyph {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 17px;
  background: linear-gradient(155deg, rgba(16, 26, 48, 0.96), rgba(6, 10, 20, 0.98));
  border: 1px solid var(--icon-border, rgba(0, 240, 255, 0.36));
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.65),
    0 0 18px var(--icon-glow, rgba(0, 240, 255, 0.14)),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--icon-color, #38bdf8);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.18s ease, box-shadow 0.18s ease;
}

.fd-os-icon-glyph svg {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 0 8px var(--icon-glow, rgba(0, 240, 255, 0.45)));
}

.fd-os-icon:hover .fd-os-icon-glyph {
  transform: translateY(-3px) scale(1.04);
  border-color: var(--icon-color, var(--os-cyan));
  box-shadow:
    0 0 22px var(--icon-glow, rgba(0, 240, 255, 0.42)),
    0 12px 26px rgba(0, 0, 0, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.fd-os-icon-glyph img {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: 12px;
}

.fd-os-icon-shortcut-dot {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: #080d18;
  border: 1px solid rgba(0, 240, 255, 0.65);
  color: var(--os-cyan);
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.fd-os-icon-label {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
  color: #f8fafc;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.98), 0 0 10px rgba(0, 0, 0, 0.95);
  word-break: keep-all;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 96px;
}

/* ── 右侧赛博 HUD 小组件面板 (Desktop Widgets Sidebar) ───────────────────── */
.fd-os-widgets {
  width: 316px;
  flex-shrink: 0;
  height: calc(100% - 76px);
  margin: 12px 12px 0 0;
  padding-right: 4px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 10;
  transition: transform 0.25s ease, opacity 0.25s ease, width 0.25s ease, margin 0.25s ease;
}

.fd-os-root[data-widgets="off"] .fd-os-widgets {
  width: 0;
  margin-right: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.fd-os-widgets::-webkit-scrollbar {
  width: 4px;
}
.fd-os-widgets::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.25);
  border-radius: 4px;
}

.fd-os-widget-card {
  position: relative;
  background: rgba(6, 10, 20, 0.78);
  border: 1px solid rgba(0, 240, 255, 0.24);
  border-radius: 12px;
  padding: 12px 13px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(0, 240, 255, 0.16);
}

.fd-os-widget-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12px;
  width: 36px;
  height: 2px;
  background: var(--os-cyan);
  box-shadow: 0 0 8px var(--os-cyan);
}

.fd-os-widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 700;
  color: #67e8f9;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.fd-os-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.fd-os-metric-box {
  background: rgba(2, 6, 14, 0.72);
  border: 1px solid rgba(0, 240, 255, 0.16);
  border-radius: 8px;
  padding: 8px 9px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.fd-os-metric-box:hover {
  border-color: var(--os-cyan);
  background: rgba(0, 240, 255, 0.1);
}

.fd-os-metric-val {
  font-size: 17px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.45);
  line-height: 1.15;
}

.fd-os-metric-lbl {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 3px;
}

.fd-os-thread-item {
  display: block;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(2, 6, 14, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: all 0.15s ease;
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.fd-os-thread-item:hover {
  border-color: rgba(0, 240, 255, 0.45);
  background: rgba(0, 240, 255, 0.09);
}

/* ── 多窗口系统 (Windows Layer) ────────────────────────────────────────────── */
.fd-os-windows-layer {
  position: fixed;
  top: var(--os-topbar-h);
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 100;
}

.fd-os-window {
  position: absolute;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  background: var(--os-surface-solid);
  border: 1px solid rgba(0, 240, 255, 0.28);
  border-radius: 12px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.78), 0 0 1px rgba(0, 240, 255, 0.4);
  overflow: hidden;
  min-width: 340px;
  min-height: 240px;
  transform-origin: center bottom;
  animation: fdWinOpen 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fdWinOpen {
  from { opacity: 0; transform: scale(0.94) translateY(14px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.fd-os-window.is-active {
  border-color: var(--os-border-active);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.88), 0 0 24px rgba(0, 240, 255, 0.24);
}

.fd-os-window.is-maximized {
  top: 4px !important;
  left: 6px !important;
  width: calc(100vw - 12px) !important;
  height: calc(100dvh - var(--os-topbar-h) - 72px) !important;
  border-radius: 10px;
}

.fd-os-window.is-minimized {
  display: none !important;
}

/* 窗口标题栏 */
.fd-os-win-titlebar {
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  background: linear-gradient(90deg, rgba(8, 16, 30, 0.98), rgba(14, 18, 34, 0.96));
  border-bottom: 1px solid rgba(0, 240, 255, 0.22);
  cursor: grab;
  flex-shrink: 0;
  gap: 8px;
  touch-action: none;
}

.fd-os-win-titlebar:active {
  cursor: grabbing;
}

.fd-os-window.is-active .fd-os-win-titlebar {
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.14), rgba(12, 18, 34, 0.98) 55%, rgba(255, 0, 127, 0.12));
  border-bottom-color: rgba(0, 240, 255, 0.45);
}

.fd-os-win-title-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.fd-os-win-title-info svg {
  width: 16px;
  height: 16px;
  color: var(--os-cyan);
}

.fd-os-win-title-text {
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fd-os-win-url-tag {
  font-size: 10px;
  color: #67e8f9;
  opacity: 0.7;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.2);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fd-os-win-tools,
.fd-os-win-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.fd-os-win-tool-btn {
  width: 26px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s ease;
}

.fd-os-win-tool-btn:hover {
  color: #fff;
  background: rgba(0, 240, 255, 0.18);
  border-color: rgba(0, 240, 255, 0.45);
}

.fd-os-win-ctrl-btn {
  width: 28px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s ease;
}

.fd-os-win-ctrl-btn:hover {
  background: rgba(0, 240, 255, 0.22);
  border-color: var(--os-cyan);
  color: #fff;
}

.fd-os-win-ctrl-btn.is-close:hover {
  background: rgba(239, 68, 68, 0.85);
  border-color: #ef4444;
  color: #fff;
}

/* 窗口内容区 */
.fd-os-win-body {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #04060a;
  overflow: hidden;
}

.fd-os-win-body iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #04060a;
}

.fd-os-win-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #04060a;
  color: #67e8f9;
  font-size: 12px;
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.fd-os-win-loading.is-hidden {
  opacity: 0;
}

/* 拖拽/缩放期间防止 iframe 劫持鼠标事件 */
.fd-os-drag-shield {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  cursor: grabbing;
}
.fd-os-drag-shield.is-active {
  display: block;
}

/* 右下角与边缘缩放手柄 */
.fd-os-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  z-index: 5;
}
.fd-os-resize-handle::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 7px;
  height: 7px;
  border-right: 2px solid rgba(0, 240, 255, 0.55);
  border-bottom: 2px solid rgba(0, 240, 255, 0.55);
}

/* ── 底部悬浮 Dock / 任务栏 ───────────────────────────────────────────────── */
.fd-os-dock-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 8px;
  z-index: 8500;
  display: flex;
  justify-content: center;
  padding: 0 12px;
  pointer-events: none;
}

.fd-os-dock {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 16px;
  background: rgba(6, 10, 20, 0.86);
  border: 1px solid rgba(0, 240, 255, 0.34);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.78), 0 0 22px rgba(0, 240, 255, 0.16);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  max-width: calc(100vw - 24px);
  overflow-x: auto;
}

.fd-os-dock::-webkit-scrollbar {
  height: 0;
}

.fd-os-dock-sep {
  width: 1px;
  height: 28px;
  background: rgba(0, 240, 255, 0.25);
  margin: 0 2px;
  flex-shrink: 0;
}

.fd-os-dock-item {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 13px;
  background: rgba(12, 20, 36, 0.88);
  border: 1px solid rgba(0, 240, 255, 0.24);
  color: #38bdf8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.15s, background 0.15s;
}

.fd-os-dock-item svg {
  width: 24px;
  height: 24px;
}

.fd-os-dock-item img {
  width: 30px;
  height: 30px;
  object-fit: cover;
  border-radius: 8px;
}

.fd-os-dock-item:hover {
  transform: translateY(-5px) scale(1.1);
  border-color: var(--os-cyan);
  background: rgba(0, 240, 255, 0.18);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.35);
}

.fd-os-dock-item.is-start {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.22), rgba(255, 0, 127, 0.22));
  border-color: rgba(0, 240, 255, 0.55);
  color: #fff;
}

.fd-os-dock-item.is-running::after {
  content: "";
  position: absolute;
  bottom: 2px;
  width: 6px;
  height: 3px;
  border-radius: 2px;
  background: var(--os-cyan);
  box-shadow: 0 0 6px var(--os-cyan);
}

.fd-os-dock-item.is-active-win {
  border-color: var(--os-cyan);
  background: rgba(0, 240, 255, 0.22);
}

.fd-os-dock-item.is-active-win::after {
  width: 14px;
  background: #ff007f;
  box-shadow: 0 0 8px #ff007f;
}

/* 运行中任务条（文字+图标） */
.fd-os-task-chip {
  height: 36px;
  max-width: 150px;
  padding: 0 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.fd-os-task-chip:hover {
  border-color: rgba(0, 240, 255, 0.5);
  color: #fff;
}

.fd-os-task-chip.is-active {
  background: rgba(0, 240, 255, 0.16);
  border-color: var(--os-cyan);
  color: #fff;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.22);
}

.fd-os-task-chip.is-minimized {
  opacity: 0.6;
  border-style: dashed;
}

.fd-os-task-chip-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── 开始菜单 / Launchpad 弹层 ─────────────────────────────────────────────── */
.fd-os-start-menu {
  position: fixed;
  bottom: 78px;
  left: 50%;
  transform: translateX(-50%);
  width: min(680px, calc(100vw - 24px));
  max-height: calc(100dvh - 130px);
  z-index: 9500;
  background: rgba(7, 11, 22, 0.94);
  border: 1px solid rgba(0, 240, 255, 0.45);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.88), 0 0 32px rgba(0, 240, 255, 0.18);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  padding: 16px;
  display: none;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.fd-os-start-menu.is-open {
  display: flex;
  animation: fdWinOpen 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

.fd-os-start-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 8px;
}

.fd-os-start-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: #e2e8f0;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.fd-os-start-app:hover {
  background: rgba(0, 240, 255, 0.14);
  border-color: rgba(0, 240, 255, 0.5);
  color: #fff;
  transform: translateY(-2px);
}

/* ── Spotlight 全局搜索面板 ─────────────────────────────────────────────────── */
.fd-os-spotlight-overlay {
  position: fixed;
  inset: 0;
  z-index: 9800;
  background: rgba(2, 5, 12, 0.72);
  backdrop-filter: blur(8px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: min(14vh, 110px);
}

.fd-os-spotlight-overlay.is-open {
  display: flex;
}

.fd-os-spotlight-box {
  width: min(620px, calc(100vw - 24px));
  background: rgba(8, 13, 24, 0.96);
  border: 1px solid var(--os-cyan);
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.9), 0 0 35px rgba(0, 240, 255, 0.25);
  overflow: hidden;
}

/* ── 桌面右键菜单 ───────────────────────────────────────────────────────────── */
.fd-os-ctx-menu {
  position: fixed;
  z-index: 9900;
  min-width: 190px;
  padding: 6px;
  border-radius: 12px;
  background: rgba(7, 11, 22, 0.96);
  border: 1px solid rgba(0, 240, 255, 0.45);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.85), 0 0 20px rgba(0, 240, 255, 0.18);
  backdrop-filter: blur(18px);
  display: none;
}

.fd-os-ctx-menu.is-open {
  display: block;
}

.fd-os-ctx-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 7px;
  background: transparent;
  border: none;
  color: #e2e8f0;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}

.fd-os-ctx-item:hover {
  background: rgba(0, 240, 255, 0.16);
  color: #fff;
}

.fd-os-ctx-sep {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 4px 6px;
}

/* ── 交互式赛博新手引导 (Onboarding Tour Spotlight) ──────────────────────── */
.fd-os-tour-layer {
  position: fixed;
  inset: 0;
  z-index: 120000;
  display: none;
  pointer-events: auto;
}

.fd-os-tour-layer.is-open {
  display: block;
}

.fd-os-tour-highlight {
  position: fixed;
  border-radius: 14px;
  border: 2px solid var(--os-cyan);
  box-shadow:
    0 0 0 9999px rgba(2, 5, 14, 0.78),
    0 0 28px rgba(0, 240, 255, 0.55),
    inset 0 0 18px rgba(0, 240, 255, 0.2);
  pointer-events: none;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1;
}

.fd-os-tour-card {
  position: fixed;
  width: min(380px, calc(100vw - 24px));
  background: #080d1a;
  border: 1px solid rgba(0, 240, 255, 0.55);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.92), 0 0 32px rgba(0, 240, 255, 0.24);
  color: #e2e8f0;
  z-index: 2;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.fd-os-tour-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  width: 56px;
  height: 3px;
  background: linear-gradient(90deg, var(--os-cyan), var(--os-magenta));
  border-radius: 0 0 4px 4px;
}

.fd-os-tour-dots {
  display: flex;
  align-items: center;
  gap: 5px;
}

.fd-os-tour-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  transition: all 0.2s ease;
}

.fd-os-tour-dot.is-active {
  width: 20px;
  background: var(--os-cyan);
  box-shadow: 0 0 8px var(--os-cyan);
}

/* ── 响应式：小屏幕 / 手机端改为类 iPad/移动主屏体验 ──────────────────────── */
@media (max-width: 900px) {
  .fd-os-widgets {
    display: none;
  }
  .fd-os-watermark {
    right: 20px;
  }
}

@media (max-width: 767px) {
  .fd-os-canvas {
    overflow-y: auto;
    padding-bottom: 84px;
  }
  .fd-os-icons-layer {
    height: auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 4px;
    justify-items: center;
  }
  .fd-os-icon {
    position: static !important;
    width: 100%;
    padding: 6px 2px;
  }
  .fd-os-icon-glyph {
    width: 56px;
    height: 56px;
    border-radius: 15px;
  }
  .fd-os-icon-glyph svg {
    width: 28px;
    height: 28px;
  }
  .fd-os-icon-label {
    font-size: 11.5px;
    max-width: 78px;
  }
  .fd-os-widgets {
    display: flex;
    width: 100%;
    height: auto;
    margin: 14px 0 0 0;
    padding-right: 0;
  }
  .fd-os-root[data-widgets="off"] .fd-os-widgets {
    display: none;
  }
  .fd-os-stage {
    flex-direction: column;
    overflow-y: auto;
  }
  .fd-os-window {
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: calc(100dvh - var(--os-topbar-h) - 66px) !important;
    border-radius: 0 !important;
  }
  .fd-os-resize-handle {
    display: none;
  }
  .fd-os-hide-mobile {
    display: none !important;
  }
}

/* ── 快速启动专属小组件 ────────────────────────────────────────────────────── */
.fd-os-ql-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fd-os-ql-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.fd-os-ql-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(0, 240, 255, 0.18);
  color: #e2e8f0;
  text-align: left;
  cursor: pointer;
  min-width: 0;
  transition: transform 0.14s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.fd-os-ql-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 240, 255, 0.55);
  background: rgba(0, 240, 255, 0.12);
  box-shadow: 0 4px 14px rgba(0, 240, 255, 0.16);
}

.fd-os-ql-ico {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: rgba(2, 6, 23, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  overflow: hidden;
}

.fd-os-ql-name {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #f1f5f9;
}

.fd-os-ql-actions {
  display: flex;
  gap: 6px;
  padding-top: 2px;
}

.fd-os-ql-mini {
  flex: 1;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.fd-os-ql-mini:hover {
  color: #67e8f9;
  border-color: rgba(0, 240, 255, 0.4);
  background: rgba(0, 240, 255, 0.09);
}
