:root {
  --bg-canvas: #F7F8FB;
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-white: #FFFFFF;
  --border: #E9ECF1;
  --border-soft: #E6E9EF;
  --text-primary: #0A0A0A;
  --text-secondary: rgba(0, 0, 0, 0.5);
  --text-placeholder: rgba(0, 0, 0, 0.3);
  --text-black-9: rgba(0, 0, 0, 0.9);
  --green: #088F50;
  --brand: #5C7FFF;
  --shadow-card: 0px 4px 12px 0px rgba(0, 0, 0, 0.04);
  --shadow-float: 0px 8px 32px 0px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0px 12px 40px 0px rgba(0, 0, 0, 0.12);
  --radius-card: 16px;
  --radius-input: 20px;
  --radius-btn: 10px;
}
html, body {
  font-family: "PingFang SC", "Helvetica Neue", Helvetica, "Microsoft YaHei", Arial, sans-serif;
  color: var(--text-primary);
  background: var(--bg-canvas);
  -webkit-font-smoothing: antialiased;
  margin: 0;
  min-height: 100vh;
}
[x-cloak] { display: none !important; }

/* Lucide 图标尺寸 */
.lucide-xs { width: 14px; height: 14px; stroke-width: 1.6; flex-shrink: 0; }
.lucide-sm { width: 16px; height: 16px; stroke-width: 1.6; flex-shrink: 0; }
.lucide-md { width: 18px; height: 18px; stroke-width: 1.6; flex-shrink: 0; }

/* Beta 标签 */
.beta-tag {
  border: 1px solid #D6DBE3;
  border-radius: 4px;
  padding: 0 5px;
  font-size: 10px;
  color: rgba(0,0,0,0.5);
  line-height: 16px;
  height: 16px;
  display: inline-flex; align-items: center;
}

/* 壁纸 */
.wallpaper {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 1200px 800px at 20% 30%, rgba(120, 188, 255, 0.40) 0%, transparent 55%),
    radial-gradient(ellipse 900px 600px at 80% 20%, rgba(92, 127, 255, 0.36) 0%, transparent 50%),
    radial-gradient(ellipse 1100px 700px at 70% 80%, rgba(155, 198, 240, 0.42) 0%, transparent 55%),
    radial-gradient(ellipse 600px 500px at 30% 85%, rgba(255, 225, 254, 0.5) 0%, transparent 55%),
    linear-gradient(135deg, #DCE8FF 0%, #E4F0FF 50%, #EEE8FF 100%);
  filter: saturate(1.1);
  transition: opacity 380ms ease;
}
.wallpaper::after {
  content: ""; position: absolute; inset: 0;
  backdrop-filter: blur(120px);
  -webkit-backdrop-filter: blur(120px);
}
.mode-f .wallpaper { opacity: 0; }

/* 主容器 */
.stage {
  position: relative;
  z-index: 1;
  transition: width 420ms cubic-bezier(0.4, 0, 0.2, 1),
              height 420ms cubic-bezier(0.4, 0, 0.2, 1),
              max-width 420ms cubic-bezier(0.4, 0, 0.2, 1),
              border-radius 420ms cubic-bezier(0.4, 0, 0.2, 1),
              background 380ms ease;
}
.mode-w .stage,
.mode-wp .stage {
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-float);
  background: var(--bg-card);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  overflow: hidden;
  max-width: calc(100vw - 40px); max-height: calc(100vh - 40px);
}
.mode-w .stage { width: 1080px; height: 768px; }
.mode-wp .stage { width: 1440px; height: 820px; }
.mode-f .stage {
  width: 100vw; height: 100vh;
  max-width: 100vw; max-height: 100vh;
  border-radius: 0;
  box-shadow: none;
  background: var(--bg-white);
  overflow: hidden;
}
.page-root {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.mode-f .page-root { padding: 0; }
.stage-inner {
  width: 100%; height: 100%;
  display: flex;
  min-height: 0;
  position: relative;
}

/* Sider */
.sider {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  transition: width 320ms cubic-bezier(0.4, 0, 0.2, 1);
}
.mode-f .sider { width: 256px; }
.sider-header {
  height: 64px;
  padding: 20px 24px;
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.sider-group-title {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 8px 12px;
}
.sider-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  margin: 2px 0;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
  transition: background 150ms ease;
}
.sider-item:hover { background: rgba(0, 0, 0, 0.04); }
.sider-item.active { background: rgba(0, 0, 0, 0.06); }
.sider-dot { width: 8px; height: 8px; border-radius: 50%; margin-left: auto; }
.sider-dot.green { background: var(--green); }
.sider-dot.gray { background: #CBD1DC; }
.sider-footer { margin-top: auto; padding: 12px; border-top: 1px solid var(--border-soft); }
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: #5C7FFF; color: white;
  display: flex; align-items: center; justify-content: center;
  font-family: 'SF Mono', monospace; font-size: 13px; font-weight: 500;
  flex-shrink: 0;
}

/* 对话区 */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  transition: flex 320ms cubic-bezier(0.4, 0, 0.2, 1);
}
.chat-topbar {
  height: 56px;
  display: flex; align-items: center;
  padding: 0 16px 0 20px;
  flex-shrink: 0;
  gap: 8px;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0 32px 16px;
  scroll-behavior: smooth;
}
.messages-inner {
  display: flex; flex-direction: column; gap: 16px;
  max-width: 760px; margin: 0 auto; padding-top: 12px;
}
.chat-composer { padding: 4px 20px 18px; flex-shrink: 0; }
.composer-container { max-width: 760px; margin: 0 auto; }

