/* ==================================================================
   Ubuntu 22.04 LTS · GNOME 42 · Yaru — 网页版桌面模拟
   样式表：Design Tokens 全部落在 :root 与主题块里，组件只引用变量。

   数值来源：ubuntu-gnome42-ui-spec.md
   动效：唯一缓动 --ease = cubic-bezier(0.25,0.46,0.45,0.94)（GTK/Yaru EASE_OUT_QUAD）
        时长统一落在 120 / 150 / 200 / 250 / 300ms 区间内（源码 400ms 压到 300ms）。
   ================================================================== */

/* ------------------------------------------------------------------
   0. 基础重置
   ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; overflow: hidden; }
body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.4;
  color: var(--text-primary);
  background: #1d1d1d;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: default; }
input, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; font-weight: inherit; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { display: block; flex: none; fill: none; }
.ic use { pointer-events: none; }

/* ------------------------------------------------------------------
   1. Design Tokens —— 规格书基准值
   ------------------------------------------------------------------ */
:root {
  /* 动效：全局唯一缓动曲线 + 五档时长（全部落在 120–300ms） */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --dur-120: 120ms;
  --dur-150: 150ms;
  --dur-200: 200ms;
  --dur-250: 250ms;
  --dur-300: 300ms;

  /* 几何：GNOME Shell 42 / GTK3 Yaru */
  --panel-h: 28px;            /* 顶栏 28px */
  --dock-w: 76px;             /* Dock 通高，图标固定 48px */
  --dock-icon: 48px;
  --titlebar-h: 46px;         /* GTK3 Yaru $_headerbar_height = 46px */
  --radius-window: 12px;      /* Yaru CSD 12px */
  --radius-window-max: 0px;
  --wbtn-hit: 28px;           /* 窗口按钮命中区 28×28 */
  --wbtn-dot: 20px;           /* 窗口按钮可见圆 20px */
  --radius-dash: 18px;        /* .dash-background border-radius:18px */
  --radius-popup: 10px;       /* .popup-menu-content border-radius:10px */
  --radius-menu-item: 6px;    /* 菜单项 border-radius:6px */
  --radius-grid-tile: 12px;   /* 应用网格磁贴 12px */
  --icon-grid-size: 96px;     /* 应用网格图标 96px */
  --aggregate-menu-w: 323px;  /* .aggregate-menu min-width:22em ≈ 323px */
  --ws-strip-w: 32px;         /* 工作区缩略图条 32px */

  /* 字体：Ubuntu 11pt ≈ 14.67px */
  --font: "Ubuntu", "Ubuntu Beta", "Cantarell", "DejaVu Sans",
          "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "Ubuntu Mono", "Ubuntu Mono 13", "DejaVu Sans Mono", Consolas, monospace;
  --fs-caption: 12px;   /* 9pt */
  --fs-body: 14.67px;   /* 11pt，GNOME Shell 基准 */
  --fs-subtitle: 15px;
  --fs-title: 20px;     /* %title_1 20pt/800 */

  /* Yaru 调色板（两个主题共用） */
  --orange: #E95420;
  --orange-dark: #DF4916;      /* 深色下的选中 / 运行指示 */
  --focus-bg: #F08561;         /* 概览里活动工作区指示器 */
  --jet: #181818;
  --porcelain: #F7F7F7;
  --red: #c7162b;
  --green: #0e8420;
  --yellow: #f99b11;
  --blue: #19B6EE;
  --ash: #878787;
}

/* ---------- 深色主题（Ubuntu 22.04 默认） ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --window-bg: #2C2C2C;        /* window background */
  --base-bg: #272727;          /* window/base、sidebar */
  --headerbar-bg: #252525;     /* headerbar */
  --border: #181818;           /* borders */
  --text-primary: #F7F7F7;
  --text-secondary: #919191;
  --text-disabled: rgba(247, 247, 247, .35);
  --hover: rgba(247, 247, 247, .10);
  --hover-strong: rgba(247, 247, 247, .15);
  --active-bg: rgba(247, 247, 247, .25);
  --card-bg: rgba(247, 247, 247, .06);
  --card-hover: rgba(247, 247, 247, .11);
  --accent: #DF4916;           /* 深色下选中/强调 */
  --accent-flat: #E95420;      /* 强调色本体 */
  --on-accent: #FFFFFF;
  --sidebar-sel: rgba(255, 255, 255, .09);   /* Nautilus 侧边栏选中：灰 */
  --sidebar-hover: rgba(255, 255, 255, .04);
  --panel-bg: #131313;         /* $panel_bg_color 不透明 */
  --panel-fg: #F2F2F2;
  --dash-bg: rgba(19, 19, 19, .75);          /* dock 背景，无模糊 */
  --dash-bg-solid: #131313;                  /* 概览中完全不透明 */
  --system-bg: #222222;        /* 活动概览背景 */
  --shell-border: #464646;     /* $borders_color_dark */
  --scrollbar: rgba(247, 247, 247, .30);
  --shadow-window: 0 1px 3px 3px transparent,
                   0 2px 8px 2px rgba(0, 0, 0, .13),
                   0 3px 20px 10px rgba(0, 0, 0, .09),
                   0 6px 32px 16px rgba(0, 0, 0, .04),
                   0 0 0 1px rgba(0, 0, 0, .05);
  --shadow-window-idle: 0 2px 6px 2px rgba(0, 0, 0, .10),
                        0 0 0 1px rgba(0, 0, 0, .05);
  --shadow-popup: 0 2px 4px rgba(0, 0, 0, .10), 0 0 0 1px rgba(247, 247, 247, .07);
  --wallpaper:
    radial-gradient(115% 85% at 18% 88%, rgba(233, 84, 32, .92) 0%, rgba(214, 74, 30, .58) 26%, transparent 62%),
    radial-gradient(105% 80% at 84% 16%, rgba(247, 148, 30, .82) 0%, rgba(233, 84, 32, .40) 30%, transparent 66%),
    radial-gradient(80% 62% at 62% 72%, rgba(122, 45, 118, .78) 0%, transparent 64%),
    radial-gradient(72% 58% at 26% 26%, rgba(74, 36, 122, .82) 0%, transparent 66%),
    radial-gradient(58% 46% at 50% 50%, rgba(247, 178, 74, .32) 0%, transparent 72%),
    conic-gradient(from 214deg at 52% 46%, rgba(235, 90, 40, .30), rgba(84, 36, 118, .26) 34%, rgba(247, 148, 30, .28) 62%, rgba(233, 84, 32, .30)),
    linear-gradient(146deg, #3A1030 0%, #4E1A3C 24%, #6B2340 46%, #8A2F2A 68%, #C2441F 86%, #E95420 100%);
}

