/* 文枢 LitHub · Swiss Grid
   延续黑白/信号红品牌；按用户反馈改为内容优先的流式三栏，并允许来源品牌图标。 */

/* ========== CSS 变量 ========== */
:root {
  /* 颜色 */
  --bg: #ffffff;
  --ink: #000000;
  --ink-2: #555555;
  --ink-3: #999999;
  --line-soft: #e0e0e0;
  --line-strong: #000000;
  --signal: #e31b23;
  /* 浅底:悬停/工具卡/代码块的统一底色(旧版留了个 --bg-subtle 引用,这里补上定义) */
  --bg-subtle: #fafafa;

  /* 字体族 / 字号阶梯 / 行高 / 字重 / 字距 —— 统一在 fonts.css(唯一来源),本文件只用 var() */

  /* 间距(8pt 栅格) */
  --sp-1: 8px;
  --sp-2: 16px;
  --sp-3: 24px;
  --sp-4: 32px;
  --sp-6: 48px;
  --sp-12: 96px;
  --page-gutter: clamp(20px, 2vw, 40px);
  --column-gap: clamp(16px, 1.4vw, 24px);
  --rail-width: 176px;
  --assistant-width: 320px;
}

/* ========== 暗色模式(data-theme="dark",设置页「外观」切换;localStorage 记 lh-theme) ==========
   只覆盖八色令牌,组件全部 var() 引用,所以一处换全站换。
   原则:底近黑不纯黑(#16181d 比 #000 柔和),墨反转为近白,信号红调亮(#ff4d55 在暗底上才够对比)。 */
:root[data-theme="dark"] {
  --bg: #16181d;
  --ink: #eceef1;
  --ink-2: #a9b0ba;
  --ink-3: #7a828d;
  --line-soft: #2c3138;
  --line-strong: #eceef1;
  --signal: #ff4d55;
  --bg-subtle: #1f232a;
}

/* ========== 全局重置 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }

[hidden] {
  display: none !important;
}

html, body {
  height: 100%;
  font-family: var(--font-sans);
  font-weight: var(--fw-regular);
  font-size: var(--fs-body-lg);
  line-height: var(--lh-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button {
  font-family: inherit;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
}

input {
  font-family: inherit;
  background: none;
  border: none;
  outline: none;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

/* 键盘焦点:Swiss 风格用信号红细线,不用浏览器默认蓝环;
   :focus-visible 保证鼠标点击不出环、Tab 键才出环 */
:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

::selection {
  background: var(--signal);
  color: var(--bg);
}

/* 滚动条:取 pi 主题 light.json 的 scrollbarTrack / scrollbarThumb
   (okhsl(248 3% 90%) / okhsl(226 7% 65%)),细、方、无按钮;侧栏/结果区/助手区一致 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #e9e9eb;
}

::-webkit-scrollbar-thumb {
  background: #a2a5ad;
}

::-webkit-scrollbar-thumb:hover {
  background: #8b8e96;
}

::-webkit-scrollbar-button {
  display: none;
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* Firefox 专用回退。
   注意:Chromium 121+ 只要元素上设了 scrollbar-width / scrollbar-color,
   ::-webkit-scrollbar 那一整块就失效,滚动条会退回系统原生样式
   (Windows 上带着上下箭头按钮、更粗、间距也不对) —— 所以这条只能给 Firefox,
   用 @supports selector() 判定,不要写成 `* { ... }`(踩过)。 */
@supports not selector(::-webkit-scrollbar) {
  * {
    scrollbar-width: thin;
    scrollbar-color: #a2a5ad #e9e9eb;
  }
}

/* 可滚动容器的留白统一:滚动条槽固定占位,内容左右边距一致,避免「滑一下内容跳一下」 */
.sidebar,
.main,
.assistant-messages,
.exports-list,
.assistant-caps,
.modal-card,
.source-groups,
#results {
  scrollbar-gutter: stable;
}

/* ========== 布局骨架：限宽两侧栏，剩余空间全部给内容 ========== */
.app {
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr) var(--assistant-width);
  /* 刊头行按内容撑开,min-height 兜住 96px 设计值.固定 96px 时标题行高盒(52.8px)+副标题
     +上下内边距比行高更高,flex-end 会把超出部分顶到页顶之外,中文标题被切上半截.
     注意:这里必须用 max-content —— auto/minmax(96px,auto) 在「定高容器 + 1fr」组合下
     都只取到最小值(96px),不会按内容撑开 */
  grid-template-rows: max-content minmax(0, 1fr);
  column-gap: var(--column-gap);
  height: 100vh;
  height: 100dvh;
  padding: 0 var(--page-gutter);
  width: 100%;
  max-width: none;
  margin: 0 auto;
}

/* ========== 刊头 ========== */
.masthead {
  grid-column: 1 / -1;
  min-height: 88px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  /* 顶部留 8px 余量:中文字形墨迹会略高于行高盒,贴页顶会被裁 */
  padding: var(--sp-1) 0 var(--sp-2);
  border-bottom: 2px solid var(--line-strong);
}

.page-title {
  font-size: var(--fs-display-lg);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-tight);
}

.page-subtitle {
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-regular);
  color: var(--ink-2);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  margin-top: var(--sp-1);
}

.masthead-right {
  text-align: right;
  padding-bottom: var(--sp-1);
}

.meta-date {
  font-size: var(--fs-body-md);
  font-weight: var(--fw-regular);
  color: var(--ink);
}

.meta-version {
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-regular);
  color: var(--ink-3);
  margin-top: 4px;
}

/* ========== 侧栏 ========== */
.sidebar {
  grid-column: 1;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line-strong);
  padding: var(--sp-3) var(--sp-2) var(--sp-2) 0;
}

.sidebar-brand {
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 20px;
  flex-shrink: 0;
}

/* 矢量化锁定版式(标记 + 字标),随侧栏宽度自适应 */
.brand-logo {
  width: 100%;
  max-width: 104px;
  height: auto;
  display: block;
  margin-bottom: var(--sp-2);
}

.brand-name {
  font-size: var(--fs-title-md);
  font-weight: var(--fw-bold);
  color: var(--ink);
  line-height: var(--lh-snug);
}

.brand-sub {
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-regular);
  color: var(--ink-3);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  margin-top: 4px;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: var(--sp-3);
}

.nav-group-title {
  font-size: var(--fs-body-md);
  font-weight: var(--fw-bold);
  color: var(--ink);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  margin-bottom: var(--sp-1);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line-strong);
  width: 16px;
}

.nav-item {
  display: block;
  font-size: var(--fs-body-lg);
  font-weight: var(--fw-regular);
  color: var(--ink);
  line-height: var(--lh-loose);
  padding: 0;
}

.nav-item:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.nav-item.active {
  font-weight: var(--fw-bold);
  color: var(--signal);
}

.nav-item.active:hover {
  text-decoration: none;
}

.sidebar-footer {
  padding-top: var(--sp-2);
  border-top: 1px solid var(--line-soft);
  flex-shrink: 0;
}

.pi-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-regular);
  color: var(--ink);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  margin-bottom: var(--sp-1);
}

.pi-dot {
  width: 6px;
  height: 6px;
  background: var(--signal);
  display: inline-block;
}

.session-id {
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-regular);
  color: var(--ink-3);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
}

/* ========== 主区 ========== */
.main {
  grid-column: 2;
  min-width: 0;
  min-height: 0;
  padding: var(--sp-3) 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
  padding-right: 6px;
}

/* 查询块 */
.query-block {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-bottom: var(--sp-3);
  border-bottom: 2px solid var(--line-strong);
  margin-bottom: var(--sp-3);
}

.query-main {
  flex: 1;
  min-width: 0;
}

.query-label {
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-regular);
  color: var(--ink-3);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  margin-bottom: var(--sp-1);
}

.query-text {
  font-size: var(--fs-title-lg);
  font-weight: var(--fw-bold);
  color: var(--ink);
  line-height: var(--lh-snug);
  margin-bottom: var(--sp-1);
}

.query-sources {
  font-size: var(--fs-body-md);
  font-weight: var(--fw-regular);
  color: var(--ink-2);
  letter-spacing: var(--ls-wide);
}

.query-params {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  text-align: right;
  padding-top: var(--sp-3);
}

.param-year {
  font-size: var(--fs-body-md);
  font-weight: var(--fw-regular);
  color: var(--ink);
  margin-bottom: 4px;
}

.param-oa {
  font-size: var(--fs-body-md);
  font-weight: var(--fw-regular);
  color: var(--ink-2);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
}

/* 检索状态行 */
.search-status {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: var(--sp-2);
}

.status-bar {
  width: 24px;
  height: 2px;
  background: var(--ink);
  animation: slide 1.2s ease-in-out infinite;
}

@keyframes slide {
  0% { transform: translateX(0); }
  50% { transform: translateX(12px); }
  100% { transform: translateX(0); }
}

.status-text {
  font-size: var(--fs-body-md);
  font-weight: var(--fw-regular);
  color: var(--ink-2);
  letter-spacing: var(--ls-wide);
}

/* 命中数字行 */
.hits-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--sp-3);
  border-bottom: 2px solid var(--line-strong);
  margin-bottom: var(--sp-3);
}

.hits-number {
  font-size: var(--fs-display-xl);
  font-weight: var(--fw-bold);
  color: var(--ink);
  line-height: var(--lh-flat);
  letter-spacing: var(--ls-tight);
  margin-right: var(--sp-2);
}

.hits-info {
  flex: 1;
}

.hits-label {
  font-size: var(--fs-body-md);
  font-weight: var(--fw-bold);
  color: var(--ink);
  margin-bottom: 4px;
}

.hits-time {
  font-size: var(--fs-body-md);
  font-weight: var(--fw-regular);
  color: var(--ink-2);
}

.hits-actions {
  display: flex;
  gap: var(--sp-3);
}

/* 文字按钮 */
.text-btn {
  font-size: var(--fs-body-md);
  font-weight: var(--fw-bold);
  color: var(--ink);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  padding: 0;
  transition: text-decoration-thickness 0.15s;
}

.text-btn:hover:not(:disabled) {
  text-decoration-thickness: 2px;
}

.text-btn:disabled {
  color: var(--ink-3);
  text-decoration-color: var(--line-soft);
  cursor: not-allowed;
}

/* 结果列表 */
.results {
  display: flex;
  flex-direction: column;
}

.empty-state {
  padding: var(--sp-6) 0;
  text-align: center;
  font-size: var(--fs-body-md);
  font-weight: var(--fw-regular);
  color: var(--ink-3);
}

/* 结果条目 */
.result-item {
  display: grid;
  grid-template-columns: 32px 1fr 92px;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
}

.result-item.active::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--sp-3));
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--signal);
}

.result-number {
  font-size: var(--fs-display-md);
  font-weight: var(--fw-bold);
  color: var(--ink);
  line-height: var(--lh-tight);
}

.result-content {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.result-sources {
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-regular);
  color: var(--ink-3);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
}

.result-title {
  font-size: var(--fs-title-lg);
  font-weight: var(--fw-bold);
  color: var(--ink);
  line-height: var(--lh-snug);
  margin-bottom: 4px;
}

.result-meta {
  font-size: var(--fs-body-md);
  font-weight: var(--fw-regular);
  color: var(--ink-2);
}

.result-doi {
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-regular);
  color: var(--signal);
  font-family: var(--font-mono);
}

.result-abstract {
  font-size: var(--fs-body-md);
  font-weight: var(--fw-regular);
  color: var(--ink-2);
  line-height: var(--lh-body);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.result-metrics {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  text-align: right;
}

.metric-cited {
  font-size: var(--fs-display-sm);
  font-weight: var(--fw-bold);
  color: var(--ink);
  line-height: var(--lh-tight);
}

.metric-label {
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-regular);
  color: var(--ink-3);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
}

.metric-oa {
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-regular);
  color: var(--ink);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 4px;
}

.metric-oa::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--ink);
  flex-shrink: 0;
}

.metric-pdf {
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-regular);
  color: var(--ink);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* 骨架屏 */
.skeleton-item {
  display: grid;
  grid-template-columns: 32px 1fr 92px;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--line-soft);
}

.skeleton-number {
  font-size: var(--fs-display-md);
  font-weight: var(--fw-bold);
  color: var(--line-soft);
}

.skeleton-content {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.skeleton-line {
  height: 1px;
  background: var(--line-soft);
}

/* 分页行 */
.pagination {
  display: flex;
  justify-content: space-between;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line-soft);
  font-size: var(--fs-body-md);
  font-weight: var(--fw-regular);
  color: var(--ink-2);
}

