@charset "UTF-8";
/* 聊天回复里的「原始文件下载链接」修复器
 * 由 index.html 注入，作用于容器内已编译的 WeKnora SPA。
 * 模型偶尔会把 <kb ... /> 引用标签当成 markdown 链接的 URL，
 * 生成 [下载 xxx.zip](<kb ... />) 这种无法点击的残缺链接；
 * 这里把它补成真实的、点击即下载的链接。
 */

.wk-file-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0 4px;
  padding: 1px 2px;
  border-radius: 4px;
  color: #0f6e56;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  vertical-align: baseline;
}
.wk-file-link:hover { color: #0a5a45; background: rgba(15, 110, 86, 0.08); }
.wk-file-link::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  background-repeat: no-repeat;
  background-size: contain;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%230f6e56' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 3v9m0 0 3.5-3.5M10 12 6.5 8.5M4 15.5h12'/%3E%3C/svg%3E");
}
.wk-file-link.is-loading { opacity: 0.6; pointer-events: none; }
.wk-file-link.is-loading::before {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%230f6e56' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M10 3a7 7 0 1 1-7 7'/%3E%3C/svg%3E");
  animation: wk-dl-spin 0.9s linear infinite;
}
.wk-file-link.is-error { color: #a32d2d; }
.wk-file-link.is-error::before { filter: hue-rotate(145deg) saturate(2); }

@keyframes wk-dl-spin { to { transform: rotate(360deg); } }

.wk-dl-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9500;
  max-width: 420px;
  padding: 12px 16px;
  border-radius: 8px;
  background: #2c2c2a;
  color: #fff;
  font-size: 13px;
  line-height: 1.6;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

[theme-mode="dark"] .wk-file-link { color: #5dcaa5; }
[theme-mode="dark"] .wk-file-link:hover { color: #9fe1cb; background: rgba(93, 202, 165, 0.12); }
[theme-mode="dark"] .wk-file-link::before { filter: brightness(1.6); }
[theme-mode="dark"] .wk-dl-toast { background: #3a3a3a; }
