/* ============================================================
   天择OS · 全屏模拟操作系统样式
   配色继承天择网：紫-蓝-绿渐变
   ============================================================ */

:root {
  /* 品牌色（与天择网一致） */
  --c-purple: #7c3aed;
  --c-violet: #8b5cf6;
  --c-blue: #3b82f6;
  --c-sky: #0ea5e9;
  --c-cyan: #06b6d4;
  --c-green: #10b981;
  --c-emerald: #34d399;
  --c-indigo: #6366f1;
  --c-violet-soft: #a78bfa;
  --c-blue-soft: #60a5fa;
  --c-green-soft: #6ee7b7;
  /* RGB 三元组（供 rgba(var(--x-rgb), α) 使用；配色皮肤切换时整体重定义） */
  --c-purple-rgb: 124,58,237;
  --c-violet-rgb: 139,92,246;
  --c-indigo-rgb: 99,102,241;
  --c-blue-rgb: 59,130,246;
  --c-sky-rgb: 14,165,233;
  --c-cyan-rgb: 6,182,212;
  --c-green-rgb: 16,185,129;
  --c-emerald-rgb: 52,211,153;
  --c-violet-soft-rgb: 167,139,250;
  --c-blue-soft-rgb: 96,165,250;
  --c-green-soft-rgb: 110,231,183;
  --grad-main: linear-gradient(135deg, #7c3aed 0%, #3b82f6 52%, #10b981 100%);
  --grad-soft: linear-gradient(135deg, #a78bfa 0%, #60a5fa 50%, #6ee7b7 100%);

  /* 玻璃表面 */
  --glass: rgba(20, 26, 48, 0.62);
  --glass-strong: rgba(24, 32, 58, 0.82);
  --glass-light: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-border-strong: rgba(255, 255, 255, 0.2);

  /* 主题感知表面色/悬停色（浅色主题反转为深色基底） */
  --surface: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.08);
  --hover: rgba(255, 255, 255, 0.08);

  /* 文字 */
  --ink: #f5f7ff;
  --ink-dim: #c3c8e4;
  --ink-faint: #a8b1cf;
  --ink-muted: #98a4c5;

  /* 圆角 */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;

  /* 阴影 */
  --sh-sm: 0 4px 16px rgba(0, 0, 0, 0.3);
  --sh-md: 0 12px 40px rgba(0, 0, 0, 0.45);
  --sh-lg: 0 24px 70px rgba(0, 0, 0, 0.55);
  --sh-glow: 0 8px 32px rgba(var(--c-indigo-rgb), 0.35);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  --tb-h: 52px;
  --macbar-h: 30px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
.tz-sr-only { position: fixed !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
html, body { height: 100%; overflow: hidden; }

body.tzos {
  font-family: "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei",
    system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #050813;
  user-select: none;
  -webkit-font-smoothing: antialiased;
  position: fixed;
  inset: 0;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.24); background-clip: content-box; }

/* ============ 开机动画 ============ */
.boot-screen {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, #0c1230 0%, #050813 70%);
  transition: opacity 0.6s var(--ease);
}
.boot-screen.gone { opacity: 0; pointer-events: none; }
.boot-logo { animation: bootPulse 2.2s var(--ease) infinite; filter: drop-shadow(0 0 30px rgba(var(--c-indigo-rgb),0.5)); }
@keyframes bootPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.boot-name {
  margin-top: 22px; font-size: 26px; font-weight: 600; letter-spacing: 5px;
  background: var(--grad-main); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.boot-spinner { display: flex; gap: 8px; margin-top: 36px; }
.boot-spinner span {
  width: 9px; height: 9px; border-radius: 50%; background: var(--grad-main);
  animation: bootDot 1.4s var(--ease) infinite;
}
.boot-spinner span:nth-child(2) { animation-delay: 0.2s; }
.boot-spinner span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bootDot { 0%,80%,100% { opacity: 0.25; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1.2); } }
.boot-tip { margin-top: 28px; font-size: 13px; color: var(--ink-faint); letter-spacing: 1px; }

/* ============ 桌面 ============ */
.desktop {
  position: fixed; inset: 0; overflow: hidden;
  background:
    radial-gradient(120vmax 80vmax at 15% 12%, rgba(var(--c-purple-rgb),0.38), transparent 55%),
    radial-gradient(110vmax 70vmax at 88% 85%, rgba(var(--c-green-rgb),0.32), transparent 55%),
    radial-gradient(90vmax 90vmax at 75% 20%, rgba(var(--c-blue-rgb),0.30), transparent 55%),
    linear-gradient(160deg, #0a0f24 0%, #070b1a 100%);
}
.desktop::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}
.desktop.mac-style::before { display: none; }
.desktop.mac-style {
  background:
    radial-gradient(120vmax 80vmax at 20% 15%, rgba(var(--c-purple-rgb),0.34), transparent 55%),
    radial-gradient(110vmax 70vmax at 80% 80%, rgba(var(--c-green-rgb),0.28), transparent 55%),
    linear-gradient(150deg, #1a1330 0%, #0d0a1f 100%);
}

/* ============ 桌面图标 ============ */
.desktop-icons {
  position: absolute; top: 16px; left: 16px; right: 16px; bottom: calc(var(--tb-h) + 12px);
  display: grid; grid-template-columns: repeat(auto-fill, 96px);
  grid-auto-rows: 104px; grid-auto-flow: column;
  gap: 6px; align-content: start;
}
.desktop.mac-style .desktop-icons { top: 16px; }

/* PC 自由摆放画布模式：绝对定位 */
.desktop-icons.canvas-mode { display: block; }
.desktop-icons.canvas-mode .desktop-icon {
  position: absolute; width: 96px;
}
.desktop-icons.canvas-mode .zone-label {
  position: absolute; font-size: 11px; font-weight: 600; letter-spacing: 1px;
  color: var(--ink-faint); text-transform: uppercase; padding: 2px 8px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8); pointer-events: none; user-select: none;
}
.desktop-icon {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 6px 8px; border-radius: var(--r-md); cursor: pointer;
  transition: background 0.16s var(--ease), transform 0.16s var(--ease);
  width: 96px;
}
.desktop-icon:hover { background: rgba(255,255,255,0.08); }
.desktop-icon.selected { background: rgba(var(--c-indigo-rgb),0.22); outline: 1px solid rgba(var(--c-violet-rgb),0.5); }
.desktop-icon:focus-visible,
.start-app:focus-visible,
.dock-app:focus-visible {
  outline: 2px solid var(--c-violet-soft);
  outline-offset: 2px;
}
.desktop-icon:active { transform: scale(0.94); }
.desktop-icon.dragging { z-index: 50; opacity: 0.9; cursor: grabbing; transform: scale(1.05); box-shadow: var(--sh-md); }
.desktop-icon.free .di-icon { box-shadow: 0 0 0 1px rgba(var(--c-violet-rgb),0.35), var(--sh-sm); }
.di-icon {
  width: 48px; height: 48px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
  font-size: 26px; background: var(--glass-light); border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px); box-shadow: var(--sh-sm);
  position: relative;
}
.di-icon.grad { background: var(--grad-main); }
.di-label {
  font-size: 12px; color: #fff; text-align: center; line-height: 1.3;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7); max-width: 88px;
  word-break: break-all;
}
.desktop-icon .di-badge {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px;
  background: #ef4444; border-radius: var(--r-pill); font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; border: 2px solid #0a0f24;
}

/* ============ 任务栏（Windows 风格） ============ */
.taskbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--tb-h);
  display: flex; align-items: center; padding: 0 8px; gap: 6px;
  background: var(--glass-strong); backdrop-filter: blur(24px) saturate(160%);
  border-top: 1px solid var(--glass-border); z-index: 5000;
}
.tb-start {
  width: 42px; height: 42px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center;
  transition: background 0.16s var(--ease);
}
.tb-start:hover { background: rgba(255,255,255,0.1); }
.tb-start.active { background: rgba(var(--c-indigo-rgb),0.25); }
.tb-running { flex: 1; display: flex; align-items: center; gap: 4px; overflow-x: auto; overflow-y: hidden; }
.tb-running::-webkit-scrollbar { display: none; }
.tb-task {
  height: 42px; padding: 0 14px; border-radius: var(--r-sm); display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink-dim); max-width: 200px; min-width: 42px;
  transition: background 0.16s var(--ease); flex-shrink: 0;
}
.tb-task .tb-task-icon { font-size: 18px; }
.tb-task .tb-task-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-task:hover { background: var(--hover); }
.tb-task.active { background: rgba(var(--c-indigo-rgb),0.22); border-bottom: 2px solid var(--c-blue); }
.tb-task.pinned { opacity: 0.55; }
.tb-task.pinned:hover { opacity: 1; }
.tb-tray { display: flex; align-items: center; gap: 4px; padding-right: 4px; }
.tb-tray-btn {
  width: 38px; height: 38px; border-radius: var(--r-sm); font-size: 16px;
  display: flex; align-items: center; justify-content: center; transition: background 0.16s var(--ease);
}
.tb-tray-btn:hover { background: var(--hover); }
.tb-clock { font: inherit; font-size: 12px; color: var(--ink-dim); padding: 0 8px; line-height: 1.3; text-align: right; cursor: pointer; background: transparent; border: 0; }
.tb-clock:hover { color: var(--ink); }

/* macOS 风格：任务栏变身为底部居中 Dock */
.desktop.mac-style .taskbar {
  left: 50%; right: auto; transform: translateX(-50%); bottom: 10px;
  width: auto; max-width: 78vw; height: auto; padding: 6px 10px; gap: 4px;
  background: var(--glass-strong); border: 1px solid var(--glass-border);
  border-radius: var(--r-lg); box-shadow: var(--sh-lg);
}
.desktop.mac-style .tb-start { display: none; }
.desktop.mac-style .tb-running { justify-content: center; }
.desktop.mac-style .tb-task {
  height: 46px; width: 46px; min-width: 46px; padding: 0; border-radius: 12px;
}
.desktop.mac-style .tb-task .tb-task-name { display: none; }
.desktop.mac-style .tb-task .tb-task-icon { font-size: 22px; }
.desktop.mac-style .tb-task.active { border-bottom: none; background: rgba(255,255,255,0.16); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15); }


/* ============ 开始菜单 ============ */
.start-menu {
  position: absolute; left: 8px; bottom: calc(var(--tb-h) + 8px); width: 480px; max-width: calc(100vw - 16px);
  max-height: 560px; background: var(--glass-strong); backdrop-filter: blur(28px) saturate(170%);
  border: 1px solid var(--glass-border); border-radius: var(--r-lg); box-shadow: var(--sh-lg);
  z-index: 5100; padding: 18px; display: flex; flex-direction: column;
  animation: startPop 0.2s var(--ease); transform-origin: bottom left;
}
/* 关键：display:flex 会覆盖 hidden 属性的 display:none，必须显式声明 [hidden] 时隐藏，否则菜单关不掉 */
.start-menu[hidden] { display: none; }
@keyframes startPop { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.start-menu.panel-exit { animation: startClose .15s var(--ease) forwards; pointer-events: none; }
@keyframes startClose { to { opacity: 0; transform: translateY(5px) scale(.99); } }
.start-search { margin-bottom: 14px; }
.start-search input {
  width: 100%; height: 38px; padding: 0 14px 0 38px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--glass-border); color: var(--ink);
  font-size: 14px; outline: none; transition: border 0.16s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b94b8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 12px center;
}
.start-search input:focus { border-color: var(--c-blue); }
.start-apps {
  flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, 92px);
  gap: 4px; align-content: start; padding: 4px;
}
.start-app {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 6px;
  border-radius: var(--r-sm); transition: background 0.16s var(--ease); cursor: pointer;
}
.start-app:hover { background: var(--hover); }
.start-app .sa-icon {
  width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  font-size: 22px; background: var(--glass-light); border: 1px solid var(--glass-border);
}
.start-app .sa-icon.grad { background: var(--grad-main); border: none; }
.start-app .sa-name { font-size: 11.5px; color: var(--ink-dim); text-align: center; max-width: 84px; word-break: break-all; }
.start-footer { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--glass-border); }
.start-footer button { width: 36px; height: 36px; border-radius: var(--r-sm); font-size: 16px; display: flex; align-items: center; justify-content: center; transition: background 0.16s; }
.start-footer button:hover { background: var(--hover); }
.start-footer .start-close-btn { margin-right: auto; width: auto; padding: 0 14px; font-size: 13px; font-weight: 500; }

/* ============ 窗口系统 ============ */
.windows-layer { position: absolute; inset: 0; pointer-events: none; }
.win {
  position: absolute; min-width: 320px; min-height: 200px;
  background: var(--glass-strong); backdrop-filter: blur(28px) saturate(170%);
  border: 1px solid var(--glass-border); border-radius: var(--r-md);
  box-shadow: var(--sh-lg); display: flex; flex-direction: column; overflow: hidden;
  pointer-events: auto; animation: winOpen 0.2s var(--ease);
}
@keyframes winOpen { from { opacity: 0; transform: translateY(6px) scale(0.975); } to { opacity: 1; transform: none; } }
.win.closing { animation: winClose 0.18s var(--ease) forwards; }
@keyframes winClose { to { opacity: 0; transform: translateY(4px) scale(0.975); } }
.win.minimized { animation: winMin 0.22s var(--ease) forwards; }
@keyframes winMin { to { opacity: 0; transform: translateY(40px) scale(0.9); } }
.win.focused { box-shadow: var(--sh-lg), 0 0 0 1px rgba(var(--c-indigo-rgb),0.35); z-index: 100; }
.win.maximized { border-radius: 0; }
.desktop.mac-style .win { border-radius: var(--r-md); }

.win-title {
  height: 40px; flex-shrink: 0; display: flex; align-items: center; padding: 0 10px; gap: 8px;
  background: rgba(255,255,255,0.04); border-bottom: 1px solid var(--glass-border); cursor: grab;
  user-select: none;
}
.msg-bubble, .msg-reasoning div, .doc-content, .doc-md, .notes-editor, .notes-preview,
.kb-detail-text, .archived-chat-messages, .store-prompt-box, .tips-content { user-select: text; }
.win-title:active { cursor: grabbing; }
/* 统一 DOM 顺序：icons, titleIcon, titleText, spacer —— 由 CSS 按风格排列 */
.win-title-icons { display: flex; align-items: center; gap: 6px; flex-shrink: 0; order: 3; }
.win-title-icon { font-size: 15px; pointer-events: none; order: 1; }
.win-title-text {
  flex: 1; font-size: 13px; color: var(--ink-dim); text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; order: 2;
}
.win-title-spacer { display: none; order: 4; }

/* Windows 风格（默认）：图标+标题靠左，控件靠右 —— 上面的 order 已实现 */

/* macOS 风格：控件靠左（红黄绿），标题居中，右侧平衡占位 */
.win.mac-style .win-title-icons { order: 0; }
.win.mac-style .win-title-icon { display: none; }
.win.mac-style .win-title-text { order: 1; text-align: center; }
.win.mac-style .win-title-spacer { display: block; order: 2; width: 60px; flex-shrink: 0; }

.wctrl {
  width: 14px; height: 14px; border-radius: 50%; border: none; cursor: pointer;
  transition: filter 0.14s; display: flex; align-items: center; justify-content: center;
}
.wctrl svg { width: 8px; height: 8px; opacity: 0; transition: opacity 0.14s; }
.win-title:hover .wctrl svg { opacity: 1; }
.wctrl.close { background: #ff5f57; }
.wctrl.min { background: #febc2e; }
.wctrl.max { background: #28c840; }
.wctrl.reload { background: var(--c-blue-soft); }
.wctrl.reload svg { width: 7px; height: 7px; }
/* 卸载按钮：仅 AI 生成软件显示，紫色提示 */
.wctrl.uninst {
  background: var(--grad-main); width: 14px; height: 14px;
  color: #fff;
}
.win-title:hover .wctrl.uninst svg { opacity: 1; }
.wctrl.uninst:hover { filter: brightness(1.15); }
/* 置顶按钮：常态灰色图钉，激活后紫色高亮 */
.wctrl.pin { background: rgba(255,255,255,0.15); color: var(--ink-dim); }
.wctrl.pin.active { background: var(--c-violet); color: #fff; box-shadow: 0 0 0 1px rgba(var(--c-violet-rgb),0.5); }
.wctrl.pin:hover { filter: brightness(1.15); }
.win.pinned { border-color: rgba(var(--c-violet-rgb),0.55); box-shadow: var(--sh-lg), 0 0 0 1px rgba(var(--c-violet-rgb),0.35); }
.win.mac-style .win-title-icons .wctrl { width: 12px; height: 12px; }
.win.mac-style .win-title-icons .wctrl svg { opacity: 0; }
.win.mac-style .win-title-icons:hover .wctrl svg { opacity: 1; }
.win.mac-style .win-title-icons .wctrl.uninst { width: 12px; height: 12px; }
.win.mac-style .win-title-icons .wctrl.uninst svg { opacity: 0; }
.win.mac-style .win-title-icons:hover .wctrl.uninst svg { opacity: 1; }
.win.mac-style .win-title-icons .wctrl.pin { width: 12px; height: 12px; }
.win.mac-style .win-title-icons .wctrl.pin svg { opacity: 0; }
.win.mac-style .win-title-icons:hover .wctrl.pin svg { opacity: 1; }
.win.mac-style .wctrl.pin.active svg { opacity: 1; }

.win-body { flex: 1; min-height: 0; overflow: auto; position: relative; background: rgba(8,12,28,0.4); }
.win-body.no-pad { padding: 0; }
.win-body.pad { padding: 16px; }
/* AI 对话与终端内部已有唯一滚动区，外层固定以避免长内容出现双滚动条。 */
.win-body.app-shell-body { overflow: hidden; padding: 0; }

.win-resizer { position: absolute; z-index: 10; }
.win-resizer.r-e { top: 0; right: 0; width: 6px; height: 100%; cursor: e-resize; }
.win-resizer.r-s { bottom: 0; left: 0; width: 100%; height: 6px; cursor: s-resize; }
.win-resizer.r-se { bottom: 0; right: 0; width: 12px; height: 12px; cursor: se-resize; }
.win-resizer.r-w { top: 0; left: 0; width: 6px; height: 100%; cursor: w-resize; }
.win-resizer.r-n { top: 0; left: 0; width: 100%; height: 6px; cursor: n-resize; }
.win-resizer.r-ne { top: 0; right: 0; width: 12px; height: 12px; cursor: ne-resize; }
.win-resizer.r-sw { bottom: 0; left: 0; width: 12px; height: 12px; cursor: sw-resize; }
.win-resizer.r-nw { top: 0; left: 0; width: 12px; height: 12px; cursor: nw-resize; }

/* ============ v3.0 AI 悬浮窗（独立覆盖层动画）============ */
@keyframes tzFloatIn { from { opacity: 0; transform: scale(0.92) translateY(12px); } to { opacity: 1; transform: none; } }

/* ============ 右键菜单 ============ */
.ctx-menu {
  position: absolute; z-index: 6000; min-width: 200px;
  background: var(--glass-strong); backdrop-filter: blur(28px) saturate(170%);
  border: 1px solid var(--glass-border); border-radius: var(--r-sm); box-shadow: var(--sh-md);
  padding: 6px; animation: ctxPop 0.16s var(--ease);
}
@keyframes ctxPop { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
.ctx-item { width: 100%; padding: 9px 14px; font: inherit; font-size: 13px; color: var(--ink-dim); border: 0; background: transparent; text-align: left; border-radius: 6px; cursor: pointer; display: flex; align-items: center; gap: 10px; transition: background 0.12s; }
.ctx-item:hover { background: rgba(var(--c-indigo-rgb),0.25); color: var(--ink); }
.ctx-item .ci-icon { font-size: 14px; width: 18px; text-align: center; }
.ctx-sep { height: 1px; background: var(--glass-border); margin: 4px 0; }

/* ============ 通用 UI 组件 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: var(--r-sm); font-size: 14px; font-weight: 500;
  background: var(--grad-main); color: #fff; transition: transform 0.14s var(--ease), filter 0.14s;
  border: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.ghost { background: var(--surface-2); border: 1px solid var(--glass-border); color: var(--ink-dim); }
.btn.ghost:hover { background: var(--hover); color: var(--ink); }
.btn.sm { padding: 6px 12px; font-size: 12px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--ink-faint); margin-bottom: 6px; }
.input, .textarea {
  width: 100%; padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--glass-border);
  color: var(--ink); font-size: 14px; outline: none; transition: border 0.16s;
}
.input:focus, .textarea:focus { border-color: var(--c-blue); }
.textarea { resize: vertical; min-height: 80px; line-height: 1.6; }

/* ============ AI 配置应用 ============ */
.app-config { padding: 20px; max-width: 520px; margin: 0 auto; }
.app-config h2 { font-size: 18px; margin-bottom: 4px; }
.app-config .sub { font-size: 12px; color: var(--ink-faint); margin-bottom: 20px; }
.config-status { padding: 10px 14px; border-radius: var(--r-sm); font-size: 13px; margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }
.config-status.ok { background: rgba(var(--c-green-rgb),0.14); border: 1px solid rgba(var(--c-green-rgb),0.3); color: var(--c-emerald); }
.config-status.warn { background: rgba(251,191,36,0.12); border: 1px solid rgba(251,191,36,0.3); color: #fbbf24; }
.config-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.preset-chip { padding: 6px 12px; border-radius: var(--r-pill); font-size: 12px; background: var(--surface); border: 1px solid var(--glass-border); cursor: pointer; transition: all 0.14s; }
.preset-chip:hover { background: rgba(var(--c-indigo-rgb),0.2); border-color: var(--c-blue); }

/* ============ AI 对话应用 ============ */
.app-chat { display: flex; flex-direction: column; height: 100%; background: rgba(5,8,19,0.4); overflow: hidden; }
.chat-messages { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.chat-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--ink-faint); text-align: center; padding: 30px; }
.chat-empty .ce-icon { font-size: 42px; opacity: 0.5; }
.chat-empty .ce-title { font-size: 17px; color: var(--ink-dim); }
.chat-empty .ce-suggest { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 420px; margin-top: 8px; }
.chat-suggest-chip { padding: 8px 14px; border-radius: var(--r-pill); font-size: 12.5px; background: var(--surface); border: 1px solid var(--glass-border); cursor: pointer; transition: all 0.14s; }
.chat-suggest-chip:hover { background: rgba(var(--c-indigo-rgb),0.2); border-color: var(--c-blue); }
.msg { display: flex; gap: 10px; max-width: 88%; animation: msgIn 0.24s var(--ease); }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.msg.ai .msg-avatar { background: var(--grad-main); }
.msg.user .msg-avatar { background: rgba(255,255,255,0.1); border: 1px solid var(--glass-border); }
.msg-bubble { padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.65; word-break: break-word; }
.msg-fallback-notice { margin: 0 0 4px 2px; color: var(--ink-muted); font-size: 11px; line-height: 1.45; word-break: break-word; }
.msg.ai .msg-bubble { background: var(--surface); border: 1px solid var(--glass-border); border-top-left-radius: 4px; }
.msg.user .msg-bubble { background: var(--grad-main); border-top-right-radius: 4px; color: #fff; }
.msg-bubble pre { background: rgba(0,0,0,0.4); padding: 10px; border-radius: 6px; overflow-x: auto; margin: 6px 0; font-size: 12px; }
.msg-bubble code { font-family: "Consolas","SF Mono",monospace; }
.msg-bubble p { margin: 4px 0; }
.chat-input-bar { flex-shrink: 0; padding: 12px; border-top: 1px solid var(--glass-border); display: flex; gap: 8px; background: rgba(10,15,36,0.5); }
.chat-input-bar textarea { flex: 1; resize: none; max-height: 120px; }
.chat-send { width: 42px; height: 42px; flex-shrink: 0; border-radius: var(--r-sm); background: var(--grad-main); color: #fff; display: flex; align-items: center; justify-content: center; transition: transform 0.14s; }
.chat-send:hover { filter: brightness(1.12); }
.chat-send:active { transform: scale(0.92); }
.chat-send:disabled { opacity: 0.4; }
.typing-dots { display: inline-flex; gap: 4px; align-items: center; }
.typing-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-faint); animation: td 1.2s infinite; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes td { 0%,60%,100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }
/* AI 消息主体流式占位：避免与"🧠 思考过程（进行中…）"details 同时显示成"两个进度条"。
   当 reasoning 还没出来或主体内容尚未到达首字时，用一行轻量文字代替独立的 typing-dots。 */
.chat-streaming-placeholder { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-faint); font-size: 12.5px; }
.chat-streaming-placeholder::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-faint); animation: td 1.2s infinite; box-shadow: 12px 0 0 var(--ink-faint), 24px 0 0 var(--ink-faint); box-shadow: 12px 0 0 0 var(--ink-faint), 24px 0 0 0 var(--ink-faint); }
.tz-stopped-tip { color: var(--ink-faint); font-size: 12px; margin-top: 6px; }

/* ============ 软件商城应用 ============ */
.app-store { display: flex; flex-direction: column; height: 100%; }
.store-header { padding: 20px; text-align: center; background: linear-gradient(180deg, rgba(var(--c-indigo-rgb),0.12), transparent); }
.store-header h2 { font-size: 18px; font-weight: 600; background: var(--grad-main); -webkit-background-clip: text; background-clip: text; color: transparent; }
.store-header p { font-size: 13px; color: var(--ink-faint); margin-top: 6px; }
.store-form { padding: 16px 20px; display: flex; gap: 8px; }
.store-form input { flex: 1; }
.store-step { padding: 0 20px 16px; }
.store-step-label { font-size: 12px; color: var(--ink-faint); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.store-step-label .step-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--grad-main); display: flex; align-items: center; justify-content: center; font-size: 11px; }
.store-prompt-box { padding: 12px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--glass-border); font-size: 13px; line-height: 1.6; color: var(--ink-dim); max-height: 180px; overflow-y: auto; }
.store-prompt-box .opt {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 7px 1px 2px;
  border-top: 1.5px solid var(--c-emerald);
  border-right: 1.5px solid var(--c-emerald);
  transform: rotate(45deg);
}
.store-installed { flex: 1; overflow-y: auto; padding: 16px 20px; }
.store-installed h3 { font-size: 13px; color: var(--ink-faint); margin-bottom: 10px; }
.store-installed-list { display: flex; flex-direction: column; gap: 8px; }
.store-installed-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--glass-border); }
.store-installed-item .sii-icon { width: 36px; height: 36px; border-radius: 9px; background: var(--grad-main); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.store-installed-item .sii-info { flex: 1; min-width: 0; }
.store-installed-item .sii-name { font-size: 13px; color: var(--ink); }
.store-installed-item .sii-meta { font-size: 11px; color: var(--ink-faint); }
.store-installed-item button { padding: 5px 10px; font-size: 12px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--glass-border); color: var(--ink-dim); }
.store-installed-item button:hover { background: rgba(239,68,68,0.2); border-color: #ef4444; color: #fca5a5; }

/* ============ 通用加载/空状态 ============ */
.app-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 14px; color: var(--ink-faint); }
.app-loading .al-spin { width: 36px; height: 36px; border: 3px solid rgba(255,255,255,0.1); border-top-color: var(--c-blue); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.app-iframe { width: 100%; height: 100%; border: none; background: #fff; contain: strict; display: block; }
/* 浏览器应用：iframe 以块级渲染消除行内基线缝隙，防止窗口体出现几像素的异常滚动条 */
.app-browser { overflow: hidden; }
.app-browser iframe { display: block; }
/* 浏览器应用：自身管理布局，禁止外层 win-body 出现第二条滚动条；iframe 去基线缝隙 */
.app-browser { overflow: hidden; }
.app-browser iframe { display: block; }
.app-error { display: grid; place-items: center; gap: 9px; padding: 30px; text-align: center; color: var(--ink-faint); }
.app-error .ae-icon { font-size: 42px; margin-bottom: 12px; }
.app-error strong { color: var(--ink); }
.app-error small { max-width: 520px; line-height: 1.6; }
.app-error-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 5px; }

/* ============ 移动端 ============ */
body.mobile .desktop-icons { display: none; }
body.mobile .home-screen {
  display: grid !important; position: absolute; inset: 0;
  bottom: calc(104px + env(safe-area-inset-bottom, 0px));
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); grid-auto-rows: 96px; gap: 8px;
  padding: max(20px, env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) 20px max(14px, env(safe-area-inset-left, 0px));
  align-content: start; overflow-y: auto;
}
body.mobile .desktop-icon { width: 100%; }
body.mobile .di-icon { width: 56px; height: 56px; font-size: 28px; }
body.mobile .taskbar { display: none; }
body.mobile .mobile-dock {
  display: flex !important; position: absolute;
  left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px));
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  height: 62px; background: var(--glass-strong); backdrop-filter: blur(24px) saturate(170%);
  border: 1px solid var(--glass-border); border-radius: var(--r-lg);
  align-items: center; padding: 0 10px; gap: 6px; overflow-x: auto; z-index: 5000;
}
body.mobile .mobile-dock::-webkit-scrollbar { display: none; }
body.mobile .home-bar {
  display: block !important; position: absolute; bottom: env(safe-area-inset-bottom, 0px); left: 50%; transform: translateX(-50%);
  width: 130px; height: 5px; border-radius: var(--r-pill); background: rgba(255,255,255,0.5); z-index: 5001; margin-bottom: 2px;
}
body.mobile .win { border-radius: 0 !important; }
body.mobile .win.maximized-mobile { top: 0 !important; left: 0 !important; width: 100% !important; height: 100% !important; border-radius: 0 !important; }
body.mobile .win-title { height: 44px; }
body.mobile .win-title { min-height: calc(44px + env(safe-area-inset-top, 0px)); padding-top: env(safe-area-inset-top, 0px); }
body.mobile .win.mobile-fullscreen { inset: 0 !important; width: 100% !important; height: 100% !important; border-radius: 0; }
.dock-app { flex-shrink: 0; width: 50px; height: 50px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 24px; background: var(--glass-light); border: 1px solid var(--glass-border); transition: transform 0.14s var(--ease); }
.dock-app:active { transform: scale(0.88); }
.dock-app.grad { background: var(--grad-main); }
.dock-sep { width: 1px; height: 36px; background: var(--glass-border); margin: 0 4px; flex-shrink: 0; }

