/* ==================================================================
   Windows 11 桌面（网页版）— 样式表
   规格书 Design Tokens 全部落在 :root 与主题块里，组件只引用变量。
   动效统一 cubic-bezier(0.1,0.9,0.2,1)，时长 120 / 180 / 250 / 300ms。
   ================================================================== */

/* ------------------------------------------------------------------
   0. 基础重置
   ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-primary);
  background: #0a1020;
  -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; }
ul, ol { margin: 0; padding: 0; list-style: none; }
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 {
  /* 动效：全局唯一缓动曲线 + 四档时长 */
  --ease: cubic-bezier(0.1, 0.9, 0.2, 1);
  --dur-120: 120ms;
  --dur-180: 180ms;
  --dur-250: 250ms;
  --dur-300: 300ms;

  /* 几何 */
  --taskbar-h: 48px;          /* 规格：任务栏 48px */
  --startmenu-w: 640px;       /* 规格：开始菜单 640px */
  --titlebar-h: 32px;         /* 规格：标题栏 32px */
  --wbtn-w: 46px;             /* 规格：窗口按钮 46×32 */
  --wbtn-h: 32px;
  --radius-window: 8px;       /* 规格：窗口 8px 圆角 */
  --radius-overlay: 8px;      /* 规格：浮出层 / 开始菜单 8px 圆角 */
  --radius-control: 4px;      /* Fluent：控件 4px */
  --radius-card: 8px;
  --flyout-w: 360px;

  /* 字体与字阶（Fluent 排版 ramp） */
  --font: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI",
          system-ui, -apple-system, "PingFang SC", "Microsoft YaHei UI",
          "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "Cascadia Code", "Cascadia Mono", Consolas, "SF Mono", monospace;
  --fs-caption: 12px;   --lh-caption: 16px;
  --fs-body: 14px;      --lh-body: 20px;
  --fs-subtitle: 20px;  --lh-subtitle: 28px;
  --fs-title: 28px;     --lh-title: 36px;

  /* 强调色（Windows 默认蓝的 Fluent 色阶） */
  --accent-base: #0078d4;
  --accent-light-2: #4cc2ff;
  --accent-dark-1: #0067c0;
}

