/* ===== 设计变量 ===== */
:root {
  --bg: #0f1014;
  --bg-soft: #15161c;
  --bg-raised: #1b1d25;
  --border: #262835;
  --border-soft: #1f2130;
  --text: #e8e9ef;
  --text-dim: #9296a6;
  --text-faint: #666a7a;
  --accent: #4d6bfe;
  --accent-soft: #2b3a7a;
  --danger: #e5534b;
  --user-bubble: #262b3f;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", "Cascadia Code", "JetBrains Mono", Consolas, monospace;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overscroll-behavior: none;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-thumb {
  background: #2c2f3d;
  border-radius: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}

/* ===== 登录 / 首次设置 ===== */
.gate {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(
      1000px 600px at 50% -10%,
      rgba(77, 107, 254, 0.16),
      transparent 70%
    ),
    var(--bg);
  z-index: 100;
}

.gate-card {
  width: 100%;
  max-width: 360px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.gate-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}

.gate-card h1 {
  font-size: 19px;
  margin: 0;
  text-align: center;
  font-weight: 600;
}

.gate-hint {
  margin: 0 0 8px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.6;
}

.gate-card input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s;
}

.gate-card input:focus {
  border-color: var(--accent);
}

.gate-error {
  color: var(--danger);
  font-size: 13px;
  padding: 8px 10px;
  background: rgba(229, 83, 75, 0.1);
  border-radius: 8px;
}

.primary {
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 600;
  transition: opacity 0.15s, transform 0.1s;
}

.primary:hover {
  opacity: 0.9;
}
.primary:active {
  transform: scale(0.99);
}
.primary:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ===== 主布局 ===== */
.app {
  display: flex;
  height: 100%;
  height: 100dvh;
}

.sidebar {
  width: 264px;
  flex: 0 0 264px;
  display: flex;
  flex-direction: column;
  background: var(--bg-soft);
  border-right: 1px solid var(--border-soft);
}

.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.2px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.icon-btn:hover {
  background: var(--bg-raised);
  color: var(--text);
}

.conv-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px 8px;
}

.conv-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 9px;
  cursor: pointer;
  margin-bottom: 2px;
  transition: background 0.12s;
}

.conv-item:hover {
  background: var(--bg-raised);
}

.conv-item.active {
  background: var(--accent-soft);
}

.conv-item .conv-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
  color: var(--text-dim);
}

.conv-item.active .conv-title {
  color: #cdd6ff;
}

.conv-actions {
  display: none;
  gap: 2px;
}

.conv-item:hover .conv-actions,
.conv-item.active .conv-actions {
  display: flex;
}

.conv-actions button {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  color: var(--text-faint);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.conv-actions button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.conv-empty {
  padding: 20px 12px;
  color: var(--text-faint);
  font-size: 13px;
  text-align: center;
}

.side-foot {
  border-top: 1px solid var(--border-soft);
  padding: 8px;
  display: flex;
  gap: 6px;
  padding-bottom: calc(8px + var(--safe-bottom));
}

/* 手机上把「人设」「主动」放进侧边栏，顶栏就没那么挤 */
.side-quick {
  display: none;
  gap: 6px;
  padding: 8px 8px 0;
}

.side-quick .ghost-btn {
  border: 1px solid var(--border);
}

.side-quick .ghost-btn.on {
  background: var(--accent-soft);
  border-color: #3d4a75;
  color: #cdd6ff;
}

.ghost-btn {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 13px;
  transition: background 0.15s, color 0.15s;
}

.ghost-btn:hover {
  background: var(--bg-raised);
  color: var(--text);
}

/* ===== 主区域 ===== */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(15, 16, 20, 0.82);
  backdrop-filter: blur(12px);
  z-index: 5;
}

.menu-btn {
  display: none;
}

.topbar-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.topbar-title h1 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conv-meta {
  font-size: 11.5px;
  color: var(--text-faint);
  height: 15px;
}