.page-nav {
  display: flex;
  gap: var(--sp-2);
}

/* ========== 助手栏 ========== */
/* 布局属性后续在「助手面板 v2」区块有追加定义(overflow/padding 在那里重置) */
.assistant {
  grid-column: 3;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line-soft);
}

.assistant-header {
  padding-bottom: var(--sp-3);
  border-bottom: 2px solid var(--line-strong);
  margin-bottom: var(--sp-3);
}

.assistant-title {
  font-size: var(--fs-title-md);
  font-weight: var(--fw-bold);
  color: var(--ink);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  margin-bottom: var(--sp-1);
}

.assistant-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-regular);
  color: var(--ink-3);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
}

.assistant-messages {
  flex: 1;
  min-height: 80px;
  overflow-y: auto;
  margin-bottom: var(--sp-3);
}

.assistant-empty {
  padding: var(--sp-6) 0;
  text-align: center;
  font-size: var(--fs-body-md);
  font-weight: var(--fw-regular);
  color: var(--ink-3);
}

.assistant-empty .hint {
  font-size: var(--fs-body-sm);
  margin-top: var(--sp-1);
}

.message {
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--line-soft);
}

.message-meta {
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-regular);
  color: var(--ink-3);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  margin-bottom: var(--sp-1);
}

.message-body {
  font-size: var(--fs-body-lg);
  font-weight: var(--fw-regular);
  color: var(--ink);
  line-height: var(--lh-body);
  white-space: pre-wrap;
}

.message-body code {
  font-family: var(--font-mono);
  font-size: var(--fs-body-md);
  background: none;
  padding: 0;
}

.tool-call {
  font-size: var(--fs-body-md);
  font-weight: var(--fw-bold);
  color: var(--ink);
  letter-spacing: var(--ls-wide);
}

.tool-call::before {
  content: '✓ ';
}

.assistant-input {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) 0;
  border-top: 2px solid var(--line-strong);
  margin-bottom: var(--sp-3);
}

.assistant-input input {
  flex: 1;
  min-width: 0;
  font-size: var(--fs-body-md);
  font-weight: var(--fw-regular);
  color: var(--ink);
  padding: 0;
}

.assistant-input input::placeholder {
  color: var(--ink-3);
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
}

.assistant-exports {
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line-soft);
}

.exports-title {
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-regular);
  color: var(--ink);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  margin-bottom: var(--sp-2);
}

.exports-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.export-empty {
  font-size: var(--fs-body-md);
  font-weight: var(--fw-regular);
  color: var(--ink-3);
}

.export-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--fs-body-md);
  font-weight: var(--fw-regular);
  color: var(--ink);
  padding: 4px 0;
}

.export-name {
  font-family: var(--font-mono);
}

.export-size {
  color: var(--ink-2);
  margin-left: auto;
  margin-right: var(--sp-1);
}

.export-arrow {
  color: var(--ink);
}

/* ================================================================
   以下为功能页样式（检索表单 / 检索式 / 引文 / 文库 / 状态 / 配置 / 期刊 / 图谱）
   ================================================================ */

/* ---------- 检索表单(查询块交互件) ---------- */
.query-line {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-1);
}

.query-input {
  flex: 1;
  min-width: 0;
  font-size: var(--fs-title-lg);
  font-weight: var(--fw-bold);
  color: var(--ink);
  line-height: var(--lh-snug);
  padding: 2px 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s;
}

.query-input::placeholder {
  color: var(--ink-3);
  font-weight: var(--fw-regular);
}

.query-input:focus {
  border-bottom-color: var(--ink);
}
.query-input:focus-visible { outline: none; }   /* 大输入框不要全局红环,黑下划线已够 */

.query-exec {
  flex-shrink: 0;
}

/* 渠道栏:一行横滑,不换行。
   做法沿用各家 AI 产品 chip 行的惯例:隐藏原生滚动条,靠两端渐隐提示还有内容,
   支持鼠标拖拽 + 滚轮横滑;键盘 Tab 到屏幕外的按钮时浏览器会自动滚入。 */
.query-sources {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;          /* Firefox 隐藏原生滚动条 */
  -ms-overflow-style: none;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain; /* 横滑到头不要带着整页晃 */
  cursor: grab;
  font-size: var(--fs-body-md);
  letter-spacing: var(--ls-wide);
}
.query-sources::-webkit-scrollbar { display: none; }
.query-sources.dragging { cursor: grabbing; scroll-behavior: auto; }
.query-sources > .src-toggle { flex: 0 0 auto; }

.src-toggle {
  font-size: var(--fs-body-md);
  font-weight: var(--fw-regular);
  color: var(--ink-2);
  letter-spacing: var(--ls-wide);
  padding: 0;
}

.param-years {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  margin-bottom: 4px;
}

.year-input {
  width: 5ch;
  text-align: right;
  font-family: var(--font-mono);
  font-size: var(--fs-body-md);
  color: var(--ink);
  border-bottom: 1px solid transparent;
  padding: 0;
}

.year-input:focus {
  border-bottom-color: var(--ink);
}

.year-input::placeholder {
  color: var(--ink-3);
}

.year-dash {
  color: var(--ink-3);
  font-size: var(--fs-body-md);
}

.param-oa {
  font-size: var(--fs-body-md);
  font-weight: var(--fw-regular);
  color: var(--ink-2);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  padding: 0;
}

.param-oa.on {
  color: var(--ink);
  font-weight: var(--fw-bold);
}

/* ---------- 源失败标注 ---------- */
.source-notes {
  padding: var(--sp-2) 0;
  font-size: var(--fs-body-md);
  color: var(--signal);
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: var(--sp-2);
}

/* ---------- 结果行操作(保存) ---------- */
.metric-save {
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-regular);
  color: var(--ink);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.metric-save.saved {
  color: var(--signal);
  text-decoration-color: var(--signal);
}

/* ---------- 通用两栏布局(检索式/引文/文库/期刊/图谱) ---------- */
.split {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: var(--sp-4);
  align-items: start;
}

.split-even {
  grid-template-columns: 1fr 1fr;
}

.col {
  min-width: 0;
}

.col-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-2);
  padding-bottom: var(--sp-2);
  border-bottom: 2px solid var(--line-strong);
  margin-bottom: var(--sp-3);
}

.col-title {
  font-size: var(--fs-title-md);
  font-weight: var(--fw-bold);
  color: var(--ink);
}

.col-note {
  font-size: var(--fs-body-sm);
  color: var(--ink-3);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
}

.row-actions {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

/* ---------- 检索式页 ---------- */
.group-card {
  border: 1px solid var(--line-strong);
  padding: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--sp-1);
}

.group-id {
  font-size: var(--fs-body-md);
  font-weight: var(--fw-bold);
}

.term-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-1);
  font-size: var(--fs-body-md);
  line-height: var(--lh-loose);
}

.term-del {
  color: var(--ink-3);
  font-size: var(--fs-body-sm);
  padding: 0 4px;
}

.term-del:hover { color: var(--signal); }

.term-add {
  font-size: var(--fs-body-sm);
  color: var(--ink-3);
  text-decoration: underline;
  padding-top: 4px;
}

.op-select {
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-regular);
  color: var(--ink-2);
  border: 1px solid var(--line-soft);
  background: var(--bg);
  padding: 2px 4px;
  font-family: var(--font-mono);
}

.dialect-row {
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--line-soft);
}

.dialect-head {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  margin-bottom: 6px;
}

.dialect-name {
  font-size: var(--fs-body-lg);
  font-weight: var(--fw-bold);
  color: var(--ink);
}

.tag-need {
  font-size: var(--fs-2xs);
  letter-spacing: var(--ls-wide);
  border: 1px solid var(--line-soft);
  color: var(--ink-3);
  padding: 0 6px;
  border-radius: 999px;
  line-height: var(--lh-body);
}

.dialect-copy {
  margin-left: auto;
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
}

.dialect-expr {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--ink-2);
  line-height: var(--lh-loose);
  word-break: break-all;
  white-space: pre-wrap;
}

/* ---------- 引文页 ---------- */
.record-row {
  display: grid;
  grid-template-columns: 20px 32px 1fr;
  gap: var(--sp-2);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--line-soft);
  align-items: start;
}

.record-check {
  width: 14px;
  height: 14px;
  margin-top: 4px;
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  cursor: pointer;
  position: relative;
}

.record-check:checked {
  background: var(--ink);
}

.record-check:checked::after {
  content: '✓';
  color: var(--bg);
  font-size: var(--fs-2xs);
  position: absolute;
  left: 2px;
  top: -1px;
}

.record-num {
  font-family: var(--font-mono);
  font-size: var(--fs-body-sm);
  color: var(--ink-3);
  padding-top: 3px;
}

.record-title {
  font-size: var(--fs-body-lg);
  font-weight: var(--fw-bold);
  color: var(--ink);
  line-height: var(--lh-snug);
  margin-bottom: 2px;
}

.record-meta {
  font-size: var(--fs-body-md);
  color: var(--ink-2);
}

.fmt-tabs {
  display: flex;
  gap: var(--sp-3);
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: var(--sp-1);
  margin-bottom: var(--sp-2);
}

.fmt-tab {
  font-size: var(--fs-body-lg);
  color: var(--ink-2);
  padding: 0 0 6px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}

.fmt-tab.active {
  font-weight: var(--fw-bold);
  color: var(--ink);
  border-bottom-color: var(--line-strong);
}

.preview-block {
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  line-height: var(--lh-loose);
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 420px;
  overflow-y: auto;
}

/* ---------- 文库页 ---------- */
.saved-row {
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--line-soft);
}

.saved-query {
  font-size: var(--fs-body-lg);
  font-weight: var(--fw-bold);
  color: var(--ink);
  margin-bottom: 4px;
  word-break: break-word;
}

.saved-meta {
  font-size: var(--fs-body-md);
  color: var(--ink-2);
  margin-bottom: 6px;
}

.saved-status {
  font-size: var(--fs-body-md);
  font-weight: var(--fw-bold);
  color: var(--ink-3);
  margin-bottom: 6px;
}

.saved-status.has-new {
  color: var(--signal);
}

.saved-status.has-new::before {
  content: '■ ';
  font-size: var(--fs-3xs);
}

.lib-row {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: var(--sp-2);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--line-soft);
  align-items: start;
}

.tag-pill {
  display: inline-block;
  font-size: var(--fs-2xs);
  letter-spacing: var(--ls-wide);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0 8px;
  line-height: var(--lh-loose);
  color: var(--ink);
  margin-right: 4px;
  margin-top: 4px;
}

/* ---------- 状态页 ---------- */
.big-status {
  font-size: var(--fs-display-lg);
  font-weight: var(--fw-bold);
  color: var(--ink);
  line-height: var(--lh-tight);
}

/* ---------- 状态页 ---------- */
.status-line {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-top: var(--sp-1);
}

.status-sub {
  font-size: var(--fs-body-md);
  color: var(--ink-2);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-body-md);
}

.data-table th {
  text-align: left;
  font-size: var(--fs-2xs);
  font-weight: var(--fw-regular);
  color: var(--ink-3);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  padding: 0 12px 8px 0;
  border-bottom: 1px solid var(--line-strong);
}

.data-table td {
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: baseline;
}

.data-table td.num {
  font-family: var(--font-mono);
  text-align: right;
  white-space: nowrap;
}

.data-table th.num { text-align: right; }

.ok-square, .fail-square {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  vertical-align: middle;
}

.ok-square { background: var(--ink); }
.fail-square { background: var(--signal); }
.fail-text { color: var(--signal); }

.quota-bar {
  height: 2px;
  background: var(--line-soft);
  margin: var(--sp-1) 0;
  position: relative;
}

.quota-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: var(--ink);
}

/* ---------- 配置页 ---------- */
/* 配置页：这页混了两种区块（搬来的 access-block 与原有的 set-group），
   原来一个是大写标题 + 2px 顶线、一个是小写小标题且没有线 —— 同页两种语言就是「乱」的根源。
   这里把 set-group 统一到 access-block 那一套，全页一个层级。 */
.settings-main .set-group {
  border-top: 2px solid var(--line-strong);
  padding: var(--sp-3) 0 var(--sp-4);
  margin-bottom: 0;
}
.settings-main .set-group-title {
  font-size: var(--fs-title-md);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-wide);
  text-transform: none;
  margin-bottom: 12px;
}
/* 空状态别占一整块灰底：一行字就够，配置页这种「还没填」的地方很多 */
.settings-main .empty-state {
  padding: 12px 14px;
  background: var(--bg-subtle);
  color: var(--ink-2);
  font-size: var(--fs-sm);
}
.settings-main .empty-state p { margin: 0; }
/* 长说明文字收窄、给个左线，和正文区分开但不抢眼 */
.settings-main .ablesci-note-line {
  border-left: 3px solid var(--line-soft);
  padding-left: 12px;
  margin-top: 14px;
  line-height: var(--lh-body);
}
/* 搬过来的两块里，两栏表单的间距对齐 access-main 的节奏 */
.settings-main .accounts-split { gap: 28px; }
.settings-main .resolve-form { margin-top: 4px; }

