.usage-ledger { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.usage-row { display: grid; grid-template-columns: minmax(72px, 120px) minmax(96px, 160px) 1fr; gap: 8px 12px; align-items: baseline; font-size: 13px; }
.usage-name { font-weight: 600; }
.usage-models { min-width: 0; }
.usage-empty { margin: 0; color: var(--danger); font-size: 13px; }
.reply-fail {
  color: var(--danger);
  max-width: min(100%, 560px);
  overflow-wrap: anywhere;
  white-space: normal;
}
.reask-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow: auto; margin: 8px 0 12px; }
.reask-row { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.reask-row input { margin-top: 3px; }

/* ============================================================
   Chrome — 壳层收口(最后加载)
   · 桌面不占顶栏,聊天从画布顶端开始
   · 主题切换收进侧边栏品牌行
   · 移动端只留一颗悬浮汉堡
   · 侧边栏控件不再叠「卡片方块」
   ============================================================ */

/* ---------- 1. 顶栏:桌面彻底撤掉 ---------- */
.topbar { display: none !important; height: 0 !important; padding: 0 !important; border: 0 !important; }

/* 汉堡默认隐藏;移动端悬浮在主区左上,不占文档流 */
.hamburger-btn {
  display: none;
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: max(10px, env(safe-area-inset-left));
  z-index: 80;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg-surface) 86%, transparent);
  color: var(--text-secondary);
  box-shadow: none;
}
.hamburger-btn:hover { background: var(--bg-hover); color: var(--text); }

@media (max-width: 768px) {
  .hamburger-btn { display: inline-flex; }
  /* 给首屏内容让出汉堡的落点,避免和空状态/首条消息重叠 */
  .messages { padding-top: 52px; }
  .empty-state { padding-top: max(8vh, 64px); padding-bottom: 24px; }
}

/* 侧边栏折叠后的展开钮:贴主区左上,不再为顶栏让位 */
.sidebar-float-btn {
  top: 12px;
  left: 12px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  color: var(--text-secondary);
}
.sidebar-float-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
  box-shadow: none;
  transform: none;
}

/* ---------- 2. 品牌行:logo 左,主题/收起右,不再撑满 ---------- */
.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  padding: 16px 10px 10px;
}
.sidebar-brand .brand-logo {
  order: 0;
  flex: 0 0 auto;
  width: auto;
  max-width: 132px;
  max-height: 28px;
  height: 28px;
  margin-right: auto;
  object-fit: contain;
  object-position: left center;
}
.theme-toggle-btn { order: 1; }
.sidebar-collapse-btn { order: 2; }
.sidebar-collapse-btn,
.theme-toggle-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin: 0;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-tertiary);
  box-shadow: none;
}
.sidebar-collapse-btn:hover,
.theme-toggle-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

/* ---------- 3. 动作行:新建对话是唯一实心按钮 ---------- */
.sidebar-header { padding: 2px 10px 8px; }
.new-chat-btn {
  height: 36px;
  padding: 0 12px;
  justify-content: center;
  border: none;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: none;
  transform: none;
}
.new-chat-btn:hover {
  background: var(--brand-soft-strong);
  color: var(--brand);
  box-shadow: none;
  transform: none;
}
.new-chat-btn:active { transform: none; background: var(--brand-soft-strong); }
.new-chat-btn svg { color: currentColor; }

/* 模型选择:次级行,比新建对话更轻 */
.sidebar-model-wrap { padding: 0 10px 10px; }
.sidebar-model-wrap .model-picker {
  height: 32px;
  padding: 0 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.sidebar-model-wrap .model-picker:hover {
  background: var(--bg-hover);
  border: none;
  box-shadow: none;
}
.sidebar-model-wrap .model-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  flex: 1;
  min-width: 0;
  max-width: none;
}
.sidebar-model-wrap .model-icon { color: var(--text-tertiary); }
.model-health,
.model-pin-mark {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.model-health {
  margin-left: auto;
  color: var(--text-tertiary);
}
.model-health.ok { color: #16a34a; }
.model-health.bad { color: #f0a8a8; }
.model-health.idle { color: #a3aab6; }
.model-health .oc-icon {
  width: 14px;
  height: 14px;
}
.model-pin-mark {
  margin-left: 4px;
  color: var(--brand);
}
.model-pin-mark.solo { margin-left: auto; }
.model-pin-mark .oc-icon {
  width: 14px;
  height: 14px;
}
.model-picker.is-pinned .model-name { color: var(--text); }
.oc-menu-item {
  justify-content: flex-start;
}
.oc-menu-item .item-label {
  flex: 1;
  min-width: 0;
}
.oc-menu-item .check {
  margin-left: 2px;
}
.oc-menu-pin {
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  margin-left: 0;
}
.oc-menu-health {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 4px;
  flex-shrink: 0;
  color: var(--text-tertiary);
}
.oc-menu-health.ok { color: #16a34a; }
.oc-menu-health.bad { color: #f0a8a8; }
.oc-menu-health.idle { color: #a3aab6; }
.oc-menu-health .oc-icon {
  width: 14px;
  height: 14px;
}
.oc-menu-pin .oc-icon {
  width: 15px;
  height: 15px;
}
.oc-menu-pin:hover { background: var(--bg-active); color: var(--text); }
.oc-menu-pin.active { color: var(--brand); }
.oc-menu-pin.active .oc-icon { stroke-width: 2; }

/* 搜索:独立浅底,和会话列表分开 */
.chat-list { padding: 0 0 8px; gap: 1px; }
.chat-search {
  height: 32px;
  margin: 0 10px 8px;
  padding: 0 10px;
  border: none;
  border-radius: 8px;
  background: var(--bg-hover);
  box-shadow: none;
}
.chat-search:focus-within {
  background: var(--bg-active);
  border: none;
  box-shadow: none;
}
.chat-search input { font-size: 12.5px; }
.chat-search svg { color: var(--text-tertiary); }
.chat-search input::selection,
.oc-menu-search::selection {
  background: var(--bg-active);
  color: var(--text);
}

/* 时间分组:字更小、更淡,左右与会话行对齐 */
.chat-group {
  padding: 12px 14px 4px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-tertiary);
  border-radius: 0;
}
.chat-group-count {
  background: transparent;
  padding: 0;
  font-weight: 500;
}

/* 会话行:左右内缩,选中只改字色+浅底,去掉左指示条 */
.chat-item-wrap { padding: 0 6px; width: auto; }
.chat-item {
  height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 450;
}
.chat-item.active {
  background: var(--bg-hover);
  color: var(--text);
  font-weight: 550;
}
.chat-item.active::before { display: none; }
.chat-item.active .chat-icon { color: var(--text-secondary); }

/* 底部分隔极淡,账户行与上方对齐 */
.sidebar-footer {
  padding: 4px 6px 6px;
  border-top: 1px solid color-mix(in srgb, var(--hairline) 70%, transparent);
  margin-top: 0;
}
.account-chip {
  padding: 3px 8px;
  border-radius: 8px;
  background: transparent;
}
.account-chip:hover { background: var(--bg-hover); }
.sidebar-footer .avatar {
  width: 24px;
  height: 24px;
  font-size: 10px;
  box-shadow: none;
}
.user-name { font-size: 13px; font-weight: 550; }
.quota { font-size: 11px; }

/* ---------- 4. 消息区:用户气泡去描边,头像去框 ---------- */
.msg.user .msg-content {
  border: none;
  border-radius: 14px 14px 4px 14px;
  box-shadow: none;
}
.msg .msg-avatar {
  border: none;
  box-shadow: none;
}

/* ---------- 5. 输入区:叠在消息上的半透明浮层,闲置轻描边,聚焦再亮 ---------- */
.chat-area {
  padding-bottom: 132px;
}
.composer-area {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 24;
  padding: 24px 20px 8px;
  border-top: none;
  background: linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--bg-app) 28%, transparent) 36%, color-mix(in srgb, var(--bg-app) 62%, transparent) 100%);
  pointer-events: none;
}
.composer-area > * { pointer-events: auto; }
.composer {
  align-items: center;
  min-height: 60px;
  background: color-mix(in srgb, var(--bg-surface) 58%, transparent);
  border: 1px solid color-mix(in srgb, var(--hairline-strong) 70%, transparent);
  border-radius: 26px;
  box-shadow: none;
  padding: 8px 8px 8px 12px;
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}
.composer:focus-within {
  border-color: color-mix(in srgb, var(--brand) 42%, var(--hairline));
  box-shadow: 0 0 0 4px var(--ring-brand);
  background: color-mix(in srgb, var(--bg-surface) 74%, transparent);
}
@media (max-width: 768px) {
  .chat-area { padding-bottom: 110px; }
  .composer-area { padding: 20px 12px 8px; }
  .scroll-bottom-btn { bottom: 108px; }
  .composer-hint-keys { display: none; }
}
.composer textarea {
  padding: 10px 6px;
  background: transparent;
}
.composer-at {
  flex-shrink: 0;
  align-self: center;
  max-width: min(42%, 220px);
  margin: 0 2px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-size: 14.5px;
  font-weight: 650;
  line-height: 1.5;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.composer-at:hover { color: var(--brand-hover, var(--brand)); }
.composer-at:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring-brand);
  border-radius: 6px;
}
.composer-wrap { position: relative; }
.composer-hint {
  margin: 4px 0 0;
  font-size: 11px !important;
  line-height: 1.35;
  letter-spacing: 0;
  opacity: 0.72;
}
.mention-pop {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(100% + 10px);
  z-index: 40;
  max-height: min(360px, 52vh);
  overflow: auto;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--hairline-strong, var(--hairline)) 72%, var(--brand) 28%);
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow:
    0 18px 40px rgba(15, 23, 42, 0.12),
    0 2px 0 color-mix(in srgb, var(--brand) 18%, transparent) inset;
}
[data-theme="dark"] .mention-pop {
  background: color-mix(in srgb, var(--bg-surface) 82%, #000 18%);
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.46),
    0 1px 0 rgba(255, 255, 255, 0.04) inset;
}
.mention-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px 6px;
  color: var(--text-tertiary);
}
.mention-head b {
  font-weight: 650;
  color: var(--text-secondary);
}
.mention-head span { opacity: 0.78; }
.mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.mention-item:hover {
  background: color-mix(in srgb, var(--bg-hover) 80%, var(--brand-soft));
}
.mention-item.active {
  background: var(--brand-soft);
  box-shadow: inset 3px 0 0 var(--brand);
}
.mention-ico {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--bg-hover) 72%, var(--brand-soft));
  font-size: 15px;
  line-height: 1;
}
.mention-item.active .mention-ico {
  background: color-mix(in srgb, var(--brand) 18%, var(--bg-surface));
}
.mention-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mention-name {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text);
}
.mention-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mention-empty {
  padding: 18px 10px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 12.5px;
}

