/* ── Reset & Variables ───────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sidebar-w: 260px;
  --bg: #ffffff;
  --bg-sidebar: #f7f7f5;
  --bg-bubble-user: #e8edf9;
  --bg-bubble-claude: #f5f5f5;
  --bg-input: #ffffff;
  --border: #e5e5e5;
  --text: #1a1a1a;
  --text-secondary: #6b6b6b;
  --text-muted: #999;
  --accent: #d97706;
  --accent-hover: #b45309;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --font: -apple-system, BlinkMacSystemFont, "Cascadia Mono", "Microsoft YaHei", Roboto, sans-serif;
  --mono: "Cascadia Mono", "SF Mono", "Fira Code", monospace;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ── Layout ──────────────────────────────────────────────────────── */

#app {
  display: flex;
  height: 100vh;
  height: var(--app-height, 100dvh);
}

/* ── Sidebar ─────────────────────────────────────────────────────── */

#sidebar {
  width: var(--sidebar-w);
  min-width: 0;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Resize handle ────────────────────────────────────────────────── */

#resize-handle {
  width: 5px;
  cursor: col-resize;
  background: transparent;
  transition: background 0.15s;
  flex-shrink: 0;
  position: relative;
}
#resize-handle:hover,
#resize-handle.active {
  background: var(--primary);
}
#resize-handle::after {
  content: '';
  position: absolute;
  top: 0;
  left: -4px;
  right: -4px;
  bottom: 0;
}

#sidebar-header {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.sidebar-actions {
  display: flex;
  gap: 6px;
}
#btn-new-session {
  flex: 1;
  padding: 7px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
#btn-new-session:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}
#btn-new-session:not(:disabled):hover {
  background: var(--primary-hover);
}
.btn-icon-only {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 16px;
  padding: 6px 8px;
  color: var(--text-secondary);
  transition: background 0.1s;
  line-height: 1;
}
.btn-icon-only:hover {
  background: #e8e8e6;
}

/* Session list */
#session-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

/* Collapsible directory groups */
.session-group {
  margin-bottom: 8px;
}
.session-group-header {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 0;
  transition: background 0.1s;
}
.session-group-header:hover {
  background: #e8e8e6;
}
.session-group-chevron {
  font-size: 8px;
  width: 14px;
  text-align: center;
  flex-shrink: 0;
  color: var(--text-muted);
}
.session-group-icon {
  font-size: 13px;
  flex-shrink: 0;
}
.session-group-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: rtl;
  text-align: left;
}
.session-group-body {
  /* nested under header */
}
.session-group.collapsed .session-group-body {
  display: none;
}

.session-item {
  padding: 5px 8px 5px 28px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 4px;
  margin: 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.1s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.session-item:hover { background: #e8e8e6; }
.session-item.active { background: #dbeafe; color: var(--primary); font-weight: 500; }
.session-item .session-actions {
  margin-left: auto;
  display: none;
  gap: 2px;
}
.session-item:hover .session-actions { display: flex; }
.session-item .btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  padding: 2px;
  border-radius: 3px;
  color: var(--text-secondary);
}
.session-item .btn-icon:hover { background: #ccc; }
.session-item .btn-icon-save { color: #16a34a; }
.session-item .btn-icon-cancel { color: var(--danger); }
.session-rename-input {
  flex: 1;
  border: none;
  border-bottom: 1px solid var(--primary);
  background: transparent;
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  padding: 0;
  line-height: 1.4;
  min-width: 0;
}

/* Connection status */
#connection-status {
  padding: 8px 12px;
  font-size: 11px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
}
#connection-status::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status-connected { color: #16a34a; }
.status-connecting { color: var(--accent); }
.status-error { color: var(--danger); }

#sidebar-session-id {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text-muted);
  margin-left: auto;
}

/* ── Main area ───────────────────────────────────────────────────── */

#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
}

#empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  gap: 8px;
}
#empty-state h2 { font-size: 18px; font-weight: 600; color: var(--text); }
#empty-state p { font-size: 14px; }

/* ── Messages ────────────────────────────────────────────────────── */

#messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.6;
  word-wrap: break-word;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.message.user {
  align-self: flex-end;
  background: var(--bg-bubble-user);
  border-bottom-right-radius: 2px;
}
.message.claude {
  align-self: flex-start;
  background: var(--bg-bubble-claude);
  border-bottom-left-radius: 2px;
}

.message .msg-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.message pre {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 10px 12px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 12px;
  overflow-x: auto;
  margin: 6px 0;
  white-space: pre-wrap;
  word-break: break-all;
}

.message code {
  font-family: var(--mono);
  font-size: 12px;
  background: rgba(0,0,0,0.06);
  padding: 1px 4px;
  border-radius: 3px;
}
.message pre code {
  background: none;
  padding: 0;
}

/* Tool progress */
.tool-progress {
  align-self: flex-start;
  max-width: 95%;
  padding: 4px 10px;
  background: #fef9c3;
  border-radius: var(--radius);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
  flex-wrap: nowrap;
}
.tool-progress > span {
  white-space: nowrap;
}
.tool-progress .tool-spinner {
  width: 12px; height: 12px;
  border: 2px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  flex-shrink: 0;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.tool-complete {
  background: #dcfce7;
  color: #166534;
}

.tool-error {
  background: #fee2e2;
  color: #991b1b;
}

/* Thinking indicator */
.thinking {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  color: var(--text-secondary);
  font-size: 13px;
}
.thinking .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--text-muted); }
.thinking .dot:nth-child(2) { animation: pulse 1.2s 0.2s infinite; }
.thinking .dot:nth-child(3) { animation: pulse 1.2s 0.4s infinite; }
.thinking .dot:nth-child(4) { animation: pulse 1.2s 0.6s infinite; }
@keyframes pulse { 0%, 60%, 100% { opacity: 0.3; } 30% { opacity: 1; } }

/* ── Permission dialog ───────────────────────────────────────────── */

#permission-dialog {
  padding: 0 0 10px;
}
.perm-card {
  background: #fffbeb;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 14px;
  width: 54%;
  min-width: 280px;
  box-shadow: var(--shadow);
}
.perm-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 6px;
}
.perm-icon { font-size: 14px; }
.perm-body {
  font-size: 13px;
  margin-bottom: 10px;
  line-height: 1.5;
}
.perm-detail {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.perm-desc {
  margin: 0;
}
#perm-body .perm-command {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 6px 8px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 12px;
  margin: 2px 0;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 80px;
  overflow-y: auto;
}
.perm-path {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
}
#perm-body .perm-reason {
  color: var(--text-muted);
  font-size: 11px;
  margin: 2px 0 0;
}
.perm-risk-low { border-left: 3px solid #eab308; }
.perm-risk-medium { border-left: 3px solid #f97316; }
.perm-risk-high { border-left: 3px solid #dc2626; }

/* CLI-style option list */
.perm-options {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.perm-option {
  padding: 5px 8px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.1s;
}
.perm-option:hover {
  background: #fef3c7;
}
.perm-option.selected {
  background: #fde68a;
  font-weight: 500;
}
.perm-option-marker {
  color: var(--accent);
  font-size: 11px;
  width: 12px;
  text-align: center;
  flex-shrink: 0;
}
.perm-option code {
  font-family: var(--mono);
  font-size: 12px;
  background: rgba(0,0,0,0.06);
  padding: 1px 4px;
  border-radius: 3px;
}

/* ── Buttons ─────────────────────────────────────────────────────── */

.btn {
  padding: 6px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  transition: all 0.1s;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger {
  background: #fff;
  color: var(--danger);
  border-color: var(--danger);
}
.btn-danger:hover { background: var(--danger); color: #fff; }

/* ── Input area ──────────────────────────────────────────────────── */

#input-area {
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border);
  position: relative;
}

#cwd-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 8px;
  font-size: 12px;
  color: var(--text-secondary);
}
#cwd-name {
  font-weight: 600;
}
.cwd-bubble {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f0f0f0;
  border: none;
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.cwd-bubble:hover {
  background: #e4e4e4;
}
.cwd-bubble-icon {
  font-size: 13px;
  line-height: 1;
}
#cwd-full {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: flex-end;
}
.path-bubble {
  display: inline-block;
  background: #f0f0f0;
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text-secondary);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#input-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  transition: border-color 0.15s;
}
#input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37,99,235,0.1);
}