.bubble-user {
  background: var(--border);
  border-radius: 8px 8px 0px 8px;
  padding: 10px 20px;
  font-size: 14px;
  max-width: 560px;
  align-self: flex-end;
  color: var(--text-primary);
  line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
}
.bubble-ai {
  max-width: 720px;
  font-size: 14px;
  line-height: 26px;
  color: var(--text-primary);
  align-self: flex-start;
  white-space: pre-wrap; word-break: break-word;
}

/* ========== 思考卡（ArkClaw 风格）========== */
.thought-card-ak {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  padding: 10px 14px;
  max-width: 720px;
  width: 100%;
  font-size: 13px;
  transition: background 200ms ease, padding 220ms ease;
}
.thought-card-ak:hover { background: #FAFBFC; }
.thought-card-ak.is-collapsed { padding: 8px 14px; background: white; }

.thought-head-ak {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer;
  user-select: none;
  color: var(--text-black-9);
  font-size: 13px;
  line-height: 22px;
}
.thought-title {
  color: rgba(0, 0, 0, 0.6);
  font-weight: 400;
}
.thought-check { color: rgba(0, 0, 0, 0.55); }
.thought-spin {
  color: #5C7FFF;
  animation: spin 1.4s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.thought-toggle-btn {
  margin-left: auto;
  width: 22px; height: 22px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: white;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: rgba(0, 0, 0, 0.5);
  transition: all 160ms ease;
  padding: 0;
}
.thought-toggle-btn:hover {
  color: var(--text-primary);
  border-color: #C7D2FE;
}

.thought-body-ak {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  display: flex; flex-direction: column;
  gap: 4px;
}

/* 步骤行 */
.ak-step {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 0;
  position: relative;
}
.ak-step-rail {
  flex-shrink: 0;
  width: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 7px;
  align-self: stretch;
}
.ak-step-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}
.ak-step-line {
  width: 1px;
  flex: 1;
  background: rgba(0, 0, 0, 0.1);
  margin-top: 4px;
  min-height: 12px;
}

.ak-step-icon {
  flex-shrink: 0;
  margin-top: 3px;
}
.ak-icon-tool { color: rgba(0, 0, 0, 0.5); }
.ak-icon-observe { color: #10B981; }

.ak-step-text {
  flex: 1;
  font-size: 13px;
  line-height: 22px;
  color: rgba(0, 0, 0, 0.75);
  min-width: 0;
  word-break: break-word;
}
.ak-step-label {
  color: rgba(0, 0, 0, 0.75);
  margin-right: 4px;
}
.ak-step-code {
  font-family: "SF Mono", "Menlo", monospace;
  font-size: 12.5px;
  color: rgba(0, 0, 0, 0.7);
  word-break: break-all;
  background: transparent;
  padding: 0;
}
.ak-step-observe {
  color: rgba(0, 0, 0, 0.7);
  font-size: 13px;
  line-height: 22px;
}


/* 预览卡片 */
.computer-preview-card {
  display: flex; align-items: center; gap: 12px;
  padding: 10px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 220ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
.computer-preview-card:hover {
  border-color: #C7D2FE;
  background: #FAFBFF;
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}
.computer-preview-card.active {
  border-color: #A5B4FC;
  background: linear-gradient(135deg, rgba(92, 127, 255, 0.04), rgba(168, 85, 247, 0.04));
}
.preview-hint-tag {
  position: absolute;
  top: -10px; left: 10px;
  background: #1A1A1A;
  color: white;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  display: flex; align-items: center; gap: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 2;
}
.preview-hint-tag .lucide-xs { width: 10px; height: 10px; color: white; }
.mini-computer {
  width: 88px; height: 64px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #2A2D35, #1F2128);
  border-radius: 8px;
  padding: 4px;
  position: relative;
  overflow: hidden;
}
.mini-chrome { height: 8px; background: #3A3D45; border-radius: 3px 3px 0 0; display: flex; align-items: center; padding: 0 3px; gap: 2px; }
.mini-traffic { display: flex; gap: 1.5px; }
.mini-traffic span { width: 2.5px; height: 2.5px; border-radius: 50%; }
.mini-url { flex: 1; height: 4px; background: #2A2D35; border-radius: 2px; margin-left: 3px; position: relative; overflow: hidden; }
.mini-url::after { content: ""; position: absolute; left: 0; top: 0; height: 100%; width: 40%; background: linear-gradient(90deg, transparent, #5C7FFF, transparent); animation: miniScan 2.4s infinite ease-in-out; }
@keyframes miniScan { 0% { left: -40%; } 100% { left: 100%; } }
.mini-body { height: calc(100% - 10px); background: linear-gradient(180deg, #FFFFFF 0%, #F0F4FC 100%); border-radius: 0 0 4px 4px; position: relative; margin-top: 2px; overflow: hidden; }
.mini-content-bars { padding: 4px; }
.mini-content-bars > div { height: 2.5px; background: #D0D8E8; border-radius: 1px; margin-bottom: 2.5px; }
.mini-content-bars > div:nth-child(1) { width: 70%; background: #FF8A3A; height: 3px; }
.mini-content-bars > div:nth-child(2) { width: 90%; }
.mini-content-bars > div:nth-child(3) { width: 60%; }
.mini-content-bars > div:nth-child(4) { width: 80%; }
.mini-cursor { position: absolute; width: 7px; height: 7px; z-index: 5; animation: miniCursor 4s infinite cubic-bezier(0.4, 0, 0.2, 1); filter: drop-shadow(0 1px 1px rgba(0,0,0,0.4)); }
@keyframes miniCursor {
  0% { left: 20%; top: 40%; }
  25% { left: 55%; top: 30%; }
  40% { left: 60%; top: 32%; transform: scale(0.85); }
  50% { left: 60%; top: 32%; transform: scale(1); }
  75% { left: 35%; top: 60%; }
  100% { left: 20%; top: 40%; }
}
.mini-click-ring { position: absolute; width: 10px; height: 10px; border: 1px solid #5C7FFF; border-radius: 50%; z-index: 4; left: 60%; top: 32%; transform: translate(-50%, -50%); animation: miniClick 4s infinite; opacity: 0; }
@keyframes miniClick {
  40% { opacity: 0; width: 4px; height: 4px; }
  50% { opacity: 1; width: 14px; height: 14px; }
  60% { opacity: 0; width: 20px; height: 20px; }
  100% { opacity: 0; }
}
.preview-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.preview-title { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-primary); font-weight: 500; }
.preview-title .status-dot { width: 6px; height: 6px; border-radius: 50%; background: #22C55E; animation: pulse 1.5s infinite; flex-shrink: 0; }
.preview-subline { font-size: 12px; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; }
.preview-chevron { transition: transform 200ms ease; flex-shrink: 0; color: var(--text-secondary); }
.computer-preview-card.active .preview-chevron { transform: rotate(90deg); }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* 接管卡 */
.handover-card {
  max-width: 720px;
  border: 1px solid #FFE2BB;
  background: linear-gradient(180deg, #FFF7EC 0%, #FFFDFA 100%);
  border-radius: 12px;
  padding: 16px;
  font-size: 14px;
  transition: background 260ms ease, border-color 260ms ease;
}
/* 接管中：切换为中性灰色卡 */
.handover-card.is-active {
  border-color: var(--border);
  background: linear-gradient(180deg, #F6F7FA 0%, #FCFCFD 100%);
}
.handover-title { display: flex; align-items: center; gap: 8px; font-weight: 500; color: #7A4F00; margin-bottom: 8px; }
/* 接管中顶部状态胶囊（与 panel status-human 风格呼应但独立于"已接管"文案）*/
.handover-active-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  font-size: 12px; font-weight: 500;
  color: var(--text-black-9);
}
.handover-active-pill .thought-spin { color: #5C7FFF; }
.handover-cta {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 12px;
  padding: 8px 14px;
  border-radius: 8px;
  background: #1A1A1A;
  color: white;
  font-size: 13px;
  cursor: pointer;
  transition: opacity 160ms ease;
}
.handover-cta:hover { opacity: 0.85; }
.handover-cta.secondary { background: white; color: var(--text-primary); border: 1px solid var(--border); }
.handover-cta .lucide-xs { color: white; }
.handover-cta.secondary .lucide-xs { color: var(--text-primary); }
/* 退出接管按钮（接管中态）：黄色，与面板顶栏呼应 */
.handover-cta-exit {
  background: #FFF7EC;
  color: #A35E00;
  border: 1px solid #FFE2BB;
}
.handover-cta-exit:hover { background: #FFEDD1; opacity: 1; }
.handover-cta-exit .lucide-xs { color: #A35E00; }

/* 输入框 */
.composer-shell {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  box-shadow: var(--shadow-card);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.composer-shell:focus-within {
  border-color: transparent;
  background:
    linear-gradient(white, white) padding-box,
    linear-gradient(131deg, #FF9C9C 1%, #B096F1 16%, #A497F2 48%, #9298F5 70%, #5C7FFF 99%) border-box;
  border: 1px solid transparent;
}
.composer-input {
  width: 100%;
  padding: 14px 20px 6px;
  border: none; outline: none;
  background: transparent;
  font-size: 14px; line-height: 24px;
  resize: none;
  color: var(--text-primary);
  font-family: inherit;
}
.composer-input::placeholder { color: var(--text-placeholder); }
.composer-actions { display: flex; align-items: center; justify-content: space-between; padding: 0 16px 12px; }
.composer-inline-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-black-9);
  transition: all 160ms ease;
}
.composer-inline-btn:hover { background: #FAFBFC; border-color: #D6DBE3; }
.send-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: #1A1A1A; color: white;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform 150ms ease;
}
.send-btn:hover { transform: scale(1.05); }
.send-btn.disabled { background: #E5E7EB; cursor: not-allowed; }
.send-btn.disabled:hover { transform: none; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-black-9);
  transition: background 160ms ease;
  border: none; background: transparent;
}
.icon-btn:hover { background: rgba(0, 0, 0, 0.06); }

/* topbar chips */
.role-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-primary);
}
.role-chip:hover { background: rgba(0, 0, 0, 0.07); }
.topbar-computer-btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.04);
  border: none;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-primary);
  transition: all 160ms ease;
}
.topbar-computer-btn:hover { background: rgba(0, 0, 0, 0.07); }
.topbar-computer-btn.active {
  background: #EEF2FF;
  color: #3730A3;
  box-shadow: 0 0 0 1px rgba(92, 127, 255, 0.3);
}
.topbar-computer-btn .pulse-dot-small {
  width: 6px; height: 6px; border-radius: 50%;
  background: #22C55E;
  animation: pulse 1.5s infinite;
}
.new-badge {
  background: #FF4F4F;
  color: white;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  line-height: 1;
  font-weight: 500;
}

/* 电脑面板 */
.computer-panel {
  border-left: 1px solid var(--border-soft);
  background: #FAFBFC;
  display: flex; flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
  transition: width 320ms cubic-bezier(0.4, 0, 0.2, 1), opacity 260ms ease-out;
}
.mode-wp .computer-panel { width: 760px; }
.mode-f .computer-panel { width: 55%; }
.mode-w .computer-panel { width: 0; }
.computer-panel.hidden { width: 0 !important; opacity: 0; border-left: none; }
/* 云电脑区全屏：在 stage 里覆盖 chat 区域 */
.computer-panel.is-maximized {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  width: auto !important;
  z-index: 50;
  border-left: none;
}
.panel-header {
  height: 52px; padding: 0 12px;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--border-soft);
  background: white;
  flex-shrink: 0;
}
.panel-brand { display: inline-flex; align-items: center; gap: 6px; padding-right: 6px; }
.panel-status-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px; font-weight: 500;
}
.status-ai-running { background: rgba(34, 197, 94, 0.08); color: #088F50; }
.status-ai-running .pulse-dot { width: 6px; height: 6px; border-radius: 50%; background: #22C55E; animation: pulse 1.5s infinite; }
.status-human { background: rgba(245, 158, 11, 0.1); color: #A35E00; }
.status-human .pulse-dot { width: 6px; height: 6px; border-radius: 50%; background: #F59E0B; animation: pulse 1.2s infinite; }
.status-done { background: rgba(0, 0, 0, 0.05); color: var(--text-black-9); }
.panel-right-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.exit-handover-btn {
  display: inline-flex; align-items: center; gap: 4px;
  color: #A35E00;
  background: #FFF7EC;
  border: 1px solid #FFE2BB;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all 160ms ease;
}
.exit-handover-btn:hover { background: #FFEDD1; }
.exit-handover-btn .lucide-xs { color: #A35E00; }

.step-strip {
  padding: 10px 16px;
  background: white;
  border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.step-progress-bar {
  flex: 1; height: 4px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  overflow: hidden;
}
.step-progress-bar > div {
  height: 100%;
  background: linear-gradient(90deg, #5C7FFF, #A497F2);
  border-radius: 999px;
  transition: width 500ms ease-out;
}

.vnc-area { flex: 1; background: #2A2D35; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.vnc-mock { width: 100%; height: 100%; background: linear-gradient(135deg, #E8EDF5 0%, #F1F4FB 100%); display: flex; flex-direction: column; position: relative; overflow: hidden; }
.vnc-browser-chrome { height: 44px; background: #FFFFFF; display: flex; align-items: center; padding: 0 12px; gap: 10px; border-bottom: 1px solid #E9ECF1; flex-shrink: 0; }
.vnc-traffic { display: flex; gap: 6px; }
.vnc-traffic span { width: 11px; height: 11px; border-radius: 50%; }
.vnc-url-bar { flex: 1; height: 28px; background: #F3F5FA; border-radius: 6px; padding: 0 12px; display: flex; align-items: center; font-size: 12px; color: #4A4A4A; font-family: "SF Mono", "Menlo", monospace; }
.vnc-body { flex: 1; padding: 16px; background: #F6F8FC; position: relative; overflow: auto; }

/* 无任务时的"空白新标签页"（ArkClaw 用户从顶栏点开云电脑但尚未发任务时展示） */
.vnc-idle-tab {
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 72px 24px 24px;
  gap: 28px;
}
.vnc-idle-logo {
  font-size: 56px;
  font-weight: 400;
  letter-spacing: -1px;
  font-family: "Product Sans", "PingFang SC", system-ui, -apple-system, sans-serif;
  user-select: none;
}
.vnc-idle-search {
  width: 100%;
  max-width: 520px;
  height: 46px;
  border: 1px solid #DFE1E5;
  border-radius: 24px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #FFFFFF;
  box-shadow: 0 1px 6px rgba(32, 33, 36, 0.08);
  transition: box-shadow 180ms ease, border-color 180ms ease;
}
.vnc-idle-search:hover {
  box-shadow: 0 1px 10px rgba(32, 33, 36, 0.18);
  border-color: transparent;
}
.vnc-idle-search-placeholder {
  color: #9AA0A6;
  font-size: 14px;
  flex: 1;
}
.vnc-idle-shortcuts {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px 20px;
  width: 100%;
  max-width: 560px;
}
.vnc-idle-shortcut {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 8px 4px;
  border-radius: 8px;
  transition: background 160ms ease;
}
.vnc-idle-shortcut:hover { background: #F1F3F4; }
.vnc-idle-shortcut-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 500;
}
.vnc-idle-shortcut span {
  font-size: 12px;
  color: #3C4043;
  max-width: 72px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vnc-idle-hint {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 8px 14px;
  background: #F6F8FC;
  border-radius: 16px;
  border: 1px solid #EEF0F5;
}
.vnc-site-header { background: linear-gradient(180deg, #FF6A1A 0%, #FF8A3A 100%); color: white; padding: 14px 20px; border-radius: 8px 8px 0 0; font-weight: 500; font-size: 16px; }
.vnc-site-body { background: white; border-radius: 0 0 8px 8px; padding: 16px; min-height: 240px; }
.vnc-list-row { display: grid; grid-template-columns: 60px 1fr 1fr 60px 60px 80px; padding: 10px 8px; border-bottom: 1px solid #F1F4FB; font-size: 12px; align-items: center; }
.vnc-list-row.head { background: #F8FAFD; color: #6B7280; font-size: 11px; font-weight: 500; border-radius: 6px; }
.vnc-price { color: #FF4D4F; font-weight: 600; }
.vnc-cursor { position: absolute; width: 18px; height: 18px; pointer-events: none; z-index: 10; transition: left 620ms cubic-bezier(0.4, 0, 0.2, 1), top 620ms cubic-bezier(0.4, 0, 0.2, 1); filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3)); }
/* 点击涟漪：与 cursor 同坐标，每次点击触发一次扩散动画 */
.vnc-click-ring {
  position: absolute;
  width: 20px; height: 20px;
  margin-left: -10px; margin-top: -10px;
  border: 2px solid #5C7FFF;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9;
  animation: vncClickRing 560ms ease-out forwards;
}
@keyframes vncClickRing {
  0%   { opacity: 0.0; transform: scale(0.35); }
  30%  { opacity: 0.9; transform: scale(0.8); }
  100% { opacity: 0.0; transform: scale(1.8); }
}
/* 云电脑区域内居中 toast：仅 AI 任务执行中用户点击才出现 */
.vnc-block-toast {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(26, 26, 26, 0.88);
  color: white;
  font-size: 13px;
  line-height: 1.3;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
  z-index: 30;
  white-space: nowrap;
}
.vnc-block-toast .lucide-xs { width: 14px; height: 14px; color: #FFB84D; }
.vnc-login-modal { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: white; border-radius: 10px; padding: 20px 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2); width: 280px; z-index: 9; animation: modalIn 300ms ease-out; }
@keyframes modalIn { from { opacity: 0; transform: translate(-50%, -45%); } to { opacity: 1; transform: translate(-50%, -50%); } }
.vnc-qr {
  width: 140px; height: 140px;
  background: repeating-conic-gradient(#000 0 25%, #fff 0 50%) 50% / 14px 14px, linear-gradient(135deg, #f0f0f0, #fafafa);
  border-radius: 6px;
  margin: 12px auto;
  border: 1px solid #E9ECF1;
  position: relative;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.vnc-qr:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(92, 127, 255, 0.25);
}
.vnc-qr-hint {
  position: absolute;
  bottom: -6px; left: 50%;
  transform: translate(-50%, 100%);
  background: #1A1A1A;
  color: white;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  display: flex; align-items: center; gap: 4px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 200ms ease;
  pointer-events: none;
}
.vnc-qr:hover .vnc-qr-hint {
  opacity: 1;
}
.vnc-qr-hint .lucide-xs { color: white; }

/* ========== 欢迎页（按 Figma 布局：左对齐）========== */
.welcome-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 32px;
  min-height: 0;
}
.welcome-inner {
  width: 100%;
  max-width: 442px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.welcome-avatar-img {
  width: 64px; height: 64px;
  object-fit: contain;
}
.welcome-title-new {
  font-size: 20px;
  line-height: 32px;
  font-weight: 400;
  color: var(--text-primary);
  margin: 0;
}
.welcome-chips {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}
.welcome-chip {
  align-self: flex-start;   /* hug 宽度 */
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  font-size: 14px;
  cursor: pointer;
  transition: all 180ms ease;
  color: var(--text-primary);
}
.welcome-chip:hover { border-color: #C7D2FE; background: #FAFBFF; }
.chip-icon-red { color: #FF4F4F; }
.chip-icon-blue { color: #5C7FFF; }

.footer-tip {
  padding: 6px 0 0;
  text-align: center;
  font-size: 11px;
  color: rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
  background: transparent;    /* 显式去背景，对齐 Dock 风格 */
}

/* icon-btn 的无 hover 背景变体（顶部「新会话 / 全屏」按钮用）*/
.icon-btn.no-hover-bg:hover { background: transparent; }
.icon-btn.no-hover-bg { color: var(--text-black-9); }

/* ===== 云电脑顶栏：OpenClaw 原生模式 下拉 ===== */
.panel-mode-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: rgba(92, 127, 255, 0.08);
  border: 1px solid rgba(92, 127, 255, 0.18);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-black-9);
  cursor: pointer;
  transition: background 160ms ease;
}
.panel-mode-pill:hover { background: rgba(92, 127, 255, 0.12); }

/* ===== 开始接管按钮（AI 执行中置灰）===== */
.takeover-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px;
  border-radius: 8px;
  background: #1A1A1A;
  color: white;
  border: none;
  font-size: 12px;
  cursor: pointer;
  transition: all 160ms ease;
}
.takeover-btn:hover { opacity: 0.88; }
.takeover-btn .lucide-xs { color: white; }
.takeover-btn.disabled {
  background: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.35);
  cursor: not-allowed;
}
.takeover-btn.disabled:hover { opacity: 1; }
.takeover-btn.disabled .lucide-xs { color: rgba(0, 0, 0, 0.35); }

/* ===== 全屏 esc 提示条 ===== */
.fullscreen-esc-hint {
  position: absolute;
  top: 60px; left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: rgba(26, 26, 26, 0.78);
  color: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  font-size: 11px;
  backdrop-filter: blur(12px);
  z-index: 20;
  pointer-events: none;
}
.fullscreen-esc-hint kbd {
  font-family: "SF Mono", "Menlo", monospace;
  background: rgba(255, 255, 255, 0.15);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
}

/* ===== 全局 Toast ===== */
.global-toast {
  position: fixed;
  top: 80px; left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  background: rgba(26, 26, 26, 0.92);
  color: white;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(12px);
  z-index: 1000;
}
.global-toast .lucide-xs { color: rgba(255, 255, 255, 0.85); }

/* ===== 安装流程（嵌入云电脑区域）===== */
.vnc-install-cover {
  position: absolute;
  inset: 0;
  z-index: 15;
  background: linear-gradient(180deg, #FFFFFF 0%, #F7F9FE 100%);
  padding: 40px 48px 36px;
  overflow: auto;
  display: flex; flex-direction: column;
}
.vnc-install-cover .install-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 8px;
  background: transparent; border: none;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-secondary);
  transition: background 160ms ease;
}
.vnc-install-cover .install-close:hover { background: rgba(0, 0, 0, 0.06); }

.install-stepper {
  display: flex; align-items: center;
  max-width: 480px; width: 100%;
  margin: 0 auto 28px;
}
.install-step-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 12px; color: var(--text-secondary);
  flex-shrink: 0;
}
.install-step-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-secondary);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 500;
  transition: all 220ms ease;
}
.install-step-item.active .install-step-num {
  background: #5C7FFF;
  color: white;
  box-shadow: 0 0 0 4px rgba(92, 127, 255, 0.15);
}
.install-step-item.active { color: var(--text-primary); }
.install-step-item.done .install-step-num {
  background: #088F50;
  color: white;
}
.install-step-item.done { color: var(--green); }
.install-step-bar {
  flex: 1;
  height: 2px;
  background: rgba(0, 0, 0, 0.08);
  margin: 0 8px 20px;
  border-radius: 999px;
}

.install-page {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}
.install-illust {
  width: 96px; height: 96px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.install-illust-blue {
  background: linear-gradient(135deg, rgba(92, 127, 255, 0.12), rgba(168, 85, 247, 0.08));
}
.install-illust-green {
  background: linear-gradient(135deg, rgba(8, 143, 80, 0.12), rgba(34, 197, 94, 0.08));
}
.install-title {
  font-size: 20px; font-weight: 500;
  color: var(--text-primary);
  margin: 0 0 8px;
}
.install-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 22px;
  margin: 0 0 20px;
}
.install-meta {
  display: flex; gap: 18px;
  margin-bottom: 24px;
  font-size: 12px;
  color: var(--text-secondary);
}
.install-meta > div {
  display: inline-flex; align-items: center; gap: 4px;
}
.install-cta-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 24px;
  background: #1A1A1A;
  color: white;
  border: none; border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 160ms ease;
}
.install-cta-primary:hover { opacity: 0.88; }
.install-cta-primary .lucide-xs { color: white; }
.install-cta-ghost {
  margin-top: 10px;
  padding: 8px 16px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
}
.install-cta-ghost:hover { color: var(--text-primary); }

.install-progress-wrap {
  width: 100%;
  margin: 8px 0 20px;
}
.install-progress-bar {
  height: 6px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  overflow: hidden;
}
.install-progress-bar > div {
  height: 100%;
  background: linear-gradient(90deg, #5C7FFF, #A497F2);
  border-radius: 999px;
  transition: width 120ms linear;
}
.install-progress-text {
  display: flex; justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
}
.install-task-list {
  width: 100%;
  display: flex; flex-direction: column; gap: 6px;
}
.install-task-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: #FAFBFC;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 180ms ease;
}
.install-task-item.running {
  background: rgba(92, 127, 255, 0.06);
  color: var(--text-primary);
}
.install-task-item.done {
  color: var(--green);
  background: rgba(8, 143, 80, 0.06);
}
.install-task-item.done .lucide-xs { color: var(--green); }
.install-task-item.running .lucide-xs { color: #5C7FFF; }
.install-task-item.pending .lucide-xs { color: rgba(0, 0, 0, 0.25); }

/* ===== 云电脑区域 Action Toast（过程反馈浮条）===== */
.vnc-action-toast {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  background: rgba(26, 26, 26, 0.88);
  color: white;
  border-radius: 999px;
  font-size: 12px;
  font-family: "SF Mono", "Menlo", monospace;
  backdrop-filter: blur(12px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  z-index: 12;
  max-width: calc(100% - 32px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vnc-action-toast .lucide-xs { color: rgba(255, 255, 255, 0.9); }

.onboard-tip {
  position: absolute;
  bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%);
  background: #1A1A1A;
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  white-space: nowrap;
  box-shadow: var(--shadow-float);
  z-index: 20;
}
.onboard-tip::after {
  content: "";
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1A1A1A;
}

/* x-cloak：Alpine 初始化前强制隐藏，避免闪烁 */
[x-cloak] { display: none !important; }

.demo-toolbar {
  position: fixed;
  bottom: 16px; left: 50%;
  transform: translateX(-50%);
  background: rgba(26, 26, 26, 0.92);
  color: white;
  border-radius: 999px;
  padding: 6px 8px;
  display: flex; gap: 4px;
  z-index: 100;
  backdrop-filter: blur(20px);
  font-size: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.demo-toolbar button {
  padding: 6px 14px;
  border: none; background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  cursor: pointer;
  border-radius: 999px;
  transition: all 160ms ease;
}
.demo-toolbar button.active { background: white; color: #1A1A1A; font-weight: 500; }
.demo-toolbar button:hover:not(.active) { color: white; }

/* ===== 常驻 demo 工具条（小尺寸·输入框下方） ===== */
.demo-toolbar-inline {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  justify-content: center;
  align-items: center;
  padding: 4px 6px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  user-select: none;
}
.demo-toolbar-inline button {
  padding: 4px 10px;
  border: none;
  background: transparent;
  color: rgba(0, 0, 0, 0.55);
  cursor: pointer;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.4;
  transition: all 140ms ease;
  white-space: nowrap;
}
.demo-toolbar-inline button:hover:not(.active) {
  color: rgba(0, 0, 0, 0.85);
  background: rgba(0, 0, 0, 0.04);
}
.demo-toolbar-inline button.active {
  background: #1A1A1A;
  color: #fff;
  font-weight: 500;
}
.demo-toolbar-inline .dti-sep {
  width: 1px;
  height: 12px;
  background: rgba(0, 0, 0, 0.12);
  margin: 0 2px;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.2); }