/* ---------- 浅色主题（Yaru light） ---------- */
:root[data-theme="light"] {
  color-scheme: light;
  --window-bg: #FAFAFA;
  --base-bg: #FFFFFF;
  --headerbar-bg: #FFFFFF;
  --border: #C7C7C7;
  --text-primary: #3D3D3D;
  --text-secondary: #9B9B9B;
  --text-disabled: rgba(61, 61, 61, .35);
  --hover: rgba(0, 0, 0, .06);
  --hover-strong: rgba(0, 0, 0, .10);
  --active-bg: rgba(0, 0, 0, .16);
  --card-bg: rgba(0, 0, 0, .04);
  --card-hover: rgba(0, 0, 0, .07);
  --accent: #E95420;
  --accent-flat: #E95420;
  --on-accent: #FFFFFF;
  --sidebar-sel: rgba(0, 0, 0, .09);
  --sidebar-hover: rgba(0, 0, 0, .04);
  --panel-bg: #131313;         /* Shell 面板在浅色下依旧深色 */
  --panel-fg: #F2F2F2;
  --dash-bg: rgba(19, 19, 19, .75);
  --dash-bg-solid: #131313;
  --system-bg: #222222;
  --shell-border: #464646;
  --scrollbar: rgba(0, 0, 0, .28);
  --shadow-window: 0 2px 8px 2px rgba(0, 0, 0, .14),
                   0 3px 20px 10px rgba(0, 0, 0, .07),
                   0 0 0 1px rgba(0, 0, 0, .08);
  --shadow-window-idle: 0 1px 4px 1px rgba(0, 0, 0, .12), 0 0 0 1px rgba(0, 0, 0, .06);
  --shadow-popup: 0 2px 4px rgba(0, 0, 0, .12), 0 0 0 1px rgba(0, 0, 0, .09);
  --wallpaper:
    radial-gradient(115% 85% at 18% 88%, rgba(233, 84, 32, .78) 0%, rgba(228, 120, 60, .46) 26%, transparent 62%),
    radial-gradient(105% 80% at 84% 16%, rgba(250, 176, 80, .78) 0%, rgba(240, 140, 60, .38) 30%, transparent 66%),
    radial-gradient(80% 62% at 62% 72%, rgba(156, 96, 158, .62) 0%, transparent 64%),
    radial-gradient(72% 58% at 26% 26%, rgba(122, 88, 172, .66) 0%, transparent 66%),
    radial-gradient(58% 46% at 50% 50%, rgba(255, 206, 140, .40) 0%, transparent 72%),
    linear-gradient(146deg, #6B2A56 0%, #8A3A5E 22%, #A8515A 44%, #C86A44 66%, #E28A3C 86%, #F2A24C 100%);
}

/* ------------------------------------------------------------------
   2. 舞台与壁纸
   ------------------------------------------------------------------ */
.stage {
  position: fixed;
  inset: var(--panel-h) 0 0 var(--dock-w);   /* 工作区 = 视口 − 顶栏 − Dock */
  overflow: hidden;
  isolation: isolate;
}
.wallpaper {
  position: absolute;
  inset: 0;
  background: var(--wallpaper);
  background-size: cover;
  transition: background var(--dur-250) var(--ease);
}
/* 亮度滑块：整体压暗遮罩 */
.stage::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, var(--dim, 0));
  pointer-events: none;
  z-index: 850;
  transition: background var(--dur-120) var(--ease);
}

/* ------------------------------------------------------------------
   3. 桌面图标
   ------------------------------------------------------------------ */
.desktop-icons {
  position: absolute;
  top: 12px; left: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 1;
}
.dicon {
  width: 92px;
  padding: 10px 4px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  transition: background var(--dur-150) var(--ease), box-shadow var(--dur-150) var(--ease);
}
.dicon-img { display: grid; place-items: center; color: var(--porcelain); }
.dicon-text {
  font-size: var(--fs-caption);
  line-height: 1.3;
  color: #FFFFFF;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .8);
  text-align: center;
  word-break: break-all;
}
.dicon:hover { background: rgba(238, 238, 236, .15); }
.dicon:active { background: rgba(238, 238, 236, .24); }
.dicon.selected { background: rgba(233, 84, 32, .40); box-shadow: inset 0 0 0 1px rgba(233, 84, 32, .85); }

/* ------------------------------------------------------------------
   4. 顶栏（28px / #131313 / 粗体 14.67px）
   ------------------------------------------------------------------ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--panel-h);
  z-index: 640;
  display: flex;
  align-items: stretch;
  background: var(--panel-bg);
  color: var(--panel-fg);
  font-size: var(--fs-body);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
.panel-btn {
  display: flex;
  align-items: center;
  height: 100%;
  border: 3px solid transparent;
  border-radius: 99px;
  color: var(--panel-fg);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 0 0 100px rgba(242, 242, 242, 0);
  transition: box-shadow var(--dur-250) var(--ease), color var(--dur-250) var(--ease);
}
.panel-btn:hover { box-shadow: inset 0 0 0 100px rgba(242, 242, 242, .15); }
.panel-btn:active, .panel-btn.active { box-shadow: inset 0 0 0 100px rgba(242, 242, 242, .20); }
.panel-btn.activities { padding: 0 15px; flex: none; }
.panel-btn.clock {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  padding: 0 12px;
}
.panel-btn.status {
  margin-left: auto;
  gap: 2px;
  padding: 0 12px;
}
.panel-btn.status .st-icon { padding: 5px; box-sizing: content-box; width: 16px; height: 16px; }

/* ------------------------------------------------------------------
   5. Ubuntu Dock（左侧、通高、图标固定 48px、无模糊）
   ------------------------------------------------------------------ */