/* ---------- 深色主题（默认） ---------- */
:root[data-theme="dark"] {
  --fill-base: #202020;
  --fill-base-alt: #0a0a0a;
  --fill-secondary: #1c1c1c;
  --fill-tertiary: #282828;
  --fill-quaternary: #2c2c2c;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, .77);
  --text-tertiary: rgba(255, 255, 255, .53);
  --text-disabled: rgba(255, 255, 255, .36);
  --control-fill: rgba(255, 255, 255, .059);
  --control-fill-2: rgba(255, 255, 255, .082);
  --control-fill-3: rgba(255, 255, 255, .031);
  --subtle-hover: rgba(255, 255, 255, .059);
  --subtle-press: rgba(255, 255, 255, .031);
  --stroke: rgba(255, 255, 255, .071);
  --stroke-2: rgba(255, 255, 255, .094);
  --divider: rgba(255, 255, 255, .082);
  --card-bg: rgba(255, 255, 255, .05);
  --card-bg-hover: rgba(255, 255, 255, .08);
  --acrylic: rgba(32, 32, 32, .70);
  --acrylic-strong: rgba(32, 32, 32, .76);
  --mica-tint: rgba(32, 32, 32, .80);
  --accent: var(--accent-light-2);
  --on-accent: #000000;
  --smoke: rgba(0, 0, 0, .30);
  --scrollbar: rgba(255, 255, 255, .28);
  --shadow-window: 0 0 0 1px rgba(255, 255, 255, .07),
                   0 32px 64px rgba(0, 0, 0, .56),
                   0 2px 21px rgba(0, 0, 0, .40);
  --shadow-window-idle: 0 0 0 1px rgba(255, 255, 255, .05),
                        0 16px 32px rgba(0, 0, 0, .36),
                        0 2px 8px rgba(0, 0, 0, .22);
  --shadow-flyout: 0 0 0 1px rgba(255, 255, 255, .07), 0 16px 40px rgba(0, 0, 0, .48);
  --wallpaper:
    radial-gradient(125% 92% at 50% 120%, rgba(8, 20, 46, 0) 38%, rgba(4, 10, 26, .88) 100%),
    radial-gradient(58% 52% at 50% 46%, rgba(124, 192, 255, .52) 0%, rgba(70, 140, 240, .30) 34%, rgba(30, 70, 170, .12) 58%, transparent 74%),
    radial-gradient(38% 34% at 50% 42%, rgba(196, 228, 255, .72) 0%, rgba(120, 180, 255, .34) 45%, transparent 72%),
    radial-gradient(26% 24% at 50% 40%, rgba(244, 252, 255, .88) 0%, rgba(160, 205, 255, .30) 55%, transparent 78%),
    radial-gradient(72% 62% at 20% 80%, rgba(92, 58, 224, .28) 0%, transparent 62%),
    radial-gradient(72% 62% at 82% 24%, rgba(36, 118, 220, .30) 0%, transparent 62%),
    linear-gradient(180deg, #050b1c 0%, #08132c 42%, #0a1a3a 70%, #061024 100%);
  --wallpaper-folds:
    conic-gradient(from 210deg at 50% 48%, rgba(80, 160, 255, .20), rgba(18, 38, 108, .06) 40%, rgba(140, 90, 255, .18) 68%, rgba(80, 160, 255, .20));
}

/* ---------- 浅色主题 ---------- */
:root[data-theme="light"] {
  --fill-base: #f3f3f3;
  --fill-base-alt: #dadada;
  --fill-secondary: #eeeeee;
  --fill-tertiary: #f9f9f9;
  --fill-quaternary: #ffffff;
  --text-primary: rgba(0, 0, 0, .89);
  --text-secondary: rgba(0, 0, 0, .62);
  --text-tertiary: rgba(0, 0, 0, .45);
  --text-disabled: rgba(0, 0, 0, .36);
  --control-fill: rgba(255, 255, 255, .70);
  --control-fill-2: rgba(249, 249, 249, .50);
  --control-fill-3: rgba(249, 249, 249, .30);
  --subtle-hover: rgba(0, 0, 0, .035);
  --subtle-press: rgba(0, 0, 0, .024);
  --stroke: rgba(0, 0, 0, .059);
  --stroke-2: rgba(0, 0, 0, .16);
  --divider: rgba(0, 0, 0, .059);
  --card-bg: rgba(255, 255, 255, .70);
  --card-bg-hover: rgba(255, 255, 255, .95);
  --acrylic: rgba(243, 243, 243, .65);
  --acrylic-strong: rgba(243, 243, 243, .74);
  --mica-tint: rgba(243, 243, 243, .82);
  --accent: var(--accent-dark-1);
  --on-accent: #ffffff;
  --smoke: rgba(0, 0, 0, .30);
  --scrollbar: rgba(0, 0, 0, .30);
  --shadow-window: 0 0 0 1px rgba(0, 0, 0, .0578),
                   0 32px 64px rgba(0, 0, 0, .28),
                   0 2px 21px rgba(0, 0, 0, .20);
  --shadow-window-idle: 0 0 0 1px rgba(0, 0, 0, .0478),
                        0 16px 32px rgba(0, 0, 0, .16),
                        0 2px 8px rgba(0, 0, 0, .10);
  --shadow-flyout: 0 0 0 1px rgba(0, 0, 0, .06), 0 16px 40px rgba(0, 0, 0, .22);
  /* Bloom 风格：中性浅灰蓝底 + 中心集中一块鲜蓝"花瓣"。
     背景要够"灰"，花的蓝才跳得出来——真实 Bloom 就是这个对比。
     wallpaper-folds 是单独一层，被遮罩限制在中心区。
     想换成你自己的壁纸：把 wallpaper.jpg 放进本目录即可自动生效。 */
  --wallpaper:
    radial-gradient(142% 112% at 50% 46%, rgba(255, 255, 255, 0) 46%, rgba(150, 160, 172, .34) 100%),
    radial-gradient(15% 14% at 47% 43%, rgba(255, 255, 255, .92) 0%, rgba(186, 222, 255, .55) 48%, transparent 80%),
    radial-gradient(33% 32% at 47% 46%, rgba(16, 72, 178, .80) 0%, rgba(28, 102, 208, .68) 36%, rgba(72, 142, 222, .44) 62%, transparent 84%),
    radial-gradient(48% 46% at 47% 46%, rgba(38, 108, 198, .28) 0%, rgba(92, 152, 216, .14) 52%, transparent 78%),
    linear-gradient(180deg, #ccd3da 0%, #dadee3 34%, #e5e9ed 60%, #d2d8de 100%);
  --wallpaper-folds:
    conic-gradient(from 18deg at 47% 46%,
      rgba(14, 62, 168, .46) 0deg, rgba(150, 205, 255, .08) 24deg, rgba(6, 40, 128, .52) 52deg,
      rgba(170, 222, 255, .10) 84deg, rgba(12, 56, 156, .44) 116deg, rgba(140, 200, 255, .08) 150deg,
      rgba(6, 40, 128, .50) 186deg, rgba(160, 216, 255, .09) 220deg, rgba(14, 62, 168, .44) 254deg,
      rgba(150, 205, 255, .08) 292deg, rgba(6, 40, 128, .48) 330deg, rgba(14, 62, 168, .46) 360deg);
}

/* ------------------------------------------------------------------
   2. 舞台与壁纸
   ------------------------------------------------------------------ */
.stage {
  position: fixed;
  inset: 0 0 var(--taskbar-h) 0;   /* 工作区 = 视口 − 任务栏 */
  overflow: hidden;
  isolation: isolate;
}
.wallpaper {
  position: absolute;
  inset: 0;
  background: var(--wallpaper);
  background-size: cover;
  transition: background var(--dur-300) var(--ease);
}
/* 褶皱纹理单独一层，并用径向遮罩限制在中心区，避免漏到四角把背景染蓝 */
.wallpaper-folds {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--wallpaper-folds, none);
  -webkit-mask-image: radial-gradient(48% 46% at 47% 46%, #000 0%, rgba(0, 0, 0, .8) 52%, transparent 82%);
  mask-image: radial-gradient(48% 46% at 47% 46%, #000 0%, rgba(0, 0, 0, .8) 52%, transparent 82%);
  transition: background var(--dur-300) var(--ease);
}
/* 亮度滑块：整体压暗遮罩（不用 filter，避免破坏 backdrop-filter 的 Mica 采样） */
.dimmer {
  position: fixed;
  inset: 0;
  z-index: 890;
  pointer-events: none;
  background: rgba(0, 0, 0, var(--dim, 0));
  transition: background var(--dur-120) var(--ease);
}

/* ------------------------------------------------------------------
   3. 桌面图标
   ------------------------------------------------------------------ */
/* 列优先网格；行数由 JS 按可用高度计算（屏幕矮就多排一列，与 Windows 行为一致） */
.desktop-icons {
  position: absolute;
  top: 6px; left: 6px;
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(9, 94px);
  grid-auto-columns: 92px;
  gap: 0 2px;
  align-content: start;
  z-index: 1;
}
.dicon {
  width: 92px;
  height: 94px;
  padding: 8px 4px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  border-radius: 4px;
  transition: background var(--dur-120) var(--ease), box-shadow var(--dur-120) var(--ease);
}
.dicon-img { width: 34px; height: 34px; display: grid; place-items: center; }
.dicon-text {
  max-width: 86px;
  font-size: 12px;
  line-height: 15px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .85);
  text-align: center;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.dicon:hover { background: rgba(255, 255, 255, .10); }
.dicon.selected { background: rgba(76, 194, 255, .22); box-shadow: inset 0 0 0 1px rgba(76, 194, 255, .55); }
.dicon:active { background: rgba(255, 255, 255, .16); }

/* ------------------------------------------------------------------
   4. 任务栏（48px，图标组绝对居中）
   ------------------------------------------------------------------ */
.taskbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: var(--taskbar-h);
  z-index: 600;
  display: flex;
  align-items: center;
  background: var(--acrylic-strong);
  backdrop-filter: blur(30px) saturate(125%);
  -webkit-backdrop-filter: blur(30px) saturate(125%);
  border-top: 1px solid var(--divider);
  color: var(--text-primary);
}
.tb-left {
  position: absolute;
  left: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.tb-center {
  position: absolute;              /* 规格：图标组绝对居中 */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: min(64vw, 900px);
}
.tb-right {
  position: absolute;
  right: 0;
  display: flex;
  align-items: center;
  height: 100%;
}

/* 任务栏按钮 40×40 / 4px 圆角 */
.tb-btn, .tb-tray-btn, .tb-app {
  position: relative;
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-control);
  transition: background var(--dur-120) var(--ease), color var(--dur-120) var(--ease);
}
.tb-btn:hover, .tb-app:hover { background: var(--control-fill-2); }
.tb-btn:active, .tb-app:active { background: var(--control-fill); }
.tb-btn.active, .tb-app.active { background: var(--control-fill-2); }

/* 运行指示条：前台 16×3，后台 9×3 */
.tb-ind {
  position: absolute;
  left: 50%; bottom: 3px;
  height: 3px;
  width: 0;
  margin-left: 0;
  border-radius: 1.5px;
  background: var(--accent);
  transition: width var(--dur-250) var(--ease),
              margin-left var(--dur-250) var(--ease),
              background var(--dur-180) var(--ease);
}
.tb-app.running .tb-ind { width: 9px; margin-left: -4.5px; background: var(--text-tertiary); }
.tb-app.running.active .tb-ind { width: 16px; margin-left: -8px; background: var(--accent); }
.tb-sep { width: 1px; height: 20px; margin: 0 6px; background: var(--divider); }
.tb-apps { display: flex; align-items: center; gap: 4px; }

/* 天气按钮（任务栏最左） */
.tb-weather {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-radius: var(--radius-control);
  transition: background var(--dur-120) var(--ease);
}
.tb-weather:hover { background: var(--control-fill-2); }
.tb-weather-t { font-size: var(--fs-caption); font-weight: 600; }
.tb-weather-s { font-size: var(--fs-caption); color: var(--text-secondary); }

/* 系统托盘 */
.tb-tray-btn { width: 26px; height: 40px; border-radius: var(--radius-control); }
.tb-tray-btn:hover { background: var(--control-fill-2); }
.tb-tray {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 8px;
  border-radius: var(--radius-control);
  transition: background var(--dur-120) var(--ease);
}
.tb-tray:hover { background: var(--control-fill-2); }
.tb-tray .ic { color: var(--text-primary); }

/* 时钟：12px/16px 两行右对齐 */
.tb-clock {
  height: 40px;
  padding: 0 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  border-radius: var(--radius-control);
  font-size: var(--fs-caption);
  line-height: var(--lh-caption);
  font-variant-numeric: tabular-nums;
  transition: background var(--dur-120) var(--ease);
}
.tb-clock:hover { background: var(--control-fill-2); }
.tb-showdesk {
  width: 8px;
  height: 100%;
  border-left: 1px solid transparent;
  transition: background var(--dur-120) var(--ease), border-color var(--dur-120) var(--ease);
}
.tb-showdesk:hover { background: var(--control-fill-2); border-left-color: var(--stroke-2); }

/* ------------------------------------------------------------------
   5. 窗口
   ------------------------------------------------------------------ */
.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: 320px;
  min-height: 180px;
  border-radius: var(--radius-window);          /* 规格：8px */
  background: var(--mica-tint);                /* Mica：不透明但带壁纸色 */
  backdrop-filter: blur(60px) saturate(140%);
  -webkit-backdrop-filter: blur(60px) saturate(140%);
  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: 0; }
.window.maximized .rz { display: none; }
.window.snapped { border-radius: var(--radius-window); }
.window.dragging, .window.resizing {
  transition: none;
  will-change: left, top, width, height;
}
.window.minimizing { pointer-events: none; }

/* 标题栏 32px */
.titlebar {
  flex: 0 0 auto;
  height: var(--titlebar-h);
  display: flex;
  align-items: center;
  padding-left: 12px;
  border-bottom: 1px solid var(--divider);
  cursor: default;
  touch-action: none;
}
.titlebar .app-ic { color: var(--text-secondary); }
.tb-title {
  flex: 1 1 auto;
  min-width: 0;
  margin-left: 10px;
  font-size: var(--fs-caption);
  line-height: var(--lh-caption);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.window.idle .tb-title { color: var(--text-disabled); }

/* 窗口按钮 46×32，关闭 hover #C42B1C */
.wbtns { display: flex; align-self: stretch; margin-left: auto; }
.wbtn {
  width: var(--wbtn-w);
  height: var(--wbtn-h);
  display: grid;
  place-items: center;
  color: var(--text-primary);
  transition: background var(--dur-120) var(--ease), color var(--dur-120) var(--ease);
}
.wbtn:hover { background: var(--control-fill-2); }
.wbtn:active { background: var(--control-fill-3); }
.wbtn.close:hover { background: #c42b1c; color: #ffffff; }
.wbtn.close:active { background: #b02418; color: #ffffff; }
.wbtn .ic { width: 10px; height: 10px; }
.window.idle .wbtn { color: var(--text-disabled); }

.win-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 8 向缩放手柄（放在窗口内侧，避免被 overflow 裁掉） */
.rz { position: absolute; z-index: 5; touch-action: none; }
.rz-n { top: 0; left: 10px; right: 10px; height: 4px; cursor: ns-resize; }
.rz-s { bottom: 0; left: 10px; right: 10px; height: 4px; cursor: ns-resize; }
.rz-w { left: 0; top: 10px; bottom: 10px; width: 4px; cursor: ew-resize; }
.rz-e { right: 0; top: 10px; bottom: 10px; width: 4px; cursor: ew-resize; }
.rz-nw { left: 0; top: 0; width: 10px; height: 10px; cursor: nwse-resize; }
.rz-ne { right: 0; top: 0; width: 10px; height: 10px; cursor: nesw-resize; }
.rz-sw { left: 0; bottom: 0; width: 10px; height: 10px; cursor: nesw-resize; }
.rz-se { right: 0; bottom: 0; width: 12px; height: 12px; cursor: nwse-resize; }
body.dragging-cursor, body.dragging-cursor * { cursor: grabbing !important; }

/* Snap 预览 */
.snap-hint {
  position: absolute;
  z-index: 90;
  border-radius: var(--radius-window);
  background: rgba(76, 194, 255, .18);
  box-shadow: inset 0 0 0 1px rgba(76, 194, 255, .55), 0 0 0 1px rgba(0, 0, 0, .20);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
  transition: left var(--dur-180) var(--ease), top var(--dur-180) var(--ease),
              width var(--dur-180) var(--ease), height var(--dur-180) var(--ease),
              opacity var(--dur-120) var(--ease);
}

/* ------------------------------------------------------------------
   6. 浮出层（Mica / 亚克力 + 统一动效）
   ------------------------------------------------------------------ */
.flyout {
  position: absolute;
  z-index: 400;
  background: var(--acrylic);
  backdrop-filter: blur(30px) saturate(125%);
  -webkit-backdrop-filter: blur(30px) saturate(125%);
  border-radius: var(--radius-overlay);
  box-shadow: var(--shadow-flyout);
  color: var(--text-primary);
  overflow: hidden;
}
.flyout.opening { animation: fly-up var(--dur-250) var(--ease) both; }
.flyout.closing { animation: fly-down var(--dur-180) var(--ease) both; }
@keyframes fly-up {
  from { opacity: 0; transform: var(--fly-tf, none) translateY(26px) scale(.995); }
  to   { opacity: 1; transform: var(--fly-tf, none) translateY(0) scale(1); }
}
@keyframes fly-down {
  from { opacity: 1; transform: var(--fly-tf, none) translateY(0) scale(1); }
  to   { opacity: 0; transform: var(--fly-tf, none) translateY(18px) scale(.995); }
}

/* ------------------------------------------------------------------
   7. 开始菜单（640px / 8px 圆角 / 底部弹入）
   ------------------------------------------------------------------ */
.start {
  --fly-tf: translateX(-50%);
  left: 50%;
  bottom: 8px;                      /* 任务栏之上，自底部弹入 */
  width: var(--startmenu-w);
  max-width: calc(100vw - 24px);
  height: 700px;
  max-height: calc(100vh - var(--taskbar-h) - 24px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
}
.start-search {
  flex: 0 0 auto;
  margin: 20px 20px 8px;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-radius: var(--radius-control);
  background: var(--control-fill);
  border: 1px solid var(--stroke);
  box-shadow: inset 0 -1px 0 var(--stroke-2);
  transition: border-color var(--dur-180) var(--ease), background var(--dur-180) var(--ease);
}
.start-search:focus-within { border-color: var(--accent); background: var(--control-fill-2); }
.start-search .ic { color: var(--text-secondary); }
.start-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}
.start-search input::placeholder { color: var(--text-secondary); }

.start-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 20px 8px; }
.start-sec { padding: 12px 0 4px; }
.start-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 600;
}
.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--radius-control);
  font-size: var(--fs-caption);
  font-weight: 400;
  color: var(--text-primary);
  background: var(--control-fill);
  border: 1px solid var(--stroke);
  transition: background var(--dur-120) var(--ease);
}
.ghost-btn:hover { background: var(--control-fill-2); }