/* ---------- 6. 回到底部钮:轻描边,不再浮起成卡 ---------- */
.scroll-bottom-btn {
  border: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--bg-surface) 78%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: none;
  bottom: 118px;
}
.scroll-bottom-btn:hover { box-shadow: none; }

/* ---------- 7. 空状态:logo 与快捷入口去卡片化 ---------- */
.empty-logo {
  border: none;
  box-shadow: none;
  background: transparent;
}
.empty-state:hover .empty-logo { transform: none; box-shadow: none; }
.empty-state {
  justify-content: center;
  padding-top: 8vh;
  padding-bottom: 28px;
}
.empty-state h2 {
  letter-spacing: -0.02em;
  font-weight: 620;
}
.empty-state p.muted {
  margin-top: 8px;
  max-width: 28em;
  line-height: 1.55;
}
.empty-suggests {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  justify-content: stretch;
  margin-top: 22px;
  max-width: 720px;
  gap: 8px;
}
@media (max-width: 768px) {
  .empty-suggests { display: none; }
  .empty-lead { display: none; }
}
.empty-suggest {
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  background: transparent;
  border: none;
  border-radius: 12px;
  box-shadow: none;
  padding: 10px 12px;
  text-align: center;
}
.empty-suggest:hover {
  background: var(--bg-hover);
  border: none;
  box-shadow: none;
  transform: none;
}
.empty-suggest:active { transform: none; background: var(--bg-active); }
.empty-suggest .es-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: transparent;
}
.empty-suggest:hover .es-icon { background: transparent; transform: none; }
.empty-suggest .es-text { padding-top: 0; }
.empty-suggest .es-desc { display: none; }

/* ---------- 8. 附件/后台:弱化卡片阴影 ---------- */
.file-card,
.attach-img-preview {
  box-shadow: none;
  border-radius: 10px;
}
.file-card.is-parsing { max-width: 260px; }
.file-card .fc-info { flex: 1; }
.file-card .fc-progress {
  display: block;
  height: 3px;
  margin-top: 6px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--brand) 16%, var(--hairline));
  overflow: hidden;
}
.file-card .fc-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width .35s ease;
}
.own-tool {
  margin: 0 0 12px;
  padding: 4px 2px 2px;
}
.own-tool .field { margin-bottom: 10px; }
.own-tool select,
.own-tool input,
.own-tool textarea {
  width: 100%;
  border: none;
  border-radius: 10px;
  background: var(--bg-hover);
  color: var(--text);
  padding: 9px 12px;
  font: inherit;
}
#pref-tools-actions { margin: 4px 0 16px; align-items: center; gap: 10px; }
#settings-modal .modal.modal-lg { width: min(860px, 94vw); }
#settings-modal .settings-shell {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  min-height: 460px;
}
#settings-modal .settings-tabs {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  margin: 0;
  padding: 8px;
  border-bottom: none;
  border-right: 1px solid var(--hairline);
}
#settings-modal .settings-tab {
  width: 100%;
  border-radius: 10px;
  text-align: left;
  padding: 9px 12px;
}
#settings-modal .modal-body { min-width: 0; max-height: min(68vh, 620px); }
@media (max-width: 720px) {
  #settings-modal .settings-shell { grid-template-columns: 1fr; min-height: 0; }
  #settings-modal .settings-tabs {
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--hairline);
  }
  #settings-modal .settings-tab { width: auto; white-space: nowrap; }
}
.stat-card,
.admin-card {
  border-radius: 12px;
  box-shadow: none;
}
.stat-card:hover { box-shadow: none; transform: none; }
.composer-left,
.composer-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 4px;
}
.composer-more,
.composer-tools { display: none; }
@media (max-width: 768px) {
  .composer-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
  }
  .composer-more:hover,
  .composer-more[aria-expanded="true"] {
    background: var(--bg-hover);
    color: var(--text);
  }
  .composer-left { position: relative; }
  .composer-tools {
    display: none;
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    z-index: 46;
    min-width: 196px;
    padding: 4px;
    border: 1px solid var(--hairline);
    border-radius: 12px;
    background: var(--bg-surface);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  }
  .composer-tools:not(.hidden) { display: flex; flex-direction: column; }
  .composer-tool {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 9px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
    text-align: left;
  }
  .composer-tool:hover { background: var(--bg-hover); }
  .composer-tool-val { color: var(--text-tertiary); font-size: 13px; }
  .composer-tool-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px;
  }
  .composer-tool-choices {
    display: flex;
    gap: 4px;
  }
  .composer-tool-choices button {
    flex: 1;
    min-width: 0;
    padding: 6px 0;
    border: none;
    border-radius: 8px;
    background: var(--bg-hover);
    color: var(--text-secondary);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
  }
  .composer-tool-choices button.active {
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 650;
  }
  .composer-left .attach-btn,
  .websearch-wrap,
  .effort-wrap { display: none !important; }
  .composer-tools:not(.hidden) ~ .websearch-wrap,
  .composer-tools:not(.hidden) ~ .effort-wrap,
  .composer-tools:not(.hidden) ~ .attach-btn { display: block !important; }
  .composer-tools:not(.hidden) ~ .websearch-wrap .websearch-btn,
  .composer-tools:not(.hidden) ~ .effort-wrap .effort-btn,
  .composer-tools:not(.hidden) ~ .attach-btn {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
}
.effort-wrap { position: relative; flex-shrink: 0; }
.effort-btn {
  height: 36px;
  min-width: 44px;
  padding: 0 10px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}
.effort-btn:hover { background: var(--bg-hover); color: var(--text); }
.effort-btn.off { color: var(--text-tertiary); }
.effort-btn .oc-icon { width: 16px; height: 16px; }
.modal-mask.hidden { display: none !important; pointer-events: none !important; }
.websearch-wrap { position: relative; flex-shrink: 0; }
.websearch-btn {
  height: 36px;
  width: 36px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.websearch-btn:hover { background: var(--bg-hover); color: var(--text); }
.websearch-btn.off { color: var(--text-tertiary); }
.websearch-btn.on,
.websearch-btn.auto {
  color: var(--brand);
  background: var(--brand-soft);
}
.websearch-btn .oc-icon { width: 16px; height: 16px; }
.websearch-pop { min-width: 240px; white-space: nowrap; }
.effort-opt .effort-sub {
  display: block;
  margin-top: 1px;
  font-size: 11.5px;
  font-weight: 450;
  color: var(--text-tertiary);
}
.effort-opt.active .effort-sub { color: color-mix(in srgb, var(--brand) 70%, var(--text-tertiary)); }
.effort-pop {
  position: absolute;
  right: 0;
  left: auto;
  bottom: calc(100% + 8px);
  z-index: 45;
  min-width: 108px;
  padding: 4px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-md, 0 10px 24px rgba(15, 23, 42, 0.12));
}
.effort-opt {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
}
.effort-opt:hover { background: var(--bg-hover); color: var(--text); }
.effort-opt.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 650;
}
.effort-pop.websearch-pop {
  min-width: 240px;
  width: max-content;
}
.effort-pop.websearch-pop .effort-opt {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  white-space: nowrap;
}
.effort-pop.websearch-pop .effort-sub {
  display: inline;
  margin-top: 0;
  white-space: nowrap;
}
.reasoning-wrap,
.live-reasoning {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 12px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--brand) 16%, var(--hairline));
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 7%, var(--bg-surface));
  box-shadow: none;
}
.reasoning-wrap.open,
.live-reasoning.open {
  width: 100%;
  border-radius: 16px;
  background: color-mix(in srgb, var(--brand) 5%, var(--bg-surface));
}
.live-reasoning .reasoning-header,
.reasoning-wrap .reasoning-header {
  gap: 8px;
  min-height: 36px;
  padding: 6px 12px 6px 10px;
  background: transparent;
}
.live-reasoning .reasoning-header:hover,
.reasoning-wrap .reasoning-header:hover {
  background: color-mix(in srgb, var(--brand) 6%, transparent);
}
.reasoning-copy {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.reasoning-title {
  flex: 1;
  color: var(--text);
  font-weight: 650;
  letter-spacing: 0.01em;
}
.reasoning-copy .reasoning-title { flex: 0 0 auto; }
.reasoning-count { margin-left: auto; }
.reasoning-preview {
  min-width: 0;
  max-width: 28em;
  overflow: hidden;
  color: var(--text-tertiary);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reasoning-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.reasoning-chev { color: var(--text-tertiary); }
.live-reasoning .reasoning-steps,
.reasoning-wrap .reasoning-steps {
  padding: 0 14px 12px 40px;
  border-top: none;
}
.reasoning-live {
  word-break: break-word;
  color: var(--text-secondary);
  line-height: 1.65;
  max-height: 280px;
  overflow: auto;
}
.reasoning-live.md-prose {
  white-space: normal;
}
.reasoning-live.md-prose > *:first-child { margin-top: 0; }
.reasoning-live.md-prose > *:last-child { margin-bottom: 0; }
.reasoning-live.md-prose p { margin: 0.45em 0; }
.reasoning-live.md-prose pre,
.reasoning-live.md-prose .code-block { margin: 0.55em 0; }
.live-reasoning.streaming {
  border-color: color-mix(in srgb, var(--brand) 28%, var(--hairline));
}
.live-reasoning.streaming .reasoning-title { color: var(--brand); }
.live-reasoning.streaming .reasoning-icon {
  background: color-mix(in srgb, var(--brand) 18%, transparent);
}
.attach-btn, .voice-btn {
  width: 42px;
  height: 42px;
  color: var(--text-secondary);
}
.send-btn, .stop-btn {
  width: 42px;
  height: 42px;
  box-shadow: none;
}
.send-btn:hover { box-shadow: none; }
.send-btn:disabled,
.send-btn.muted,
#send-btn:disabled,
#send-btn.muted {
  background: var(--bg-hover) none !important;
  background-color: var(--bg-hover) !important;
  color: var(--text-tertiary) !important;
  box-shadow: none;
  opacity: 1;
}
.send-btn:disabled:hover,
.send-btn.muted:hover,
#send-btn:disabled:hover,
#send-btn.muted:hover {
  background: var(--bg-active) !important;
  background-color: var(--bg-active) !important;
  color: var(--text-secondary) !important;
  transform: none;
}
.send-btn:not(:disabled):not(.muted),
#send-btn:not(:disabled):not(.muted) {
  background: var(--brand) none !important;
  background-color: var(--brand) !important;
  color: var(--primary-text, #fff) !important;
}