.dock {
  position: fixed;
  top: var(--panel-h);
  left: 0;
  bottom: 0;
  width: var(--dock-w);
  z-index: 620;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
/* extend-height=true：背景通高；图标组在背景内垂直居中 */
.dash-background {
  pointer-events: auto;
  align-self: stretch;
  flex: 1;
  margin: 6px 1px 6px 4px;
  padding: 3px 3px;
  border-radius: var(--radius-dash);
  background: var(--dash-bg);          /* rgba(19,19,19,0.75)，无 backdrop-filter */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  transition: background var(--dur-200) var(--ease);
}
.dash-background::-webkit-scrollbar { width: 0; }
.dock-item {
  position: relative;
  width: 60px;
  height: 54px;
  padding: 1px 4px 1px 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background var(--dur-200) var(--ease);
}
.dock-item .overview-icon {
  width: var(--dock-icon);
  height: var(--dock-icon);
  display: grid;
  place-items: center;
  border-radius: 8px;
  transition: background var(--dur-200) var(--ease), transform var(--dur-200) var(--ease);
}
.dock-item:hover .overview-icon { background: rgba(238, 238, 236, .15); }
.dock-item.focused .overview-icon { background: rgba(238, 238, 236, .20); }
.dock-item:active .overview-icon { transform: scale(.94); }
/* 运行指示：DOTS 风格，最多 4 个，贴图标底边 */
.dock-dots {
  position: absolute;
  left: 50%;
  bottom: 1px;
  transform: translateX(-50%);
  display: flex;
  gap: 2px;
  pointer-events: none;
}
.dock-dot {
  width: 5px; height: 5px;
  border-radius: 5px;
  background: #DF4916;
  margin-bottom: 0;
}
.dock-sep {
  width: 42px;
  height: 1px;
  margin: 4px 0 4px 8px;
  background: rgba(238, 238, 236, .30);
}

/* ------------------------------------------------------------------
   6. 窗口（Yaru CSD）
   ------------------------------------------------------------------ */
.win-layer { position: absolute; inset: 0; z-index: 100; }
/* 这一层铺满整个桌面，必须对指针透明，否则会截走桌面图标与右键菜单的点击；
   窗口是它的直接子元素，单独恢复事件接收。 */
.win-layer { pointer-events: none; }
.win-layer > * { pointer-events: auto; }

.window {
  position: absolute;
  display: flex;
  flex-direction: column;
  min-width: 360px;
  min-height: 220px;
  border-radius: var(--radius-window);
  background: var(--window-bg);
  box-shadow: var(--shadow-window);
  overflow: hidden;
  transition: box-shadow var(--dur-250) var(--ease),
              opacity var(--dur-250) var(--ease),
              transform var(--dur-250) var(--ease),
              border-radius var(--dur-250) var(--ease),
              left var(--dur-250) var(--ease),
              top var(--dur-250) var(--ease),
              width var(--dur-250) var(--ease),
              height var(--dur-250) var(--ease);
}
.window.idle { box-shadow: var(--shadow-window-idle); }
.window.maximized { border-radius: var(--radius-window-max); }
.window.maximized .rz { display: none; }
.window.dragging, .window.resizing {
  transition: none;
  will-change: left, top, width, height;
}
.window.minimizing { pointer-events: none; }

/* 标题栏 46px，标题居中粗体 */
.titlebar {
  flex: 0 0 auto;
  position: relative;
  height: var(--titlebar-h);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  background: var(--headerbar-bg);
  border-bottom: 1px solid var(--border);
  cursor: default;
  touch-action: none;
}
.titlebar .app-ic { display: none; }
.tb-title {
  max-width: calc(100% - 130px);
  font-size: var(--fs-body);
  font-weight: 700;                 /* Ubuntu Bold 11 */
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
.window.idle .tb-title { color: var(--text-secondary); }

/* 窗口按钮：右侧，顺序 最小化 → 最大化 → 关闭；可见圆 20px，命中区 28×28 */
.wbtns {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 0;                       /* 规格：没有额外间隙，圆间距来自各 4px padding */
}
.wbtn {
  position: relative;
  width: var(--wbtn-hit);       /* 28×28 命中区 */
  height: var(--wbtn-hit);
  display: grid;
  place-items: center;
  padding: 0;                   /* 命中区已固定 28px，padding 由 ::before 的 4px 偏移表达 */
  color: var(--text-primary);
  transition: color var(--dur-200) var(--ease);
}
/* Yaru 22.04.1：三个按钮画同一个灰色圆，关闭按钮 hover 不是红色 */
.wbtn::before {
  content: '';
  position: absolute;
  left: 4px; top: 4px;
  width: var(--wbtn-dot);
  height: var(--wbtn-dot);
  border-radius: 50%;
  background: rgba(247, 247, 247, .10);
  transition: background var(--dur-200) var(--ease);
}
.wbtn:hover::before { background: rgba(247, 247, 247, .15); }
.wbtn:active::before { background: rgba(247, 247, 247, .25); }
.wbtn.close:hover::before { background: rgba(247, 247, 247, .15); }
.wbtn.close:active::before { background: rgba(247, 247, 247, .25); }
.wbtn .ic { position: relative; width: 14px; height: 14px; }
.window.idle .wbtn { color: var(--text-secondary); }

.win-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--window-bg);
  color: var(--text-primary);
}

/* 8 向缩放手柄 */
.rz { position: absolute; z-index: 5; touch-action: none; }
.rz-n { top: 0; left: 12px; right: 12px; height: 5px; cursor: ns-resize; }
.rz-s { bottom: 0; left: 12px; right: 12px; height: 5px; cursor: ns-resize; }
.rz-w { left: 0; top: 12px; bottom: 12px; width: 5px; cursor: ew-resize; }
.rz-e { right: 0; top: 12px; bottom: 12px; width: 5px; cursor: ew-resize; }
.rz-nw { left: 0; top: 0; width: 12px; height: 12px; cursor: nwse-resize; }
.rz-ne { right: 0; top: 0; width: 12px; height: 12px; cursor: nesw-resize; }
.rz-sw { left: 0; bottom: 0; width: 12px; height: 12px; cursor: nesw-resize; }
.rz-se { right: 0; bottom: 0; width: 14px; height: 14px; cursor: nwse-resize; }
body.dragging-cursor, body.dragging-cursor * { cursor: grabbing !important; }

