:root { --app-height: 100vh; /* * 全站字体栈(改 font-family 族前须先明确需求)。 * UI:有网时 index.html 外链 Inter + Noto Sans SC;外链失败则仅用后续系统无衬线。 * 拉丁优先 Inter,中文缺字形由 Noto Sans SC 补。 * 代码:行内/块 code 与 pre → Source Code Pro(Google 文件名 source-code-pro)+ Menlo … */ --font-ui: Inter, "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif; --font-mono: "Source Code Pro", Menlo, Monaco, Consolas, "Courier New", monospace; } /* ─── 重置与基础 ──────────────────────────────────────────────────── */ *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; } html { font-size: 16px; -webkit-text-size-adjust: 100%; font-family: var(--font-ui); } body { font-family: inherit; background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.06), transparent 28%), linear-gradient(180deg, #f7f8fb 0%, #f2f4f8 100%); color: #1a1a1a; height: var(--app-height); overflow: hidden; } body.settings-page { display: flex; flex-direction: column; min-height: var(--app-height); height: var(--app-height); overflow: hidden; background: #fff; } button, input, textarea, select, optgroup { font-family: inherit; } [hidden] { display: none !important; } /* 全文等宽:
(含 fenced 与非 Markdown 片段) */
code,
kbd,
samp,
pre {
  font-family: var(--font-mono);
}

/* highlight.js github 主题会写 SFMono/ui-monospace;统一回站点等宽栈 */
.hljs,
pre code.hljs,
code.hljs {
  font-family: var(--font-mono) !important;
}

/* ─── 布局 ─────────────────────────────────────────────────────────── */

#app {
  display: flex;
  height: var(--app-height);
  min-height: 0;
}

/* ─── 侧边栏 ───────────────────────────────────────────────────────── */

#sidebar {
  width: 236px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-right: 1px solid #e5e5e5;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 100;
  transition: transform 0.25s ease;
}

.sidebar-header {
  padding: 18px 16px 10px;
  border-bottom: 1px solid #f0f0f0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-title {
  font-size: 17px;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: -0.3px;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-subtitle {
  font-size: 12px;
  color: #999;
  margin-top: 2px;
}

/* ─── 会话列表 ─────────────────────────────────────────────────────── */

.sidebar-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 6px;
  font-size: 11px;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.section-refresh {
  background: none;
  border: none;
  color: #bbb;
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  display: flex;
  transition: color 0.15s, background 0.15s;
}

.section-refresh:hover {
  color: #666;
  background: #f0f0f0;
}

.session-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 6px;
}

.session-list::-webkit-scrollbar { width: 4px; }
.session-list::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

.session-empty {
  padding: 16px 10px;
  color: #bbb;
  font-size: 12px;
  text-align: center;
}

/* 会话条目 */
.session-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  width: 100%;
  background: transparent;
  border: none;
  border-radius: 10px;
  transition: background 0.15s;
  margin-bottom: 3px;
}