.set-group { margin-bottom: var(--sp-4); }

.set-group-title {
  font-size: var(--fs-body-md);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line-strong);
  margin-bottom: var(--sp-1);
}

.set-row {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}

.set-key {
  width: 180px;
  flex-shrink: 0;
  font-size: var(--fs-2xs);
  color: var(--ink-3);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
}

.set-val {
  flex: 1;
  min-width: 0;
  font-size: var(--fs-body-md);
  color: var(--ink);
  word-break: break-all;
}

.set-val.mono { font-family: var(--font-mono); }
.set-val.muted { color: var(--ink-3); }

.chip {
  display: inline-block;
  font-size: var(--fs-2xs);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0 8px;
  line-height: var(--lh-loose);
  margin: 0 4px 4px 0;
}

.chip.on { background: var(--ink); color: var(--bg); }

.switch-btn {
  font-size: var(--fs-2xs);
  border: 1px solid var(--line-strong);
  padding: 2px 10px;
  margin-right: 4px;
}

.switch-btn.on { background: var(--ink); color: var(--bg); }

/* ---------- 期刊页 ---------- */
.plain-input {
  flex: 1;
  font-size: var(--fs-title-lg);
  font-weight: var(--fw-bold);
  color: var(--ink);
  border-bottom: 2px solid transparent;
  padding: 2px 0;
}

.plain-input:focus { border-bottom-color: var(--ink); }
.plain-input::placeholder { color: var(--ink-3); font-weight: var(--fw-regular); }

.journal-row { cursor: pointer; }

.journal-row.selected td {
  box-shadow: inset 4px 0 0 var(--signal);
  padding-left: 12px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 var(--sp-4);
  margin-top: var(--sp-2);
}

/* ---------- 图谱页 ---------- */
.graph-wrap {
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: var(--sp-2) 0;
  position: relative;
}

.graph-svg {
  width: 100%;
  height: 360px;
  display: block;
}

.graph-ctrl {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.ctrl-label {
  font-size: var(--fs-2xs);
  color: var(--ink-3);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.ctrl-btn {
  font-size: var(--fs-xs);
  font-family: var(--font-mono);
  border: 1px solid var(--line-strong);
  padding: 2px 8px;
  margin-right: 4px;
}

.ctrl-btn.on { background: var(--ink); color: var(--bg); }

.ctrl-text {
  display: block;
  font-size: var(--fs-body-md);
  color: var(--ink);
  padding: 2px 0;
  text-align: left;
}

.ctrl-text.on {
  font-weight: var(--fw-bold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- 加载 / 提示 ---------- */
.loading-line {
  padding: var(--sp-4) 0;
  text-align: center;
  font-size: var(--fs-body-md);
  color: var(--ink-3);
}

/* ---------- 表单件(渠道管理用) ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
  margin: 12px 0;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-field.wide { grid-column: 1 / -1; }

.form-field label {
  font-size: var(--fs-2xs);
  color: var(--ink-3);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
}

.form-input {
  font-family: inherit;
  font-size: var(--fs-sm);
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-soft);
  padding: 6px 8px;
  outline: none;
}

.form-input:focus { border-color: var(--ink); }
.form-input.mono { font-family: var(--font-mono); }

select.form-input { cursor: pointer; }

.btn-solid {
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--bg);
  background: var(--ink);
  border: 1px solid var(--ink);
  padding: 7px 16px;
  cursor: pointer;
}

.btn-solid:hover { background: #333; }

.btn-ghost {
  font-family: inherit;
  font-size: var(--fs-sm);
  color: var(--ink);
  background: none;
  border: 1px solid var(--line-strong);
  padding: 6px 12px;
  cursor: pointer;
}

.btn-ghost:hover { background: var(--bg-subtle); }

.chan-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}

.chan-row .chan-name { font-weight: var(--fw-regular); }
.chan-row.active .chan-name { font-weight: var(--fw-bold); }
.chan-row .chan-models {
  flex: 1;
  min-width: 0;
  font-size: var(--fs-xs);
  font-family: var(--font-mono);
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 三个格子各自不缩：当前标记 / 状态标签(KEY·测试) / 操作按钮 */
.chan-row .chan-flag { flex: 0 0 12px; }
.chan-row .chan-tags,
.chan-row .chan-acts { display: flex; align-items: baseline; gap: 10px; flex-shrink: 0; }
.chan-row .chan-acts { align-items: center; }

.chan-form {
  border: 1px solid var(--line-soft);
  padding: 16px;
  margin-top: 16px;
}

.chan-form-title {
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  margin-bottom: 4px;
}

/* ================================================================
   升级(2026-10-03):助手抽屉 / 浮动触发 / 全文互助页 / 响应式 / reduced-motion
   ================================================================ */

/* ---------- 助手面板:可收起右侧面板 + 右下浮动触发(不占底部) ---------- */
.assistant-head-left { flex: 1; min-width: 0; }
.assistant-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-2);
}
.assistant-head-actions {
  display: flex;
  gap: var(--sp-2);
  padding-bottom: 2px;
}

.assistant-fab {
  position: fixed;
  right: var(--sp-3);
  bottom: var(--sp-6);
  z-index: 60;
  display: none;
  align-items: center;
  gap: var(--sp-1);
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: var(--fs-body-md);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  cursor: pointer;
}
.assistant-fab .fab-square {
  width: 8px;
  height: 8px;
  background: var(--signal);
}
.assistant-fab:focus-visible { outline: 1px dashed var(--ink); outline-offset: 2px; }

/* 收起时:面板移出视口右侧,浮动按钮出现 */
body.assistant-closed .assistant-fab { display: flex; }
body.assistant-closed .assistant {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 320px;
  background: var(--bg);
  transform: translateX(100%);
  transition: transform 0.2s ease-out;
  z-index: 50;
  padding: var(--sp-3);
  border-left: 1px solid var(--line-strong);
}
body.assistant-open .assistant {
  position: static;
  transform: none;
}
.skeleton-content { min-width: 0; }
.skeleton-line { max-width: 100%; }

/* 内容宽度不足时助手抽屉化，而不是继续挤压中间主区。 */
@media (max-width: 1180px) {
  :root { --rail-width: 156px; }
  .assistant {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: min(320px, 88vw);
    background: var(--bg);
    z-index: 50;
    padding: var(--sp-3);
    border-left: 1px solid var(--line-strong);
    transform: translateX(100%);
    transition: transform 0.2s ease-out;
  }
  body.assistant-open .assistant {
    position: fixed;
    transform: translateX(0);
    height: 100dvh;
    max-height: 100dvh;
    overflow-y: auto;
  }
  body.assistant-closed .assistant-fab { display: flex; }
  body.assistant-open .assistant-fab { display: none; }
  .app, body.assistant-closed .app { grid-template-columns: var(--rail-width) minmax(0, 1fr); }
  .main { grid-column: 2 / -1; min-width: 0; }
}

/* 768px:单栏,侧栏抽屉化(左侧滑出),防横向溢出 */
@media (max-width: 768px) {
  .app {
    display: block;
    padding: 0 var(--sp-2);
    height: auto;
    overflow-x: hidden;
  }
  .masthead { min-height: 0; padding: var(--sp-2) 0; }
  .page-title { font-size: var(--fs-display-md); }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(280px, 84vw);
    background: var(--bg);
    z-index: 55;
    padding: var(--sp-3);
    border-right: 1px solid var(--line-strong);
    transform: translateX(-100%);
    transition: transform 0.2s ease-out;
    overflow-y: auto;
  }
  .main { padding: var(--sp-2) 0 var(--sp-6); }
  .query-block { flex-direction: column; }
  .query-params {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px 16px;
    align-items: center;
    text-align: left;
    padding-top: 0;
  }
  .hits-block { flex-wrap: wrap; gap: 12px; }
  .hits-actions { gap: 16px; margin-left: auto; }
  .hits-number { font-size: var(--fs-display-lg); }
  .result-item { grid-template-columns: 28px 1fr; }
  .result-metrics { grid-column: 2; flex-direction: row; gap: var(--sp-2); align-items: baseline; }
  input, button, a { touch-action: manipulation; }
}

/* 侧栏移动触发(仅窄屏可见) */
.sidebar-fab {
  position: fixed;
  left: var(--sp-3);
  bottom: var(--sp-6);
  z-index: 60;
  display: none;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  font-size: var(--fs-body-md);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-wide);
}
@media (max-width: 768px) {
  .sidebar-fab { display: block; }
  .sidebar { visibility: hidden; }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar { visibility: visible; }
  body.sidebar-open .sidebar-fab { display: none; }
  body.assistant-open .sidebar-fab, body.sidebar-open .assistant-fab { display: none; }
}

/* ---------- 助手:能力列表面板 ---------- */
/* 停止按钮(发送中替代 ⏎) */
.stop-btn { color: var(--signal); }

/* ---------- 全文 · 互助页 ---------- */
.access-main { overflow-y: auto; }

.access-block {
  border-top: 2px solid var(--line-strong);
  padding: var(--sp-3) 0 var(--sp-4);
}
.access-block:first-child { border-top: none; padding-top: var(--sp-2); }
#access-readiness[hidden] + .access-block { border-top: none; padding-top: 0; }
.access-main .empty-state { padding: 20px 16px; text-align: left; background: var(--bg-subtle); color: var(--ink-2); }

.access-block-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--sp-3);
  margin-bottom: var(--sp-2);
  flex-wrap: wrap;
}
.access-block-title {
  font-size: var(--fs-title-md);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
}
.access-block-note {
  font-size: var(--fs-body-md);
  color: var(--ink-2);
}

.resolve-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
  gap: var(--sp-2);
  align-items: end;
  margin-bottom: var(--sp-2);
}
.resolve-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.resolve-field > span { font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: var(--ls-wide); }
.resolve-field small { margin-left: 8px; color: var(--ink-2); font-weight: var(--fw-regular); }
.resolve-field input { width: 100%; }
.access-exec { min-height: 36px; white-space: nowrap; }
@media (max-width: 768px) {
  .resolve-form { grid-template-columns: 1fr; }
}

.resolve-input {
  font-size: var(--fs-body-lg);
  /* 左侧常留 2px 位，聚焦/有内容时上色，字不会跳 */
  padding: 6px 0 6px 8px;
  border-left: 2px solid transparent;
  border-bottom: 1px solid var(--line-strong);
  min-width: 0;
}
/* 聚焦（或已经填了内容）→ 左侧 2px 信号红，与「导航当前页 / 已勾选渠道」同一个「你在这里」语言。
   `:focus-within` 兜住「窗口没在前台时 :focus 不命中」的情况，单独写一遍更稳。 */
.resolve-input:focus,
.resolve-field:focus-within .resolve-input,
.resolve-input:not(:placeholder-shown) { border-left-color: var(--signal); }
.resolve-input:focus { border-bottom: 2px solid var(--ink); }
.resolve-input::placeholder { color: var(--ink-3); font-weight: var(--fw-regular); }

.resolve-status {
  font-size: var(--fs-body-md);
  color: var(--ink-2);
  padding: var(--sp-1) 0;
}

.resolve-card { padding: var(--sp-2) 0; }
.resolve-verdict {
  display: flex;
  align-items: baseline;
  gap: var(--sp-1);
  font-size: var(--fs-title-lg);
  font-weight: var(--fw-bold);
  margin-bottom: var(--sp-1);
}
.verdict-square {
  width: 8px;
  height: 8px;
  background: var(--signal);
  align-self: center;
  flex-shrink: 0;
}
.verdict-note {
  font-size: var(--fs-body-md);
  font-weight: var(--fw-regular);
  color: var(--ink-2);
}
.resolve-pdf_available .verdict-square { background: var(--ink); }

.resolve-links {
  display: flex;
  gap: var(--sp-3);
  margin-bottom: var(--sp-2);
}
.resolve-attempts { margin-bottom: var(--sp-2); }
.attempt-line {
  font-size: var(--fs-body-md);
  color: var(--ink-2);
  line-height: var(--lh-body);
}
.resolve-help { border-top: 1px solid var(--line-soft); padding-top: var(--sp-2); }
.help-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-1);
}