/* 贴靠预览框 */
.snap-hint {
  position: absolute;
  z-index: 90;
  border-radius: var(--radius-window);
  background: rgba(233, 84, 32, .16);
  box-shadow: inset 0 0 0 2px rgba(233, 84, 32, .70);
  pointer-events: none;
  transition: left var(--dur-150) var(--ease), top var(--dur-150) var(--ease),
              width var(--dur-150) var(--ease), height var(--dur-150) var(--ease),
              opacity var(--dur-120) var(--ease);
}

/* ------------------------------------------------------------------
   7. 活动概览（#222222，右侧工作区细条，底部 Dash）
   ------------------------------------------------------------------ */
.overview {
  position: fixed;
  inset: var(--panel-h) 0 0 0;
  z-index: 660;
  background: var(--system-bg);
  display: block;
  overflow: hidden;
}
.overview.opening { animation: ov-in var(--dur-250) var(--ease) both; }
.overview.closing { animation: ov-out var(--dur-250) var(--ease) both; }
@keyframes ov-in {
  from { opacity: 0; transform: scale(1.03); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes ov-out {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(1.03); }
}
/* 概览中 Dock 背景完全不透明（GNOME Shell 概览态） */
body.ov-open .dash-background { background: var(--dash-bg-solid); }

/* 搜索框 */
.ov-search-wrap {
  position: absolute;
  top: 34px; left: 50%;
  transform: translateX(-50%);
  width: 372px;
  max-width: calc(100vw - var(--dock-w) - 80px);
  z-index: 4;
}
.ov-search {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-radius: 19px;
  background: rgba(238, 238, 236, .10);
  border: 1px solid rgba(242, 242, 242, .18);
  color: #F2F2F2;
  transition: background var(--dur-200) var(--ease), border-color var(--dur-200) var(--ease);
}
.ov-search:focus-within { background: rgba(238, 238, 236, .16); border-color: var(--accent-flat); }
.ov-search input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: transparent;
  font-size: var(--fs-body);
  color: #F2F2F2;
}
.ov-search input::placeholder { color: rgba(242, 242, 242, .62); }
.ov-results {
  margin-top: 10px;
  padding: 6px;
  border-radius: var(--radius-popup);
  background: #1D1D1D;
  border: 1px solid rgba(247, 247, 247, .07);
  box-shadow: var(--shadow-popup);
  max-height: 320px;
  overflow-y: auto;
}
.ov-result {
  width: 100%;
  height: 40px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: var(--radius-menu-item);
  color: #F2F2F2;
  font-size: var(--fs-body);
  text-align: left;
  transition: background var(--dur-200) var(--ease);
}
.ov-result:hover { background: rgba(247, 247, 247, .10); }
.ov-result .ic { width: 24px; height: 24px; }
.ov-result-kind { margin-left: auto; font-size: var(--fs-caption); color: rgba(242, 242, 242, .55); }
.ov-noresult { padding: 16px 12px; color: rgba(242, 242, 242, .60); font-size: var(--fs-body); }

