/* ============================================================
   DS 页 — DeepSeek 网页复刻样式
   设计令牌取自官方 chat.deepseek.com CSS
   ============================================================ */

/* ---------- 字体 ---------- */
@font-face {
  font-family: "Inter";
  src: url("./fonts/Inter-Regular-subset.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("./fonts/Inter-Medium-subset.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("./fonts/Inter-SemiBold-subset.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("./fonts/Inter-Bold-subset.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("./fonts/Inter-Italic-subset.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* ---------- 设计令牌 ---------- */
:root {
  --brand: #3964fe;
  --brand-hover: #5686fe;
  --brand-soft: #edf3fe;
  --bg: #ffffff;
  --sidebar-bg: #f9fafb;
  --layer: #f5f6f7;
  --layer-2: #eef0f2;
  --border: rgba(0, 0, 0, 0.1);
  --border-soft: rgba(0, 0, 0, 0.06);
  --text: #0f1115;
  --secondary: #61666b;
  --tertiary: #81858c;
  --user-bubble: #edf3fe;
  --input-bg: #ffffff;
  --hover: rgba(38, 49, 72, 0.06);
  --code-bg: #f5f6f7;
  --code-head: #eceef0;
  --inline-code: #eef0f2;
  --input-shadow: 0 2px 10px rgba(15, 17, 21, 0.04);
  --shadow-1: 0 1px 2px rgba(72, 104, 178, 0.02), 0 2px 8px rgba(106, 111, 117, 0.08);
  --shadow-2: 0 16px 48px rgba(15, 17, 21, 0.16);
  --toast-bg: rgba(15, 17, 21, 0.9);
  --mask: rgba(15, 17, 21, 0.42);
  --danger: #dd3b41;
  --danger-soft: rgba(221, 59, 65, 0.08);
  --scrollbar: rgba(0, 0, 0, 0.16);
  --selection: rgba(57, 100, 254, 0.18);
  --stop-bg: #0f1115;
  --stop-fg: #ffffff;
  --font: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --code-font: "SFMono-Regular", Menlo, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", monospace;
  color-scheme: light;
}

[data-theme="dark"] {
  --brand: #3964fe;
  --brand-hover: #5686fe;
  --brand-soft: #283142;
  --bg: #151517;
  --sidebar-bg: #1b1b1c;
  --layer: #232324;
  --layer-2: #2a2a2c;
  --border: rgba(255, 255, 255, 0.1);
  --border-soft: rgba(255, 255, 255, 0.06);
  --text: #f9fafb;
  --secondary: #adb2b8;
  --tertiary: #81858c;
  --user-bubble: #283142;
  --input-bg: #1b1b1c;
  --hover: rgba(255, 255, 255, 0.08);
  --code-bg: #232324;
  --code-head: #2a2a2c;
  --inline-code: #2c2c2e;
  --input-shadow: 0 2px 14px rgba(0, 0, 0, 0.3);
  --shadow-1: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-2: 0 16px 48px rgba(0, 0, 0, 0.55);
  --toast-bg: rgba(44, 44, 46, 0.96);
  --mask: rgba(0, 0, 0, 0.62);
  --danger: #f25a5a;
  --danger-soft: rgba(242, 90, 90, 0.14);
  --scrollbar: rgba(255, 255, 255, 0.18);
  --selection: rgba(57, 100, 254, 0.32);
  --stop-bg: #f9fafb;
  --stop-fg: #151517;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --brand: #3964fe;
    --brand-hover: #5686fe;
    --brand-soft: #283142;
    --bg: #151517;
    --sidebar-bg: #1b1b1c;
    --layer: #232324;
    --layer-2: #2a2a2c;
    --border: rgba(255, 255, 255, 0.1);
    --border-soft: rgba(255, 255, 255, 0.06);
    --text: #f9fafb;
    --secondary: #adb2b8;
    --tertiary: #81858c;
    --user-bubble: #283142;
    --input-bg: #1b1b1c;
    --hover: rgba(255, 255, 255, 0.08);
    --code-bg: #232324;
    --code-head: #2a2a2c;
    --inline-code: #2c2c2e;
    --input-shadow: 0 2px 14px rgba(0, 0, 0, 0.3);
    --shadow-1: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-2: 0 16px 48px rgba(0, 0, 0, 0.55);
    --toast-bg: rgba(44, 44, 46, 0.96);
    --mask: rgba(0, 0, 0, 0.62);
    --danger: #f25a5a;
    --danger-soft: rgba(242, 90, 90, 0.14);
    --scrollbar: rgba(255, 255, 255, 0.18);
    --selection: rgba(57, 100, 254, 0.32);
    --stop-bg: #f9fafb;
    --stop-fg: #151517;
    color-scheme: dark;
  }
}

/* ---------- 基础 ---------- */
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}
#app {
  height: 100%;
}
[hidden] {
  display: none !important;
}
button {
  font-family: inherit;
}
input,
textarea {
  font-family: inherit;
}
::selection {
  background: var(--selection);
}
a {
  color: var(--brand);
}
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--scrollbar);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--tertiary);
  border: 2px solid transparent;
  background-clip: content-box;
}