.session-item:hover { background: #f5f5f5; }
.session-item.active { background: #f0f7ff; }

.session-item-main {
  min-width: 0;
  text-align: left;
  padding: 8px 4px 8px 10px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.session-item-name {
  font-size: 13px;
  font-weight: 500;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-item-meta {
  font-size: 10px;
  color: #bbb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 4px;
}

.session-delete-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  margin-right: 4px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #bbb;
  cursor: pointer;
  opacity: 0;
  transition: background 0.15s, color 0.15s, opacity 0.15s;
}

.session-item:hover .session-delete-btn,
.session-item.active .session-delete-btn,
.session-delete-btn:focus-visible {
  opacity: 1;
}

.session-delete-btn:hover {
  color: #dc2626;
  background: #fee2e2;
}

/* ─── 侧边栏操作按钮 ─────────────────────────────────────────────── */

.sidebar-actions {
  padding: 8px 10px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-actions button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: #555;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.sidebar-actions button:hover {
  background: #f0f0f0;
  color: #1a1a1a;
}

.sidebar-actions button svg {
  flex-shrink: 0;
}

/* ─── 侧边栏底部状态 ──────────────────────────────────────────────── */

.sidebar-status {
  padding: 12px 16px;
  border-top: 1px solid #f0f0f0;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #888;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.connected { background: #22c55e; }
.status-dot.streaming { background: #f59e0b; animation: pulse 1.2s ease-in-out infinite; }
.status-dot.disconnected { background: #ef4444; }

.status-model {
  font-size: 10px;
  color: #bbb;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

/* ─── 移动端遮罩层 ────────────────────────────────────────────────── */

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 99;
}

/* ─── 主区域 ───────────────────────────────────────────────────────── */

#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #fff;
}

/* ─── 顶部栏 ───────────────────────────────────────────────────────── */

#header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  flex-wrap: wrap;
}

.header-trailing {
  margin-left: auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
  max-width: min(68%, 680px);
  min-width: 0;
}

.menu-btn {
  display: none;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #555;
  cursor: pointer;
  flex-shrink: 0;
}

.menu-btn:hover { background: #f0f0f0; color: #1a1a1a; }

.header-info {
  flex: 1 1 auto;
  min-width: 0;
}

.header-info h1 {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
}

.header-meta {
  font-size: 11px;
  color: #999;
}

.header-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #dc2626;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}

.header-btn:hover { background: #fee2e2; }

.model-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.model-select,
.thinking-select {
  height: 30px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #374151;
  font-size: 11px;
  outline: none;
}

.model-select {
  width: min(260px, 28vw);
}

.thinking-select {
  width: 86px;
}

.model-select:focus,
.thinking-select:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 2px rgba(147, 197, 253, 0.22);
}

.model-select:disabled,
.thinking-select:disabled {
  color: #9ca3af;
  background: #f9fafb;
  cursor: not-allowed;
}

/* ─── 主区上下文条(与 TUI Footer 统计行同源:get_state.stats + model) ─ */

.session-context-bar {
  flex-shrink: 0;
  padding: 6px 16px 7px;
  border-bottom: 1px solid #f0f0f0;
  background: rgba(250, 251, 253, 0.97);
  font-size: 11px;
  line-height: 1.42;
  color: #5c6578;
}

/* 并入顶栏右上角:不占整宽独立一行 */
.session-context-bar.session-context-in-header {
  border: none;
  background: transparent;
  padding: 0;
  max-width: 100%;
  text-align: right;
}

.session-context-in-header .session-context-row {
  justify-content: flex-end;
}

.session-context-in-header.session-context-bar .session-context-primary-wrap .session-context-row {
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.session-context-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.session-context-left {
  flex: 1;
  min-width: 0;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}

.session-context-in-header .session-context-left,
.session-context-in-header .session-context-right {
  flex: 0 1 auto;
  max-width: 100%;
  text-align: right;
}

.session-context-right {
  flex-shrink: 0;
  text-align: right;
  opacity: 0.95;
  max-width: 46%;
}

#sessionContextSecondary {
  margin-top: 3px;
  font-size: 10px;
  color: #8b95a8;
}

.session-context-in-header #sessionContextSecondary {
  margin-top: 2px;
}

#sessionContextSecondary:empty {
  display: none;
}

.session-context-bar .ctx-warn {
  color: #b45309;
  font-weight: 500;
}

.session-context-bar .ctx-danger {
  color: #b91c1c;
  font-weight: 500;
}

/* ─── 聊天区域 ─────────────────────────────────────────────────────── */

#chat {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}

#chat::-webkit-scrollbar { width: 6px; }
#chat::-webkit-scrollbar-track { background: transparent; }
#chat::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }
#chat::-webkit-scrollbar-thumb:hover { background: #ccc; }

/* 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: #bbb;
  text-align: center;
  gap: 8px;
}

.empty-icon { color: #ddd; }
.empty-state p { font-size: 13px; }
.empty-hint { font-size: 11px; color: #ccc; }

/* ─── 消息 ─────────────────────────────────────────────────────────── */

.msg {
  max-width: min(700px, 100%);
  padding: 10px 12px;
  line-height: 1.4;
  font-size: 16px;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.msg.user {
  align-self: flex-end;
  background: linear-gradient(180deg, #f0f7ff 0%, #eaf2ff 100%);
  border: 1px solid #dbeafe;
  border-radius: 14px 14px 4px 14px;
  margin: 0 0 2px;
  color: #1a1a1a;
}

.msg.assistant {
  align-self: flex-start;
  margin: 0;
  padding: 0;
  color: #1a1a1a;
  line-height: 1.32;
}

.msg.system {
  align-self: center;
  color: #aaa;
  font-size: 11px;
  text-align: center;
  padding: 6px 10px;
}

.msg.thinking {
  align-self: flex-start;
  color: #888;
  font-size: 13px;
  font-style: italic;
  padding: 8px 0 8px 16px;
  border-left: 3px solid #e5e5e5;
  margin: 0;
}

.msg.tool_call {
  align-self: flex-start;
  font-size: 13px;
  font-family: var(--font-mono);
  color: #666;
  padding: 0;
  margin: 0 0 4px 12px;
  background: #fafafa;
  border-radius: 10px;
  border: 1px solid #eee;
  line-height: 1.4;
  max-width: min(680px, 100%);
}

.tool-call-collapsible {
  margin: 0;
}

.tool-call-collapsible > .tool-call-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  user-select: none;
  font-weight: 500;
  color: #555;
}

.tool-call-collapsible > .tool-call-summary::-webkit-details-marker {
  display: none;
}

.tool-call-summary::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 5px solid #888;
  border-top: 3.5px solid transparent;
  border-bottom: 3.5px solid transparent;
  flex-shrink: 0;
  transform: rotate(0deg);
  transition: transform 0.15s ease;
}

.tool-call-collapsible[open] > .tool-call-summary::before {
  transform: rotate(90deg);
}

.tool-call-summary-text {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-call-detail {
  margin: 0;
  padding: 6px 10px 8px;
  border-top: 1px solid #eee;
}

.tool-call-detail-pre {
  margin: 0;
  padding: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.45;
}

.msg.tool_result {
  align-self: flex-start;
  font-size: 12px;
  font-family: var(--font-mono);
  color: #666;
  padding: 8px 12px;
  margin: 0 0 2px 14px;
  background: #fafafa;
  border-radius: 10px;
  border: 1px solid #eee;
  max-height: 200px;
  overflow-y: auto;
}

/* ─── Markdown 渲染内容 ──────────────────────────────────────────── */

.msg.assistant h1, .msg.assistant h2, .msg.assistant h3,
.msg.assistant h4, .msg.assistant h5, .msg.assistant h6 {
  margin: 0.2em 0 0.04em;
  font-weight: 600;
  line-height: 1.25;
}
.msg.assistant h1 { font-size: 1.22em; }
.msg.assistant h2 { font-size: 1.12em; }
.msg.assistant h3 { font-size: 1.04em; }
.msg.assistant h4 { font-size: 1em; }

.msg.assistant p { margin: 0.03em 0; }
.msg.assistant p:first-child { margin-top: 0; }
.msg.assistant p:last-child { margin-bottom: 0; }

.msg.assistant strong { font-weight: 600; }
.msg.assistant em { font-style: italic; }

.msg.assistant a {
  color: #2563eb;
  text-decoration: none;
}
.msg.assistant a:hover { text-decoration: underline; }

.msg.assistant ul, .msg.assistant ol {
  margin: 0.02em 0;
  padding-left: 1.05em;
}
.msg.assistant li {
  margin: 0;
}
.msg.assistant li + li {
  margin-top: 0.04em;
}

/* marked 常在 
  • 内包一层或多层

    ,会与 li 边距叠加出大块留白 */ .msg.assistant li > p { margin: 0; } .msg.assistant li > p + p { margin-top: 0.06em; } .msg.assistant li ul, .msg.assistant li ol { margin: 0.03em 0 0.06em; } .msg.assistant blockquote { margin: 0.08em 0; padding: 2px 8px; border-left: 2px solid #e5e5e5; color: #666; } .msg.assistant hr { border: none; border-top: 1px solid #eee; margin: 0.2em 0; } .msg.assistant table { border-collapse: collapse; margin: 0.06em 0; font-size: 13px; width: 100%; } .msg.assistant th, .msg.assistant td { border: 1px solid #e5e5e5; padding: 4px 7px; text-align: left; } .msg.assistant th { background: #fafafa; font-weight: 600; } .msg.assistant code:not(.hljs) { font-size: 0.9em; background: #f5f5f5; padding: 2px 6px; border-radius: 4px; color: #d63384; word-break: break-word; } .msg.assistant pre.assistant-pre { margin: 0.35em 0; padding: 0; background: transparent; border: 1px solid #e8edf2; border-radius: 8px; overflow-x: auto; line-height: 1.5; } .msg.assistant pre.assistant-pre code.hljs { display: block; padding: 12px 14px; background: none; border: none; color: inherit; font-size: 14px; line-height: 1.5; word-break: normal; tab-size: 2; } .msg.assistant img { max-width: 100%; border-radius: 8px; margin: 0.06em 0; } /* 流式光标 */ .msg.streaming::after { content: "▊"; animation: blink 0.8s step-end infinite; color: #2563eb; margin-left: 1px; } @keyframes blink { 50% { opacity: 0; } } /* 消息分隔线 */ .msg.assistant + .msg.assistant { border-top: 1px solid #f0f0f0; padding-top: 4px; } /* ─── 设置页 ─────────────────────────────────────────────────────── */ .settings-view { flex: 1; min-height: 0; overflow-y: auto; background: #fff; padding: 18px 18px 22px; } .settings-page-main { flex: 1; display: flex; flex-direction: column; min-height: 0; width: 100%; padding: 0; } .settings-page-header { flex-shrink: 0; width: 100%; margin: 0; padding: max(14px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 14px max(18px, env(safe-area-inset-left)); display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #eef0f3; background: #fafbfc; } .settings-page-title { display: flex; align-items: center; gap: 10px; min-width: 0; } .settings-page-title h1 { font-size: 18px; font-weight: 700; color: #111827; line-height: 1.2; } .settings-page-title p { margin-top: 2px; font-size: 12px; color: #8b95a8; } .settings-page-shell { flex: 1; min-height: 0; margin: 0; padding: 0; display: flex; flex-direction: column; } .settings-link-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; } /* 设置页:侧栏 + 单栏内容(移动端侧栏改为顶部分段) */ .settings-layout { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: row; align-items: stretch; overflow: hidden; } .settings-sidebar { flex-shrink: 0; width: 220px; display: flex; flex-direction: column; gap: 6px; padding: 14px 12px; padding-left: max(12px, env(safe-area-inset-left)); background: #f4f6f9; border-right: 1px solid #e5e7eb; } .settings-nav-btn { display: flex; align-items: center; width: 100%; margin: 0; padding: 11px 14px; border: 1px solid transparent; border-radius: 10px; background: transparent; font-family: inherit; font-size: 14px; font-weight: 500; color: #4b5563; text-align: left; cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s; touch-action: manipulation; } .settings-nav-btn:hover { background: rgba(255, 255, 255, 0.72); color: #111827; } .settings-nav-btn.is-active { background: #fff; color: #2563eb; border-color: #e5e7eb; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06); } .settings-nav-btn:focus-visible { outline: 2px solid rgba(37, 99, 235, 0.45); outline-offset: 2px; } .settings-nav-btn-label { min-width: 0; } .settings-panes { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 14px max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) 14px; } .settings-pane:not(.is-active) { display: none !important; } .settings-pane.is-active { flex: 1; min-height: 0; display: flex; flex-direction: column; } .settings-panel { border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; } .settings-panel-header { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; row-gap: 8px; padding: 12px 14px; border-bottom: 1px solid #eef0f3; background: #fafbfc; } .settings-panel-header h2 { font-size: 14px; line-height: 1.3; font-weight: 600; color: #111827; } .settings-panel-header p { margin-top: 3px; font-size: 11px; color: #8b95a8; word-break: break-all; } .settings-primary-btn, .settings-secondary-btn { height: 30px; padding: 0 12px; border-radius: 7px; font-size: 12px; font-weight: 500; cursor: pointer; flex-shrink: 0; transition: background 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s; } .settings-primary-btn { color: #fff; background: #2563eb; border: 1px solid #2563eb; } .settings-primary-btn:hover { background: #1d4ed8; border-color: #1d4ed8; } .settings-primary-btn:disabled { opacity: 0.55; cursor: not-allowed; } .settings-secondary-btn { color: #374151; background: #fff; border: 1px solid #d1d5db; } .settings-secondary-btn:hover { background: #f3f4f6; } .settings-textarea { display: block; width: 100%; flex: 1 1 auto; min-height: 0; padding: 14px; border: none; outline: none; resize: none; color: #111827; background: #fff; font-family: var(--font-mono); font-size: 13px; line-height: 1.55; white-space: pre; overflow: auto; } .settings-textarea:focus { box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.18); } .settings-status { flex-shrink: 0; min-height: 30px; padding: 7px 14px 9px; border-top: 1px solid #eef0f3; color: #8b95a8; font-size: 12px; } .settings-status.ok { color: #15803d; } .settings-status.error { color: #b91c1c; } .skills-list, .extensions-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 8px; } .skill-item, .extension-item { padding: 10px 10px 9px; border: 1px solid #edf0f4; border-radius: 8px; background: #fff; } .skill-item + .skill-item, .extension-item + .extension-item { margin-top: 7px; } .skill-title-row, .extension-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; } .skill-name, .extension-name { min-width: 0; color: #111827; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .skill-meta, .extension-meta { flex-shrink: 0; color: #9ca3af; font-size: 10px; } .skill-desc { margin-top: 5px; color: #4b5563; font-size: 12px; line-height: 1.45; } .skill-path { margin-top: 6px; color: #9ca3af; font-family: var(--font-mono); font-size: 10px; line-height: 1.4; word-break: break-all; } .extension-counts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; } .extension-counts span { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 999px; background: #f3f4f6; color: #4b5563; font-size: 11px; line-height: 1; } .extension-details { margin-top: 8px; border-top: 1px solid #f1f3f6; padding-top: 7px; } .extension-details > summary { cursor: pointer; color: #6b7280; font-size: 11px; user-select: none; } .extension-details > summary:hover { color: #2563eb; } .extension-name-list { margin-top: 8px; display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 8px; align-items: start; font-size: 11px; color: #8b95a8; } .extension-name-list > div { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; } .extension-name-list code { padding: 2px 6px; border-radius: 5px; background: #f8fafc; border: 1px solid #edf0f4; color: #374151; font-family: var(--font-mono); font-size: 10px; word-break: break-all; } .extension-path { margin-top: 8px; color: #9ca3af; font-family: var(--font-mono); font-size: 10px; line-height: 1.4; word-break: break-all; } .settings-empty { padding: 20px 10px; color: #9ca3af; font-size: 12px; text-align: center; } /* ─── 输入区域 ─────────────────────────────────────────────────────── */ #inputArea { padding: 10px 16px 12px; border-top: 1px solid #f0f0f0; flex-shrink: 0; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(10px); } .input-wrapper { display: flex; gap: 8px; align-items: flex-end; max-width: 720px; margin: 0 auto; background: #f6f7fb; border: 1px solid #e5e5e5; border-radius: 14px; padding: 4px 4px 4px 12px; transition: border-color 0.15s; } .input-wrapper:focus-within { border-color: #2563eb; background: #fff; } #input { flex: 1; background: transparent; border: none; color: #1a1a1a; padding: 8px 0; font-size: 16px; font-family: inherit; resize: none; outline: none; min-height: 24px; max-height: 120px; line-height: 1.45; } #input::placeholder { color: #bbb; } #sendBtn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: #2563eb; border: none; border-radius: 11px; color: #fff; cursor: pointer; flex-shrink: 0; transition: background 0.15s, opacity 0.15s; touch-action: manipulation; } #sendBtn:hover { background: #1d4ed8; } #sendBtn:disabled { background: #d1d5db; cursor: not-allowed; } /* ─── 移动端适配 ──────────────────────────────────────────────────── */ @media (max-width: 768px) { body, #app { height: var(--app-height); } #sidebar { position: fixed; top: 0; left: 0; bottom: 0; transform: translateX(-100%); } #sidebar.open { transform: translateX(0); } .sidebar-overlay.open { display: block; } .menu-btn { display: flex; } #header { padding: 10px 12px; align-items: flex-start; } .header-trailing { max-width: 100%; width: 100%; flex-basis: 100%; margin-left: 0; justify-content: flex-start; padding-left: 44px; box-sizing: border-box; flex-wrap: wrap; } .model-controls { width: 100%; } .model-select { width: min(100%, 260px); flex: 1 1 180px; } .session-context-bar:not(.session-context-in-header) { padding: 5px 12px 6px; font-size: 10px; } .session-context-in-header { font-size: 10px; } #sessionContextSecondary { font-size: 9px; } #chat { padding: 10px 12px 8px; } .settings-view { padding: 12px; } .settings-page-main { padding: 0; } .settings-page-header { align-items: flex-start; padding-top: max(12px, env(safe-area-inset-top)); padding-bottom: 12px; padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); } .settings-layout { flex-direction: column; } .settings-sidebar { width: 100%; flex-direction: row; align-items: stretch; gap: 8px; padding: 10px max(12px, env(safe-area-inset-left)) 10px max(12px, env(safe-area-inset-right)); border-right: none; border-bottom: 1px solid #e5e7eb; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; } .settings-sidebar::-webkit-scrollbar { height: 0; width: 0; } .settings-nav-btn { flex: 1 1 0; min-width: 0; justify-content: center; text-align: center; padding: 12px 8px; font-size: 13px; } .settings-panes { flex: 1; min-height: 0; padding: 10px max(10px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-right)); } .settings-textarea { font-size: 12px; } .msg { padding: 11px 12px; font-size: 16px; } .msg.user { max-width: 88%; } .msg.assistant { padding-left: 0; } .msg.tool_call, .msg.tool_result { margin-left: 0; font-size: 12px; } #inputArea { position: sticky; bottom: 0; z-index: 5; padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); } .input-wrapper { padding: 2px 2px 2px 10px; } } @media (max-width: 480px) { .msg.user { max-width: 92%; padding: 10px 12px; font-size: 16px; } .msg.assistant { font-size: 16px; padding: 10px 0; } } /* ─── 动效偏好 ───────────────────────────────────────────────────── */ @media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; } }