/* 窗口缩略卡片 */
.ov-main {
  position: absolute;
  inset: 96px calc(var(--ws-strip-w) + 24px) 128px var(--dock-w);
  display: flex;
  align-items: center;
  justify-content: center;
}
.win-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  max-height: 100%;
  overflow-y: auto;
}
.win-pick {
  width: 244px;
  padding: 6px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: background var(--dur-200) var(--ease);
}
.win-pick:hover { background: rgba(238, 238, 236, .10); }
.win-pick.active { background: rgba(238, 238, 236, .13); }
.win-thumb {
  width: 100%;
  height: 150px;
  position: relative;
  border-radius: 8px;
  background: #2C2C2C;
  border: 1px solid rgba(70, 70, 70, .9);
  overflow: hidden;
}
.win-thumb-bar {
  height: 22px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  background: #252525;
  border-bottom: 1px solid #181818;
}
.win-thumb-bar .ic { width: 12px; height: 12px; }
.win-thumb-name {
  font-size: 10px;
  color: #F7F7F7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.win-thumb-body {
  height: calc(100% - 22px);
  display: grid;
  place-items: center;
  color: rgba(247, 247, 247, .22);
}
.win-thumb-close {
  position: absolute;
  right: 6px; top: 24px;
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(19, 19, 19, .82);
  color: #F7F7F7;
  opacity: 0;
  transition: opacity var(--dur-200) var(--ease), background var(--dur-200) var(--ease);
}
.win-pick:hover .win-thumb-close { opacity: 1; }
.win-thumb-close:hover { background: var(--accent-flat); }
.win-pick-label {
  margin-top: 6px;
  font-size: var(--fs-body);
  color: #F2F2F2;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.win-pick-icon { margin-top: -14px; }
.ov-empty {
  color: rgba(242, 242, 242, .66);
  font-size: var(--fs-body);
}

/* 右侧工作区缩略图条（平时收成 32px） */
.workspace-thumbs {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: var(--ws-strip-w);
  padding: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  z-index: 3;
}
.ws-thumb {
  width: 20px;
  height: 54px;
  border-radius: 3px;
  background: #1D1D1D;
  border: 1px solid var(--shell-border);
  color: rgba(242, 242, 242, .70);
  font-size: 9px;
  overflow: hidden;
  display: grid;
  place-items: center;
  transition: width var(--dur-250) var(--ease), border-color var(--dur-250) var(--ease),
              background var(--dur-250) var(--ease);
}
.ws-thumb-inner { writing-mode: vertical-rl; text-orientation: mixed; letter-spacing: 1px; }
.ws-thumb:hover { width: 28px; }
.ws-thumb.active { width: 32px; border: 2px solid var(--focus-bg); }

/* 底部 Dash */
.ov-dash {
  position: absolute;
  left: var(--dock-w);
  right: var(--ws-strip-w);
  bottom: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 3;
}
.ov-dash-inner {
  max-width: 100%;
  padding: 6px 10px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  border-radius: 12px;
  background: rgba(19, 19, 19, .55);
  overflow-x: auto;
  scrollbar-width: none;
}
.ov-dash-inner::-webkit-scrollbar { height: 0; }
.ov-dash-item {
  position: relative;
  width: 62px;
  height: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  padding-top: 4px;
  border-radius: 12px;
  transition: background var(--dur-200) var(--ease);
}
.ov-dash-item:hover { background: rgba(238, 238, 236, .15); }
.ov-dash-item.focused { background: rgba(238, 238, 236, .20); }
.ov-dash-item .ic { width: 48px; height: 48px; }
.ov-dash-label {
  font-size: 11px;
  line-height: 1.2;
  color: #F2F2F2;
  max-width: 58px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ov-dash-item .dock-dots { bottom: 8px; }
.ov-pager { display: flex; gap: 8px; }
.ov-dot {
  width: 10px; height: 10px;
  border-radius: 10px;
  background: #FFFFFF;
  opacity: 128 / 255;
  transform: scale(0.6667);
  transition: opacity var(--dur-250) var(--ease), transform var(--dur-250) var(--ease);
}
.ov-dot.active { opacity: 1; transform: scale(1); }

/* 应用网格 */
.app-grid-view {
  position: absolute;
  inset: 96px 0 118px 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  z-index: 3;
}
.app-grid-view.opening { animation: grid-in var(--dur-250) var(--ease) both; }
@keyframes grid-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.icon-grid {
  display: grid;
  grid-template-columns: repeat(6, var(--icon-grid-size));
  row-gap: 12px;
  column-gap: 12px;
  padding: 24px 12px;
  align-content: start;
  justify-content: center;
}
.icon-grid-item {
  width: var(--icon-grid-size);
  min-height: 110px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-grid-tile);
  border: 2px solid transparent;
  color: #F2F2F2;
  transition: background var(--dur-200) var(--ease), border-color var(--dur-200) var(--ease);
}
.icon-grid-item:hover { background: rgba(238, 238, 236, .10); }
.icon-grid-item.selected { background: rgba(238, 238, 236, .13); border-color: rgba(238, 238, 236, .28); }
.icon-grid-item .ic { width: var(--icon-grid-size); height: var(--icon-grid-size); }
.icon-grid-label {
  font-size: var(--fs-body);
  line-height: 1.24;
  text-align: center;
  max-width: 84px;
  color: #F2F2F2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.icon-grid-item .dock-dots { position: static; transform: none; margin-top: -6px; margin-bottom: 8px; }

/* ------------------------------------------------------------------
   8. 聚合状态菜单（GNOME 42：若干独立面板按钮，非胶囊）
   ------------------------------------------------------------------ */
.panel-menu {
  position: fixed;
  top: calc(var(--panel-h) + 4px);
  right: 6px;
  z-index: 700;
  min-width: var(--aggregate-menu-w);
  padding: 6px;
  border-radius: var(--radius-popup);
  background: #1D1D1D;
  border: 1px solid rgba(247, 247, 247, .07);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .35);
  color: #F2F2F2;
}
.panel-menu.opening { animation: pm-in var(--dur-200) var(--ease) both; transform-origin: top right; }
@keyframes pm-in { from { opacity: 0; transform: scale(.97) translateY(-6px); } to { opacity: 1; transform: none; } }
.pm-section { padding: 6px 0; }
.pm-section + .pm-section { border-top: 1px solid rgba(247, 247, 247, .07); }
.pm-slider-row { display: flex; align-items: center; gap: 10px; padding: 5px 6px; }
.pm-icon-btn {
  width: 30px; height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #F2F2F2;
  transition: background var(--dur-200) var(--ease);
}
.pm-icon-btn:hover { background: rgba(247, 247, 247, .10); }
.pm-icon-btn.static { pointer-events: none; color: rgba(242, 242, 242, .80); }
.pm-slider { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.pm-slider-track {
  position: relative;
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: rgba(247, 247, 247, .18);
  cursor: pointer;
  touch-action: none;
}
.pm-slider-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 42%;
  border-radius: 3px;
  background: var(--accent-flat);
  transition: width var(--dur-120) var(--ease);
}
.pm-slider-knob {
  position: absolute;
  top: 50%; left: 42%;
  width: 14px; height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .5);
  transition: left var(--dur-120) var(--ease);
}
.pm-slider-val {
  width: 40px;
  text-align: right;
  font-size: var(--fs-caption);
  color: rgba(242, 242, 242, .70);
  font-variant-numeric: tabular-nums;
}
.pm-toggle {
  width: 100%;
  height: 44px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: var(--radius-menu-item);
  color: #F2F2F2;
  text-align: left;
  transition: background var(--dur-200) var(--ease);
}
.pm-toggle:hover { background: rgba(247, 247, 247, .10); }
.pm-toggle .ic { color: rgba(242, 242, 242, .80); }
.pm-toggle-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pm-toggle-t { font-size: var(--fs-body); }
.pm-toggle-s { font-size: var(--fs-caption); color: rgba(242, 242, 242, .60); }
.pm-switch {
  position: relative;
  width: 40px; height: 22px;
  flex: none;
  border-radius: 11px;
  background: rgba(247, 247, 247, .18);
  transition: background var(--dur-200) var(--ease);
}
.pm-switch::after {
  content: '';
  position: absolute;
  left: 2px; top: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #FFFFFF;
  transition: transform var(--dur-200) var(--ease);
}
.pm-toggle.on .pm-switch { background: var(--accent-flat); }
.pm-toggle.on .pm-switch::after { transform: translateX(18px); }
.pm-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 2px;
  border-top: 1px solid rgba(247, 247, 247, .07);
}
.pm-battery {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-caption);
  color: rgba(242, 242, 242, .80);
}
.pm-foot-btns { display: flex; gap: 2px; }

/* ------------------------------------------------------------------
   9. 右键菜单
   ------------------------------------------------------------------ */