.icon {
  display: block;
  flex: 0 0 auto;
}

/* ---------- 布局 ---------- */
.app {
  display: flex;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}
.main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg);
}

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: 260px;
  flex: 0 0 260px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-soft);
  transition: width 0.2s ease, flex-basis 0.2s ease;
  z-index: 30;
}
.sb-head {
  height: 56px;
  flex: 0 0 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 18px;
}
.sb-logo {
  display: inline-flex;
  align-items: center;
  height: 24px;
  text-decoration: none;
}
.sb-logo img {
  height: 23px;
  width: auto;
  display: block;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--secondary);
  cursor: pointer;
  flex: 0 0 auto;
  transition: background 0.15s ease, color 0.15s ease;
}
.icon-btn:hover {
  background: var(--hover);
  color: var(--text);
}
.sb-collapse {
  width: 30px;
  height: 30px;
  color: var(--tertiary);
}
.sb-actions {
  padding: 4px 12px 8px;
}
.new-chat {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  text-align: left;
}
.new-chat:hover {
  background: var(--hover);
}
.new-chat .icon {
  color: var(--secondary);
}
.convo-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 8px 8px;
  -webkit-overflow-scrolling: touch;
}
.convo-empty {
  font-size: 13px;
  color: var(--tertiary);
  text-align: center;
  padding: 24px 8px;
}
.convo-group-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--tertiary);
  padding: 14px 10px 5px;
  user-select: none;
  letter-spacing: 0.01em;
}
.convo-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 1px 0;
  padding: 8px 8px 8px 10px;
  border-radius: 9px;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
  outline: none;
}
.convo-item:hover {
  background: var(--hover);
}
.convo-item.active {
  background: var(--brand-soft);
  color: var(--brand);
}
[data-theme="dark"] .convo-item.active {
  background: rgba(57, 100, 254, 0.18);
  color: #9dbcff;
}
.convo-item:focus-visible {
  box-shadow: inset 0 0 0 2px var(--brand);
}
.convo-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 20px;
}
.convo-more {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  color: var(--tertiary);
  opacity: 0;
  transition: opacity 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.convo-item:hover .convo-more,
.convo-item.active .convo-more {
  opacity: 1;
}
.convo-more:hover {
  background: var(--hover);
  color: var(--text);
}
.sb-bottom {
  flex: 0 0 auto;
  padding: 8px;
  border-top: 1px solid var(--border-soft);
}
.sb-bottom-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}
.sb-bottom-btn:hover {
  background: var(--hover);
}
.sb-bottom-btn .icon {
  color: var(--secondary);
}
.user-area {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 10px;
  min-width: 0;
}
.user-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3964fe, #6a8dff);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  user-select: none;
}
.user-meta {
  flex: 1;
  min-width: 0;
}
.user-name {
  display: block;
  font-size: 14px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.logout-btn {
  width: 30px;
  height: 30px;
  color: var(--tertiary);
}
.sb-mask {
  display: none;
}

/* ---------- 折起状态 ---------- */
.app.collapsed .sidebar {
  width: 64px;
  flex-basis: 64px;
}
.app.collapsed .sb-head {
  justify-content: center;
  padding: 0;
}
.app.collapsed .sb-logo {
  display: none;
}
.app.collapsed .sb-actions {
  padding: 0 8px 8px;
}
.app.collapsed .new-chat {
  justify-content: center;
  padding: 9px 0;
}
.app.collapsed .new-chat span {
  display: none;
}
.app.collapsed .convo-scroll {
  display: none;
}
.app.collapsed .sb-bottom {
  display: flex;
  justify-content: center;
}
.app.collapsed .sb-bottom-btn {
  justify-content: center;
  padding: 9px 0;
}
.app.collapsed .sb-bottom-btn span {
  display: none;
}
.app.collapsed .user-area {
  flex-direction: column;
  gap: 6px;
  padding: 4px;
}
.app.collapsed .user-meta {
  display: none;
}
.app.collapsed .logout-btn {
  width: 30px;
}

/* ---------- 顶栏 ---------- */
.topbar {
  height: 56px;
  flex: 0 0 56px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 0 16px 0 12px;
  position: relative;
  z-index: 10;
}
.menu-btn {
  display: none;
  grid-column: 1;
  justify-self: start;
}
.topbar-title {
  grid-column: 2;
  justify-self: center;
  max-width: min(60vw, 460px);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 8px;
}
.topbar-right {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}
.model-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--layer);
  color: var(--secondary);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
}
.model-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px rgba(57, 100, 254, 0.12);
  flex: 0 0 auto;
}