/* 主题色必须同时驱动发送钮/主按钮/空状态主按钮,避免只改 --accent 看起来没生效 */
.send-btn:not(:disabled):not(.muted),
#send-btn:not(:disabled):not(.muted),
.auth-card .btn.primary:not(:disabled) {
  background: var(--brand) none !important;
  background-color: var(--brand) !important;
  border-color: var(--brand);
  color: var(--primary-text, #fff);
}
.send-btn:not(:disabled):not(.muted):hover,
#send-btn:not(:disabled):not(.muted):hover,
.auth-card .btn.primary:not(:disabled):hover {
  background: var(--brand-hover) !important;
  background-color: var(--brand-hover) !important;
  border-color: var(--brand-hover);
}
.btn.primary:not(:disabled) {
  background: var(--brand);
  background-color: var(--brand);
  border-color: var(--brand);
  color: var(--primary-text, #fff);
}
.btn.primary:not(:disabled):hover {
  background: var(--brand-hover);
  background-color: var(--brand-hover);
  border-color: var(--brand-hover);
}
.switch input:checked + .slider {
  background: var(--brand);
  background-color: var(--brand);
}

/* ---------- 9. 图标:统一线标,尺寸按容器归一 ---------- */
.oc-icon { flex-shrink: 0; display: inline-block; }
.icon-btn .oc-icon { width: 17px; height: 17px; }
.new-chat-btn .oc-icon { width: 15px; height: 15px; }
.model-icon .oc-icon { width: 15px; height: 15px; }
.chat-search .oc-icon { width: 14px; height: 14px; }
.chat-item .chat-icon .oc-icon { width: 14px; height: 14px; }
.chevron .oc-icon, .sb-arrow .oc-icon, .account-chevron .oc-icon { width: 13px; height: 13px; }
.user-menu {
  border: 1px solid var(--hairline);
  border-radius: 12px;
  box-shadow: none;
  background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
}
.user-menu-item { text-decoration: none; }
.user-menu-item .oc-icon { width: 15px; height: 15px; }
a.user-menu-item { color: inherit; }
.empty-logo .oc-icon { width: 26px; height: 26px; }
.empty-suggest .es-icon .oc-icon { width: 18px; height: 18px; }
.scroll-bottom-btn .oc-icon { width: 16px; height: 16px; }
.attach-btn .oc-icon, .voice-btn .oc-icon { width: 22px; height: 22px; }
.send-btn .oc-icon, .stop-btn .oc-icon { width: 20px; height: 20px; }
.msg-action .oc-icon { width: 14px; height: 14px; }
.oc-select-item .oc-icon { width: 14px; height: 14px; }
.chat-group .oc-icon { width: 12px; height: 12px; }
.fc-remove .oc-icon { width: 10px; height: 10px; }
.file-card .fc-icon .oc-icon { width: 15px; height: 15px; }
.pw-toggle .oc-icon { width: 16px; height: 16px; }
.lightbox-close .oc-icon { width: 16px; height: 16px; }
.auth-logo .oc-icon { width: 26px; height: 26px; }
#ap-key-toggle .oc-icon { width: 14px; height: 14px; }

/* ---------- 10. 模型菜单:去掉大白块,搜索选中不再刷蓝 ---------- */
.oc-menu {
  background: var(--bg-app);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  padding: 4px;
}
[data-theme="dark"] .oc-menu {
  background: var(--bg-surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.oc-menu-search {
  border: none;
  background: var(--bg-hover);
  border-radius: 8px;
  box-shadow: none;
}
.oc-menu-search:focus {
  outline: none;
  box-shadow: none;
  background: var(--bg-active);
}
.oc-menu-item.active {
  background: var(--bg-hover);
  color: var(--text);
}
.oc-menu-item.active .check { color: var(--text-secondary); }
.oc-menu .oc-menu-list {
  overflow-y: auto;
  overscroll-behavior: contain;
  max-height: 280px;
}
.oc-menu-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 6px;
  margin: 0 2px 4px;
  border-bottom: 1px solid var(--hairline);
}
.oc-menu-chip {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 12px;
  line-height: 1;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.oc-menu-chip:hover { background: var(--bg-hover); color: var(--text); }
.oc-menu-chip.active {
  background: var(--bg-active);
  border-color: transparent;
  color: var(--text);
  font-weight: 600;
}
.oc-menu-chip:focus-visible { outline: 2px solid color-mix(in srgb, var(--primary) 40%, transparent); outline-offset: 1px; }

/* ---------- 12. 偏好:整页缩放 + 本机字体 ---------- */
/* zoom 作用在 html 上会连 100vh 一起放大,底栏被挤出窗口。
   外壳按缩放反算宽高,视觉上始终铺满视口;左下角账户栏再反缩放,钉住不动. */
html {
  zoom: var(--oc-ui-zoom, 1);
  width: calc(100vw / var(--oc-ui-zoom, 1));
  height: calc(100vh / var(--oc-ui-zoom, 1));
  overflow: hidden;
}
body {
  font-family: var(--oc-font-family);
  width: 100%;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}
.sidebar {
  height: 100%;
  min-height: 0;
  min-width: 0;
}
.chat-list {
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
}
.sidebar-footer {
  flex-shrink: 0;
  zoom: calc(1 / var(--oc-ui-zoom, 1));
  width: calc(100% * var(--oc-ui-zoom, 1));
}
.msg .msg-content,
.composer textarea,
.chat-item,
.chat-title,
.user-name,
.quota {
  font-family: inherit;
}
.font-family-control {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.font-family-control > .btn,
.font-family-control > .font-family-input {
  height: 34px;
  box-sizing: border-box;
}
.font-family-control > .btn {
  padding: 0 10px;
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  background: var(--bg-surface);
  box-shadow: none;
  font-size: 12.5px;
  white-space: nowrap;
}
.font-family-control > .btn:hover {
  background: var(--bg-hover);
  border-color: var(--brand);
}
.font-family-control .font-family-input {
  width: 150px;
  padding: 0 10px;
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  background: var(--bg-surface);
  font-size: 12.5px;
}
.font-family-control .font-family-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--ring-brand);
}
.font-select-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 132px;
}
.font-select-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.font-select-chevron { display: inline-flex; flex: 0 0 auto; color: var(--text-tertiary); transition: transform 0.16s ease; }
.font-select-trigger[aria-expanded="true"] .font-select-chevron { transform: rotate(180deg); }
.oc-menu-item.oc-font-item .item-label {
  font-family: var(--oc-item-font, inherit);
}

/* ---------- 11. 侧边栏/主区分隔:单一清晰边线,不叠软阴影 ---------- */
.sidebar,
[data-theme="dark"] .sidebar {
  background: var(--bg-surface-2);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-right: 1px solid var(--hairline);
  box-shadow: none;
}
/* 拖拽手柄平时不画线,交给侧边栏自身的一条 hairline */
.sidebar-resizer::after {
  background: transparent;
  box-shadow: none;
}

/* ---------- 12. 对话列两侧拖拽调宽 ---------- */
.chat-resizer {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 10px;
  z-index: 30;
  cursor: col-resize;
  touch-action: none;
  background: transparent;
}
.chat-resizer-left { left: max(0px, calc(50% - var(--content-w) / 2 - 5px)); }
.chat-resizer-right { left: min(100%, calc(50% + var(--content-w) / 2 - 5px)); }
.chat-resizer::after {
  content: "";
  position: absolute;
  top: 12%;
  bottom: 12%;
  left: 4px;
  width: 2px;
  border-radius: 2px;
  background: transparent;
  transition: background 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.chat-resizer:hover::after,
.chat-resizer:focus-visible::after,
.chat-resizer.active::after,
body.chat-resizing .chat-resizer::after {
  background: var(--accent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 40%, transparent);
}
.chat-resizer:focus-visible {
  outline: none;
}
body.chat-resizing {
  cursor: col-resize !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}
body.chat-resizing * { cursor: col-resize !important; }
@media (max-width: 768px) {
  .chat-resizer { display: none; }
}

/* ---------- 13. 默认头像:长条 logo 居中放进方形,上下透明留白 ---------- */
.avatar-logo,
.avatar.avatar-logo {
  aspect-ratio: 1 / 1;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--text);
  overflow: hidden;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.sidebar-footer .avatar.avatar-logo {
  width: 24px;
  height: 24px;
  border-radius: 0;
}
.avatar.avatar-lg.avatar-logo {
  width: 52px;
  height: 52px;
  border-radius: 0;
}
.avatar-logo .avatar-logo-img,
.msg .msg-avatar .avatar-logo-img {
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}
.avatar-logo .brand-logo-light,
.msg .msg-avatar .brand-logo-light { display: block; }
.avatar-logo .brand-logo-dark,
.msg .msg-avatar .brand-logo-dark { display: none; }
[data-theme="dark"] .avatar-logo .brand-logo-light,
[data-theme="dark"] .msg .msg-avatar .brand-logo-light { display: none; }
[data-theme="dark"] .avatar-logo .brand-logo-dark,
[data-theme="dark"] .msg .msg-avatar .brand-logo-dark { display: block; }
.msg .msg-avatar,
.msg .msg-avatar.avatar-logo {
  width: 28px;
  height: 28px;
  aspect-ratio: 1 / 1;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  border: none;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.msg.assistant .msg-avatar {
  background: transparent !important;
  border: none;
  color: inherit;
}

/* 回答出来前头像也在,思考态跟在同一行,不要单独掉到下面 */
.msg.assistant {
  align-items: flex-start;
}
.msg.assistant .msg-content {
  flex: 1 1 0;
  min-width: 0;
}
.msg.assistant .phase-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 0;
  padding: 0;
  min-height: 22px;
}

/* 空状态:logo 原样展示,不再包圆角方块 */
.empty-logo {
  width: auto;
  height: 44px;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}
.empty-logo .empty-logo-img {
  max-width: 180px;
  max-height: 44px;
  width: auto;
  height: 44px;
  object-fit: contain;
}
.empty-logo .oc-icon { display: none; }

/* 语音按钮已移除:保留兼容隐藏,避免旧样式生效 */
.voice-btn { display: none !important; }

/* ---------- 14. 供应商:拉取模型后勾选启用 ---------- */
.model-check {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.model-check-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.model-check-toolbar input {
  flex: 1 1 auto;
  min-width: 0;
}
.model-check-toolbar .btn { flex-shrink: 0; }
.model-check-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.model-check-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}
.model-check-all input,
.model-table input[type="checkbox"] {
  width: auto;
  padding: 0;
  background: none;
  box-shadow: none;
  accent-color: var(--accent);
  margin: 0;
}
.model-check-list {
  max-height: 280px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--bg-hover);
}
.model-check-empty {
  padding: 18px 12px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 12.5px;
  line-height: 1.5;
}
.probe-box {
  margin: 4px 0 14px;
  padding: 12px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--bg-surface-2);
}
.probe-box .field:last-of-type { margin-bottom: 10px; }
.probe-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.probe-result {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.probe-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--hairline);
}
.probe-row.ok { border-color: color-mix(in srgb, var(--brand, #16a34a) 35%, var(--hairline)); }
.probe-row.bad { border-color: color-mix(in srgb, #dc2626 30%, var(--hairline)); }
.probe-main { min-width: 0; }
.probe-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.probe-sub {
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 12.5px;
  line-height: 1.45;
  word-break: break-word;
}
.probe-side {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.probe-ms { color: var(--text-tertiary); font-variant-numeric: tabular-nums; font-size: 12px; }

/* ---------- 15. 轻提示:替代系统黑框 title ---------- */
.oc-tip {
  position: fixed;
  z-index: 10050;
  max-width: min(280px, calc(100vw - 16px));
  padding: 6px 10px;
  border: none;
  border-radius: 8px;
  background: color-mix(in srgb, var(--text) 88%, transparent);
  color: var(--bg-app);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.01em;
  pointer-events: none;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  box-shadow: none;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.oc-tip.show {
  opacity: 1;
  transform: translateY(0);
}
[data-theme="dark"] .oc-tip {
  background: color-mix(in srgb, var(--bg-surface) 92%, var(--text));
  color: var(--text);
}

/* ---------- 16. 消息操作栏:始终显示,不再靠悬停浮现 ---------- */
.msg .msg-actions,
.msg-actions {
  opacity: 1 !important;
  visibility: visible;
  pointer-events: auto;
}
/* 头像 28 + 间距 14，再扣掉按钮自身的 8px 左内边距，图标才和正文左缘对齐 */
.msg.assistant .msg-actions {
  margin-left: 0;
  padding-left: 34px;
}
.msg.assistant .msg-actions .msg-action:first-child {
  margin-left: 0;
}

/* 用户气泡在右,复制/编辑贴在气泡正下方右对齐 */
.msg.user {
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
}
.msg.user .msg-content {
  flex: 0 1 auto;
  width: fit-content;
  max-width: 82%;
}
.msg.user .msg-actions {
  flex: 0 0 auto !important;
  width: auto;
  max-width: 82%;
  justify-content: flex-end;
  padding-left: 0;
  margin-top: 4px;
}
@media (max-width: 768px) {
  .msg.assistant .msg-avatar { display: none; }
  .msg.assistant .msg-actions { padding-left: 0; }
  .msg.assistant .msg-actions {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .msg.assistant .msg-actions .reply-meta {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-left: 0;
    order: 10;
    justify-content: flex-start;
    box-sizing: border-box;
    overflow-wrap: anywhere;
  }
  .msg.assistant .reply-meta > * {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  .msg.assistant .reply-meta .reply-time,
  .msg.assistant .reply-meta .reply-usage,
  .msg.assistant .reply-meta .reply-cost,
  .msg.assistant .reply-meta .reply-flag {
    white-space: normal;
    word-break: break-word;
  }
}
@media (max-width: 420px) {
  .msg.assistant .msg-actions .reply-meta {
    gap: 5px;
    font-size: 11px;
  }
}

/* ---------- 17. 分享链接弹窗 ---------- */
.share-link-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-top: 4px;
}
.share-link-row input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--hairline-strong);
  border-radius: 10px;
  background: var(--bg-hover);
  color: var(--text);
  font-size: 13px;
}
.share-link-hint {
  margin: 10px 0 0;
  font-size: 12.5px;
  color: var(--text-tertiary);
  line-height: 1.5;
}

/* ---------- 17b. 代码、公式、表格、导图的复制按钮 ---------- */
.code-copy {
  background: var(--bg-surface);
  border: 1px solid var(--hairline);
  color: var(--text-secondary);
  padding: 3px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  line-height: 1.2;
}
.code-copy .oc-icon { width: 13px; height: 13px; }
.katex-display,
.table-wrap,
.mindmap-wrap,
.mermaid-wrap { position: relative; }
.katex-display > .visual-actions,
.table-wrap > .visual-actions,
.mindmap-wrap > .visual-actions,
.mermaid-wrap > .visual-actions,
.html-present > .visual-actions,
.html-present-row > .visual-actions {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  min-height: 32px;
  margin: -4px 0 10px;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--hairline);
}
.visual-actions .code-copy {
  background: var(--bg-surface);
  flex: 0 0 auto;
}
.visual-actions .copy-menu { flex: 0 0 auto; }
.msg-actions .reply-meta,
.reply-meta {
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
  white-space: normal;
  overflow-wrap: anywhere;
}
.reply-meta .reply-cost {
  font: inherit;
  font-size: 11.5px !important;
}
.msg-actions .msg-action { flex: 0 0 auto; }
.visual-actions .copy-menu-list {
  top: calc(100% + 4px);
  max-width: min(220px, calc(100vw - 24px));
}
.html-present > .visual-actions,
.html-present-row > .visual-actions { margin-bottom: 8px; }
.copy-menu { position: relative; }
.copy-menu-list {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 5;
  min-width: 112px;
  padding: 4px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}
.copy-menu-list button {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  font-size: 12px;
  line-height: 1.2;
  padding: 7px 8px;
  border-radius: 7px;
  cursor: pointer;
}
.copy-menu-list button:hover { background: var(--bg-hover); }
.html-present,
.html-present-row { position: relative; }

/* ---------- 18. 公开分享页 ---------- */
/* 基础 body 是 flex(为聊天三栏服务),分享页必须恢复块级布局,否则头部与正文被排成一行 */
.share-page {
  display: block !important;
  min-height: 100vh;
  background: var(--bg-app);
  color: var(--text);
}
.share-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 22px;
  background: color-mix(in srgb, var(--bg-app) 88%, transparent);
  backdrop-filter: blur(14px);
}
.share-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}
.share-brand img {
  height: 22px;
  width: auto;
}
.share-main {
  max-width: 800px;
  margin: 0 auto;
  padding: 18px 24px 80px;
}
.share-title {
  font-size: 26px;
  font-weight: 680;
  letter-spacing: -0.03em;
  margin: 8px 0 6px;
}
.share-meta {
  margin: 0 0 22px;
  color: var(--text-tertiary);
  font-size: 13px;
}
.share-empty,
.share-error {
  padding: 80px 24px;
  text-align: center;
  color: var(--text-secondary);
}
.share-error h1 {
  font-size: 22px;
  margin: 0 0 8px;
  color: var(--text);
}
html:has(body.share-page),
html:has(body.auth-body),
html:has(body.admin-body) {
  zoom: 1 !important;
  width: 100% !important;
  height: auto !important;
  overflow: auto !important;
}
body.auth-body,
body.admin-body {
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  overflow: auto !important;
}
body.share-page {
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  overflow: auto !important;
}

/* ---------- 19. 获取模型弹窗：勾选 + 改前台显示名 ---------- */
.model-fetch-modal .modal-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.model-fetch-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 12px;
}
.model-fetch-search {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--bg-hover);
  color: var(--text-tertiary);
  box-shadow: none;
}
.model-fetch-search .oc-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.model-fetch-search input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  box-shadow: none;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.model-fetch-search input[type="search"]::placeholder {
  color: var(--text-tertiary);
}
.model-fetch-search input[type="search"]::-webkit-search-decoration,
.model-fetch-search input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}
.model-fetch-search:focus-within {
  background: var(--bg-surface);
  border-color: color-mix(in srgb, var(--brand) 45%, var(--hairline));
  box-shadow: 0 0 0 3px var(--ring-brand);
  color: var(--text-secondary);
}
.model-fetch-toolbar .muted { flex-shrink: 0; white-space: nowrap; }
.model-fetch-list {
  max-height: min(52vh, 460px);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--bg-hover);
}