#user-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  font-family: var(--font);
  resize: none;
  max-height: 150px;
  line-height: 1.4;
}
#user-input::placeholder { color: var(--text-muted); }

#btn-send, #btn-interrupt {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 4px;
  width: 32px; height: 32px;
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
#btn-send:disabled { cursor: not-allowed; opacity: 0.4; }
#btn-send:not(:disabled):hover { background: var(--primary-hover); }
#btn-interrupt {
  background: var(--danger);
  font-size: 18px;
}
#btn-interrupt:hover { background: var(--danger-hover); }

/* ── System messages ─────────────────────────────────────────────── */

.system-msg {
  align-self: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 10px;
  background: #fafafa;
  border-radius: 12px;
}

.error-msg {
  align-self: center;
  font-size: 12px;
  color: var(--danger);
  padding: 4px 10px;
  background: #fee2e2;
  border-radius: 12px;
}

/* ── History loading spinner ─────────────────────────────────────── */

#session-list .spinner {
  width: 14px; height: 14px;
  border: 2px solid #ddd;
  border-top-color: var(--text-muted);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin: 12px auto;
}
#session-list.loading {
  opacity: 0.5;
  pointer-events: none;
  position: relative;
}
#session-list.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px; height: 24px;
  margin: -12px 0 0 -12px;
  border: 3px solid #ddd;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ── Markdown output styles ────────────────────────────────────────── */

.message h1, .message h2, .message h3, .message h4 {
  font-weight: 600;
  margin: 10px 0 6px;
  line-height: 1.3;
}
.message h1 { font-size: 17px; }
.message h2 { font-size: 16px; }
.message h3 { font-size: 15px; }
.message h4 { font-size: 14px; }

.message ul, .message ol {
  margin: 4px 0;
  padding-left: 20px;
}
.message li {
  margin: 2px 0;
}

.message a {
  color: var(--primary);
  text-decoration: underline;
}
.message a:hover {
  opacity: 0.8;
}

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

.message blockquote {
  border-left: 3px solid var(--border);
  padding-left: 12px;
  margin: 6px 0;
  color: var(--text-secondary);
}

.message table {
  border-collapse: collapse;
  margin: 6px 0;
  font-size: 13px;
}
.message th, .message td {
  border: 1px solid var(--border);
  padding: 4px 8px;
  text-align: left;
}
.message th {
  background: var(--bg-sidebar);
  font-weight: 600;
}

.message hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 10px 0;
}

/* ── Skill & Command selector ───────────────────────────────────────────── */

#cmds-dropdown,
#model-dropdown,
#skills-dropdown {
  position: absolute;
  bottom: 100%;
  left: 12px;
  right: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  max-height: 240px;
  overflow-y: auto;
  z-index: 100;
  margin-bottom: 4px;
}

#cmds-empty,
#model-empty,
#skills-empty {
  padding: 16px 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.cmds-dropdown-item,
.skills-dropdown-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.1s;
}
.cmds-dropdown-item:hover,
.skills-dropdown-item:hover {
  background: #f0f4ff;
}
.cmds-dropdown-item + .cmds-dropdown-item,
.skills-dropdown-item + .skills-dropdown-item {
  border-top: 1px solid var(--border);
}
.cmds-dropdown-name,
.skills-dropdown-name {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--primary);
  white-space: nowrap;
  flex-shrink: 0;
}
.cmds-dropdown-desc,
.skills-dropdown-desc {
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Skill chips in input area */
#skill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  width: 100%;
}

.skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #dbeafe;
  color: var(--primary);
  border-radius: 12px;
  padding: 2px 6px 2px 8px;
  font-size: 12px;
  line-height: 1.4;
}
.skill-chip-name {
  font-family: var(--mono);
}
.skill-chip-remove {
  cursor: pointer;
  font-size: 11px;
  color: var(--text-muted);
  padding: 0 2px;
}
.skill-chip-remove:hover {
  color: var(--danger);
}

/* ── MCP selector ─────────────────────────────────────────────────── */

#mcp-dropdown {
  position: absolute;
  bottom: 100%;
  left: 12px;
  right: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  max-height: 280px;
  overflow-y: auto;
  z-index: 100;
  margin-bottom: 4px;
}