.inline-link {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link-dead { color: var(--ink-3); font-size: var(--fs-body-md); }

.prepare-card {
  border: 1px solid var(--line-strong);
  padding: var(--sp-2);
  margin-top: var(--sp-2);
}
.prepare-title { font-size: var(--fs-title-md); margin-bottom: var(--sp-1); }
.prepare-text {
  font-size: var(--fs-body-md);
  color: var(--ink);
  line-height: var(--lh-body);
  white-space: pre-wrap;
  word-break: break-word;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: var(--sp-1) 0;
  margin: var(--sp-1) 0;
  max-height: 220px;
  overflow-y: auto;
}
.prepare-actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; }

/* 渠道目录 */
.source-search-line { margin-bottom: var(--sp-3); }
.source-search-line .resolve-input { width: 100%; }
.source-group { margin-bottom: var(--sp-3); }
.source-group-title {
  font-size: var(--fs-title-md);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  margin-bottom: var(--sp-1);
}
.source-group-hint {
  font-size: var(--fs-body-md);
  font-weight: var(--fw-regular);
  color: var(--ink-2);
  letter-spacing: 0;
  text-transform: none;
  display: block;
  margin-top: 4px;
  line-height: var(--lh-body);
}
.source-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 212px), 1fr));
  gap: 8px;
}
/* 渠道条目 + 右上角的「配置」：绝不能把 button 嵌进 button（无效 HTML），
   所以外面包一层定位壳，配置键浮在角落，主体仍是「点了就跳转」。 */
.source-cell { position: relative; display: grid; }
.source-cell .source-item { width: 100%; height: 100%; }
.src-cfg {
  position: absolute; top: 4px; right: 4px;
  font-size: var(--fs-2xs);
  letter-spacing: var(--ls-wide);
  padding: 1px 5px;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  color: var(--ink-3);
  opacity: 0;
  transition: opacity .16s ease, color .16s ease, border-color .16s ease;
}
.source-cell:hover .src-cfg, .src-cfg:focus-visible { opacity: 1; }
.src-cfg:hover { color: var(--ink); border-color: var(--ink); }

.source-item {
  background: var(--bg);
  padding: 12px;
  min-height: 72px;
  min-width: 0;
  border: 1px solid var(--line-soft);
  text-align: left;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 12px;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.source-item-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.source-item-arrow { align-self: start; color: var(--ink-3); font-size: var(--fs-sm); }
.source-item:hover { background: var(--bg-subtle); border-color: var(--ink-3); }
.source-item:hover .source-item-arrow { color: var(--ink); }
.source-item:hover .source-item-name { text-decoration: underline; }
.source-item:focus-visible { outline: 1px dashed var(--ink); outline-offset: -2px; }
.source-item:disabled { color: var(--ink-3); cursor: wait; }
.source-item-name { font-size: var(--fs-body-lg); font-weight: var(--fw-bold); line-height: var(--lh-snug); overflow-wrap: anywhere; }
.source-item-mode {
  font-size: var(--fs-body-sm);
  color: var(--ink-2);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
}

/* 科研通状态格 */
.ablesci-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.5fr);
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}
@media (max-width: 768px) {
  .ablesci-grid { grid-template-columns: repeat(2, 1fr); }
}
.ablesci-cell { border-top: 1px solid var(--line-soft); padding-top: var(--sp-1); }
.cell-label {
  font-size: var(--fs-body-sm);
  color: var(--ink-3);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
}
.cell-value { font-size: var(--fs-title-lg); font-weight: var(--fw-bold); overflow-wrap: anywhere; }
#ablesci-auto, #ablesci-checkin { font-size: var(--fs-sm); line-height: var(--lh-body); margin-top: 4px; }

.ablesci-actions {
  display: flex;
  gap: var(--sp-3);
  align-items: baseline;
  margin-bottom: var(--sp-1);
  flex-wrap: wrap;
}
.ablesci-note-line {
  font-size: var(--fs-body-md);
  color: var(--ink-2);
  margin-bottom: var(--sp-3);
  min-height: 1em;
}

.assist-list-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1px solid var(--line-strong);
  padding-top: var(--sp-2);
  margin-bottom: var(--sp-1);
}

.assist-row, .notify-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--sp-2);
  padding: var(--sp-1) 0;
  border-bottom: 1px solid var(--line-soft);
}
.assist-new { border-left: 4px solid var(--signal); padding-left: var(--sp-1); }
.assist-main { min-width: 0; }
.assist-title { font-size: var(--fs-body-lg); font-weight: var(--fw-bold); word-break: break-word; }
.assist-meta { font-size: var(--fs-body-md); color: var(--ink-2); }
.assist-side {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  flex-shrink: 0;
}
.notify-unread-row .assist-title::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--signal);
  margin-right: 6px;
  vertical-align: middle;
}
.notify-unread {
  font-size: var(--fs-body-sm);
  color: var(--signal);
  letter-spacing: var(--ls-wider);
  margin-left: var(--sp-1);
}

.skeleton-block {
  height: 1px;
  background: var(--line-soft);
  margin: var(--sp-2) 0;
  width: 70%;
}

/* toast(access 页复用检索页模式) */
.toast {
  position: fixed;
  left: 50%;
  bottom: var(--sp-6);
  transform: translateX(-50%) translateY(8px);
  background: var(--ink);
  color: var(--bg);
  font-size: var(--fs-body-md);
  padding: 8px 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 80;
  max-width: min(90vw, 480px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .assistant, .sidebar, .toast, .assistant-fab { transition: none !important; }
}
/* Shared, quiet arrival indicator. It does not request OS notification permission. */
/* ========== 强制引导（全站一条，叠加层，不改正文） ==========
   挖洞用 box-shadow 外扩 9999px 造遮罩：比 SVG 遮罩稳，跟着目标动也不用重算路径。
   卡片黑顶边 3px —— 和登录/注册那三张「门」同一档仪式感。 */
.tour { position: fixed; inset: 0; z-index: 9000; }
.tour-hole {
  position: fixed;
  border-radius: 2px;
  box-shadow: 0 0 0 9999px rgba(18, 18, 18, .62), 0 0 0 2px var(--signal);
  pointer-events: none;
  transition: left .26s cubic-bezier(.22,.68,.3,1), top .26s cubic-bezier(.22,.68,.3,1),
              width .26s cubic-bezier(.22,.68,.3,1), height .26s cubic-bezier(.22,.68,.3,1);
}
.tour-card {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: min(430px, calc(100vw - 32px));
  /* 夹进视口：窗口再矮也要连「跳过」一起露出来，不能把按钮截在屏幕外 */
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  scrollbar-gutter: stable;
  background: var(--bg);
  border: 1px solid var(--ink);
  border-top: 3px solid var(--ink);
  padding: var(--sp-3);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .22);
  /* 丝滑：淡入 + 轻微上浮，同一条缓动；换步骤时整体重画，看起来像卡片自己滑到下一个位置 */
  animation: tour-in .34s cubic-bezier(.22, .68, .3, 1) both;
}
@keyframes tour-in {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.tour-card.is-center { animation-name: tour-in-center; }
@keyframes tour-in-center {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 10px)); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}
/* 关闭并不再显示 */
.tour-x {
  position: absolute; top: 8px; right: 8px;
  width: 26px; height: 26px; line-height: 1;
  display: grid; place-items: center;
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; font-size: 18px; color: var(--ink-3);
  transition: color .16s ease;
}
.tour-x:hover { color: var(--signal); }
@media (prefers-reduced-motion: reduce) {
  .tour-card, .tour-card.is-center { animation: none; }
  .tour-hole { transition: none; }
}
/* 没有目标元素的那两步（开场与收尾）：卡片居中 */
.tour-card.is-center { top: 50%; transform: translate(-50%, -50%); }
.tour-title { font-size: var(--fs-lg); font-weight: var(--fw-bold); letter-spacing: var(--ls-tight); margin-bottom: 6px; }
.tour-text { font-size: var(--fs-sm); line-height: var(--lh-body); color: var(--ink-2); }
.tour-actions { display: flex; align-items: center; gap: 12px; margin-top: var(--sp-2); padding-top: 12px; border-top: 1px solid var(--line-soft); }
.tour-count { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--ink-3); letter-spacing: var(--ls-wide); }
.tour-next { font-weight: var(--fw-bold); }
.tour-skip { margin-left: auto; color: var(--ink-3); }
/* 侧栏底部的重看入口 */
/* 引导统一入口：刊头左上角，每页同一位置 */
.masthead-guide {
  display: flex; justify-content: flex-end; align-items: center; gap: 6px;
  margin-top: 6px;
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; font-size: var(--fs-2xs); color: var(--ink-3);
  letter-spacing: var(--ls-wide);
  transition: color .16s ease;
}
.masthead-guide .mg-mark { width: 7px; height: 7px; background: var(--signal); flex: 0 0 7px; }
.masthead-guide:hover { color: var(--ink); }

/* 刊头插件徽章(与引导作伴,右上顶角):知桥浏览器插件装了没的全局状态。 
   装了=实线墨边「知桥 v.x」,没装=虚线灰「未装插件」;点了去设置页插件区。
   注：`.masthead-guide` 必须是块级且**各自独占一行** —— 原先写 inline-flex，徽章与「引导」
   被排在同一行且没有间距，渲染成「已装■ 引导」挤在一起的样子。 */
.masthead-plug { text-decoration: none; }
.masthead-plug .mg-mark { width: 7px; height: 7px; background: var(--ink-3); flex: 0 0 7px; }
.masthead-plug.is-on .mg-mark { background: var(--ink); }
.masthead-plug.is-on { color: var(--ink); }

/* 全局提示栈：侧栏底部堆「等你处理」的事（互助到件 / 找到全文 / 求助归档 / 插件更新）。
   语气按紧急度分：到件与回音用信号红，插件更新用墨色（不急，但别漏）。 */
.alert-stack { display: flex; flex-direction: column; gap: 8px; }
.alert-stack:not(:empty) { margin-bottom: 14px; }
.side-alert {
  display: flex; align-items: baseline; gap: 8px;
  border-left: 3px solid var(--ink);
  padding: 7px 9px;
  background: var(--bg-subtle);
  font-size: var(--fs-xs);
  line-height: var(--lh-snug);
  color: var(--ink);
  text-decoration: none;
}
.side-alert:hover .sa-text { text-decoration: underline; text-underline-offset: 3px; }
.side-alert .sa-mark { width: 7px; height: 7px; flex: 0 0 7px; background: var(--ink); align-self: center; }
.side-alert--assist, .side-alert--request { border-left-color: var(--signal); color: var(--signal); font-weight: var(--fw-bold); }
.side-alert--assist .sa-mark, .side-alert--request .sa-mark { background: var(--signal); }
.side-alert--plugin { color: var(--ink-2); }
.side-alert--plugin .sa-mark { background: var(--ink-3); }

.paper-arrival { display: block; margin-bottom: 14px; border-left: 3px solid var(--signal); padding: 8px 10px; color: var(--signal); background: var(--bg-subtle); font-size: var(--fs-sm); font-weight: var(--fw-bold); text-decoration: none; }
.paper-arrival[hidden] { display: none; }
/* 来源品牌资产仅从本应用加载；失效时仍有文字标识。 */
.source-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  vertical-align: middle;
}
.source-icon-fallback, .source-icon-image { grid-area: 1 / 1; }
.source-icon-fallback {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--ink-2);
  background: var(--bg-subtle);
  font: var(--fw-bold) var(--fs-2xs) var(--font-sans);
}
.source-icon-image {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
  background: var(--bg);
}
.source-icon-image[hidden] { display: none; }
.source-icon-dark .source-icon-image { background: #333; }
.source-label, .dialect-name { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.dialect-head { flex-wrap: wrap; }
.dialect-name { flex: 1 1 150px; line-height: var(--lh-snug); }
.dialect-copy, .tag-need { flex-shrink: 0; }
.src-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 3px 10px;
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--line-soft);
  background: var(--bg);
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  transition: border-color .15s, opacity .15s;
}
.src-toggle:hover { border-color: var(--ink-3); }
/* 选中:左边线转信号红(与全站「当前态用红」同语言),文字转黑加粗 */
.src-toggle.on { border-color: var(--line-soft); border-left-color: var(--signal); color: var(--ink); font-weight: var(--fw-bold); }
/* 未接入(个人源未连工作站):降透明、虚线边,一眼是「点不动」 */
.src-toggle.off, .src-toggle:disabled { opacity: .45; border-style: dashed; cursor: not-allowed; }
.src-toggle .source-icon { width: 20px; height: 20px; flex-basis: 20px; }
.src-toggle .source-icon-image, .src-toggle .source-icon-fallback { width: 18px; height: 18px; font-size: var(--fs-3xs); }
.query-sources { gap: 8px; }
.assistant-head-actions { gap: 10px; }
.assistant-header, .assistant-input, .assistant-exports { flex-shrink: 0; }
.assistant-exports { max-height: 150px; overflow-y: auto; }
.assistant-header { margin-bottom: 8px; padding-bottom: 16px; }
.assistant-input { margin-bottom: 16px; }

