/* 知源功能组件样式（第一版浅色主题配套） */

/* 顶部用户头像 */
.user-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.72); box-shadow: 0 8px 22px rgba(56,83,122,.08); }
.user-chip img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.user-chip span { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.user-chip.compact span { display: none; }

/* 面板标题操作区与文档搜索 */
.panel-heading-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel-heading-actions .document-search { width: 210px; }
.document-search { height: 36px; padding: 0 12px; color: var(--ink); border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.86); }

/* 文档卡片：增加批量选择框列 */
.document-card { grid-template-columns: 22px 48px 1fr auto; }
.document-select { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* 危险操作按钮 */
.danger-button, .panel-heading-actions .danger-button, .compact-row .danger-button { color: #d92d42; border-color: rgba(217,45,66,.28); background: #fff2f4; }
.danger-button:hover { border-color: #d92d42; }
.danger-button:disabled { color: #9aa5b5; border-color: var(--line); background: #f2f4f8; cursor: not-allowed; }

/* 账号状态标签 */
.status-tag.active { color: #087d49; background: #e5f8ee; }
.status-tag.pending { color: #9a6400; background: #fff3d6; }
.status-tag.disabled { color: #6d7789; background: #eef1f5; }

/* 文档标签与引用标签 */
.document-tags, .citation-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.document-tag, .citation-tags i { padding: 3px 8px; color: #0d6fd1; font-size: 10px; font-style: normal; border: 1px solid rgba(22,119,255,.2); border-radius: 999px; background: #eef5ff; }

/* 历史记录操作 */
.history-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }

/* 检索模式切换与标签面板：与输入框同一固定层 */
.search-toolbar { position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); z-index: 31; display: flex; align-items: center; gap: 8px; }
.search-mode-switch { position: static; flex: 0 0 auto; display: inline-grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.88); box-shadow: 0 10px 26px rgba(56,83,122,.12); }
.search-mode-switch button { padding: 8px 15px; color: var(--muted); border: 0; border-radius: 9px; background: transparent; cursor: pointer; white-space: nowrap; }
.search-mode-switch button.active { color: var(--accent); background: #eaf3ff; }
.tag-search-panel { position: relative; flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.95); box-shadow: 0 10px 26px rgba(56,83,122,.12); }
.selected-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-capsule { padding: 5px 9px; color: var(--accent); font-size: 11px; border: 1px solid rgba(22,119,255,.24); border-radius: 999px; background: #eef5ff; cursor: pointer; white-space: nowrap; }
.tag-search-panel input { flex: 1 1 auto; min-width: 90px; height: 34px; margin: 0; padding: 0 10px; color: var(--ink); border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.tag-suggestions { position: absolute; left: 10px; right: 10px; bottom: calc(100% + 7px); z-index: 50; display: grid; gap: 4px; max-height: 220px; overflow: auto; padding: 7px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 18px 40px rgba(56,83,122,.18); }
.tag-suggestions:empty { display: none; }
.tag-suggestions button { display: flex; justify-content: space-between; gap: 12px; padding: 9px 10px; color: var(--ink); border: 0; border-radius: 9px; background: transparent; cursor: pointer; }
.tag-suggestions button:hover { background: #eef5ff; }
.tag-suggestions small { color: var(--muted); }
body.tag-mode-active .chat-layout { padding-bottom: 380px; }
@media (max-width: 800px) { .search-toolbar { flex-direction: column; align-items: stretch; } .panel-heading-actions .document-search { width: 100%; } }

/* 输入框不透明，避免回答文字透过输入框看起来像重合 */
.composer { background: rgba(255,255,255,.98); border: 1px solid rgba(255,255,255,.92); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); box-shadow: 0 18px 46px rgba(56,83,122,.18); }

/* 命中片段分条显示 */
.citation-card { display: block; }
.citation-title { display: block; margin-bottom: 9px; font-size: 13px; }
.citation-matches { display: grid; gap: 6px; }
.citation-match { display: flex; align-items: center; gap: 10px; padding: 10px 12px; color: #33445e; font-size: 12px; line-height: 1.65; border: 1px solid rgba(22,119,255,.16); border-radius: 10px; background: #f4f8ff; cursor: pointer; transition: background .18s ease, border-color .18s ease; }
.citation-match:hover { background: #e9f2ff; border-color: rgba(22,119,255,.36); }
.citation-match em { flex: 0 0 auto; display: grid; place-items: center; width: 20px; height: 20px; color: var(--accent); font-style: normal; font-size: 11px; font-weight: 700; border-radius: 50%; background: rgba(22,119,255,.12); }
.citation-match span { flex: 1; display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.citation-match b { flex: 0 0 auto; color: var(--accent); font-size: 11px; font-weight: 600; white-space: nowrap; }

/* 文档全文预览：隐藏命中侧栏，让原文占满阅读区 */
.viewer-layout.document-mode { grid-template-columns: 1fr; }
.viewer-layout.document-mode .document-stage { min-height: calc(100vh - 120px); }

/* PDF 连续滚动全文阅读 */
.pdf-stage { display: flex !important; flex-direction: column; align-items: center; gap: 30px; padding: 34px 28px 60px !important; }
.pdf-stage .pdf-page-wrap { flex: 0 0 auto; }
.pdf-page-label { position: absolute; top: -22px; left: 0; color: var(--muted); font-size: 11px; letter-spacing: .08em; }

/* 原文阅读区保持纸张质感 */
.source-html, .table-view { color: #172332; background: #f8f5ed; }

/* Դ�ڵ���ʱ����ʾ���ж���ɶ�λ��Ƭ�� */
.quote-list { display: grid; gap: 8px; margin: 14px 0; }
.quote-option {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 4px 9px;
  padding: 10px 12px;
  color: #33445e;
  text-decoration: none;
  border: 1px solid rgba(22,119,255,.16);
  border-radius: 12px;
  background: #f7faff;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.quote-option:hover { background: #edf5ff; border-color: rgba(22,119,255,.38); }
.quote-option.active { border-color: rgba(22,119,255,.55); background: #e9f2ff; box-shadow: inset 3px 0 0 var(--accent); }
.quote-option em {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--accent);
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  border-radius: 50%;
  background: rgba(22,119,255,.12);
}
.quote-option span { overflow: hidden; font-size: 12px; line-height: 1.55; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.quote-option small { grid-column: 2; color: var(--muted); font-size: 11px; }
.hit-focus { background: rgba(255,138,0,.92) !important; box-shadow: 0 0 0 3px rgba(255,138,0,.62) !important; }
.textLayer span.match-focus { background: rgba(255,138,0,.28); box-shadow: 0 0 0 2px rgba(255,138,0,.48); }
.data-table { color: #243243; background: #fff; }
.source-target, .source-block:target { background: #f5dfad; box-shadow: 0 0 0 4px #f5dfad; }