/* 固定应用：6 列网格，磁贴 88×92 */
.pin-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 2px;
}
.pin {
  height: 92px;
  padding: 10px 4px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-control);
  transition: background var(--dur-120) var(--ease), transform var(--dur-120) var(--ease);
}
.pin:hover { background: var(--subtle-hover); }
.pin:active { transform: scale(.97); background: var(--subtle-press); }
.pin .ic { width: 32px; height: 32px; }
.pin-label {
  font-size: var(--fs-caption);
  line-height: 1.25;
  text-align: center;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 推荐列表 */
.rec-list { display: flex; flex-direction: column; gap: 2px; }
.rec {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-control);
  text-align: left;
  transition: background var(--dur-120) var(--ease);
}
.rec:hover { background: var(--subtle-hover); }
.rec .ic { width: 24px; height: 24px; color: var(--text-secondary); }
.rec-t { font-size: var(--fs-body); line-height: var(--lh-body); }
.rec-s { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-secondary); }

/* 开始菜单底部 */
.start-foot {
  flex: 0 0 auto;
  height: 56px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, .04);
  border-top: 1px solid var(--divider);
}
:root[data-theme="light"] .start-foot { background: rgba(0, 0, 0, .03); }
.user-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 12px 0 6px;
  border-radius: var(--radius-control);
  transition: background var(--dur-120) var(--ease);
}
.user-btn:hover { background: var(--subtle-hover); }
.user-avatar {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-base), #7c3aed);
  color: #fff;
}
.user-name { font-size: var(--fs-body); }
.power-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: var(--radius-control);
  transition: background var(--dur-120) var(--ease);
}
.power-btn:hover { background: var(--subtle-hover); }