/* ---------- 内容区 ---------- */
.content {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}
.scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  outline: none;
  scroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
}
.scroll-inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 24px 24px 8px;
  min-height: 100%;
}
.scroll-inner.is-welcome {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px 7vh;
}
.scroll-bottom {
  position: fixed;
  right: max(16px, calc(50vw - 410px));
  bottom: 148px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-1);
  z-index: 12;
  transition: background 0.15s ease, color 0.15s ease;
}
.scroll-bottom:hover {
  background: var(--layer);
  color: var(--text);
}

/* ---------- 欢迎页 ---------- */
.welcome {
  width: 100%;
  max-width: 820px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 0;
}
.welcome-icon {
  width: 64px;
  height: 64px;
  display: block;
  user-select: none;
}
.welcome-title {
  margin: 18px 0 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.welcome-sub {
  margin: 10px 0 0;
  max-width: 560px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--secondary);
}
.welcome-composer {
  width: 100%;
  margin-top: 34px;
}

/* ---------- 消息 ---------- */
.message-list {
  padding-bottom: 16px;
}
.msg {
  margin-bottom: 24px;
}
.msg:last-child {
  margin-bottom: 8px;
}
.msg-user {
  display: flex;
  justify-content: flex-end;
  padding-left: 15%;
}
.msg-user .bubble {
  max-width: 100%;
  background: var(--user-bubble);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 16px 16px 4px 16px;
  font-size: 15px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.msg-assistant {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.assistant-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 9px;
  background: var(--brand-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  overflow: hidden;
}
.assistant-avatar img {
  width: 22px;
  height: 22px;
  display: block;
}
[data-theme="dark"] .assistant-avatar {
  background: rgba(57, 100, 254, 0.16);
}
.msg-body {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
  font-size: 15px;
  line-height: 1.75;
}
.msg-error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  line-height: 1.6;
}
.msg-error .icon {
  margin-top: 2px;
  flex: 0 0 auto;
}
.msg-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.msg-assistant:hover .msg-actions,
.msg-assistant:focus-within .msg-actions,
.msg-actions.always-visible {
  opacity: 1;
}
.msg-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--tertiary);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.msg-action:hover {
  background: var(--hover);
  color: var(--text);
}
.msg-status {
  font-size: 12px;
  color: var(--tertiary);
  margin-right: 4px;
}
@media (hover: none) {
  .msg-actions {
    opacity: 1;
  }
}