@media (min-width: 769px) and (max-width: 1380px) {
  .resolve-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
  .access-exec { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 768px) {
  .source-items { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .source-item { grid-template-columns: 24px minmax(0, 1fr); gap: 8px; padding: 10px; min-height: 80px; }
  .source-item .source-icon { width: 24px; }
  .source-item-name { font-size: var(--fs-sm); }
  .source-item-arrow { display: none; }
  .source-item-mode { font-size: var(--fs-2xs); }
  .access-block { padding-bottom: 24px; }
  .access-block-head { gap: 6px; }
  .access-block-note { flex-basis: 100%; }
  .access-exec { justify-self: start; }
  .split, .split-even { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .masthead { gap: 12px; }
  .page-title { font-size: var(--fs-4xl); }
  .page-subtitle { font-size: var(--fs-3xs); letter-spacing: var(--ls-wider); overflow-wrap: anywhere; }
  .masthead-right { flex-shrink: 0; }
  .main { scrollbar-gutter: auto; }
}
@media (prefers-reduced-motion: no-preference) {
  .source-item { transition: background-color .15s, border-color .15s; }
}

/* ========== 助手面板:模型/思考选择 + 思考流 ========== */
.assistant-ctl {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.assistant-ctl > span {
  font-size: var(--fs-2xs);
  color: var(--ink-3);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  flex-shrink: 0;
}

.assistant-ctl > select {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-soft);
  padding: 3px 4px;
  cursor: pointer;
}

.assistant-ctl > select:focus { border-color: var(--ink); outline: none; }

.thinking-block .message-meta { color: var(--ink-3); }

/* 来源页:徽章 + 校园认证条 */
.src-badge {
  display: inline-block;
  font-size: var(--fs-2xs);
  line-height: var(--lh-body);
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  color: var(--ink-2);
  margin-right: 6px;
}

.src-badge--auth { border-color: var(--ink); color: var(--ink); font-weight: var(--fw-bold); }
.src-badge--account { border-color: var(--line-strong); color: var(--ink-2); }
.src-badge--open { border-color: var(--line-soft); color: var(--ink-3); }

.src-how { font-size: var(--fs-2xs); color: var(--ink-3); letter-spacing: var(--ls-wide); }

/* 知桥插件状态：装了 = 可代填（实线深色）；没装 = 降级（虚线灰字） */
.campus-plug {
  font-size: var(--fs-2xs);
  letter-spacing: var(--ls-wide);
  border: 1px solid var(--line-soft);
  color: var(--ink-3);
  padding: 1px 5px;
}
.campus-plug.is-on { border-style: solid; border-color: var(--ink); color: var(--ink); }
.campus-plug.is-off { border-style: dashed; }
.acct-row .campus-plug { align-self: center; }

/* 联网实例上的「本机专属」提示：左边一道实线，和普通说明行区分开 */
.ablesci-note-line.campus-local-note {
  border-left: 3px solid var(--ink);
  padding-left: 10px;
  margin-bottom: 12px;
}

/* 未装插件的降级提示：跟来源页其它说明行同一套字号口径 */
.campus-hint {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin: -4px 0 10px;
  font-size: var(--fs-xs);
  line-height: var(--lh-body);
  color: var(--ink-2);
}

/* 弹窗里的编号步骤（安装指引） */
.lh-steps {
  margin: 12px 0 0;
  padding-left: 20px;
  font-size: var(--fs-sm);
  line-height: var(--lh-body);
  color: var(--ink-2);
}
.lh-steps li { margin-bottom: 7px; }
.lh-steps code { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--ink); }

/* ========== Research lane / actual source progress ========== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.search-mode-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 26px; border-bottom: 1px solid var(--line-soft); }
.search-mode-tabs { display: flex; gap: 26px; }
.search-mode-tabs [role="tab"] { display: flex; align-items: center; gap: 8px; padding: 0 0 13px; font-weight: var(--fw-regular); color: var(--ink-2); border-bottom: 3px solid transparent; margin-bottom: -1px; font-size: var(--fs-lg); white-space: nowrap; }
.search-mode-tabs [aria-selected="true"] { color: var(--ink); font-weight: var(--fw-bold); border-color: var(--signal); }
/* 智能体检索(research)区别于助手:选中态用纯黑,信号红只留给「数据库检索」与助手面板 */
.search-mode-tabs #mode-research[aria-selected="true"] { border-color: var(--ink); }
.search-mode-tabs #mode-research[aria-selected="true"] .mode-dot { background: var(--ink); }
.mode-dot { display: inline-block; width: 7px; height: 7px; flex: 0 0 7px; background: var(--signal); }
.mode-caption { font-size: var(--fs-xs); color: var(--ink-2); padding-bottom: 12px; }
body.research-mode .app { grid-template-columns: var(--rail-width) minmax(0, 1fr); }
body.research-mode .main { grid-column: 2 / -1; }
body.research-mode .assistant, body.research-mode .assistant-fab { display: none !important; }
@media (max-width: 768px) { body.research-mode:not(.sidebar-open) .sidebar-fab { display: block; } }
.research-panel { width: 100%; min-height: calc(100% - 70px); display: flex; flex-direction: column; gap: 22px; padding: 0 clamp(0px, 1.5vw, 22px); }
.research-intro { flex: 1; padding: clamp(12px, 3vh, 38px) 0 8px; }
.research-eyebrow { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: var(--fs-xs); letter-spacing: var(--ls-wider); }
.research-eyebrow .mode-dot { background: var(--ink); }   /* research 身份色:黑,与助手的信号红区分开 */
.research-intro h2 { font-size: clamp(var(--fs-4xl), 3vw, var(--fs-5xl)); letter-spacing: var(--ls-tight); line-height: var(--lh-tight); margin: 22px 0 18px; font-weight: var(--fw-bold); }
.research-intro > p { color: var(--ink-2); font-size: var(--fs-lg); line-height: var(--lh-loose); }
.research-channel-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 13px 22px; margin-top: 26px; }
.research-channel-strip > span { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-xs); color: var(--ink-2); }
.research-channel-strip .source-icon { width: 19px; height: 19px; }
.research-examples { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 30px; }
.research-examples button { position: relative; border-top: 1px solid var(--ink-3); padding: 13px 24px 12px 0; text-align: left; line-height: var(--lh-loose); font-size: var(--fs-sm); }
.research-examples button:hover { border-color: var(--ink); color: var(--ink); }
.research-examples span { display: block; font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--ink-3); margin-bottom: 7px; }
.research-examples b { position: absolute; right: 2px; bottom: 15px; font-size: var(--fs-2xl); font-weight: var(--fw-regular); }
.research-composer { position: sticky; bottom: -24px; z-index: 4; border: 1px solid var(--ink-3); border-top: 2px solid var(--ink); background: var(--bg); padding: 18px 20px 12px; box-shadow: 0 -10px 20px var(--bg); }
.research-composer:focus-within { border-top-color: var(--ink); }
.research-composer textarea { display: block; width: 100%; resize: vertical; min-height: 70px; max-height: 240px; font: inherit; font-size: var(--fs-lg); line-height: var(--lh-loose); color: var(--ink); border: 0; outline: none; background: transparent; }
.research-composer textarea::placeholder { color: var(--ink-3); }
.research-composer-controls { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 10px; }
.research-options { display: flex; flex-wrap: wrap; gap: 10px 18px; min-width: 0; }
.research-options label { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: var(--fs-2xs); }
.research-options select { max-width: min(200px, 32vw); padding: 4px 0; color: var(--ink); background: var(--bg); border: 0; border-bottom: 1px solid var(--line-soft); font: inherit; font-size: var(--fs-xs); }
.research-submit-actions { display: flex; gap: 14px; align-items: center; flex-shrink: 0; }
.research-submit { display: flex; align-items: center; gap: 22px; padding: 10px 14px; background: var(--ink); color: var(--bg); font-size: var(--fs-sm); }
.research-submit:hover:not(:disabled) { background: var(--signal); }
.research-submit:disabled { opacity: .4; cursor: progress; }
.research-submit span { font-size: var(--fs-2xl); line-height: var(--lh-flat); }
.research-composer-note { display: flex; justify-content: space-between; gap: 12px; margin-top: 13px; padding-top: 10px; border-top: 1px solid var(--line-soft); font-size: var(--fs-2xs); color: var(--ink-3); }
.research-composer-note > :last-child { white-space: nowrap; }
.research-footer { display: flex; justify-content: space-between; gap: 15px; font-size: var(--fs-2xs); color: var(--ink-3); padding-bottom: 10px; }
.research-footer .text-btn { font-size: var(--fs-2xs); flex-shrink: 0; }
.research-selection { display: flex; align-items: center; gap: 12px; justify-content: space-between; background: var(--bg-subtle); border-left: 2px solid var(--ink); padding: 9px 12px; margin-bottom: 14px; }
.research-selection span { min-width: 0; }
.research-selection small { display: block; font-size: var(--fs-2xs); color: var(--ink-2); }
.research-selection strong { display: block; font-size: var(--fs-sm); white-space: nowrap; text-overflow: ellipsis; overflow: hidden; font-weight: var(--fw-bold); }
.research-selection button { font-size: var(--fs-3xl); padding: 0 4px; }
.research-selection .research-selection-help { font-size: var(--fs-2xs); flex-shrink: 0; white-space: nowrap; border-bottom: 1px solid var(--ink-3); }
.research-panel.has-conversation { min-height: 0; }
.research-panel.has-conversation .research-intro { padding: 0 0 4px; }
.research-panel.has-conversation .research-intro > :not(.research-eyebrow) { display: none; }
.research-panel.has-conversation .research-composer textarea { min-height: 48px; }
.research-conversation:empty { display: none; }
.research-paper { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line-soft); }
.research-paper-number { font: 18px var(--font-mono); color: var(--ink-3); padding-top: 22px; }
.research-paper-source { display: flex; align-items: center; gap: 6px; font-size: var(--fs-2xs); color: var(--ink-2); }
.research-paper-source .source-icon { width: 14px; height: 14px; }
.research-paper h4 { font-size: var(--fs-lg); line-height: var(--lh-body); margin: 7px 0; font-weight: var(--fw-bold); overflow-wrap: anywhere; }
.research-paper h4 a:hover { color: var(--signal); }
.research-paper-meta, .research-paper-doi { color: var(--ink-3); font-size: var(--fs-xs); overflow-wrap: anywhere; }
.research-paper-doi { font-family: var(--font-mono); font-size: var(--fs-2xs); margin-top: 3px; }
.research-paper-abstract { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--ink-2); line-height: var(--lh-loose); font-size: var(--fs-sm); margin: 10px 0 8px; }
.research-paper-actions, .result-research-actions { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 12px; }
.research-paper-actions button, .result-research-actions button { font-size: var(--fs-2xs); border-bottom: 1px solid var(--ink-3); }
.research-paper-actions button:hover:not(:disabled), .result-research-actions button:hover { color: var(--signal); border-color: var(--signal); }
.research-paper-actions button:disabled { color: var(--ink-3); cursor: default; }
.search-status { display: block; padding: 17px 18px 13px; border: 1px solid var(--line-soft); background: var(--bg-subtle); margin-bottom: 24px; }
.search-progress-heading, .search-progress-heading > div { display: flex; align-items: center; gap: 10px; }
.search-progress-heading { justify-content: space-between; }
.search-progress-heading strong { font-size: var(--fs-md); font-weight: var(--fw-bold); }
.search-progress-count { font: 10px var(--font-mono); color: var(--ink-3); }
.search-progress-heading .text-btn { font-size: var(--fs-2xs); }
.loading-pulse { display: inline-block; flex: 0 0 6px; width: 6px; height: 6px; background: var(--signal); animation: research-pulse 1.6s ease-in-out infinite; }
.search-status.complete .loading-pulse { animation: none; background: var(--ink-3); }
.search-source-progress { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.source-progress-chip { display: flex; align-items: center; gap: 7px; padding: 7px 9px; background: var(--bg); border: 1px solid var(--line-soft); font-size: var(--fs-xs); }
.source-progress-chip .source-icon { width: 17px; height: 17px; }
.source-progress-chip small { color: var(--ink-3); font-size: var(--fs-2xs); margin-left: 6px; }
.source-progress-chip[data-phase="running"] { border-color: var(--ink-3); }
.source-progress-chip[data-phase="success"] small { color: var(--ink-2); }
.source-progress-chip[data-phase="error"] small { color: var(--signal); }
.search-progress-foot { display: flex; justify-content: space-between; gap: 16px; color: var(--ink-3); font-size: var(--fs-2xs); margin-top: 13px; }
.search-progress-foot > :last-child { white-space: nowrap; font-family: var(--font-mono); }
#results[aria-busy="true"] .skeleton-item { padding: 24px 0; }
#results[aria-busy="true"] .skeleton-line { height: 7px; border-radius: 2px; background: linear-gradient(90deg, var(--bg-subtle) 0%, var(--line-soft) 45%, var(--bg-subtle) 80%); background-size: 220% 100%; animation: research-shimmer 2s linear infinite; }
#results[aria-busy="true"] .skeleton-title { height: 15px; margin-bottom: 9px; }
#results[aria-busy="true"] .skeleton-content { gap: 11px; }
.search-mode-tabs button:focus-visible, .research-panel button:focus-visible, .research-panel select:focus-visible, .research-panel a:focus-visible { outline: 2px solid var(--signal); outline-offset: 4px; }
@keyframes research-pulse { 50% { opacity: .3; } }
@keyframes research-shimmer { to { background-position: -220% 0; } }
@media (max-width: 1100px) {
  .research-options { gap: 6px 13px; }
  .research-composer-controls { align-items: flex-start; }
  .research-composer-note > :last-child { display: none; }
  .mode-caption { display: none; }
  .research-intro h2 { font-size: var(--fs-4xl); }
}
@media (max-width: 768px) {
  .research-panel { padding: 0; gap: 17px; }
  .search-mode-bar { margin-bottom: 20px; }
  .search-mode-tabs { gap: 24px; }
  .search-mode-tabs [role="tab"] { font-size: var(--fs-lg); padding-bottom: 11px; }
  .research-intro { padding: 10px 0 0; }
  .research-intro h2 { font-size: var(--fs-4xl); margin: 18px 0 13px; }
  .research-intro > p { font-size: var(--fs-sm); }
  .research-eyebrow { font-size: var(--fs-3xs); letter-spacing: var(--ls-wide); }
  .research-channel-strip { gap: 10px 16px; margin-top: 19px; }
  .research-channel-strip > span { font-size: var(--fs-2xs); }
  .research-examples { grid-template-columns: 1fr; gap: 0; margin-top: 22px; }
  .research-examples button { padding: 10px 25px 10px 0; font-size: var(--fs-xs); }
  .research-examples span { display: inline; margin-right: 12px; font-size: var(--fs-3xs); }
  .research-examples b { bottom: 9px; }
  .research-composer { position: static; padding: 13px 13px 10px; }
  .research-composer textarea { font-size: var(--fs-lg); min-height: 65px; }
  .research-composer-controls { flex-direction: column; align-items: stretch; }
  .research-options { gap: 4px 12px; }
  .research-options label { font-size: var(--fs-3xs); }
  .research-options select { max-width: 128px; font-size: var(--fs-2xs); }
  .research-submit-actions { justify-content: flex-end; }
  .research-submit { padding: 9px 13px; }
  .research-composer-note { font-size: var(--fs-3xs); margin-top: 10px; }
  .research-footer { font-size: var(--fs-3xs); padding-right: 45px; }
      .research-paper { grid-template-columns: 20px minmax(0, 1fr); gap: 9px; }
  .research-paper h4 { font-size: var(--fs-lg); }
      .research-paper-actions { gap: 9px 15px; }
  .research-paper-actions button, .result-research-actions button { min-height: 32px; }
      .search-status { padding: 13px; }
  .search-progress-heading > div { flex-wrap: wrap; gap: 6px; }
  .search-progress-heading strong { font-size: var(--fs-sm); }
  .search-progress-count { flex-basis: 100%; padding-left: 12px; font-size: var(--fs-3xs); }
  .search-progress-heading .text-btn { flex-shrink: 0; }
  .source-progress-chip { padding: 5px 7px; gap: 5px; font-size: var(--fs-2xs); }
  .source-progress-chip small { font-size: var(--fs-3xs); }
  .search-source-progress { gap: 6px; }
  .search-progress-foot { font-size: var(--fs-3xs); }
  .wide-only { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .loading-pulse, #results[aria-busy="true"] .skeleton-line { animation: none; }
  .research-panel *, .search-status * { scroll-behavior: auto !important; }
}

/* ========== 助手面板:可拖拽 + pi 风格消息渲染 ========== */

/* 侧栏:导航区可滚动(窗口矮时不至于把底部信息挤没) */
.sidebar-nav {
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  padding-right: 4px;
}

/* 拖拽条:位于助手栏左缘。
   ⚠️ 必须放在 .assistant 的 **padding 区内**(left:0) —— .assistant 有 overflow:hidden(助手面板 v2),
   溢出部分会被裁掉,left:-3px 那种「骑在边框上」的写法点不到(实测踩过)。 */
.assistant {
  position: relative;
}

.assistant-resizer {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: col-resize;
  z-index: 6;
  background: transparent;
}

.assistant-resizer::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line-soft);
}