#mcp-empty {
  padding: 16px 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.mcp-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  transition: background 0.1s;
}
.mcp-item + .mcp-item {
  border-top: 1px solid var(--border);
}

.mcp-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.mcp-status-dot.connected { background: #22c55e; }
.mcp-status-dot.failed { background: #ef4444; }
.mcp-status-dot.pending { background: #f59e0b; }
.mcp-status-dot.disabled { background: #9ca3af; }
.mcp-status-dot.needs-auth { background: #8b5cf6; }

.mcp-info {
  flex: 1;
  min-width: 0;
}
.mcp-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.mcp-tools-count {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.mcp-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.mcp-btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
}
.mcp-btn:hover {
  background: #f0f0f0;
  color: var(--text);
}
.mcp-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.mcp-btn.reconnect:hover {
  border-color: #f59e0b;
  color: #b45309;
}

/* ── Model selector ─────────────────────────────────────────────────── */

.model-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.1s;
}
.model-item:hover {
  background: #f0f4ff;
}
.model-item + .model-item {
  border-top: 1px solid var(--border);
}
.model-item.active {
  background: #eff6ff;
}
.model-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.model-item.active .model-name {
  color: var(--primary);
}
.model-desc {
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.model-check {
  margin-left: auto;
  color: var(--primary);
  font-size: 13px;
  flex-shrink: 0;
}

/* ── Mobile adaptation ────────────────────────────────────────────── */

/* 桌面端默认隐藏汉堡按钮和遮罩 */
.sidebar-toggle { display: none; }
#sidebar-backdrop { display: none; }

/* 手机布局：无条件生效（该 web UI 只在本机手机使用） */
  /* 侧栏改成抽屉式，默认收起 */
  #sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(82vw, 320px);
    z-index: 1200;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 2px 0 14px rgba(0,0,0,0.18);
  }
  body.sidebar-open #sidebar {
    transform: translateX(0);
  }

  #resize-handle { display: none; }

  .sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1100;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.16);
    font-size: 20px;
    color: var(--text);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  #sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.38);
    z-index: 1150;
  }
  body.sidebar-open #sidebar-backdrop {
    display: block;
  }

  #main { min-width: 0; }

  /* 给顶部汉堡按钮让位 */
  #empty-state {
    padding-top: 56px;
    justify-content: flex-start;
  }
  #empty-state h2 { font-size: 20px; }
  #empty-state p { font-size: 15px; padding: 0 18px; text-align: center; }

  #messages {
    padding: 56px 12px 12px;
  }
  .message {
    max-width: 92%;
    font-size: 15px;
    line-height: 1.55;
  }
  .message pre { font-size: 13px; }

  /* 表格/长内容横向滚动，避免撑破布局 */
  .message table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    white-space: nowrap;
  }

  #input-area {
    padding: 10px 12px 14px;
  }

  /* cwd 按钮栏横向滚动，不换行挤压 */
  #cwd-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding-bottom: 8px;
  }
  #cwd-bar::-webkit-scrollbar { display: none; }
  #cwd-full { display: none; }
  .cwd-bubble {
    font-size: 13px;
    padding: 7px 11px;
    flex-shrink: 0;
  }

  #user-input { font-size: 16px; }
  #btn-send, #btn-interrupt {
    width: 42px;
    height: 42px;
    font-size: 16px;
  }

  /* 权限弹窗占满宽度 */
  .perm-card {
    width: 100%;
    min-width: 0;
    padding: 12px;
  }

  /* 下拉菜单铺满可用宽度，更易点按 */
  #cmds-dropdown,
  #skills-dropdown,
  #mcp-dropdown,
  #model-dropdown {
    left: 8px;
    right: 8px;
    max-height: 42vh;
  }

  /* 触控目标加大 */
  .session-item {
    padding: 11px 8px 11px 28px;
    font-size: 14px;
  }
  .session-group-header {
    padding: 8px;
    font-size: 13px;
  }
  .perm-option { padding: 9px 8px; font-size: 14px; }
  .cmds-dropdown-item,
  .skills-dropdown-item,
  .mcp-item,
  .model-item { padding: 10px 12px; }
