/* ====================================================
   style.css - 多AI聚合对比工具 样式表
   设计原则：简约清爽、响应式、移动端友好
   ==================================================== */

/* ---- 基础重置 ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f4f6fa;
  --card-bg: #ffffff;
  --border: #e0e4ef;
  --primary: #4f7cff;
  --primary-dark: #2f5cd8;
  --danger: #ff5252;
  --success: #19c37d;
  --text: #1a1a2e;
  --text-muted: #4d576b;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --radius: 12px;
  --header-h: 56px;
  --footer-h: 72px;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

/* ---- 顶部栏 ---- */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  box-shadow: var(--shadow);
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}
.logo {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--primary);
}
/* 顶部右侧按钮区 */
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
/* 积分显示 */
.credit-display {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: #eef2ff;
  padding: 4px 12px;
  border-radius: 20px;
  cursor: default;
  white-space: nowrap;
}
/* 购买积分按钮 */
.btn-buy {
  padding: 6px 14px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
  white-space: nowrap;
}
.btn-buy { opacity: .9; }
.btn-buy:hover { opacity: .75; }

/* 积分充足时的迷你图标（默认显示） */
.credit-hint {
  font-size: 16px;
  cursor: pointer;
  opacity: .7;
  transition: transform .15s, opacity .15s;
}
.credit-hint:hover { opacity: 1; transform: scale(1.15); }