/* ---------- Markdown ---------- */
.markdown {
  font-size: 15px;
  line-height: 1.75;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.markdown > *:first-child {
  margin-top: 0;
}
.markdown > *:last-child {
  margin-bottom: 0;
}
.markdown p {
  margin: 0 0 12px;
}
.markdown h1,
.markdown h2,
.markdown h3,
.markdown h4,
.markdown h5,
.markdown h6 {
  margin: 22px 0 10px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}
.markdown h1 {
  font-size: 22px;
}
.markdown h2 {
  font-size: 20px;
}
.markdown h3 {
  font-size: 17px;
}
.markdown h4 {
  font-size: 15.5px;
}
.markdown h5,
.markdown h6 {
  font-size: 15px;
}
.markdown ul,
.markdown ol {
  margin: 0 0 12px;
  padding-left: 24px;
}
.markdown li {
  margin: 4px 0;
}
.markdown li > p {
  margin: 0 0 6px;
}
.markdown a {
  color: var(--brand);
  text-decoration: none;
}
.markdown a:hover {
  text-decoration: underline;
}
.markdown strong {
  font-weight: 600;
}
.markdown blockquote {
  margin: 0 0 12px;
  padding: 2px 0 2px 14px;
  border-left: 3px solid var(--border);
  color: var(--secondary);
}
.markdown hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}
.markdown img {
  max-width: 100%;
  border-radius: 8px;
}
.markdown code:not(pre code) {
  background: var(--inline-code);
  border-radius: 5px;
  padding: 1px 5px;
  font-family: var(--code-font);
  font-size: 13px;
  color: var(--text);
}
.markdown .table-wrap {
  overflow-x: auto;
  margin: 0 0 14px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
}
.markdown table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}
.markdown th,
.markdown td {
  border-bottom: 1px solid var(--border-soft);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}
.markdown th {
  background: var(--layer);
  font-weight: 500;
}
.markdown tr:last-child td {
  border-bottom: none;
}
.citation-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  margin: 0 2px;
  border-radius: 5px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  vertical-align: 2px;
  transition: background 0.15s ease;
}
.citation-chip:hover {
  background: #dbe7ff;
  text-decoration: none;
}
[data-theme="dark"] .citation-chip {
  background: rgba(57, 100, 254, 0.22);
  color: #9dbcff;
}
[data-theme="dark"] .citation-chip:hover {
  background: rgba(57, 100, 254, 0.34);
}