.ctx {
  position: fixed;
  z-index: 720;
  min-width: 220px;
  max-width: 320px;
  padding: 6px;
  border-radius: var(--radius-popup);
  background: #1D1D1D;
  border: 1px solid rgba(247, 247, 247, .07);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .35);
  color: #F2F2F2;
  font-size: var(--fs-body);
}
.ctx.opening { animation: ctx-in var(--dur-150) var(--ease) both; transform-origin: top left; }
@keyframes ctx-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.ctx-item {
  width: 100%;
  min-height: 34px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: var(--radius-menu-item);
  text-align: left;
  transition: background var(--dur-200) var(--ease), color var(--dur-200) var(--ease);
}
.ctx-item:hover { background: rgba(247, 247, 247, .10); }
.ctx-item.disabled { color: rgba(242, 242, 242, .35); pointer-events: none; }
.ctx-item .ic { width: 16px; height: 16px; color: rgba(242, 242, 242, .80); }
.ctx-item .ctx-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-item .ctx-key { font-size: var(--fs-caption); color: rgba(242, 242, 242, .55); }
.ctx-sep { height: 1px; margin: 6px 8px; background: rgba(247, 247, 247, .10); }
.ctx-head {
  padding: 8px 12px 6px;
  font-size: var(--fs-caption);
  font-weight: 700;
  color: rgba(242, 242, 242, .55);
}

/* ------------------------------------------------------------------
   10. 对话框 / 轻提示
   ------------------------------------------------------------------ */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 760;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .48);
}
.scrim.opening { animation: fade-in var(--dur-200) var(--ease) both; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.dialog {
  width: 420px;
  max-width: calc(100vw - 48px);
  padding: 22px;
  border-radius: var(--radius-window);
  background: var(--window-bg);
  color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: 0 8px 40px rgba(0, 0, 0, .5);
  animation: dlg-in var(--dur-250) var(--ease) both;
}
@keyframes dlg-in { from { opacity: 0; transform: scale(.96) translateY(10px); } to { opacity: 1; transform: none; } }
.dialog-title { font-size: var(--fs-title); font-weight: 700; margin-bottom: 10px; }
.dialog-body { font-size: var(--fs-body); color: var(--text-secondary); margin-bottom: 22px; line-height: 1.55; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; }
.btn {
  min-width: 96px;
  height: 34px;
  padding: 0 16px;
  border-radius: 6px;
  background: var(--hover);
  color: var(--text-primary);
  font-size: var(--fs-body);
  transition: background var(--dur-200) var(--ease);
}
.btn:hover { background: var(--hover-strong); }
.btn.primary { background: var(--accent-flat); color: #FFFFFF; font-weight: 700; }
.btn.primary:hover { background: #F0862B; }
.btn.destructive { background: var(--red); color: #FFFFFF; font-weight: 700; }

.toast-wrap {
  position: fixed;
  right: 14px;
  bottom: 18px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 380px;
  padding: 12px 16px;
  border-radius: var(--radius-popup);
  background: #1D1D1D;
  border: 1px solid rgba(247, 247, 247, .07);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .45);
  color: #F2F2F2;
  font-size: var(--fs-body);
  animation: toast-in var(--dur-250) var(--ease) both;
}
.toast.out { animation: toast-out var(--dur-200) var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); } }
.toast .ic { color: var(--accent-flat); }

/* ------------------------------------------------------------------
   11. 应用：文件（Nautilus 42）
   ------------------------------------------------------------------ */
.app-files { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--window-bg); }
.nf-header {
  flex: none;
  height: var(--titlebar-h);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  background: var(--headerbar-bg);
  border-bottom: 1px solid var(--border);
}
.nf-nav { display: flex; align-items: center; gap: 2px; }
.nf-nav-btn {
  width: 32px; height: 30px;
  display: grid; place-items: center;
  border-radius: 6px;
  color: var(--text-primary);
  transition: background var(--dur-200) var(--ease);
}
.nf-nav-btn:hover { background: var(--hover); }
.nf-nav-btn:disabled { color: var(--text-disabled); pointer-events: none; }
.path-bar-box {
  flex: 1;
  min-width: 0;
  height: 30px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 6px 0 4px;
  border-radius: 5px;
  background: var(--base-bg);
  border: 1px solid var(--border);
  overflow: hidden;
}
.crumb {
  height: 24px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 4px;
  font-size: var(--fs-caption);
  color: var(--text-primary);
  white-space: nowrap;
  transition: background var(--dur-200) var(--ease);
}
.crumb:hover { background: var(--hover); }
.crumb.current { font-weight: 700; }
.crumb-sep { color: var(--text-secondary); display: grid; place-items: center; }
.nf-view-btn {
  width: 30px; height: 30px;
  margin-left: auto;
  display: grid; place-items: center;
  border-radius: 6px;
  color: var(--text-primary);
  transition: background var(--dur-200) var(--ease);
}
.nf-view-btn:hover { background: var(--hover); }
.nf-menu-btn {
  width: 34px; height: 30px;
  display: grid; place-items: center;
  border-radius: 6px;
  color: var(--text-primary);
  transition: background var(--dur-200) var(--ease);
}
.nf-menu-btn:hover { background: var(--hover); }
.nf-main { flex: 1; display: flex; min-height: 0; }
.nf-side {
  width: 176px;
  flex: none;
  padding: 8px 6px;
  overflow-y: auto;
  background: var(--base-bg);
  border-right: 1px solid var(--border);
}
.nf-side-item {
  width: 100%;
  height: 30px;
  padding: 0 12px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 6px;
  font-size: var(--fs-caption);
  color: var(--text-primary);
  text-align: left;
  transition: background var(--dur-200) var(--ease);
}
.nf-side-item:hover { background: var(--sidebar-hover); }
/* 侧边栏选中：灰色，文字保持正常色（Yaru 故意不在侧边栏用橙色） */
.nf-side-item.active { background: var(--sidebar-sel); color: var(--text-primary); }
.nf-side-item .ic { width: 16px; height: 16px; color: var(--text-secondary); }
.nf-side-gap { height: 8px; }
.nf-side-title {
  padding: 10px 12px 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}
