/* ===== Tokens (from Anvita Mate glass theme, light) ===== */
:root {
  --gray-1: #fcfcfc;
  --gray-3: #f1f1f1;
  --bg-layout: var(--gray-3);      /* sidebar  #f1f1f1 */
  --bg-container: var(--gray-1);   /* main     #fcfcfc */
  --seg-bg: #e3e3e3;
  --selected-bg: #dbdbdb;
  --border: #dddddd;
  --text: #1e1e1e;
  --text-2: #808080;
  --text-muted-nav: #9e9e9e;
  --orange-text: #a9691d;
  --orange-icon: #de765d;

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, "Courier New", monospace;

  --sidebar-w: 280px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: #000; }
body {
  font-family: var(--font);
  font-size: var(--type-body-size);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  user-select: none;
 line-height: var(--type-body-line); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: default; }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* 原窗口截图四角为 ~12px 圆角（透明区呈黑色），这里同样裁圆角以便逐像素比对 */
.app { display: flex; height: 100vh; width: 100vw; border-radius: 12px; overflow: hidden; background: var(--bg-container); }

/* ============ Sidebar ============ */
.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: var(--bg-layout);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: margin-left .22s cubic-bezier(.16,1,.3,1);
}
.sidebar.collapsed { margin-left: calc(-1 * var(--sidebar-w)); }