/* 搜索联想 */
.search-results {
  position: absolute;
  inset: 74px 0 56px 0;
  background: var(--acrylic);
  backdrop-filter: blur(30px) saturate(125%);
  -webkit-backdrop-filter: blur(30px) saturate(125%);
  padding: 12px 20px;
  overflow-y: auto;
}
.sr-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: var(--radius-control);
  text-align: left;
  transition: background var(--dur-120) var(--ease);
}
.sr-item:hover, .sr-item.sel { background: var(--subtle-hover); }
.sr-item .ic { width: 24px; height: 24px; }
.sr-empty { padding: 24px 10px; color: var(--text-secondary); font-size: var(--fs-body); }

/* ------------------------------------------------------------------
   8. 快捷设置
   ------------------------------------------------------------------ */
.qs {
  --fly-tf: none;
  right: 12px;
  bottom: calc(var(--taskbar-h) + 8px);
  width: var(--flyout-w);
  padding: 16px;
}
.qs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.qs-tile {
  height: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: var(--radius-control);
  background: var(--control-fill);
  border: 1px solid var(--stroke);
  font-size: var(--fs-caption);
  line-height: 1.2;
  text-align: center;
  transition: background var(--dur-120) var(--ease),
              border-color var(--dur-120) var(--ease),
              color var(--dur-120) var(--ease);
}
.qs-tile:hover { background: var(--control-fill-2); }
.qs-tile.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.qs-tile.on .ic { color: var(--on-accent); }
.qs-tile:active { transform: scale(.98); }
.qs-slider {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}
.qs-slider .ic { color: var(--text-secondary); }
input[type="range"] {
  flex: 1;
  height: 4px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 2px;
  background: var(--control-fill);
  border: 1px solid var(--stroke);
  outline: 0;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--fill-base);
  box-shadow: 0 0 0 1px var(--stroke-2);
  transition: transform var(--dur-120) var(--ease);
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.1); }
input[type="range"]::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--fill-base);
}
.qs-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--divider);
}
.qs-battery { display: flex; align-items: center; gap: 8px; font-size: var(--fs-caption); }
.qs-foot-btns { display: flex; gap: 4px; }
.icon-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: var(--radius-control);
  transition: background var(--dur-120) var(--ease);
}
.icon-btn:hover { background: var(--subtle-hover); }