.model-select {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12.5px;
  color: var(--text-dim);
  outline: none;
  max-width: 190px;
}

.model-select:focus {
  border-color: var(--accent);
}

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

.think-btn {
  padding: 6px 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text-faint);
  font-size: 12.5px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.think-btn:hover {
  color: var(--text);
}

.think-btn.on {
  background: var(--accent-soft);
  border-color: #3d4a75;
  color: #cdd6ff;
}

.effort-select {
  max-width: 82px;
  padding-left: 8px;
  padding-right: 4px;
}

/* ===== 消息区 ===== */
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 22px 0 8px;
  scroll-behavior: smooth;
}

.msg {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px 22px;
  display: flex;
  gap: 12px;
}

.msg.user {
  justify-content: flex-end;
}

.msg .bubble {
  background: var(--user-bubble);
  padding: 11px 15px;
  border-radius: 16px 16px 4px 16px;
  max-width: min(78%, 620px);
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14.5px;
}

.msg.assistant .body {
  flex: 1;
  min-width: 0;
}

.msg.assistant .body > *:first-child {
  margin-top: 0;
}

.msg.assistant .body > *:last-child {
  margin-bottom: 0;
}

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(140deg, #4d6bfe, #7b5cff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex: 0 0 26px;
  margin-top: 3px;
  object-fit: cover;
  overflow: hidden;
}

img.avatar {
  background: none;
  border: 1px solid var(--border-soft);
}

.avatar.me {
  margin-left: 10px;
}

/* 头像设置 */
.avatar-row {
  display: flex;
  gap: 14px;
}

.avatar-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}

.avatar-preview {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.avatar-label {
  font-size: 12px;
  color: var(--text-faint);
}

.avatar-slot .ghost-btn {
  width: 100%;
  border: 1px solid var(--border);
  padding: 6px;
}

/* Markdown */
.md {
  font-size: 15px;
  word-break: break-word;
}

.md p {
  margin: 0 0 12px;
}

.md h1,
.md h2,
.md h3,
.md h4 {
  margin: 20px 0 10px;
  line-height: 1.35;
  font-weight: 600;
}

.md h1 {
  font-size: 21px;
}
.md h2 {
  font-size: 18px;
}
.md h3 {
  font-size: 16px;
}
.md h4 {
  font-size: 15px;
}

.md ul,
.md ol {
  margin: 0 0 12px;
  padding-left: 22px;
}

.md li {
  margin: 4px 0;
}

.md code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 0.88em;
  color: #ffb4a2;
}

.md a {
  color: #8fa4ff;
  text-decoration: none;
  border-bottom: 1px solid rgba(143, 164, 255, 0.35);
}

.md a:hover {
  border-bottom-color: #8fa4ff;
}

.md img {
  display: block;
  max-width: min(100%, 420px);
  border-radius: 10px;
  margin: 8px 0;
  border: 1px solid var(--border-soft);
}

/* 加载更早 */
.load-earlier-wrap {
  max-width: 820px;
  margin: 0 auto 18px;
  padding: 0 24px;
  display: flex;
  justify-content: center;
}

.load-earlier {
  padding: 7px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-dim);
  font-size: 12.5px;
  transition: border-color 0.15s, color 0.15s;
}

.load-earlier:hover {
  border-color: var(--accent);
  color: var(--text);
}

.load-earlier:disabled {
  opacity: 0.6;
  cursor: default;
}

.md blockquote {
  margin: 0 0 12px;
  padding: 2px 0 2px 14px;
  border-left: 3px solid var(--accent-soft);
  color: var(--text-dim);
}

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

.md table {
  border-collapse: collapse;
  margin: 0 0 12px;
  font-size: 14px;
  display: block;
  overflow-x: auto;
}

.md th,
.md td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: left;
}

.md th {
  background: var(--bg-raised);
  font-weight: 600;
}

.code-block {
  margin: 0 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #0b0c10;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: #14161d;
  border-bottom: 1px solid var(--border-soft);
  font-size: 11.5px;
  color: var(--text-faint);
  font-family: var(--mono);
}