/* 模型列表表格：勾选 | 模型 ID | 显示名称 | max_tokens | 最大上下文 */
.model-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 12.5px;
}
.model-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 10px;
  background: var(--bg-hover);
  border-bottom: 1px solid var(--hairline);
  color: var(--text-tertiary);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: left;
  white-space: nowrap;
}
.model-table .col-check {
  width: 36px;
  text-align: center;
  padding-left: 8px;
  padding-right: 4px;
}
.model-table .col-id {
  width: 32%;
}
.model-table .col-name {
  width: auto;
}
.model-table .col-mtok {
  width: 96px;
}
.model-table .col-ctx {
  width: 112px;
}
.model-table tbody td {
  padding: 6px 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--hairline) 70%, transparent);
  vertical-align: middle;
}
.model-table tbody tr:last-child td { border-bottom: none; }
.model-table tbody tr:hover td { background: var(--bg-surface); }
.model-table .mid {
  display: block;
  font-weight: 550;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.model-table .mname {
  width: 100%;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--hairline);
  border-radius: 7px;
  background: var(--bg-surface);
  color: var(--text);
  font-size: 12.5px;
  box-shadow: none;
}
.model-table .mname:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--brand) 45%, var(--hairline));
}
.model-table .mname-static {
  display: block;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.model-table .mtokens,
.model-table .mctx {
  width: 100%;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--hairline);
  border-radius: 7px;
  background: var(--bg-surface);
  color: var(--text);
  font-size: 12.5px;
  box-shadow: none;
  text-align: right;
}
.model-table .mtokens:focus,
.model-table .mctx:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--brand) 45%, var(--hairline));
}
.model-table .mtokens-static,
.model-table .mctx-static {
  display: block;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.model-table .mtokens-static i,
.model-table .mctx-static i {
  font-style: normal;
  color: var(--text-tertiary);
}
.model-table .mname-static em {
  margin-left: 6px;
  font-style: normal;
  font-size: 11px;
  color: var(--danger, #c2410c);
}
.model-table tr.is-stale .mid { color: var(--text-secondary); }
.model-stale-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
}
.model-stale-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.model-stale-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.model-stale-hint {
  margin: 6px 0 8px;
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.45;
}
.model-stale-list {
  max-height: min(28vh, 220px);
}

/* ---------- 20. 用户管理 ---------- */
.users-card { padding-bottom: 8px; }
.users-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.users-head h2 { margin-bottom: 2px; }
.users-count {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-tertiary);
}
.users-toolbar { margin-bottom: 10px; }
.users-search {
  flex: 1 1 220px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--bg-hover);
  color: var(--text-tertiary);
}
.users-search .oc-icon { flex-shrink: 0; }
.users-search .search-input,
.admin-toolbar .users-search .search-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.users-search .search-input:focus,
.admin-toolbar .users-search .search-input:focus {
  border: none;
  box-shadow: none;
}
.users-search .search-input::-webkit-search-decoration,
.users-search .search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}
.users-search:focus-within {
  background: var(--bg-surface);
  border-color: color-mix(in srgb, var(--brand) 45%, var(--hairline));
  box-shadow: 0 0 0 3px var(--ring-brand);
  color: var(--text-secondary);
}
.users-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.users-table-wrap {
  overflow-x: auto;
  max-width: 100%;
  margin: 0 -8px;
}
.admin-tabs { width: auto; }
.admin-body { overflow-x: hidden; }
.users-table { min-width: 720px; }
.users-table th,
.users-table td {
  padding: 10px 12px;
  vertical-align: middle;
}
.users-table th { text-transform: none; letter-spacing: 0.01em; }
.users-table .col-quota,
.users-table .col-chats { width: 72px; white-space: nowrap; }
.users-table .col-time { white-space: nowrap; font-size: 12.5px; }
.users-table .col-actions { width: 1%; white-space: nowrap; }
.users-table .admin-row-actions { justify-content: flex-end; }
.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--bg-hover);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 650;
}
.user-avatar.is-admin {
  background: var(--brand-soft);
  color: var(--brand);
}
.user-name {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-weight: 550;
}
.users-empty-row td {
  text-align: center;
  color: var(--text-tertiary);
  padding: 36px 12px;
}
.user-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.user-form-grid .field input,
.user-form-grid .select-box {
  box-sizing: border-box;
  height: 42px;
  min-height: 42px;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 42px;
}
.user-form-admin {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 8px;
  font-size: 13.5px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
@media (max-width: 640px) {
  .user-form-grid { grid-template-columns: 1fr; }
  .users-head { flex-direction: column; align-items: stretch; }
}

/* ---------- 21. 助手库 ---------- */
.assistant-lib-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 32px;
  margin-bottom: 2px;
  padding: 0 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
}
.assistant-lib-btn:hover { background: var(--bg-hover); color: var(--text); }
.assistant-lib-btn .model-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 500;
}
.assistant-lib-btn .model-icon,
.assistant-lib-btn .chevron { color: var(--text-tertiary); display: inline-flex; }
.assistant-lib-modal {
  width: min(920px, calc(100vw - 28px));
  max-height: min(88vh, 820px);
  display: flex;
  flex-direction: column;
}
.assistant-lib-head { align-items: flex-start; }
.assistant-lib-heading { min-width: 0; }
.assistant-lib-heading h3 { margin: 0; }
.assistant-lib-kicker {
  margin: 4px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-tertiary);
}
.assistant-lib-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 22px 12px;
}
.assistant-lib-actions { display: flex; gap: 8px; flex-shrink: 0; }
.al-search {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-hover) 88%, var(--bg-surface));
  color: var(--text-tertiary);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 6%, transparent);
}
.al-search .oc-icon { flex-shrink: 0; opacity: 0.78; }
.al-search input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  letter-spacing: 0.01em;
  box-shadow: none;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.al-search input[type="search"]::placeholder {
  color: var(--text-tertiary);
  opacity: 0.92;
}
.al-search input[type="search"]::-webkit-search-decoration,
.al-search input[type="search"]::-webkit-search-cancel-button,
.al-search input[type="search"]::-webkit-search-results-button,
.al-search input[type="search"]::-webkit-search-results-decoration {
  display: none;
  -webkit-appearance: none;
  appearance: none;
}
.al-search:focus-within {
  background: var(--bg-surface);
  border-color: color-mix(in srgb, var(--brand) 42%, var(--hairline));
  box-shadow: 0 0 0 3px var(--ring-brand);
  color: var(--text-secondary);
}
.assistant-lib-split {
  display: flex;
  align-items: stretch;
  min-height: 0;
  flex: 1;
  border-top: 1px solid var(--hairline);
}
.assistant-lib-cats {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 196px;
  flex-shrink: 0;
  padding: 10px 8px 14px;
  overflow: auto;
  border-right: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--bg) 55%, var(--bg-surface));
}
.al-cat {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 6px 8px 6px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.al-cat span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.al-cat i {
  font-style: normal;
  font-size: 14px;
  line-height: 1;
  width: 1.15em;
  text-align: center;
  flex-shrink: 0;
}
.al-cat small {
  color: var(--text-tertiary);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.al-cat em {
  font-style: normal;
  margin-left: 6px;
  font-size: 11px;
  color: var(--text-tertiary);
}
.al-cat:hover { background: var(--bg-hover); color: var(--text); }
.al-cat:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--ring-brand);
}
.al-cat.active {
  background: var(--bg-active);
  color: var(--text);
  font-weight: 600;
  box-shadow: none;
}
.al-cat.active small { color: var(--text-secondary); }
.assistant-lib-modal .assistant-lib-body.modal-body {
  padding: 16px 22px 22px;
}
.assistant-lib-body {
  flex: 1;
  min-width: 0;
  max-height: min(62vh, 560px);
  overflow: auto;
}
.admin-asst-split { min-height: 420px; }
.admin-asst-body { max-height: none; padding: 16px 18px 8px; }
.al-section + .al-section { margin-top: 22px; }
.al-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.al-section-head h4 {
  margin: 0 auto 0 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.al-section-head h4 i { font-style: normal; font-size: 14px; line-height: 1; }
.al-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 10px;
}
.al-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 92px;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg-surface) 92%, var(--bg));
}
.al-card:hover {
  border-color: color-mix(in srgb, var(--brand) 28%, var(--hairline));
  background: var(--bg-surface);
}
.al-card-main {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  flex: 1;
  width: 100%;
  padding: 13px 42px 13px 13px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.al-card-main.static { cursor: default; }
.al-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--bg-hover) 80%, var(--brand-soft));
  color: var(--brand);
}
.al-emoji {
  font-size: 18px;
  line-height: 1;
  font-style: normal;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
}
.al-card-text { min-width: 0; display: flex; flex-direction: column; gap: 4px; padding-top: 1px; }
.al-card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.al-card-desc {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-tertiary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.al-badge {
  font-size: 10.5px;
  font-weight: 550;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 999px;
  padding: 1px 6px;
}
.al-badge.mine { color: var(--text-secondary); background: var(--bg-hover); }
.al-card-ops {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 1;
  display: flex;
  gap: 2px;
}
.al-card-ops:empty { display: none; }
.al-mini { width: 26px; height: 26px; color: var(--text-tertiary); }
@media (hover: hover) and (pointer: fine) {
  .al-card-ops { opacity: 0; }
  .al-card:hover .al-card-ops,
  .al-card:focus-within .al-card-ops { opacity: 1; }
}
.al-mini:hover { color: var(--text); background: var(--bg-hover); }
.al-mini.danger:hover { color: var(--danger, #dc2626); }
.al-empty {
  text-align: center;
  color: var(--text-tertiary);
  padding: 48px 16px;
  font-size: 13px;
}
.field textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  line-height: 1.5;
}
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--ring-brand);
}
@media (max-width: 640px) {
  .assistant-lib-toolbar { flex-direction: column; align-items: stretch; }
  .assistant-lib-actions { justify-content: flex-end; }
  .al-search { height: 42px; }
  .assistant-lib-split { flex-direction: column; }
  .assistant-lib-cats {
    width: auto;
    max-width: 100%;
    flex-direction: row;
    gap: 2px;
    padding: 8px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--hairline);
    overflow-x: auto;
  }
  .log-table { min-width: 760px; }
  .al-cat { width: auto; flex: 0 0 auto; }
  .al-cat.active { box-shadow: none; }
  .admin-asst-split { min-height: 0; }
}