.sb-titlebar {
  height: 28px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 0 10px;
  -webkit-app-region: drag;
}
.traffic { display: flex; gap: 9px; margin-left: 2px; }
.traffic span { width: 14px; height: 14px; border-radius: 50%; background: #cccccc; }
.traffic span:nth-child(2) { background: #cecece; }
.app.active .traffic span:nth-child(1) { background: #ff5f57; }
.app.active .traffic span:nth-child(2) { background: #febc2e; }
.app.active .traffic span:nth-child(3) { background: #28c840; }
.sb-toggle { margin-right: -2px; }
.icon-btn.sb-toggle svg { width: 16px; height: 16px; color: #6f6f6f; }

.icon-btn {
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
  color: #6f6f6f;
}
.icon-btn:hover { background: rgba(0,0,0,.06); color: var(--text); }
.icon-btn svg { width: 14px; height: 14px; }

.sb-brand {
  display: flex; align-items: center;
  height: 20px;
  margin-top: 19px;
  padding: 0 14px;
  gap: 6px;
}
.sb-brand-text { font-size: 22px; font-weight: 700; letter-spacing: .7px; color: var(--text); line-height: 1; }
.sb-brand-chev { width: 14px; height: 14px; color: #9e9e9e; margin-left: auto; margin-right: 7px; stroke-width: 2.4; }

.segmented {
  margin: 19px 14px 0 8px;
  height: 34px;
  background: var(--seg-bg);
  border-radius: 8px;
  padding: 2px 2px;
  display: flex;
  gap: 4px;
}
.seg-item {
  flex: 1;
  height: 30px;
  border-radius: 6px;
  font-size: var(--type-body-size);
  color: #767676;
  display: flex; align-items: center; justify-content: center; gap: 6px;
 line-height: var(--type-body-line); }
.seg-item svg { width: 14px; height: 14px; stroke-width: 2; color: #787878; }
.seg-item.active { background: #fff; color: #2c2c2c; font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.seg-item.active svg { color: #4f4f4f; }

.sb-nav { margin-top: 13px; padding: 0 14px 0 8px; display: flex; flex-direction: column; gap: 3px; }
.nav-row {
  height: 30px;
  display: flex; align-items: center;
  padding: 0 8px;
  border-radius: 6px;
  font-size: var(--type-body-size);
  color: var(--text);
  text-align: left;
 line-height: var(--type-body-line); }
.nav-row:hover { background: rgba(0,0,0,.05); }
.nav-row svg { width: 16px; height: 16px; margin-right: 6px; color: #3a3a3a; stroke-width: 1.75; }
.nav-row kbd { margin-left: auto; margin-right: 0; font-family: var(--font); font-size: var(--type-body-size); font-weight: 500; color: #7c7c7c; letter-spacing: .5px;  line-height: var(--type-body-line); }

.sb-scroll { flex: 1; overflow-y: auto; padding: 0 14px 0 8px; min-height: 0; }
.sb-scroll::-webkit-scrollbar { width: 0; }
.sb-section-title { font-size: var(--type-body-size); color: #a6a6a6; padding: 0 8px; height: 13px;  margin-top: 11px;  line-height: var(--type-body-line); }

.project { margin-top: 22px; }
.project + .project { margin-top: 25px; }
.proj-row {
  height: 16px;
  display: flex; align-items: center;
  padding: 0 8px;
  font-size: var(--type-body-size);
  color: var(--text);
  border-radius: 6px;
 line-height: var(--type-body-line); }
.proj-row svg { width: 16px; height: 16px; margin-right: 6px; color: #3a3a3a; stroke-width: 1.75; }
.task-row {
  min-height: 28px;
  margin-top: 1px;
  display: flex; align-items: center;
  padding: 0 8px 0 30px;
  border-radius: 6px;
  font-size: var(--type-body-size);
  color: var(--text);
  white-space: nowrap; overflow: hidden;
 line-height: var(--type-body-line); }
.proj-row + .task-row { margin-top: 9px; }
.task-row span { overflow: hidden; text-overflow: ellipsis; }
.task-row.placeholder { padding-left: 8px; color: var(--text-muted-nav); }
.task-row.placeholder svg { width: 16px; height: 16px; margin-right: 8px; color: #b5b5b5; stroke-width: 1.75; }
.task-row:hover { background: rgba(0,0,0,.04); }
.task-row.selected { background: var(--selected-bg); padding-left: 8px; padding-right: 41px; margin-top: 1px; }
.task-row.selected .grip { width: 14px; height: 14px; margin: 0 8px 0 0; color: #969696; stroke-width: 2.4; fill: currentColor; }
.collapse-row { font-size: var(--type-body-size); color: #9e9e9e; padding-left: 32px; height: 14px;  margin-top: 10px;  line-height: var(--type-body-line); }

.sb-footer {
  height: 52px;
  display: flex; align-items: center;
  padding: 0 14px 4px 10px;
  gap: 8px;
  flex: none;
}
.avatar { width: 28px; height: 28px; border-radius: 7px; overflow: hidden; flex: none; margin-top: 8px; }
.avatar svg { width: 28px; height: 28px; display: block; stroke: none; }
.avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.user-name { font-size: var(--type-body-size); color: var(--text); flex: 1;  line-height: var(--type-body-line); }
.sb-footer .icon-btn { margin-right: 8px; }
.sb-footer .icon-btn svg { width: 16px; height: 16px; color: #565656; }

/* ============ Main ============ */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg-container); position: relative; }
.main-header {
  height: 66px;
  display: flex; align-items: flex-end;
  padding: 0 20px 16px 12px;
  gap: 8px;
  -webkit-app-region: drag;
}
.hdr-icon { width: 14px; height: 14px; color: #3a3a3a; stroke-width: 1.9; margin: 0 0 3px 0; }
.hdr-title { font-size: var(--type-body-size); font-weight: 500;  color: #202020; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1;  line-height: var(--type-body-line); }
.hdr-actions { display: flex; gap: 16px; align-self: flex-start; margin-top: 14px; margin-right: -6px; }
.hdr-actions .icon-btn svg { width: 14px; height: 14px; color: #3a3a3a; stroke-width: 1.9; }
.hdr-actions .icon-btn:last-child svg { width: 16px; height: 16px; }

.transcript { flex: 1; overflow-y: auto; min-height: 0; padding-bottom: 8px; }
.transcript::-webkit-scrollbar { width: 4px; }
.transcript::-webkit-scrollbar-track { background: #f6f7f8; }
.transcript::-webkit-scrollbar-thumb { background: #d8d8d8; border-radius: 2px; }
/* 原图右侧 x≥1263 有 4px 宽常驻滚动条轨道（y 10–1153），无头 --hide-scrollbars 下用伪元素补齐 */
.main::after { content: ""; position: absolute; right: 0; top: 10px; width: 4px; height: 1144px; background: #f6f7f8; pointer-events: none; }
.thread { width: 808px; max-width: calc(100% - 40px); margin: 0 0 0 96px; padding-top: 0; }
.thread > :first-child.ellipsis { margin-top: 19px; }
/* 原图 x282–293 三段 3px 圆角短横（y 513/525/537），第三段更深 */
.edge-marks { position: absolute; left: 2px; top: 513px; width: 12px; pointer-events: none; }
.edge-marks i { display: block; width: 12px; height: 3px; border-radius: 1.5px; background: #cfcfcf; margin-bottom: 9px; }
.edge-marks i:last-child { background: #828282; }

.msg.user { display: flex; justify-content: flex-end; margin: 6px 0 18px; }
.msg.user .bubble {
  max-width: 78%;
  background: #f1f1f1;
  border-radius: 12px;
  padding: 8px 14px;
  font-size: var(--type-body-size);  color: #202020;
  white-space: pre-wrap; word-break: break-word;
  user-select: text;
 line-height: var(--type-body-line); }
.msg.assistant { margin-top: 8px; font-size: var(--type-body-size);  color: #202020; user-select: text;  line-height: var(--type-body-line); }
.msg.assistant p + p { margin-top: 8px; }
.msg.assistant + .tool-row { margin-top: 9px; }
.tool-row + .msg.assistant { margin-top: 7px; }
.tool-row.running + .msg.assistant { margin-top: 17px; }

.ellipsis { height: 2px;  font-size: var(--type-section-size); color: #808080; margin: 24px 0 21px; letter-spacing: 0; overflow: visible;  line-height: var(--type-section-line); }
.tool-row + .ellipsis { margin-top: 17px; }
.tool-row {
  display: flex; align-items: flex-start;
  gap: 5px;
  font-size: var(--type-caption-size);  color: #808080;
  margin-top: 16px;
  white-space: nowrap; overflow: hidden;
 line-height: var(--type-caption-line); }
.tool-row svg { width: 14px; height: 14px; color: #909090; stroke-width: 1.8; margin-left: 2px; }
.tool-row.term svg { width: 14px; height: 14px; margin: 0 0 0 2px; }
.tool-text { overflow: hidden; text-overflow: ellipsis; }
.tool-row .mono { font-family: inherit; font-size: inherit; white-space: nowrap; }
.tool-row.running, .tool-row.running svg { color: #202020; }
.result-row {
  display: flex; align-items: center;
  overflow: hidden;
  height: 11px;
  font-size: var(--type-caption-size); color: #818181; 
  margin-top: 8px;
  gap: 7px;
  padding-left: 2px;
 line-height: var(--type-caption-line); }
.result-row svg { width: 10px; height: 10px; stroke-width: 2.2; color: #909090; transition: transform .15s; }
.result-row:hover { color: #202020; }
.result-row.open svg { transform: rotate(90deg); }
.result-body {
  margin: 8px 0 0 19px;
  padding: 8px 12px;
  background: #f6f7f8;
  border-radius: 8px;
  font-family: var(--mono); font-size: var(--type-caption-size);  color: #505050;
  white-space: pre-wrap; user-select: text;
 line-height: var(--type-caption-line); }
.tool-row + .tool-row { margin-top: 8px; }
.result-row + .tool-row { margin-top: 15px; }
.result-row + .tool-row.term { margin-top: 14px; }

/* ============ Composer ============ */
.composer-wrap { flex: none; padding: 8px 0 14px; position: relative; left: -2px; }
.composer {
  width: 860px; max-width: calc(100% - 40px);
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--gray-1);
  box-shadow: 0 2px 14px rgba(0,0,0,.045), 0 0 4px rgba(0,0,0,.02);
  padding: 16px 12px 14px 16px;
  display: flex; flex-direction: column;
}
.composer:focus-within { border-color: #c9c9c9; }
#input {
  width: 100%;
  border: 0; outline: 0; resize: none;
  background: transparent;
  font: inherit; font-size: var(--type-body-size);  color: #202020;
  min-height: 20px; max-height: 240px;
  margin-bottom: 44px;
  user-select: text;
 line-height: var(--type-body-line); }
#input::placeholder { color: #9a9a9a; }
.composer-bar { display: flex; align-items: center; justify-content: space-between; height: 32px; }
.bar-left, .bar-right { display: flex; align-items: center; gap: 8px; }
.bar-left { margin-left: 0; gap: 6px; }
.bar-right { gap: 6px; }
.composer-bar .icon-btn { color: #4a4a4a; }
.composer-bar .icon-btn svg { width: 16px; height: 16px; }
.bar-left .icon-btn svg { width: 14px; height: 14px; stroke-width: 2.2; }
.pill {
  height: 26px;
  display: inline-flex; align-items: center;
  gap: 6px;
  padding: 0 6px;
  border-radius: 6px;
  font-size: var(--type-body-size);
 line-height: var(--type-body-line); }
.pill:hover { background: rgba(0,0,0,.05); }
.pill svg { width: 14px; height: 14px; }
.pill .chev { width: 14px; height: 14px; stroke-width: 2.4; }
.pill.auto, .pill.auto svg { color: var(--orange-text); }
.pill.auto { gap: 4px; }
.pill.auto svg:first-child { width: 16px; height: 16px; }
.pill.auto .chev { margin-left: -1px; }
.pill.model { color: #202020; font-weight: 500; }
.pill.model { padding: 0 3px 0 4px; gap: 6px; }
.pill.model .model-icon { color: var(--orange-icon); stroke-width: 2.6; width: 15px; height: 15px; }
.pill.model .chev { color: #4a4a4a; stroke-width: 2.6; width: 12px; height: 12px; margin-left: -2px; }
.send {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #1e1e1e; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: 8px;
}
.send svg { width: 14px; height: 14px; stroke-width: 2.4; }
.send.stop svg { display: none; }
.send.stop::after { content: ""; width: 10px; height: 10px; background: #fff; border-radius: 2px; }
.composer-note {
  width: 860px; max-width: calc(100% - 40px);
  margin: 6px auto 0;
  padding-right: 0;
  text-align: right;
  font-size: var(--type-caption-size); color: #9a9a9a; 
 line-height: var(--type-caption-line); }

.empty-view { display: flex; flex-direction: column; align-items: center; justify-content: center; color: #808080; font-size: var(--type-body-size); gap: 8px;  line-height: var(--type-body-line); }
.empty-view h2 { font-size: var(--type-page-size); font-weight: 600; color: #202020;  line-height: var(--type-page-line); }