.code-copy {
  color: var(--text-faint);
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 5px;
  font-family: var(--font);
}

.code-copy:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.code-block pre {
  margin: 0;
  padding: 12px 14px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
}

.code-block pre code {
  background: none;
  padding: 0;
  color: #d6dae6;
  font-size: 13px;
}

/* 思考过程 */
.reasoning {
  margin: 0 0 12px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.reasoning summary {
  padding: 8px 12px;
  font-size: 12.5px;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.reasoning summary::-webkit-details-marker {
  display: none;
}

.reasoning summary::before {
  content: "▸ ";
  color: var(--text-faint);
}

.reasoning[open] summary::before {
  content: "▾ ";
}

.reasoning-body {
  padding: 0 12px 12px;
  font-size: 13px;
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-word;
  border-top: 1px solid var(--border-soft);
  padding-top: 10px;
  max-height: 340px;
  overflow-y: auto;
}

/* 光标 */
.cursor {
  display: inline-block;
  width: 7px;
  height: 15px;
  background: var(--accent);
  vertical-align: -2px;
  margin-left: 3px;
  animation: blink 1s steps(2, start) infinite;
  border-radius: 1px;
}

@keyframes blink {
  to {
    visibility: hidden;
  }
}

.msg-error {
  color: var(--danger);
  font-size: 13px;
  background: rgba(229, 83, 75, 0.09);
  border: 1px solid rgba(229, 83, 75, 0.25);
  padding: 9px 12px;
  border-radius: 9px;
}

.thinking-dots {
  color: var(--text-faint);
  font-size: 13.5px;
}

/* 空状态 */
.empty-state {
  max-width: 640px;
  margin: 12vh auto 0;
  padding: 0 24px;
  text-align: center;
}

.empty-state h2 {
  font-size: 24px;
  margin: 0 0 8px;
  background: linear-gradient(100deg, #aebcff, #7b8cff, #c4a8ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.empty-state p {
  color: var(--text-dim);
  font-size: 14px;
  margin: 0 0 26px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.chip {
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-dim);
  background: var(--bg-soft);
  transition: border-color 0.15s, color 0.15s;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* ===== 输入区 ===== */
.composer-wrap {
  padding: 10px 16px calc(12px + var(--safe-bottom));
  background: linear-gradient(to top, var(--bg) 55%, transparent);
}

.composer {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 8px 8px 8px 16px;
  transition: border-color 0.15s;
}

.composer:focus-within {
  border-color: #3d4a75;
}

.composer textarea {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  resize: none;
  max-height: 200px;
  padding: 7px 0;
  line-height: 1.6;
  font-size: 15px;
  color: var(--text);
  overflow-y: auto;
  scrollbar-width: thin;
  overflow-wrap: break-word;
}

.composer textarea::placeholder {
  color: var(--text-faint);
}

.send-btn,
.stop-btn {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s;
}

.send-btn:disabled {
  background: var(--bg-raised);
  color: var(--text-faint);
  cursor: default;
}

.stop-btn {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  font-size: 11px;
}

.composer-tip {
  max-width: 820px;
  margin: 5px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 11px;
  color: var(--text-faint);
  height: 14px;
}

.composer-tip .kbd-hint::after {
  content: "·";
  margin-left: 12px;
}

/* ===== 附件 ===== */
.attach-btn {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 10px;
  color: var(--text-faint);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.attach-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

/* 隐藏的 file input 不要用 display:none —— iOS Safari 上会点不开 */
.file-input-hidden {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.attach-preview {
  max-width: 820px;
  margin: 0 auto 7px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-soft);
  font-size: 12px;
  color: var(--text-dim);
  max-width: 240px;
}

.attach-chip .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attach-chip button {
  color: var(--text-faint);
  font-size: 13px;
  padding: 0 2px;
  line-height: 1;
}

.attach-chip button:hover {
  color: var(--danger);
}

.attach-chip.uploading {
  opacity: 0.6;
}

.msg-files {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.msg-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 9px;
  border-radius: 7px;
  width: fit-content;
}

/* ===== 引用来源 ===== */
.citations {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
  font-size: 12.5px;
}

.citations .cit-title {
  color: var(--text-faint);
  margin-bottom: 6px;
}

.citations ol {
  margin: 0;
  padding-left: 20px;
}

.citations li {
  margin: 3px 0;
  color: var(--text-dim);
}

.citations a {
  color: #8fa4ff;
  text-decoration: none;
}

.citations a:hover {
  text-decoration: underline;
}

.export-row {
  display: flex;
  gap: 8px;
}

.export-row .ghost-btn {
  flex: 1;
  border: 1px solid var(--border);
  padding: 9px 10px;
}

/* ===== 弹窗 ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 200;
  backdrop-filter: blur(3px);
}

.modal-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-card h2 {
  margin: 0;
  font-size: 17px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-dim);
}

.field input,
.field textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 12px;
  outline: none;
  color: var(--text);
  font-size: 14px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
}

.field small {
  color: var(--text-faint);
  font-size: 11.5px;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}

.persona-hint {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-dim);
}

.persona-hint b {
  color: #cdd6ff;
  font-weight: 600;
}

.persona-info {
  font-size: 12px;
  color: var(--text-faint);
}

.push-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.push-actions .ghost-btn {
  border: 1px solid var(--border);
  padding: 6px 10px;
  font-size: 12.5px;
}

.summary-box {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 11px;
  background: var(--bg);
  font-size: 12px;
}

.summary-box summary {
  cursor: pointer;
  color: var(--text-dim);
  user-select: none;
}

.summary-box pre {
  margin: 9px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-dim);
  max-height: 260px;
  overflow-y: auto;
}

.modal-card textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 11px 12px;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.7;
  resize: vertical;
  outline: none;
  font-family: inherit;
}

.modal-card textarea:focus {
  border-color: var(--accent);
}

.modal-actions .primary {
  min-width: 92px;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 13px;
  z-index: 300;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.18s ease-out;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
}

.backdrop {
  display: none;
}

/* ===== 响应式：手机 ===== */
@media (max-width: 820px) {
  .topbar {
    gap: 6px;
    padding: 8px 10px;
  }

  /* 标题让位给控件，最多占 30% */
  .topbar-title {
    flex: 0 1 auto;
    max-width: 30%;
    min-width: 0;
  }

  .topbar-title h1 {
    font-size: 13px;
  }

  /* 控件可以横向滑动，保证每个都能点到 */
  .topbar-controls {
    flex: 1 1 auto;
    overflow-x: auto;
    overflow-y: hidden;
    justify-content: flex-end;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .topbar-controls::-webkit-scrollbar {
    display: none;
  }

  .topbar-controls > * {
    flex: 0 0 auto;
  }

  /* 手机上这两个按钮挪到抽屉里 */
  #personaBtn,
  #proactiveBtn {
    display: none;
  }

  .side-quick {
    display: flex;
  }

  .think-btn {
    padding: 6px 9px;
    font-size: 12px;
  }

  .model-select {
    max-width: 104px;
    font-size: 12px;
    padding: 5px 7px;
  }

  .effort-select {
    max-width: 62px;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.5);
  }

  body.drawer-open .sidebar {
    transform: translateX(0);
  }

  .backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s;
  }

  body.drawer-open .backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .menu-btn {
    display: flex;
  }

  .msg {
    padding: 0 14px 18px;
  }

  .msg .bubble {
    max-width: 86%;
  }

  .composer-wrap {
    padding: 8px 10px calc(10px + var(--safe-bottom));
  }

  .messages {
    padding-top: 16px;
  }

  .model-select {
    max-width: 120px;
    font-size: 12px;
  }

  .composer-tip .kbd-hint {
    display: none;
  }

  .empty-state h2 {
    font-size: 21px;
  }
}