/* ---------- 字号收口:界面只保留正文 / 标题 / 展示三档 ---------- */
:root {
  --fs: 14px;
  --fs-title: 16px;
  --fs-display: 20px;
}
body,
button,
input,
textarea,
select,
.small,
.btn,
.btn.small,
.new-chat-btn,
.footer-btn,
.chat-item,
.chat-title,
.chat-search input,
.chat-group,
.chat-group-count,
.chat-list-empty,
.sidebar-model-wrap .model-name,
.user-name,
.quota,
.composer-at,
.composer textarea,
	.effort-btn,
	.effort-opt,
	.websearch-btn,
.reasoning-title,
.reasoning-live,
.mention-head,
.mention-head b,
.mention-name,
.mention-desc,
.mention-empty,
.msg .msg-content,
.msg-error,
.msg.assistant table,
.msg.assistant code,
.msg.assistant pre,
.msg.assistant .md-prose :not(pre) > code,
.msg.assistant .md-prose .code-block pre,
.msg.assistant .md-prose pre,
.msg.assistant .md-prose table,
.msg.assistant .md-prose .footnotes,
.empty-state p.muted,
.empty-hint,
.empty-suggest .es-title,
.empty-suggest .es-desc,
.modal-header h3,
.modal-header p,
.field span,
.field input,
.field textarea,
.field select,
.provider-card .pc-name,
.provider-card .pc-url,
.badge,
.access-title,
.access-prov,
.access-all,
.row-between,
.al-section-head h4,
.al-section-head h4 i,
.al-card-title,
.al-card-desc,
.al-badge,
.al-empty,
.al-search input,
.pref-name,
.pref-desc,
.font-size-value,
.font-family-input,
.confirm-message,
.oc-menu-item,
.oc-menu-item .item-sub,
.reply-cost,
.quick-action,
.file-card .fc-size,
.artifact-title,
.artifact-text,
.admin-table,
.share-meta,
.share-empty,
.share-error,
.auth-switch {
  font-size: var(--fs) !important;
}
.admin-header h1 { font-size: 22px !important; }
.admin-card h2,
.modal-header h3 { font-size: 16px !important; }
.admin-table th { font-size: 12px !important; letter-spacing: 0; text-transform: none; }
.stat-card .stat-label,
.al-card-desc,
.al-badge,
.field span { font-size: 12.5px !important; }
.al-cat { font-size: 13px !important; }
.al-emoji { font-size: 18px !important; }
.empty-state h2,
.share-title,
.share-error h1,
.stat-card .stat-value,
.acc-name {
  font-size: var(--fs-display) !important;
}
.msg.assistant h1,
.msg.assistant h2,
.msg.assistant h3,
.msg.assistant h4,
.msg.assistant h5,
.msg.assistant h6,
.msg.assistant .md-prose h1,
.msg.assistant .md-prose h2,
.msg.assistant .md-prose h3,
.msg.assistant .md-prose h4,
.msg.assistant .md-prose h5,
.msg.assistant .md-prose h6 {
  font-size: var(--fs-title) !important;
}
.mention-ico {
  font-size: var(--fs) !important;
}