/* ------------------------------------------------------------------
   9. 通知中心 + 日历
   ------------------------------------------------------------------ */
.nc {
  --fly-tf: none;
  right: 12px;
  bottom: calc(var(--taskbar-h) + 8px);
  width: var(--flyout-w);
  max-height: calc(100vh - var(--taskbar-h) - 24px);
  display: flex;
  flex-direction: column;
  padding: 14px 0 12px;
}
.nc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 10px;
  font-weight: 600;
}
.nc-list { padding: 0 12px; display: flex; flex-direction: column; gap: 8px; max-height: 240px; overflow-y: auto; }
.nc-item {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-card);
  background: var(--card-bg);
  border: 1px solid var(--stroke);
  animation: nc-in var(--dur-250) var(--ease) both;
}
@keyframes nc-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.nc-item.leaving { animation: nc-out var(--dur-180) var(--ease) both; }
@keyframes nc-out { to { opacity: 0; transform: translateX(24px); } }
.nc-item .ic { margin-top: 1px; color: var(--accent); }
.nc-item-main { flex: 1; min-width: 0; }
.nc-item-t { font-size: var(--fs-caption); font-weight: 600; margin-bottom: 3px; }
.nc-item-b { font-size: var(--fs-caption); line-height: 1.5; color: var(--text-secondary); }
.nc-item-x {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: var(--radius-control);
  color: var(--text-secondary);
  transition: background var(--dur-120) var(--ease);
}
.nc-item-x:hover { background: var(--subtle-hover); }
.nc-empty { padding: 22px 8px; text-align: center; font-size: var(--fs-caption); color: var(--text-secondary); }