.assistant-resizer:hover::after,
.assistant-resizer.dragging::after {
  background: var(--ink);
  width: 2px;
}

/* ---- markdown 正文(结构照 pi:标题/列表/引用/代码/表格/链接) ---- */
.md-body {
  font-size: var(--fs-body-md);
  line-height: var(--lh-loose);
  color: var(--ink);
  word-break: break-word;
}

.md-body > *:first-child { margin-top: 0; }
.md-body > *:last-child { margin-bottom: 0; }

.md-body h1, .md-body h2, .md-body h3, .md-body h4 {
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-wide);
  margin: 12px 0 6px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--line-soft);
}

.md-body p { margin: 6px 0; }

.md-body ul, .md-body ol { margin: 6px 0 6px 20px; }
.md-body li { margin: 3px 0; }
.md-body li > ul, .md-body li > ol { margin: 3px 0 3px 16px; }

.md-body a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.md-body a:hover { text-decoration-thickness: 2px; }

.md-body strong { font-weight: var(--fw-bold); }
.md-body em { font-style: italic; }

/* 行内代码(pi 移植,收敛为黑白灰) */
.md-body code {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  background: var(--bg-subtle);
  color: var(--ink);
  padding: 0 4px;
}

/* mdQuote */
.md-body blockquote {
  margin: 8px 0;
  padding: 2px 0 2px 10px;
  border-left: 3px solid var(--line-strong);
  color: var(--ink-2);
}

.md-body hr { border: none; border-top: 1px solid var(--line-soft); margin: 12px 0; }

.md-body table { border-collapse: collapse; margin: 8px 0; font-size: var(--fs-xs); }
.md-body th, .md-body td { border: 1px solid var(--line-soft); padding: 4px 8px; text-align: left; }
.md-body th { background: var(--bg-subtle); font-weight: var(--fw-bold); }

.md-body img { max-width: 100%; }

/* ---- 工具调用块(三态见下方新版 .tool-card) ---- */
.tool-card .tool-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  color: var(--ink);
}

.tool-card .tool-head .tool-state { font-weight: var(--fw-regular); color: var(--ink-2); }

.tool-card .tool-args {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  color: var(--ink-2);
  margin-top: 3px;
  word-break: break-all;
}

.tool-card .tool-out {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  color: var(--ink-2);
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(0, 0, 0, 0.07);
  white-space: pre-wrap;
  max-height: 140px;
  overflow-y: auto;
}

.tool-card .tool-fold {
  font-size: var(--fs-2xs);
  color: var(--ink-3);
  text-decoration: underline;
  background: none;
  border: none;
  padding: 0;
  margin-left: auto;
  cursor: pointer;
}

/* 拖拽条的定位基准:必须让 .assistant 成为 containing block。
   ⚠️ body.assistant-open .assistant 里写了 position: static(抽屉系统),特异性比 .assistant 高,
   所以这里要用同特异性的选择器覆盖(relative 不改布局,只提供定位基准)。 */
body.assistant-open .assistant {
  position: relative;
}

/* 抽屉模式(窄屏)下助手是浮层,宽度由抽屉决定,拖拽条无意义 → 隐藏 */
@media (max-width: 1180px) {
  .assistant-resizer { display: none; }
}

/* ========== 图标(替代 ↗ → ← › ▸ 这类字形) ========== */
.ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  vertical-align: -0.14em;
}

.ico > svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* 按钮/胶囊里的图标稍小一点,跟 11–12px 的标签配 */
.text-btn .ico, .source-item .ico, .metric-pdf .ico, .export-item .ico {
  width: 0.95em;
  height: 0.95em;
}

/* 检索页:个人源不可用态 */
.src-toggle.off {
  opacity: 0.45;
  cursor: not-allowed;
}

/* 知网芯片三态（工作站 / 插件 / 未接入）：**都不禁用** —— 禁用等于把「个人通道」
   从界面上抹掉,用户只会以为坏了;哪一态看 hover 的 title,检索时由结果如实说明缺什么。
   三态徽章（`src-personal` 胶囊）2026-10-04 按用户要求去掉,不要加回来。 */

/* ============================================================================
   助手面板 v2 —— 现代对话布局
   参考 pi 的 export-html(用户气泡 userMessageBg / 无气泡助手消息 / 三态工具卡 /
   md 正文与代码高亮),落到 Swiss Grid:方角、1px 线、黑白灰。
   结构:头部 → 顶部 tab(对话/产物/能力) → 面板;只有消息区滚动。
   有意偏离老规格:用户气泡给 8px 圆角(现代聊天惯例),代码块保留等宽字体,
   语法高亮走黑白灰不引彩色主题(守住「只有一种红」)。
   ============================================================================ */
.assistant {
  overflow: hidden;                       /* 整栏不滚:否则头部/输入框跟着跑 */
  padding: 0;
  gap: 0;
}

/* ---- 头部 ---- */
.assistant-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-1);
  padding: 20px var(--sp-2) 12px var(--sp-2);
  border-bottom: 2px solid var(--ink);
  margin: 0;
  flex-shrink: 0;
}
.assistant-head-left { min-width: 0; }
.assistant-title {
  font-size: var(--fs-title-md);
  font-weight: var(--fw-bold);
  color: var(--ink);
  letter-spacing: var(--ls-wide);
  text-transform: none;
  margin-bottom: 4px;
}
.assistant-status { letter-spacing: 0; text-transform: none; }