/* ---------- 22. 登录页:字标,不再套方块图标 ---------- */
.auth-body {
  min-height: 100vh;
  background: var(--bg-app);
}
.auth-card {
  width: min(380px, 92vw);
  padding: 36px 32px 28px;
  border: 1px solid var(--hairline);
  border-radius: 22px;
  background: color-mix(in srgb, var(--bg-surface) 86%, transparent);
  box-shadow: none;
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
}
.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 22px;
}
.auth-logo .brand-logo {
  height: 34px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}
.auth-logo p {
  margin-top: 10px;
}
.auth-card .btn.primary {
  height: 40px;
  border: none;
  border-radius: 11px;
  box-shadow: none;
}
.auth-card .btn.primary:hover { transform: none; box-shadow: none; }
.auth-switch { margin-top: 16px; }
.auth-switch a { color: var(--brand); }

/* ---------- 23. 追问:去掉虚线顶栏和位移 ---------- */
.follow-ups {
  margin-top: 10px;
  padding-top: 0;
  border-top: none;
  gap: 2px;
}
.follow-ups-label {
  display: none;
}
.follow-up-btn {
  padding: 6px 8px;
  border-radius: 8px;
}
.follow-up-btn::before {
  width: 4px;
  height: 4px;
}
.follow-up-btn:hover { padding-left: 8px; }

/* 后台二级菜单必须独占第二行 */
.admin-tabs { display:flex !important; flex-direction:column !important; align-items:stretch !important; width:100% !important; max-width:none !important; overflow:visible !important; gap:0 !important; }
.admin-group-tabs { width:100%; flex:0 0 auto; display:flex; flex-wrap:nowrap; overflow-x:auto; padding:0 2px 8px; border-bottom:1px solid var(--hairline); }
.admin-subnav { width:100%; flex:0 0 auto; display:flex; flex-wrap:nowrap; overflow-x:auto; min-height:38px; padding:7px 2px 2px; border-bottom:1px solid var(--hairline); }
.admin-group-tab,.admin-subnav-btn { flex:0 0 auto; white-space:nowrap; }
.admin-card select,.admin-card textarea,.admin-card input[type="url"],.admin-card input[type="email"] { width:100%; box-sizing:border-box; min-height:38px; border:1px solid var(--hairline-strong); border-radius:8px; background:var(--bg-input,var(--bg-surface)); color:var(--text); padding:8px 10px; font:inherit; }
.admin-card textarea { min-height:88px; resize:vertical; line-height:1.5; }
.admin-list { display:grid; gap:8px; margin:14px 0; min-height:42px; padding:10px; border:1px solid var(--hairline); border-radius:10px; background:var(--bg-hover); }
.admin-list:empty::before { content:"暂无数据"; color:var(--text-tertiary); font-size:13px; }
#pkg-generated-codes { display:block; width:100%; min-height:150px; margin-top:12px; font-family:"SF Mono",Consolas,monospace; font-size:12px; }
.admin-long-list,.admin-table-wrap,.users-table-wrap { max-height:min(62vh,680px); overflow:auto; scrollbar-gutter:stable; }
#panel-usage .usage-ledger,#panel-logs .admin-table-wrap,#panel-packages .admin-list { max-height:min(64vh,720px); overflow:auto; }

/* 后台导航外观：覆盖旧版 admin-tabs 的默认按钮规则 */
.admin-group-tabs,
.admin-subnav { background: transparent; }
.admin-group-tab,
.admin-subnav-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  width: auto !important;
  padding: 7px 13px !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: var(--text-secondary) !important;
  font: inherit;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.admin-group-tab:hover,
.admin-subnav-btn:hover { background: var(--bg-hover) !important; color: var(--text) !important; }
.admin-group-tab.active,
.admin-subnav-btn.active {
  background: var(--brand-soft, var(--bg-active)) !important;
  border-color: color-mix(in srgb, var(--brand, var(--accent)) 28%, transparent) !important;
  color: var(--brand, var(--accent)) !important;
  font-weight: 650;
}
.admin-card .field > select,
.admin-card .field > textarea,
.admin-card .field > input[type="url"] {
  display: block;
  width: 100% !important;
  max-width: 100%;
  min-width: 0;
  min-height: 38px;
}
.admin-card .field > textarea { height: auto; }