.nc-cal { margin-top: 12px; padding: 12px 16px 4px; border-top: 1px solid var(--divider); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-title { font-size: var(--fs-body); font-weight: 600; }
.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-dow span {
  text-align: center;
  font-size: var(--fs-caption);
  color: var(--text-secondary);
  padding: 4px 0;
}
.cal-cell {
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: var(--fs-body);
  transition: background var(--dur-120) var(--ease);
}
.cal-cell.mute { color: var(--text-disabled); }
.cal-cell:hover { background: var(--subtle-hover); }
.cal-cell.today {
  width: 32px; height: 32px;
  margin: 4px auto;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

/* ------------------------------------------------------------------
   10. 小组件
   ------------------------------------------------------------------ */
.wg {
  --fly-tf: none;
  left: 8px;
  bottom: calc(var(--taskbar-h) + 8px);
  width: 400px;
  max-height: calc(100vh - var(--taskbar-h) - 24px);
  padding: 16px;
  overflow-y: auto;
}
.wg-head { font-weight: 600; margin-bottom: 12px; }
.wg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wg-card {
  padding: 14px;
  border-radius: var(--radius-card);
  background: var(--card-bg);
  border: 1px solid var(--stroke);
  font-size: var(--fs-caption);
}
.wg-weather { grid-column: span 2; }
.wg-k { color: var(--text-secondary); margin-bottom: 10px; }
.wg-weather-row { display: flex; align-items: center; gap: 14px; }
.wg-temp { font-size: var(--fs-title); line-height: 1; font-weight: 300; }
.wg-sub { color: var(--text-secondary); margin-top: 6px; }
.wg-line { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.dot-accent, .dot-muted { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.dot-accent { background: var(--accent); }
.dot-muted { background: var(--text-disabled); }
.wg-todo { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.wg-todo input { accent-color: var(--accent); }
.wg-bar { height: 8px; border-radius: 4px; background: var(--control-fill); overflow: hidden; margin-bottom: 8px; }
.wg-bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }

/* ------------------------------------------------------------------
   11. 任务视图
   ------------------------------------------------------------------ */
.taskview {
  position: absolute;
  inset: 0;
  z-index: 380;
  background: rgba(20, 20, 20, .55);
  backdrop-filter: blur(28px) saturate(120%);
  -webkit-backdrop-filter: blur(28px) saturate(120%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 40px;
}
.taskview.opening { animation: tv-in var(--dur-250) var(--ease) both; }
@keyframes tv-in { from { opacity: 0; } to { opacity: 1; } }
.tv-grid { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 20px; max-height: 62vh; overflow-y: auto; }
.tv-card { width: 260px; text-align: center; transition: transform var(--dur-250) var(--ease); }
.tv-card:hover { transform: translateY(-4px); }
.tv-thumb {
  height: 168px;
  border-radius: var(--radius-card);
  background: var(--mica-tint);
  box-shadow: 0 0 0 1px var(--stroke), 0 12px 28px rgba(0, 0, 0, .45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.tv-thumb-bar { height: 22px; background: var(--control-fill); display: flex; align-items: center; padding: 0 8px; gap: 6px; }
.tv-thumb-bar .ic { width: 12px; height: 12px; color: var(--text-secondary); }
.tv-thumb-name { font-size: 10px; color: var(--text-secondary); }
.tv-thumb-body { flex: 1; display: grid; place-items: center; color: var(--text-disabled); }
.tv-label { margin-top: 10px; font-size: var(--fs-caption); color: #fff; }
.tv-empty { color: rgba(255, 255, 255, .7); font-size: var(--fs-body); }
.tv-desk { display: flex; gap: 14px; }
.tv-desk-btn {
  width: 150px; height: 86px;
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .16);
  color: #fff;
  font-size: var(--fs-caption);
  display: grid;
  place-items: center;
  transition: background var(--dur-180) var(--ease), border-color var(--dur-180) var(--ease);
}
.tv-desk-btn:hover { background: rgba(255, 255, 255, .18); }
.tv-desk-btn.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }

/* ------------------------------------------------------------------
   12. 右键菜单
   ------------------------------------------------------------------ */
.ctx {
  position: absolute;
  z-index: 700;
  min-width: 230px;
  max-width: 340px;
  padding: 5px;
  border-radius: var(--radius-overlay);
  background: var(--acrylic);
  backdrop-filter: blur(30px) saturate(125%);
  -webkit-backdrop-filter: blur(30px) saturate(125%);
  box-shadow: var(--shadow-flyout);
  font-size: var(--fs-body);
}
.ctx.opening { animation: ctx-in var(--dur-180) var(--ease) both; transform-origin: top left; }
@keyframes ctx-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
.ctx-item {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: var(--radius-control);
  text-align: left;
  transition: background var(--dur-120) var(--ease);
}
.ctx-item:hover { background: var(--subtle-hover); }
.ctx-item.disabled { color: var(--text-disabled); pointer-events: none; }
.ctx-item .ic { width: 16px; height: 16px; color: var(--text-secondary); }
.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: var(--text-secondary); }
.ctx-sep { height: 1px; margin: 5px 10px; background: var(--divider); }
.ctx-head { padding: 8px 10px 6px; font-size: var(--fs-caption); color: var(--text-secondary); }

/* ------------------------------------------------------------------
   13. 对话框 / 遮罩 / 轻提示
   ------------------------------------------------------------------ */
.scrim {
  position: absolute;
  inset: 0;
  z-index: 800;
  display: grid;
  place-items: center;
  background: var(--smoke);
  backdrop-filter: blur(2px);
}
.scrim.opening { animation: tv-in var(--dur-180) var(--ease) both; }
.dialog {
  width: 420px;
  max-width: calc(100vw - 48px);
  padding: 24px;
  border-radius: var(--radius-overlay);
  background: var(--fill-tertiary);
  box-shadow: var(--shadow-window);
  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-subtitle); line-height: var(--lh-subtitle); font-weight: 600; margin-bottom: 10px; }
.dialog-body { font-size: var(--fs-body); line-height: var(--lh-body); color: var(--text-secondary); margin-bottom: 24px; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; }
.btn {
  min-width: 96px;
  height: 32px;
  padding: 0 16px;
  border-radius: var(--radius-control);
  background: var(--control-fill);
  border: 1px solid var(--stroke);
  font-size: var(--fs-body);
  transition: background var(--dur-120) var(--ease);
}
.btn:hover { background: var(--control-fill-2); }
.btn.primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--on-accent);
  font-weight: 600;
}
.btn.primary:hover { filter: brightness(1.08); }

.toast-wrap {
  position: fixed;
  right: 12px;
  bottom: calc(var(--taskbar-h) + 12px);
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-card);
  background: var(--acrylic-strong);
  backdrop-filter: blur(30px) saturate(125%);
  -webkit-backdrop-filter: blur(30px) saturate(125%);
  box-shadow: var(--shadow-flyout);
  font-size: var(--fs-body);
  animation: toast-in var(--dur-250) var(--ease) both;
}
.toast.out { animation: nc-out var(--dur-180) var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
.toast .ic { color: var(--accent); }

/* ------------------------------------------------------------------
   14. 应用内容：文件资源管理器
   ------------------------------------------------------------------ */
.app-explorer { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.ex-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--divider);
}
.ex-nav { display: flex; align-items: center; gap: 2px; }
.ex-nav-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: var(--radius-control);
  color: var(--text-primary);
  transition: background var(--dur-120) var(--ease);
}
.ex-nav-btn:hover { background: var(--subtle-hover); }
.ex-nav-btn:disabled { color: var(--text-disabled); pointer-events: none; }
.ex-crumb {
  flex: 1;
  min-width: 0;
  height: 32px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 6px;
  border-radius: var(--radius-control);
  background: var(--control-fill);
  border: 1px solid var(--stroke);
  overflow: hidden;
}
.crumb {
  height: 24px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-control);
  font-size: var(--fs-caption);
  white-space: nowrap;
  transition: background var(--dur-120) var(--ease);
}
.crumb:hover { background: var(--subtle-hover); }
.crumb-sep { color: var(--text-secondary); font-size: 11px; }
.ex-search {
  width: 200px;
  height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-radius: var(--radius-control);
  background: var(--control-fill);
  border: 1px solid var(--stroke);
  font-size: var(--fs-caption);
  color: var(--text-secondary);
}
.ex-cmd {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--divider);
}
.ex-cmd-btn {
  height: 30px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: var(--radius-control);
  font-size: var(--fs-caption);
  transition: background var(--dur-120) var(--ease);
}
.ex-cmd-btn:hover { background: var(--subtle-hover); }
.ex-cmd-btn .ic { color: var(--text-secondary); }
.ex-main { flex: 1; display: flex; min-height: 0; }
.ex-side {
  width: 200px;
  flex: none;
  padding: 8px;
  overflow-y: auto;
  border-right: 1px solid var(--divider);
  background: rgba(255, 255, 255, .02);
}
:root[data-theme="light"] .ex-side { background: rgba(0, 0, 0, .02); }
.ex-side-item {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius-control);
  font-size: var(--fs-caption);
  text-align: left;
  transition: background var(--dur-120) var(--ease);
}
.ex-side-item:hover { background: var(--subtle-hover); }
.ex-side-item.active { background: var(--control-fill-2); }
.ex-side-item .ic { width: 16px; height: 16px; color: var(--text-secondary); }
.ex-side-gap { height: 10px; }
.ex-files { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ex-head, .ex-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px 120px 90px;
  gap: 10px;
  align-items: center;
  padding: 0 14px;
}
.ex-head {
  flex: none;
  height: 30px;
  font-size: var(--fs-caption);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--divider);
}
.ex-list { flex: 1; overflow-y: auto; padding: 4px 6px; }
.ex-row {
  height: 34px;
  border-radius: var(--radius-control);
  font-size: var(--fs-caption);
  transition: background var(--dur-120) var(--ease);
}
.ex-row:hover { background: var(--subtle-hover); }
.ex-row.selected { background: rgba(76, 194, 255, .20); box-shadow: inset 0 0 0 1px rgba(76, 194, 255, .40); }
.ex-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ex-name .ic { width: 17px; height: 17px; color: var(--text-secondary); }
.ex-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-dim { color: var(--text-secondary); }
.ex-status {
  flex: none;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  font-size: var(--fs-caption);
  color: var(--text-secondary);
  border-top: 1px solid var(--divider);
}