/* ============ 通知 ============ */
.notif-center { position: absolute; right: 8px; bottom: calc(var(--tb-h) + 8px); width: 360px; max-width: calc(100vw - 16px); max-height: 60vh; background: var(--glass-strong); backdrop-filter: blur(28px); border: 1px solid var(--glass-border); border-radius: var(--r-md); box-shadow: var(--sh-lg); z-index: 5100; padding: 10px; overflow-y: auto; }
.notif-center:not([hidden]) { animation: notifPanelIn .18s var(--ease); transform-origin: bottom right; }
.notif-center.panel-exit { animation: notifPanelOut .15s var(--ease) forwards; pointer-events: none; }
@keyframes notifPanelIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes notifPanelOut { to { opacity: 0; transform: translateY(5px) scale(.99); } }
.notif { padding: 12px; border-radius: var(--r-sm); background: var(--surface); margin-bottom: 8px; border-left: 3px solid var(--c-blue); animation: notifItemIn .18s var(--ease) both; }
@keyframes notifItemIn { from { opacity: 0; transform: translateX(5px); } to { opacity: 1; transform: none; } }
.notif .nf-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.notif .nf-body { font-size: 12px; color: var(--ink-faint); line-height: 1.5; }
.notif .nf-time { font-size: 11px; color: var(--ink-muted); margin-top: 6px; }