/* 一级/二级层级差异：一级负责分组，二级负责页面 */
.admin-group-tabs {
  min-height: 46px;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 7px;
  background: var(--bg-surface-2);
  border: 1px solid var(--hairline);
  border-radius: 10px 10px 0 0;
}
.admin-group-tab {
  min-height: 36px !important;
  padding: 9px 16px !important;
  border-radius: 8px !important;
  color: var(--text-secondary) !important;
  font-size: 14px !important;
  font-weight: 600;
}
.admin-group-tab.active {
  color: var(--text) !important;
  background: var(--bg-surface) !important;
  border-color: var(--hairline-strong) !important;
  box-shadow: 0 1px 0 var(--bg-surface);
}
.admin-subnav {
  min-height: 36px;
  align-items: center;
  gap: 4px;
  padding: 4px 12px 5px;
  background: var(--bg-hover);
  border: 1px solid var(--hairline);
  border-top: 0;
  border-radius: 0 0 10px 10px;
}
.admin-subnav-btn {
  min-height: 28px !important;
  padding: 5px 11px !important;
  border-radius: 6px !important;
  color: var(--text-tertiary) !important;
  font-size: 12.5px !important;
  font-weight: 500;
}
.admin-subnav-btn.active {
  color: var(--brand, var(--accent)) !important;
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: inset 0 -2px 0 var(--brand, var(--accent));
  font-weight: 650;
}

/* 后台导航视觉收敛：去掉嵌套卡片感，一级用文字层级，二级用轻分隔线 */
.admin-tabs {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.admin-group-tabs {
  min-height: 42px;
  padding: 0 2px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--hairline) !important;
  border-radius: 0 !important;
  background: transparent !important;
  gap: 4px;
}
.admin-group-tab {
  min-height: 34px !important;
  padding: 7px 13px !important;
  border: 0 !important;
  border-radius: 7px 7px 0 0 !important;
  background: transparent !important;
  color: var(--text-secondary) !important;
  font-size: 13.5px !important;
  font-weight: 600;
}
.admin-group-tab:hover { background: var(--bg-hover) !important; color: var(--text) !important; }
.admin-group-tab.active {
  color: var(--text) !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: inset 0 -2px 0 var(--brand, var(--accent));
}
.admin-subnav {
  min-height: 34px;
  padding: 2px 4px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--hairline) !important;
  border-radius: 0 !important;
  background: color-mix(in srgb, var(--bg-hover) 42%, transparent) !important;
  gap: 2px;
}
.admin-subnav-btn {
  min-height: 28px !important;
  padding: 5px 10px !important;
  border: 0 !important;
  border-radius: 6px !important;
  background: transparent !important;
  color: var(--text-tertiary) !important;
  font-size: 12px !important;
  font-weight: 500;
}
.admin-subnav-btn:hover { background: var(--bg-hover) !important; color: var(--text-secondary) !important; }

/* 一二级导航：一级分段选择，二级文字下划线；只有一项时不占一行 */
.admin-tabs {
  gap: 8px !important;
  margin-bottom: 18px !important;
}
.admin-group-tabs {
  width: fit-content !important;
  max-width: 100%;
  min-height: 0 !important;
  align-items: center;
  gap: 2px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  scrollbar-width: none;
}
.admin-group-tabs::-webkit-scrollbar { display: none; }
.admin-group-tab {
  min-height: 30px !important;
  padding: 5px 14px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: var(--text-secondary) !important;
  font-size: 13px !important;
  font-weight: 550 !important;
  letter-spacing: 0.01em;
  box-shadow: none !important;
  transition: background 0.15s ease, color 0.15s ease;
}
.admin-group-tab:hover {
  background: var(--bg-hover) !important;
  color: var(--text) !important;
}
.admin-group-tab.active {
  background: var(--bg-active) !important;
  color: var(--text) !important;
  box-shadow: none !important;
}
.admin-subnav {
  width: fit-content !important;
  max-width: 100%;
  min-height: 0 !important;
  align-items: center;
  gap: 2px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  scrollbar-width: none;
}
.admin-subnav::-webkit-scrollbar { display: none; }
.admin-subnav.is-single { display: none !important; }
.admin-subnav-btn {
  position: relative;
  min-height: 28px !important;
  padding: 4px 13px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: var(--text-secondary) !important;
  font-size: 13px !important;
  font-weight: 550 !important;
  box-shadow: none !important;
  transition: background 0.15s ease, color 0.15s ease;
}
.admin-subnav-btn::after { content: none; }
.admin-subnav-btn:hover {
  background: var(--bg-hover) !important;
  color: var(--text) !important;
}
.admin-subnav-btn.active {
  background: var(--bg-active) !important;
  border-color: transparent !important;
  color: var(--text) !important;
  font-weight: 650 !important;
  box-shadow: none !important;
}
[data-theme="dark"] .admin-group-tab.active {
  box-shadow: none !important;
}

/* ---------- 模型/供应商 logo(模型选择器、供应商筛选、会话列表) ---------- */
.oc-menu-item .item-logo {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 4px;
}
.oc-menu-chip .chip-logo {
  width: 14px;
  height: 14px;
  object-fit: contain;
  border-radius: 3px;
  flex-shrink: 0;
}
/* 供应商筛选 chip:图标与文字同水平并留出间隔 */
.oc-menu-chip { display: inline-flex; align-items: center; gap: 5px; }
/* 不设 display:显隐交给 brand-logo-light/dark 的主题切换规则 */
.chat-item .chat-icon .chat-logo {
  width: 16px;
  height: 16px;
  object-fit: contain;
  border-radius: 4px;
}
/* 模型选择器:菜单宽度按内容自适应;勾/状态/置顶图标作为一组右对齐(label 撑满,沿用基础样式) */
.oc-model-menu .oc-menu-item { gap: 5px; }
.oc-model-menu .oc-menu-item .item-logo { margin-right: 2px; }

/* ============================================================
   无描边控件:按钮 / 页签 / 筛选 chip 一律去掉描边,
   激活态改为柔和填充的圆角药丸(不再用边框和环形阴影)
   ============================================================ */

/* 通用按钮:去描边,统一药丸圆角;主色/危险按钮本身就是填充式,仅去边框 */
.btn,
.btn.small,
.btn.primary,
.btn.danger,
.msg-retry-row .btn {
  border: 0 !important;
  border-radius: 999px !important;
}
.btn:not(.primary):not(.danger) {
  background: var(--bg-hover);
  color: var(--text);
}
.btn:not(.primary):not(.danger):hover { background: var(--bg-active); }
.msg-retry-row .btn:not(.primary):not(.danger) {
  background: var(--bg-hover);
  color: var(--text-secondary);
}
.msg-retry-row .btn:not(.primary):not(.danger):hover { background: var(--bg-active); color: var(--text); }
.font-family-control > .btn {
  border: 0 !important;
  border-radius: 999px !important;
  background: var(--bg-hover);
}
.font-family-control > .btn:hover { background: var(--bg-active); border-color: transparent; }

/* 日志/用户列表筛选 chips:透明底,激活态柔和填充 */
.log-filter-btn {
  border: 0 !important;
  background: transparent !important;
  color: var(--text-secondary);
}
.log-filter-btn:hover { background: var(--bg-hover) !important; color: var(--text); border-color: transparent !important; }
.log-filter-btn.active {
  background: var(--bg-active) !important;
  border-color: transparent !important;
  color: var(--text) !important;
  font-weight: 600;
}

/* 信息统计卡(服务版本/运行时间/内存等):白底 + 清晰细描边,替代灰底色块 */
.meta-row span {
  border: 1px solid color-mix(in srgb, var(--text) 11%, transparent);
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
}

/* 运行日志表格:徽章/状态不换行,避免"对话/失败"竖排 */
.log-badge, .log-status { white-space: nowrap; }

/* 表单控件边界加强:细灰描边统一为 11% 文字色,悬停加深 */
.field input, .field select, .field textarea,
.select-box, .admin-card select, .admin-card textarea,
.admin-card input[type="url"], .admin-card input[type="text"],
.admin-card input[type="email"], .admin-card input[type="number"], .admin-card input[type="password"] {
  border-color: color-mix(in srgb, var(--text) 11%, transparent);
}
.select-box:hover,
.field input:hover, .field select:hover, .field textarea:hover,
.admin-card input[type="email"]:hover {
  border-color: color-mix(in srgb, var(--text) 22%, transparent);
}

/* 兑换码搜索框:与用户搜索一致的填充式胶囊 */
#codes-search {
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--bg-hover);
  padding: 8px 14px;
}
#codes-search:focus { border-color: color-mix(in srgb, var(--text) 22%, transparent); background: var(--bg-surface); }

/* 用量分析:行列表改为分隔线结构 */
.usage-ledger { gap: 0; }
.usage-ledger .usage-row {
  padding: 10px 2px;
  border-bottom: 1px solid var(--hairline);
}
.usage-ledger .usage-row:last-child { border-bottom: 0; }
.usage-ledger .usage-row .usage-name { font-weight: 600; color: var(--text); }

/* 模型评价:同样改为分隔线行 */
.model-votes { gap: 0; }
.model-votes .model-vote-row {
  background: transparent;
  border-radius: 0;
  padding: 10px 2px;
  border-bottom: 1px solid var(--hairline);
}
.model-votes .model-vote-row:last-child { border-bottom: 0; }