/* ---------- LaTeX 公式（KaTeX） ---------- */
.markdown .math-inline {
  display: inline-block;
  max-width: 100%;
  vertical-align: baseline;
}
.markdown .math-inline .katex {
  font-size: 1.02em;
}
.markdown .math-display {
  display: block;
  width: 100%;
  margin: 10px 0;
  padding: 4px 2px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
.markdown .math-display .katex-display {
  margin: 0;
  text-align: left;
}
.markdown .math-display .katex {
  font-size: 1.08em;
  white-space: nowrap;
}
.markdown .katex {
  color: var(--text);
  overflow-wrap: normal;
  word-break: normal;
}
.markdown .katex-display {
  overflow: visible;
}
.markdown .katex-error {
  color: var(--danger);
  font-family: var(--code-font);
  font-size: 0.92em;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- 代码块 ---------- */
.code-block {
  margin: 0 0 14px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  background: var(--code-bg);
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 6px 14px;
  background: var(--code-head);
  color: var(--secondary);
  min-height: 32px;
}
.code-lang {
  font-family: var(--code-font);
  font-size: 12px;
  color: var(--secondary);
  text-transform: lowercase;
  user-select: none;
}
.code-copy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--secondary);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.code-copy:hover {
  background: var(--hover);
  color: var(--text);
}
.code-block pre {
  margin: 0;
  padding: 14px 16px;
  overflow: auto;
  background: transparent;
  border-radius: 0;
}
.code-block pre code {
  display: block;
  font-family: var(--code-font);
  font-size: 13px;
  line-height: 1.65;
  background: transparent;
  padding: 0;
  color: var(--text);
  white-space: pre;
}

/* ---------- highlight.js 主题 ---------- */
.hljs-comment,
.hljs-quote {
  color: #7d8590;
  font-style: italic;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-type,
.hljs-name {
  color: #cf222e;
}
.hljs-string,
.hljs-attr,
.hljs-symbol,
.hljs-bullet,
.hljs-addition,
.hljs-template-tag,
.hljs-template-variable,
.hljs-regexp {
  color: #0a3069;
}
.hljs-number {
  color: #0550ae;
}
.hljs-title,
.hljs-section,
.hljs-title.function_,
.hljs-title.class_ {
  color: #8250df;
}
.hljs-variable,
.hljs-attribute,
.hljs-params {
  color: #953800;
}
.hljs-built_in,
.hljs-class .hljs-title {
  color: #0550ae;
}
.hljs-meta,
.hljs-meta .hljs-keyword {
  color: #6e7781;
}
.hljs-doctag {
  color: #cf222e;
}
.hljs-tag {
  color: #116329;
}
.hljs-selector-id,
.hljs-selector-class {
  color: #0550ae;
}
.hljs-deletion {
  color: #82071e;
  background: rgba(255, 129, 130, 0.12);
}
.hljs-emphasis {
  font-style: italic;
}
.hljs-strong {
  font-weight: 600;
}
[data-theme="dark"] .hljs-comment,
[data-theme="dark"] .hljs-quote {
  color: #8b949e;
}
[data-theme="dark"] .hljs-keyword,
[data-theme="dark"] .hljs-selector-tag,
[data-theme="dark"] .hljs-literal,
[data-theme="dark"] .hljs-type,
[data-theme="dark"] .hljs-name {
  color: #ff7b72;
}
[data-theme="dark"] .hljs-string,
[data-theme="dark"] .hljs-attr,
[data-theme="dark"] .hljs-symbol,
[data-theme="dark"] .hljs-bullet,
[data-theme="dark"] .hljs-addition,
[data-theme="dark"] .hljs-template-tag,
[data-theme="dark"] .hljs-template-variable,
[data-theme="dark"] .hljs-regexp {
  color: #a5d6ff;
}
[data-theme="dark"] .hljs-number {
  color: #79c0ff;
}
[data-theme="dark"] .hljs-title,
[data-theme="dark"] .hljs-section,
[data-theme="dark"] .hljs-title.function_,
[data-theme="dark"] .hljs-title.class_ {
  color: #d2a8ff;
}
[data-theme="dark"] .hljs-variable,
[data-theme="dark"] .hljs-attribute,
[data-theme="dark"] .hljs-params {
  color: #ffa657;
}
[data-theme="dark"] .hljs-built_in,
[data-theme="dark"] .hljs-class .hljs-title {
  color: #79c0ff;
}
[data-theme="dark"] .hljs-meta,
[data-theme="dark"] .hljs-meta .hljs-keyword {
  color: #8b949e;
}
[data-theme="dark"] .hljs-tag {
  color: #7ee787;
}
[data-theme="dark"] .hljs-selector-id,
[data-theme="dark"] .hljs-selector-class {
  color: #79c0ff;
}
[data-theme="dark"] .hljs-deletion {
  color: #ffdcd7;
  background: rgba(248, 81, 73, 0.2);
}

/* ---------- 思考块 ---------- */
.think-slot {
  margin: 0 0 10px;
}
.think-block {
  font-size: 13px;
}
.think-head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 10px 5px 8px;
  border: none;
  border-radius: 8px;
  background: var(--layer);
  color: var(--secondary);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.think-head:hover {
  background: var(--hover);
}
.think-icon {
  display: inline-flex;
  color: var(--tertiary);
}
.think-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.think-chevron {
  display: inline-flex;
  color: var(--tertiary);
  transition: transform 0.2s ease;
}
.think-block.open .think-chevron {
  transform: rotate(180deg);
}
.think-block.thinking .think-title {
  background: linear-gradient(90deg, var(--tertiary) 20%, var(--text) 48%, var(--tertiary) 75%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 1.6s linear infinite;
}
.think-body {
  margin: 10px 0 2px 2px;
  padding-left: 12px;
  border-left: 2px solid var(--border-soft);
  max-height: 340px;
  overflow: auto;
  color: var(--secondary);
  font-size: 13px;
  line-height: 1.7;
  -webkit-overflow-scrolling: touch;
}
.think-body .markdown {
  font-size: 13px;
  line-height: 1.7;
  color: var(--secondary);
}
.think-body .markdown code:not(pre code) {
  font-size: 12px;
}

/* ---------- 搜索卡片 ---------- */
.search-slot {
  margin: 0;
}
.search-card {
  margin: 0 0 14px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--layer);
  overflow: hidden;
  font-size: 13px;
}
.search-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--secondary);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}
.search-head:hover {
  background: var(--hover);
}
.search-head.static {
  cursor: default;
}
.search-head.static:hover {
  background: transparent;
}
.search-icon {
  display: inline-flex;
  color: var(--brand);
  flex: 0 0 auto;
}
.search-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-icons {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}
.search-icons .site-favicon {
  margin-left: -5px;
  border: 2px solid var(--layer);
  border-radius: 50%;
  background: var(--bg);
}
.search-icons .site-favicon:first-child {
  margin-left: 0;
}
.search-chevron {
  display: inline-flex;
  color: var(--tertiary);
  transition: transform 0.2s ease;
  flex: 0 0 auto;
}
.search-card.open .search-chevron {
  transform: rotate(180deg);
}
.search-body {
  display: none;
  border-top: 1px solid var(--border-soft);
  padding: 6px;
}
.search-card.open .search-body {
  display: block;
}
.search-card.is-searching .search-body {
  display: block;
  border-top: none;
  padding: 8px 10px 10px;
}
.search-pending-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 2px;
  color: var(--secondary);
  font-size: 12.5px;
  line-height: 1.5;
}
.search-pending-row .spinner {
  width: 12px;
  height: 12px;
}
.search-group {
  padding: 2px 0;
}
.search-group + .search-group {
  border-top: 1px solid var(--border-soft);
  margin-top: 4px;
  padding-top: 6px;
}
.search-group-title {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 2px;
  font-size: 12px;
  color: var(--tertiary);
  min-width: 0;
}
.search-group-icon {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--brand);
}
.search-group-label {
  flex: 0 0 auto;
}
.search-group-query {
  color: var(--secondary);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-group-empty {
  padding: 8px 10px;
  color: var(--tertiary);
  font-size: 12px;
}
.search-skipped-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 4px;
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--layer);
  color: var(--tertiary);
  font-size: 12.5px;
}
.search-skipped-hint .icon {
  color: var(--tertiary);
}
.search-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.source-item {
  display: flex;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
  transition: background 0.15s ease;
}
a.source-item:hover {
  background: var(--hover);
}
.source-main {
  flex: 1;
  min-width: 0;
}
.source-title-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.source-citation {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 5px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}
.source-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.source-meta {
  font-size: 12px;
  color: var(--tertiary);
  margin-top: 2px;
}
.source-summary {
  font-size: 12px;
  color: var(--secondary);
  line-height: 1.55;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.site-favicon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 4px;
  overflow: hidden;
  background: var(--layer-2);
  color: var(--secondary);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  margin-top: 1px;
}
.site-favicon img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--bg);
}
.spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
  flex: 0 0 auto;
}