/* ---- 顶部 tab(资源分页) ---- */
.assistant-tabs {
  display: flex;
  align-items: stretch;
  gap: 20px;
  padding: 0 var(--sp-2);
  border-bottom: 1px solid var(--line-soft);
  flex-shrink: 0;
}
.assistant-tab {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 10px 0 9px;
  margin: 0;
  font: inherit;
  font-size: var(--fs-body-md);
  color: var(--ink-3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.assistant-tab:hover { color: var(--ink); }
.assistant-tab.on { color: var(--ink); font-weight: var(--fw-bold); border-bottom-color: var(--ink); }
.assistant-tab .tab-count {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--ink);
  color: var(--bg);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---- 面板 ---- */
.assistant-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.panel-head {
  padding: 12px var(--sp-2);
  font-size: var(--fs-body-md);
  font-weight: var(--fw-bold);
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-shrink: 0;
}
.panel-note { font-size: var(--fs-body-sm); font-weight: var(--fw-regular); color: var(--ink-3); }

/* ---- 对话:模型/思考(已挪到底部 composer 动作行,见 .composer-models) + 上下文 ---- */
.assistant-ctl { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }
.assistant-ctl > span { font-size: var(--fs-body-sm); color: var(--ink-3); flex-shrink: 0; }
.assistant-ctl > select {
  flex: 1;
  min-width: 0;
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  padding: 3px 0;
  font: inherit;
  font-size: var(--fs-body-md);
  color: var(--ink);
  cursor: pointer;
}
.assistant-ctl > select:focus { border-bottom-color: var(--ink); outline: none; }
.assistant-context {
  padding: 6px var(--sp-2);
  border-top: 1px solid var(--line-soft);
  color: var(--ink-3);
  font-size: var(--fs-2xs);
  letter-spacing: var(--ls-wide);
  line-height: var(--lh-snug);
  overflow-wrap: anywhere;
  flex-shrink: 0;
}

/* ---- 消息区 ---- */
.assistant-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
  padding: var(--sp-2);
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
}
.assistant-empty { padding: 40px 0; text-align: center; color: var(--ink-3); font-size: var(--fs-body-md); }
.assistant-empty .hint { font-size: var(--fs-body-sm); margin-top: 6px; line-height: var(--lh-body); }

/* 空状态推荐问题卡:2×2 方角网格,hover 左边线转信号红(与全站「当前态用红」同语言);
   点击填入输入框(见 chrome.js data-cmd 处理),不直接发送 */
.assistant-empty .empty-lead { color: var(--ink-3); font-size: var(--fs-body-md); margin-bottom: 14px; }
/* 推荐问题:Linear/Notion 式线条列表(不再是一张张带框盒子)——
   一个细线框容器 + 行内分隔线;hover 整行泛浅底、标题出信号红下划线、右尖角着色 */
.suggest-grid { display: flex; flex-direction: column; text-align: left; border: 1px solid var(--line-soft); }
.suggest-card {
  display: flex; align-items: baseline; gap: 10px;
  background: var(--bg); border: 0; border-bottom: 1px solid var(--line-soft);
  padding: 11px 14px; cursor: pointer; text-align: left;
  font: inherit;
  transition: background .15s;
}
.suggest-card:last-child { border-bottom: 0; }
.suggest-card:hover { background: var(--bg-subtle); }
.suggest-card:active { transform: none; }
.suggest-title { font-size: var(--fs-body-md); font-weight: var(--fw-bold); color: var(--ink); line-height: var(--lh-snug); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px; transition: text-decoration-color .15s, color .15s; flex: 0 0 auto; }
.suggest-card:hover .suggest-title { color: var(--signal); text-decoration-color: var(--signal); }
.suggest-desc { font-size: var(--fs-2xs); color: var(--ink-3); line-height: var(--lh-snug); flex: 1; min-width: 0; }
.suggest-card::after { content: '›'; margin-left: auto; align-self: center; color: var(--ink-3); font-size: var(--fs-lg); transition: color .15s, transform .15s; }
.suggest-card:hover::after { color: var(--signal); transform: translateX(2px); }
@media (max-width: 400px) { .suggest-card { flex-wrap: wrap; } }

.message { padding: 0; border: 0; display: flex; flex-direction: column; }
.message-meta {
  font-size: var(--fs-body-sm);
  color: var(--ink-3);
  margin-bottom: 5px;
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
}
/* 状态行(「助手已启动…等待模型响应」这类):左侧细横条滑动,表示活着——
   与检索状态行 .status-bar 同一族语言(曾用信号红方块脉冲,换成更素的横条) */
.message.message-meta-pulse .message-meta {
  display: flex; align-items: center; gap: 8px;
  color: var(--ink-2);
}
.message.message-meta-pulse .message-meta::before {
  content: '';
  flex: 0 0 auto;
  width: 18px; height: 2px;
  background: var(--ink);
  animation: lh-status-slide 1.1s ease-in-out infinite;
}
@keyframes lh-status-slide { 0%,100% { transform: translateX(0); } 50% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .message.message-meta-pulse .message-meta::before { animation: none; } }
.message-body { font-size: var(--fs-md); line-height: var(--lh-loose); color: var(--ink); overflow-wrap: anywhere; }

/* 用户消息:右对齐、浅底 + 左侧信号红边(用户/当前态用红,与导航 .nav-item.active 同色;
   曾用 8px 圆角气泡 → 收方;黑边让给助手/品牌方) */
.message-user { align-self: flex-end; max-width: 88%; align-items: flex-end; }
.message-user .message-meta { text-align: right; }
.message-user .message-body {
  background: var(--bg-subtle);
  border-left: 2px solid var(--signal);
  padding: 8px 12px;
  white-space: pre-wrap;
}

/* 助手消息:左侧 2px 黑边(品牌方/助手用黑),正文走 md,与用户红边对称呼应 */
.message-assistant {
  align-self: stretch;
  border-left: 2px solid var(--ink);
  padding-left: 10px;
}
.message-assistant .message-body:empty { display: none; }

/* 流式光标 */
.message-body.streaming::after {
  content: '';
  display: inline-block;
  width: 7px;
  height: 13px;
  margin-left: 3px;
  vertical-align: -2px;
  background: var(--ink);
  animation: lh-caret 1s steps(2, start) infinite;
}
@keyframes lh-caret { 50% { opacity: 0; } }

/* 思考块:比正式回答淡一级(ink-3 边线),灰字、可折叠——过程稿不与正文抢视觉 */
.thinking-block {
  border-left: 2px solid var(--ink-3);
  padding-left: 10px;
  align-self: stretch;
  opacity: .85;
}
.thinking-block .message-meta { display: flex; align-items: center; gap: 4px; }
.thinking-body {
  font-size: var(--fs-sm);
  font-style: italic;
  line-height: var(--lh-loose);
  color: var(--ink-3);
  white-space: pre-wrap;
  max-height: 240px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

/* 工具卡:pi 的三态(pending/success/error) → 黑白灰 + 错误信号红 */
.tool-card {
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--ink-3);
  background: var(--bg-subtle);
  padding: 8px 10px;
  font-size: var(--fs-sm);
}
.tool-card.ok { border-left-color: var(--ink); }
.tool-card.err { border-left-color: var(--signal); background: color-mix(in srgb, var(--signal) 6%, var(--bg)); }
.tool-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
}
.tool-state { font-family: var(--font-sans); font-size: var(--fs-body-sm); font-weight: var(--fw-regular); color: var(--ink-3); }
.tool-args {
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.tool-out {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  line-height: var(--lh-body);
  color: var(--ink-2);
  white-space: pre-wrap;
  max-height: 180px;
  overflow: auto;
  scrollbar-gutter: stable;
}
.tool-call { font-size: var(--fs-body-md); color: var(--ink-2); }
.tool-call.error { color: var(--signal); }

/* ---- 输入区:多行自增高 + 动作行 ---- */
.assistant-composer {
  border-top: 2px solid var(--ink);
  padding: 10px var(--sp-2) 12px;
  flex-shrink: 0;
  margin: 0;
}
.composer-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line-soft);
  background: var(--bg);
  padding: 9px 10px;
  font: inherit;
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  color: var(--ink);
  resize: none;
  max-height: 132px;
  overflow-y: hidden;
}
.composer-input::placeholder { color: var(--ink-3); }
.composer-input:focus { outline: none; border-color: var(--ink); }
.composer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}
/* 模型/思考下拉:随发送键放在同一行,不占顶部位置(用户口径「和正常的一样放在下面」) */
.composer-models {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
  min-width: 0;
}
.composer-models .assistant-ctl { flex: 0 1 auto; }
.composer-models .assistant-ctl > select { width: auto; max-width: 132px; min-width: 0; font-size: var(--fs-body-sm); color: var(--ink-2); }
.composer-hint { font-size: var(--fs-body-sm); color: var(--ink-3); }
.send-btn {
  appearance: none;
  width: 28px;
  height: 28px;
  padding: 5px;
  background: none;
  border: 1px solid var(--line-soft);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.send-btn:hover { border-color: var(--ink); }
.send-btn .ico { width: 15px; height: 15px; }
.stop-btn { color: var(--signal); border-color: var(--signal); }
.stop-btn .ico { width: 12px; height: 12px; }

/* ---- 产物 / 能力 面板 ---- */
.exports-list { flex: 1; min-height: 0; overflow-y: auto; padding: var(--sp-2); max-height: none; }
.export-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
  text-decoration: none;
}
.export-item:hover .export-name { text-decoration: underline; }
.export-name { flex: 1; min-width: 0; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.export-size { font-size: var(--fs-body-sm); color: var(--ink-3); font-family: var(--font-mono); }
.export-arrow { color: var(--ink-3); display: inline-flex; }
.export-empty { padding: 28px 0; text-align: center; font-size: var(--fs-body-md); color: var(--ink-3); line-height: var(--lh-loose); }
.assistant-caps {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--sp-2);
  max-height: none;
}
.caps-group {
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-bold);
  color: var(--ink-3);
  letter-spacing: var(--ls-wider);
  margin: 14px 0 6px;
}
.caps-line { font-size: var(--fs-sm); line-height: var(--lh-body); color: var(--ink-2); overflow-wrap: anywhere; }
.caps-line + .caps-line { margin-top: 3px; }
.caps-restrict { color: var(--ink-3); }

/* 能力页:图标网格卡片(图标 + 工具名 + 描述 + 状态),替代原来的纯文字列表 */
.cap-grid { display: grid; grid-template-columns: 1fr; gap: 6px; margin: 4px 0 6px; }
.cap-card {
  display: flex; align-items: center; gap: 9px;
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--ink);
  background: var(--bg);
  padding: 7px 10px;
  min-width: 0;
}
.cap-ico { flex: 0 0 auto; width: 16px; height: 16px; color: var(--ink); display: inline-flex; }
.cap-ico .ico, .cap-ico svg { width: 100%; height: 100%; display: block; }
.cap-main { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.cap-name { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--ink); line-height: var(--lh-snug); }
.cap-desc { font-size: var(--fs-2xs); color: var(--ink-3); line-height: var(--lh-snug); overflow-wrap: anywhere; }
.cap-state { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 3px; font-size: var(--fs-2xs); color: var(--ink-3); white-space: nowrap; }
.cap-state .ico, .cap-state svg { width: 11px; height: 11px; }
.cap-state.ok { color: var(--ink-2); }
.cap-state.pending { color: var(--ink-3); }
/* 「不做」卡:左边线换信号红(警示语义),图标也红 */
.cap-card.cap-restrict { border-left-color: var(--signal); }
.cap-card.cap-restrict .cap-ico { color: var(--signal); }
.cap-card.cap-restrict .cap-name { font-family: var(--font-sans); font-weight: var(--fw-regular); color: var(--ink-2); }