/* 设置弹窗侧栏页签:与全局统一的柔和填充激活态 */
#settings-modal .settings-tab.active { background: var(--bg-active); color: var(--text); box-shadow: none; }

/* ============================================================
   套餐卡片体系:后台管理 + 用户端定价页
   ============================================================ */

/* 后台:表单两列栅格 */
.pkg-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin-bottom: 14px;
}
.pkg-form-grid .field { margin: 0; }
@media (max-width: 720px) { .pkg-form-grid { grid-template-columns: 1fr; } }

/* 后台:一个套餐一张卡片 */
.pkg-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  margin: 16px 0 6px;
}
.pkg-cards:empty { display: none; }
.pkg-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px;
  border: 1px solid color-mix(in srgb, var(--text) 11%, transparent);
  border-radius: 14px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.pkg-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.pkg-card-off { opacity: 0.55; }
.pkg-card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pkg-card-name { font-size: 15px; font-weight: 650; color: var(--text); }
.pkg-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-active);
  color: var(--text-secondary);
  white-space: nowrap;
}
.pkg-tag-free { background: color-mix(in srgb, var(--brand, var(--accent)) 12%, transparent); color: var(--brand, var(--accent)); }
.pkg-tag-off { background: var(--danger-bg); color: var(--danger); }
.pkg-tag-edit { background: color-mix(in srgb, var(--brand, var(--accent)) 18%, transparent); color: var(--brand, var(--accent)); }
.pkg-card-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pkg-card-stats span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pkg-card-stats b { font-size: 14px; font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pkg-card-stats i { font-style: normal; font-size: 11px; color: var(--text-tertiary); }
.pkg-card-desc { margin: 0; font-size: 12.5px; line-height: 1.6; color: var(--text-secondary); }
.pkg-card-url { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pkg-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 2px; }

/* 用户端:定价卡片网格 */
.plan-packages-box { margin: 12px 0; }
.plan-packages-box:empty { display: none; }
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
.plan-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--text) 11%, transparent);
  border-radius: 16px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
  transition: transform 0.2s var(--ease-out, ease), box-shadow 0.2s ease, border-color 0.2s ease;
}
.plan-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--brand, var(--accent)) 28%, transparent);
}
.plan-tile-free {
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--brand, var(--accent)) 7%, transparent), transparent 60%),
    var(--bg-surface);
}
.plan-tile-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-tile-name { font-size: 14px; font-weight: 650; color: var(--text); }
.plan-tile-tag {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: color-mix(in srgb, var(--brand, var(--accent)) 12%, transparent);
  color: var(--brand, var(--accent));
  white-space: nowrap;
}
.plan-tile-price { display: flex; align-items: baseline; gap: 6px; }
.plan-tile-amount { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.plan-tile-free .plan-tile-amount { color: var(--brand, var(--accent)); }
.plan-tile-unit { font-size: 12px; color: var(--text-tertiary); }
.plan-tile-stats { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-secondary); flex-wrap: wrap; }
.plan-tile-dot { color: var(--text-tertiary); }
.plan-tile-desc { margin: 0; font-size: 12px; line-height: 1.6; color: var(--text-tertiary); }
.plan-tile-foot { margin-top: auto; padding-top: 6px; }
.plan-tile-btn { width: 100%; }

/* 分组列表卡片:iOS 设置式 —— 白底圆角卡片 + 清晰细描边 + 行间分隔线 */
.admin-list {
  display: block;
  gap: 0 !important;
  margin: 10px 0;
  min-height: 0;
  padding: 2px 14px;
  border: 1px solid color-mix(in srgb, var(--text) 11%, transparent);
  border-radius: 12px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
}
.admin-list > .row-between {
  padding: 11px 0;
  border-bottom: 1px solid var(--hairline);
}
.admin-list > .row-between:last-child { border-bottom: 0; }
.admin-list > .muted:only-child { display: inline-block; padding: 10px 0; }
.admin-list > .row-between code {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg-code);
  font-size: 12px;
}

/* ---------- MinerU 解析进度弹窗 ---------- */
.oc-parse-modal { width: min(430px, calc(100vw - 32px)); }
.oc-parse-modal .modal-body { padding: 4px 22px 6px; }
.oc-parse-modal .parse-file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  min-width: 0;
}
.oc-parse-modal .parse-file-row .fc-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.oc-parse-modal .parse-file-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text);
}
.oc-parse-modal .parse-file-size { flex-shrink: 0; font-size: 12px; color: var(--text-tertiary); }
.oc-parse-modal .parse-bar {
  height: 6px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--brand) 14%, var(--hairline));
  overflow: hidden;
}
.oc-parse-modal .parse-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width .3s ease;
}
.oc-parse-modal .parse-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
}
.oc-parse-modal .parse-pct { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); }
.oc-parse-modal .parse-hint { margin: 12px 0 0; font-size: 12px; line-height: 1.6; color: var(--text-tertiary); }
.oc-parse-modal .modal-footer { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding: 14px 22px 18px; }

/* 邮件模板页签:胶囊分段控件 */
.seg-group { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--bg-hover); }
.seg-group .seg-btn { border: none; background: transparent; padding: 6px 16px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--text-secondary); cursor: pointer; font-family: inherit; transition: background 0.15s, color 0.15s; }
.seg-group .seg-btn.active { background: var(--bg-surface); color: var(--text); box-shadow: var(--shadow-xs); font-weight: 600; }

/* 供应商卡片列表:加大卡片之间的间距 */
#admin-providers { display: flex; flex-direction: column; gap: 14px; }

/* 测试收件邮箱输入框:与其他表单控件一致的聚焦反馈 */
.admin-card input[type="email"]:focus {
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--brand, var(--accent)) 14%, transparent) !important;
  outline: none;
}

/* AI 思考策略:全局设置行(规则卡片复用 pkg-card 体系) */
.thinking-global {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 12px 22px;
  align-items: center;
  margin: 14px 0 6px;
}
.thinking-global .field { margin: 0; }
.thinking-global .user-form-admin { margin: 0; }
@media (max-width: 720px) { .thinking-global { grid-template-columns: 1fr; } }

/* ---------- 移动端修复 ---------- */
/* 抽屉打开时清除折叠残留的负 margin(旧机制是 margin,新机制是 transform,叠加导致抽屉只露出一条边) */
@media (max-width: 768px) {
  .sidebar, .sidebar.collapsed { margin-left: 0 !important; margin-right: 0 !important; }
  .sidebar.collapsed.mobile-open, .sidebar.mobile-open { transform: translateX(0) !important; }
  .sidebar.collapsed:not(.mobile-open), .sidebar:not(.mobile-open) { transform: translateX(-100%); }
  /* 底部免责声明与输入区保持安全距离,不再贴边裁切 */
  .composer-hint { padding: 0 16px calc(10px + env(safe-area-inset-bottom, 0px)); }
}

/* 分享页消息排版:与聊天一致 —— 用户气泡靠右不带头像,助手消息带头像 */
.share-page .msg { flex-direction: row !important; align-items: flex-start; }
.share-page .msg.user { flex-direction: row-reverse !important; justify-content: flex-start; }
.share-page .msg.user .msg-avatar { display: none !important; }
.share-page .msg .msg-avatar { align-self: flex-start; }
.share-page .msg .msg-content { max-width: min(82%, 640px); }

/* 分享页错误/空状态:视口垂直居中 + 柔和图标 */
.share-error, .share-empty {
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 24px;
  text-align: center;
}
.share-error-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 12px;
  border-radius: 20px;
  background: var(--bg-hover);
  color: var(--text-tertiary);
}
.share-error h1 { font-size: 20px; margin: 0 0 6px; color: var(--text); }
.share-error p { margin: 0 0 18px; color: var(--text-tertiary); font-size: 13.5px; }

/* 链接型按钮:去掉下划线,统一高度(按钮与链接的 UA 默认样式不同) */
a.btn { text-decoration: none !important; }
.plan-tile-btn {
  width: 100%;
  height: 38px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13.5px;
}

/* 用户端用量:统计大数卡 + 模型占比卡 */
.usage-summary-box { margin: 12px 0; }
.usage-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.usage-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid color-mix(in srgb, var(--text) 11%, transparent);
  border-radius: 16px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
  transition: transform 0.2s var(--ease-out, ease), box-shadow 0.2s ease;
}
.usage-stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.usage-stat-accent {
  background: radial-gradient(120% 100% at 100% 0%, color-mix(in srgb, var(--brand, var(--accent)) 10%, transparent), transparent 60%), var(--bg-surface);
}
.usage-stat-label { font-size: 12px; color: var(--text-tertiary); letter-spacing: 0.02em; }
.usage-stat-value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.15; }
.usage-stat-accent .usage-stat-value { color: var(--brand, var(--accent)); }
.usage-stat-sub { font-size: 12px; color: var(--text-secondary); }
.usage-stat-err { color: var(--danger); font-weight: 600; }

.usage-model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.usage-model-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--text) 11%, transparent);
  border-radius: 14px;
  background: var(--bg-surface);
}
.usage-model-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.share-bar { height: 6px; border-radius: 999px; background: var(--bg-hover); overflow: hidden; }
.share-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--brand, var(--accent)) 55%, transparent), var(--brand, var(--accent)));
  transition: width 0.4s var(--ease-out, ease);
}
.usage-model-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-secondary); }
.usage-model-tokens { font-variant-numeric: tabular-nums; color: var(--text-tertiary); white-space: nowrap; }
