Skip to content

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode,DeepSeek Harness and more. Only official website: ccswitch.io

4.8 KB
Raw Blame
/* 系统模糊和 Windows 使用透明画布,Linux 回退模式在内层画布铺实色。 */
html,
body.tray-panel,
body.tray-panel #root {
  height: 100%;
  background: transparent !important;
  overflow: hidden;
}

body.tray-panel {
  -webkit-user-select: none;
  user-select: none;
  cursor: default;
}

.tp-card {
  position: absolute;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: hsl(var(--foreground));
}

/* macOS:每块卡片下面一块系统玻璃,网页再叠一层主题底色。
   玻璃会随身后的桌面变深变浅,文字颜色却跟着主题走:底色太淡时,浅色主题放在
   深色窗口上面会变成深字压深底,所以底色要盖住大半,只透出一点模糊的背景 */
html[data-glass="native"][data-layout="floating"] .tp-card {
  background: rgba(246, 246, 248, 0.72);
  box-shadow:
    inset 0 0 0 0.5px rgba(0, 0, 0, 0.12),
    0 6px 16px rgba(0, 0, 0, 0.14),
    0 1px 3px rgba(0, 0, 0, 0.1);
}
html.dark[data-glass="native"][data-layout="floating"] .tp-card {
  background: rgba(30, 30, 33, 0.62);
  box-shadow:
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.14),
    0 6px 16px rgba(0, 0, 0, 0.3),
    0 1px 3px rgba(0, 0, 0, 0.2);
}

/* 兼容磨砂背景(没有系统玻璃的平台):半透明底色 + 背景模糊(只作用于网页内容)
   + 顶部高光和细描边。Windows、Linux 的底色由下面的平台规则改成实色,Linux 还关掉背景模糊 */
html[data-glass="frosted"] .tp-card {
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.55),
      rgba(255, 255, 255, 0) 120px
    ),
    rgba(244, 244, 247, 0.9);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
html.dark[data-glass="frosted"] .tp-card {
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.06),
      rgba(255, 255, 255, 0) 120px
    ),
    rgba(36, 36, 40, 0.9);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Wayland 由合成器模糊窗口后方的内容,卡片仅画半透明底色。 */
html[data-glass="wayland-blur"] .tp-card {
  background: rgba(235, 235, 237, 0.76);
}
html.dark[data-glass="wayland-blur"] .tp-card {
  background: rgba(36, 36, 40, 0.74);
}

/* Windows / Linux 回退:卡片自己提供完整底色,避免桌面内容透进菜单。
   Linux WebKitGTK 回退到软件渲染时,实色画布可避免轻量模式重建面板后
   悬停或调整大小时出现透明缺块(#9216)。
   保留卡片上的控件、选中态和用量区块的层次;Windows 卡片之外的画布仍透明。 */
html [data-platform="windows"] .tp-card,
html:not([data-glass="wayland-blur"]) [data-platform="linux"],
html:not([data-glass="wayland-blur"]) [data-platform="linux"] .tp-card {
  background: #ebebed;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
html.dark [data-platform="windows"] .tp-card,
html.dark:not([data-glass="wayland-blur"]) [data-platform="linux"],
html.dark:not([data-glass="wayland-blur"]) [data-platform="linux"] .tp-card {
  background: #242428;
}

/* 两栏时子面板和主面板之间一条分隔线 */
html[data-layout="joined"] .tp-sub[data-side="right"] {
  border-left: 1px solid rgba(0, 0, 0, 0.08);
}
html[data-layout="joined"] .tp-sub[data-side="left"] {
  border-right: 1px solid rgba(0, 0, 0, 0.08);
}
html.dark[data-layout="joined"] .tp-sub[data-side="right"] {
  border-left-color: rgba(255, 255, 255, 0.08);
}
html.dark[data-layout="joined"] .tp-sub[data-side="left"] {
  border-right-color: rgba(255, 255, 255, 0.08);
}

/* 滚动条样式用 index.css 的全局样式;不设 scrollbar-width,否则 WebView2 会忽略它 */
.tp-scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* 子面板展开:淡入并略微滑入(玻璃在原生层同步淡入) */
@keyframes tp-sub-in-right {
  from {
    opacity: 0;
    transform: translateX(-6px);
  }
}
@keyframes tp-sub-in-left {
  from {
    opacity: 0;
    transform: translateX(6px);
  }
}
html[data-layout="floating"] .tp-sub[data-side="right"] {
  animation: tp-sub-in-right 140ms ease-out;
}
html[data-layout="floating"] .tp-sub[data-side="left"] {
  animation: tp-sub-in-left 140ms ease-out;
}
/* 子面板换到另一个应用:新内容第一帧就在,只从半透明淡到不透明,不淡出、不动卡片
   (卡片下的原生玻璃不跟网页动画,只淡内容才不会露出空玻璃) */
@keyframes tp-sub-swap {
  from {
    opacity: 0.5;
  }
}
.tp-sub[data-swap] > * {
  animation: tp-sub-swap 90ms ease-out;
}
@media (prefers-reduced-motion: reduce) {
  html[data-layout="floating"] .tp-sub,
  .tp-sub[data-swap] > * {
    animation: none;
  }
}