/* ---------- 流式指示 ---------- */
.stream-cursor {
  display: inline-block;
  width: 7px;
  height: 16px;
  margin-left: 3px;
  border-radius: 2px;
  background: var(--brand);
  vertical-align: -2px;
  animation: blink 1s steps(2, start) infinite;
}
.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 2px;
}
.typing-indicator span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tertiary);
  animation: typing 1.2s ease-in-out infinite;
}
.typing-indicator span:nth-child(2) {
  animation-delay: 0.15s;
}
.typing-indicator span:nth-child(3) {
  animation-delay: 0.3s;
}

/* ---------- 输入区 ---------- */
.dock {
  flex: 0 0 auto;
  padding: 0 24px 14px;
  background: var(--bg);
  z-index: 8;
}
.composer {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
}
.composer-card {
  display: flex;
  flex-direction: column;
  padding: 13px 13px 9px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--input-shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.composer-card:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand), var(--input-shadow);
}
.composer-input {
  display: block;
  width: 100%;
  max-height: 200px;
  padding: 2px 6px 6px;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  resize: none;
}
.composer-input::placeholder {
  color: var(--tertiary);
}
.composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}
.composer-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}
.tool-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--secondary);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.tool-pill:hover {
  background: var(--hover);
  color: var(--text);
}
.tool-pill.active {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: rgba(57, 100, 254, 0.18);
}
[data-theme="dark"] .tool-pill.active {
  background: rgba(57, 100, 254, 0.18);
  color: #9dbcff;
  border-color: rgba(57, 100, 254, 0.32);
}
.tool-pill .icon {
  flex: 0 0 auto;
}
.composer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.attach-btn {
  width: 32px;
  height: 32px;
  color: var(--secondary);
}
.send-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
}
.send-btn:hover:not(:disabled) {
  background: var(--brand-hover);
}
.send-btn:active:not(:disabled) {
  transform: scale(0.94);
}
.send-btn:disabled {
  background: var(--layer-2);
  color: var(--tertiary);
  cursor: default;
}
.send-btn.stop {
  background: var(--stop-bg);
  color: var(--stop-fg);
}
.composer-hint {
  margin-top: 10px;
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  color: var(--tertiary);
  user-select: none;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translate(-50%, -14px);
  max-width: calc(100vw - 40px);
  padding: 9px 16px;
  border-radius: 10px;
  background: var(--toast-bg);
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 999;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- 弹窗 ---------- */
.modal-root {
  position: relative;
  z-index: 100;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--mask);
  opacity: 0;
  transition: opacity 0.15s ease;
  overflow-y: auto;
}
.modal-overlay.show {
  opacity: 1;
}
.modal {
  width: 100%;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: var(--bg);
  box-shadow: var(--shadow-2);
  transform: translateY(8px) scale(0.985);
  transition: transform 0.18s ease;
}
.modal-overlay.show .modal {
  transform: none;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 8px;
}
.modal-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.modal-close {
  width: 30px;
  height: 30px;
  color: var(--tertiary);
}
.modal-body {
  padding: 8px 20px 4px;
  overflow-y: auto;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px 18px;
}
.modal-text {
  margin: 4px 0 8px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--secondary);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, filter 0.15s ease;
}
.btn-primary {
  background: var(--brand);
  color: #fff;
}
.btn-primary:hover {
  background: var(--brand-hover);
}
.btn-ghost {
  border-color: var(--border);
  background: transparent;
  color: var(--secondary);
}
.btn-ghost:hover {
  background: var(--hover);
  color: var(--text);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  filter: brightness(1.06);
}
.form-row {
  margin-bottom: 18px;
}
.form-label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.text-input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.text-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(57, 100, 254, 0.12);
}
.form-hint {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--tertiary);
}
.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 9px;
  background: var(--layer);
}
.segmented button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--secondary);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.segmented button.active {
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow-1);
}
.cache-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.cache-head .form-label {
  margin-bottom: 0;
}
.cache-scope {
  font-size: 11.5px;
  color: var(--tertiary);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cache-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.cache-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--layer);
  min-width: 0;
}
.cache-num {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cache-label {
  font-size: 11.5px;
  color: var(--tertiary);
  line-height: 1.4;
}
.danger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
}
.danger-text {
  min-width: 0;
}
.danger-row .btn-danger {
  flex: 0 0 auto;
  height: 34px;
}

