:root {
  --accent: #7c3aed;
  --accent2: #4f6ef7;
  --ink: #1f2454;
  --ink-soft: #6b7299;
  --panel-bg: #ffffff;
  --panel-border: #e3e5f3;
  --shadow: 0 2px 8px rgba(0,0,0,.06);
  --radius: 22px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  color: var(--ink);
  background: #f4f5fb;
  overflow: hidden;
}

/* ---------- 背景（纯色，无磨砂/光斑） ---------- */
.bg-scene { position: fixed; inset: 0; z-index: -2; background: #f4f5fb; }
.blob, .grain { display: none; }

/* ---------- 面板（纯白卡片，无模糊） ---------- */
.glass {
  position: relative;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
}
.glass::before { content: none; }
.glass-pop {
  background: #ffffff;
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

/* ---------- 布局 ---------- */
.app {
  height: 100vh;
  display: grid;
  grid-template-columns: 292px 1fr;
  grid-template-rows: minmax(0, 1fr); /* 关键：grid 行收缩，防止 .main 被内容撑出视口 */
  gap: 0;
  padding: 0;
}
.app.hidden { display: none; }
.hidden { display: none !important; }

/* ---------- 侧栏 ---------- */
.sidebar {
  border-radius: 0;
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px;
  overflow: hidden;
  background: #fbfbfd;
  border: 0;
  border-right: 1px solid #ececf1;
  box-shadow: none;
}
.side-head { padding: 2px 6px 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo svg { filter: none; }
.logo-text { font-size: 17px; font-weight: 800; letter-spacing: .4px; }
.logo-text em { font-style: normal; font-weight: 500; color: var(--ink-soft); font-size: 12px; margin-left: 3px; }
.side-brand { font-size: 10.5px; color: var(--ink-soft); margin-top: 5px; letter-spacing: .6px; }

.new-chat {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; border-radius: 999px; border: 1px solid #e3e5f3;
  background: #ffffff;
  color: var(--ink); font-size: 14.5px; font-weight: 650; font-family: inherit; cursor: pointer;
  box-shadow: none;
  transition: all .22s ease;
}
.new-chat:hover { background: #f4f6fc; border-color: #d7dbe9; }
.new-chat .ic { width: 17px; height: 17px; }

.conv-list { flex: 1; overflow-y: auto; margin-top: 14px; display: flex; flex-direction: column; gap: 4px; padding-right: 2px; }
.conv-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 10px;
  cursor: pointer; border: 0; transition: all .18s ease; position: relative;
}
.conv-item:hover { background: #f4f6fc; }
.conv-item.active { background: #f0eefe; box-shadow: none; }
.conv-item .conv-ic { width: 16px; height: 16px; color: #7d86ad; flex-shrink: 0; }
.conv-group {
  font-size: 12px; font-weight: 600; color: #8b94b8;
  padding: 14px 12px 6px; letter-spacing: .3px;
}
.conv-item .conv-main { flex: 1; min-width: 0; }
.conv-item .conv-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-item .conv-sub { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 11px; color: #8b94b8; }
.conv-item .conv-more {
  opacity: 0; border: 0; background: transparent; cursor: pointer; color: #a0a8c8;
  width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: all .18s ease;
}
.conv-item:hover .conv-more { opacity: 1; }
.conv-item .conv-more:hover { color: var(--ink); background: #e8eaf4; }
.conv-more svg { width: 16px; height: 16px; }

.tag { font-size: 10px; padding: 2px 7px; border-radius: 999px; font-weight: 700; color: #fff; }
.tag.flash { background: #8b9dff; }
.tag.pro { background: #7c3aed; }

.side-foot { padding-top: 12px; }
.user-card {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 15px;
  background: #ffffff; border: 1px solid #e3e5f3;
}
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; color: #fff; letter-spacing: 0;
  background: #7c3aed;
  box-shadow: none;
}
.avatar.sm { width: 26px; height: 26px; font-size: 12px; }
.user-meta { flex: 1; min-width: 0; }
.user-name { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quota-line { margin-top: 5px; }
.quota-text { font-size: 11px; color: #7d86ad; }
.quota-bar { height: 5px; border-radius: 4px; background: rgba(109,91,208,.16); margin-top: 4px; overflow: hidden; }
.quota-bar i { display: block; height: 100%; border-radius: 4px; width: 100%;
  background: #7c3aed; transition: width .6s ease; }
.logout {
  border: 0; background: transparent; cursor: pointer; color: #98a1c4;
  width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  transition: all .18s ease; flex-shrink: 0;
}
.logout:hover { color: #d64545; background: rgba(214,69,69,.1); }
.logout svg { width: 16px; height: 16px; }

/* ---------- 主区 ---------- */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; position: relative; padding: 0 24px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 14px; border-radius: 18px; z-index: 30; flex-shrink: 0;
}
.icon-btn {
  width: 28px; height: 28px; border-radius: 8px; border: 1px solid #e3e5f3;
  background: #ffffff; cursor: pointer; color: var(--ink-soft);
  display: none; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.icon-btn svg { width: 14px; height: 14px; }
.icon-btn:hover { background: #eef0fb; color: var(--ink); }
.top-center { display: flex; align-items: center; gap: 10px; }

.picker { position: relative; }
.picker-btn {
  display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px;
  border-radius: 8px; border: 1px solid #e3e5f3; cursor: pointer;
  background: #ffffff; color: var(--ink-soft); font-size: 12px; font-weight: 600;
  font-family: inherit; transition: all .2s ease;
}
.picker-btn:hover { background: #eef0fb; color: var(--ink); }
.picker.open .picker-btn { background: #f0eefe; color: var(--accent); box-shadow: 0 0 0 2px rgba(124,58,237,.12); }
.picker-btn .chev { width: 12px; height: 12px; color: #8b94b8; transition: transform .25s ease; }
.picker.open .chev { transform: rotate(180deg); }
.model-badge {
  font-size: 10px; font-weight: 700; padding: 1.5px 6px; border-radius: 999px; color: #fff;
  background: #8b9dff; letter-spacing: .3px;
}
.model-badge.pro { background: #7c3aed; }
.bolt { width: 13px; height: 13px; color: #93a5ff; }

/* 联网搜索开关 */
.search-toggle {
  display: flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px;
  border-radius: 8px; border: 1px solid #e3e5f3; cursor: pointer;
  background: #ffffff; color: var(--ink-soft); font-size: 12px; font-weight: 600;
  font-family: inherit; transition: all .2s ease;
}
.search-toggle .globe { width: 13px; height: 13px; color: #98a1c4; }
.search-toggle .search-count { font-size: 10px; color: #b6bdda; font-weight: 600; }
.search-toggle:hover { background: #eef0fb; color: var(--ink); }
.search-toggle.on { background: #f0eefe; border-color: rgba(124,58,237,.45); color: var(--accent); }
.search-toggle.on .globe { color: var(--accent); }
.search-toggle.off { opacity: .45; cursor: not-allowed; }
.search-toggle.off:hover { background: #ffffff; }

.picker-pop {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  min-width: 260px; padding: 8px; z-index: 60;
  animation: popIn .2s ease;
}
@keyframes popIn { from { opacity: 0; transform: translateX(-50%) translateY(-6px) scale(.98); } to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } }
.pick-opt {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px;
  border: 0; background: transparent; border-radius: 12px; cursor: pointer; text-align: left;
  font-family: inherit; transition: all .15s ease;
}
.pick-opt:hover { background: rgba(124,58,237,.1); }
.pick-opt.active { background: rgba(124,58,237,.14); box-shadow: inset 0 0 0 1px rgba(124,58,237,.25); }
.pick-opt .pk-name { font-size: 14px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.pick-opt .pk-desc { font-size: 12px; color: #7d86ad; margin-top: 3px; }
.pick-opt .pk-check { margin-left: auto; color: var(--accent); opacity: 0; transition: opacity .15s; }
.pick-opt.active .pk-check { opacity: 1; }
.pick-opt .pk-check svg { width: 17px; height: 17px; }
.pick-sep { height: 1px; margin: 6px 8px; background: rgba(109,91,208,.18); }

.chip-user {
  display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; border-radius: 999px;
  background: #ffffff; border: 1px solid #e3e5f3; font-size: 13px; font-weight: 650;
}

/* ---------- 消息区 ---------- */
.messages {
  flex: 1;
  min-height: 0; /* 关键：允许 flex 子项收缩，overflow-y 才会真正生效 */
  overflow-y: auto; padding: 12px 0 10px; scroll-behavior: smooth;
  display: flex; flex-direction: column; align-items: center;
}
.messages-inner { width: 100%; max-width: 820px; display: flex; flex-direction: column; gap: 26px; }

.msg { display: flex; gap: 12px; width: 100%; animation: msgIn .3s ease; }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.msg.user { justify-content: flex-end; }
.msg .msg-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: #f0f1fb; box-shadow: none;
}
.msg .msg-avatar svg { width: 20px; height: 20px; }
.msg.user .msg-avatar { background: #eef4ff; box-shadow: none; }
.msg.user .msg-avatar svg { width: 16px; height: 16px; }

.msg-body { max-width: min(78%, 640px); min-width: 0; }
.msg.user .msg-body { display: flex; flex-direction: column; align-items: flex-end; }

.msg-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.msg.user .msg-meta { justify-content: flex-end; }
.msg-author { font-size: 13px; font-weight: 750; color: var(--ink); }
.msg.ai .msg-author { color: #37338f; }
.msg-tags { display: flex; gap: 6px; }
.msg-tag {
  font-size: 10.5px; padding: 2px 9px; border-radius: 999px; font-weight: 700;
  background: #f0f1fb; color: #6b7299; border: 1px solid #e3e5f3;
}
.msg-tag.tokens { color: #6d28d9; background: rgba(124,58,237,.1); border-color: rgba(124,58,237,.25); }

.bubble {
  padding: 14px 18px; border-radius: 18px; font-size: 14.5px; line-height: 1.78;
  overflow-wrap: break-word; word-break: break-word;
}
.msg.user .bubble {
  background: #7c3aed;
  color: #fff;
  border: 0;
  border-radius: 18px;
  border-bottom-right-radius: 4px;
  box-shadow: none;
}
.msg.ai .bubble {
  background: transparent;
  border: 0;
  border-bottom-left-radius: 0;
  box-shadow: none;
  padding-left: 0;
}

/* 思考状态条（不展示思考过程，用加载动画代替） */
.thinking {
  margin-bottom: 10px; border-radius: 12px; overflow: hidden;
  background: #f0eefe; border: 1px solid #dfdcf7;
}
.thinking-status {
  display: flex; align-items: center; gap: 9px; padding: 9px 13px;
  color: #6b7299; font-size: 12.5px; font-weight: 650;
}
.thinking-status .tt-ic { width: 15px; height: 15px; color: #93a5ff; flex-shrink: 0; }
.thinking-status .tt-state { color: #93a5ff; }
.thinking-status .tt-dur { color: #7d86ad; font-weight: 600; }
.typing-dots { display: inline-flex; gap: 4px; align-items: center; margin-left: 2px; }
.typing-dots i { width: 5px; height: 5px; border-radius: 50%; background: #93a5ff; animation: blink 1.2s infinite; }
.typing-dots i:nth-child(2) { animation-delay: .2s; }
.typing-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }

/* 流式光标 */
.stream-caret { display: inline-block; width: 8px; height: 16px; border-radius: 2px; margin-left: 2px; vertical-align: -2px;
  background: #7c3aed; animation: caretBlink .8s steps(1) infinite; }
@keyframes caretBlink { 50% { opacity: 0; } }

.msg-actions { display: flex; gap: 4px; margin-top: 8px; opacity: 0; transition: opacity .2s; }
.msg:hover .msg-actions { opacity: 1; }
.msg-actions button {
  border: 1px solid #e3e5f3; background: #ffffff; cursor: pointer;
  color: #7d86ad; width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  transition: all .18s ease;
}
.msg-actions button:hover { color: var(--accent); background: #eef0fb; }
.msg-actions button svg { width: 14px; height: 14px; }

.msg-error { width: 100%; padding: 13px 17px; border-radius: 16px; font-size: 13.5px; color: #c33;
  background: rgba(255,214,214,.55); border: 1px solid rgba(214,69,69,.3); }

/* ---------- Markdown 内容 ---------- */
.md-body { font-size: 14.5px; line-height: 1.78; }
.md-body p { margin: .45em 0; }
.md-body h1, .md-body h2, .md-body h3, .md-body h4 { margin: 1em 0 .5em; line-height: 1.4; font-weight: 750; }
.md-body h1 { font-size: 1.35em; } .md-body h2 { font-size: 1.2em; } .md-body h3 { font-size: 1.08em; }
.md-body ul, .md-body ol { margin: .45em 0; padding-left: 1.5em; }
.md-body li { margin: .25em 0; }
.md-body code { font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; font-size: .88em;
  background: rgba(124,58,237,.1); color: #6d5bd0; padding: .12em .4em; border-radius: 6px; }
.md-body a { color: #7c3aed; text-decoration: none; border-bottom: 1px solid rgba(124,58,237,.35); }
.md-body a:hover { border-bottom-color: #7c3aed; }
.md-body blockquote { margin: .6em 0; padding: .5em 1em; border-left: 3px solid #7c3aed;
  background: rgba(124,58,237,.07); border-radius: 0 10px 10px 0; color: #6d5bd0; }
.md-body hr { margin: 1.1em 0; border: 0; height: 1px; background: rgba(109,91,208,.25); }
.md-body strong { font-weight: 750; }
.md-table-wrap { overflow-x: auto; margin: .6em 0; border-radius: 12px; border: 1px solid rgba(109,91,208,.18); }
.md-body table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.md-body th { background: rgba(124,58,237,.1); font-weight: 700; }
.md-body th, .md-body td { padding: 8px 14px; border-bottom: 1px solid rgba(109,91,208,.14); text-align: left; }
.md-body tr:last-child td { border-bottom: 0; }

.code-block { margin: .7em 0; border-radius: 14px; overflow: hidden;
  background: rgba(28,35,64,.86); border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 12px 30px -14px rgba(20,28,66,.5); }
.code-head { display: flex; align-items: center; justify-content: space-between; padding: 7px 14px;
  background: rgba(255,255,255,.06); border-bottom: 1px solid rgba(255,255,255,.08); }
.code-lang { font-size: 11px; color: rgba(255,255,255,.55); font-family: "SF Mono", ui-monospace, Menlo, monospace; text-transform: lowercase; }
.copy-btn {
  border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: rgba(255,255,255,.75);
  font-size: 11px; padding: 3px 10px; border-radius: 8px; cursor: pointer; font-family: inherit; transition: all .18s ease;
}
.copy-btn:hover { background: rgba(255,255,255,.16); color: #fff; }
.copy-btn.copied { color: #8b9dff; border-color: rgba(34,193,168,.5); }
.code-block pre { padding: 13px 15px; overflow-x: auto; }
.code-block code { font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; font-size: 12.8px; line-height: 1.65; color: #e8e6ff; background: transparent; padding: 0; }

/* ---------- 空状态 ---------- */
.empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 20px; }
.empty .logo { animation: none; }
.empty h1 { font-size: 30px; font-weight: 800; margin-top: 16px; letter-spacing: .5px; color: var(--ink); }
.empty h1 .grad { color: var(--accent); background: none; -webkit-background-clip: initial; background-clip: initial; }
.empty p.sub { color: var(--ink-soft); font-size: 14px; }
.suggest { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 26px; width: min(560px, 92%); }
.suggest button {
  padding: 14px 16px; border-radius: 15px; border: 1px solid #e3e5f3; cursor: pointer;
  background: #ffffff; color: var(--ink); font-size: 13.5px; font-family: inherit; text-align: left;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  transition: all .2s ease; line-height: 1.6;
}
.suggest button:hover { background: #eef0fb; }
.suggest button b { display: block; font-size: 14px; margin-bottom: 3px; }
.suggest button span { color: var(--ink-soft); font-size: 12px; }

/* ---------- 输入区 ---------- */
.composer-wrap { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; padding: 8px 0 0; }
.composer {
  width: 100%; max-width: 820px; border-radius: 24px; padding: 12px 14px 10px;
  background: #ffffff; border: 1px solid #e3e5f3;
  box-shadow: 0 1px 4px rgba(0,0,0,.03);
  transition: border-color .25s ease, box-shadow .25s ease;
}
.composer:focus-within { border-color: #7c3aed; box-shadow: 0 0 0 1px rgba(124,58,237,.25); }
#input {
  width: 100%; border: 0; outline: 0; background: transparent; resize: none;
  font-family: inherit; font-size: 15px; line-height: 1.65; color: var(--ink);
  max-height: 200px; min-height: 26px;
}
#input::placeholder { color: #a4acc9; }
.composer-bar { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.composer-left { display: flex; align-items: center; gap: 10px; }
.quota-hint { font-size: 11.5px; color: #7d86ad; }
.composer-right { display: flex; align-items: center; gap: 12px; }
.disclaimer { font-size: 11px; color: #9aa3c2; }
.send-btn {
  width: 38px; height: 38px; border-radius: 13px; border: 0; cursor: pointer;
  background: #7c3aed; color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: all .22s ease;
}
.send-btn svg { width: 17px; height: 17px; margin-left: 1px; }
.send-btn:hover:not(:disabled) { background: #6d28d9; }
.send-btn.disabled, .send-btn:disabled { background: #e4e6f0; color: #aab0c8; cursor: not-allowed; opacity: 1; }
.send-btn.stop { background: #e04a42; }
.send-btn.stop:hover:not(:disabled) { background: #c93a33; }
.foot-note { font-size: 11px; color: #a4acc9; margin: 9px 0 4px; text-align: center; }

/* ---------- 登录浮层 ---------- */
.login-cover {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: rgba(238,240,251,.92);
  animation: fadeIn .3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.login-cover.hidden { display: none; }
.login-card {
  border-radius: 26px; padding: 44px 52px; text-align: center; max-width: 420px;
  animation: cardIn .4s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
.login-card h2 { margin-top: 18px; font-size: 24px; font-weight: 800; }
.login-card p { margin-top: 10px; color: var(--ink-soft); font-size: 14px; line-height: 1.7; }
.primary-link {
  display: inline-block; margin-top: 24px; padding: 13px 34px; border-radius: 15px; text-decoration: none;
  color: #fff; font-weight: 700; font-size: 15px;
  background: #7c3aed;
  transition: all .25s ease;
}
.primary-link:hover { background: #6d28d9; }

/* ---------- 提示 toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 120;
  padding: 11px 20px; border-radius: 13px; font-size: 13.5px; white-space: nowrap;
  background: #ffffff; border: 1px solid #e3e5f3;
  box-shadow: 0 4px 14px rgba(0,0,0,.1);
  box-shadow: 0 10px 30px rgba(84,58,237,.22); color: var(--ink);
  animation: toastIn .3s ease;
}
.toast.err { color: #d64545; }
.toast.ok { color: #0f9d76; }
.toast.hidden { display: none; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(109,91,208,.28); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(109,91,208,.45); }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr !important; padding: 8px; }
  .sidebar { position: fixed; left: 8px; top: 8px; bottom: 8px; width: 280px; z-index: 90;
    transform: translateX(-120%); transition: transform .3s ease; }
  .sidebar.open { transform: none; }
  .topbar { z-index: 100; }   /* 让左上角三条杠按钮始终在侧栏之上，可再次点击收起 */
  .icon-btn { display: flex; }
  .disclaimer { display: none; }
  .msg-body { max-width: 88%; }
  .suggest { grid-template-columns: 1fr; }

  /* 窄屏输入框优化：全宽，底部功能按钮紧凑排列（隐藏次要文字，避免拥挤换行） */
  .composer { max-width: 100%; }
  .composer-left { gap: 6px; }
  .composer-left .picker-btn, .composer-left .search-toggle { padding: 0 8px; }
  /* 窄屏隐藏长文字，只留关键信息，让按钮一行排下 */
  #model-label, .search-label { display: none; }
  #think-label { display: none; }
  .search-count { display: inline; }
  .composer-right { margin-left: auto; }
  .quota-hint { display: none; }   /* 窄屏隐藏额度提示，减少拥挤 */
  .disclaimer { display: none; }
}

/* ---------- 移动端顶部操作栏（仅窄屏显示） ---------- */
.mobile-topbar {
  display: none;       /* 默认桌面端隐藏 */
}
.mobile-icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent;
  cursor: pointer; color: #5a628c;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .18s;
}
.mobile-icon-btn:hover { background: #f0f1fb; color: var(--ink); }
.mobile-icon-btn svg { width: 20px; height: 20px; }

@media (max-width: 900px) {
  /* 窄屏：显示顶部操作栏 */
  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px 0;
    flex-shrink: 0;
  }
  /* 窄屏：隐藏侧边栏内的新建对话按钮（因为右上角已有） */
  .sidebar .new-chat { display: none; }
}

/* ============ DeepSeek 风格输入框组件 ============ */
.pill-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border-radius: 999px; border: 1px solid #e3e5f3;
  background: #ffffff; color: #4b4f6d;
  font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all .18s ease;
}
.pill-btn .pill-ic { width: 14px; height: 14px; }
.pill-btn:hover { background: #f4f6fc; border-color: #d7dbe9; }
.pill-btn.think-on {
  background: #2b2e3a; color: #fff; border-color: #2b2e3a;
}
.pill-btn.think-on .pill-ic { color: #fff; }
.pill-btn.think-off { background: #f1f3f9; color: #6b7299; border-color: #e3e5f3; }
.pill-btn.search-on {
  background: #f0f1ff; color: #7c3aed; border-color: #d6d8ff;
}
.pill-btn.search-on:hover { background: #e9ebff; border-color: #c7c9ff; }
.pill-btn.search-off { background: #f4f6fc; color: #6b7299; border-color: #e3e5f3; }
.model-badge-pill {
  font-size: 11px; font-weight: 600; line-height: 1; padding: 2px 6px; border-radius: 6px;
}
.model-badge-pill.flash { color: #12a879; background: #e6f7f0; }
.model-badge-pill.pro { color: #5b7cfa; background: #eaf0ff; }

.round-icon {
  width: 34px; height: 34px; border-radius: 50%;
  background: transparent; border: 0; color: #6b7299;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .18s;
}
.round-icon:hover { background: #f4f6fc; color: var(--ink); }
.round-icon svg { width: 18px; height: 18px; }

/* 发送按钮：圆 FAB */
.send-fab {
  width: 34px; height: 34px; border-radius: 50%;
  background: #7c3aed; color: #fff;
  border: 0; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .18s, opacity .18s;
}
.send-fab svg { width: 18px; height: 18px; }
.send-fab:hover:not(:disabled) { background: #6d28d9; }
.send-fab.disabled, .send-fab:disabled { background: #e4e6f0; color: #aab0c8; cursor: not-allowed; }
.send-fab.stop { background: #e04a42; color: #fff; }
.send-fab.stop:hover:not(:disabled) { background: #c93a33; }

/* 顶部 toolbar 调整 */
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 24px; border-bottom: 1px solid #f0f2f8;
  background: #ffffff; min-height: 50px;
}
.topbar .quota-hint { margin-left: auto; font-size: 12.5px; color: #6b7299; }
.topbar .picker-btn { padding: 6px 12px; }
.topbar .picker-btn #think-label { display: inline; }

/* ============ 侧边栏折叠 + 浮窗 ============ */
.side-head-main { flex: 1; min-width: 0; }
.collapse-btn {
  width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent;
  cursor: pointer; color: #98a1c4; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all .18s ease;
}
.collapse-btn:hover { background: #f0f1fb; color: var(--ink); }
.collapse-btn svg { width: 17px; height: 17px; }

/* 收起状态：侧边栏隐藏（由 JS 内联样式控制） */
/* .app.side-collapsed 不再使用 */

/* 浮窗：主区域左上角胶囊 */
.float-bar {
  position: fixed; top: 16px; left: 16px; z-index: 60;
  display: flex; align-items: center; gap: 2px;
  background: #ffffff; border: 1px solid #e3e5f3; border-radius: 999px;
  padding: 4px; box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.float-bar.hidden { display: none; }
.float-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent;
  cursor: pointer; color: #5a628c; display: flex; align-items: center; justify-content: center;
  transition: background .18s;
}
.float-btn:hover { background: #f0f1fb; color: var(--ink); }
.float-btn svg { width: 18px; height: 18px; }
