:root { font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; color: #243047; background: #f7f9fc; } /* 统一字体、文字颜色和页面底色。 */
* { box-sizing: border-box; } /* 把边框计入元素尺寸。 */
body { margin: 0; } /* 移除浏览器默认外边距。 */
button, select, textarea, input { font: inherit; } /* 让表单控件沿用页面字体。 */
button { cursor: pointer; } /* 明确按钮可以点击。 */
a { color: inherit; text-decoration: none; } /* 由组件样式控制链接外观。 */
:focus-visible { outline: 2px solid #4d73d9; outline-offset: 2px; } /* 为键盘操作保留清晰焦点。 */
.site-header { height: 64px; border-bottom: 1px solid #e8edf4; background: #fff; } /* 使用简单的白色顶部栏。 */
.header-inner { width: min(1160px, calc(100% - 40px)); height: 100%; margin: auto; display: flex; align-items: center; justify-content: space-between; } /* 对齐品牌与返回链接。 */
.brand { display: inline-flex; align-items: center; gap: 10px; color: #1e2b42; font-size: 17px; font-weight: 700; } /* 使用简短品牌文字。 */
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: #3767d6; color: #fff; font-size: 16px; } /* 显示小型蓝色品牌标记。 */
.home-link { color: #5f6f88; font-size: 13px; } /* 用轻量文字提供返回入口。 */
.home-link:hover { color: #2f60d2; } /* 鼠标悬停时提示可点击。 */
.page-shell { width: min(1160px, calc(100% - 40px)); margin: 0 auto; padding: 32px 0 40px; } /* 限制内容宽度并保留页面留白。 */
.page-intro { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; } /* 标题与清理提示并排。 */
.eyebrow { margin: 0 0 6px; color: #5578c4; font-size: 11px; font-weight: 700; letter-spacing: .13em; } /* 标记项目类型。 */
.page-intro h1 { margin: 0; color: #1f2c42; font-size: 28px; line-height: 1.3; } /* 用适中的字号显示标题。 */
.intro-text { margin: 7px 0 0; color: #728098; font-size: 13px; line-height: 1.6; } /* 用一句话说明使用方式。 */
.cleanup-badge { flex: none; padding: 8px 11px; border-radius: 8px; background: #edf3ff; color: #4b6eb6; font-size: 12px; } /* 低对比度显示清理时间。 */
.workspace { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: stretch; } /* 桌面端采用文档栏和对话栏。 */
.library-panel, .chat-panel { min-width: 0; height: min(760px, max(620px, calc(100vh - 185px))); border: 1px solid #e5eaf1; border-radius: 14px; background: #fff; box-shadow: 0 6px 24px #25385808; } /* 使用轻边框代替大型装饰卡片。 */
.library-panel { display: flex; flex-direction: column; padding: 20px; } /* 让文档列表占用剩余空间。 */
.panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; } /* 文档标题和数量同行。 */
.panel-heading h2, .chat-header h2 { margin: 0; color: #253047; font-size: 16px; line-height: 1.4; } /* 两栏使用一致的标题层级。 */
.document-count { color: #8290a4; font-size: 12px; } /* 用小字标示文件数量。 */
.document-count strong { color: #3767d6; } /* 让数量便于识别。 */
.upload-zone { position: relative; min-height: 112px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 14px; border: 1px dashed #b5c5e3; border-radius: 10px; background: #f9fbff; text-align: center; cursor: pointer; } /* 保留明显但克制的上传区域。 */
.upload-zone:hover, .upload-zone:focus-within { border-color: #5b83dc; background: #f3f7ff; } /* 提供上传区域的交互反馈。 */
.upload-symbol { color: #4772d2; font-size: 22px; line-height: 1; } /* 显示简单的加号。 */
.upload-zone strong { color: #345fbd; font-size: 13px; } /* 突出上传操作文字。 */
.upload-zone small { color: #8b98ab; font-size: 11px; line-height: 1.5; } /* 显示格式和大小限制。 */
.upload-zone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; } /* 让整块上传区域都可点击。 */
.upload-status { min-height: 18px; max-height: 72px; overflow-y: auto; margin: 9px 0 15px; color: #56719f; overflow-wrap: anywhere; font-size: 11px; line-height: 1.5; } /* 展示多个文件的处理结果。 */
.list-heading { padding-bottom: 10px; border-bottom: 1px solid #edf0f5; color: #66758e; font-size: 12px; font-weight: 600; } /* 用细分隔线引出文件列表。 */
.document-list { flex: 1; min-height: 100px; overflow-y: auto; padding: 10px 0; } /* 文件较多时仅滚动列表。 */
.document { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 10px 0; border-bottom: 1px solid #f0f2f6; } /* 每份文件显示为紧凑的一行。 */
.document:last-child { border-bottom: 0; } /* 去除列表末尾多余分隔线。 */
.document span { min-width: 0; flex: 1; overflow: hidden; color: #43536d; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; } /* 长文件名保持在一行。 */
.document button { flex: none; padding: 5px 7px; border: 0; border-radius: 6px; background: transparent; color: #8895a8; font-size: 11px; } /* 将删除按钮做成轻量文字操作。 */
.document button:hover { background: #fff1f1; color: #c54b4b; } /* 删除操作悬停时用红色提示。 */
.document-empty { padding: 32px 8px; color: #9aa6b7; text-align: center; font-size: 12px; } /* 文件为空时显示安静的提示。 */
.library-footer { padding-top: 13px; border-top: 1px solid #edf0f5; } /* 将使用提醒放在侧栏底部。 */
.library-footer > p:first-child { margin: 0; color: #8a96a8; font-size: 11px; line-height: 1.6; } /* 显示共享文档与清理规则。 */
.config-status { margin: 12px 0 0; color: #73819a; font-size: 11px; line-height: 1.5; } /* 显示当前服务配置状态。 */
.chat-panel { display: flex; flex-direction: column; overflow: hidden; } /* 对话区由顶部、消息和输入区组成。 */
.chat-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 19px 22px; border-bottom: 1px solid #edf0f5; } /* 对话顶部只保留必要信息。 */
.chat-header p { margin: 4px 0 0; color: #8a97a9; font-size: 11px; } /* 用浅色说明回答形式。 */
.toolbar-actions { display: flex; align-items: center; gap: 8px; } /* 模式与清空操作并排。 */
.toolbar-actions select, .toolbar-actions button { height: 33px; padding: 0 10px; border: 1px solid #dce4ef; border-radius: 7px; background: #fff; color: #54657f; font-size: 12px; } /* 统一工具栏控件尺寸。 */
.toolbar-actions select:hover, .toolbar-actions button:hover { border-color: #a8bce3; } /* 鼠标经过时强调控件边界。 */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; } /* 保留屏幕阅读器可读的标签。 */
.messages { flex: 1; min-height: 0; overflow-y: auto; padding: 22px; } /* 让对话记录单独滚动。 */
.empty-chat { height: 100%; min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #8996a9; text-align: center; } /* 在空对话中显示简短引导。 */
.empty-chat span { margin-bottom: 12px; color: #7090d6; font-size: 25px; } /* 使用一个小型欢迎标识。 */
.empty-chat strong { color: #52627c; font-size: 14px; } /* 显示空状态标题。 */
.empty-chat p { margin: 7px 0 0; font-size: 12px; } /* 显示示例问题。 */
.message { width: fit-content; max-width: min(88%, 690px); margin-bottom: 16px; padding: 11px 13px; border: 1px solid #e8ecf3; border-radius: 11px; background: #f8fafc; } /* 助手消息使用低对比度气泡。 */
.message.user { margin-left: auto; border-color: #dce7ff; background: #eff5ff; } /* 用户消息靠右并使用浅蓝底。 */
.message > strong { color: #5b73a7; font-size: 11px; } /* 只给消息角色应用小标题样式。 */
.message-body { margin-top: 5px; color: #34445d; overflow-wrap: anywhere; font-size: 13px; line-height: 1.7; } /* 统一消息正文排版。 */
.message.user .message-body { white-space: pre-wrap; } /* 用户输入仍按原始换行显示。 */
.message-body p { margin: 0 0 9px; white-space: pre-wrap; } /* 保留普通段落里的换行。 */
.message-body > :last-child { margin-bottom: 0; } /* 去掉最后一段的多余空白。 */
.message-body :is(h1,h2,h3,h4,h5,h6) { margin: 11px 0 5px; font-size: 14px; line-height: 1.4; } /* 控制回答中的标题层级。 */
.message-body :is(ul,ol) { margin: 5px 0 10px; padding-left: 23px; } /* 给列表留出项目标记的位置。 */
.message-body li { margin: 3px 0; } /* 分隔相邻列表项。 */
.message-body blockquote { margin: 8px 0; padding: 1px 10px; border-left: 3px solid #bed0ed; color: #687994; } /* 区分引用内容。 */
.message-body pre { max-width: 100%; overflow-x: auto; margin: 8px 0; padding: 11px; border-radius: 7px; background: #eaf0f8; font-size: 12px; line-height: 1.5; } /* 长代码在气泡内横向滚动。 */
.message-body code { padding: 1px 4px; border-radius: 4px; background: #eaf0f8; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: normal; } /* 显示行内代码。 */
.message-body pre code { padding: 0; background: transparent; white-space: pre; } /* 代码块保持原始缩进。 */
.message-body .markdown-table-scroll { max-width: 100%; overflow-x: auto; margin: 8px 0; } /* 手机上表格可以横向滚动。 */
.message-body :is(th,td) { padding: 5px 8px; border: 1px solid #dce4ee; text-align: left; white-space: nowrap; } /* 保持表格单元格清楚可读。 */
.message-body a { color: #3767d6; text-decoration: underline; overflow-wrap: anywhere; } /* 让 Markdown 链接明显可见。 */
.message-body hr { margin: 10px 0; border: 0; border-top: 1px solid #dce4ee; } /* 显示内容分隔线。 */
.message small { display: block; margin-top: 7px; color: #7e8ca2; font-size: 11px; line-height: 1.5; } /* 显示工具调用状态。 */
.sources { margin-top: 10px; padding-top: 9px; border-top: 1px solid #e5eaf2; } /* 将引用与回答正文隔开。 */
.sources div { margin-top: 6px; color: #62738c; font-size: 11px; line-height: 1.5; } /* 展示每条来源。 */
.sources a { color: #3767d6; } /* 网页来源保持可点击的蓝色。 */
.sources a:hover { text-decoration: underline; } /* 链接悬停时添加下划线。 */
.sources small { margin-top: 3px; color: #8995a5; } /* 让来源摘要弱于标题。 */
.chat-bottom { padding: 13px 20px 16px; border-top: 1px solid #edf0f5; } /* 输入区保持在卡片底部。 */
.composer { display: flex; align-items: end; gap: 9px; padding: 7px; border: 1px solid #cdd8e9; border-radius: 10px; background: #fff; } /* 将输入框与发送按钮放在一行。 */
.composer:focus-within { border-color: #6b8fe0; } /* 输入时显示焦点边框。 */
.composer textarea { flex: 1; min-width: 0; min-height: 41px; max-height: 150px; padding: 9px; border: 0; outline: 0; resize: vertical; color: #2c3b53; background: transparent; font-size: 13px; line-height: 1.5; } /* 输入区可随问题长度拉高。 */
.composer textarea::placeholder { color: #a0aab8; } /* 弱化占位文字。 */
.composer button { min-width: 58px; height: 36px; border: 0; border-radius: 7px; background: #3767d6; color: #fff; font-size: 12px; font-weight: 600; } /* 使用明确的发送文字。 */
.composer button:hover { background: #2d58be; } /* 提供发送按钮悬停反馈。 */
.composer button:disabled { opacity: .55; cursor: wait; } /* 请求期间显示禁用状态。 */
.assistant-tip { margin: 9px 2px 0; color: #9aa5b4; font-size: 11px; } /* 在输入区下方提醒核对来源。 */
@media (max-width: 850px) { /* 平板和手机改为上下布局。 */
  .workspace { grid-template-columns: 1fr; } /* 文档区排列在对话区上方。 */
  .library-panel { height: auto; min-height: 0; } /* 文档区随内容自然增长。 */
  .document-list { flex: none; max-height: 230px; } /* 文件多时仍可在列表内部滚动。 */
  .chat-panel { height: 680px; } /* 保留足够的对话阅读空间。 */
} /* 响应式布局结束。 */
@media (max-width: 560px) { /* 手机宽度下收紧页面间距。 */
  .header-inner, .page-shell { width: calc(100% - 28px); } /* 缩小两侧空白。 */
  .page-shell { padding-top: 24px; } /* 让主要内容更快进入视野。 */
  .page-intro { align-items: flex-start; flex-direction: column; gap: 10px; } /* 标题和提示改为上下排列。 */
  .page-intro h1 { font-size: 24px; } /* 缩小手机上的主标题。 */
  .workspace { gap: 14px; } /* 缩小两栏之间的间距。 */
  .library-panel { padding: 17px; } /* 缩小文档栏内边距。 */
  .chat-panel { height: 620px; } /* 适配较窄的手机屏幕。 */
  .chat-header { align-items: flex-start; flex-direction: column; padding: 16px; } /* 对话标题和工具栏分行。 */
  .toolbar-actions { width: 100%; } /* 让操作区域使用可用宽度。 */
  .toolbar-actions select { flex: 1; min-width: 0; } /* 模式选择框优先占据空间。 */
  .messages { padding: 16px; } /* 缩小消息区边距。 */
  .message { max-width: 95%; } /* 让手机消息有更多文字空间。 */
  .chat-bottom { padding: 12px; } /* 输入区贴合手机宽度。 */
} /* 手机样式结束。 */