/* ---------- 会话右键菜单 ---------- */
.convo-menu {
  position: fixed;
  z-index: 200;
  min-width: 132px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  box-shadow: var(--shadow-2);
  animation: pop 0.12s ease;
}
.convo-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}
.convo-menu button:hover {
  background: var(--hover);
}
.convo-menu button.danger {
  color: var(--danger);
}
.convo-menu button.danger:hover {
  background: var(--danger-soft);
}

/* ---------- 登录 / 注册 ---------- */
.auth-page {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px 72px;
  background: var(--bg);
  overflow-y: auto;
}
.auth-top {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 5;
}
.auth-card {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.auth-logo img {
  height: 28px;
  width: auto;
  display: block;
}
.auth-title {
  margin: 30px 0 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  text-align: center;
}
.auth-sub {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--secondary);
  text-align: center;
}
.auth-form {
  width: 100%;
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.auth-label {
  font-size: 13px;
  color: var(--secondary);
}
.auth-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-input::placeholder {
  color: var(--tertiary);
}
.auth-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(57, 100, 254, 0.14);
}
.auth-error {
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  line-height: 1.5;
}
.auth-submit {
  height: 44px;
  margin-top: 2px;
  border: none;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.auth-submit:hover:not(:disabled) {
  background: var(--brand-hover);
}
.auth-submit:disabled {
  opacity: 0.6;
  cursor: default;
}
.auth-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 20px;
  font-size: 13px;
  color: var(--secondary);
}
.link-btn {
  padding: 2px 4px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--brand);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.link-btn:hover {
  background: var(--brand-soft);
}
.auth-foot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 18px;
  text-align: center;
  font-size: 12px;
  color: var(--tertiary);
  pointer-events: none;
}