.nf-files { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--base-bg); }
.nf-files-toolbar {
  flex: none;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: var(--fs-caption);
}
.nf-list { flex: 1; overflow-y: auto; padding: 2px 0; }
.nf-head, .nf-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 116px 108px 92px;
  gap: 8px;
  align-items: center;
  padding: 0 12px;
}
.nf-head {
  flex: none;
  height: 30px;
  font-size: var(--fs-caption);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
.nf-row {
  min-height: 28px;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-caption);
  color: var(--text-primary);
  transition: background var(--dur-200) var(--ease), color var(--dur-200) var(--ease);
}
.nf-row:hover { background: var(--hover); }
/* 列表选中：橙色 + 白字 */
.nf-row.selected { background: var(--accent); color: #FFFFFF; }
.nf-row.selected .nf-dim { color: rgba(255, 255, 255, .88); }
.nf-row.selected .ic { color: #FFFFFF; }
.nf-star { display: grid; place-items: center; color: var(--text-secondary); }
.nf-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.nf-name .ic { width: 17px; height: 17px; color: var(--text-secondary); }
.nf-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nf-dim { color: var(--text-secondary); }
.nf-status {
  flex: none;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: var(--fs-caption);
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
}
.nf-empty { padding: 30px 12px; text-align: center; color: var(--text-secondary); font-size: var(--fs-body); }

/* ------------------------------------------------------------------
   12. 应用：终端
   ------------------------------------------------------------------ */
.app-term {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #2C001E;
  padding: 6px 8px 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.42;
}
.term-out {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: #F2F2F2;
  user-select: text;
}
.term-line { white-space: pre-wrap; }
.term-prompt { color: #8AE234; }
.term-path { color: #729FCF; }
.term-inline { display: flex; align-items: baseline; gap: 0; }
.term-input {
  flex: 1;
  min-width: 40px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #F2F2F2;
  font-family: var(--font-mono);
  font-size: 13px;
  caret-color: #F2F2F2;
}
.term-cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  margin-left: -7px;
  background: rgba(242, 242, 242, .75);
  animation: caret var(--dur-300) steps(1) infinite alternate;
}
@keyframes caret { from { opacity: 1; } to { opacity: 0; } }

/* ------------------------------------------------------------------
   13. 应用：计算器
   ------------------------------------------------------------------ */
.app-calc { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 0 8px 8px; background: var(--window-bg); }
.calc-mode { padding: 6px 6px 2px; font-size: var(--fs-caption); color: var(--text-secondary); }
.calc-display {
  padding: 6px 8px 12px;
  text-align: right;
  font-size: 40px;
  line-height: 1.1;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}
.calc-grid { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.calc-btn {
  border-radius: 6px;
  background: var(--hover);
  color: var(--text-primary);
  font-size: 17px;
  transition: background var(--dur-200) var(--ease), transform var(--dur-120) var(--ease);
}
.calc-btn:hover { background: var(--hover-strong); }
.calc-btn:active { transform: scale(.97); }
.calc-btn.fn { font-size: 15px; background: rgba(247, 247, 247, .04); color: var(--text-secondary); }
.calc-btn.fn:hover { background: var(--hover); color: var(--text-primary); }
.calc-btn.eq { background: var(--accent-flat); color: #FFFFFF; }
.calc-btn.eq:hover { background: #F0862B; }

/* ------------------------------------------------------------------
   14. 应用：设置
   ------------------------------------------------------------------ */
.app-settings { flex: 1; display: flex; min-height: 0; background: var(--window-bg); }
.set-side {
  width: 220px;
  flex: none;
  padding: 10px 8px;
  overflow-y: auto;
  background: var(--base-bg);
  border-right: 1px solid var(--border);
}
.set-search {
  height: 32px;
  margin: 4px 4px 12px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 6px;
  background: var(--window-bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: var(--fs-caption);
}
.set-nav-item {
  position: relative;
  width: 100%;
  height: 34px;
  padding: 0 12px;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 6px;
  font-size: var(--fs-caption);
  color: var(--text-primary);
  text-align: left;
  transition: background var(--dur-200) var(--ease);
}
.set-nav-item:hover { background: var(--hover); }
.set-nav-item.active { background: var(--sidebar-sel); }
.set-nav-item .ic { width: 16px; height: 16px; color: var(--text-secondary); }
.set-main { flex: 1; min-width: 0; padding: 20px 26px; overflow-y: auto; background: var(--window-bg); }
.set-h1 { font-size: var(--fs-title); font-weight: 700; margin-bottom: 18px; color: var(--text-primary); }
.set-group-title { font-size: var(--fs-body); font-weight: 700; margin: 18px 0 8px; }
.set-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  margin-bottom: 6px;
  border-radius: 10px;
  background: var(--base-bg);
  border: 1px solid var(--border);
  transition: background var(--dur-200) var(--ease);
}
.set-card.clickable:hover { background: var(--hover); }
.set-card .ic { color: var(--text-secondary); }
.set-card-main { flex: 1; min-width: 0; }
.set-card-t { font-size: var(--fs-body); }
.set-card-s { font-size: var(--fs-caption); color: var(--text-secondary); margin-top: 2px; }
.theme-cards { display: flex; gap: 12px; }
.theme-card {
  width: 148px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--base-bg);
  text-align: left;
  transition: border-color var(--dur-200) var(--ease), background var(--dur-200) var(--ease);
}
.theme-card:hover { background: var(--hover); }
.theme-card.active { border-color: var(--accent-flat); box-shadow: 0 0 0 1px var(--accent-flat); }
.theme-preview {
  height: 68px;
  border-radius: 6px;
  margin-bottom: 8px;
  overflow: hidden;
  display: flex;
  border: 1px solid var(--border);
}
.tp-side { width: 34%; }
.tp-body { flex: 1; }
.tp-dark .tp-side { background: #272727; }
.tp-dark .tp-body { background: #2C2C2C; }
.tp-light .tp-side { background: #FCFCFC; }
.tp-light .tp-body { background: #FAFAFA; }
.switch {
  position: relative;
  width: 44px; height: 24px;
  flex: none;
  border-radius: 12px;
  background: rgba(247, 247, 247, .18);
  transition: background var(--dur-200) var(--ease);
}
.switch::after {
  content: '';
  position: absolute;
  left: 2px; top: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #FFFFFF;
  transition: transform var(--dur-200) var(--ease);
}
.switch.on { background: var(--accent-flat); }
.switch.on::after { transform: translateX(20px); }
.accent-dots { display: flex; gap: 8px; }
.accent-dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: border-color var(--dur-200) var(--ease);
}
.accent-dot.active { border-color: var(--text-primary); }
.about-logo { display: grid; place-items: center; padding: 10px 0 16px; }

/* ------------------------------------------------------------------
   15. 应用：文本编辑器 / 图像查看器 / 占位
   ------------------------------------------------------------------ */
.app-editor { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--window-bg); }
.ed-area {
  flex: 1;
  min-height: 0;
  resize: none;
  border: 0;
  outline: 0;
  padding: 12px 14px;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  user-select: text;
}
.ed-status {
  flex: none;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  font-size: var(--fs-caption);
  color: var(--text-secondary);
  background: var(--headerbar-bg);
  border-top: 1px solid var(--border);
}
.viewer-page {
  flex: 1;
  display: grid;
  place-items: center;
  gap: 12px;
  grid-auto-flow: row;
  padding: 20px;
  color: var(--text-secondary);
  background: var(--base-bg);
  font-size: var(--fs-body);
  text-align: center;
}
.placeholder-app {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 30px;
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--fs-body);
}
.placeholder-app .ic { color: rgba(247, 247, 247, .35); }
.placeholder-t {
  font-size: var(--fs-subtitle);
  font-weight: 700;
  color: var(--text-primary);
}
.demo-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 12px;
  background: rgba(233, 84, 32, .18);
  color: var(--accent-flat);
  font-size: var(--fs-caption);
  font-weight: 700;
}
.repl-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--base-bg);
}
.repl-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.repl-btn {
  width: 32px; height: 30px;
  display: grid; place-items: center;
  border-radius: 6px;
  color: var(--text-secondary);
  transition: background var(--dur-200) var(--ease);
}
.repl-btn:hover { background: var(--hover); }
.repl-url {
  flex: 1;
  height: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 15px;
  background: var(--window-bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: var(--fs-caption);
}
.repl-body {
  flex: 1;
  overflow-y: auto;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.repl-title { font-size: var(--fs-title); font-weight: 700; color: var(--text-primary); }
.repl-quick { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.repl-card {
  width: 118px;
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  background: var(--base-bg);
  border: 1px solid var(--border);
  font-size: var(--fs-caption);
  color: var(--text-primary);
  transition: background var(--dur-200) var(--ease); }
.repl-card:hover { background: var(--hover); }
.repl-card .ic { width: 28px; height: 28px; }

/* ------------------------------------------------------------------
   16. 应用：共享剪贴板 / 关于这个系统
   （新增样式只引用既有 Design Token 变量，不引入新的时长 / 缓动硬编码值）
   ------------------------------------------------------------------ */
.app-clip {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 14px 16px 12px;
  gap: 10px;
  background: var(--window-bg);
}
.clip-status {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-menu-item);
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: var(--fs-caption);
}
.clip-status .ic { width: 18px; height: 18px; }
.clip-status-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clip-area {
  flex: 1;
  min-height: 0;
  resize: none;
  padding: 10px 12px;
  border-radius: var(--radius-menu-item);
  border: 1px solid var(--border);
  background: var(--base-bg);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  user-select: text;
  outline: 0;
  transition: border-color var(--dur-200) var(--ease);
}
.clip-area:focus { border-color: var(--accent-flat); }
.clip-area::placeholder { color: var(--text-secondary); }
.clip-actions { flex: none; display: flex; gap: 8px; flex-wrap: wrap; }
.clip-actions .btn { min-width: 0; flex: 1 1 auto; padding: 0 10px; white-space: nowrap; }
.clip-hint { flex: none; font-size: var(--fs-caption); color: var(--text-secondary); line-height: 1.5; }

.app-about {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--window-bg);
  user-select: text;
}
.about-hero {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-popup);
  background: rgba(233, 84, 32, .14);
  border: 1px solid rgba(233, 84, 32, .55);
}
.about-hero-ic { flex: none; }
.about-hero-ic .ic { width: 32px; height: 32px; }
.about-hero-main { min-width: 0; }
.about-hero-t {
  font-size: var(--fs-subtitle);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
}
.about-hero-s {
  margin-top: 4px;
  font-size: var(--fs-caption);
  color: var(--text-secondary);
  line-height: 1.5;
}
.about-hero-s b { color: var(--accent-flat); }
.about-sec-t {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: var(--fs-caption);
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  padding-bottom: 5px;
}
.about-list {
  margin: 0;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: var(--fs-caption);
  line-height: 1.45;
  color: var(--text-primary);
}
.about-list b { color: var(--accent-flat); font-weight: 700; }
.about-list code {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--card-bg);
  color: var(--text-primary);
}
.about-refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: 26px;
  padding: 0 10px;
  border-radius: 13px;
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: var(--fs-caption);
  font-weight: 400;
  transition: background var(--dur-200) var(--ease);
}
.about-refresh:hover { background: var(--card-hover); }
.about-refresh .ic { width: 13px; height: 13px; color: var(--text-secondary); }
.about-kv {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-menu-item);
  overflow: hidden;
  background: var(--card-bg);
}
.about-kv-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 12px;
  font-size: var(--fs-caption);
  border-top: 1px solid rgba(127, 127, 127, .18);
}
.about-kv-row:first-child { border-top: 0; }
.about-kv-k { color: var(--text-secondary); }
.about-kv-v { font-family: var(--font-mono); color: var(--text-primary); text-align: right; }
.about-foot {
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  font-size: var(--fs-caption);
  color: var(--text-secondary);
  text-align: center;
}

/* ------------------------------------------------------------------
   17. 滚动条
   ------------------------------------------------------------------ */
* { scrollbar-width: thin; scrollbar-color: var(--scrollbar) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--scrollbar);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 8px;
}

/* ------------------------------------------------------------------
   18. 无障碍与降级
   ------------------------------------------------------------------ */
:focus-visible { outline: 2px solid var(--accent-flat); outline-offset: 1px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
@media (max-width: 1100px) {
  .icon-grid { grid-template-columns: repeat(4, var(--icon-grid-size)); }
}

/* ------------------------------------------------------------------
   加载 / 启动失败提示
   app.js 成功启动后会移除它，所以它一直可见 = 脚本没有执行。
   ------------------------------------------------------------------ */
.boot-note {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2147483647;
  max-width: 620px;
  padding: 18px 24px;
  border-radius: 10px;
  background: rgba(18, 18, 20, .95);
  color: #fff;
  font: 400 14px/1.9 var(--font, sans-serif);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .6);
}
.boot-note b { color: #ffd166; }
.boot-note-error { border-color: #ff6b6b; }
.boot-note-error b { color: #ff8f8f; }