/* ---- markdown 正文(参照 pi 的 .markdown-content,换成项目配色) ---- */
.md-body { font-size: var(--fs-md); line-height: var(--lh-loose); color: var(--ink); }
.md-body > *:first-child { margin-top: 0 !important; }
.md-body > *:last-child { margin-bottom: 0 !important; }
.md-body h1, .md-body h2, .md-body h3, .md-body h4, .md-body h5, .md-body h6 {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  margin: 16px 0 6px;
  line-height: var(--lh-snug);
}
.md-body p { margin: 0 0 9px; }
.md-body ul, .md-body ol { margin: 6px 0 10px; padding-left: 20px; }
.md-body li { margin: 3px 0; }
.md-body li::marker { color: var(--ink-3); }
.md-body a { color: var(--ink); text-decoration: underline; }
.md-body a:hover { text-decoration-thickness: 2px; }
.md-body strong { font-weight: var(--fw-bold); }
.md-body code {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  background: var(--bg-subtle);
  padding: 1px 4px;
  color: var(--ink);
}
.md-body pre {
  background: var(--bg-subtle);
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--ink);
  padding: 10px 12px;
  margin: 9px 0;
  overflow-x: auto;
  scrollbar-gutter: stable;
}
.md-body pre code { background: none; padding: 0; font-size: var(--fs-sm); line-height: var(--lh-body); }
.md-body blockquote {
  border-left: 2px solid var(--line-soft);
  padding-left: 10px;
  margin: 9px 0;
  color: var(--ink-2);
}
.md-body hr { border: 0; border-top: 1px solid var(--line-soft); margin: 14px 0; }
.md-body table { border-collapse: collapse; width: 100%; margin: 9px 0; font-size: var(--fs-sm); }
.md-body th, .md-body td { border: 1px solid var(--line-soft); padding: 6px 8px; text-align: left; vertical-align: top; }
.md-body th { background: var(--bg-subtle); font-weight: var(--fw-bold); }
.md-body img { max-width: 100%; }
/* 代码高亮:黑白灰 monochrome(不引 pi 的彩色主题,守住「只有一种红」) */
.md-body .hljs-comment, .md-body .hljs-quote { color: var(--ink-3); font-style: italic; }
.md-body .hljs-keyword, .md-body .hljs-selector-tag, .md-body .hljs-literal,
.md-body .hljs-section, .md-body .hljs-doctag { color: var(--ink); font-weight: var(--fw-bold); }
.md-body .hljs-string, .md-body .hljs-regexp, .md-body .hljs-attr, .md-body .hljs-attribute { color: #4a4a4a; }
.md-body .hljs-number, .md-body .hljs-built_in, .md-body .hljs-type, .md-body .hljs-class { color: #666; }
.md-body .hljs-title, .md-body .hljs-name, .md-body .hljs-function, .md-body .hljs-params { color: var(--ink); }
.md-body .hljs-variable, .md-body .hljs-template-variable, .md-body .hljs-meta { color: #555; }
.md-body .hljs-emphasis { font-style: italic; }
.md-body .hljs-strong { font-weight: var(--fw-bold); }

/* ============================================================================
   全局弹窗(替代浏览器原生 prompt/alert/confirm)
   Swiss Grid:遮罩 28% 黑、白底、顶部 3px 黑线、方角、文字按钮;无多余解释。
   ============================================================================ */
.lh-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 900;
}
.lh-modal {
  width: 400px;
  max-width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  scrollbar-gutter: stable;
  background: var(--bg);
  border: 1px solid var(--ink);
  border-top: 3px solid var(--ink);
  padding: 20px 22px 16px;
}
.lh-modal-wide { width: 540px; }
.lh-modal-title {
  font-size: var(--fs-title-md);
  font-weight: var(--fw-bold);
  color: var(--ink);
  margin-bottom: 12px;
}
.lh-modal-text {
  font-size: var(--fs-md);
  line-height: var(--lh-loose);
  color: var(--ink-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.lh-modal-note {
  font-size: var(--fs-xs);
  line-height: var(--lh-body);
  color: var(--ink-3);
  margin-bottom: 12px;
}
.lh-field { display: block; margin-bottom: 14px; }
.lh-field > span {
  display: block;
  font-size: var(--fs-xs);
  color: var(--ink-3);
  margin-bottom: 4px;
}
.lh-field > span i { font-style: normal; }
.lh-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: none;
  padding: 7px 0;
  font: inherit;
  font-size: var(--fs-md);
  color: var(--ink);
}
.lh-input:focus { outline: none; border-bottom-color: var(--ink); }
.lh-input::placeholder { color: var(--ink-3); }
textarea.lh-input {
  border: 1px solid var(--line-soft);
  padding: 8px 10px;
  resize: vertical;
  line-height: var(--lh-body);
}
textarea.lh-input:focus { border-color: var(--ink); }
.lh-field-hint { display: block; font-size: var(--fs-2xs); color: var(--ink-3); margin-top: 4px; line-height: var(--lh-snug); }
.lh-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.lh-modal-ok { font-weight: var(--fw-bold); }
.lh-modal-ok.danger { color: var(--signal); }
.lh-modal-ok:disabled {
  color: var(--ink-3);
  cursor: not-allowed;
  text-decoration: none;
}
body.lh-modal-open { overflow: hidden; }

/* ---- 账号与自动认证卡片(来源页) ---- */
.accounts-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  margin-top: 12px;
}
@media (max-width: 900px) { .accounts-split { grid-template-columns: minmax(0, 1fr); } }
.accounts-sub {
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-bold);
  color: var(--ink-3);
  letter-spacing: var(--ls-wider);
  margin-bottom: 4px;
}
.acct-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
}
.acct-name { font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--ink); }
.acct-user {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.acct-badge {
  font-size: var(--fs-2xs);
  color: var(--ink-2);
  border: 1px solid var(--line-soft);
  padding: 1px 5px;
}
.acct-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 10px; }

/* 账号区页脚：本实例自带的「知桥」安装包，点一下直接下载
   （没打包的实例只留左边那行说明，链接由 JS 决定出不出） */
.plugin-get {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

/* 渠道横滑条:两端渐隐(白底上做渐变,pointer-events:none 不挡点击) */
.sources-strip { position: relative; min-width: 0; }
.sources-fade {
  position: absolute;
  top: 0;
  bottom: 2px;
  width: 32px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s linear;
}
.sources-fade.left { left: 0; background: linear-gradient(to right, var(--bg), rgba(255, 255, 255, 0)); }
.sources-fade.right { right: 0; background: linear-gradient(to left, var(--bg), rgba(255, 255, 255, 0)); }
.sources-strip:not(.at-start) .sources-fade.left { opacity: 1; }
.sources-strip:not(.at-end) .sources-fade.right { opacity: 1; }

/* ============================================================================
   智能体检索 · 工作流视图（2026-10-04）
   把「提一个问题 → 等答案」的对话式界面，改成看得见每一步的流水线：
     竖排步骤 + 1px 连接线 + 每步真实状态（待运行/运行中/完成/失败/本轮不用）
     + 每步真实产物（渠道明细、题录、读取页数、正文、产物文件）+ 单次运行可停止/重跑。
   状态不靠颜色单独承载（黑白灰为主，失败才用信号红），符合项目的色规。
   ============================================================================ */
.wf-run {
  border: 1px solid var(--line-soft);
  border-top: 2px solid var(--ink);
  margin: 0 0 28px;
}
.wf-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.wf-question {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
  overflow-wrap: anywhere;
}
.wf-question .wf-mode {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 6px;
  border: 1px solid var(--line-soft);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-regular);
  color: var(--ink-2);
  vertical-align: 2px;
}
.wf-ref { margin-top: 6px; font-size: var(--fs-sm); color: var(--ink-2); overflow-wrap: anywhere; }
.wf-head-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.wf-runmeta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.wf-actions { display: flex; gap: 12px; }

/* ---- 步骤列表 ---- */
.wf-steps { list-style: none; margin: 0; padding: 0; }
.wf-step {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  border-bottom: 1px solid var(--line-soft);
  position: relative;
}
.wf-step:last-child { border-bottom: 0; }
/* 连接线:贯穿序号列的 1px 竖线,末步截断 */
.wf-step::before {
  content: '';
  position: absolute;
  left: 23px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line-soft);
}
.wf-step:first-child::before { top: 22px; }
.wf-step:last-child::before { bottom: calc(100% - 22px); }
.wf-index {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;   /* 节点在上、序号在下,连接线正好穿过节点中心 */
  align-items: center;
  gap: 4px;
  padding-top: 14px;
}
.wf-node {
  width: 15px;
  height: 15px;
  border: 1px solid var(--ink-3);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.wf-node .ico { width: 10px; height: 10px; }
.wf-num {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  color: var(--ink-3);
  margin-top: 3px;
}
.wf-body { padding: 14px 16px 14px 0; min-width: 0; }
.wf-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
}
.wf-state {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-regular);
  color: var(--ink-3);
  border: 1px solid var(--line-soft);
  padding: 0 5px;
}
.wf-note { margin-top: 3px; font-size: var(--fs-sm); color: var(--ink-3); line-height: var(--lh-body); }
.wf-out { margin-top: 9px; font-size: var(--fs-sm); color: var(--ink-2); line-height: var(--lh-body); overflow-wrap: anywhere; }
.wf-out:empty { display: none; }
.wf-out > *:first-child { margin-top: 0; }
.wf-out > *:last-child { margin-bottom: 0; }

/* 步骤状态(黑白灰为主,失败才用信号红) */
.wf-step[data-state='running'] .wf-node { border-color: var(--ink); border-width: 2px; animation: wf-pulse 1s steps(2, start) infinite; }
.wf-step[data-state='running'] .wf-title { color: var(--ink); }
.wf-step[data-state='running'] .wf-state { color: var(--ink); border-color: var(--ink); }
.wf-step[data-state='done'] .wf-node { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.wf-step[data-state='done'] .wf-state { color: var(--ink); border-color: var(--ink); }
.wf-step[data-state='error'] .wf-node { border-color: var(--signal); color: var(--signal); }
.wf-step[data-state='error'] .wf-state { color: var(--signal); border-color: var(--signal); }
.wf-step[data-state='skip'] { opacity: 0.55; }
.wf-step[data-state='pending'] .wf-state { color: var(--ink-3); }
@keyframes wf-pulse { 50% { opacity: 0.25; } }

/* 步骤里的明细(渠道格 / 题录 / 读取范围 / 正文) */
.wf-sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.wf-source {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-2xs);
  border: 1px solid var(--line-soft);
  padding: 2px 6px;
  font-variant-numeric: tabular-nums;
}
.wf-source[data-ok='false'] { border-color: var(--signal); color: var(--signal); }
.wf-kv { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 6px; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.wf-kv b { font-weight: var(--fw-bold); }
.wf-detail { margin-top: 9px; }
.wf-detail > summary {
  cursor: pointer;
  font-size: var(--fs-sm);
  color: var(--ink-2);
  text-decoration: underline;
}
.wf-detail > summary::marker { color: var(--ink-3); }
.wf-papers { margin-top: 10px; border-top: 1px solid var(--line-soft); padding-top: 4px; }
.wf-papers .research-paper { border-bottom: 1px solid var(--line-soft); }
.wf-answer { margin-top: 4px; font-size: var(--fs-md); }
.wf-warning { margin-top: 6px; font-size: var(--fs-sm); color: var(--signal); }
.wf-file {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
  font-size: var(--fs-sm);
}
.wf-file small { color: var(--ink-2); }
.wf-file a { color: var(--ink); }
.wf-empty { padding: 26px 0; text-align: center; font-size: var(--fs-sm); color: var(--ink-3); }

/* 历史运行:旧的收成一行 */
.wf-past {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: var(--fs-sm);
  color: var(--ink-2);
}
.wf-past .wf-past-q { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 工作流预览:开跑前告诉用户会经过哪几步(横向排,窄屏换行) */
.research-pipeline {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin: 26px 0 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--line-soft);
  font-size: var(--fs-sm);
  color: var(--ink-2);
  counter-reset: wfprev;
}
.research-pipeline li { display: inline-flex; align-items: center; gap: 6px; }
.research-pipeline li::before {
  counter-increment: wfprev;
  content: counter(wfprev, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  color: var(--ink-3);
}
/* 步骤之间用 1px 短线相连(不用箭头字形,守图标口径) */
.research-pipeline li:not(:last-child)::after { content: ''; width: 14px; height: 1px; background: var(--line-soft); margin-left: 6px; }
@media (max-width: 720px) { .research-pipeline { font-size: var(--fs-xs); gap: 4px 10px; } }

/* 汇总步:产物容器为空时不占位(正文在上、产物在下) */
.wf-files:empty { display: none; }
.wf-answer:empty + .wf-files { margin-top: 0; }

/* 工作流进度层:随完成步推进的实线(1px),对齐节点中心;节点不透明,让线从节点后方穿过 */
.wf-steps { position: relative; }
.wf-track {
  position: absolute;
  left: 23px;
  top: 0;
  width: 1px;
  height: 0;
  background: var(--ink);
  transition: height 0.35s ease;
  pointer-events: none;
}
/* 用户主动停止:中性(不是失败,不占信号红)——参考 Temporal 的 Canceled=neutral */
.wf-step[data-state='stopped'] .wf-node { border-color: var(--ink-3); }
.wf-step[data-state='stopped'] .wf-state { color: var(--ink-2); border-color: var(--line-soft); }
.wf-runmeta [data-run-progress] { color: var(--ink-3); }

/* 助手栏与主区「合并」:去掉两栏之间那道列间距(--column-gap ≈ 16–24px),
   让助手栏的分隔线直接贴住主区右缘,中间不再留一条空白带。
   注意只能在宽屏生效:≤1180px 时助手栏是覆盖式抽屉(position: fixed),负外边距会把它推出屏幕。
   主区自身的 padding-right: 6px 保留 —— 那是滚动条与分隔线之间的呼吸,不算栏间空隙。 */
@media (min-width: 1181px) {
  body.assistant-open .assistant { margin-left: calc(-1 * var(--column-gap)); }
}

/* 面板级滚动条:隐藏(主区 / 助手对话区 / 产物 / 能力)。
   理由:这几处的滚动条是纯装饰性 chrome —— 面板本来就能滚,留着只是在主区与助手栏之间
   又多出一条灰色竖条(用户口径:保留分隔线、隐藏滑动条)。
   内容照旧可滚:滚轮 / 触控板 / 键盘 / 拖动选择都不受影响。
   注意同时把 scrollbar-gutter 收回 auto:槽位是给滚动条预留的,隐藏后它就是白留的空白。 */
.main,
.assistant-messages,
.exports-list,
.assistant-caps {
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;
  scrollbar-gutter: auto;
}
.main::-webkit-scrollbar,
.assistant-messages::-webkit-scrollbar,
.exports-list::-webkit-scrollbar,
.assistant-caps::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* 块内滚动(工具输出、代码块、思考过程)保留细滚动条:
   它们是「内容被截断」的信号,藏掉反而让人以为就这么多。 */

/* 分隔线保留并略作加强:隐藏滚动条后它是主区与助手栏之间唯一的界 */
.assistant { border-left: 1px solid var(--line-soft); }