/* 购买弹窗 */
.modal-pay { max-width: 440px; }
.pay-pkg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.pay-pkg {
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
}
.pay-pkg:hover     { border-color: var(--primary); background: #f0f4ff; }
.pay-pkg.selected  { border-color: var(--primary); background: #eef2ff; }
.pay-pkg-name      { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.pay-pkg-credits   { font-size: 20px; font-weight: 700; color: var(--primary); }
.pay-pkg-price     { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
@media (max-width: 480px) {
  .pay-pkg-grid { grid-template-columns: 1fr 1fr; }
  .header-right .credit-display { display: none; }
}
.header-tip {
  font-size: 12px;
  color: var(--text-muted);
  display: none;
}
@media (min-width: 600px) {
  .header-tip { display: block; }
}
.loading-tip {
  font-style: italic;
  color: var(--text-muted);
}

/* ---- 主体区 ---- */
.main {
  margin-top: var(--header-h);
  margin-bottom: var(--footer-h);
  padding: 16px;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}
/* 桌面端：给左侧栏让出空间 */
@media (min-width: 901px) {
  body.has-sidebar .main { padding-left: 248px; padding-right: 16px; max-width: none; margin-left: 0; margin-right: 0; }
}

/* ---- 左侧栏 ---- */
.sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0; bottom: 0;
  width: 232px;
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  padding: 14px 12px;
  overflow-y: auto;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sb-new { width: 100%; justify-content: center; }
/* 侧栏滚动条：细条灰色，常驻可见（参考豆包），让用户知道内容可下滚、何时到底 */
.sidebar { scrollbar-width: thin; scrollbar-color: #d3d9e3 transparent; }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #d3d9e3; border-radius: 3px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: #b9c2d0; }
/* 内容超高时不许压缩区块（否则标题和列表叠在一起），靠侧栏整体滚动 */
.sb-section { flex-shrink: 0; }
.sb-account { flex-shrink: 0; }
.sb-section { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.sb-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sb-cloud { font-size: 10px; color: #79839a; font-weight: 400; }
.sb-tabs { display: flex; gap: 6px; }
.sb-tab {
  flex: 1;
  font-size: 12px;
  padding: 4px 0;
  border: 1px solid var(--border);
  background: #fafbff;
  border-radius: 7px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all .15s;
}
.sb-tab.active { background: #eef2ff; color: var(--primary-dark); border-color: var(--primary); }
.sb-list { display: flex; flex-direction: column; gap: 4px; }
.sb-item {
  text-align: left;
  border: none;
  background: transparent;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  line-height: 1.4;
  transition: background .15s;
  position: relative;
  word-break: break-all;
}
.sb-item:hover { background: #f0f4ff; }
.sb-item.active { background: #eef2ff; color: var(--primary-dark); font-weight: 600; }
.sb-item .sb-item-time { display: block; font-size: 11px; color: #79839a; margin-top: 2px; }
.sb-item .sb-del {
  position: absolute;
  right: 6px; top: 6px;
  font-size: 11px;
  color: #c0c6d4;
  background: none;
  border: none;
  cursor: pointer;
  display: none;
  padding: 2px;
}
.sb-item:hover .sb-del { display: block; }
.sb-item .sb-del:hover { color: var(--danger); }
.sb-empty { font-size: 12px; color: #79839a; text-align: center; padding: 10px 0; }
.btn.btn-menu { display: none; }
.sidebar-mask {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 85;
}

/* ---- 主问题 / 追问 分组 ---- */
.topic-group { display: flex; flex-direction: column; gap: 8px; }
.topic-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: filter .15s;
}
.topic-header:hover { filter: brightness(0.96); }
.topic-header .topic-arrow {
  font-size: 11px;
  transition: transform .2s;
  flex-shrink: 0;
}
.topic-group.collapsed .topic-arrow { transform: rotate(-90deg); }
.topic-header .topic-label { font-size: 11px; font-weight: 600; flex-shrink: 0; }
.topic-header .topic-text {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topic-header .topic-body-text { display: none; }
/* 主问题：紫色醒目 */
.topic-group.main-topic > .topic-header {
  background: #eef2ff;
  border: 1px solid #c8d5ff;
  color: var(--primary-dark);
}
/* 追问：绿色缩进 */
.topic-group.sub-topic > .topic-header {
  background: #f0fff6;
  border: 1px solid #b8f0d8;
  color: #0e7a50;
  margin-left: 16px;
}
.topic-body { display: flex; flex-direction: column; gap: 8px; }
.topic-group.collapsed .topic-body { display: none; }
.sub-topic .topic-body { margin-left: 16px; }

/* ---- AI 面板横向布局 ---- */
.panels-wrapper {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  align-items: flex-start;
}
/* 横向滚动条加粗，方便点击拖拽 */
.panels-wrapper::-webkit-scrollbar {
  height: 14px;
}
.panels-wrapper::-webkit-scrollbar-track {
  background: #f1f3f7;
  border-radius: 7px;
}
.panels-wrapper::-webkit-scrollbar-thumb {
  background: #c2cad6;
  border: 3px solid #f1f3f7;
  border-radius: 7px;
}
.panels-wrapper::-webkit-scrollbar-thumb:hover {
  background: #9aa4b5;
}

/* 每个 AI 卡片：自动拉伸，AI 少时占满整行 */
.ai-panel {
  flex: 1 1 320px;
  min-width: 280px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow .2s;
}
.ai-panel:hover { box-shadow: 0 4px 20px rgba(79,124,255,0.15); }

/* 卡片头部 */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: linear-gradient(135deg, var(--primary) 0%, #7c5cfc 100%);
  color: #fff;
  user-select: none;
}
.panel-title {
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.panel-status {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #a0e8c0;
  display: inline-block;
}
.panel-status.loading { background: #ffd76e; animation: blink .8s infinite; }
.panel-status.error   { background: #ff7070; }

.panel-actions {
  display: flex;
  gap: 6px;
}
.panel-actions button {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  cursor: pointer;
  transition: background .15s;
}
.panel-actions button:hover { background: rgba(255,255,255,0.35); }

/* 卡片消息区域 */
.panel-messages {
  flex: 1;
  min-height: 180px;
  max-height: 480px;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.panel-messages.collapsed { display: none; }

/* 消息气泡 */
.msg {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.msg-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}
.msg-bubble {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.65;
  word-break: break-word;
  white-space: pre-wrap;
}
.msg.user .msg-bubble {
  background: #e8edff;
  color: var(--primary-dark);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.msg.ai .msg-bubble {
  background: #f5f7fb;
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.msg.ai.loading .msg-bubble {
  color: var(--text-muted);
  font-style: italic;
}
.msg.ai.error .msg-bubble {
  background: #fff0f0;
  color: var(--danger);
}

/* 复制按钮 */
.msg-copy {
  align-self: flex-end;
  font-size: 11px;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 8px;
  cursor: pointer;
  transition: all .15s;
}
.msg-copy:hover { color: var(--primary); border-color: var(--primary); }

/* ---- 对比区域 ---- */
.compare-section {
  margin-top: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
/* 对比打开时：隐藏分栏和横滑带，让对比分析区直接占满主区顶部，无需用户滚动 */
body.compare-open .panels-wrapper { display: none; }
body.compare-open .scroll-strip   { display: none; }
.compare-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f0f4ff;
  font-weight: 900;
  font-size: 20px;            /* 父级标题：比卡内 共识/分歧/总结 更大更显眼 */
  color: #0f1319;
  border-bottom: 1px solid var(--border);
}
.compare-header .btn { font-size: 12px; font-weight: 600; }  /* 关闭按钮不受父级放大影响 */
.compare-body {
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.8;
}
/* 对比高亮 */
.diff-same  { background: #d4f7e5; color: #0e7a50; border-radius: 3px; padding: 0 2px; }
.diff-diff  { background: #ffd6d6; color: #c0392b; border-radius: 3px; padding: 0 2px; }

/* ---- 底部输入栏 ---- */
.input-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: auto;
  min-height: var(--footer-h);
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  z-index: 100;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.07);
}
.input-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px 14px;
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.input-textarea {
  flex: 1;
  resize: none;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 9px 13px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fafbff;
  transition: border-color .2s;
  max-height: 120px;
  overflow-y: auto;
  line-height: 1.5;
}
.input-textarea:focus {
  outline: none;
  border-color: var(--primary);
}

/* ---- 通用按钮 ---- */
.btn {
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover  { background: var(--primary-dark); }
.btn-secondary { background: #edf0fa; color: var(--text); }
.btn-secondary:hover { background: #dde3f7; }
.btn-voice { background: #fff0e6; color: #e06030; font-size: 18px; padding: 6px 12px; }
.btn-voice.recording { background: #ff5252; color: #fff; animation: blink .5s infinite; }
.btn-compare { background: #f0fff6; color: #13a560; border: 1.5px solid #b8f0d8; }
.btn-compare:hover { background: #d4f7e5; }
.btn-small { font-size: 12px; padding: 4px 10px; }
.btn-close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--text-muted); }
.btn-close:hover { color: var(--danger); }

/* ---- 管理弹窗 ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal {
  background: var(--card-bg);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 17px; }
.modal-body { padding: 16px 20px 20px; }

/* AI 列表 */
.ai-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.ai-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fafbff;
  transition: border-color .15s;
}
.ai-item:hover { border-color: var(--primary); }
/* 新版 ai-item 布局：左侧名称+meta，右侧操作区 */
.ai-item { align-items: flex-start; flex-wrap: wrap; gap: 10px; }
.ai-item-left  { flex: 1; min-width: 120px; }
.ai-item-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-item-name  { font-weight: 600; font-size: 14px; }
.ai-item-meta  { font-size: 12px; color: var(--text-muted); margin-top: 3px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* 旧的独立字段兼容 */
.ai-item-model { flex: 1.5; font-size: 12px; color: var(--text-muted); }

/* Key 状态徽章 */
.key-badge { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 20px; font-weight: 500; }
.key-ok      { background: #d4f7e5; color: #0e7a50; }
.key-backend { background: #e8edff; color: #2f5cd8; }
.key-missing { background: #fff0e0; color: #c05000; }

/* Key 输入框（管理弹窗内） */
.key-input {
  width: 160px;
  padding: 5px 9px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: 12px;
  font-family: inherit;
  background: #fafbff;
  transition: border-color .15s;
}
.key-input:focus { outline: none; border-color: var(--primary); }

/* 教程按钮 */
.btn-tutorial {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 7px;
  border: 1.5px solid var(--primary);
  color: var(--primary);
  background: #f0f4ff;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}
.btn-tutorial:hover { background: var(--primary); color: #fff; }

/* 灰色淡字次要链接：用自己的Key */
.ai-item-ownkey-hint {
  flex: 1 0 100%;
  padding: 4px 0 2px 44px;
  font-size: 12px;
}
.link-muted {
  color: #79839a;
  cursor: pointer;
  transition: color .15s;
}
.link-muted:hover { color: var(--primary); text-decoration: underline; }

/* 开关前置后的 ai-item 微调 */
.ai-item { align-items: center; }
.ai-item .toggle-switch { margin-right: 6px; flex-shrink: 0; }

/* 预设 AI 网格卡片 */
.ai-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}
.ai-card {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  transition: border-color .15s;
}
.ai-card.disabled { opacity: .6; }
.ai-card:hover { border-color: var(--primary); }
.ai-card .toggle-switch { margin-bottom: 4px; }
.ai-card-info { width: 100%; }
.ai-card-name { font-size: 14px; font-weight: 600; color: var(--text); }
.ai-card-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; word-break: break-all; }
.ai-card-badge {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  background: #d4f7e5;
  color: #0e7a50;
  margin-top: 4px;
}
.ai-card-hint { font-size: 11px; margin-top: 2px; }

/* 底部教程链接 */
.add-ai-tutorials {
  font-size: 12px;
  color: #79839a;
  margin: -4px 0 10px;
}
.link-tutorial {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 12px;
  cursor: pointer;
  padding: 0 2px;
  text-decoration: underline;
}
.link-tutorial:hover { color: var(--primary-dark); }

/* 次要按钮：用自己的Key / 移除（浅色弱化） */
.btn-ownkey {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px dashed var(--border-strong, #b8c2d4);
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}
.btn-ownkey:hover { border-color: var(--primary); color: var(--primary); background: #f5f7ff; }

/* 展开的"自己的Key"输入行 */
.own-key-row {
  flex: 1 0 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0 2px;
  border-top: 1px dashed #e5e9f2;
  margin-top: 2px;
}
.own-key-input { flex: 1; width: auto; }

/* 信息横幅 */
.info-banner {
  background: #f0f4ff;
  border: 1px solid #c8d5ff;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13px;
  color: var(--primary-dark);
  margin-bottom: 16px;
  line-height: 1.6;
}

/* 教程弹窗 */
.modal-tutorial { max-width: 520px; }
.tutorial-steps {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tutorial-steps li {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
}
.tutorial-steps a { color: var(--primary); text-decoration: none; }
.tutorial-steps a:hover { text-decoration: underline; }
.tutorial-steps code {
  background: #f0f4ff;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--primary-dark);
}
.tutorial-note {
  margin-top: 16px;
  padding: 10px 14px;
  background: #f5fff8;
  border: 1px solid #b8f0d8;
  border-radius: 8px;
  font-size: 13px;
  color: #0e7a50;
}
.toggle-switch {
  position: relative;
  width: 42px; height: 24px;
}
.toggle-switch input { display: none; }
.toggle-track {
  position: absolute; inset: 0;
  background: #cdd5e0;
  border-radius: 12px;
  cursor: pointer;
  transition: background .2s;
}
.toggle-track::after {
  content: '';
  position: absolute;
  left: 3px; top: 3px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-track { background: var(--success); }
.toggle-switch input:checked + .toggle-track::after { transform: translateX(18px); }
.btn-delete { color: var(--danger); background: #fff0f0; font-size: 12px; padding: 4px 8px; border-radius: 6px; border: none; cursor: pointer; }
.btn-delete:hover { background: #ffd6d6; }

/* 添加 AI 表单（明显区分区域） */
.add-ai-form {
  border-top: 2px solid var(--border-strong, #b8c2d4);
  padding: 16px;
  margin-top: 8px;
  background: #f8f9fb;
  border-radius: 10px;
}
.add-ai-form h3 { font-size: 14px; margin-bottom: 4px; color: var(--primary-dark); }
.add-ai-desc {
  font-size: 12px;
  color: #79839a;
  margin-bottom: 12px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 13px; color: var(--text-muted);
}
.form-grid input {
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: #fafbff;
  transition: border-color .15s;
}
.form-grid input:focus { outline: none; border-color: var(--primary); }

/* 语音提示浮层 */
.voice-tip {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  z-index: 300;
  pointer-events: none;
}

/* 空状态提示 */
.empty-tip {
  color: var(--text-muted);
  font-size: 13px;
  padding: 24px 0;
  text-align: center;
  width: 100%;
}

/* ---- 动画 ---- */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.msg { animation: fadeIn .25s ease; }

/* ---- 移动端适配 ---- */
@media (max-width: 600px) {
  .panels-wrapper { flex-direction: column; overflow-x: visible; }
  .ai-panel { flex: none; min-width: unset; max-width: unset; width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .input-inner { flex-wrap: wrap; }
  .input-textarea { flex: 1 1 100%; order: -1; }
  .logo { font-size: 18px; }
}

/* 滚动条美化 */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cdd5e0; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #adb5cc; }

/* 输入验证错误红边 */
.input-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239,68,68,.15);
  animation: inputShake .3s ease;
}
@keyframes inputShake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ── AI 回复 Markdown 排版 ─────────────────────────────── */
.msg-bubble h4 {
  margin: 10px 0 4px;
  font-size: 14px;
  font-weight: 700;
  color: inherit;
}
.msg-bubble p { margin: 4px 0; }
.msg-bubble ul, .msg-bubble ol { margin: 4px 0; padding-left: 20px; }
.msg-bubble li { margin: 2px 0; }
.msg-bubble code {
  background: rgba(0,0,0,0.08);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12.5px;
  font-family: Consolas, monospace;
}
.msg-bubble strong { font-weight: 700; }

/* ── 输入区：追问 / 新话题 切换 ────────────────────────── */
.topic-switch {
  display: flex;
  gap: 4px;
  background: #f0f2f8;
  border-radius: 9px;
  padding: 3px;
  align-self: center;
  flex-shrink: 0;
}
.topic-btn {
  border: none;
  background: transparent;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
  color: var(--text-muted);
  white-space: nowrap;
  transition: all .15s;
}
.topic-btn.active { background: #fff; color: var(--primary-dark); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,0.1); }
#btnTopicNew.active { color: #0e7a50; }

/* AI 回复上的收藏按钮 */
.msg-fav {
  align-self: flex-end;
  font-size: 11px;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 8px;
  cursor: pointer;
  transition: all .15s;
}
.msg-fav:hover { color: #d4a017; border-color: #d4a017; }
.msg-fav.faved { color: #d4a017; border-color: #d4a017; background: #fffbe6; }

/* ── 移动端：左侧栏默认隐藏，点 ☰ 弹出 ─────────────────── */
@media (max-width: 900px) {
  .btn.btn-menu { display: inline-flex; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 210;
    width: 280px;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,0.2); }
  .topic-switch { order: -1; flex: 1 1 100%; }
}

/* ── 收藏弹窗：对话勾选列表（豆包式） ───────────────────── */
.fav-select-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  border-bottom: 1px solid #eef1f6;
  transition: background .15s;
}
.fav-select-item:hover { background: #f5f7fb; }
.fav-select-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: var(--primary, #4f7cff);
}
.fav-select-item .fsi-title {
  flex: 1;
  font-size: 14px;
  color: #1f2430;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 重命名按钮（✏️）放在删除按钮（✕）左边，避免重叠 */
.sb-item .sb-del.sb-edit { right: 26px; }

/* ── 收藏弹窗：AI 范围勾选行 ─────────────────────────────── */
.fav-ai-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: #f5f7fb;
  border-radius: 8px;
  font-size: 13px;
}
.fav-ai-row label {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  color: #1f2430;
  white-space: nowrap;
}
.fav-ai-row input[type="checkbox"] {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--primary, #4f7cff);
}
.fav-ai-all { font-weight: 600; padding-right: 8px; border-right: 1px solid #dfe4ee; }

/* ── 问答操作行：折叠 / 分类 / 收藏 ──────────────────────── */
.msg-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  justify-content: flex-end;
  flex-wrap: nowrap;      /* 窄面板不换行 */
  max-width: 100%;
  overflow: visible;      /* ★不能 hidden：会把折叠按钮悬停弹出的「全部折叠」菜单裁掉；
                             窄面板溢出仍由 JS 检测 scrollWidth 切「只显示图标」模式 */
  align-items: center;
}
/* 窄面板紧凑模式：按钮只显示图标，文字隐藏（悬停有 title 提示） */
.msg-actions.compact { gap: 4px; }
.msg-actions.compact .bt { display: none; }
.msg-actions .msg-fav, .msg-actions .msg-copy { white-space: nowrap; }
.msg.qa-collapsed .msg-bubble,
.msg.qa-collapsed .msg-copy {
  display: none;
}
/* 回答被折叠时，回答上的"已对比"小标一并隐藏；提问的小标不受影响（20260912a） */
.msg.ai.qa-collapsed .cmp-badge { display: none !important; }

/* ── 侧栏「收藏整段对话」小按钮 ──────────────────────────── */
.fav-open-select {
  display: block;
  width: 100%;
  margin: 6px 0 4px;
  font-size: 12px;
  padding: 6px 8px;
}

/* ── 分类：当前对话标题行 + 主干/次级层级 ────────────────── */
.cat-conv-title {
  font-size: 12px;
  color: #59637a;
  padding: 4px 8px 6px;
  border-bottom: 1px dashed #e3e8f0;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sb-item.cat-main { font-weight: normal; }
.sb-item.cat-sub {
  padding-left: 26px;
  font-size: 13px;
  font-weight: normal;
  color: #4a5265;
}

/* ── 最近列表：当前对话高亮 + 分类缩进 ───────────────────── */
.sb-item.sb-cur { background: #eef3ff; }
.sb-item.cat-main { padding-left: 30px; font-size: 13px; }
.sb-item.cat-sub  { padding-left: 46px; font-size: 12px; color: #4a5265; }

/* ── 分类弹窗：位置点选列表 ──────────────────────────────── */
.cat-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: #1f2430;
  cursor: pointer;
}
.cat-opt:hover { background: #f5f7fb; }
.cat-opt input { accent-color: var(--primary, #4f7cff); cursor: pointer; }
.cat-opt-1 { padding-left: 22px; }
.cat-opt-2 { padding-left: 44px; color: #4a5265; }
.cat-group {
  padding: 8px 10px 2px;
  font-size: 13px;
  font-weight: 600;
  color: #1f2430;
}

/* ── 折叠按钮悬停菜单：全部折叠 / 全部展开 ────────────────── */
.fold-wrap {
  position: relative;
  display: inline-block;
}
.fold-wrap::after {
  content: '';
  display: none;
  position: absolute;
  left: 0;
  bottom: 100%;
  width: 100%;
  height: 8px;  /* 隐形桥：鼠标从按钮滑向菜单时不中断悬停 */
}
.fold-wrap:hover::after { display: block; }
.fold-menu {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 0;
  min-width: 88px;
  background: #fff;
  border: 1px solid #e3e8f0;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(31, 36, 48, .12);
  padding: 4px;
  z-index: 30;
}
.fold-wrap:hover .fold-menu { display: block; }
.fold-menu-item {
  display: block;
  padding: 6px 10px;
  font-size: 12px;
  color: #1f2430;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.fold-menu-item:hover { background: #f0f4ff; color: var(--primary, #4f7cff); }

/* ── 左侧分类折叠箭头 + 条目行 ───────────────────────────── */
.sb-item .cat-arrow {
  display: inline-block;
  width: 14px;
  flex-shrink: 0;
  font-size: 10px;
  color: #59637a;
  cursor: pointer;
}
.sb-item .cat-arrow:hover { color: var(--primary, #4f7cff); }
.sb-item.cat-item1 { padding-left: 44px; font-size: 12px; color: #4d5568; }
.sb-item.cat-item2 { padding-left: 60px; font-size: 12px; color: #4d5568; }
.cat-item-dot { margin-right: 4px; color: #b6bdcc; }

/* 收藏跳转定位时的高亮 */
.msg.qa-jump-hl { animation: qaJumpHl 2.5s ease; border-radius: 10px; }
@keyframes qaJumpHl {
  0%   { background: #f0f2f6; }
  70%  { background: #f7f8fa; }
  100% { background: transparent; }
}

/* 分类层级缩进：主分类最左，子分类往右，条目再往右 */
.sb-item.cat-main  { padding-left: 10px !important; }
.sb-item.cat-sub   { padding-left: 28px !important; }
.sb-item.cat-item1 { padding-left: 46px !important; }
.sb-item.cat-item2 { padding-left: 64px !important; }

/* 分类树：子分类挂在父分类正下方的竖线上，层级一目了然 */
.cat-children { margin-left: 24px; border-left: 2px solid #dde3f0; padding-left: 2px; }
.sb-item.cat-main { padding-left: 10px !important; }
.sb-item.cat-sub { padding-left: 4px !important; font-size: 12px; color: #4a5265; font-weight: 500; }

/* 弹窗里的分类树：子分类挂在主分类下的竖线上 */
.cat-tree-line { margin-left: 20px; border-left: 2px solid #dde3f0; padding-left: 6px; }
.cat-tree-line .cat-opt-2 { padding-left: 10px; }

/* 弹窗里已有类目名仅展示，不带勾选框 */
.cat-name-only { color: #4d5568; cursor: default; }
.cat-name-only:hover { background: transparent; }

/* 弹窗里禁用的「＋新建子分类」：置灰不可选 */
.cat-disabled { color: #b9c0cf; cursor: not-allowed; text-decoration: line-through; }
.cat-disabled:hover { background: transparent; }

/* 加入分类弹窗：类目行右侧淡灰色「＋子分类」，点谁就建在谁下面 */
.cat-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 8px; border-radius: 6px; }
.cat-row:hover { background: #f6f8fc; }
.cat-row-name { font-size: 13px; color: #3a4154; }
.cat-row-add { font-size: 12px; color: #6f7890; cursor: pointer; white-space: nowrap; flex: none; }
.cat-row-add input { display: none; }
.cat-row-add span { padding: 1px 8px; border-radius: 6px; }
.cat-row-add:hover span { color: #3b6ef5; background: #eef3ff; }
.cat-row-add input:checked + span { color: #fff; background: #3b6ef5; }
.cat-row-add.disabled { color: #c3cad8; cursor: not-allowed; text-decoration: line-through; }
.cat-row-add.disabled:hover span { color: #c3cad8; background: transparent; }

/* 对话行/收藏标题的线条小图标对齐 */
.conv-ic, .star-ic { vertical-align: -2px; margin-right: 5px; flex: none; }

/* 置顶区标题行 */
.pin-head {
  display: flex; align-items: center; gap: 5px;
  width: 100%; text-align: left; border: none; background: transparent;
  font-size: 12px; font-weight: 600; color: var(--text-muted, #6b7280);
  padding: 6px 10px; cursor: pointer; border-radius: 6px;
}
.pin-head:hover { background: #f2f4f8; }
.pin-flag { flex: none; font-size: 11px; }

/* 置顶小标记与折叠箭头同宽，保证各行标题左对齐 */
.sb-item .pin-flag { display: inline-block; width: 14px; text-align: center; }

/* 对话行「⋯」更多操作菜单 */
.sb-item .sb-more { font-size: 15px; letter-spacing: 1px; color: #6b7280; font-weight: 700; }
.ctx-overlay { position: fixed; inset: 0; z-index: 999; pointer-events: none; }   /* 不挡点击：菜单开着时点其他标题/⋯直接生效（20260911b） */
.ctx-overlay .ctx-menu-pop { pointer-events: auto; }
.ctx-menu-pop {
  position: fixed; background: #fff; border: 1px solid #e5e8f0;
  border-radius: 10px; box-shadow: 0 10px 36px rgba(0,0,0,.28), 0 2px 8px rgba(0,0,0,.14);
  padding: 6px 0; min-width: 130px;
}
.ctx-item {
  display: flex; gap: 8px; align-items: center; width: 100%;
  border: none; background: none; padding: 8px 14px;
  font-size: 13px; color: #333; cursor: pointer; border-radius: 0; text-align: left;
}
.ctx-item:hover { background: #f2f4f8; }
.ctx-danger { color: #e5484d; }

/* 「置顶」分组标题：与「最近」同级，可点击折叠 */
.pin-title { cursor: pointer; gap: 6px; }
.pin-title:hover { color: var(--text, #333); }
.pin-title .cat-arrow { font-size: 10px; color: #59637a; }

/* ============================================
   界面去彩色（高级灰白风）：所有彩色元素统一为黑/白/灰
   ============================================ */
:root { --primary: #33383f; --primary-dark: #17191d; }

/* AI 分栏头部：彩色渐变 → 浅灰底深字 */
.panel-header { background: #f7f8fa; color: #333; border-bottom: 1px solid var(--border); }
.ai-panel:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.08); }

/* 顶部购买积分按钮：橙红渐变 → 深灰 */
.btn-buy { background: #33383f; }
.btn-buy:hover { background: #17191d; }

/* 发送/新对话等主按钮 → 深灰黑 */
.btn-primary { background: #33383f; }
.btn-primary:hover { background: #17191d; }

/* 对比按钮：绿色 → 白底灰边 */
.btn-compare { background: #fff; color: #333; border: 1.5px solid #d5d9e2; }
.btn-compare:hover { background: #f2f4f8; }

/* 语音按钮：橙色 → 白底灰字 */
.btn-voice { background: #fff; color: #333; border: 1px solid #d5d9e2; }

/* 侧边栏选中态：淡蓝 → 淡灰 */
.sb-item.sb-cur, .sb-item.active, .sb-tab.active { background: #f0f1f4; color: #17191d; }
.sb-cur-item { background: #eef2ff; } /* 兼容旧类 */
.sb-cur-item, .pay-pkg:hover, .pay-pkg.selected { background: #f0f1f4; border-color: #c9cdd6; }
.pay-pkg-credits { color: #17191d; }

/* 链接/强调文字的蓝色 → 深灰 */
a, .link { color: #33383f; }

/* 已收藏金星 → 深灰空心风格统一由图标自身控制，这里压掉彩色背景 */
.credit-display { background: #f0f1f4; color: #17191d; }

/* ============================================
   DeepSeek 式布局与浅色风（第2轮）：
   侧栏通到底部、输入框只在右侧聊天区、按钮去深灰改浅色+阴影
   ============================================ */

/* 桌面端：输入栏只盖住右侧聊天区，左侧栏通到底部不被遮 */
@media (min-width: 901px) {
  body.has-sidebar .input-bar { left: 232px; }
}

/* 输入区 DeepSeek 风：浅灰底上浮白色圆角卡片+阴影 */
.input-bar { background: transparent; border-top: none; box-shadow: none; }
.input-inner {
  background: #fff;
  border: 1px solid #e5e8f0;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  margin-bottom: 12px;
}

/* 按钮：去深灰实心 → 白底浅边+轻阴影（悬停淡灰） */
.btn-primary, .btn-buy {
  background: #fff;
  color: #333;
  border: 1px solid #e2e5ec;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.btn-primary:hover, .btn-buy:hover { background: #f5f6f8; }

/* ============================================
   第3轮微调：输入框离侧栏留空隙 / 背景提白 / 选中对话文字带色
   ============================================ */

/* 背景提亮：去掉整体灰蒙蒙的感觉 */
:root { --bg: #fbfcfe; }

/* 输入卡片与侧栏、屏幕边缘留出空隙 */
.input-inner { margin-left: 20px; margin-right: 20px; }

/* 当前选中的对话：文字用品牌蓝点缀（DeepSeek 同款） */
.sb-item.sb-cur, .sb-item.active { color: #4f7cff; background: #eff4ff; }
.sb-item.sb-cur .cat-arrow, .sb-item.active .cat-arrow { color: #4f7cff; }

/* ============================================
   第4轮：背景纯白 + 字体放大
   ============================================ */

/* 纯白背景，彻底去掉灰蒙蒙的感觉 */
:root { --bg: #ffffff; }

/* 全局字号放大：15px → 16px */
body { font-size: 16px; }

/* 聊天气泡正文放大：14px → 15.5px */
.msg-bubble { font-size: 15.5px; }

/* 侧边栏文字也放大一点 */
.sidebar { font-size: 14.5px; }
.sb-title { font-size: 13px; }
.sb-item { font-size: 14.5px; }

/* 输入框文字放大 */
.input-inner input, .input-inner textarea { font-size: 15px !important; }

/* 分组标题（置顶/最近/我的收藏）：DeepSeek 式小而细的灰字 */
.sb-title { font-size: 12px !important; font-weight: 400 !important; color: #4a5264 !important; font-weight: 500 !important; letter-spacing: .5px; }

/* ============================================
   左下角「个人账户」入口（DeepSeek 式）
   ============================================ */
.sb-account {
  margin: 0 -12px;                  /* 通栏贴边（抵消侧栏左右 padding） */
  padding: 10px 22px;
  margin-top: auto;                 /* 侧栏是纵向 flex，推到底部 */
  display: flex; align-items: center; gap: 9px;
  position: sticky; bottom: 0;      /* 内容再多、往上滚也始终钉在侧栏底部可见 */
  background: rgba(255,255,255,0.78);          /* 半透明底 + 毛玻璃 = 雾蒙蒙分隔效果 */
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);         /* 顶部一条分隔线 */
  border-radius: 0;
  z-index: 5;
}
.sb-account:hover { background: rgba(240,243,248,0.92); }
/* 底部不留 padding 空隙，账户栏严丝合缝贴到底（否则下方会露出滚过的内容） */
.sidebar { padding-bottom: 0; }
.acct-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: #3f4759; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.acct-name { font-size: 14px; color: #33383f; }

/* ============================================
   「个人账户」弹窗（DeepSeek 系统设置式：左菜单+右内容）
   ============================================ */
.acct-modal {
  position: relative;
  background: #fff; border-radius: 14px;
  width: 560px; max-width: 100%; min-height: 420px;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,.18);
}
.acct-close {
  position: absolute; top: 14px; right: 14px;
  width: 28px; height: 28px; border: none; background: transparent;
  border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.acct-close:hover { background: #f2f4f8; }
.acct-body { flex: 1; padding: 24px 26px; overflow-y: auto; }
.acct-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 0; border-bottom: 1px solid #f2f4f8;
}
.acct-label { width: 90px; flex: none; font-size: 14px; color: #3f4759; }
.acct-val { flex: 1; font-size: 14px; color: #17191d; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.acct-input {
  padding: 7px 10px; border: 1px solid #dfe3ea; border-radius: 8px;
  font-size: 14px; width: 200px; outline: none;
}
.acct-input:focus { border-color: #4f7cff; }
.acct-hint { color: #6f7890; font-size: 12.5px; }
.acct-hint2 { color: #4d5568; font-size: 13px; }
.acct-avatar-edit {
  width: 52px; height: 52px; border-radius: 50%; overflow: hidden;
  background: #eef0f4; cursor: pointer; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.acct-avatar-edit img { width: 100%; height: 100%; object-fit: cover; }
.acct-save {
  padding: 9px 26px; border: 1px solid #e2e5ec; border-radius: 9px;
  background: #fff; color: #333; font-size: 14px; cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.acct-save:hover { background: #f5f6f8; }
.acct-credits-hero {
  text-align: center; padding: 18px 0 20px;
  border-bottom: 1px solid #f2f4f8; margin-bottom: 6px;
}

/* 顶栏通栏：logo 与左侧栏左对齐，管理AI 与右侧内容右对齐 */
.header-inner { max-width: none; }
.logo { padding-left: 4px; }

/* ============================================
   一屏锁定布局：页面本身不滚动，只有每个 AI 分栏内部滚动
   → 无论怎么滚（分栏内 / 点空白处拖动），AI 标题始终钉在分栏顶部
   ============================================ */
@media (min-width: 901px) {
  body.has-sidebar .main {
    height: calc(100vh - var(--header-h) - var(--footer-h));
    /* 不再加 overflow:hidden —— 下方对比结果区需要主区域纵向滚动，
       滚动行为统一交给后面的 .main { overflow-y:auto } 规则 */
    box-sizing: border-box;
  }
  body.has-sidebar .panels-wrapper {
    height: 100%;
    align-items: stretch;       /* 分栏撑满可用高度 */
    padding-bottom: 0;
  }
  body.has-sidebar .ai-panel {
    height: 100%;
    min-height: 0;
  }
  body.has-sidebar .panel-messages {
    flex: 1;                    /* 消息区吃掉剩余高度，内部滚动 */
    max-height: none;
    min-height: 0;
  }
}

/* ============================================
   掐断滚动连锁 + 网页本体禁止滚动
   ============================================ */
/* 分栏消息区滚到头后，滚动量不再传给整页（overscroll 连锁是"带动网页滑"的元凶） */
.panel-messages { overscroll-behavior: contain; }
.sidebar        { overscroll-behavior: contain; }

/* 桌面端：网页本体彻底不可滚动，空白处怎么拖都不动；但主区域内部可滚
   （否则下方的对比结果区被输入栏挡住，内容看不全） */
@media (min-width: 901px) {
  html, body { overflow: hidden; }
  .main {
    height: calc(100vh - var(--header-h) - var(--footer-h));
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

/* ============================================
   右侧专用横滑带（有横向溢出时显示）
   ============================================ */
.main { position: relative; }

/* ============================================
   右侧专用横滑带：固定空白区域，鼠标在此滚轮=左右滑
   ============================================ */
body.has-sidebar .panels-wrapper.has-overflow {
  padding-right: 84px;   /* 只有确实放不下、需要横滑时才留出滑道空间 */
}
.scroll-strip {
  position: absolute;
  top: 16px;
  bottom: 16px;
  right: 0;
  width: 72px;
  z-index: 30;
  background: #f2f4f7;
  border-left: 1px solid #dfe3ea;
  border-radius: 0 10px 10px 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: default;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.scroll-strip.show { opacity: 1; pointer-events: auto; }
.scroll-strip span {
  writing-mode: vertical-rl;
  letter-spacing: 5px;
  font-size: 17px;
  font-weight: 400;
  color: #3d4453;
  user-select: none;
}

/* Logo 图片（后台上传，替代文字Logo） */
.logo-img {
  height: 40px;      /* 想再大/小改这个数：36~48 之间比较协调 */
  max-width: 220px;  /* 防止过宽的图把顶栏撑爆，超出等比缩小 */
  width: auto;
  display: block;
  padding-left: 4px;
  object-fit: contain;
}

/* ============================================
   全局文字加深：消除雾蒙蒙感（2026-09-04）
   ============================================ */
.msg-bubble { color: #1f2430; }                 /* AI回答正文 */
.sb-item, .sb-item * { color: #2a3040; }        /* 侧栏对话条目 */
.sb-item.active, .sb-item.active * { color: var(--primary-dark); }
.sb-item .sb-item-time { color: #79839a; }      /* 时间戳稍浅，保留层次 */
input::placeholder, textarea::placeholder { color: #6f7890; opacity: 1; }

/* ============================================
   高对比兜底（v=20260906h）：主文字全部钉深
   ============================================ */
body { color: #14161d; }
.msg-bubble { color: #14161d !important; }
.panel-header { color: #1c212b !important; }
.input-textarea { color: #14161d !important; }
.sb-item { color: #1f2430 !important; }
.sb-title { color: #3a4152 !important; }
.cat-name-only, .sb-item.cat-item1, .sb-item.cat-item2 { color: #333b4d !important; }
.empty-tip, .sb-empty { color: #4a5264 !important; }

/* 选中态恢复蓝色字体（v=20260906i） */
.sb-item.active, .sb-item.sb-cur { color: var(--primary-dark) !important; font-weight: 600; }

/* 选中对话：真正的蓝色（去彩色时--primary-dark被改成了黑色，不能再用变量） */
.sb-item.active, .sb-item.sb-cur { color: #2f5cd8 !important; }

/* 选中对话定稿（v=20260906k）：蓝色稍加深，不加粗 */
.sb-item.active, .sb-item.sb-cur { color: #3568e0 !important; font-weight: 400 !important; }

/* ★修复（20260913f）：1498 行 .sb-item * 直接钉死了内层标题 span 的颜色，
   上面的蓝色只作用在按钮上被顶掉 → 标题文字一直不变蓝。这里把内层 span 一起染蓝，
   并补浅蓝底色块与普通分组区分 */
.sb-item.sb-cur { background: #dceafd !important; border-radius: 8px; }   /* 浅蓝块+蓝字（DeepSeek风格，20260913p） */
.sb-item.sb-cur, .sb-item.sb-cur .sb-item-main { color: #3568e0 !important; }

/* ============================================
   侧栏层级定稿（v=20260906l）：主次分明
   对话名(主,14.5px深黑) > 分类(中,12.5px中灰) > 子分类(轻,12px浅灰)
   收藏条目里的AI名(豆包等)：明显弱化，小一号浅灰
   ============================================ */
.sb-item.cat-main { font-size: 12.5px !important; color: #59637a !important; font-weight: 400 !important; }
.sb-item.cat-sub  { font-size: 12px !important;   color: #6b7590 !important; font-weight: 400 !important; }
.sb-item .sb-item-time { font-size: 11px !important; color: #9aa3b5 !important; font-weight: 400 !important; }

/* 收藏AI名定稿（v=20260906m）：不再独占一行，跟在标题同一行最右侧，更浅的小灰字 */
.sb-item .sb-item-time {
  display: inline !important;
  float: right;
  margin-top: 3px;
  font-size: 11px !important;
  color: #a8b0c0 !important;
  font-weight: 400 !important;
}

/* 收藏AI名再缩小（v=20260906n）：10px */
.sb-item .sb-item-time { font-size: 10px !important; }

/* 收藏AI名（v=20260906o）：默认隐藏，悬停收藏条目时淡入显示；右侧稍留空避免和删除✕重叠 */
.sb-item .sb-item-time { opacity: 0; transition: opacity .15s; margin-right: 20px; }
.sb-item:hover .sb-item-time { opacity: 1; }

/* ============================================
   输入框定稿（v=20260906p）：只留外层卡片一层框
   内层textarea去掉自带边框（消除双重框+底部隐线）
   ============================================ */
.input-textarea,
.input-textarea:focus {
  border: none !important;
  background: transparent !important;
  outline: none !important;
  box-shadow: none !important;
}

/* ============================================
   输入框降高（v=20260906q）：上下间隔一致
   ============================================ */
.input-bar { padding-top: 6px !important; padding-bottom: 6px !important; }
.input-inner { padding: 6px 14px !important; }
.input-textarea { padding-top: 6px !important; padding-bottom: 6px !important; min-height: 0 !important; }
.input-inner .btn { padding-top: 5px !important; padding-bottom: 5px !important; font-size: 13px !important; }

/* ============================================
   复制并入操作行 + 分享按钮（v=20260906t）
   ============================================ */
.msg-actions .msg-copy { align-self: center; }
/* 行内所有按钮统一垂直居中，避免「复制」跟其他按钮不在一条水平线 */
.msg-actions { align-items: center !important; }
.msg-actions .msg-fav { align-self: center !important; }
.msg-actions .fold-wrap { align-self: center !important; }
/* fold-wrap 是 inline-block，内部按钮会被基线空隙顶低 2~3px：强制它变成与按钮同规格的 flex 盒 */
.msg-actions .fold-wrap {
  display: inline-flex !important;
  align-items: center !important;
  height: 20px !important;
  box-sizing: border-box !important;
  line-height: 1 !important;
}
/* 操作行所有按钮强制等高 + 垂直居中，保证「复制/折叠/分类/收藏/分享」一条水平线 */
.msg-actions > button,
.msg-actions .fold-wrap > button {
  height: 20px !important;
  min-height: 20px !important;
  box-sizing: border-box !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  vertical-align: middle !important;
  margin: 0 !important;
}

/* 分享弹窗底部操作栏（全选｜已选N组 —— 取消/创建分享链接） */
.share-bottom-bar {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.share-count-wrap { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #1f2430; }
.share-sep { color: #dfe4ee; }
.share-btns { display: flex; gap: 8px; }

/* ============ AI 语义差异分析卡（对比按钮） ============ */
.diff-sem-card { margin-bottom: 18px; padding: 16px 18px; background: #fff; border: 1px solid #e8ebf2; border-radius: 10px; }
.diff-sem-title { font-weight: 600; font-size: 14px; color: var(--primary); margin-bottom: 8px; }
.diff-sem-loading { font-size: 13px; color: #7a869a; }
.diff-sem-sec { margin-bottom: 8px; font-size: 13px; }
.diff-sem-item { padding: 6px 10px; border-radius: 6px; margin-top: 4px; line-height: 1.6; }
.diff-sem-item.same { background: #f0fdf4; border: 1px solid #bbf7d0; }
.diff-sem-item.diff { background: #fef2f2; border: 1px solid #fecaca; }
.diff-ai-tag { display: inline-block; font-size: 12px; font-weight: 600; color: #4f7cff; background: #eef2ff; border-radius: 4px; padding: 1px 6px; margin-right: 6px; }
.diff-sem-summary { font-size: 13px; color: #475569; margin-top: 6px; }
.diff-sem-cost { font-size: 12px; color: #9aa4b5; margin-top: 6px; text-align: right; }
.diff-literal-block { margin-bottom: 18px; }
.diff-literal-title { font-weight: 600; font-size: 13px; color: #4f7cff; margin-bottom: 6px; }
.diff-literal-note { font-weight: 400; font-size: 12px; color: #9aa4b5; }
.diff-literal-body { line-height: 1.9; font-size: 14px; padding: 10px 12px; background: #f8f9ff; border-radius: 8px; border: 1px solid #e0e4ef; }
.diff-legend { margin-top: 10px; font-size: 12px; color: #7a869a; }
/* DeepSeek 深度思考勾选框（管理AI卡片内） */
.think-toggle { display: flex; align-items: center; gap: 4px; font-size: 12px; color: #4f7cff; font-weight: 600; margin-top: 4px; cursor: pointer; user-select: none; }

/* DeepSeek 分栏标题旁的深度思考小开关 */
.think-toggle-panel { display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; font-size: 12px; cursor: pointer; user-select: none; opacity: 0.75; }
.think-toggle-panel:hover { opacity: 1; }
.think-toggle-panel input { cursor: pointer; margin: 0; }
.diff-literal-body { white-space: pre-wrap; word-break: break-word; }
/* 各栏原文里被判定为分歧的句子色块 */
.diff-mark { background: #ffd6d6; color: #c0392b; border-radius: 3px; padding: 0 3px; }

/* 侧栏「对比记录」条目 */
.cmp-item { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.cmp-q { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-time { font-size: 11px; color: #9aa4b5; flex: none; }
/* 电脑端：给悬停 ⋯ 和 置顶小旗 都预留位置（此前只给时间留 26px，小旗插在时间后
   正好压到 ⋯ 上；手机端靠 padding-right:46px 没这个问题——20260913c 同思路修电脑端） */
@media (min-width: 601px) {
  .sb-item.cmp-item { padding-right: 44px; }
}
.cmp-del { font-size: 12px; color: #c0392b; opacity: 0; flex: none; padding: 0 2px; }
.cmp-item:hover .cmp-del { opacity: 1; }

/* 「对比收藏」板块：不加外框不加图标，只给标题行变色（金色文字+金色浅底块）与普通分组区分（20260913e） */
.cmpfav-block { background: none; border: none; padding: 0; margin: 2px 0; }
.cmpfav-title {
  color: #17191d !important;              /* 黑字 */
}
.cmpfav-title .grp-chip { background: rgba(110,135,220,.28) !important; }   /* 分组同色系加深 */
.cmpfav-title:hover .grp-chip { background: rgba(110,135,220,.38) !important; }
.cmpfav-title .cat-arrow, .cmpfav-title .gcnt { color: #17191d !important; opacity: 1; }
/* 电脑端微调已移至文件末尾（20260913l）：必须排在 .grp-title 基础规则之后才能生效 */

/* 最近/收藏条目：超长单行省略号，悬停看全名（同对比记录样式） */
.sb-item .sb-item-main { display: inline-block; vertical-align: top; max-width: calc(100% - 20px); text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 收藏条目更紧凑：压低上下内边距，条与条更密 */
.sb-item.fav-item { padding: 4px 10px; }

/* ============================================
   手机端布局（≤600px）：AI标签切换单栏（v=20260907z6）
   电脑端不受影响（#mobileTabs 桌面隐藏）
   ============================================ */
#mobileTabs { display: none; }
@media (max-width: 600px) {
  .scroll-strip { display: none !important; }   /* 手机没有滚轮横滑，隐藏滑动带 */
  #mobileTabs {
    display: flex; gap: 8px; overflow-x: auto;
    padding: 8px 2px 10px; position: sticky; top: 0; z-index: 30;
    background: #f5f6fa;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  #mobileTabs::-webkit-scrollbar { display: none; }
  .mtab {
    flex: none; padding: 7px 14px; border-radius: 999px;
    background: #fff; border: 1px solid #e5e8f0; font-size: 13px; color: #333b4d;
    cursor: pointer; user-select: none; white-space: nowrap;
  }
  .mtab.mtab-on { background: #111518; color: #fff; border-color: #111518; font-weight: 600; }
  .panels-wrapper { flex-direction: column; overflow-x: visible; }
  /* 只显示当前选中的AI分栏，其余隐藏（display:none 优先级压过旧媒体查询的堆叠规则） */
  .ai-panel { display: none !important; }
  .ai-panel.mobile-on { display: flex !important; }
}
body.compare-open #mobileTabs { display: none !important; }   /* 对比全屏页打开时藏标签 */

/* ============================================
   手机端补充（v=20260908a）：
   1) 隐藏输入框占位文字（太长换行难看）
   2) 个人账户弹窗：左右两栏改上下堆叠，不再挤乱
   ============================================ */
@media (max-width: 600px) {
  .input-textarea::placeholder { color: transparent; }   /* 隐藏占位文字，输入框保持干净 */
  /* 账户/登录弹窗手机端：全屏化 */
  #acctOverlay, #authOverlay { padding: 0 !important; align-items: stretch; }
  #acctOverlay .modal, #authOverlay .modal {
    width: 100% !important; max-width: 100% !important;
    max-height: 100vh !important; height: 100%; border-radius: 0;
  }
  /* 账户弹窗的两栏容器：改上下堆叠（display:block 压过行内 flex） */
  #acctOverlay .modal > div[style*="display:flex"] { display: block !important; overflow-y: auto; }
  #acctOverlay .modal > div[style*="display:flex"] > div[style*="width:1px"] { display: none; }  /* 中间灰线隐藏 */
  #acctOverlay .modal > div[style*="display:flex"] > div { max-width: 100%; }
}

/* ============================================
   手机端补充（v=20260908c）：
   1) 顶部 Logo 隐藏，☰ 移到左上角（豆包式）
   2) 输入区默认「按住说话」大条，⌨️/🎤 切换键盘与语音
   电脑端不受影响（#holdTalk/#btnKB 桌面隐藏）
   ============================================ */
#holdTalk { display: none; }
#btnKB    { display: none; background: #fff; color: #333; border: 1px solid #d5d9e2; }
@media (max-width: 600px) {
  /* 顶栏：Logo 隐藏，☰ 固定到左上角 */
  .header .logo, .header .logo-img { display: none !important; }
  .header-inner { position: relative; }
  #btnSidebar { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); }
  .header-right { margin-left: auto; }
  /* 顶栏两个按钮去灰底：纯图标/文字（豆包式） */
  #btnSidebar, #btnManageAI {
    background: transparent !important; border: none !important;
    box-shadow: none !important; padding: 6px 8px !important;
  }

  /* 输入区：语音模式（默认）显示按住说话大条，键盘模式显示输入框 */
  .input-bar.m-voice #inputText, .input-bar.m-voice #btnVoice { display: none !important; }
  .input-bar:not(.m-voice) #holdTalk, .input-bar:not(.m-voice) #btnKB { display: none !important; }
  /* 按住说话：白卡内干净一条，无灰底无描边 */
  #holdTalk {
    display: flex; flex: 1 1 100%; order: -1; height: 42px;
    align-items: center; justify-content: center;
    background: transparent; border: none; border-radius: 12px;
    font-size: 15.5px; color: #191b1f; font-weight: 500;
  }
  /* 文字用 content 生成：浏览器无法选中 content，长按不触发系统选择菜单 */
  #holdTalk:empty::before { content: '按住说话'; }
  #holdTalk { user-select: none; -webkit-user-select: none; cursor: pointer; }
  #holdTalk.recording { background: #ff5252; color: #fff; font-weight: 600; animation: blink .5s infinite; }
  /* 底部按钮行：⌨️/对比 纯文字图标，发送 蓝色胶囊（豆包式） */
  #btnKB { display: inline-flex; font-size: 17px; background: transparent !important; border: none !important; box-shadow: none !important; }
  #btnCompare { background: transparent !important; border: none !important; box-shadow: none !important; color: #5b6472; }
  #btnSend {
    background: #3b7cff !important; border: none !important; box-shadow: none !important;
    color: #fff !important; border-radius: 999px !important; padding-left: 20px !important; padding-right: 20px !important;
  }
  /* 白卡更紧凑 */
  .input-inner { border-radius: 20px; padding: 8px 14px 10px !important; }
}

/* ============================================
   手机端（v=20260908e）：
   1) 顶栏紧凑  2) AI标签吸顶在顶栏正下方（之前 top:0 滑到顶栏后面看不见）
   3) 分栏去框去灰：AI回答白底、提问浅蓝底
   4) 输入栏改版：[对比icon] [按住说话] [⌨] [⊕上传]
   电脑端（>600px）完全不受影响
   ============================================ */
#btnPlus { display: none; }
#uploadChips { display: none; }
@media (max-width: 600px) {
  :root { --header-h: 46px; }                      /* 顶栏变矮：三横/管理AI占位更小 */
  body { background: #fff; }
  .main { background: #fff; padding: 0 12px 10px; }
  .header { background: #fff; border-bottom: 1px solid #f0f1f4; }
  .header-inner { padding: 0 6px !important; }
  #btnSidebar { padding: 4px 7px !important; }
  #btnManageAI { font-size: 13px !important; padding: 4px 6px !important; }

  /* AI名称标签：吸顶在顶栏正下方（之前 top:0 被固定顶栏盖住，下滑就看不见） */
  #mobileTabs {
    top: var(--header-h);
    background: #fff;
    margin: 0 -12px 0;
    padding: 6px 10px 8px;
  }
  .mtab { background: #f1f3f6; border: none; padding: 6px 13px; }
  .mtab.mtab-on { background: #111518; }

  /* 分栏去框：无卡片边框阴影，回答白底 */
  .ai-panel {
    background: transparent !important; border: none !important;
    box-shadow: none !important; border-radius: 0 !important;
  }
  .panel-header { display: none !important; }        /* 栏内重复的「● AI名 + 收起」整行去掉，顶部标签已示AI名 */
  .panel-messages { padding: 2px 0 0 !important; }
  .msg.ai    .msg-bubble { background: #fff !important; padding: 6px 2px 6px; }
  .msg.user  .msg-bubble { background: #e3f0ff !important; color: #27456e !important; }

  /* 输入栏（按用户设计图）：[对比icon] [按住说话] [⌨] [⊕] */
  .input-bar { background: #fff; border-top: 1px solid #f0f1f4; }
  .input-inner {
    display: flex; align-items: center; gap: 12px;
    border-radius: 999px !important; padding: 9px 14px !important;
    box-shadow: 0 2px 12px rgba(15,18,28,.08);
  }
  #btnCompare, #btnKB, #btnPlus {
    background: transparent !important; border: none !important;
    box-shadow: none !important; padding: 4px !important; flex: none;
  }
  #btnPlus { display: inline-flex; }
  #btnCompare { order: -2; }
  #holdTalk {
    order: 0; flex: 1; height: auto; padding: 8px 0;
    font-size: 17px; font-weight: 700; color: #111518;
  }
  #btnKB { order: 1; font-size: 19px; }
  #btnPlus { order: 2; }
  #btnSend { order: 3; background: #3b7cff !important; border: none !important; color: #fff !important; border-radius: 999px !important; padding: 7px 18px !important; }
  /* 键盘模式：[对比icon] [输入框] [⊕] [发送] */
  .input-bar:not(.m-voice) #inputText { flex: 1; }
  #btnVoice { display: none !important; }
  /* 已选图片预览条 */
  #uploadChips { display: flex; gap: 8px; padding: 0 14px 6px; overflow-x: auto; }
  .up-chip { position: relative; flex: none; }
  .up-chip img { width: 52px; height: 52px; object-fit: cover; border-radius: 10px; border: 1px solid #e5e8f0; }
  .up-chip span {
    position: absolute; top: -6px; right: -6px; width: 20px; height: 20px;
    background: #111518; color: #fff; border-radius: 50%; font-size: 13px;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
  }
}

/* ============================================
   手机端（v=20260908f）：
   1) 顶栏新增「新对话」图标；管理AI去图标放大、三横放大
   2) 对话文字放大
   3) 输入栏严格按用户设计图：语音模式只有 [对比icon][按住说话][⌨][⊕]，
      不显示发送（松开自动发）；键盘模式 [对比icon][输入框][⊕][发送]
   4) 去掉输入栏底层白框（阴影/圆角），内容贴近输入框
   电脑端不受影响
   ============================================ */
#btnNewChat { display: none; }
@media (max-width: 600px) {
  /* 顶栏按钮 */
  #btnNewChat {
    display: inline-flex; align-items: center;
    position: absolute; left: 42px; top: 50%; transform: translateY(-50%);
    background: transparent !important; border: none !important;
    box-shadow: none !important; padding: 4px 6px !important;
  }
  #btnSidebar svg { width: 22px !important; height: 22px !important; }
  #btnManageAI svg { display: none !important; }          /* 管理AI前面的小格子图标去掉 */
  #btnManageAI { font-size: 15.5px !important; padding: 4px 8px !important; }

  /* 对话文字放大 */
  .msg-bubble { font-size: 16px !important; line-height: 1.7 !important; }

  /* 输入栏：去底层框（无阴影无圆角），贴底紧凑 */
  :root { --footer-h: 60px; }
  .input-inner {
    border-radius: 0 !important; box-shadow: none !important;
    background: transparent !important; padding: 6px 10px !important; gap: 14px;
  }
  /* 语音模式只有4个元素：发送不显示（松开自动发送） */
  .input-bar.m-voice #btnSend { display: none !important; }
  #btnKB svg, #btnPlus svg { display: block; }
  /* 键盘模式：输入框+发送 */
  .input-bar:not(.m-voice) #btnSend { display: inline-flex !important; }
}

/* ============================================
   手机端（v=20260908g）：
   1) 消息区不再限高480px（红圈浪费的空白还给对话内容）
   2) 对话文字再放大到 18px
   电脑端不受影响
   ============================================ */
@media (max-width: 600px) {
  .panel-messages {
    max-height: none !important;      /* 去掉480px限高：内容区域一直顶到输入框上方 */
    min-height: 0 !important;
    padding: 4px 0 8px !important;
  }
  .msg-bubble { font-size: 18px !important; line-height: 1.75 !important; }
  .empty-tip { margin: 40vh auto 0; }  /* 空对话提示仍居中在可视区 */
}

/* ============================================
   手机端（v=20260908h）：右滑防退出双保险
   overscroll-behavior-x:none：页面横向滑到头也不许浏览器接手（不加它页面内滚动
   到边缘会把手势"漏"给浏览器，触发返回）。配合 app.js 里 touchmove 的
   preventDefault（页面主动消费横滑）——豆包/DeepSeek 同款做法；电脑端不受影响
   ============================================ */
@media (max-width: 600px) {
  html, body, .main, .panel-messages, #sidebar {
    overscroll-behavior-x: none;
  }
}

/* ============================================
   手机端（v=20260908i）：右滑退出修复·内容区版
   现象：空白页右滑正常开侧栏，有对话内容就右滑退出网页。
   根因：有内容后手指落在 .panel-messages（纵向滚动容器）里，
   浏览器把它当"未处理的横向手势"→ 触发返回/退出。
   修复：内容区声明 touch-action:pan-y（横向手势必须由页面 JS 消费，
   浏览器不得接手）；AI标签条是横向滚动区，单独声明 pan-x 恢复滚动。
   ============================================ */
@media (max-width: 600px) {
  .main, .panel-messages, .ai-panel, .empty-tip, .input-bar {
    touch-action: pan-y;
  }
  #mobileTabs, #uploadChips {
    touch-action: pan-x;   /* 横向滚动条自己滚（pan-y 的祖先限制到此为止） */
  }
}

/* ============================================
   手机端（v=20260908j）：
   1) 顶栏三横/新对话/管理AI 再放大
   2) 输入栏去上方横线；输入容器改圆弧胶囊 + 底部阴影
   3) 文件预览徽标样式；隐藏侧栏「新对话」
   电脑端不受影响
   ============================================ */
@media (max-width: 600px) {
  /* 顶栏放大 */
  #btnSidebar svg { width: 27px !important; height: 27px !important; }
  #btnNewChat svg { width: 25px !important; height: 25px !important; }
  #btnManageAI { font-size: 17.5px !important; padding: 5px 9px !important; }

  /* 输入栏：去上方横线，输入容器圆弧 + 底部阴影 */
  .input-bar { border-top: none !important; background: transparent; }
  .input-inner {
    background: #fff;
    border-radius: 28px;
    box-shadow: 0 8px 24px rgba(15, 18, 28, .13);
    padding: 8px 16px !important;
  }
  #inputText { border: none !important; background: transparent !important; font-size: 16px !important; }
  #holdTalk  { background: transparent; border: none; }

  /* 侧栏里的「新对话」手机端隐藏（顶栏已有新对话按钮） */
  .sb-new { display: none !important; }
}

/* 手机端（v=20260908j 补）：⌨ 切换按钮两种模式都显示（键盘模式变成麦克风图标）+ 文件徽标 */
@media (max-width: 600px) {
  .input-bar:not(.m-voice) #btnKB { display: inline-flex !important; }
  .up-doc {
    display: flex; align-items: center; gap: 8px;
    background: #f4f5f7; border: 1px solid #e5e8f0; border-radius: 12px;
    padding: 10px 12px; flex: none; max-width: 70vw;
  }
  .up-doc .doc-name { font-size: 13.5px; color: #111518; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .up-doc .doc-x { flex: none; width: 20px; height: 20px; background: #111518; color: #fff; border-radius: 50%; font-size: 12px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
}

/* ============================================
   手机端（v=20260908k）：输入容器圆弧修复
   根因：更早的"去底层框"块用了 !important（透明/无圆角/无阴影），
   把新的圆弧胶囊样式压掉了 → 容器透明、对话内容从背后透出（重叠）。
   这里用同级 !important 且写在文件更后面，优先级更高，覆盖生效。
   同时加大 --footer-h，保证内容不会被输入栏盖住。
   ============================================ */
@media (max-width: 600px) {
  :root { --footer-h: 96px; }   /* 底部预留空间：输入胶囊约70px + 上下留白 */
  .input-inner {
    background: #fff !important;
    border-radius: 28px !important;
    box-shadow: 0 8px 24px rgba(15, 18, 28, .14) !important;
    padding: 8px 16px !important;
  }
}

/* ============================================
   手机端（v=20260908l）：输入栏不透明白底
   内容滚动经过固定在底部的输入栏时，不再从旁边/下面透出来；
   保持无横线，胶囊阴影保留。
   ============================================ */
@media (max-width: 600px) {
  .input-bar { background: #fff !important; box-shadow: none !important; }
}

/* ============================================
   手机端（v=20260908m）：输入胶囊微调
   1) 更贴近屏幕底部  2) 弧度收敛 18px  3) 阴影只朝下不四周发散
   4) 「按住 说话」视觉居中（左右图标宽度不对称，用 padding 补偿）
   5) 三个图标放大
   ============================================ */
@media (max-width: 600px) {
  :root { --footer-h: 88px; }
  .input-inner {
    border-radius: 18px !important;
    box-shadow: 0 5px 14px rgba(15, 18, 28, .13) !important;
    padding: 8px 14px !important;
    margin-bottom: 2px;
  }
  .input-bar { padding-bottom: 2px !important; }
  #holdTalk { padding-left: 50px; }   /* 补偿右侧两图标比左侧一图标宽出的约50px，文字回到屏幕正中 */
  #btnCompare svg { width: 28px !important; height: 28px !important; }
  #btnKB svg      { width: 30px !important; height: 30px !important; }
  #btnPlus svg    { width: 30px !important; height: 30px !important; }
}

/* ============================================
   手机端（v=20260908n）：输入胶囊再调
   1) 再下移：底边贴屏  2) 左右加宽：两侧留白收到 8px
   3) 阴影加深且只朝下（负 spread 收掉上边/两侧的散射）
   4) 「按住 说话」加大加粗（19px/800），居中补偿校准到 52px
   ============================================ */
@media (max-width: 600px) {
  .input-bar { padding-bottom: 0 !important; padding-left: 6px !important; padding-right: 6px !important; }
  .input-inner {
    margin-left: 4px !important;
    margin-right: 4px !important;
    border-radius: 18px !important;
    box-shadow: 0 10px 22px -6px rgba(15, 18, 28, .25) !important;
  }
  #holdTalk { padding-left: 52px; font-size: 19px !important; font-weight: 800 !important; letter-spacing: 1px; }
}

/* ============================================
   手机端（v=20260908o）：输入胶囊图标位置微调
   对比图标左移 / ⌨ 右移一部分 / ⊕ 右移、与文字间隔缩小
   ============================================ */
@media (max-width: 600px) {
  #btnCompare { margin-left: -3px !important; }
  #btnKB      { margin-left: 10px !important; }
  #btnPlus    { margin-right: -3px !important; }
  #holdTalk   { margin-right: -8px; }   /* 文字与 ⊕ 间隔缩小 */
}

/* ============================================
   手机端（v=20260908p）：输入胶囊收窄压扁再下移
   ============================================ */
@media (max-width: 600px) {
  .input-inner {
    margin-left: 10px !important;    /* 左右各收 6px：胶囊变窄 */
    margin-right: 10px !important;
    padding: 5px 12px !important;    /* 上下压扁 */
    margin-bottom: -4px;             /* 整体下移贴屏 */
  }
  #holdTalk { padding-top: 4px; padding-bottom: 4px; }   /* 高度再降一点 */
  #btnKB { margin-left: 18px !important; }               /* ⌨ 再右移 */
}

/* ============================================
   手机端（v=20260908q）：回调
   宽度/高度略回加；⌨ 继续右移；阴影改"小而远"（模糊收小、距离拉大）
   ============================================ */
@media (max-width: 600px) {
  .input-inner {
    margin-left: 5px !important;
    margin-right: 5px !important;
    padding: 7px 12px !important;
    box-shadow: 0 13px 16px -7px rgba(15, 18, 28, .28) !important;
  }
  #btnKB { margin-left: 26px !important; }
}

/* ============================================
   手机端（v=20260908r）：按用户设计图定稿
   1) 胶囊：完全胶囊形（两端半圆）、加高
   2) ⌨ 和 ⊕：46px 细圆环按钮（图标居中在内），⊕ 换成裸加号（圆环由CSS画）
   3) 「按住说话」居中补偿按新图标宽度重算 = 68px
   ============================================ */
@media (max-width: 600px) {
  .input-inner {
    border-radius: 999px !important;
    padding: 9px 12px !important;
    align-items: center;
  }
  #btnKB, #btnPlus {
    width: 46px !important; height: 46px !important;
    padding: 0 !important;
    border: 1.7px solid #14161a !important;
    border-radius: 50% !important;
    background: transparent !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: none;
  }
  #btnKB svg, #btnPlus svg { width: 22px !important; height: 22px !important; }
  #btnKB { margin-left: 10px !important; }
  #btnPlus { margin-right: 0 !important; }
  #holdTalk { padding-left: 68px; padding-top: 0; padding-bottom: 0; font-size: 19px !important; font-weight: 800 !important; }
}

/* ============================================
   手机端（v=20260908s）：撤销 r 块的图标样式改动
   ⌨/⊕ 恢复为原来的裸图标（无圆环、无固定尺寸框）；
   胶囊恢复 18px 圆角、7px 内距；图标恢复 30px；
   ⌨ 位置回到 26px；居中补偿回到 52px；阴影恢复"小而远"。
   ============================================ */
@media (max-width: 600px) {
  .input-inner {
    border-radius: 18px !important;
    padding: 7px 12px !important;
    margin-left: 5px !important;
    margin-right: 5px !important;
    box-shadow: 0 13px 16px -7px rgba(15, 18, 28, .28) !important;
  }
  #btnKB, #btnPlus {
    width: auto !important; height: auto !important;
    border: none !important; border-radius: 0 !important;
    padding: 2px !important;
  }
  #btnCompare svg { width: 28px !important; height: 28px !important; }
  #btnKB svg, #btnPlus svg { width: 30px !important; height: 30px !important; }
  #btnKB { margin-left: 26px !important; }
  #btnPlus { margin-right: -3px !important; }
  #holdTalk { padding-left: 52px; padding-top: 0; padding-bottom: 0; }
}

/* ============================================
   手机端（v=20260908t）：只改阴影这一项
   四周均匀包裹（含上边），紧凑不发散：
   上下左右偏移全为0，模糊 12px（收敛、不糊），透明度 0.2
   其他属性一律未动
   ============================================ */
@media (max-width: 600px) {
  .input-inner {
    box-shadow: 0 0 12px rgba(15, 18, 28, .20) !important;
  }
}

/* ============================================
   手机端（v=20260908u）：四项微调
   1) 输入框高度增加（内距 7→10px）
   2) 再靠近底部（下移 4px）
   3) 「按住说话」加粗到最重（900）
   4) 圆弧 18px → 14px（减一丁点）
   阴影/图标位置等其余属性不动
   ============================================ */
@media (max-width: 600px) {
  .input-inner {
    padding: 10px 12px !important;
    margin-bottom: -8px;
    border-radius: 14px !important;
  }
  #holdTalk { font-weight: 900 !important; }
}

/* ============================================
   手机端（v=20260908v）：输入框贴底 + 四边等距
   之前栏的 min-height 把输入框顶在上方，底部空了约18px，
   而两侧只有11px。改为内容贴底排布（flex-end），
   底部 padding 11px = 两侧距离（栏6px + 胶囊5px），四边等距。
   ============================================ */
@media (max-width: 600px) {
  .input-bar {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 6px 6px 11px !important;
  }
  .input-inner { margin-bottom: 0 !important; }
}

/* 手机端（v=20260908w）：弧度回调 14→18px */
@media (max-width: 600px) {
  .input-inner { border-radius: 18px !important; }
}

/* ============================================
   手机端（v=20260908x）：
   1) 高度再增加（内距 10→12px）
   2) 对比图标右移一丁点（-3px→0）
   3) 按住说话右移（补偿 52→62px）
   4) ⌨ 右移（26→32px）
   5) ⊕ 左移（右缘留 4px）
   6) 阴影收紧：模糊 12→8px，四周包裹不变
   ============================================ */
@media (max-width: 600px) {
  .input-inner { padding: 12px !important; }
  #btnCompare { margin-left: 0 !important; }
  #holdTalk { padding-left: 62px; }
  #btnKB { margin-left: 32px !important; }
  #btnPlus { margin-right: 4px !important; }
  .input-inner { box-shadow: 0 0 8px rgba(15, 18, 28, .22) !important; }
}

/* ============================================
   手机端（v=20260908y）：继续同方向微调
   1) 阴影加深（透明度 .22→.32）
   2) 对比图标再右移（0→5px）
   3) 按住说话再右移（62→72px）
   4) ⌨ 再右移（32→38px）
   5) ⊕ 再左移（右缘留 10px）
   ============================================ */
@media (max-width: 600px) {
  .input-inner { box-shadow: 0 0 8px rgba(15, 18, 28, .32) !important; }
  #btnCompare { margin-left: 5px !important; }
  #holdTalk { padding-left: 72px; }
  #btnKB { margin-left: 38px !important; }
  #btnPlus { margin-right: 10px !important; }
}

/* ============================================
   手机端（v=20260908z）：去"两层" + 五项微调
   两层根因：全局旧样式给 .input-inner 加了 1px 灰边框，
   叠在白色胶囊上视觉成两层 → 手机端去掉边框
   1) 高度降低（内距 12→9px）
   2) 对比图标左移（5→0px）
   3) 按住说话变细（900→600）并右移（72→80px）
   4) ⌨ 右移（38→44px）
   5) ⊕ 右移（右缘 10→5px）
   ============================================ */
@media (max-width: 600px) {
  .input-inner { border: none !important; padding: 9px 12px !important; }
  #btnCompare { margin-left: 0 !important; }
  #holdTalk { padding-left: 80px; font-weight: 600 !important; }
  #btnKB { margin-left: 44px !important; }
  #btnPlus { margin-right: 5px !important; }
}

/* ============================================
   手机端（v=20260909a）：
   1) 阴影再加深（.32→.42）
   2) 高度增加一点点（内距 9→11px）
   3) 按住说话/⌨/⊕ 三个都右移
   4) 按住说话加粗（600→800）
   5) 修复夸克浏览器「按住说话」换行：强制单行不折行
      （不同浏览器字体宽度略有差异，padding 挤压后换行）
   ============================================ */
@media (max-width: 600px) {
  .input-inner { box-shadow: 0 0 8px rgba(15, 18, 28, .42) !important; padding: 11px 12px !important; }
  #holdTalk { padding-left: 88px; font-weight: 800 !important; white-space: nowrap; }
  #btnKB { margin-left: 50px !important; }
  #btnPlus { margin-right: 0 !important; }
}

/* ============================================
   手机端（v=20260909b）：修复 ⊕ 掉到第二行（两浏览器都乱）
   根因：上一轮右移量叠加（88+50+0）超过胶囊可用宽度，
   加上全局有 flex-wrap:wrap，放不下就把 ⊕ 折到下一行。
   修复：强制单行不折行 + 右移量收敛到安全值（保持右移方向但不溢出）
   ============================================ */
@media (max-width: 600px) {
  .input-inner { flex-wrap: nowrap !important; }
  #holdTalk { padding-left: 40px; white-space: nowrap; min-width: 0; }
  #btnKB { margin-left: 30px !important; }
  #btnPlus { margin-right: 2px !important; flex: none; }
}

/* ============================================
   手机端（v=20260909c）：
   1) 阴影收紧（模糊 8→5px，更贴边不飘），浓度微加深
   2) ⌨ 右移（30→36px）
   3) 按住说话加粗一点点（800→900）并右移（40→48px）
   ============================================ */
@media (max-width: 600px) {
  .input-inner { box-shadow: 0 0 5px rgba(15, 18, 28, .45) !important; }
  #btnKB { margin-left: 36px !important; }
  #holdTalk { padding-left: 48px; font-weight: 900 !important; }
}

/* ============================================
   手机端（v=20260909d）：
   1) 按住说话：900→800（细回一档）并右移（48→56px）
   2) ⌨ 右移（36→42px）
   ============================================ */
@media (max-width: 600px) {
  #holdTalk { padding-left: 56px; font-weight: 800 !important; }
  #btnKB { margin-left: 42px !important; }
}

/* ============================================
   手机端（v=20260909e）：
   1) 按住说话：加粗（800→900）、缩小字号（19→18px）、右移（56→60px）
   2) ⌨ 右移（42→46px）
   3) 输入框整体宽高各减一丁点：高度内距 11→10px，左右留白 5→7px
   ============================================ */
@media (max-width: 600px) {
  #holdTalk { font-weight: 900 !important; font-size: 18px !important; padding-left: 60px; }
  #btnKB { margin-left: 46px !important; }
  .input-inner { padding: 10px 12px !important; margin-left: 7px !important; margin-right: 7px !important; }
}

/* ============================================
   手机端（v=20260909f）：
   1) 对比图标左移一点（0→-3px）
   2) 按住说话：900→800（注：800与900多数机型同字重，若仍粗退700）多右移（60→66）
   3) ⌨ 多右移（46→50px）
   4) ⊕ 右移一点（右缘 2→0px）
   5) 阴影减淡一丁点（.45→.40）
   ============================================ */
@media (max-width: 600px) {
  #btnCompare { margin-left: -3px !important; }
  #holdTalk { font-weight: 800 !important; padding-left: 66px; }
  #btnKB { margin-left: 50px !important; }
  #btnPlus { margin-right: 0 !important; }
  .input-inner { box-shadow: 0 0 5px rgba(15, 18, 28, .40) !important; }
}

/* ============================================
   手机端（v=20260909g）：
   1) ⌨ 右移（50→54px）
   2) 按住说话：加粗（→900）、加大字号（18→19px）、右移（66→70px）
   ============================================ */
@media (max-width: 600px) {
  #btnKB { margin-left: 54px !important; }
  #holdTalk { font-weight: 900 !important; font-size: 19px !important; padding-left: 70px; }
}

/* ============================================
   手机端（v=20260909h）：
   1) ⌨ 再右移（54→58px）
   2) 按住说话：字重减回800、字号 19→18px、再右移（70→74px）
   ============================================ */
@media (max-width: 600px) {
  #btnKB { margin-left: 58px !important; }
  #holdTalk { font-weight: 800 !important; font-size: 18px !important; padding-left: 74px; }
}

/* ============================================
   手机端（v=20260909i）：
   1) 按住说话：加粗一丁点（800→900）再右移（74→76px）
   2) ⌨ 再右移（58→60px）
   ============================================ */
@media (max-width: 600px) {
  #holdTalk { font-weight: 900 !important; padding-left: 76px; }
  #btnKB { margin-left: 60px !important; }
}

/* 手机端（v=20260909j）：按住说话(76→80px) 与 ⌨(60→64px) 继续右移 */
@media (max-width: 600px) {
  #holdTalk { padding-left: 80px; }
  #btnKB { margin-left: 64px !important; }
}

/* 手机端（v=20260909k）：按住说话(80→84px) 与 ⌨(64→68px) 再右移一点 */
@media (max-width: 600px) {
  #holdTalk { padding-left: 84px; }
  #btnKB { margin-left: 68px !important; }
}

/* 手机端（v=20260909l）：按住说话(84→88px) 与 ⌨(68→72px) 继续右移 */
@media (max-width: 600px) {
  #holdTalk { padding-left: 88px; }
  #btnKB { margin-left: 72px !important; }
}

/* 手机端（v=20260909m）：按住说话(88→92px) 与 ⌨(72→76px) 继续右移 */
@media (max-width: 600px) {
  #holdTalk { padding-left: 92px; }
  #btnKB { margin-left: 76px !important; }
}

/* 手机端（v=20260909n）：按住说话(92→96px) 与 ⌨(76→80px) 再右移 */
@media (max-width: 600px) {
  #holdTalk { padding-left: 96px; }
  #btnKB { margin-left: 80px !important; }
}

/* 手机端（v=20260909o）：按住说话(96→100px) 与 ⌨(80→84px) 再右移 */
@media (max-width: 600px) {
  #holdTalk { padding-left: 100px; }
  #btnKB { margin-left: 84px !important; }
}

/* 手机端（v=20260909q）：压缩输入栏占高、给对话文字让空间（不动胶囊本身）
   根因：--footer-h=88px 把整条输入栏定死高度，胶囊贴底后顶部空出约20px白带。
   修复：胶囊还原原样(padding 10px 12px、栏 padding 6/6/11)，
   只把预留高度 88→72px，整条栏矮16px → 内容区自动高16px，白带消失 */
@media (max-width: 600px) {
  .input-bar { padding: 6px 6px 11px !important; }
  .input-inner { padding: 10px 12px !important; }
  :root { --footer-h: 72px; }
}

/* 手机端（v=20260909r）：左上角 ☰ 与 ＋ 间隔稍微加大（加号 42→48px） */
@media (max-width: 600px) {
  #btnNewChat { left: 48px; }
}

/* ============================================
   手机端（v=20260909t）：文字输入模式仿豆包样式（图标功能全部不变）
   1) 修 bug：切到文字模式点不动——根因：输入框在语音模式 display:none 时
      被算出 height:0px 行内样式，切回来仍是0高（截图左上角溢出的"00"就是它）
      → CSS min-height 兜底 + JS 切换时重算高度
   2) 样式仿豆包：大圆角白卡 + 浅阴影，文字居左、图标靠右、间距收紧
   ============================================ */
@media (max-width: 600px) {
  .input-bar:not(.m-voice) .input-inner {
    border-radius: 22px !important;
    padding: 12px 14px !important;
    box-shadow: 0 2px 10px rgba(15, 18, 28, .10) !important;
    gap: 10px;
    align-items: center;
  }
  .input-bar:not(.m-voice) #inputText {
    min-height: 26px !important;          /* 0高兜底，保证可点可聚焦 */
    max-height: 110px;
    font-size: 16.5px !important;
    line-height: 1.5;
    padding: 3px 2px !important;
    align-self: center;
  }
  .input-bar:not(.m-voice) #inputText::placeholder { color: #a9b1bf; }
  /* 文字模式下取消语音模式那一套"右移补偿"数值，回归正常间距 */
  .input-bar:not(.m-voice) #btnCompare { margin-left: 0 !important; }
  .input-bar:not(.m-voice) #btnKB      { margin-left: 0 !important; }
  .input-bar:not(.m-voice) #btnPlus    { margin-right: 0 !important; }
  .input-bar:not(.m-voice) #btnKB svg,
  .input-bar:not(.m-voice) #btnPlus svg { width: 26px !important; height: 26px !important; }
  .input-bar:not(.m-voice) #btnSend { padding: 8px 18px !important; font-size: 15px !important; }
}

/* ============================================
   手机端（v=20260909u）：文字模式发送按钮改豆包式蓝色圆形↑
   （箭头 SVG 由 JS 注入；电脑端仍为"发送"文字胶囊不受影响）
   ============================================ */
@media (max-width: 600px) {
  .input-bar:not(.m-voice) #btnSend {
    width: 28px !important; height: 28px !important; min-width: 28px !important;
    padding: 0 !important; border-radius: 50% !important;
    display: inline-flex !important; align-items: center !important; justify-content: center !important;
    flex: none;
  }
  .input-bar:not(.m-voice) #btnSend svg { width: 14px !important; height: 14px !important; }
}

/* ============================================
   管理AI：自定义排序按钮（↑↓）
   预设卡片/自定义列表每项都有上下移按钮，点击后立即重排并记住顺序
   ============================================ */
.ai-card-ops, .ai-item-ops { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.ai-item-ops { justify-content: flex-start; }
.btn-order {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 26px; font-size: 14px; color: #667085;
  background: #f2f4f7; border-radius: 7px; cursor: pointer;
  user-select: none; -webkit-user-select: none;
}
.btn-order:active { background: #dfe3ea; }
.order-hint { font-size: 12px; color: #9aa3b2; margin-left: 4px; }
@media (max-width: 600px) {
  .btn-order { width: 34px; height: 30px; font-size: 16px; }  /* 手机触控更大 */
  .order-hint { font-size: 11px; }
}

/* ============================================
   手机端（v=20260909y）：修复"回复内容底部被输入栏挡住"
   根因：--footer-h 写死 72px，手机浏览器字体放大后输入栏实际更高。
   输入栏 min-height 交给内容（高度自适应），底部预留改由 JS 实测写入
   （见 app.js 末尾 syncFooterH），两者配合后内容永远能滚到输入栏上方
   ============================================ */
@media (max-width: 600px) {
  .input-bar { min-height: 0 !important; }
}

/* ============================================
   手机端（v=20260909z）：根治"回复内容底部被输入栏挡住"
   实测根因：.main 的 margin-bottom 在文档末尾不产生可滚动空间
  （外边距塌陷），导致无论预留多少，滚到底内容都被输入栏压住。
   修复：margin 归零，改用 body 的 padding-bottom（不会塌陷、
   必定计入滚动高度）；高度值仍由 app.js syncFooterH 实测输入栏
   高度动态写入 --footer-h，输入栏变高时预留自动跟着变
   ============================================ */
@media (max-width: 600px) {
  .main { margin-bottom: 0 !important; }
  body { padding-bottom: var(--footer-h) !important; }
}

/* ============================================
   手机端（v=20260910a）：底部遮挡最终修法（浏览器实测定位）
   html,body{height:100%} 下，.main 的 margin-bottom 与 body 的
   padding-bottom 在长内容时都不计入滚动范围（实测仍挡47px）。
   唯一可靠：给 .main 自身加 padding-bottom —— 元素自身 padding
   必定计入内容高度，滚到底时最后一行必然停在输入栏上方
   ============================================ */
@media (max-width: 600px) {
  body { padding-bottom: 0 !important; }
  .main { padding-bottom: calc(var(--footer-h) + 14px) !important; }
}

/* ── 侧栏标题分组（20260909）：各区内部文件夹 ── */
.grp-title { cursor: pointer; gap: 6px; display: flex; align-items: center; }
.grp-title:hover { color: var(--text, #333); }
.grp-title .cat-arrow { font-size: 10px; color: #59637a; }
.sb-add { margin-left: auto; font-size: 13px; opacity: 0; cursor: pointer; padding: 0 4px; border-radius: 4px; }
.sb-title:hover .sb-add { opacity: .7; }
.sb-add:hover { opacity: 1 !important; background: rgba(90,120,255,.15); }

/* ── 侧栏分组视觉优化（20260913s）：色块=裹住文字的小胶囊(grp-chip)，⋯固定最右 ── */
.sb-add { opacity: .45; }                       /* ＋常显，不再悬停才出现 */
.sb-title:hover .sb-add { opacity: 1; }
.grp-title {
  display: flex; align-items: center; gap: 6px;
  background: none;                              /* 行本身无底色（色块在 chip 上） */
  padding: 0; margin: 1px 4px;
  cursor: pointer; font-size: 12px; font-weight: 600;
}
.grp-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(110,135,220,.10);
  border-radius: 8px; padding: 1px 8px;
  max-width: calc(100% - 40px);                  /* 留出⋯的位置 */
}
.grp-title:hover .grp-chip { background: rgba(110,135,220,.18); }
.grp-title .cat-arrow { font-size: 10px; color: #59637a; flex: none; }
.grp-title svg { flex: none; }
.grp-title .gname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grp-title .gcnt { font-size: 11px; opacity: .5; flex: none; }
.grp-title .sb-more { margin-left: auto; margin-right: -4px; }   /* -4px 抵消行边距，与对话行⋯对齐（20260913t） */
.grp-body { margin-left: 16px; padding-left: 6px; border-left: 2px solid rgba(110,135,220,.25); }

/* ── 菜单里的分组区块：浅蓝底色块，与 重命名/置顶/删除 等操作项区分 ── */
.ctx-grp-block {
  background: rgba(110,135,220,.18);
  border-radius: 0;
  margin: 4px 0;
  padding: 3px 0;
}
.ctx-grp-label { padding: 4px 12px 2px; font-size: 11px; color: #7a86a8; font-weight: 600; }

/* ── 菜单内 新建分组/移出分组 灰底，与可选分组名区分（20260909-3） ── */
.ctx-item-muted { background: rgba(120,130,150,.10); border-radius: 6px; margin: 2px 6px; }
.ctx-item-muted:hover { background: rgba(120,130,150,.18); }

/* ── 移动端：区标题 ＋/折叠箭头 加大点击区、拉开间距；行尾⋯也加大（20260910d） ── */
@media (max-width: 600px) {
  .sb-title { gap: 0; }
  /* ── 手机端：⋯ 常驻显示 + 标题与 ⋯ 保持最小间隔 ──
     长按标题弹菜单已取消（小米等浏览器长按仍会弹系统工具栏且关不掉），
     ⋯ 成为唯一操作入口，必须让用户一眼看到（20260912a） */
  .sb-item .sb-del.sb-more { display: block; }
  .sb-item { padding-right: 46px !important; }   /* 预留 ⋯ 位置，标题再长也不重叠 */
  .sb-item .sb-item-main { max-width: calc(100% - 50px) !important; }
  .sb-title .sb-add {
    font-size: 17px; opacity: .55;
    padding: 9px 12px;            /* 热区约38px见方 */
    margin-right: 2px;
  }
  .sb-title .sb-add:hover { opacity: 1; }
  .sb-title .cat-arrow {
    font-size: 13px;
    padding: 9px 12px;            /* 折叠箭头同样38px热区 */
  }
  /* 行尾 ⋯ 与分组行 ⋯ 热区加大（视觉位置不变） */
  .sb-item .sb-more, .grp-title .sb-more {
    font-size: 16px;
    padding: 8px 6px;
    margin: -8px -4px -8px 0;
  }
  /* ── 方案1（20260912d/e）：⋯ 减淡 + 所有行统一同一套定位 ──
     之前对话行用 top:50% 居中、分组行还是旧 top:6px 贴顶 → 高低不一（20260912e 统一） */
  .grp-title { position: relative; }   /* 让组内 ⋯ 的 absolute 有参照物 */
  .sb-item .sb-more, .grp-title .sb-more {
    font-size: 15px !important;
    color: #bcc3cf !important;      /* 很浅的灰，不吵眼 */
    font-weight: 400 !important;
    position: absolute !important;
    top: 50% !important;
    right: 8px !important;
    transform: translateY(-50%);
    margin: 0 !important;
    padding: 12px 8px !important;   /* 热区约 39px 见方 */
  }
  .sb-item.active .sb-more, .sb-item:hover .sb-more { color: #8a93a3 !important; }
  .grp-title .sb-more { right: 4px !important; }   /* 抵消分组行4px边距，与对话行⋯对齐（20260913t） */
}

/* ── 移动端：侧栏字体/图标整体增大（20260910e） ── */
@media (max-width: 600px) {
  .sb-title { font-size: 14px !important; }
  .sb-item, .sb-item .sb-item-main { font-size: 16px; }
  .sb-item { padding-top: 10px; padding-bottom: 10px; }   /* 行高同步加大，更好点 */
  .sb-item .cat-arrow { font-size: 13px; }
  .sb-item .sb-del, .sb-item .sb-more, .grp-title .sb-more { font-size: 18px; }
  .grp-title { font-size: 14px; }
  .grp-title .gcnt { font-size: 12px; }
  .cmp-time { font-size: 12px; }
  .sb-empty { font-size: 13px; }
  .sb-account { font-size: 15px; }
}

/* ── 移动端：侧栏字体/图标再增大（20260910f） ── */
@media (max-width: 600px) {
  .sb-title { font-size: 15px !important; }
  .sb-item, .sb-item .sb-item-main { font-size: 17.5px; }
  .sb-item { padding-top: 11px; padding-bottom: 11px; }
  .sb-item .sb-del, .sb-item .sb-more, .grp-title .sb-more { font-size: 20px; }
  .grp-title { font-size: 15.5px; }
  .grp-title .gcnt { font-size: 13px; }
  .cmp-time { font-size: 13px; }
  .sb-account { font-size: 16px; }
  .sb-account .acct-name { font-size: 16px; }
}

/* ── 移动端：长按/⋯ 弹出菜单的字体图标增大（20260910g） ── */
@media (max-width: 600px) {
  .ctx-menu-pop { min-width: 168px; }
  .ctx-item { font-size: 16px; padding: 12px 16px; gap: 10px; }
  .ctx-item svg { width: 18px; height: 18px; }
  .ctx-grp-block .ctx-item { font-size: 16px; }
}

/* ── 菜单阴影再加大（20260910i） ── */
.ctx-menu-pop {
  box-shadow: 0 18px 56px rgba(0,0,0,.38), 0 4px 14px rgba(0,0,0,.18);
}

/* ── 输入条防长按弹系统菜单（20260910k）──
   长按"00"/按住说话/按钮会选中文字弹出系统菜单（全选/复制/问AI），
   控件区一律禁止选中文本；textarea(#inputText) 打字不受影响 */
.input-bar button, .input-bar div, #holdTalk {
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
}

/* ── 侧栏条目防长按选中文字（20260911a）──
   长按历史标题时浏览器先把文字选中（蓝色高亮），导致操作菜单弹不出来；
   侧栏条目一律禁止选中——长按只弹"重命名/置顶…"菜单，不再出现蓝色选中 */
#sidebar .sb-item, #sidebar .sb-item-main, #sidebar .grp-title,
#sidebar .sb-item * {
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
}

/* ── 对比结果右下角关闭（20260911d）──
   与右上角"关闭"完全同款（btn-small btn-secondary + 12px/600字重），
   排在内容末尾、右下角对齐；不悬浮防误触；对比关闭时自动隐藏 */
.compare-close-fab {
  display: none;
  margin: 2px 16px 16px auto;   /* block + margin-left:auto → 右下角对齐 */
  font-size: 12px;
  font-weight: 600;             /* 与右上角关闭按钮同粗度 */
}
body.compare-open .compare-close-fab { display: block; }

/* ── "已对比"标记（20260911h：青绿色块方案，问答同色系）──
   问题气泡：淡青绿色块；右上角迷你青标（点击弹菜单）；
   对应 AI 回答：更浅的青绿色块 + 同款迷你青标，位置在回答底部（同样可点击）。
   ★必须 !important：手机端媒体查询里有 .msg-bubble 白底 !important 规则会盖掉色块 */
.ai-panel .msg { position: relative; }   /* 迷你角标的定位基准 */
.msg.user.cmp-q-mark .msg-bubble {
  background: #d9f2ea !important;
  color: #12463b !important;
}
.msg.ai.cmp-ans .msg-bubble {
  background: #e8f7f1 !important;
}
.cmp-badge {
  position: absolute;
  top: -9px;
  right: 10px;
  z-index: 2;
  padding: 1px 9px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.6;
  border-radius: 999px;
  background: #17a087;
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 1px 5px rgba(15, 130, 110, .35);
  -webkit-user-select: none;
  user-select: none;
}
/* 回答的"已对比"小标：不悬浮，正常流内右对齐（在按钮行上方），
   用负上边距把小标"拉上去"一半压住绿色气泡底边——与问题小标半压气泡顶边对称（20260911k） */
.msg.ai.cmp-ans .cmp-badge {
  position: relative;
  display: block;
  width: max-content;
  margin: -10px 10px -3px auto;
  z-index: 2;
}
.cmp-badge:hover { background: #0f8a73; }

/* 手机端长按折叠按钮弹出的"全部折叠/全部展开"菜单（桌面仍走 hover） */
.fold-wrap.fold-open .fold-menu { display: block; }
.fold-wrap.fold-open::after { display: block; }

/* 角标菜单：图标+文字左对齐，图标 16px 统一（与 app.js 里 SVG 同规格） */
.cmp-choice-item { display: flex; align-items: center; gap: 9px; text-align: left; }
.cmp-choice-item .ci { flex: 0 0 16px; display: inline-flex; justify-content: center; }
.cmp-choice-item .ct { flex: 1; text-align: left; }

/* ── 阻止浏览器长按弹"全选/复制/搜索"系统菜单（20260911f）──
   侧栏/对话内容/对比界面：禁止文字选中 + 禁用长按呼出菜单
   （代价：这些区域不能长按复制文字；回答有复制按钮，影响可控） */
#sidebar, .compare-section, .panel-messages, .msg-bubble, .ctx-menu-pop {
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
}

/* ── 分区恢复文字选择（20260912b）：
   对话正文气泡 + 对比界面正文允许长按选中复制——这两处长按弹出的系统"复制"菜单
   正是用户想要的；侧栏标题/按钮行维持上面的禁止，长按依旧不弹任何东西 ── */
.msg-bubble, .compare-section, .compare-section * {
  -webkit-user-select: text !important;
  user-select: text !important;
  -webkit-touch-callout: default !important;
}
/* 对比界面里的按钮（关闭/查看原问答等）不算正文，维持禁止 */
.compare-section button, .compare-section button * {
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
}

/* ── 按住说话全屏覆盖层（20260910m）：松手发送/上移取消 + 音波跳动 ── */
#voiceOverlay {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding-bottom: 30px;
  /* 平底色带（像素制）：底部150px实心橙（文字区必在实心内），
     向上约300px内平滑渐隐完（约占屏1/3，不再铺满屏），14个过渡点每步≤0.09无分界线 */
  background: linear-gradient(0deg,
    #ff9450 0px,
    #ff9e58 55px,
    #ff9e58 150px,
    rgba(255,162,92,.95) 170px,
    rgba(255,167,98,.88) 190px,
    rgba(255,173,106,.81) 210px,
    rgba(255,180,115,.73) 230px,
    rgba(255,187,126,.65) 250px,
    rgba(255,194,138,.56) 270px,
    rgba(255,201,150,.47) 290px,
    rgba(255,209,162,.38) 310px,
    rgba(255,216,175,.29) 330px,
    rgba(255,223,189,.21) 350px,
    rgba(255,230,202,.13) 370px,
    rgba(255,237,215,.07) 390px,
    rgba(255,243,228,.02) 415px,
    rgba(255,255,255,0) 445px
  );
  opacity: 0; pointer-events: none; transition: opacity .18s;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
#voiceOverlay.on { opacity: 1; pointer-events: auto; }
#voText { font-size: 14.5px; color: rgba(255,255,255,.8); font-weight: 400; margin-bottom: 10px; }
#voiceOverlay.cancel #voText { color: rgba(255,255,255,.55); }
#voWave { display: flex; align-items: center; justify-content: center; gap: 4px; height: 72px; }
#voWave i {
  display: block; width: 4px; min-height: 5px; border-radius: 2px;
  background: #fff; transition: height .09s linear;
}
#voiceOverlay.cancel #voWave i { background: rgba(255,255,255,.45); }
/* 录音期间隐藏输入条卡片（露出红色录音条不好看） */
.input-bar.vo-rec .input-inner { visibility: hidden; }

/* 输入框滚动条隐藏（手机上灰色滑块常驻碍眼） */
#inputText::-webkit-scrollbar { width: 0; height: 0; }
#inputText { scrollbar-width: none; }

/* ══ 手机端：放大消息操作行按钮（复制/折叠/分类/收藏/分享）便于手指点击 ══
   仅 ≤600px 手机生效；电脑端尺寸保持不变（电脑端已有的 20px !important 规则
   在本块之后不生效，本块靠"文件更靠后 + !important"取胜） */
@media (max-width: 600px) {
  /* 间隔收紧统一保证 5 个按钮整行放得下；整行靠右（贴气泡一侧，20260912a） */
  .msg-actions { gap: 4px !important; margin-top: 7px !important; justify-content: flex-end !important; }
  .msg-actions > button,
  .msg-actions .fold-wrap,
  .msg-actions .fold-wrap > button {
    height: 30px !important;
    min-height: 30px !important;
    font-size: 12px !important;
    padding: 0 7px !important;
    border-radius: 8px !important;
    gap: 3px;
  }
  /* 按钮里的图标同步放大（复制/分类为镂空 SVG，折叠/收藏/分享为符号） */
  .msg-actions > button svg,
  .msg-actions .fold-wrap > button svg { width: 15px !important; height: 15px !important; }
  /* 长按弹出的「全部折叠/全部展开」菜单也放大，跟按钮同规格 */
  .fold-menu-item { font-size: 13.5px !important; padding: 10px 14px !important; }
  .fold-menu { min-width: 104px !important; }
  /* 「已对比」小标同步放大一点，方便点击 */
  .cmp-badge { font-size: 11.5px !important; padding: 2px 11px !important; }
  /* 回答小标：手机端小标更高，上移量同步加大，保持"半压绿框" */
  .msg.ai.cmp-ans .cmp-badge { margin-top: -12px !important; margin-right: 8px !important; }
  /* ── 手机端禁用 fold-wrap 悬停菜单（20260912d）──
     手机浏览器"点一下=粘性悬停"，点折叠按钮会把电脑端的悬停菜单也带出来，
     折叠后它还自己同步成「展开本条/全部展开」一直挂着。手机统一用点按弹出的
     三选项菜单（app.js openFoldMenu），悬停菜单整条禁用 */
  .fold-wrap .fold-menu,
  .fold-wrap.fold-open .fold-menu,
  .fold-wrap.fold-open::after,
  .fold-wrap:hover .fold-menu,
  .fold-wrap:hover::after { display: none !important; }
}

/* ============================================
   电脑端侧栏微调（20260913l，手机端不动）
   必须放在文件最末尾：排在 .grp-title/.gcnt 基础规则之后，否则被级联覆盖
   ============================================ */
@media (min-width: 601px) {
  .cmpfav-title { font-weight: 600; font-size: 13.5px; }
  .cmpfav-title .grp-chip { background: rgba(110,135,220,.28) !important; }
  .cmpfav-title:hover .grp-chip { background: rgba(110,135,220,.38) !important; }
  .cmpfav-title .gcnt { opacity: .9; }
  .grp-title { margin: 1px 4px; }
  .sb-item { font-size: 15px; }
}

/* ============================================
   当前对话高亮通边（20260914a，电脑手机都生效）
   侧栏容器 padding 左右各12px，用负边距拉回贴墙；文字位置不变（内边距补回）
   ============================================ */
.sb-item.sb-cur {
  margin-left: -12px;
  margin-right: -12px;
  padding-left: 22px;
  padding-right: 22px;
  border-radius: 0;
}