/* ------------------------------------------------------------------
   15. 应用内容：记事本
   ------------------------------------------------------------------ */
.app-notepad { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.np-tabs { display: flex; align-items: center; gap: 2px; padding: 6px 8px 0; }
.np-tab {
  height: 30px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 6px 6px 0 0;
  background: var(--control-fill);
  font-size: var(--fs-caption);
}
.np-tab.add { padding: 0 10px; }
.np-area {
  flex: 1;
  min-height: 0;
  resize: none;
  border: 0;
  outline: 0;
  padding: 14px 16px;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  user-select: text;
}
.np-status {
  flex: none;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
  padding: 0 16px;
  font-size: var(--fs-caption);
  color: var(--text-secondary);
  border-top: 1px solid var(--divider);
}

/* ------------------------------------------------------------------
   16. 应用内容：计算器
   ------------------------------------------------------------------ */
.app-calc { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 0 8px 8px; }
.calc-mode { padding: 6px 4px 2px; font-size: var(--fs-caption); color: var(--text-secondary); display: flex; align-items: center; gap: 8px; }
.calc-display {
  padding: 8px 8px 14px;
  text-align: right;
  font-size: 44px;
  line-height: 1.1;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.calc-grid { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
.calc-btn {
  border-radius: var(--radius-control);
  background: var(--control-fill);
  border: 1px solid var(--stroke);
  font-size: 17px;
  transition: background var(--dur-120) var(--ease), transform var(--dur-120) var(--ease);
}
.calc-btn:hover { background: var(--control-fill-2); }
.calc-btn:active { transform: scale(.97); }
.calc-btn.fn { font-size: 15px; color: var(--text-primary); }
.calc-btn.eq { background: var(--accent); border-color: transparent; color: var(--on-accent); font-weight: 600; }
.calc-btn.eq:hover { filter: brightness(1.08); }

/* ------------------------------------------------------------------
   17. 应用内容：设置
   ------------------------------------------------------------------ */
.app-settings { flex: 1; display: flex; min-height: 0; }
.set-side { width: 250px; flex: none; padding: 14px 10px; overflow-y: auto; }
.set-user { display: flex; align-items: center; gap: 12px; padding: 6px 10px 16px; }
.set-user .user-avatar { width: 36px; height: 36px; }
.set-nav-item {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: var(--radius-control);
  font-size: var(--fs-caption);
  text-align: left;
  position: relative;
  transition: background var(--dur-120) var(--ease);
}
.set-nav-item:hover { background: var(--subtle-hover); }
.set-nav-item.active { background: var(--control-fill-2); }
.set-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  width: 3px; height: 16px;
  margin-top: -8px;
  border-radius: 2px;
  background: var(--accent);
}
.set-nav-item .ic { width: 16px; height: 16px; color: var(--text-secondary); }
.set-main { flex: 1; min-width: 0; padding: 24px 30px; overflow-y: auto; }
.set-h1 { font-size: var(--fs-title); line-height: var(--lh-title); font-weight: 600; margin-bottom: 22px; }
.set-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  margin-bottom: 8px;
  border-radius: var(--radius-card);
  background: var(--card-bg);
  border: 1px solid var(--stroke);
  transition: background var(--dur-120) var(--ease);
}
.set-card.clickable:hover { background: var(--card-bg-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; }
.set-group-title { font-size: var(--fs-body); font-weight: 600; margin: 20px 0 10px; }
.switch {
  position: relative;
  width: 40px; height: 20px;
  flex: none;
  border-radius: 10px;
  background: var(--control-fill-3);
  border: 1px solid var(--stroke-2);
  transition: background var(--dur-180) var(--ease), border-color var(--dur-180) var(--ease);
}
.switch::after {
  content: '';
  position: absolute;
  left: 3px; top: 3px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--text-primary);
  transition: transform var(--dur-180) var(--ease), background var(--dur-180) var(--ease);
}
.switch.on { background: var(--accent); border-color: transparent; }
.switch.on::after { transform: translateX(20px); background: var(--on-accent); }
.theme-cards { display: flex; gap: 12px; }
.theme-card {
  width: 150px;
  padding: 12px;
  border-radius: var(--radius-card);
  border: 1px solid var(--stroke);
  background: var(--card-bg);
  text-align: left;
  transition: border-color var(--dur-180) var(--ease), background var(--dur-180) var(--ease);
}
.theme-card:hover { background: var(--card-bg-hover); }
.theme-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.theme-preview {
  height: 72px;
  border-radius: 6px;
  margin-bottom: 10px;
  overflow: hidden;
  display: flex;
  border: 1px solid var(--stroke-2);
}
.tp-side { width: 34%; }
.tp-body { flex: 1; }
.tp-dark .tp-side { background: #1f1f1f; }
.tp-dark .tp-body { background: #2b2b2b; }
.tp-light .tp-side { background: #e6e6e6; }
.tp-light .tp-body { background: #f7f7f7; }

/* ------------------------------------------------------------------
   18. 应用内容：Edge / 关于
   ------------------------------------------------------------------ */
.app-edge { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.edge-tabs { display: flex; align-items: center; gap: 4px; padding: 6px 8px 0; }
.edge-tab {
  height: 30px;
  max-width: 220px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 6px 6px 0 0;
  background: var(--control-fill);
  font-size: var(--fs-caption);
  white-space: nowrap;
  overflow: hidden;
}
.edge-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--divider);
}
.edge-url {
  flex: 1;
  height: 30px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  border-radius: 15px;
  background: var(--control-fill);
  border: 1px solid var(--stroke);
  font-size: var(--fs-caption);
  color: var(--text-secondary);
}
.edge-page {
  flex: 1;
  overflow-y: auto;
  padding: 34px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.edge-logo { color: var(--accent); }
.edge-search {
  width: 100%;
  max-width: 420px;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-radius: 19px;
  background: var(--control-fill);
  border: 1px solid var(--stroke);
}
.edge-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: var(--fs-body); }
.edge-quick { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.edge-card {
  width: 112px;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius-card);
  background: var(--card-bg);
  border: 1px solid var(--stroke);
  font-size: var(--fs-caption);
  transition: background var(--dur-120) var(--ease), transform var(--dur-120) var(--ease);
}
.edge-card:hover { background: var(--card-bg-hover); transform: translateY(-2px); }
.edge-note { font-size: var(--fs-caption); color: var(--text-secondary); text-align: center; max-width: 420px; line-height: 1.7; }

.placeholder-app {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: var(--fs-body);
  padding: 30px;
  text-align: center;
}
.placeholder-app .ic { color: var(--text-disabled); }

/* ------------------------------------------------------------------
   19. 滚动条
   ------------------------------------------------------------------ */
* { scrollbar-width: thin; scrollbar-color: var(--scrollbar) transparent; }
*::-webkit-scrollbar { width: 12px; height: 12px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--scrollbar);
  border: 4px solid transparent;
  background-clip: content-box;
  border-radius: 8px;
}
*::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); background-clip: content-box; }

/* ------------------------------------------------------------------
   20. 无障碍与降级
   ------------------------------------------------------------------ */
:focus-visible { outline: 2px solid var(--text-primary); outline-offset: 1px; border-radius: var(--radius-control); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
@media (max-width: 900px) {
  .start { width: calc(100vw - 24px); }
  .pin-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ex-side, .set-side { width: 170px; }
  .ex-head, .ex-row { grid-template-columns: minmax(0, 1fr) 110px; }
  .ex-head > :nth-child(3), .ex-row > :nth-child(3),
  .ex-head > :nth-child(4), .ex-row > :nth-child(4) { display: none; }
}

/* ------------------------------------------------------------------
   终端（桌面图标可打开）
   ------------------------------------------------------------------ */
.app-term {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 10px 12px 0;
  background: rgba(12, 12, 12, .94);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  color: #dcdcdc;
  user-select: text;
}
.term-out { flex: 1; min-height: 0; overflow-y: auto; }
.term-l { white-space: pre-wrap; word-break: break-word; }
.term-prompt { color: #6fd18a; }
.term-in-row { display: flex; align-items: center; gap: 6px; padding: 4px 0 10px; }
.term-in {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #dcdcdc;
  font-family: inherit;
  font-size: inherit;
}

/* ------------------------------------------------------------------
   21. 应用内容：共享剪贴板
   ------------------------------------------------------------------ */
.app-clip {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px 12px;
}
.clip-status {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-caption);
  line-height: var(--lh-caption);
  color: var(--text-secondary);
}
.clip-status .ic { color: var(--accent); }
.clip-area {
  flex: 1;
  min-height: 0;
  resize: none;
  outline: 0;
  padding: 10px 12px;
  border-radius: var(--radius-control);
  border: 1px solid var(--stroke);
  background: var(--control-fill);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  user-select: text;
  transition: border-color var(--dur-180) var(--ease), background var(--dur-180) var(--ease);
}
.clip-area:focus { border-color: var(--accent); background: var(--control-fill-2); }
.clip-area::placeholder { color: var(--text-tertiary); }
.clip-actions { flex: none; display: flex; flex-wrap: wrap; gap: 8px; }
.clip-actions .btn { min-width: 0; flex: 1 1 auto; }
.clip-tip {
  flex: none;
  font-size: var(--fs-caption);
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ------------------------------------------------------------------
   22. 应用内容：关于这个系统
   ------------------------------------------------------------------ */
.app-about {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 18px 18px;
  font-size: var(--fs-caption);
  line-height: 1.75;
  color: var(--text-secondary);
}
/* 合规声明：最上方、带强调色边条与高对比文字 */
.about-notice {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 4px;
  border-radius: var(--radius-card);
  border: 1px solid var(--stroke-2);
  border-left: 3px solid var(--accent);
  background: var(--card-bg);
  color: var(--text-primary);
}
.about-notice .ic { color: var(--accent); margin-top: 2px; }
.about-notice b { font-weight: 600; }
.about-h {
  margin: 16px 0 8px;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 600;
  color: var(--text-primary);
}
.about-list { display: flex; flex-direction: column; gap: 8px; }
.about-item { display: flex; gap: 10px; }
.about-item .ic { color: var(--text-tertiary); margin-top: 3px; }
.about-item-t { color: var(--text-primary); font-weight: 600; }
.about-stats {
  border: 1px solid var(--divider);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.about-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 12px;
}
.about-row + .about-row { border-top: 1px solid var(--divider); }
.about-k { color: var(--text-secondary); }
.about-v {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  text-align: right;
  user-select: text;
}
.about-foot {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--divider);
  color: var(--text-tertiary);
}

/* ------------------------------------------------------------------
   加载 / 启动失败提示
   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; }