/* ---------- 动画 ---------- */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}
@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
@keyframes typing {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}
@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ---------- 移动端 ---------- */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    flex-basis: 280px;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    z-index: 80;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.16);
  }
  .app.sidebar-open .sidebar {
    transform: translateX(0);
  }
  .app.collapsed .sidebar {
    width: 280px;
    flex-basis: 280px;
  }
  .app.collapsed .sb-logo,
  .app.collapsed .new-chat span,
  .app.collapsed .sb-bottom-btn span,
  .app.collapsed .user-meta {
    display: revert;
  }
  .app.collapsed .sb-head {
    justify-content: space-between;
    padding: 0 12px 0 18px;
  }
  .app.collapsed .convo-scroll {
    display: block;
  }
  .app.collapsed .new-chat {
    justify-content: flex-start;
    padding: 9px 12px;
  }
  .app.collapsed .sb-bottom-btn {
    justify-content: flex-start;
    padding: 9px 12px;
  }
  .app.collapsed .user-area {
    flex-direction: row;
    gap: 10px;
    padding: 7px 8px;
  }
  .sb-collapse {
    display: none;
  }
  .sb-mask {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: block;
    background: var(--mask);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .app.sidebar-open .sb-mask {
    opacity: 1;
    pointer-events: auto;
  }
  .menu-btn {
    display: inline-flex;
  }
  .topbar {
    padding: 0 10px;
    gap: 4px;
  }
  .topbar-title {
    max-width: 46vw;
    font-size: 15px;
  }
  .model-badge {
    height: 26px;
    padding: 0 8px;
    font-size: 11px;
  }
  .scroll-inner {
    padding: 14px 14px 8px;
  }
  .scroll-inner.is-welcome {
    padding: 0 14px 5vh;
  }
  .msg-user {
    padding-left: 8%;
  }
  .msg-assistant {
    gap: 10px;
  }
  .assistant-avatar {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    border-radius: 8px;
  }
  .assistant-avatar img {
    width: 19px;
    height: 19px;
  }
  .msg {
    margin-bottom: 22px;
  }
  .dock {
    padding: 0 12px calc(10px + env(safe-area-inset-bottom));
  }
  .composer-card {
    border-radius: 20px;
    padding: 12px 12px 8px;
  }
  .composer-input {
    font-size: 15px;
  }
  .tool-pill {
    height: 30px;
    padding: 0 9px;
    font-size: 12.5px;
  }
  .composer-hint {
    margin-top: 8px;
    font-size: 11px;
  }
  .welcome-icon {
    width: 56px;
    height: 56px;
  }
  .welcome-title {
    font-size: 22px;
  }
  .welcome-sub {
    font-size: 14px;
  }
  .welcome-composer {
    margin-top: 26px;
  }
  .scroll-bottom {
    right: 14px;
    bottom: 132px;
  }
  .think-body {
    max-height: 280px;
  }
  .markdown .math-display .katex {
    font-size: 1em;
  }
  .cache-stat {
    padding: 8px 10px;
  }
  .cache-num {
    font-size: 14px;
  }
}