/* ============ 设置面板 ============ */
.settings-panel { padding: 20px; max-width: 480px; margin: 0 auto; }
.settings-panel h2 { font-size: 18px; margin-bottom: 16px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--glass-border); }
.setting-row .sr-label { font-size: 14px; }
.setting-row .sr-desc { font-size: 12px; color: var(--ink-faint); margin-top: 2px; }
.toggle { width: 44px; height: 26px; border-radius: var(--r-pill); background: rgba(255,255,255,0.12); position: relative; cursor: pointer; transition: background 0.2s; flex-shrink: 0; }
.toggle.on { background: var(--c-green); }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.2s var(--ease); }
.toggle.on::after { transform: translateX(18px); }
.style-pick { display: flex; gap: 8px; }
.style-pick button { padding: 8px 14px; border-radius: var(--r-sm); font-size: 12px; background: var(--surface); border: 1px solid var(--glass-border); color: var(--ink-dim); }
.style-pick button.active { background: var(--grad-main); border: none; color: #fff; }

/* ============ 左下角悬浮窗 ============ */
.floating-widget {
  position: absolute; left: 12px; bottom: calc(var(--tb-h) + 12px); z-index: 4600;
  width: 168px; background: var(--glass-strong); backdrop-filter: blur(24px) saturate(170%);
  border: 1px solid var(--glass-border); border-radius: var(--r-md); box-shadow: var(--sh-md);
  overflow: hidden; user-select: none; transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.floating-widget.hidden { opacity: 0; pointer-events: none; transform: scale(0.9); }
.fw-header {
  display: flex; align-items: center; justify-content: space-between; padding: 8px 10px;
  background: var(--surface); cursor: grab; border-bottom: 1px solid var(--glass-border);
}
.fw-header:active { cursor: grabbing; }
.fw-title { font-size: 12px; font-weight: 600; color: var(--ink-dim); }
.fw-close {
  width: 20px; height: 20px; border-radius: 50%; background: #ff5f57; color: #5b0700;
  font-size: 14px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.fw-close:hover { filter: brightness(1.15); }
.fw-body { padding: 12px 10px; display: flex; flex-direction: column; gap: 10px; }
.fw-clock { font-size: 24px; font-weight: 600; text-align: center; background: var(--grad-main); -webkit-background-clip: text; background-clip: text; color: transparent; }
.fw-actions { display: flex; justify-content: space-around; gap: 6px; }
.fw-btn {
  width: 40px; height: 40px; border-radius: 11px; font-size: 18px;
  background: var(--glass-light); border: 1px solid var(--glass-border);
  display: flex; align-items: center; justify-content: center; transition: transform 0.14s var(--ease), background 0.14s;
}
.fw-btn:hover { background: rgba(var(--c-indigo-rgb),0.25); }
.fw-btn:active { transform: scale(0.9); }
.fw-reopen {
  position: absolute; left: 12px; bottom: calc(var(--tb-h) + 12px); z-index: 4600;
  width: 44px; height: 44px; border-radius: 50%; font-size: 20px;
  background: var(--grad-main); color: #fff; box-shadow: var(--sh-glow);
  display: flex; align-items: center; justify-content: center; transition: transform 0.14s var(--ease);
}
.fw-reopen.hidden { display: none; }
.fw-reopen:hover { transform: scale(1.08); }
.fw-reopen:active { transform: scale(0.92); }
body.mobile .floating-widget, body.mobile .fw-reopen { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== KaTeX 数学公式渲染（AI 对话） ===== */
.msg-bubble .katex { font-size: 1.04em; color: var(--ink); }
.msg-bubble .katex-display {
  margin: 8px 0; overflow-x: auto; overflow-y: visible;
  padding: 8px 10px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--glass-border);
}
.msg-bubble .katex-display > .katex { white-space: nowrap; }
.tz-math { white-space: nowrap; }

/* ===================== 自定义对话框 ===================== */
.tz-dialog-mask {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(2,4,12,0.55); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s; padding: 20px;
}
.tz-dialog-mask.show { opacity: 1; }
.tz-dialog {
  width: min(420px, 92vw); background: var(--glass-strong);
  border: 1px solid var(--glass-border); border-radius: var(--r-md);
  box-shadow: var(--sh-lg); padding: 22px; transform: scale(0.92); transition: transform 0.22s var(--ease);
}
.tz-dialog-mask.show .tz-dialog { transform: none; }
.tz-dialog.danger { border-color: rgba(239,68,68,0.35); }
.tz-dialog-title { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 12px; }
.tz-dialog-msg { font-size: 13px; color: var(--ink-dim); line-height: 1.65; margin-bottom: 16px; word-break: break-word; }
.tz-dialog-input {
  width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--glass-border); background: rgba(0,0,0,0.25); color: var(--ink);
  font-size: 13px; font-family: inherit; outline: none; margin-bottom: 16px; transition: border-color 0.15s;
}
.tz-dialog-input:focus { border-color: var(--c-blue, var(--c-blue)); }
textarea.tz-dialog-input { resize: vertical; min-height: 70px; line-height: 1.5; }
.tz-dialog-btns { display: flex; gap: 8px; justify-content: flex-end; }
.tz-dialog-btn { padding: 8px 18px; border-radius: 7px; font-size: 13px; cursor: pointer; border: 1px solid var(--glass-border); background: var(--surface); color: var(--ink-dim); transition: background 0.15s, transform 0.1s; font-family: inherit; }
.tz-dialog-btn:hover { background: rgba(255,255,255,0.1); }
.tz-dialog-btn:active { transform: scale(0.96); }
.tz-dialog-btn.confirm { background: linear-gradient(135deg,var(--c-purple),var(--c-blue)); color: #fff; border: none; }
.tz-dialog-btn.confirm.danger { background: linear-gradient(135deg,#ef4444,#dc2626); }

/* ============ Windows 风格窗口按钮（真正的 Windows 样式：矩形全高 — ▢ ✕） ============ */
.win:not(.mac-style) .win-title-icons { order: 3; align-self: stretch; gap: 0; margin-right: -10px; }
.win:not(.mac-style) .wctrl {
  width: 46px; height: 100%; border-radius: 0; background: transparent;
  display: flex; align-items: center; justify-content: center;
}
.win:not(.mac-style) .wctrl svg { opacity: 1; stroke: var(--ink-dim); width: 10px; height: 10px; }
.win:not(.mac-style) .wctrl:hover { background: rgba(128,128,128,0.18); filter: none; }
.win:not(.mac-style) .wctrl.close:hover { background: #e81123; }
.win:not(.mac-style) .wctrl.close:hover svg { stroke: #fff; }
/* 顺序：刷新/卸载/置顶 → 最小化 → 最大化 → 关闭 */
.win:not(.mac-style) .wctrl.reload, .win:not(.mac-style) .wctrl.uninst, .win:not(.mac-style) .wctrl.pin { order: -1; width: 34px; background: transparent; }
.win:not(.mac-style) .wctrl.pin.active { background: rgba(var(--c-violet-rgb),0.22); color: var(--c-violet); }
.win:not(.mac-style) .wctrl.pin.active:hover { background: rgba(var(--c-violet-rgb),0.32); }
.win:not(.mac-style) .wctrl.min { order: 1; }
.win:not(.mac-style) .wctrl.max { order: 2; }
.win:not(.mac-style) .wctrl.close { order: 3; }

/* ============ 任务栏：Windows 与 macOS 高度统一 52px ============ */
.desktop.mac-style .taskbar { height: var(--tb-h); padding: 5px 10px; }
.desktop.mac-style .tb-task { height: 42px; width: 42px; min-width: 42px; }
.desktop.mac-style .tb-task .tb-task-icon { font-size: 20px; }

/* 显示桌面按钮（Windows 风格最右细条）：负边距抵消任务栏右 padding，贴到屏幕最右缘 */
.tb-show-desktop {
  width: 10px; align-self: stretch; margin-left: 2px; margin-right: -8px; flex-shrink: 0;
  border-left: 1px solid var(--glass-border); background: transparent; cursor: pointer;
  transition: background 0.14s;
}
.tb-show-desktop:hover { background: rgba(128,128,128,0.18); }
.tb-show-desktop.active { background: rgba(var(--c-indigo-rgb),0.32); }
.desktop.mac-style .tb-show-desktop, body.mobile .tb-show-desktop { display: none; }

/* ============ 浏览器：标签页栏并入窗口标题栏 ============ */
.win-tabs { order: 2; flex: 1; display: flex; align-items: center; gap: 4px; overflow-x: auto; min-width: 0; height: 100%; padding: 0 2px; }
.win-tabs::-webkit-scrollbar { display: none; }
.br-tab {
  display: flex; align-items: center; gap: 6px; padding: 0 10px; height: 28px; border-radius: 6px;
  background: rgba(128,128,128,0.12); font-size: 12px; color: var(--ink-dim); cursor: pointer;
  white-space: nowrap; max-width: 170px; flex-shrink: 0;
  transition: background-color .16s var(--ease), color .16s var(--ease), transform .16s var(--ease);
}
.br-tab-main {
  min-width: 0; flex: 1; height: 100%; padding: 0; border: 0; background: transparent;
  color: inherit; font: inherit; text-align: left; cursor: pointer; display: flex; align-items: center;
}
.br-tab > .br-x { border: 0; background: transparent; color: inherit; cursor: pointer; flex-shrink: 0; }
.br-tab.active { background: rgba(var(--c-indigo-rgb),0.30); color: var(--ink); transform: translateY(-1px); }
.br-tab-label { overflow: hidden; text-overflow: ellipsis; }
.br-tab .br-x { display: inline-flex; align-items: center; justify-content: center; opacity: .55; padding: 0 3px; border-radius: 3px; font-size: 11px; }
.br-tab .br-x .tz-icon,
.doc-tab .dt-x .tz-icon,
.br-bm-del .tz-icon { width: 11px; height: 11px; vertical-align: middle; }
.br-tab .br-x:hover { opacity: 1; background: rgba(239,68,68,0.45); color: #fff; }
.br-tab-plus {
  flex-shrink: 0; width: 26px; height: 28px; border-radius: 6px; background: rgba(128,128,128,0.12);
  color: var(--ink-dim); font-size: 14px; display: flex; align-items: center; justify-content: center;
  transition: background-color .15s var(--ease), transform .15s var(--ease);
}
.br-tab-plus:hover { background: rgba(128,128,128,0.22); transform: translateY(-1px); }
.br-tab-plus:active { transform: scale(.94); }
.win.mac-style .win-tabs { order: 1; }

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible,
[role="switch"]:focus-visible,
[role="option"]:focus-visible,
[role="treeitem"]:focus-visible,
[role="tab"]:focus-visible,
[role="menuitem"]:focus-visible {
  outline: 2px solid var(--c-blue-soft);
  outline-offset: 2px;
}

/* ============ AI 对话：消息体 / token 统计 / 消息操作 ============ */
.msg-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; max-width: 100%; }
.msg-usage { font-size: 11px; color: var(--ink-muted); padding: 0 4px; user-select: text; }
.msg-actions { display: flex; gap: 6px; opacity: 0; transition: opacity 0.15s; padding: 0 4px; }
.msg:hover .msg-actions { opacity: 1; }
.msg-act {
  font-size: 11.5px; padding: 3px 10px; border-radius: var(--r-pill);
  background: rgba(128,128,128,0.10); border: 1px solid var(--glass-border); color: var(--ink-faint);
}
.msg-act:hover { background: rgba(var(--c-indigo-rgb),0.22); color: var(--ink); }
.chat-send.stopping { background: linear-gradient(135deg,#ef4444,#dc2626); }

/* ============ 开始菜单分类标题 ============ */
.start-cat {
  grid-column: 1/-1; font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--ink-faint); padding: 12px 6px 4px; text-transform: uppercase;
}
.start-cat:first-child { padding-top: 2px; }

/* ============ 天择导航树状图 ============ */
.tt-tree, .tt-kids { list-style: none; padding: 0; margin: 0; }
.tt-kids { margin-left: 14px; border-left: 1px dashed var(--glass-border); padding-left: 10px; }
.tt-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13.5px; color: var(--ink-dim); }
.tt-row:hover { background: rgba(128,128,128,0.12); color: var(--ink); }
.tt-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  color: var(--ink-faint);
  flex-shrink: 0;
}
.tt-toggle .tz-icon { width: 12px; height: 12px; transition: transform .16s var(--ease); }
.tt-toggle.is-open .tz-icon { transform: rotate(90deg); }
.tt-leaf { position: relative; width: 16px; height: 16px; flex-shrink: 0; }
.tt-leaf::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 6px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ink-muted);
}
.tt-icon { font-size: 16px; }
.tt-name { flex: 1; }
.tt-open { opacity: 0; color: var(--c-blue); transition: opacity 0.15s; }
.tt-row:hover .tt-open { opacity: 1; }

/* ============ 浅色主题 ============ */
body.tzos.light {
  --glass: rgba(248, 250, 255, 0.72);
  --glass-strong: rgba(252, 253, 255, 0.90);
  --glass-light: rgba(15, 23, 42, 0.05);
  --glass-border: rgba(15, 23, 42, 0.14);
  --glass-border-strong: rgba(15, 23, 42, 0.22);
  --surface: rgba(15, 23, 42, 0.05);
  --surface-2: rgba(15, 23, 42, 0.08);
  --hover: rgba(15, 23, 42, 0.07);
  --ink: #0f172a;
  --ink-dim: #334155;
  --ink-faint: #526175;
  --ink-muted: #6b7280;
  --sh-sm: 0 4px 16px rgba(15, 23, 42, 0.12);
  --sh-md: 0 12px 40px rgba(15, 23, 42, 0.18);
  --sh-lg: 0 24px 70px rgba(15, 23, 42, 0.22);
}
body.tzos.light .desktop {
  background:
    radial-gradient(120vmax 80vmax at 15% 12%, rgba(var(--c-purple-rgb),0.20), transparent 55%),
    radial-gradient(110vmax 70vmax at 88% 85%, rgba(var(--c-green-rgb),0.18), transparent 55%),
    radial-gradient(90vmax 90vmax at 75% 20%, rgba(var(--c-blue-rgb),0.18), transparent 55%),
    linear-gradient(160deg, #e8ecf8 0%, #dde4f2 100%);
}
body.tzos.light .desktop::before {
  background-image:
    linear-gradient(rgba(15,23,42,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,23,42,0.045) 1px, transparent 1px);
}
body.tzos.light .desktop.mac-style {
  background:
    radial-gradient(120vmax 80vmax at 20% 15%, rgba(var(--c-purple-rgb),0.18), transparent 55%),
    radial-gradient(110vmax 70vmax at 80% 80%, rgba(var(--c-green-rgb),0.16), transparent 55%),
    linear-gradient(150deg, #ece4f7 0%, #e2e8f5 100%);
}
body.tzos.light .boot-screen { background: radial-gradient(ellipse at 50% 40%, #e6ebf9 0%, #dfe5f3 70%); }
body.tzos.light .di-label { color: #0f172a; text-shadow: 0 1px 4px rgba(255,255,255,0.7); }
body.tzos.light .zone-label { text-shadow: 0 1px 4px rgba(255,255,255,0.85); }
body.tzos.light .win-title { background: rgba(255,255,255,0.40); }
body.tzos.light .win-body { background: rgba(255,255,255,0.35); }
body.tzos.light .app-chat, body.tzos.light .app-browser { background: rgba(255,255,255,0.4) !important; }
body.tzos.light .chat-input-bar { background: rgba(240,244,252,0.7); }
body.tzos.light .msg.ai .msg-bubble { background: rgba(15,23,42,0.05); }
body.tzos.light .start-search input,
body.tzos.light .input, body.tzos.light .textarea { background: rgba(15,23,42,0.05); }
body.tzos.light .store-installed-item, body.tzos.light .store-prompt-box { background: rgba(15,23,42,0.05); }
body.tzos.light .di-icon, body.tzos.light .sa-icon, body.tzos.light .fw-btn, body.tzos.light .dock-app { background: rgba(255,255,255,0.55); }
body.tzos.light ::-webkit-scrollbar-thumb { background: rgba(15,23,42,0.18); background-clip: content-box; }
body.tzos.light .btn.ghost { background: rgba(15,23,42,0.06); }
body.tzos.light .preset-chip, body.tzos.light .chat-suggest-chip { background: rgba(15,23,42,0.05); }
body.tzos.light .notif { background: rgba(15,23,42,0.05); }
body.tzos.light .floating-widget .fw-header { background: rgba(15,23,42,0.04); }
body.tzos.light .fw-close { color: #fff; }
/* 浅色主题专项修复：杜绝白底白字/隐形元素 */
body.tzos.light .toggle { background: rgba(15,23,42,0.18); }
body.tzos.light .app-loading .al-spin { border-color: rgba(15,23,42,0.14); border-top-color: var(--c-blue); }
body.tzos.light .msg-bubble pre { background: rgba(15,23,42,0.06); }
body.tzos.light .msg-bubble pre code { color: #0f172a; }
body.tzos.light .msg-bubble code.md-ic { background: rgba(15,23,42,0.09); color: #0f172a; }
body.tzos.light .msg-usage { color: #64748b; }
body.tzos.light .msg-act { background: rgba(15,23,42,0.06); }
body.tzos.light .cmd-res.err { color: #dc2626; }

/* ============ AI 对话 Markdown 渲染（标题/分割线/表格/列表/引用） ============ */
.msg-bubble h1, .msg-bubble h2, .msg-bubble h3, .msg-bubble h4, .msg-bubble h5, .msg-bubble h6 {
  margin: 10px 0 5px; line-height: 1.4; color: var(--ink); font-weight: 700;
}
.msg-bubble h1 { font-size: 1.32em; } .msg-bubble h2 { font-size: 1.2em; } .msg-bubble h3 { font-size: 1.1em; }
.msg-bubble h4, .msg-bubble h5, .msg-bubble h6 { font-size: 1em; }
.msg-bubble > h1:first-child, .msg-bubble > h2:first-child, .msg-bubble > h3:first-child,
.msg-bubble > h4:first-child, .msg-bubble > p:first-child { margin-top: 0; }
.msg-bubble hr { border: none; border-top: 1px solid var(--glass-border); margin: 10px 0; }
.md-table-wrap { overflow-x: auto; max-width: 100%; margin: 8px 0; }
.md-table { border-collapse: collapse; font-size: 0.92em; }
.md-table th, .md-table td { border: 1px solid var(--glass-border); padding: 5px 10px; text-align: left; }
.md-table th { background: var(--surface-2); font-weight: 600; color: var(--ink); white-space: nowrap; }
.msg-bubble ul, .msg-bubble ol { margin: 5px 0; padding-left: 20px; }
.msg-bubble li { margin: 2px 0; }
.msg-bubble blockquote {
  margin: 6px 0; padding: 4px 12px; border-left: 3px solid var(--c-blue);
  background: var(--surface); border-radius: 0 6px 6px 0; color: var(--ink-dim);
}
.msg-bubble code.md-ic { background: rgba(0,0,0,0.3); padding: 2px 5px; border-radius: 4px; font-size: 0.9em; }
.msg-bubble s { opacity: 0.7; }

/* ============ 命令行终端 ============ */
.term-app { display: flex; flex-direction: column; height: 100%; background: rgba(3,6,16,0.55); font-family: "Consolas","SF Mono",monospace; }
.term-out { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 14px; font-size: 13px; line-height: 1.65; color: #d7e0f4; white-space: pre-wrap; word-break: break-word; user-select: text; }
.term-out .t-cmd { color: var(--c-green-soft); }
.term-out .t-err { color: #fca5a5; }
.term-out .t-dim { color: #7c86a8; }
/* 大段输出（如 gethtml 返回的完整 HTML 代码）折叠容器，避免一次性渲染拖累 term-out */
.term-out .tz-term-big { margin: 4px 0; border: 1px solid var(--glass-border); border-radius: 8px; background: rgba(4,9,27,.4); overflow: hidden; }
.term-out .tz-term-big > summary { cursor: pointer; padding: 8px 12px; font-size: 12px; color: var(--ink-faint); list-style: none; user-select: none; }
.term-out .tz-term-big > summary::before { content: "▸ "; color: var(--c-blue); }
.term-out .tz-term-big[open] > summary::before { content: "▾ "; }
.term-out .tz-term-pre { margin: 0; padding: 10px 14px; max-height: 420px; overflow: auto; font: 12px/1.55 ui-monospace, Menlo, Consolas, monospace; color: var(--ink-dim); white-space: pre-wrap; word-break: break-word; background: rgba(0,0,0,.25); }
body.tzos.light .term-out .tz-term-big { background: rgba(255,255,255,.6); }
body.tzos.light .term-out .tz-term-pre { background: rgba(15,23,42,.05); color: #1e293b; }
.term-input-row { flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--glass-border); background: rgba(10,15,36,0.5); }
.term-prompt { color: var(--c-green-soft); font-size: 13px; font-family: inherit; flex-shrink: 0; }
.term-input-row input { flex: 1; background: transparent; border: none; outline: none; color: #d7e0f4; font-family: inherit; font-size: 13px; }
body.tzos.light .term-app { background: rgba(240,244,252,0.85); }
body.tzos.light .term-out { color: #1e293b; }
body.tzos.light .term-out .t-cmd { color: var(--c-green); }
body.tzos.light .term-out .t-dim { color: #64748b; }
body.tzos.light .term-out .t-err { color: #dc2626; }
body.tzos.light .term-input-row { background: rgba(226,232,244,0.8); }
body.tzos.light .term-prompt { color: var(--c-green); }
body.tzos.light .term-input-row input { color: #1e293b; }

/* ============ AI 对话中的命令行执行卡片 ============ */
.cmd-card { margin-top: 8px; border: 1px solid var(--glass-border); border-radius: 8px; background: var(--surface); overflow: hidden; }
.cmd-card > summary { cursor: pointer; padding: 7px 10px; font-size: 12px; color: var(--ink-faint); list-style: none; user-select: none; }
.cmd-card > summary::before {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-right: 6px;
  vertical-align: -.12em;
  background-color: transparent;
  background-image: var(--os-icon-atlas);
  background-repeat: no-repeat;
  background-size: 800% 800%;
  background-position: 85.714286% 28.571429%;
  -webkit-mask: none;
  mask: none;
}
.cmd-card .cmd-body { padding: 6px 10px 8px; border-top: 1px solid var(--glass-border); font-family: "Consolas","SF Mono",monospace; font-size: 12px; max-height: 220px; overflow-y: auto; }
.cmd-card--ask { border-color: color-mix(in srgb, var(--c-blue) 48%, var(--glass-border)); background: color-mix(in srgb, var(--c-blue) 8%, var(--surface)); }
.cmd-card--ask > summary { color: color-mix(in srgb, var(--c-blue) 72%, var(--ink)); }
.cmd-card--agent { border-color: color-mix(in srgb, var(--c-green) 48%, var(--glass-border)); background: color-mix(in srgb, var(--c-green) 8%, var(--surface)); }
.cmd-card--agent > summary { color: color-mix(in srgb, var(--c-green) 72%, var(--ink)); }
.cmd-card--agent .cmd-body { max-height: min(52vh, 520px); }
.cmd-line { padding: 2px 0; color: var(--ink-dim); word-break: break-all; }
.cmd-line::before { content: '$ '; color: var(--c-green); }
.cmd-res { padding: 2px 0 4px 14px; color: var(--ink-faint); white-space: pre-wrap; word-break: break-word; }
.cmd-res.err { color: #fca5a5; }

/* ============ AI 配置：Token 价格 ============ */
.price-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.price-grid .field { margin-bottom: 0; }

/* ============================================================
   v2.5 新增组件 + 整体 UI 润色（配色不变，动画更丝滑）
   ============================================================ */

/* ---------- 全局动效润色 ---------- */
.win { transition: box-shadow 0.18s var(--ease), border-color 0.18s var(--ease); }
.win:hover { box-shadow: var(--sh-lg), 0 0 0 1px rgba(var(--c-indigo-rgb),0.18); }
.desktop-icon { transition: background 0.2s var(--ease), transform 0.2s var(--ease-bounce); }
.desktop-icon:hover { transform: translateY(-2px); }
.desktop-icon:hover .di-icon { box-shadow: 0 6px 18px rgba(0,0,0,0.35), 0 0 0 1px rgba(var(--c-violet-rgb),0.3); }
.start-app { transition: background 0.2s var(--ease), transform 0.2s var(--ease-bounce); }
.start-app:hover { transform: translateY(-2px); }
.btn { transition: transform 0.16s var(--ease-bounce), filter 0.16s, box-shadow 0.2s; }
.btn:hover { box-shadow: 0 6px 20px rgba(var(--c-purple-rgb),0.35); }
.btn.ghost:hover { box-shadow: none; }
.tb-task { transition: background 0.2s var(--ease), transform 0.16s var(--ease); }
.tb-task:hover { transform: translateY(-1px); }
.preset-chip { transition: all 0.2s var(--ease); }
.preset-chip:hover { transform: translateY(-1px); }
.store-installed-item { transition: transform 0.18s var(--ease), box-shadow 0.18s; }
.store-installed-item:hover { transform: translateX(2px); box-shadow: var(--sh-sm); }
.setting-row { transition: background 0.18s; border-radius: 6px; padding-left: 8px; padding-right: 8px; margin-left: -8px; margin-right: -8px; }
.setting-row:hover { background: var(--hover); }
.ctx-item { transition: background 0.14s, transform 0.1s, padding-left 0.16s; }
.ctx-item:hover { padding-left: 18px; }
.notif { transition: transform 0.18s var(--ease); }
.notif:hover { transform: translateX(-2px); }

/* ---------- 聊天工具栏（重构） ---------- */
.chat-toolbar { display: flex; gap: 6px; padding: 7px 10px; border-bottom: 1px solid var(--glass-border); background: var(--surface); align-items: center; flex-wrap: wrap; }
.chat-flag { font-size: 11px; color: var(--c-emerald); padding: 3px 9px; border: 1px solid rgba(var(--c-green-rgb),0.4); border-radius: 999px; flex-shrink: 0; background: rgba(var(--c-green-rgb),0.08); }
.chat-flag.violet { color: var(--c-violet); border-color: var(--c-violet); border-style: dashed; background: transparent; }
.chat-ctx { font-size: 11px; color: var(--ink-muted); padding: 3px 8px; border-radius: 6px; background: var(--surface); white-space: nowrap; user-select: none; }
.chat-resume-tip { text-align: center; font-size: 12px; color: var(--c-blue); padding: 8px 12px; margin: 4px auto; background: rgba(var(--c-blue-rgb),0.1); border: 1px dashed rgba(var(--c-blue-rgb),0.4); border-radius: 999px; max-width: 80%; animation: msgIn 0.3s var(--ease); }

/* ---------- 聊天附件 ---------- */
.chat-attach { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 12px 0; }
.chat-attach[hidden] { display: none; }
.attach-chip { display: flex; align-items: center; gap: 7px; padding: 5px 8px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--glass-border); font-size: 12px; color: var(--ink-dim); max-width: 200px; animation: msgIn 0.2s var(--ease); }
.attach-thumb { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.attach-ficon { font-size: 18px; }
.attach-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-x { flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%; background: rgba(239,68,68,0.2); color: #fca5a5; font-size: 10px; display: flex; align-items: center; justify-content: center; }
.attach-x:hover { background: #ef4444; color: #fff; }
.chat-attach-btn { width: 42px; height: 42px; flex-shrink: 0; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--glass-border); font-size: 17px; display: flex; align-items: center; justify-content: center; transition: background 0.16s, transform 0.14s; }
.chat-attach-btn:hover { background: var(--hover); transform: scale(1.06); }

/* ---------- Markdown 链接与图片 ---------- */
.msg-bubble a.md-link { color: var(--c-sky); text-decoration: none; border-bottom: 1px dashed rgba(var(--c-sky-rgb),0.5); transition: color 0.14s, border-color 0.14s; }
.msg-bubble a.md-link:hover { color: var(--c-cyan); border-bottom-style: solid; }
.msg.user .msg-bubble a.md-link { color: #e0f2fe; border-bottom-color: rgba(255,255,255,0.6); }
.msg-bubble .md-img { max-width: 100%; border-radius: 8px; margin: 6px 0; display: block; box-shadow: var(--sh-sm); }
.msg-bubble strong { font-weight: 700; color: var(--ink); }
.msg.user .msg-bubble strong { color: #fff; }

/* ---------- 时钟应用 ---------- */
.clock-app { display: flex; flex-direction: column; height: 100%; padding: 18px; gap: 14px; }
.clock-tabs { display: flex; gap: 6px; background: var(--surface); padding: 4px; border-radius: var(--r-pill); border: 1px solid var(--glass-border); }
.clock-tab { flex: 1; padding: 8px 10px; border-radius: var(--r-pill); font-size: 13px; color: var(--ink-faint); transition: all 0.2s var(--ease); }
.clock-tab.active { background: var(--grad-main); color: #fff; box-shadow: 0 4px 14px rgba(var(--c-purple-rgb),0.4); }
.clock-pane { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.clock-pane[hidden] { display: none; }
.clock-pane:not([hidden]) { animation: panelContentIn .16s var(--ease); }
@keyframes panelContentIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.clock-big { font-size: 46px; font-weight: 600; letter-spacing: 1px; background: var(--grad-main); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.clock-date { font-size: 14px; color: var(--ink-faint); }
.clock-btns { display: flex; gap: 8px; }
.clock-laps { font-size: 12px; color: var(--ink-muted); max-height: 90px; overflow-y: auto; }
.clock-quick { display: flex; gap: 6px; }

/* ---------- 文档阅读器（标签页并入标题栏，v3.1.1 起取消缩放栏仅 Ctrl+滚轮） ---------- */
.doc-app { display: flex; flex-direction: column; height: 100%; }
.doc-app.drag .doc-stage { outline: 2px dashed var(--c-blue); outline-offset: -6px; }
.doc-tab .dt-label { overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.doc-tab .dt-x { display: inline-flex; align-items: center; justify-content: center; opacity: 0.6; padding: 0 3px; border-radius: 4px; }
.doc-tab .dt-x:hover { opacity: 1; background: rgba(239,68,68,0.3); }
.doc-stage { flex: 1; min-height: 0; position: relative; overflow: hidden; }
.doc-open { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 30px; text-align: center; }
.doc-open-icon { font-size: 52px; opacity: 0.6; }
.doc-open-title { font-size: 19px; color: var(--ink); font-weight: 600; }
.doc-open-sub { font-size: 13px; color: var(--ink-faint); }
.doc-open-tip { font-size: 11.5px; color: var(--ink-muted); }
.doc-pane { position: absolute; inset: 0; overflow: auto; background: rgba(8,12,28,0.3); }
body.tzos.light .doc-pane { background: rgba(255,255,255,0.5); }
.doc-content { padding: 22px 26px; font-size: 14px; line-height: 1.75; color: var(--ink-dim); max-width: 860px; margin: 0 auto; }
.doc-content h1, .doc-content h2, .doc-content h3 { color: var(--ink); margin: 16px 0 8px; }
.doc-content p { margin: 8px 0; }
.doc-content table { border-collapse: collapse; margin: 10px 0; font-size: 13px; }
.doc-content td, .doc-content th { border: 1px solid var(--glass-border); padding: 5px 10px; }
.doc-content th { background: var(--surface-2); }
.doc-content img { max-width: 100%; }
.doc-frame { width: 100%; height: 100%; border: none; background: #fff; display: block; }
.doc-pdf { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.doc-pdf-page { max-width: 100%; border-radius: 6px; box-shadow: var(--sh-md); }
.doc-slide { background: var(--surface); border: 1px solid var(--glass-border); border-radius: 10px; padding: 14px 16px; margin: 12px 0; }
.doc-slide-no { font-size: 11px; color: var(--c-violet); font-weight: 700; margin-bottom: 8px; }
.doc-slide-line { font-size: 13.5px; color: var(--ink-dim); line-height: 1.7; padding: 1px 0; }
/* Ctrl+滚轮缩放时的瞬时百分比提示 */
.doc-zoom-tip { position: absolute; right: 16px; bottom: 14px; z-index: 5; padding: 5px 12px; border-radius: 999px; background: var(--glass-strong); border: 1px solid var(--glass-border); color: var(--ink); font-size: 12.5px; box-shadow: var(--sh-md); opacity: 0; transition: opacity 0.25s; pointer-events: none; backdrop-filter: blur(12px); }
.doc-zoom-tip.show { opacity: 1; }

/* ---------- 笔记（Markdown / LaTeX） ---------- */
.notes-app { display: flex; height: 100%; min-height: 0; }
.notes-side { width: 200px; flex-shrink: 0; border-right: 1px solid var(--glass-border); display: flex; flex-direction: column; padding: 10px; gap: 8px; min-height: 0; }
.notes-new { width: 100%; flex-shrink: 0; }
.notes-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; min-height: 0; }
.notes-empty { color: var(--ink-faint); font-size: 12px; text-align: center; padding: 30px 6px; line-height: 1.8; }
.notes-item { padding: 7px 9px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; transition: background 0.13s; }
.notes-item:hover { background: var(--hover); }
.notes-item.active { background: rgba(var(--c-violet-rgb),0.16); border-color: rgba(var(--c-violet-rgb),0.38); }
.ni-no { display: inline-block; font-size: 10.5px; color: var(--c-violet); background: rgba(var(--c-violet-rgb),.12); border: 1px solid rgba(var(--c-violet-rgb),.3); border-radius: 5px; padding: 0 5px; margin-right: 6px; font-family: ui-monospace, Consolas, monospace; vertical-align: 1px; }
.ni-title { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ni-sub { font-size: 11px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.notes-main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.notes-toolbar { display: flex; gap: 8px; align-items: center; padding: 10px 12px 6px; flex-shrink: 0; }
.notes-title { flex: 1; min-width: 0; }
.notes-modes { display: flex; gap: 2px; background: var(--surface-2); border: 1px solid var(--glass-border); border-radius: 8px; padding: 2px; flex-shrink: 0; }
.notes-mode { border: none; background: transparent; color: var(--ink-muted); padding: 4px 9px; border-radius: 6px; cursor: pointer; font-size: 13px; line-height: 1; }
.notes-mode:hover { color: var(--ink); }
.notes-mode.active { background: rgba(var(--c-violet-rgb),0.28); color: var(--ink); }
.notes-body { flex: 1; display: flex; gap: 8px; padding: 6px 12px 8px; min-height: 0; }
.notes-editor { flex: 1; min-width: 0; resize: none; background: var(--surface); border: 1px solid var(--glass-border); border-radius: 10px; padding: 12px; color: var(--ink); font: 13px/1.7 "Cascadia Mono", Consolas, "Segoe UI", "PingFang SC", "Microsoft YaHei", monospace; outline: none; }
.notes-editor:focus { border-color: var(--c-violet); }
.notes-preview { flex: 1; min-width: 0; overflow-y: auto; padding: 4px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--glass-border); font-size: 14px; line-height: 1.75; color: var(--ink-dim); }
.notes-body.edit .notes-preview { display: none; }
.notes-body.prev .notes-editor { display: none; }
.notes-preview h1, .notes-preview h2, .notes-preview h3, .notes-preview h4, .notes-preview h5, .notes-preview h6 { color: var(--ink); margin: 12px 0 6px; line-height: 1.4; }
.notes-preview h1 { font-size: 1.35em; } .notes-preview h2 { font-size: 1.2em; } .notes-preview h3 { font-size: 1.1em; }
.notes-preview p { margin: 7px 0; }
.notes-preview ul, .notes-preview ol { margin: 6px 0; padding-left: 22px; }
.notes-preview li { margin: 2px 0; }
.notes-preview blockquote { margin: 8px 0; padding: 6px 12px; border-left: 3px solid var(--c-violet); background: var(--surface-2); border-radius: 0 8px 8px 0; color: var(--ink-muted); }
.notes-preview pre { background: rgba(0,0,0,0.4); padding: 10px; border-radius: 8px; overflow-x: auto; margin: 8px 0; font-size: 12px; }
body.tzos.light .notes-preview pre { background: rgba(15,23,42,0.06); }
.notes-preview code { font-family: "Cascadia Mono", Consolas, monospace; font-size: 0.92em; }
.notes-preview .md-ic { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.notes-preview hr { border: none; border-top: 1px solid var(--glass-border); margin: 12px 0; }
.notes-preview .md-img { max-width: 100%; border-radius: 8px; }
.notes-preview .md-link { color: var(--c-blue); }
.notes-status { padding: 0 14px 8px; font-size: 11px; color: var(--ink-faint); flex-shrink: 0; }
/* 保存占位（与 AI 对话修复同源：单条轻量占位，杜绝"两个进度条"）
   使用与 .chat-streaming-placeholder 一致的脉冲圆点，状态栏是唯一的进度反馈通道。 */
.notes-status .notes-saving-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--c-violet); margin-right: 6px; vertical-align: 1px; animation: notes-saving-pulse 1.1s ease-in-out infinite; }
.notes-status .notes-saving-text { color: var(--ink-muted); }
@keyframes notes-saving-pulse { 0%, 100% { opacity: .35; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.1); } }

/* ---------- AI 配置左右分栏 ---------- */
.app-config.cfg-split { max-width: 980px; display: grid; grid-template-columns: 1fr 1fr; gap: 26px; padding: 22px; }
.app-config.cfg-split .cfg-col { min-width: 0; }
.cfg-h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.cfg-hr { margin: 20px 0; border: none; border-top: 1px solid var(--glass-border); }
@media (max-width: 860px) { .app-config.cfg-split { grid-template-columns: 1fr; } }

/* ---------- 任务栏状态图标（电量/联网） ---------- */
.tb-status { font-size: 12px; color: var(--ink-dim); padding: 0 4px; cursor: default; display: flex; align-items: center; white-space: nowrap; }
.tb-status.off { color: #fca5a5; }
.tb-status.low { color: #fbbf24; }
.tb-vol { cursor: pointer; border-radius: 6px; padding: 3px 5px; transition: background 0.15s; user-select: none; }
.tb-vol:hover { background: var(--hover); }

/* ---------- 消息进入更丝滑 ---------- */
.msg { animation: msgIn 0.22s var(--ease); }
.desktop-icons .desktop-icon, .start-apps .start-app { animation: iconIn 0.2s var(--ease) backwards; }
@keyframes iconIn { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: none; } }

/* ============================================================
   界面配色皮肤（v3.5）：默认冷色（紫·蓝·绿）；
   body[data-palette="mid"|"warm"] 时整体切换品牌色与桌面背景。
   mid 标准：蓝·绿·黄；warm 暖色：绿·黄·橙。
   ============================================================ */
body[data-palette="mid"] {
  --c-purple: #3b82f6; --c-violet: #60a5fa; --c-blue: #10b981; --c-sky: #34d399;
  --c-cyan: #4ade80; --c-green: #eab308; --c-emerald: #facc15;
  --c-indigo: #0ea5e9;
  --c-violet-soft: #60a5fa; --c-blue-soft: #6ee7b7; --c-green-soft: #fde047;
  --c-purple-rgb: 59,130,246; --c-violet-rgb: 96,165,250; --c-indigo-rgb: 14,165,233;
  --c-blue-rgb: 16,185,129; --c-sky-rgb: 52,211,153; --c-cyan-rgb: 74,222,128;
  --c-green-rgb: 234,179,8; --c-emerald-rgb: 250,204,21;
  --c-violet-soft-rgb: 96,165,250; --c-blue-soft-rgb: 110,231,183; --c-green-soft-rgb: 253,224,71;
  --grad-main: linear-gradient(135deg, #3b82f6 0%, #10b981 52%, #eab308 100%);
  --grad-soft: linear-gradient(135deg, #60a5fa 0%, #6ee7b7 50%, #fde047 100%);
}
body[data-palette="warm"] {
  --c-purple: #10b981; --c-violet: #34d399; --c-blue: #eab308; --c-sky: #fbbf24;
  --c-cyan: #fb923c; --c-green: #f97316; --c-emerald: #fdba74;
  --c-indigo: #eab308;
  --c-violet-soft: #6ee7b7; --c-blue-soft: #fde047; --c-green-soft: #fdba74;
  --c-purple-rgb: 16,185,129; --c-violet-rgb: 52,211,153; --c-indigo-rgb: 234,179,8;
  --c-blue-rgb: 234,179,8; --c-sky-rgb: 251,191,36; --c-cyan-rgb: 251,146,60;
  --c-green-rgb: 249,115,22; --c-emerald-rgb: 253,186,116;
  --c-violet-soft-rgb: 110,231,183; --c-blue-soft-rgb: 253,224,71; --c-green-soft-rgb: 253,186,116;
  --grad-main: linear-gradient(135deg, #10b981 0%, #eab308 52%, #f97316 100%);
  --grad-soft: linear-gradient(135deg, #6ee7b7 0%, #fde047 50%, #fdba74 100%);
}
/* 桌面背景（深色） */
body[data-palette="mid"] .desktop {
  background:
    radial-gradient(120vmax 80vmax at 15% 12%, rgba(59,130,246,0.38), transparent 55%),
    radial-gradient(110vmax 70vmax at 88% 85%, rgba(234,179,8,0.30), transparent 55%),
    radial-gradient(90vmax 90vmax at 75% 20%, rgba(16,185,129,0.32), transparent 55%),
    linear-gradient(160deg, #0a0f24 0%, #070b1a 100%);
}
body[data-palette="mid"] .desktop.mac-style {
  background:
    radial-gradient(120vmax 80vmax at 20% 15%, rgba(59,130,246,0.34), transparent 55%),
    radial-gradient(110vmax 70vmax at 80% 80%, rgba(234,179,8,0.26), transparent 55%),
    linear-gradient(150deg, #101a30 0%, #0a121f 100%);
}
body[data-palette="warm"] .desktop {
  background:
    radial-gradient(120vmax 80vmax at 15% 12%, rgba(16,185,129,0.36), transparent 55%),
    radial-gradient(110vmax 70vmax at 88% 85%, rgba(249,115,22,0.30), transparent 55%),
    radial-gradient(90vmax 90vmax at 75% 20%, rgba(234,179,8,0.30), transparent 55%),
    linear-gradient(160deg, #0a0f24 0%, #070b1a 100%);
}
body[data-palette="warm"] .desktop.mac-style {
  background:
    radial-gradient(120vmax 80vmax at 20% 15%, rgba(16,185,129,0.32), transparent 55%),
    radial-gradient(110vmax 70vmax at 80% 80%, rgba(249,115,22,0.26), transparent 55%),
    linear-gradient(150deg, #10241c 0%, #0a140f 100%);
}
/* 桌面背景（浅色，特异性需高于 body.tzos.light .desktop） */
body.tzos.light[data-palette="mid"] .desktop {
  background:
    radial-gradient(120vmax 80vmax at 15% 12%, rgba(59,130,246,0.20), transparent 55%),
    radial-gradient(110vmax 70vmax at 88% 85%, rgba(234,179,8,0.18), transparent 55%),
    radial-gradient(90vmax 90vmax at 75% 20%, rgba(16,185,129,0.18), transparent 55%),
    linear-gradient(160deg, #e8ecf8 0%, #dde4f2 100%);
}
body.tzos.light[data-palette="mid"] .desktop.mac-style {
  background:
    radial-gradient(120vmax 80vmax at 20% 15%, rgba(59,130,246,0.18), transparent 55%),
    radial-gradient(110vmax 70vmax at 80% 80%, rgba(234,179,8,0.16), transparent 55%),
    linear-gradient(150deg, #e4ecfa 0%, #e2e8f5 100%);
}
body.tzos.light[data-palette="warm"] .desktop {
  background:
    radial-gradient(120vmax 80vmax at 15% 12%, rgba(16,185,129,0.20), transparent 55%),
    radial-gradient(110vmax 70vmax at 88% 85%, rgba(249,115,22,0.18), transparent 55%),
    radial-gradient(90vmax 90vmax at 75% 20%, rgba(234,179,8,0.18), transparent 55%),
    linear-gradient(160deg, #e8f4ec 0%, #dde8f2 100%);
}
body.tzos.light[data-palette="warm"] .desktop.mac-style {
  background:
    radial-gradient(120vmax 80vmax at 20% 15%, rgba(16,185,129,0.18), transparent 55%),
    radial-gradient(110vmax 70vmax at 80% 80%, rgba(249,115,22,0.16), transparent 55%),
    linear-gradient(150deg, #e4f5ec 0%, #e2e8f5 100%);
}

/* ---------- 配色选择卡片（系统设置） ---------- */
.skin-pick { display: flex; gap: 10px; flex-wrap: wrap; }
.skin-opt {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 14px; border-radius: var(--r-md); cursor: pointer; min-width: 86px;
  background: var(--surface); border: 1.5px solid var(--glass-border);
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.skin-opt:hover { transform: translateY(-2px); }
.skin-opt.active { border-color: var(--c-violet); box-shadow: var(--sh-glow); }
.skin-opt.locked { opacity: 0.72; }
.skin-dots { display: flex; gap: 5px; }
.skin-dots i { width: 16px; height: 16px; border-radius: 50%; display: block; box-shadow: 0 1px 4px rgba(0,0,0,0.35); }
.skin-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.skin-opt { width: 100%; font: inherit; text-align: left; }
.skin-sub { font-size: 11px; color: var(--ink-faint); }
.skin-cost { font-size: 11px; color: var(--c-emerald); }
.skin-opt.locked .skin-cost { color: #fbbf24; }

/* ---------- 等级进度条（系统设置/等级与外观） ---------- */
.rpg-bar {
  width: 180px; height: 10px; border-radius: 999px; flex-shrink: 0;
  background: var(--surface-2); overflow: hidden; border: 1px solid var(--glass-border);
}
.rpg-bar i { display: block; height: 100%; border-radius: 999px; background: var(--grad-main); transition: width 0.4s var(--ease); }

/* ---------- 等级与外观应用（v3.5） ---------- */
.growth-panel { max-width: 560px; }
.growth-hero {
  display: flex; align-items: center; gap: 18px; padding: 18px 20px; margin-bottom: 12px;
  background: var(--surface); border: 1px solid var(--glass-border); border-radius: var(--r-lg);
}
.gh-lv {
  font-size: 26px; font-weight: 650; padding: 12px 16px; border-radius: var(--r-md);
  background: var(--grad-main); color: #fff; letter-spacing: 1px; flex-shrink: 0;
  box-shadow: var(--sh-glow);
}
.gh-main { flex: 1; min-width: 0; }
.gh-title { font-size: 16px; font-weight: 600; color: var(--ink); }
.gh-pts { font-size: 12px; color: var(--ink-dim); margin-top: 2px; }
.gh-pts b { color: var(--c-emerald); font-size: 14px; }
.gh-next { font-size: 11px; color: var(--ink-faint); margin-top: 5px; }
.growth-titles { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.growth-title {
  font-size: 11px; padding: 3px 10px; border-radius: 999px; color: var(--ink-faint);
  background: var(--surface); border: 1px solid var(--glass-border);
}
.growth-title.got {
  color: #fff; background: var(--grad-main); border-color: transparent;
}
.growth-rule { margin-bottom: 10px; }
.gr-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-dim); margin-bottom: 4px; }
.gr-vals { color: var(--ink-faint); font-size: 11px; }

/* ============================================================
   天择OS 4.1 · Evolution Shell
   生成式星图壁纸、矿物按钮材质与光纤表面均来自 ui-v4 图片资产。
   旧布局/窗口层级契约保持不变；此区只重构视觉壳与新增的顶部态势线/系统轨道。
   ============================================================ */
:root {
  --os-wallpaper: url("../../../assets/img/section-bg/source/os.webp");
  --os-surface: url("../../../assets/img/ui-v4/surface-cold.webp");
  --os-button: url("../../../assets/img/ui-v4/button-cold.webp");
  --os-icon-atlas: url("../../../assets/img/ui-v4/icon-atlas-cold.png");
  --os-icon-well: url("../../../assets/img/ui-v4/icon-well-cold.webp");
  --os-wallpaper-layer: linear-gradient(rgba(7, 13, 30, .18), rgba(7, 13, 30, .18)), var(--os-wallpaper);
  --os-surface-layer: linear-gradient(rgba(7, 13, 30, .74), rgba(7, 13, 30, .74)), var(--os-surface);
  --os-button-layer: linear-gradient(rgba(11, 18, 39, .18), rgba(11, 18, 39, .18)), var(--os-button);
}
body[data-palette="mid"] {
  --os-wallpaper: url("../../../assets/img/section-bg/source/os.webp");
  --os-surface: url("../../../assets/img/ui-v4/surface-mid.webp");
  --os-button: url("../../../assets/img/ui-v4/button-mid.webp");
  --os-icon-atlas: url("../../../assets/img/ui-v4/icon-atlas-mid.png");
  --os-icon-well: url("../../../assets/img/ui-v4/icon-well-mid.webp");
}
body[data-palette="warm"] {
  --os-wallpaper: url("../../../assets/img/section-bg/source/os.webp");
  --os-surface: url("../../../assets/img/ui-v4/surface-warm.webp");
  --os-button: url("../../../assets/img/ui-v4/button-warm.webp");
  --os-icon-atlas: url("../../../assets/img/ui-v4/icon-atlas-warm.png");
  --os-icon-well: url("../../../assets/img/ui-v4/icon-well-warm.webp");
}
body.tzos.light {
  --os-wallpaper-layer: linear-gradient(rgba(242, 246, 255, .64), rgba(242, 246, 255, .64)), var(--os-wallpaper);
  --os-surface-layer: linear-gradient(rgba(246, 249, 255, .82), rgba(246, 249, 255, .82)), var(--os-surface);
  --os-button-layer: linear-gradient(rgba(255, 255, 255, .28), rgba(255, 255, 255, .28)), var(--os-button);
}

/* 图标图集为 AI 生成的 8 × 8 透明 PNG。
   直接渲染图集，避免 Electron 自定义协议下 CSS mask 失效造成空图标。 */
.tz-icon {
  --tz-ix: 7;
  --tz-iy: 7;
  --tz-x: 100%;
  --tz-y: 100%;
  display: inline-block;
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  background-color: transparent;
  background-image: var(--os-icon-atlas);
  background-repeat: no-repeat;
  background-size: 800% 800%;
  background-position: var(--tz-x) var(--tz-y);
  -webkit-mask: none;
  mask: none;
  vertical-align: -.12em;
}
.tz-icon[style*="--tz-ix:0"] { --tz-x: 0%; }
.tz-icon[style*="--tz-ix:1"] { --tz-x: 14.285714%; }
.tz-icon[style*="--tz-ix:2"] { --tz-x: 28.571429%; }
.tz-icon[style*="--tz-ix:3"] { --tz-x: 42.857143%; }
.tz-icon[style*="--tz-ix:4"] { --tz-x: 57.142857%; }
.tz-icon[style*="--tz-ix:5"] { --tz-x: 71.428571%; }
.tz-icon[style*="--tz-ix:6"] { --tz-x: 85.714286%; }
.tz-icon[style*="--tz-ix:7"] { --tz-x: 100%; }
.tz-icon[style*="--tz-iy:0"] { --tz-y: 0%; }
.tz-icon[style*="--tz-iy:1"] { --tz-y: 14.285714%; }
.tz-icon[style*="--tz-iy:2"] { --tz-y: 28.571429%; }
.tz-icon[style*="--tz-iy:3"] { --tz-y: 42.857143%; }
.tz-icon[style*="--tz-iy:4"] { --tz-y: 57.142857%; }
.tz-icon[style*="--tz-iy:5"] { --tz-y: 71.428571%; }
.tz-icon[style*="--tz-iy:6"] { --tz-y: 85.714286%; }
.tz-icon[style*="--tz-iy:7"] { --tz-y: 100%; }
.tz-icon-hero { width: 64px; height: 64px; color: var(--c-violet-soft); }
.tz-icon-label { display: inline-flex; align-items: center; gap: 7px; }
.tz-icon-label > .tz-icon { font-size: 1.05em; color: var(--c-violet-soft); }

body.tzos {
  background-color: #12203a;
  background-image: var(--os-wallpaper-layer);
  background-size: cover;
  background-position: center;
}
.boot-screen {
  background-color: #12203a;
  background-image: linear-gradient(rgba(5, 12, 29, .34), rgba(5, 12, 29, .72)), var(--os-wallpaper);
  background-size: cover;
  background-position: center;
}
body.tzos.light .boot-screen {
  background-color: #dfe8f6;
  background-image: var(--os-wallpaper-layer);
  background-size: cover;
  background-position: center;
}
.boot-logo {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 30px;
  background-image: var(--os-surface-layer);
  background-size: cover;
  box-shadow: 0 24px 80px rgba(0,0,0,.34), inset 0 1px rgba(255,255,255,.14);
}
.boot-name { color: var(--ink); background: none; -webkit-text-fill-color: currentColor; }
.boot-name span { color: var(--c-violet-soft); letter-spacing: 1px; }
.boot-edition { margin-top: 8px; font-size: 10px; letter-spacing: 4px; color: var(--ink-faint); }
.boot-spinner span { background-image: var(--os-button); background-size: cover; }

.desktop,
.desktop.mac-style,
body[data-palette="mid"] .desktop,
body[data-palette="mid"] .desktop.mac-style,
body[data-palette="warm"] .desktop,
body[data-palette="warm"] .desktop.mac-style,
body.tzos.light .desktop,
body.tzos.light .desktop.mac-style,
body.tzos.light[data-palette="mid"] .desktop,
body.tzos.light[data-palette="mid"] .desktop.mac-style,
body.tzos.light[data-palette="warm"] .desktop,
body.tzos.light[data-palette="warm"] .desktop.mac-style {
  background-color: #12203a;
  background-image: linear-gradient(rgba(4, 10, 24, .13), rgba(4, 10, 24, .32)), var(--os-wallpaper);
  background-size: cover;
  background-position: center;
}
body.tzos.light .desktop,
body.tzos.light .desktop.mac-style,
body.tzos.light[data-palette="mid"] .desktop,
body.tzos.light[data-palette="mid"] .desktop.mac-style,
body.tzos.light[data-palette="warm"] .desktop,
body.tzos.light[data-palette="warm"] .desktop.mac-style {
  background-image: linear-gradient(rgba(255, 255, 255, .26), rgba(238, 245, 255, .42)), var(--os-wallpaper);
}
.desktop::before {
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, transparent 0, #000 18%, #000 84%, transparent 100%);
}

/* 4.0 顶部态势线与系统轨道。z-index 仅 72/74：低于普通窗口起始层级 100。 */
.os-topline {
  position: absolute;
  z-index: 72;
  top: 14px;
  left: 18px;
  right: 18px;
  height: 48px;
  display: grid;
  grid-template-columns: minmax(190px, auto) minmax(260px, 520px) minmax(190px, auto);
  align-items: center;
  gap: 14px;
  pointer-events: none;
}
.os-topline > * { pointer-events: auto; }
.os-brand-chip,
.os-command-chip,
.os-top-status {
  min-height: 44px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 16px;
  background-image: var(--os-surface-layer);
  background-size: cover;
  background-position: center;
  box-shadow: 0 14px 40px rgba(0,0,0,.18), inset 0 1px rgba(255,255,255,.1);
  backdrop-filter: blur(20px) saturate(145%);
}
.os-brand-chip {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 13px 5px 9px;
  text-align: left;
}
.os-brand-chip .tz-icon { width: 28px; height: 28px; color: var(--c-violet-soft); }
.os-brand-chip b { display: block; font-size: 13px; letter-spacing: .5px; }
.os-brand-chip small { display: block; margin-top: 1px; color: var(--ink-faint); font-size: 9px; letter-spacing: 1px; }
.os-command-chip {
  width: 100%;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: var(--ink-dim);
}
.os-command-chip .tz-icon { color: var(--c-blue-soft); }
.os-command-chip span:nth-child(2) { flex: 1; text-align: left; }
.os-command-chip kbd {
  padding: 3px 7px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 6px;
  color: var(--ink-faint);
  background: rgba(255,255,255,.05);
  font: 10px/1.2 "Cascadia Mono", Consolas, monospace;
}
.os-top-status {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  font-size: 11px;
  color: var(--ink-dim);
}
.os-top-status #osTopClock { color: var(--ink); font-variant-numeric: tabular-nums; }
.os-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-green-soft);
  box-shadow: 0 0 12px rgba(var(--c-green-rgb),.9);
}

.system-rail {
  position: absolute;
  z-index: 74;
  top: 82px;
  left: 18px;
  width: 60px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: calc(100vh - 150px);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--c-violet-rgb),.38) transparent;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 22px;
  background-image: var(--os-surface-layer);
  background-size: cover;
  background-position: center;
  box-shadow: 0 18px 50px rgba(0,0,0,.22), inset 0 1px rgba(255,255,255,.1);
  backdrop-filter: blur(22px) saturate(150%);
}
.system-rail button {
  min-height: 52px;
  padding: 7px 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid transparent;
  border-radius: 15px;
  background-image: var(--os-button-layer);
  background-size: 320% 320%;
  background-position: center;
  color: var(--ink-dim);
  transition: transform .16s var(--ease), border-color .16s, color .16s;
}
.system-rail button:hover {
  transform: translateX(3px);
  border-color: rgba(var(--c-violet-rgb),.5);
  color: var(--ink);
}
.system-rail .tz-icon { width: 20px; height: 20px; color: var(--c-violet-soft); }
.system-rail button > span:last-child { font-size: 9px; letter-spacing: .5px; }

.desktop-icons { top: 76px; left: 92px; }
.desktop.mac-style .desktop-icons { top: 76px; }

/* 生成图片表面覆盖所有 OS 壳体，但保留原 z-index 与 hidden 行为。 */
.taskbar,
.desktop.mac-style .taskbar,
.start-menu,
.ctx-menu,
.notif-center,
.floating-widget,
.tz-dialog,
.win,
.win-title,
.win-body,
.app-chat,
.app-browser,
.chat-input-bar,
.term-app,
.term-input-row,
.term-out .tz-term-big,
.term-out .tz-term-pre,
.msg-bubble pre,
.msg-bubble code.md-ic,
.notes-preview pre,
.notes-editor,
.notes-preview,
.doc-pane,
.cmd-card,
.notif,
.floating-widget .fw-header,
.store-prompt-box,
.tz-dialog-input,
.input,
.textarea,
.clock-tabs,
.notes-modes,
.growth-hero,
.skin-opt,
.store-installed-item,
.config-status,
.setting-row,
.browser-bookmarks,
.doc-slide {
  background-color: transparent !important;
  background-image: var(--os-surface-layer) !important;
  background-size: cover !important;
  background-position: center !important;
}
body.tzos.light .win-title,
body.tzos.light .win-body,
body.tzos.light .app-chat,
body.tzos.light .app-browser,
body.tzos.light .chat-input-bar,
body.tzos.light .term-app,
body.tzos.light .term-input-row,
body.tzos.light .msg.ai .msg-bubble,
body.tzos.light .start-search input,
body.tzos.light .input,
body.tzos.light .textarea,
body.tzos.light .store-installed-item,
body.tzos.light .store-prompt-box,
body.tzos.light .term-out .tz-term-big,
body.tzos.light .term-out .tz-term-pre,
body.tzos.light .msg-bubble pre,
body.tzos.light .msg-bubble code.md-ic,
body.tzos.light .notes-preview pre {
  background-color: transparent !important;
  background-image: var(--os-surface-layer) !important;
  background-size: cover !important;
  background-position: center !important;
}
.taskbar {
  left: 12px;
  right: 12px;
  bottom: 10px;
  height: 54px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 18px;
  box-shadow: 0 18px 54px rgba(0,0,0,.25), inset 0 1px rgba(255,255,255,.1);
}
.start-menu { bottom: 74px; left: 18px; }
.floating-widget,
.fw-reopen { bottom: 76px; }
.notif-center { bottom: 74px; right: 18px; }
.win {
  border-color: rgba(255,255,255,.16);
  box-shadow: 0 28px 90px rgba(0,0,0,.34), inset 0 1px rgba(255,255,255,.08);
}
.win-title { background-position: 50% 18%; }
.win-body { background-position: 50% 80%; }
.di-icon,
.sa-icon,
.dock-app,
.sii-icon {
  background-color: transparent !important;
  background-image: var(--os-icon-well) !important;
  background-size: cover !important;
  background-position: center !important;
  border: 1px solid rgba(255,255,255,.16) !important;
}
.msg-avatar,
.ce-icon {
  background-color: transparent !important;
  background-image: var(--os-button-layer) !important;
  background-size: cover !important;
  background-position: center !important;
  border: 1px solid rgba(255,255,255,.16) !important;
}
.di-icon .tz-icon { width: 30px; height: 30px; color: #fff; }
.sa-icon .tz-icon { width: 24px; height: 24px; color: #fff; }
.dock-app .tz-icon { width: 27px; height: 27px; color: #fff; }
.sii-icon .tz-icon { width: 21px; height: 21px; color: #fff; }
.about-v4 > .sii-icon .tz-icon { width: 42px; height: 42px; }
.tb-task-icon .tz-icon,
.win-title-icon .tz-icon,
.ci-icon .tz-icon,
.tt-icon .tz-icon,
.attach-ficon .tz-icon,
.msg-avatar .tz-icon,
.ce-icon .tz-icon { width: 1em; height: 1em; color: var(--c-violet-soft); }
.win-title-icon { display: inline-flex; align-items: center; justify-content: center; }
.win-title-icon .tz-icon { font-size: 17px; }

/* 所有可点击主控件使用生成的矿物按钮图，而不再依赖纯色/渐变填充。 */
button,
.btn,
.btn.ghost,
.style-pick button,
.style-pick button.active,
.preset-chip,
.tips-cat,
.clock-tab,
.clock-tab.active,
.notes-mode,
.notes-mode.active,
.tz-dialog-btn,
.tz-dialog-btn.confirm,
.tz-dialog-btn.confirm.danger,
.chat-send,
.chat-send.stopping,
.chat-attach-btn,
.store-installed-item button,
.tb-start,
.tb-task,
.tb-tray-btn,
.start-footer button,
.fw-btn,
.fw-reopen,
.os-brand-chip,
.os-command-chip,
.chat-suggest-chip,
.msg-act,
.tb-vol,
.tb-show-desktop,
.br-tab,
.br-tab-plus,
.attach-x,
.toggle {
  background-color: transparent !important;
  background-image: var(--os-button-layer) !important;
  background-size: 320% 320% !important;
  background-position: center !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  color: var(--ink);
}
.btn.ghost { color: var(--ink-dim); }
.btn:hover,
.btn.ghost:hover,
.style-pick button:hover,
.preset-chip:hover,
.tips-cat:hover,
.clock-tab:hover,
.notes-mode:hover,
.chat-attach-btn:hover,
.tb-start:hover,
.tb-task:hover,
.tb-tray-btn:hover,
.start-footer button:hover,
.fw-btn:hover,
.fw-reopen:hover,
.os-brand-chip:hover,
.os-command-chip:hover,
.chat-suggest-chip:hover,
.msg-act:hover,
.tb-vol:hover,
.tb-show-desktop:hover,
.br-tab:hover,
.br-tab-plus:hover,
.attach-x:hover,
.toggle:hover {
  background-image: var(--os-button-layer) !important;
  background-position: 68% 42% !important;
  border-color: rgba(var(--c-violet-rgb),.54);
}
.toggle.on {
  background-image: linear-gradient(rgba(var(--c-green-rgb), .36), rgba(var(--c-green-rgb), .36)), var(--os-button) !important;
  border-color: rgba(var(--c-green-rgb), .62) !important;
}
.style-pick button.active,
.notes-mode.active,
.br-tab.active,
.tb-start.active,
.tb-show-desktop.active,
.clock-tab.active,
.tb-task.active,
.wctrl.pin.active,
.tips-cat.active {
  background-image: var(--os-button-layer) !important;
  background-position: 68% 42% !important;
  border-color: rgba(var(--c-violet-rgb), .65) !important;
  box-shadow:
    inset 0 0 0 1px rgba(var(--c-violet-rgb), .28),
    0 4px 14px rgba(var(--c-violet-rgb), .2);
  color: var(--ink) !important;
}
.tz-dialog-btn.confirm.danger,
.chat-send.stopping,
.wctrl.close,
.fw-close,
#floatCloseBtn {
  background-image: linear-gradient(rgba(112, 8, 18, .48), rgba(112, 8, 18, .48)), var(--os-button) !important;
  border-color: rgba(248, 113, 113, .5) !important;
}
.tb-start .tz-icon,
.tb-tray-btn .tz-icon,
.tb-status .tz-icon,
.fw-btn .tz-icon,
.fw-reopen .tz-icon,
.start-footer .tz-icon { width: 18px; height: 18px; color: var(--c-violet-soft); }
.tb-status { gap: 3px; }
.tz-icon-suffix { font-size: 10px; font-variant-numeric: tabular-nums; }
.chat-toolbar .tz-icon-label,
.msg-actions .tz-icon-label { display: inline-flex; }
.chat-ctx .tz-icon { color: var(--c-blue-soft); }
.doc-open-icon .tz-icon { width: 52px; height: 52px; color: var(--c-violet-soft); }
.attach-x .tz-icon { width: 11px; height: 11px; }
.start-close-btn { width: auto !important; padding: 0 10px; gap: 6px; font-size: 12px !important; }
.start-footer { gap: 8px; }
.start-footer .start-close-btn { margin-right: auto; }

body.mobile .os-topline,
body.mobile .system-rail { display: none; }

@media (forced-colors: active) {
  .tz-icon,
  .cmd-card > summary::before {
    background-color: ButtonText;
    forced-color-adjust: auto;
  }
  button,
  .btn,
  .chat-suggest-chip,
  .msg-act,
  .toggle {
    background-color: ButtonFace !important;
    background-image: none !important;
    border: 1px solid ButtonText !important;
    color: ButtonText !important;
    forced-color-adjust: auto;
  }
}

/* ============================================================
   天择OS 5.0：内部文件、应用管理、Python 与原生浏览器状态
   ============================================================ */
.app-workspace--native { min-width: 0; min-height: 0; }
.workspace-tabs { display: inline-flex; align-items: center; gap: 5px; }
.file-workspace-panel,
.app-manager-panel { display: flex; flex: 1; min-width: 0; min-height: 0; overflow: hidden; }
.file-workspace-panel[hidden],
.app-manager-panel[hidden] { display: none !important; }
.file-workspace-panel > .kb-manager-app { flex: 1; border-radius: 0; }
.file-workspace-panel > .kb-manager-app > .app-workspace__header { display: none; }

.native-files-layout {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.native-files-places {
  min-width: 0;
  padding: 12px 9px;
  overflow-y: auto;
  border-right: 1px solid var(--app-line);
  background: var(--app-neutral);
}
.native-pane-title { padding: 2px 9px 8px; color: var(--ink-muted); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.native-files-places .app-nav__item { width: 100%; }
.native-security-note {
  margin: 14px 5px 0;
  padding: 10px;
  border: 1px solid rgba(var(--c-green-rgb), .28);
  border-radius: 10px;
  color: var(--ink-muted);
  background: rgba(var(--c-green-rgb), .055);
  font-size: 10px;
  line-height: 1.55;
}
.native-files-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.native-pathbar { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; padding: 8px; border-bottom: 1px solid var(--app-line); background: var(--app-neutral); }
.native-path-input { flex: 1; min-width: 100px; height: 32px; padding: 6px 9px; font: 11px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }
.file-search { flex: 0 1 260px; min-width: 150px; }
.file-actionbar { flex: 0 0 auto; margin: 0; border-width: 0 0 1px; border-radius: 0; }
.file-actionbar .tz-icon { width: 14px; height: 14px; }
.native-files-split { display: grid; grid-template-columns: minmax(300px, .92fr) minmax(320px, 1.08fr); flex: 1; min-width: 0; min-height: 0; }
.native-file-browser { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--app-line); }
.native-file-columns,
.native-file-row { display: grid; grid-template-columns: minmax(150px, 1fr) 132px 74px; align-items: center; gap: 9px; }
.native-file-columns { flex: 0 0 auto; padding: 7px 10px; color: var(--ink-muted); border-bottom: 1px solid var(--app-line); font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; }
.native-file-list { flex: 1; min-height: 0; overflow: auto; padding: 5px; }
.native-file-row { width: 100%; min-height: 37px; padding: 6px; border: 1px solid transparent; border-radius: 8px; color: var(--ink-faint); background: transparent; text-align: left; font: inherit; font-size: 10.5px; cursor: pointer; }
.native-file-row:hover,
.native-file-row.selected { color: var(--ink); border-color: rgba(var(--c-blue-rgb), .28); background: rgba(var(--c-blue-rgb), .1); }
.native-file-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.native-file-name .tz-icon { flex: 0 0 auto; width: 17px; height: 17px; }
.native-file-name > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.native-file-status,
.windows-apps-note { flex: 0 0 auto; min-height: 27px; padding: 6px 10px; border-top: 1px solid var(--app-line); color: var(--ink-muted); background: var(--app-neutral); font-size: 9.5px; }
.native-file-status.is-error,
.windows-apps-note.is-error { color: #fca5a5; }
.native-preview { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: rgba(5, 11, 26, .18); }
.native-preview-empty,
.native-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 130px; padding: 24px; color: var(--ink-muted); text-align: center; font-size: 11px; line-height: 1.55; }
.native-preview-empty { flex: 1; }
.native-preview-empty > .tz-icon { width: 38px; height: 38px; opacity: .75; }
.native-preview-empty strong { color: var(--ink); font-size: 13px; }
.native-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: 0 0 auto; min-height: 54px; padding: 8px 10px; border-bottom: 1px solid var(--app-line); background: var(--app-neutral); }
.native-preview-head > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.native-preview-head strong { overflow: hidden; color: var(--ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.native-preview-head small { margin-top: 2px; color: var(--ink-muted); font-size: 9px; }
.native-preview-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.native-text-editor { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.native-text-editor textarea { flex: 1; min-height: 0; width: 100%; resize: none; padding: 13px; border: 0; outline: 0; color: var(--ink-dim); background: rgba(3, 8, 20, .36); font: 11.5px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; tab-size: 2; }
body.tzos.light .native-text-editor textarea { background: rgba(255,255,255,.45); }
.native-text-editor footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: 0 0 auto; padding: 7px 9px; border-top: 1px solid var(--app-line); color: var(--ink-muted); background: var(--app-neutral); font-size: 9.5px; }
.native-text-editor footer > span:last-child { display: flex; gap: 6px; }
.native-media-preview { display: grid; place-items: center; flex: 1; min-height: 0; overflow: auto; padding: 14px; }
.native-media-preview img,
.native-media-preview video { display: block; max-width: 100%; max-height: 100%; border-radius: 8px; object-fit: contain; }
.native-media-preview audio { width: min(360px, 100%); }
.native-pdf-preview { flex: 1; min-width: 0; min-height: 0; border: 0; background: #fff; }

.app-manager-app .app-manager-panel { flex-direction: column; }
.windows-apps-main { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; }
.windows-apps-toolbar { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; padding: 9px 12px; border-bottom: 1px solid var(--app-line); background: var(--app-neutral); }
.windows-apps-toolbar .app-search { flex: 1; max-width: 420px; }
.windows-apps-toolbar > span:last-child { margin-left: auto; color: var(--ink-muted); font-size: 10px; }
.windows-apps-list { flex: 1; min-height: 0; overflow: auto; padding: 12px; }
.windows-app-group + .windows-app-group { margin-top: 16px; }
.windows-app-group h3 { display: flex; align-items: center; gap: 7px; margin: 0 0 7px; color: var(--ink-dim); font-size: 11px; }
.windows-app-group h3 span { color: var(--ink-muted); font-size: 9px; font-weight: 400; }
.windows-app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 7px; }
.windows-app-card { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-width: 0; padding: 9px; border: 1px solid var(--app-line); border-radius: 11px; color: var(--ink-dim); background: var(--app-neutral); text-align: left; }
.windows-app-card:hover { border-color: rgba(var(--c-blue-rgb), .46); background: rgba(var(--c-blue-rgb), .09); }
.windows-app-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: rgba(var(--c-blue-rgb), .12); }
.windows-app-icon .tz-icon { width: 20px; height: 20px; }
.windows-app-card > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; }
.windows-app-card strong { overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.windows-app-card small { margin-top: 3px; color: var(--ink-muted); font-size: 9px; }
.windows-app-card-actions { display: flex; align-items: center; gap: 4px; }
.app-manager-panel .file-manager-main { max-width: none; height: 100%; align-self: stretch; }

.python-tools-layout { display: grid; grid-template-columns: minmax(360px, 1.1fr) minmax(300px, .9fr); flex: 1; min-width: 0; min-height: 0; }
.python-editor-pane,
.python-output-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.python-editor-pane { border-right: 1px solid var(--app-line); }
.python-file-field { display: flex; flex: 1; min-width: 180px; flex-direction: row; align-items: center; gap: 7px; }
.python-file-field > span { flex: 0 0 auto; color: var(--ink-muted); font-size: 10px; }
.python-code-editor { flex: 1; min-width: 0; min-height: 0; resize: none; padding: 14px; border: 0; outline: 0; color: #d6e4ff; background: rgba(2, 6, 18, .76); font: 12px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; tab-size: 4; }
body.tzos.light .python-code-editor { color: #172554; background: rgba(239,246,255,.78); }
.python-output-pane > .app-toolbar { border-width: 0 0 1px; border-radius: 0; }
.python-task-list { display: flex; flex-wrap: wrap; gap: 5px; flex: 0 0 auto; max-height: 100px; overflow: auto; padding: 7px; border-bottom: 1px solid var(--app-line); }
.python-task { display: flex; min-width: 0; flex-direction: column; padding: 5px 8px; border: 1px solid var(--app-line); border-radius: 8px; color: var(--ink-dim); background: var(--app-neutral); text-align: left; }
.python-task.active { border-color: rgba(var(--c-green-rgb), .5); }
.python-task strong { max-width: 190px; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.python-task small,
.python-task-empty { color: var(--ink-muted); font-size: 9px; }
.python-output { flex: 1; min-width: 0; min-height: 0; margin: 0; overflow: auto; padding: 13px; color: #c7f9d4; background: rgba(0, 8, 14, .75); font: 11.5px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
body.tzos.light .python-output { color: #14532d; background: rgba(240,253,244,.76); }
.python-stdin-bar { flex: 0 0 auto; border-width: 1px 0 0 !important; }
.python-stdin-bar .app-field { flex: 1; min-width: 180px; }
.python-stdin-bar .input { width: 100%; }

.desktop-backup-list { display: grid; gap: 7px; padding-top: 8px; }
.desktop-backup-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.desktop-backup-item > span { display: flex; min-width: 0; flex-direction: column; }
.desktop-backup-item strong { color: var(--ink); font-size: 11px; }
.desktop-backup-item small { margin-top: 3px; overflow: hidden; color: var(--ink-muted); font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }

.browser-native-status { max-width: 180px; overflow: hidden; color: var(--ink-muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.browser-native-host { position: relative; }
.browser-native-host .browser-empty { z-index: 1; }
.browser-download-badge { min-width: 24px; }

/* 网页 AI：配置页多选 + 桌面原生 Chromium 承载区（第三方站点不使用 iframe）。 */
.web-ai-site-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.web-ai-site-card {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--app-line);
  border-radius: 11px;
  color: var(--ink-dim);
  background: var(--app-neutral);
  cursor: pointer;
}
.web-ai-site-card:hover { border-color: rgba(var(--c-violet-rgb), .46); background: var(--hover); }
.web-ai-site-card.requires-vpn { border-color: rgba(245,158,11,.28); }
.web-ai-site-card > input { width: 16px; height: 16px; flex: 0 0 auto; accent-color: var(--c-violet); }
.web-ai-site-card__mark { display: grid; width: 31px; height: 31px; flex: 0 0 auto; place-items: center; border-radius: 9px; color: var(--c-violet-soft); background: var(--app-primary-soft); }
.web-ai-site-card__mark .tz-icon { width: 17px; height: 17px; }
.web-ai-site-card__copy { display: flex; flex: 1; min-width: 0; flex-direction: column; }
.web-ai-site-card__copy strong { overflow: hidden; color: var(--ink); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.web-ai-site-card__copy small { overflow: hidden; margin-top: 1px; color: var(--ink-muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.web-ai-site-card .app-badge { flex: 0 0 auto; }
.web-ai-config-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 9px; color: var(--ink-dim); font-size: 10px; }
.web-ai-config-summary small { color: var(--ink-muted); text-align: right; }
.web-ai-provider-picker { display: flex; align-items: center; gap: 6px; min-width: 220px; color: var(--ink-faint); }
.web-ai-provider-picker > .tz-icon { width: 15px; height: 15px; flex: 0 0 auto; }
.web-ai-provider-picker__label { flex: 0 0 auto; font-size: 10px; }
.web-ai-provider-picker .input { width: min(245px, 35vw); height: 32px; padding: 4px 28px 4px 8px; font-size: 10.5px; }
.web-ai-status { max-width: 200px; overflow: hidden; color: var(--ink-muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.web-ai-native-host { position: relative; flex: 1; min-height: 0; background: #fff; }
.web-ai-empty { position: absolute; inset: 0; z-index: 1; min-height: 0; background-image: var(--os-surface-layer); }

@container (max-width: 860px) {
  .native-files-layout { grid-template-columns: 142px minmax(0, 1fr); }
  .native-files-split { grid-template-columns: 1fr; }
  .native-preview { min-height: 46%; border-top: 1px solid var(--app-line); }
  .native-file-browser { border-right: 0; }
  .python-tools-layout { grid-template-columns: 1fr; overflow: auto; }
  .python-editor-pane { min-height: 440px; border-right: 0; border-bottom: 1px solid var(--app-line); }
  .python-output-pane { min-height: 360px; }
  .desktop-backup-item { align-items: stretch; flex-direction: column; }
}
@container (max-width: 600px) {
  .workspace-tabs { width: 100%; }
  .workspace-tabs > .btn { flex: 1; }
  .native-files-layout { display: flex; flex-direction: column; overflow: auto; }
  .native-files-places { display: none; }
  .native-files-main { min-height: 680px; }
  .native-pathbar { flex-wrap: wrap; }
  .file-search { flex-basis: 100%; max-width: none; }
  .native-file-columns,
  .native-file-row { grid-template-columns: minmax(130px, 1fr) 70px; }
  .native-file-columns > span:nth-child(2),
  .native-file-row > span:nth-child(2) { display: none; }
  .windows-apps-toolbar { align-items: stretch; flex-direction: column; }
  .windows-apps-toolbar > span:last-child { margin-left: 0; }
  .windows-app-grid { grid-template-columns: 1fr; }
  .windows-app-card { grid-template-columns: 36px minmax(0, 1fr); }
  .windows-app-card-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .web-ai-site-grid { grid-template-columns: 1fr; }
  .web-ai-provider-picker { min-width: 190px; }
  .web-ai-provider-picker__label { display: none; }
  .web-ai-provider-picker .input { width: 180px; }
}

/* ============================================================
   4.1 完整皮肤与 VIP 外观
   基础皮肤继续复用各自的生成式材质；六档 VIP 拥有独立壁纸、色彩、
   表面叠层、按钮高光和圆角语言。权益判断由 os.js 的 RPG/VIP 层负责。
   ============================================================ */
body[data-palette="vip-bronze"] {
  --c-purple:#92400e;--c-violet:#b45309;--c-indigo:#a16207;--c-blue:#0f766e;--c-sky:#0d9488;--c-cyan:#14b8a6;--c-green:#d97706;--c-emerald:#f59e0b;
  --c-violet-soft:#d6a76c;--c-blue-soft:#5eead4;--c-green-soft:#f4b860;
  --c-purple-rgb:146,64,14;--c-violet-rgb:180,83,9;--c-indigo-rgb:161,98,7;--c-blue-rgb:15,118,110;--c-sky-rgb:13,148,136;--c-cyan-rgb:20,184,166;--c-green-rgb:217,119,6;--c-emerald-rgb:245,158,11;--c-violet-soft-rgb:214,167,108;--c-blue-soft-rgb:94,234,212;--c-green-soft-rgb:244,184,96;
  --grad-main:linear-gradient(135deg,#854d0e,#d97706 54%,#0f766e);--grad-soft:linear-gradient(135deg,#d6a76c,#f4b860 54%,#5eead4);
  --os-wallpaper:url("../../../assets/img/os-vip/vip-bronze.webp");--os-surface:url("../../../assets/img/ui-v4/surface-warm.webp");--os-button:url("../../../assets/img/ui-v4/button-warm.webp");--os-icon-atlas:url("../../../assets/img/ui-v4/icon-atlas-warm.png");--os-icon-well:url("../../../assets/img/ui-v4/icon-well-warm.webp");
  --os-surface-layer:linear-gradient(rgba(48,25,12,.74),rgba(21,31,35,.78)),var(--os-surface);--os-button-layer:linear-gradient(120deg,rgba(255,213,150,.18),rgba(99,45,12,.18)),var(--os-button);--vip-metal:214,167,108;--r-sm:7px;--r-md:10px;--r-lg:15px;
}
body[data-palette="vip-silver"] {
  --c-purple:#475569;--c-violet:#64748b;--c-indigo:#60a5fa;--c-blue:#0284c7;--c-sky:#38bdf8;--c-cyan:#22d3ee;--c-green:#0ea5e9;--c-emerald:#67e8f9;
  --c-violet-soft:#cbd5e1;--c-blue-soft:#93c5fd;--c-green-soft:#67e8f9;
  --c-purple-rgb:71,85,105;--c-violet-rgb:100,116,139;--c-indigo-rgb:96,165,250;--c-blue-rgb:2,132,199;--c-sky-rgb:56,189,248;--c-cyan-rgb:34,211,238;--c-green-rgb:14,165,233;--c-emerald-rgb:103,232,249;--c-violet-soft-rgb:203,213,225;--c-blue-soft-rgb:147,197,253;--c-green-soft-rgb:103,232,249;
  --grad-main:linear-gradient(135deg,#64748b,#60a5fa 52%,#22d3ee);--grad-soft:linear-gradient(135deg,#e2e8f0,#93c5fd 52%,#67e8f9);
  --os-wallpaper:url("../../../assets/img/os-vip/vip-silver.webp");--os-surface:url("../../../assets/img/ui-v4/surface-cold.webp");--os-button:url("../../../assets/img/ui-v4/button-cold.webp");--os-icon-atlas:url("../../../assets/img/ui-v4/icon-atlas-cold.png");--os-icon-well:url("../../../assets/img/ui-v4/icon-well-cold.webp");
  --os-surface-layer:linear-gradient(rgba(23,34,52,.68),rgba(17,39,57,.76)),var(--os-surface);--os-button-layer:linear-gradient(120deg,rgba(241,245,249,.2),rgba(96,165,250,.12)),var(--os-button);--vip-metal:203,213,225;--r-sm:10px;--r-md:14px;--r-lg:20px;
}
body[data-palette="vip-gold"] {
  --c-purple:#92400e;--c-violet:#b45309;--c-indigo:#d97706;--c-blue:#f59e0b;--c-sky:#fbbf24;--c-cyan:#facc15;--c-green:#eab308;--c-emerald:#fde047;
  --c-violet-soft:#f5c46b;--c-blue-soft:#fcd34d;--c-green-soft:#fef08a;
  --c-purple-rgb:146,64,14;--c-violet-rgb:180,83,9;--c-indigo-rgb:217,119,6;--c-blue-rgb:245,158,11;--c-sky-rgb:251,191,36;--c-cyan-rgb:250,204,21;--c-green-rgb:234,179,8;--c-emerald-rgb:253,224,71;--c-violet-soft-rgb:245,196,107;--c-blue-soft-rgb:252,211,77;--c-green-soft-rgb:254,240,138;
  --grad-main:linear-gradient(135deg,#92400e,#f59e0b 48%,#fde047);--grad-soft:linear-gradient(135deg,#f5c46b,#fcd34d 52%,#fef3c7);
  --os-wallpaper:url("../../../assets/img/os-vip/vip-gold.webp");--os-surface:url("../../../assets/img/ui-v4/surface-warm.webp");--os-button:url("../../../assets/img/ui-v4/button-warm.webp");--os-icon-atlas:url("../../../assets/img/ui-v4/icon-atlas-warm.png");--os-icon-well:url("../../../assets/img/ui-v4/icon-well-warm.webp");
  --os-surface-layer:linear-gradient(rgba(49,31,8,.7),rgba(36,25,10,.78)),var(--os-surface);--os-button-layer:linear-gradient(120deg,rgba(255,244,188,.24),rgba(180,83,9,.15)),var(--os-button);--vip-metal:252,211,77;--r-sm:9px;--r-md:16px;--r-lg:24px;
}
body[data-palette="vip-platinum"] {
  --c-purple:#7c3aed;--c-violet:#8b5cf6;--c-indigo:#818cf8;--c-blue:#38bdf8;--c-sky:#7dd3fc;--c-cyan:#67e8f9;--c-green:#cbd5e1;--c-emerald:#f8fafc;
  --c-violet-soft:#c4b5fd;--c-blue-soft:#bae6fd;--c-green-soft:#f8fafc;
  --c-purple-rgb:124,58,237;--c-violet-rgb:139,92,246;--c-indigo-rgb:129,140,248;--c-blue-rgb:56,189,248;--c-sky-rgb:125,211,252;--c-cyan-rgb:103,232,249;--c-green-rgb:203,213,225;--c-emerald-rgb:248,250,252;--c-violet-soft-rgb:196,181,253;--c-blue-soft-rgb:186,230,253;--c-green-soft-rgb:248,250,252;
  --grad-main:linear-gradient(135deg,#8b5cf6,#cbd5e1 48%,#38bdf8);--grad-soft:linear-gradient(135deg,#ddd6fe,#f8fafc 50%,#bae6fd);
  --os-wallpaper:url("../../../assets/img/os-vip/vip-platinum.webp");--os-surface:url("../../../assets/img/ui-v4/surface-cold.webp");--os-button:url("../../../assets/img/ui-v4/button-cold.webp");--os-icon-atlas:url("../../../assets/img/ui-v4/icon-atlas-cold.png");--os-icon-well:url("../../../assets/img/ui-v4/icon-well-cold.webp");
  --os-surface-layer:linear-gradient(rgba(35,31,62,.66),rgba(24,42,62,.74)),var(--os-surface);--os-button-layer:linear-gradient(115deg,rgba(248,250,252,.26),rgba(139,92,246,.12),rgba(56,189,248,.13)),var(--os-button);--vip-metal:226,232,240;--r-sm:12px;--r-md:18px;--r-lg:26px;
}
body[data-palette="vip-blackgold"] {
  --c-purple:#1c1917;--c-violet:#57534e;--c-indigo:#a16207;--c-blue:#ca8a04;--c-sky:#eab308;--c-cyan:#f59e0b;--c-green:#facc15;--c-emerald:#fde047;
  --c-violet-soft:#a8a29e;--c-blue-soft:#facc15;--c-green-soft:#fde68a;
  --c-purple-rgb:28,25,23;--c-violet-rgb:87,83,78;--c-indigo-rgb:161,98,7;--c-blue-rgb:202,138,4;--c-sky-rgb:234,179,8;--c-cyan-rgb:245,158,11;--c-green-rgb:250,204,21;--c-emerald-rgb:253,224,71;--c-violet-soft-rgb:168,162,158;--c-blue-soft-rgb:250,204,21;--c-green-soft-rgb:253,230,138;
  --grad-main:linear-gradient(135deg,#292524,#ca8a04 55%,#fde047);--grad-soft:linear-gradient(135deg,#78716c,#facc15 55%,#fef3c7);
  --os-wallpaper:url("../../../assets/img/os-vip/vip-blackgold.webp");--os-surface:url("../../../assets/img/ui-v4/surface-warm.webp");--os-button:url("../../../assets/img/ui-v4/button-warm.webp");--os-icon-atlas:url("../../../assets/img/ui-v4/icon-atlas-warm.png");--os-icon-well:url("../../../assets/img/ui-v4/icon-well-warm.webp");
  --os-surface-layer:linear-gradient(rgba(21,19,18,.78),rgba(38,31,13,.76)),var(--os-surface);--os-button-layer:linear-gradient(120deg,rgba(253,224,71,.18),rgba(12,10,9,.2)),var(--os-button);--vip-metal:250,204,21;--r-sm:4px;--r-md:8px;--r-lg:14px;
}
body[data-palette="vip-diamond"] {
  --c-purple:#6366f1;--c-violet:#8b5cf6;--c-indigo:#818cf8;--c-blue:#0ea5e9;--c-sky:#22d3ee;--c-cyan:#67e8f9;--c-green:#d946ef;--c-emerald:#e879f9;
  --c-violet-soft:#c4b5fd;--c-blue-soft:#a5f3fc;--c-green-soft:#f0abfc;
  --c-purple-rgb:99,102,241;--c-violet-rgb:139,92,246;--c-indigo-rgb:129,140,248;--c-blue-rgb:14,165,233;--c-sky-rgb:34,211,238;--c-cyan-rgb:103,232,249;--c-green-rgb:217,70,239;--c-emerald-rgb:232,121,249;--c-violet-soft-rgb:196,181,253;--c-blue-soft-rgb:165,243,252;--c-green-soft-rgb:240,171,252;
  --grad-main:linear-gradient(135deg,#6366f1,#22d3ee 48%,#e879f9);--grad-soft:linear-gradient(135deg,#c4b5fd,#a5f3fc 48%,#f0abfc);
  --os-wallpaper:url("../../../assets/img/os-vip/vip-diamond.webp");--os-surface:url("../../../assets/img/ui-v4/surface-cold.webp");--os-button:url("../../../assets/img/ui-v4/button-cold.webp");--os-icon-atlas:url("../../../assets/img/ui-v4/icon-atlas-cold.png");--os-icon-well:url("../../../assets/img/ui-v4/icon-well-cold.webp");
  --os-surface-layer:linear-gradient(rgba(36,31,76,.62),rgba(18,52,74,.7)),var(--os-surface);--os-button-layer:linear-gradient(115deg,rgba(255,255,255,.25),rgba(34,211,238,.12),rgba(232,121,249,.14)),var(--os-button);--vip-metal:165,243,252;--r-sm:13px;--r-md:20px;--r-lg:30px;
}
body.tzos[data-palette^="vip-"] {
  --glass:rgba(16,24,42,.58);--glass-strong:rgba(12,20,37,.8);--glass-border:rgba(var(--vip-metal),.24);--glass-border-strong:rgba(var(--vip-metal),.4);
  --surface:rgba(255,255,255,.065);--surface-2:rgba(255,255,255,.105);--hover:rgba(var(--vip-metal),.12);
  --sh-glow:0 10px 38px rgba(var(--vip-metal),.25);
  --os-wallpaper-layer:linear-gradient(rgba(255,255,255,.08),rgba(9,16,31,.19)),var(--os-wallpaper);
}
body.tzos.light[data-palette^="vip-"] {
  --glass:rgba(255,255,255,.58);--glass-strong:rgba(250,252,255,.82);--surface:rgba(255,255,255,.5);--surface-2:rgba(255,255,255,.72);--hover:rgba(var(--vip-metal),.14);
  --os-surface-layer:linear-gradient(rgba(250,252,255,.72),rgba(242,247,255,.76)),var(--os-surface);
  --os-wallpaper-layer:linear-gradient(rgba(255,255,255,.34),rgba(242,247,255,.4)),var(--os-wallpaper);
}
body.tzos[data-palette^="vip-"] .desktop,
body.tzos[data-palette^="vip-"] .desktop.mac-style {
  background-color:#dbe8f4;
  background-image:linear-gradient(rgba(255,255,255,.05),rgba(7,14,27,.18)),var(--os-wallpaper);
  background-position:center;background-size:cover;
}
body.tzos.light[data-palette^="vip-"] .desktop,
body.tzos.light[data-palette^="vip-"] .desktop.mac-style {
  background-image:linear-gradient(rgba(255,255,255,.28),rgba(245,249,255,.38)),var(--os-wallpaper);
}
body.tzos[data-palette^="vip-"] :is(.btn,.system-rail button,.dock-app,.tb-task,.start-app,.style-pick button) {
  border-color:rgba(var(--vip-metal),.22);
  box-shadow:inset 0 1px rgba(255,255,255,.18),0 8px 24px rgba(7,12,24,.12);
}
body.tzos[data-palette="vip-diamond"] :is(.btn,.system-rail button,.dock-app,.style-pick button) {
  background-image:linear-gradient(115deg,rgba(255,255,255,.16),rgba(34,211,238,.08),rgba(232,121,249,.1)),var(--os-button);
}

.vip-current { display:flex;align-items:center;gap:12px;padding:14px;margin-bottom:12px; }
.vip-current>span:first-child { display:grid;place-items:center;width:42px;height:42px;border-radius:14px;background:var(--grad-main);box-shadow:var(--sh-glow); }
.vip-current>span:nth-child(2) { display:grid;gap:3px;min-width:0;flex:1; }
.vip-current strong { color:var(--ink);font-size:14px; }
.vip-current small { color:var(--ink-muted);font-size:11px; }
.vip-plan-grid { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px; }
.vip-plan { position:relative;display:grid;grid-template-rows:auto auto auto 1fr auto;gap:9px;min-width:0;padding:12px;overflow:hidden; }
.vip-plan.active { outline:2px solid var(--c-violet-soft);box-shadow:var(--sh-glow); }
.vip-plan.locked { opacity:.65; }
.vip-plan__preview { display:grid;place-items:center;height:72px;border:1px solid rgba(255,255,255,.22);border-radius:calc(var(--r-lg) - 3px);background-image:linear-gradient(110deg,rgba(8,15,29,.08),rgba(255,255,255,.06)),var(--vip-preview),linear-gradient(135deg,var(--vip-a),var(--vip-b) 54%,var(--vip-c));background-position:center;background-size:cover; }
.vip-plan__preview .tz-icon { width:32px;height:32px;filter:drop-shadow(0 4px 12px rgba(0,0,0,.32)); }
.vip-plan header { display:flex;align-items:flex-start;justify-content:space-between;gap:8px; }
.vip-plan header>span { display:grid;gap:2px; }
.vip-plan header small { color:var(--ink-muted);font-size:9px;letter-spacing:1.5px; }
.vip-plan header strong { color:var(--ink);font-size:13px; }
.vip-plan>p { color:var(--ink-dim);font-size:10px;line-height:1.5; }
.vip-plan__price { display:flex;align-items:baseline;gap:5px;color:var(--c-violet-soft); }
.vip-plan__price strong { font-size:21px; }
.vip-plan__price span { color:var(--ink-muted);font-size:9px; }
.vip-plan__actions { display:grid;grid-template-columns:1fr;gap:6px; }
.vip-plan__actions>.btn { width:100%;justify-content:center; }

.agent-center-main { display:grid;align-content:start;gap:14px;padding:14px; }
.agent-activity-list,.agent-guard-list { display:grid;gap:9px; }
.agent-job { display:grid;gap:9px;padding:12px; }
.agent-job.is-active { border-color:rgba(var(--c-green-rgb),.48);box-shadow:0 0 0 1px rgba(var(--c-green-rgb),.12),var(--sh-sm); }
.agent-job__head,.agent-job__meta { display:flex;align-items:center;justify-content:space-between;gap:10px; }
.agent-job__head>span:first-child { display:grid;gap:3px;min-width:0; }
.agent-job__head small,.agent-job__meta { color:var(--ink-muted);font-size:10px; }
.agent-job__head strong { overflow:hidden;color:var(--ink);font-size:13px;text-overflow:ellipsis;white-space:nowrap; }
.agent-job__state { display:flex;align-items:center;gap:7px;flex:0 0 auto; }
.agent-job__meta code { overflow:hidden;max-width:48%;color:var(--ink-faint);text-overflow:ellipsis;white-space:nowrap; }
.agent-job__detail { color:var(--ink-dim);font-size:11px;line-height:1.55; }
.agent-job__commands summary { color:var(--c-blue-soft);font-size:11px;cursor:pointer; }
.agent-job__commands ol { display:grid;gap:6px;margin-top:8px;list-style:none; }
.agent-job__commands li { display:grid;gap:3px;padding:8px;border-left:2px solid var(--c-green);border-radius:8px;background:var(--surface); }
.agent-job__commands li.is-error { border-left-color:#ef4444; }
.agent-job__commands code { color:var(--ink);font-size:10px;word-break:break-all; }
.agent-job__commands li>span { display:-webkit-box;overflow:hidden;color:var(--ink-muted);font-size:10px;line-height:1.45;-webkit-box-orient:vertical;-webkit-line-clamp:3;white-space:pre-wrap; }
.agent-guard-row { display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px; }
.agent-guard-row>span:first-child { display:grid;gap:3px; }
.agent-guard-row strong { color:var(--ink);font-size:12px; }.agent-guard-row small { color:var(--ink-muted);font-size:10px; }
.agent-guard-risk { display:grid;gap:4px;width:min(180px,42%); }.agent-guard-risk>i { display:block;height:6px;overflow:hidden;border-radius:99px;background:var(--surface-2); }
.agent-guard-risk>i::before { content:"";display:block;width:var(--risk);height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--c-green),#f59e0b,#ef4444); }
.agent-command-search { position:sticky;z-index:2;top:0;margin-bottom:10px; }.agent-command-search input { flex:1; }.agent-command-search>span:last-child { color:var(--ink-muted);font-size:10px;white-space:nowrap; }
.command-explorer { display:grid;gap:14px; }.command-group { display:grid;gap:8px; }.command-group h3 { color:var(--ink);font-size:12px; }.command-group h3 small { color:var(--ink-muted);font-weight:400; }
.command-grid { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px; }.command-item { display:grid;gap:6px;padding:10px; }.command-item>code { color:var(--c-blue-soft);font-size:11px;word-break:break-word; }.command-item>p { color:var(--ink-dim);font-size:10px;line-height:1.45; }.command-item>footer { display:flex;align-items:center;gap:7px;min-width:0; }.command-item>footer small { overflow:hidden;color:var(--ink-muted);font-size:9px;text-overflow:ellipsis;white-space:nowrap; }

@media (max-width:760px) {
  .vip-plan-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .command-grid { grid-template-columns:1fr; }
}
@media (max-width:480px) {
  .vip-plan-grid { grid-template-columns:1fr; }
  .vip-current { align-items:flex-start;flex-wrap:wrap; }
  .agent-job__head,.agent-job__meta,.agent-guard-row { align-items:flex-start;flex-direction:column; }
  .agent-job__state,.agent-guard-risk { width:100%; }
}

/* ============================================================
   4.1 · Archived AI conversations
   ============================================================ */
.archived-chats-panel {
  position: absolute;
  z-index: 25;
  top: 54px;
  right: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  max-width: 920px;
  max-height: calc(100% - 68px);
  margin-left: auto;
  overflow: hidden;
  border: 1px solid var(--app-line, var(--glass-border));
  border-radius: 18px;
  background: color-mix(in srgb, var(--glass-strong) 97%, transparent);
  box-shadow: 0 24px 68px rgba(0,0,0,.46), 0 0 0 1px rgba(var(--c-blue-rgb),.12);
  backdrop-filter: blur(28px) saturate(1.2);
}
.archived-chats-panel[hidden] { display: none; }
.archived-chats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--app-line, var(--glass-border));
}
.archived-chats-head > div { display: grid; gap: 3px; }
.archived-chats-head strong { color: var(--ink); font-size: 16px; }
.archived-chats-head small { color: var(--ink-muted); font-size: 11px; }
.archived-chats-list { display: grid; gap: 10px; min-height: 0; overflow: auto; padding: 12px; }
.archived-chat-card { border: 1px solid var(--app-line, var(--glass-border)); border-radius: 14px; background: var(--surface); }
.archived-chat-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; }
.archived-chat-card__head > div:first-child { display: grid; min-width: 0; gap: 3px; }
.archived-chat-card__head strong { overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.archived-chat-card__head small { color: var(--ink-muted); font-size: 10px; }
.archived-chat-actions { display: flex; flex: 0 0 auto; gap: 7px; }
.archived-chat-card details { border-top: 1px solid var(--app-line, var(--glass-border)); }
.archived-chat-card summary { padding: 9px 12px; color: var(--c-blue-soft); font-size: 11px; cursor: pointer; }
.archived-chat-messages { display: grid; gap: 8px; max-height: 290px; overflow: auto; padding: 0 12px 12px; }
.archived-chat-message { padding: 9px 10px; border-radius: 11px; background: var(--surface-2); }
.archived-chat-message.is-user { border-left: 2px solid var(--c-blue); }
.archived-chat-message.is-assistant { border-left: 2px solid var(--c-violet); }
.archived-chat-message strong { color: var(--ink); font-size: 10px; }
.archived-chat-message p { margin: 4px 0 0; color: var(--ink-dim); font-size: 11px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.archived-chat-empty { display: grid; place-items: center; gap: 5px; padding: 18px; color: var(--ink-muted); font-size: 11px; text-align: center; }
.archived-chat-empty--panel { min-height: 180px; }
.archived-chat-empty .tz-icon { width: 36px; height: 36px; }
.archived-chat-empty strong { color: var(--ink); font-size: 14px; }

@media (max-width: 700px) {
  body.tzos,
  body.tzos[data-palette="mid"],
  body.tzos[data-palette="warm"] {
    --os-wallpaper: url("../../../assets/img/section-bg/mobile/os.webp");
    --os-wallpaper-layer: linear-gradient(rgba(6, 20, 48, .24), rgba(4, 16, 38, .42)), var(--os-wallpaper);
  }
  body.tzos.light,
  body.tzos.light[data-palette="mid"],
  body.tzos.light[data-palette="warm"] {
    --os-wallpaper-layer: linear-gradient(rgba(238, 246, 255, .42), rgba(225, 238, 255, .52)), var(--os-wallpaper);
  }
  .archived-chats-panel { top: 126px; right: 7px; left: 7px; max-height: calc(100% - 138px); }
  .archived-chat-card__head { align-items: flex-start; flex-direction: column; }
  .archived-chat-actions { width: 100%; }
  .archived-chat-actions .btn { flex: 1; justify-content: center; }
}

.ai-usage-main { display: grid; align-content: start; gap: 14px; padding: 14px; }
.ai-usage-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ai-usage-summary .app-card { display: grid; gap: 5px; min-width: 0; padding: 14px; }
.ai-usage-summary small { color: var(--ink-muted); font-size: 10px; }
.ai-usage-summary strong { overflow: hidden; color: var(--ink); font-size: clamp(20px, 3vw, 31px); text-overflow: ellipsis; white-space: nowrap; }
.ai-usage-summary span { overflow: hidden; color: var(--ink-faint); font-size: 9px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.ai-usage-history { min-width: 0; padding: 0; overflow: hidden; }
.ai-usage-history__head { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding: 14px; border-bottom: 1px solid var(--app-line); }
.ai-usage-history__head > div { display: grid; gap: 3px; }
.ai-usage-history__head strong { color: var(--ink); font-size: 15px; }
.ai-usage-history__head > small { max-width: 420px; color: var(--ink-muted); font-size: 10px; line-height: 1.5; text-align: right; }
.ai-usage-table-wrap { overflow: auto; }
.ai-usage-table-wrap table { width: 100%; min-width: 690px; border-collapse: collapse; }
.ai-usage-table-wrap th,
.ai-usage-table-wrap td { padding: 10px 12px; border-bottom: 1px solid var(--app-line); color: var(--ink-dim); font-size: 10px; text-align: left; }
.ai-usage-table-wrap th { position: sticky; top: 0; z-index: 1; color: var(--ink-muted); background: var(--glass-strong); }
.ai-usage-table-wrap td:first-child { display: grid; gap: 2px; }
.ai-usage-table-wrap td strong { color: var(--ink); font-size: 11px; }
.ai-usage-table-wrap td small { color: var(--ink-muted); font-size: 9px; }

@media (max-width: 900px) {
  .ai-usage-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .ai-usage-main { padding: 8px; }
  .ai-usage-summary { grid-template-columns: 1fr; }
  .ai-usage-history__head { align-items: start; flex-direction: column; }
  .ai-usage-history__head > small { text-align: left; }
}

/* AI 配置：三个可命名的本地自定义配置槽位 */
.custom-ai-profiles {
  display: grid;
  gap: 14px;
}
.custom-ai-profiles__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.custom-ai-profiles__head > span:first-child {
  display: grid;
  gap: 4px;
}
.custom-ai-profiles__head strong { color: var(--ink); }
.custom-ai-profiles__head small { color: var(--ink-faint); line-height: 1.55; }
.custom-ai-profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.custom-ai-profile {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(var(--c-blue-rgb),.055), transparent 56%),
    var(--glass);
}
.custom-ai-profile.is-saved {
  border-color: rgba(var(--c-blue-rgb),.34);
  box-shadow: inset 0 1px rgba(255,255,255,.045);
}
.custom-ai-profile__top,
.custom-ai-profile__actions {
  display: flex;
  align-items: center;
  gap: 7px;
}
.custom-ai-profile__top { justify-content: space-between; }
.custom-ai-profile__slot {
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.custom-ai-profile .app-field { margin: 0; }
.custom-ai-profile .app-field > span {
  color: var(--ink-dim);
  font-size: 11px;
  font-weight: 650;
}
.custom-ai-profile__summary {
  min-height: 42px;
  display: grid;
  gap: 4px;
  min-width: 0;
}
.custom-ai-profile__summary strong,
.custom-ai-profile__summary small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.custom-ai-profile__summary strong { color: var(--ink); font-size: 13px; }
.custom-ai-profile__summary small { color: var(--ink-faint); font-size: 11px; }
.custom-ai-profile__actions { margin-top: auto; flex-wrap: wrap; }
.custom-ai-profile__actions .btn.danger { margin-left: auto; }

@container (max-width: 840px) {
  .custom-ai-profile-grid { grid-template-columns: 1fr; }
  .custom-ai-profile { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
  .custom-ai-profile__top,
  .custom-ai-profile .app-field { grid-column: 1 / -1; }
  .custom-ai-profile__summary { align-self: center; }
}
@container (max-width: 520px) {
  .custom-ai-profile { display: grid; grid-template-columns: minmax(0, 1fr); }
  .custom-ai-profile__summary,
  .custom-ai-profile__actions { grid-column: 1; }
  .custom-ai-profile__actions .btn { flex: 1 1 auto; }
  .custom-ai-profile__actions .btn.danger { flex: 0 0 auto; margin-left: 0; }
}

/* ============================================================
   4.0 · AI 知识库设置、管理器与扫描 PDF OCR
   ============================================================ */
.app-chat { position: relative; }
.kb-settings-panel {
  position: absolute;
  z-index: 24;
  top: 54px;
  right: 12px;
  left: 12px;
  max-width: 920px;
  margin-left: auto;
  overflow: hidden;
  border: 1px solid var(--app-line, var(--glass-border));
  border-radius: 18px;
  background: color-mix(in srgb, var(--glass-strong) 96%, transparent);
  box-shadow: 0 24px 68px rgba(0,0,0,.46), 0 0 0 1px rgba(var(--c-blue-rgb),.12);
  backdrop-filter: blur(28px) saturate(1.25);
}
.kb-settings-panel[hidden] { display: none; }
.kb-settings-head,
.kb-settings-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--app-line, var(--glass-border));
}
.kb-settings-head > div { display: grid; gap: 3px; }
.kb-settings-head strong { color: var(--ink); font-size: 16px; }
.kb-settings-head small,
.kb-settings-foot { color: var(--ink-muted); font-size: 11px; }
.kb-settings-foot { border-top: 1px solid var(--app-line, var(--glass-border)); border-bottom: 0; }
.kb-settings-foot > span { display: inline-flex; align-items: center; gap: 7px; line-height: 1.55; }
.kb-settings-foot .tz-icon { width: 16px; height: 16px; flex: 0 0 auto; }
.kb-table-wrap { overflow-x: auto; padding: 12px; }
.kb-mode-table { width: 100%; min-width: 660px; border-collapse: separate; border-spacing: 8px; table-layout: fixed; }
.kb-mode-table th { padding: 4px 7px 7px; color: var(--ink-dim); font-size: 12px; text-align: center; }
.kb-mode-table th .tz-icon { width: 18px; height: 18px; }
.kb-mode-table td { padding: 0; vertical-align: stretch; }
.kb-mode-cell {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0,1fr);
  grid-template-rows: auto auto;
  align-items: center;
  gap: 2px 8px;
  min-height: 62px;
  padding: 9px 10px;
  border: 1px solid var(--app-line, var(--glass-border));
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color .16s, background .16s, transform .16s;
}
.kb-mode-cell:hover { transform: translateY(-1px); border-color: rgba(var(--c-blue-rgb),.54); }
.kb-mode-cell.active { border-color: var(--c-blue); background: rgba(var(--c-blue-rgb),.12); box-shadow: inset 0 0 0 1px rgba(var(--c-blue-rgb),.16); }
.kb-mode-cell input { position: absolute; opacity: 0; pointer-events: none; }
.kb-mode-check {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(var(--c-blue-rgb),.55);
  border-radius: 7px;
  color: #fff;
  background: rgba(var(--c-blue-rgb),.06);
  font-weight: 800;
}
.kb-mode-cell.active .kb-mode-check { background: var(--grad-main); border-color: transparent; }
.kb-mode-cell strong { color: var(--ink); font-size: 12px; }
.kb-mode-cell small { color: var(--ink-muted); font-size: 9px; line-height: 1.35; }

.kb-manager-app { min-height: 0; }
.kb-manager-main { display: flex; flex-direction: column; min-height: 0; padding: 0; }
.kb-manager-toolbar { flex: 0 0 auto; }
.kb-search-wrap { display: flex; align-items: center; gap: 8px; width: min(420px, 55%); }
.kb-search-wrap .tz-icon { width: 18px; height: 18px; color: var(--c-blue); }
.kb-search-wrap .input { width: 100%; }
.kb-source-strip { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--app-line, var(--glass-border)); }
.kb-source-chip { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 9px 10px; border: 1px solid var(--app-line, var(--glass-border)); border-radius: 12px; color: var(--ink-dim); background: var(--surface); text-align: left; }
.kb-source-chip.active { color: var(--ink); border-color: var(--c-blue); background: rgba(var(--c-blue-rgb),.12); }
.kb-source-chip.is-off { opacity: .58; }
.kb-source-chip > .tz-icon { width: 21px; height: 21px; flex: 0 0 auto; }
.kb-source-chip > span { display: grid; min-width: 0; }
.kb-source-chip strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.kb-source-chip small { overflow: hidden; color: var(--ink-muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.kb-manager-layout { display: grid; grid-template-columns: minmax(260px, .85fr) minmax(0, 1.15fr); flex: 1; min-height: 0; }
.kb-entry-list { min-height: 0; overflow: auto; padding: 10px; border-right: 1px solid var(--app-line, var(--glass-border)); }
.kb-entry { display: grid; grid-template-columns: 35px minmax(0,1fr); gap: 10px; width: 100%; padding: 11px; border: 1px solid transparent; border-radius: 12px; color: inherit; text-align: left; }
.kb-entry:hover { background: var(--hover); }
.kb-entry.active { border-color: rgba(var(--c-blue-rgb),.55); background: rgba(var(--c-blue-rgb),.10); }
.kb-entry-icon { display: grid; place-items: center; width: 35px; height: 35px; border: 1px solid var(--app-line, var(--glass-border)); border-radius: 10px; background: var(--surface-2); }
.kb-entry-icon .tz-icon { width: 20px; height: 20px; }
.kb-entry-copy { display: grid; min-width: 0; gap: 3px; }
.kb-entry-copy strong,
.kb-entry-copy small,
.kb-entry-copy > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-entry-copy strong { color: var(--ink); font-size: 12px; }
.kb-entry-copy small { color: var(--c-blue); font-size: 9px; }
.kb-entry-copy > span { color: var(--ink-muted); font-size: 10px; }
.kb-entry-detail { min-height: 0; overflow: auto; padding: 18px; }
.kb-detail-head { display: flex; flex-wrap: wrap; gap: 7px; }
.kb-detail-head h3,
.kb-detail-head p,
.kb-detail-meta { flex-basis: 100%; }
.kb-detail-head h3 { margin: 9px 0 0; color: var(--ink); font-size: 21px; }
.kb-detail-head p { margin: 0; color: var(--ink-dim); line-height: 1.6; word-break: break-word; }
.kb-detail-meta { display: flex; flex-wrap: wrap; gap: 10px; color: var(--ink-muted); font-size: 10px; }
.kb-detail-text { margin-top: 15px; padding: 15px; border: 1px solid var(--app-line, var(--glass-border)); border-radius: 13px; color: var(--ink-dim); background: var(--surface); font-size: 11px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.kb-detail-actions { display: flex; justify-content: flex-end; margin-top: 13px; }

.doc-ocr-status { position: sticky; z-index: 4; top: 8px; display: grid; grid-template-columns: 32px minmax(0,1fr) auto; align-items: center; gap: 10px; margin: 8px 12px 12px; padding: 10px 12px; border: 1px solid rgba(var(--c-blue-rgb),.45); border-radius: 12px; color: var(--ink-dim); background: color-mix(in srgb, var(--glass-strong) 94%, transparent); box-shadow: var(--sh-sm); }
.doc-ocr-status > .tz-icon { width: 25px; height: 25px; color: var(--c-blue); }
.doc-ocr-status > span { display: grid; gap: 2px; }
.doc-ocr-status strong { color: var(--ink); font-size: 11px; }
.doc-ocr-status small { color: var(--ink-muted); font-size: 9px; line-height: 1.4; }
.doc-ocr-status b { color: var(--c-blue); font-size: 12px; }
.doc-ocr-status.is-done { border-color: rgba(var(--c-green-rgb),.5); }
.doc-ocr-status.is-done > .tz-icon,
.doc-ocr-status.is-done b { color: var(--c-green); }
.doc-ocr-status.is-warn { border-color: rgba(245,158,11,.55); }
.doc-ocr-status.is-warn b { color: #fbbf24; }

@container (max-width: 760px) {
  .kb-settings-panel { top: 96px; }
  .kb-manager-layout { grid-template-columns: 1fr; }
  .kb-entry-list { max-height: 42%; border-right: 0; border-bottom: 1px solid var(--app-line, var(--glass-border)); }
  .kb-source-strip { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@container (max-width: 520px) {
  .kb-settings-panel { top: 126px; right: 7px; left: 7px; }
  .kb-settings-head, .kb-settings-foot { align-items: flex-start; flex-direction: column; }
  .kb-settings-head > .btn { position: absolute; top: 10px; right: 10px; }
  .kb-search-wrap { width: 100%; }
  .kb-manager-toolbar { align-items: stretch; }
  .kb-manager-toolbar .app-toolbar__spacer { display: none; }
}
body.mobile .desktop-icons { top: 10px; left: 10px; }
body.mobile .home-screen { padding-top: 16px; }
body.mobile .mobile-dock {
  background-image: var(--os-surface-layer);
  background-size: cover;
  border: 1px solid rgba(255,255,255,.15);
}

@media (max-width: 980px) {
  .os-topline { grid-template-columns: auto 1fr; }
  .os-top-status { display: none; }
}
@media (max-width: 720px) {
  .os-command-chip { display: none; }
  .os-topline { right: auto; }
}

/* ============================================================
   天择OS 4.1 · Built-in App Workspace
   14 个内置应用共享同一套信息架构、表面、工具栏与操作层级。
   专用编辑器/对话/终端/iframe 仍保留各自的交互契约。
   ============================================================ */
.app-workspace {
  --app-neutral: rgba(255,255,255,.055);
  --app-neutral-strong: rgba(255,255,255,.085);
  --app-line: rgba(255,255,255,.13);
  --app-line-strong: rgba(var(--c-violet-rgb),.42);
  --app-primary-tint: rgba(var(--c-violet-rgb),.24);
  --app-primary-soft: rgba(var(--c-blue-rgb),.13);
  --app-danger-tint: rgba(127,29,29,.28);
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  color: var(--ink);
  isolation: isolate;
  container-type: inline-size;
  background-color: transparent;
  background-image:
    linear-gradient(rgba(8,15,32,.22), rgba(8,15,32,.22)),
    var(--os-surface);
  background-size: cover;
  background-position: center;
}
body.tzos.light .app-workspace {
  --app-neutral: rgba(15,23,42,.045);
  --app-neutral-strong: rgba(15,23,42,.075);
  --app-line: rgba(15,23,42,.14);
  --app-primary-tint: rgba(var(--c-violet-rgb),.14);
  --app-primary-soft: rgba(var(--c-blue-rgb),.1);
  background-image:
    linear-gradient(rgba(250,252,255,.72), rgba(250,252,255,.72)),
    var(--os-surface);
}
.app-workspace.app-config,
.app-workspace.settings-panel,
.app-workspace.growth-panel,
.app-workspace.about-v4 {
  max-width: none;
  margin: 0;
  padding: 0;
}

.app-workspace__header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
  min-height: 82px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--app-line);
  background-color: transparent;
  background-image:
    linear-gradient(100deg, rgba(var(--c-violet-rgb),.15), rgba(var(--c-blue-rgb),.07) 48%, rgba(6,12,27,.38)),
    var(--os-surface);
  background-size: cover;
  background-position: center 24%;
  box-shadow: inset 0 1px rgba(255,255,255,.08);
}
body.tzos.light .app-workspace__header {
  background-image:
    linear-gradient(100deg, rgba(var(--c-violet-rgb),.11), rgba(255,255,255,.58) 58%, rgba(255,255,255,.7)),
    var(--os-surface);
}
.app-workspace__header.is-compact { min-height: 72px; padding-block: 11px; }
.app-workspace__identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.app-workspace__icon,
.app-section__icon,
.app-card__icon,
.msg-avatar,
.ce-icon,
.app-empty__icon,
.about-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid rgba(var(--c-violet-rgb),.36);
  color: var(--c-violet-soft);
  background-image:
    linear-gradient(rgba(var(--c-violet-rgb),.12), rgba(var(--c-blue-rgb),.06)),
    var(--os-button);
  background-size: 340% 340%;
  background-position: 52% 44%;
  box-shadow: inset 0 1px rgba(255,255,255,.1), 0 8px 24px rgba(0,0,0,.12);
}
.app-workspace__icon { width: 46px; height: 46px; border-radius: 15px; }
.app-workspace__icon .tz-icon { width: 24px; height: 24px; }
.app-workspace__heading { display: flex; flex-direction: column; min-width: 0; }
.app-workspace__eyebrow,
.app-section__kicker {
  color: var(--c-violet-soft);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 1.55px;
  text-transform: uppercase;
}
.app-workspace__title { margin-top: 1px; color: var(--ink); font-size: 17px; font-weight: 600; line-height: 1.3; }
.app-workspace__subtitle {
  max-width: 560px;
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 11.5px;
  line-height: 1.45;
}
.app-workspace__meta,
.app-workspace__actions,
.app-section__actions,
.setting-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}
.app-workspace__meta { margin-left: auto; }
.app-workspace__actions { margin-left: 4px; }

.app-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid var(--app-line);
  border-radius: 999px;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  background-image:
    linear-gradient(rgba(8,15,32,.45), rgba(8,15,32,.45)),
    var(--os-surface);
  background-size: 220% 220%;
}
body.tzos.light .app-badge {
  background-image:
    linear-gradient(rgba(255,255,255,.62), rgba(255,255,255,.62)),
    var(--os-surface);
}
.app-badge.is-live { color: var(--c-green-soft); border-color: rgba(var(--c-green-rgb),.42); }
.app-badge.is-live::before {
  content: "";
  width: 5px;
  height: 5px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--c-green-soft);
  box-shadow: 0 0 9px rgba(var(--c-green-rgb),.75);
}
.app-badge.is-warn { color: #fbbf24; border-color: rgba(251,191,36,.42); }

.app-workspace__layout {
  display: grid;
  grid-template-columns: minmax(156px, 190px) minmax(0, 1fr);
  flex: 1;
  min-height: 0;
}
.app-workspace__rail {
  min-width: 0;
  min-height: 0;
  padding: 14px 10px;
  overflow-y: auto;
  border-right: 1px solid var(--app-line);
  background-image:
    linear-gradient(rgba(8,15,32,.48), rgba(8,15,32,.48)),
    var(--os-surface);
  background-size: cover;
  background-position: left center;
}
body.tzos.light .app-workspace__rail {
  background-image:
    linear-gradient(rgba(255,255,255,.7), rgba(255,255,255,.7)),
    var(--os-surface);
}
.app-workspace__main {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
}
.app-workspace__main--scroll {
  padding: 16px;
  overflow-y: auto;
  scroll-behavior: smooth;
  scroll-padding-top: 14px;
}
.app-workspace__stage { position: relative; flex: 1; min-width: 0; min-height: 0; }
.app-workspace__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-muted);
  font-size: 10.5px;
  padding: 2px 2px 10px;
}

.app-nav { display: flex; flex-direction: column; gap: 5px; }
.app-nav__item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid transparent !important;
  border-radius: 10px;
  color: var(--ink-faint) !important;
  font-size: 11.5px;
  text-align: left;
  text-decoration: none;
  background: none !important;
  cursor: pointer;
}
.app-nav__item .tz-icon { width: 16px; height: 16px; }
.app-nav__item:hover,
.app-nav__item.active {
  color: var(--ink) !important;
  border-color: var(--app-line-strong) !important;
  background-image:
    linear-gradient(var(--app-primary-tint), var(--app-primary-tint)),
    var(--os-button) !important;
  background-size: 300% 300% !important;
  background-position: 54% 45% !important;
}
.app-nav__item.is-danger { color: #fca5a5 !important; }

.app-section {
  min-width: 0;
  margin: 0 0 14px;
  scroll-margin-top: 14px;
  border: 1px solid var(--app-line);
  border-radius: 16px;
  overflow: hidden;
  background-image:
    linear-gradient(rgba(8,15,32,.26), rgba(8,15,32,.26)),
    var(--os-surface);
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 1px rgba(255,255,255,.055), 0 12px 35px rgba(0,0,0,.08);
}
body.tzos.light .app-section {
  background-image:
    linear-gradient(rgba(255,255,255,.69), rgba(255,255,255,.69)),
    var(--os-surface);
}
.app-section__header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--app-line);
  background: var(--app-neutral);
}
.app-section__icon { width: 34px; height: 34px; border-radius: 11px; }
.app-section__icon .tz-icon { width: 17px; height: 17px; }
.app-section__heading { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.app-section__heading strong { color: var(--ink); font-size: 13.5px; line-height: 1.35; }
.app-section__heading small { margin-top: 2px; color: var(--ink-faint); font-size: 10.5px; line-height: 1.4; }
.app-section__body { min-width: 0; padding: 13px; }
.app-section--danger { border-color: rgba(248,113,113,.34); }

.app-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--app-line);
  border-radius: 12px;
  color: var(--ink-dim);
  background-image:
    linear-gradient(rgba(8,15,32,.34), rgba(8,15,32,.34)),
    var(--os-surface);
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 1px rgba(255,255,255,.045);
}
body.tzos.light .app-card {
  background-image:
    linear-gradient(rgba(255,255,255,.74), rgba(255,255,255,.74)),
    var(--os-surface);
}
.app-card--horizontal {
  display: flex;
  align-items: center;
  gap: 12px;
}
.app-card--horizontal > span:nth-child(2) {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}
.app-card--horizontal strong { color: var(--ink); font-size: 13px; }
.app-card--horizontal small { margin-top: 2px; color: var(--ink-faint); font-size: 11px; line-height: 1.45; }
.app-card__icon { width: 38px; height: 38px; border-radius: 12px; }
.app-card__icon .tz-icon { width: 19px; height: 19px; }
.app-card--danger {
  border-color: rgba(248,113,113,.34);
  background-image:
    linear-gradient(var(--app-danger-tint), var(--app-danger-tint)),
    var(--os-surface);
}
.app-list { display: flex; flex-direction: column; gap: 8px; }

.app-toolbar {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  min-width: 0;
  padding: 8px 10px;
  border-color: var(--app-line);
  background-image:
    linear-gradient(rgba(8,15,32,.42), rgba(8,15,32,.42)),
    var(--os-surface);
  background-size: cover;
  background-position: center;
}
body.tzos.light .app-toolbar {
  background-image:
    linear-gradient(rgba(255,255,255,.72), rgba(255,255,255,.72)),
    var(--os-surface);
}
.app-toolbar--wrap { flex-wrap: wrap; }
.app-toolbar__label { color: var(--ink-dim); font-size: 11px; font-weight: 650; white-space: nowrap; }
.app-toolbar__hint { color: var(--ink-muted); font-size: 10px; line-height: 1.35; }
.app-toolbar__spacer { flex: 1; }

.app-empty {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  padding: 28px;
  text-align: center;
  color: var(--ink-faint);
}
.app-empty__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 66px;
  height: 66px;
  margin-bottom: 10px;
  border: 1px solid rgba(var(--c-violet-rgb),.38);
  border-radius: 21px;
  color: var(--c-violet-soft);
  background-image:
    linear-gradient(var(--app-primary-tint), var(--app-primary-tint)),
    var(--os-button);
  background-size: 300% 300%;
  background-position: center;
}
.app-empty__icon .tz-icon { width: 34px; height: 34px; }
.app-empty > strong { color: var(--ink); font-size: 15px; font-weight: 600; }
.app-empty > p { max-width: 430px; margin-top: 5px; color: var(--ink-faint); font-size: 11.5px; line-height: 1.6; }
.app-empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-top: 12px; }
.app-empty__meta { max-width: 440px; margin-top: 11px; color: var(--ink-muted); font-size: 10px; line-height: 1.5; }

/* 操作层级：neutral / primary / ghost / danger。按钮仍使用三配色图片材质。 */
.app-workspace .btn,
.app-workspace button:not(.wctrl) {
  box-shadow: inset 0 1px rgba(255,255,255,.075);
}
.app-workspace .btn.primary {
  color: var(--ink) !important;
  border-color: rgba(var(--c-violet-rgb),.58) !important;
  background-image:
    linear-gradient(var(--app-primary-tint), var(--app-primary-tint)),
    var(--os-button) !important;
  background-size: 280% 280% !important;
  background-position: 58% 44% !important;
  box-shadow: inset 0 1px rgba(255,255,255,.12), 0 7px 20px rgba(var(--c-violet-rgb),.14);
}
.app-workspace .btn.ghost {
  color: var(--ink-faint) !important;
  border-color: var(--app-line) !important;
  background-image:
    linear-gradient(rgba(8,15,32,.5), rgba(8,15,32,.5)),
    var(--os-surface) !important;
  background-size: 240% 240% !important;
}
body.tzos.light .app-workspace .btn.ghost {
  background-image:
    linear-gradient(rgba(255,255,255,.72), rgba(255,255,255,.72)),
    var(--os-surface) !important;
}
.app-workspace .btn.danger {
  color: #fecaca !important;
  border-color: rgba(248,113,113,.52) !important;
  background-image:
    linear-gradient(rgba(112,8,18,.5), rgba(112,8,18,.5)),
    var(--os-button) !important;
  background-size: 280% 280% !important;
}
.app-workspace .btn:hover { border-color: rgba(var(--c-violet-rgb),.65) !important; color: var(--ink) !important; }

/* AI 配置与系统设置 */
.cfg-main,
.settings-main { max-width: 900px; width: 100%; justify-self: center; }
.app-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.app-form-grid .field,
.app-field { min-width: 0; margin: 0; }
.app-field--wide { grid-column: 1 / -1; }
.app-field--compact { max-width: 420px; margin-top: 12px; }
.field-label-actions { display: flex !important; align-items: center; justify-content: space-between; gap: 8px; }
.config-presets { margin: 0 0 12px; }
.app-security-note {
  display: flex;
  margin-top: 12px;
  padding: 9px 11px;
  border: 1px solid rgba(var(--c-green-rgb),.27);
  border-radius: 10px;
  color: var(--ink-faint);
  font-size: 10.5px;
  line-height: 1.45;
  background: rgba(var(--c-green-rgb),.055);
}
.app-setting-list { display: flex; flex-direction: column; gap: 7px; }
.app-workspace .setting-row {
  gap: 18px;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid var(--app-line);
  border-radius: 11px;
  background: var(--app-neutral);
}
.app-workspace .setting-row:hover { background: var(--app-neutral-strong); }
.app-workspace .setting-row .sr-label { color: var(--ink); font-size: 12.5px; }
.app-workspace .setting-row .sr-desc { max-width: 620px; font-size: 10.5px; line-height: 1.45; }
.app-workspace .setting-row.is-highlight {
  border-color: rgba(var(--c-green-rgb),.42);
  background: rgba(var(--c-green-rgb),.07);
}
.price-toolbar { margin-bottom: 10px; border: 1px solid var(--app-line); border-radius: 10px; }
.price-grid.app-form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.memory-list { margin-top: 10px; }
.memory-list .app-empty { min-height: 140px; padding: 18px; }
.memory-list .app-empty__icon { width: 48px; height: 48px; border-radius: 15px; }
.memory-list .app-empty__icon .tz-icon { width: 24px; height: 24px; }
.mem-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; padding: 8px 9px; }
.mem-row .mem-en { flex: 0 0 auto; accent-color: var(--c-blue); }
.mem-row .mem-text { flex: 1; min-width: 0; color: var(--ink-dim); font-size: 12px; line-height: 1.5; word-break: break-word; }
.mem-row .btn { padding: 4px 7px; }
.memory-create { margin-top: 9px; border: 1px solid var(--app-line); border-radius: 10px; }
.memory-create .input { flex: 1; min-width: 120px; }
.memory-actions { padding-inline: 0; background: none; }
.memory-actions small { color: var(--ink-muted); font-size: 10px; }
.setting-danger { justify-content: space-between; }

/* 软件工坊与软件库 */
.store-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, .92fr);
  align-items: start;
  gap: 14px;
}
.app-store .store-header { display: none; }
.store-composer { padding: 0; overflow: hidden; }
.store-prompt {
  min-height: 92px;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-image: none !important;
}
.app-store .store-form { padding: 8px 10px; border-top: 1px solid var(--app-line); }
.app-store .store-step { margin-top: 10px; padding: 12px; }
.store-step-label { margin: 8px 0; }
.store-step-label:first-child { margin-top: 0; }
.store-step-label .step-dot {
  background: transparent;
  background-image:
    linear-gradient(var(--app-primary-tint), var(--app-primary-tint)),
    var(--os-button);
  background-size: 260% 260%;
  border: 1px solid rgba(var(--c-violet-rgb),.38);
}
.store-reason-body,
.store-code-progress {
  max-height: 160px;
  overflow-y: auto;
  padding: 9px;
  border: 1px solid var(--app-line);
  border-radius: 9px;
  color: var(--ink-faint);
  font: 11px/1.55 ui-monospace, Consolas, monospace;
  white-space: pre-wrap;
}
.store-installed { padding: 0; overflow: visible; }
.store-installed-item {
  flex-wrap: wrap;
  background-image:
    linear-gradient(rgba(8,15,32,.34), rgba(8,15,32,.34)),
    var(--os-surface) !important;
}
body.tzos.light .store-installed-item {
  background-image:
    linear-gradient(rgba(255,255,255,.74), rgba(255,255,255,.74)),
    var(--os-surface) !important;
}
.store-installed-item:hover { transform: translateY(-1px); }
.store-installed-item .sii-info { min-width: 150px; }
.file-manager-main { max-width: 900px; width: 100%; align-self: center; }

/* 成长与外观 */
.growth-main { max-width: 900px; width: 100%; align-self: center; }
.growth-overview { border: 0; background: none; box-shadow: none; }
.growth-overview .app-section__body { padding: 0; }
.growth-hero {
  margin: 0;
  background-image:
    linear-gradient(rgba(var(--c-violet-rgb),.13), rgba(var(--c-blue-rgb),.06)),
    var(--os-surface) !important;
}
.gh-lv {
  color: var(--ink);
  background: transparent;
  background-image:
    linear-gradient(var(--app-primary-tint), var(--app-primary-tint)),
    var(--os-button);
  background-size: 260% 260%;
  border: 1px solid rgba(var(--c-violet-rgb),.45);
}
.rpg-bar { background: var(--app-neutral); }
.rpg-bar i {
  background: transparent;
  background-image:
    linear-gradient(rgba(var(--c-green-rgb),.3), rgba(var(--c-violet-rgb),.23)),
    var(--os-button);
  background-size: 260% 260%;
}
.growth-titles { margin: 10px 0 0; }
.growth-title.got {
  color: var(--ink);
  border-color: rgba(var(--c-violet-rgb),.35);
  background: transparent;
  background-image:
    linear-gradient(var(--app-primary-tint), var(--app-primary-tint)),
    var(--os-button);
  background-size: 240% 240%;
}
.growth-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.growth-rule { margin: 0; }
.skin-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.skin-opt { min-width: 0; align-items: flex-start; padding: 13px; }

/* 关于、技巧与服务地图 */
.about-main { max-width: 880px; width: 100%; align-self: center; }
.about-hero { display: flex; align-items: center; gap: 18px; padding: 18px; }
.about-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 82px;
  height: 82px;
  flex: 0 0 auto;
  border: 1px solid rgba(var(--c-violet-rgb),.45);
  border-radius: 25px;
  background-image:
    linear-gradient(var(--app-primary-tint), var(--app-primary-tint)),
    var(--os-button);
  background-size: 300% 300%;
  background-position: center;
}
.about-mark .tz-icon { width: 46px; height: 46px; }
.about-copy { display: flex; flex-direction: column; min-width: 0; }
.about-copy > strong { margin-top: 4px; color: var(--ink); font-size: 16px; font-weight: 600; line-height: 1.35; }
.about-copy > small { margin-top: 6px; color: var(--ink-faint); font-size: 11px; line-height: 1.55; }
.about-update { margin-top: 6px; color: var(--c-green-soft); font-size: 10.5px; }
.about-capabilities { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.about-cap { display: flex; align-items: center; gap: 10px; }
.about-cap > .tz-icon { width: 22px; height: 22px; color: var(--c-violet-soft); }
.about-cap > span { display: flex; flex-direction: column; }
.about-cap strong { color: var(--ink); font-size: 12px; }
.about-cap small { margin-top: 2px; color: var(--ink-faint); font-size: 10px; }
.tips-rail { display: flex; flex-direction: column; gap: 12px; }
.app-search {
  display: flex;
  gap: 7px;
  padding: 5px 8px;
  border: 1px solid var(--app-line);
  border-radius: 10px;
  color: var(--ink-faint);
  background: var(--app-neutral);
}
.app-search .input { min-width: 0; height: 30px; padding: 4px; border: 0 !important; background: none !important; background-image: none !important; }
.tips-main,
.tz-tree-main { max-width: 900px; width: 100%; justify-self: center; }
.tip-card header { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.tip-card header strong { color: var(--ink); font-size: 13px; }
.tip-card p { color: var(--ink-dim); font-size: 11.5px; line-height: 1.7; }
.tt-tree .tt-row {
  margin-bottom: 6px;
  padding: 9px 10px;
  border-radius: 11px;
}
.tt-row:hover { transform: translateX(2px); }
.tt-kids { margin-top: 2px; margin-bottom: 5px; }

/* 时间、文档、笔记、终端、浏览器、对话等专用工具 */
.app-workspace.clock-app { padding: 0; gap: 0; }
.clock-tabs {
  margin: 12px 14px 0;
  padding: 4px;
  border: 1px solid var(--app-line);
  border-radius: 12px;
}
.clock-tab { min-height: 36px; border-radius: 9px; }
.clock-tab.active {
  background-image:
    linear-gradient(var(--app-primary-tint), var(--app-primary-tint)),
    var(--os-button) !important;
}
.clock-stage { display: flex; padding: 12px 14px 14px; }
.clock-pane {
  width: 100%;
  min-height: 0;
  border-radius: 15px;
}
.clock-kicker { color: var(--c-violet-soft); font-size: 9px; font-weight: 650; letter-spacing: 1.4px; }
.clock-big {
  color: var(--ink);
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  text-shadow: 0 0 24px rgba(var(--c-violet-rgb),.23);
}
.clock-countdown-controls { flex-wrap: wrap; justify-content: center; }
.clock-countdown-controls .input { width: 170px; }

.app-workspace.doc-app { display: flex; }
.doc-toolbar { border-bottom: 1px solid var(--app-line); }
.doc-toolbar .app-toolbar__hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-open { inset: 0; }
.doc-open-icon { margin-bottom: 4px; opacity: 1; }
.doc-open-icon .tz-icon { width: 34px; height: 34px; }
.doc-open-title { font-size: 16px; }
.doc-open-sub { margin: 5px 0 0; }
.doc-pane {
  background-image:
    linear-gradient(rgba(8,15,32,.25), rgba(8,15,32,.25)),
    var(--os-surface) !important;
}

.app-workspace.notes-app { flex-direction: row; }
.notes-side { padding: 10px; background-image: none; }
.notes-side-head { display: flex; flex-direction: column; gap: 2px; padding: 5px 3px 8px; }
.notes-side-head strong { color: var(--ink); font-size: 12px; }
.notes-side-head small { color: var(--ink-muted); font-size: 9px; letter-spacing: .5px; }
.notes-toolbar { border-bottom: 1px solid var(--app-line); }
.notes-modes { background-image: var(--os-surface-layer) !important; }
.notes-item { border-color: transparent; }
.notes-item.active {
  border-color: rgba(var(--c-violet-rgb),.36);
  background-image:
    linear-gradient(var(--app-primary-soft), var(--app-primary-soft)),
    var(--os-surface);
  background-size: cover;
}
.notes-body { padding-top: 8px; }

.app-workspace.term-app {
  background-image:
    linear-gradient(rgba(5,11,26,.42), rgba(5,11,26,.42)),
    var(--os-surface);
}
body.tzos.light .app-workspace.term-app {
  background-image:
    linear-gradient(rgba(247,250,255,.78), rgba(247,250,255,.78)),
    var(--os-surface);
}
.term-session-bar { min-height: 36px; padding-block: 5px; border-bottom: 1px solid var(--app-line); }
.term-session-bar .app-badge { min-height: 21px; }
.term-out { color: var(--ink-dim); }
.term-input-row { border-top: 1px solid var(--app-line); }

.app-workspace.app-browser {
  position: absolute;
  inset: 0;
  display: flex;
}
.browser-toolbar { border-bottom: 1px solid var(--app-line); }
.browser-address {
  display: flex;
  flex: 1;
  min-width: 100px;
  gap: 7px;
  padding: 0 9px;
  border: 1px solid var(--app-line);
  border-radius: 10px;
  color: var(--ink-faint);
  background: var(--app-neutral);
}
.browser-address .input { height: 34px; padding: 4px 0; border: 0 !important; background: none !important; background-image: none !important; }
.browser-bookmarks { max-height: 220px; overflow-y: auto; border-bottom: 1px solid var(--app-line); }
.browser-views { background: #fff; }
.browser-empty { position: absolute; inset: 0; min-height: 0; background-image: var(--os-surface-layer); }

.app-workspace.app-chat {
  background-image:
    linear-gradient(rgba(8,15,32,.25), rgba(8,15,32,.25)),
    var(--os-surface);
}
.chat-toolbar { border-bottom: 1px solid var(--app-line); }
.chat-input-bar { border-top: 1px solid var(--app-line); }
.msg.ai .msg-avatar,
.msg.user .msg-avatar {
  background: transparent;
  background-image:
    linear-gradient(var(--app-primary-soft), var(--app-primary-soft)),
    var(--os-button);
  background-size: 260% 260%;
}
.msg.user .msg-bubble {
  color: var(--ink);
  border: 1px solid rgba(var(--c-violet-rgb),.33);
  background: transparent;
  background-image:
    linear-gradient(var(--app-primary-tint), var(--app-primary-tint)),
    var(--os-surface);
  background-size: cover;
}

@container (max-width: 700px) {
  .app-workspace__header { align-items: flex-start; flex-wrap: wrap; min-height: auto; }
  .app-workspace__meta { margin-left: 0; }
  .app-workspace__actions { margin-left: auto; }
  .app-workspace__layout { grid-template-columns: 1fr; }
  .app-workspace__rail {
    display: flex;
    gap: 7px;
    padding: 8px 10px;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--app-line);
  }
  .app-workspace__rail.app-nav,
  .app-workspace__rail .app-nav { flex-direction: row; }
  .app-nav__item { width: auto; flex: 0 0 auto; white-space: nowrap; }
  .tips-rail { display: block; }
  .tips-rail .app-search { margin-bottom: 7px; }
  .tips-rail .app-nav { flex-direction: row; overflow-x: auto; }
  .store-workspace { grid-template-columns: 1fr; }
  .price-grid.app-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .growth-rules { grid-template-columns: 1fr; }
  .skin-pick { grid-template-columns: repeat(3, minmax(120px, 1fr)); overflow-x: auto; }
}
@container (max-width: 500px) {
  .app-workspace__header { padding: 11px 12px; }
  .app-workspace__subtitle,
  .app-workspace__meta { display: none; }
  .app-workspace__main--scroll { padding: 10px; }
  .app-section__body { padding: 10px; }
  .app-form-grid,
  .price-grid.app-form-grid,
  .about-capabilities { grid-template-columns: 1fr; }
  .app-field--wide { grid-column: auto; }
  .app-card--horizontal,
  .setting-row { align-items: flex-start; flex-direction: column; }
  .app-card--horizontal .app-badge { align-self: flex-start; }
  .setting-actions { width: 100%; }
  .store-installed-item .sii-info { flex-basis: calc(100% - 54px); }
  .about-hero { align-items: flex-start; flex-direction: column; }
  .notes-app { flex-direction: column; }
  .notes-side { width: 100%; height: 132px; border-right: 0; border-bottom: 1px solid var(--glass-border); }
  .notes-side-head { display: none; }
  .notes-new { width: auto; align-self: flex-start; }
  .notes-list { flex-direction: row; overflow-x: auto; overflow-y: hidden; }
  .notes-item { min-width: 132px; }
  .browser-toolbar { flex-wrap: wrap; }
  .browser-address { order: 2; flex-basis: 100%; }
  .chat-toolbar { overflow-x: auto; flex-wrap: nowrap; }
  .chat-toolbar > .btn { flex: 0 0 auto; }
}

@media (pointer: coarse), (max-width: 720px) {
  body.mobile .mobile-dock,
  body.mobile .notif-center,
  body.mobile .start-menu { backdrop-filter: none; }
}

body.a11y-large-text { font-size: 112.5%; }
body.a11y-large-text .msg-bubble,
body.a11y-large-text .doc-content,
body.a11y-large-text .notes-editor,
body.a11y-large-text .notes-preview,
body.a11y-large-text input,
body.a11y-large-text textarea,
body.a11y-large-text button { font-size: max(14px, 1em); }
body.a11y-high-contrast {
  --ink: #fff;
  --ink-dim: #f1f5f9;
  --ink-faint: #d8e0ee;
  --ink-muted: #c0cadb;
  --glass-border: rgba(255,255,255,.55);
}
body.tzos.light.a11y-high-contrast {
  --ink: #05070d;
  --ink-dim: #111827;
  --ink-faint: #26344c;
  --ink-muted: #334155;
  --glass-border: rgba(15,23,42,.55);
}
body.a11y-high-contrast :focus-visible { outline: 3px solid #facc15 !important; outline-offset: 2px; }
body.a11y-low-transparency *,
body.a11y-low-transparency *::before,
body.a11y-low-transparency *::after { backdrop-filter: none !important; }
body.a11y-low-transparency .win,
body.a11y-low-transparency .start-menu,
body.a11y-low-transparency .notif-center,
body.a11y-low-transparency .mobile-dock,
body.a11y-low-transparency .tz-dialog { background-color: #101d32 !important; background-image: none !important; }
body.tzos.light.a11y-low-transparency .win,
body.tzos.light.a11y-low-transparency .start-menu,
body.tzos.light.a11y-low-transparency .notif-center,
body.tzos.light.a11y-low-transparency .mobile-dock,
body.tzos.light.a11y-low-transparency .tz-dialog { background-color: #f5f8ff !important; }
body.a11y-reduced-motion *,
body.a11y-reduced-motion *::before,
body.a11y-reduced-motion *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }

/* 必须继续尊重原生 hidden 属性，避免新增 flex/grid 壳覆盖 display:none。 */
.tzos [hidden] { display: none; }

/* ============================================================
   Tianze OS 4.1 · App clarity pass
   Keep the generated palette textures, but give every workspace
   layer an opaque graphite-blue base so wallpaper details cannot
   bleed through controls or compete with application content.
   ============================================================ */
body.tzos:not(.light) .win {
  background-color: #0d1b31 !important;
}
body.tzos:not(.light) .win-title {
  background-color: #10213b !important;
}
body.tzos:not(.light) .win-body {
  background-color: #12243f !important;
}
body.tzos:not(.light) .app-workspace {
  background-color: #142843 !important;
}
body.tzos:not(.light) .app-workspace__header {
  background-color: #19304f !important;
}
body.tzos:not(.light) .app-workspace__rail {
  background-color: #10223b !important;
}
body.tzos:not(.light) .app-workspace__main,
body.tzos:not(.light) .app-workspace__stage {
  background-color: #142843;
}
body.tzos:not(.light) .app-section {
  background-color: #19304d !important;
}
body.tzos:not(.light) .app-section__header,
body.tzos:not(.light) .app-toolbar {
  background-color: #1d3655 !important;
}
body.tzos:not(.light) .app-card,
body.tzos:not(.light) .setting-row,
body.tzos:not(.light) .store-installed-item,
body.tzos:not(.light) .cmd-card {
  background-color: #203a59 !important;
}
body.tzos:not(.light) .app-badge,
body.tzos:not(.light) .input,
body.tzos:not(.light) .textarea,
body.tzos:not(.light) .term-input-row,
body.tzos:not(.light) .chat-input-bar {
  background-color: #142842 !important;
}

/* Icon wells and actionable controls intentionally use different assets. */
.app-workspace__icon,
.app-section__icon,
.app-card__icon,
.msg-avatar,
.ce-icon,
.app-empty__icon,
.about-mark {
  background-color: #11223a !important;
  background-image:
    linear-gradient(rgba(7, 16, 31, .22), rgba(7, 16, 31, .22)),
    var(--os-icon-well) !important;
  background-size: cover !important;
  background-position: center !important;
  border-color: rgba(255,255,255,.16) !important;
}
body.tzos.light .app-workspace__icon,
body.tzos.light .app-section__icon,
body.tzos.light .app-card__icon,
body.tzos.light .msg-avatar,
body.tzos.light .ce-icon,
body.tzos.light .app-empty__icon,
body.tzos.light .about-mark {
  background-color: #e7edf7 !important;
  background-image:
    linear-gradient(rgba(255,255,255,.42), rgba(255,255,255,.42)),
    var(--os-icon-well) !important;
  border-color: rgba(15,23,42,.14) !important;
}

/* ============================================================
   AI model presets and multi-conversation tabs
   The controls reuse the generated surface/button assets so all
   three palettes stay in sync without turning labels into icons.
   ============================================================ */
.config-presets {
  display: block;
  padding: 11px;
  border: 1px solid var(--app-line);
  border-radius: 13px;
  background-color: #172f4d;
  background-image:
    linear-gradient(rgba(8,15,32,.38), rgba(8,15,32,.38)),
    var(--os-surface);
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 1px rgba(255,255,255,.055);
}
body.tzos.light .config-presets {
  background-color: #edf3fb;
  background-image:
    linear-gradient(rgba(255,255,255,.76), rgba(255,255,255,.76)),
    var(--os-surface);
}
.model-presets__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}
.model-presets__head > span:first-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.model-presets__head strong {
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.35;
}
.model-presets__head small {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.45;
}
.model-presets-grid,
.ai-model-presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.model-preset,
.ai-model-preset {
  --preset-accent: var(--c-violet-rgb);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  min-height: 142px;
  padding: 11px 12px 10px;
  overflow: hidden;
  border: 1px solid var(--app-line) !important;
  border-radius: 11px;
  color: var(--ink-dim);
  text-align: left;
  background-color: #1b3654 !important;
  background-image:
    linear-gradient(rgba(8,15,32,.46), rgba(8,15,32,.46)),
    var(--os-button) !important;
  background-size: 280% 280% !important;
  background-position: 42% 48% !important;
  box-shadow:
    inset 0 1px rgba(255,255,255,.07),
    0 5px 14px rgba(0,0,0,.1) !important;
  transition:
    transform .16s var(--ease),
    border-color .16s,
    box-shadow .18s,
    filter .18s;
}
.model-preset:nth-child(3n + 2),
.ai-model-preset:nth-child(3n + 2) { --preset-accent: var(--c-blue-rgb); }
.model-preset:nth-child(3n),
.ai-model-preset:nth-child(3n) { --preset-accent: var(--c-green-rgb); }
body.tzos.light .model-preset,
body.tzos.light .ai-model-preset {
  background-color: #e7eef9 !important;
  background-image:
    linear-gradient(rgba(255,255,255,.6), rgba(255,255,255,.6)),
    var(--os-button) !important;
}
.model-preset:hover,
.ai-model-preset:hover {
  z-index: 1;
  transform: translateY(-2px);
  border-color: rgba(var(--preset-accent),.62) !important;
  filter: brightness(1.06);
  box-shadow:
    inset 0 1px rgba(255,255,255,.11),
    0 9px 22px rgba(var(--preset-accent),.14) !important;
}
.model-preset.active,
.model-preset[aria-pressed="true"],
.ai-model-preset.active,
.ai-model-preset[aria-pressed="true"] {
  border-color: rgba(var(--preset-accent),.82) !important;
  color: var(--ink);
  background-image:
    linear-gradient(rgba(var(--preset-accent),.2), rgba(var(--preset-accent),.2)),
    var(--os-button) !important;
  background-position: 64% 43% !important;
  box-shadow:
    inset 0 0 0 1px rgba(var(--preset-accent),.28),
    inset 0 1px rgba(255,255,255,.13),
    0 8px 22px rgba(var(--preset-accent),.18) !important;
}
.model-preset.active::after,
.model-preset[aria-pressed="true"]::after,
.ai-model-preset.active::after,
.ai-model-preset[aria-pressed="true"]::after {
  content: "已选";
  position: absolute;
  top: 9px;
  right: 9px;
  padding: 2px 6px;
  border: 1px solid rgba(var(--preset-accent),.5);
  border-radius: 999px;
  color: var(--ink);
  background-color: rgba(7,15,30,.64);
  font-size: 8.5px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: .5px;
  pointer-events: none;
}
body.tzos.light .model-preset.active::after,
body.tzos.light .model-preset[aria-pressed="true"]::after,
body.tzos.light .ai-model-preset.active::after,
body.tzos.light .ai-model-preset[aria-pressed="true"]::after {
  background-color: rgba(255,255,255,.76);
}
.model-preset__provider,
.ai-model-preset__provider {
  display: inline-flex;
  align-items: center;
  max-width: calc(100% - 42px);
  min-height: 20px;
  padding: 2px 7px;
  overflow: hidden;
  border: 1px solid rgba(var(--preset-accent),.28);
  border-radius: 999px;
  color: rgba(var(--preset-accent),.96);
  background-color: rgba(8,16,32,.46);
  background-image:
    linear-gradient(rgba(var(--preset-accent),.07), rgba(var(--preset-accent),.07)),
    var(--os-surface);
  background-size: 360% 360%;
  font-size: 8.5px;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: .55px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.tzos.light .model-preset__provider,
body.tzos.light .ai-model-preset__provider {
  background-color: rgba(255,255,255,.68);
}
.model-preset > strong,
.ai-model-preset > strong {
  width: 100%;
  margin-top: 7px;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.model-preset > small,
.ai-model-preset > small {
  display: -webkit-box;
  min-height: 29px;
  margin-top: 2px;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.model-preset__meta,
.ai-model-preset__meta {
  margin-top: auto;
  padding-top: 7px;
  color: var(--ink-muted);
  font: 9px/1.35 "Cascadia Mono", Consolas, monospace;
}
.model-preset__caps,
.ai-model-preset__caps {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.model-preset__caps i,
.ai-model-preset__caps i {
  padding: 2px 5px;
  border: 1px solid var(--app-line);
  border-radius: 999px;
  color: var(--ink-faint);
  background: var(--app-neutral);
  font-size: 8.5px;
  font-style: normal;
  line-height: 1.3;
  white-space: nowrap;
}
.model-preset:focus-visible,
.ai-model-preset:focus-visible,
.chat-tab__main:focus-visible,
.chat-tab__close:focus-visible,
.chat-tab-new:focus-visible {
  outline: 2px solid rgba(var(--c-blue-rgb),.88);
  outline-offset: 2px;
}

.chat-tabbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 0;
  min-height: 48px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--app-line);
  background-color: #18314e;
  background-image:
    linear-gradient(rgba(8,15,32,.42), rgba(8,15,32,.42)),
    var(--os-surface);
  background-size: cover;
  background-position: center 42%;
  box-shadow: inset 0 1px rgba(255,255,255,.055);
}
body.tzos.light .chat-tabbar {
  background-color: #ebf1fa;
  background-image:
    linear-gradient(rgba(255,255,255,.74), rgba(255,255,255,.74)),
    var(--os-surface);
}
.chat-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  padding: 2px 2px 4px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scroll-snap-type: inline proximity;
  scrollbar-color: rgba(var(--c-violet-rgb),.35) transparent;
  scrollbar-width: thin;
}
.chat-tabs::-webkit-scrollbar { height: 4px; }
.chat-tabs::-webkit-scrollbar-track { background: transparent; }
.chat-tabs::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(var(--c-violet-rgb),.34);
}
.chat-tab {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 1 202px;
  min-width: 124px;
  max-width: 224px;
  height: 34px;
  overflow: hidden;
  border: 1px solid var(--app-line);
  border-radius: 10px;
  color: var(--ink-faint);
  background-color: #1a3452;
  background-image:
    linear-gradient(rgba(8,15,32,.48), rgba(8,15,32,.48)),
    var(--os-surface);
  background-size: 250% 250%;
  background-position: center;
  box-shadow: inset 0 1px rgba(255,255,255,.05);
  scroll-snap-align: start;
  transition:
    flex-basis .18s var(--ease),
    border-color .16s,
    box-shadow .18s,
    color .16s,
    transform .16s var(--ease);
}
body.tzos.light .chat-tab {
  background-color: #e6edf8;
  background-image:
    linear-gradient(rgba(255,255,255,.7), rgba(255,255,255,.7)),
    var(--os-surface);
}
.chat-tab:hover,
.chat-tab:focus-within {
  border-color: rgba(var(--c-blue-rgb),.42);
  color: var(--ink-dim);
}
.chat-tab.active {
  flex-basis: 216px;
  transform: translateY(-1px);
  border-color: rgba(var(--c-violet-rgb),.66);
  color: var(--ink);
  background-color: #203a5a;
  background-image:
    linear-gradient(var(--app-primary-tint), var(--app-primary-tint)),
    var(--os-button);
  background-size: 280% 280%;
  background-position: 62% 44%;
  box-shadow:
    inset 0 0 0 1px rgba(var(--c-violet-rgb),.2),
    inset 0 1px rgba(255,255,255,.1),
    0 5px 14px rgba(var(--c-violet-rgb),.13);
}
body.tzos.light .chat-tab.active { background-color: #dfe9f8; }
.chat-tab.active::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 0;
  left: 12px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: rgba(var(--c-violet-rgb),.88);
  box-shadow: 0 -2px 7px rgba(var(--c-violet-rgb),.3);
  pointer-events: none;
}
.chat-tab__main,
.chat-tab__close {
  margin: 0;
  border: 0 !important;
  color: inherit;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}
.chat-tab__main {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  padding: 0 7px 0 9px;
  text-align: left;
}
.chat-tab__main .tz-icon {
  width: 16px;
  height: 16px;
  opacity: .86;
}
.chat-tab.active .chat-tab__main .tz-icon { opacity: 1; }
.chat-tab__main > span:last-child {
  min-width: 0;
  overflow: hidden;
  font-size: 10.5px;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-tab__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  margin-right: 4px;
  padding: 0;
  border-radius: 7px;
  opacity: 0;
  transition: opacity .14s, background-color .14s, transform .14s;
}
.chat-tab__close .tz-icon { width: 11px; height: 11px; }
.chat-tab:hover .chat-tab__close,
.chat-tab.active .chat-tab__close,
.chat-tab:focus-within .chat-tab__close { opacity: .68; }
.chat-tab__close:hover {
  border: 1px solid rgba(248,113,113,.42) !important;
  color: #fecaca;
  opacity: 1 !important;
  background-image:
    linear-gradient(rgba(112,8,18,.48), rgba(112,8,18,.48)),
    var(--os-button) !important;
  background-size: 300% 300% !important;
  background-position: 60% 45% !important;
}
.chat-tab__close:active { transform: scale(.9); }
.chat-tab-new {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 0 auto;
  min-width: 72px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(var(--c-blue-rgb),.42) !important;
  border-radius: 10px;
  color: var(--ink-dim);
  background-color: #1b3857 !important;
  background-image:
    linear-gradient(rgba(var(--c-blue-rgb),.12), rgba(var(--c-blue-rgb),.12)),
    var(--os-button) !important;
  background-size: 280% 280% !important;
  background-position: 48% 46% !important;
  box-shadow:
    inset 0 1px rgba(255,255,255,.09),
    0 5px 14px rgba(var(--c-blue-rgb),.1) !important;
  font-size: 10.5px;
  font-weight: 650;
  white-space: nowrap;
  transition: transform .15s var(--ease), border-color .15s, filter .15s;
}
body.tzos.light .chat-tab-new {
  background-color: #e2ebf8 !important;
  background-image:
    linear-gradient(rgba(255,255,255,.46), rgba(255,255,255,.46)),
    var(--os-button) !important;
}
.chat-tab-new:hover {
  transform: translateY(-1px);
  border-color: rgba(var(--c-blue-rgb),.7) !important;
  filter: brightness(1.07);
}
.chat-tab-new:active { transform: translateY(0) scale(.97); }
.chat-tab-new .tz-icon { width: 15px; height: 15px; }

/* 主 OS 的 AI 会话标签直接占用窗口标题栏；独立 float-chat 仍使用内容区标签栏。 */
.chat-win .win-tabs { overflow: hidden; }
.chat-tabs--title {
  height: 100%;
  padding: 0;
  gap: 4px;
  overflow-y: hidden;
  scrollbar-width: none;
}
.chat-tabs--title::-webkit-scrollbar { display: none; }
.chat-win .chat-tab {
  flex-basis: 170px;
  min-width: 104px;
  max-width: 190px;
  height: 28px;
  border-radius: 6px;
}
.chat-win .chat-tab.active { flex-basis: 182px; }
.chat-win .chat-tab__main { padding-left: 7px; }
.chat-win .chat-tab__main .tz-icon { width: 13px; height: 13px; }
.chat-win .chat-tab__close { width: 22px; height: 22px; margin-right: 3px; border-radius: 5px; }
.chat-tab-new--title {
  min-width: 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 6px;
}
.chat-title-static {
  min-width: 0;
  color: var(--ink-dim);
  font-size: 12px;
}

@container (max-width: 700px) {
  .model-preset,
  .ai-model-preset { min-height: 136px; }
  .chat-tab { flex-basis: 178px; max-width: 196px; }
  .chat-tab.active { flex-basis: 190px; }
}
@container (max-width: 500px) {
  .config-presets { padding: 9px; }
  .model-presets__head { align-items: center; }
  .model-presets__head small { display: none; }
  .model-presets-grid,
  .ai-model-presets { grid-template-columns: 1fr; }
  .model-preset,
  .ai-model-preset { min-height: 132px; }
  .chat-tabbar { gap: 6px; min-height: 45px; padding: 6px 8px; }
  .chat-tabs { gap: 5px; }
  .chat-tab,
  .chat-tab.active {
    flex-basis: 154px;
    min-width: 108px;
    max-width: 174px;
  }
  .chat-tab__close { opacity: .64; }
  .chat-tab-new {
    width: 34px;
    min-width: 34px;
    padding: 0;
  }
  .chat-tab-new > span:last-child { display: none; }
}
@media (hover: none) {
  .chat-tab__close { opacity: .68; }
}
@media (prefers-reduced-motion: reduce) {
  .model-preset,
  .ai-model-preset,
  .chat-tab,
  .chat-tab__close,
  .chat-tab-new,
  .chat-tabs {
    scroll-behavior: auto;
    transition: none;
  }
}
@media (forced-colors: active) {
  .config-presets,
  .model-preset,
  .ai-model-preset,
  .chat-tabbar,
  .chat-tab,
  .chat-tab-new,
  .chat-tab__close:hover {
    border-color: ButtonText !important;
    color: ButtonText !important;
    background-color: ButtonFace !important;
    background-image: none !important;
    box-shadow: none !important;
    forced-color-adjust: auto;
  }
  .model-preset.active,
  .model-preset[aria-pressed="true"],
  .ai-model-preset.active,
  .ai-model-preset[aria-pressed="true"],
  .chat-tab.active {
    outline: 2px solid Highlight;
    outline-offset: -2px;
  }
}
