/* ----------------------------------------------------------------
   🏷️ 推荐话题标签栏 — 注入在输入框下方，始终可见
   ---------------------------------------------------------------- */
#birding-tags-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0 4px 0;
  max-width: 100%;
  justify-content: flex-start;
  align-items: flex-start;
}

#birding-tags-bar .birding-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 999px;                   /* pill shape */
  font-size: 0.8em;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: all 0.18s ease;

  /* light theme */
  background: #f0f4f0;
  color: #2d6a2d;
  border: 1px solid #c3e0c3;
}

/* dark theme */
.dark #birding-tags-bar .birding-tag {
  background: #1a2e1a;
  color: #8ccf8c;
  border-color: #3d6a3d;
}

#birding-tags-bar .birding-tag:hover {
  background: #d4ecd4;
  border-color: #5bab5b;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.dark #birding-tags-bar .birding-tag:hover {
  background: #2a4a2a;
  border-color: #5bab5b;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

#birding-tags-bar .birding-tag:active {
  transform: translateY(0);
  box-shadow: none;
}

/* loading feedback when clicked */
#birding-tags-bar .birding-tag.tag-active {
  background: #c3e0c3;
  border-color: #5bab5b;
  transform: scale(0.96);
}
.dark #birding-tags-bar .birding-tag.tag-active {
  background: #3d6a3d;
}

/* tag icon — optional subtle dot */
#birding-tags-bar .birding-tag .tag-icon {
  font-size: 0.9em;
  opacity: 0.7;
}

/* ================================================================
   🔐 登录页面定制 — 隐藏右侧默认图标，展示 Agent 功能
   ================================================================ */

/* Chainlit 登录页是左右双栏布局：左栏表单，右栏 Chainlit 默认插画。
   隐藏右栏，让表单区域全宽居中。 */
/* 策略：定位包含 "chainlit" logo/水印的右侧面板并隐藏 */

/* 隐藏登录页右侧的默认 Chainlit 插画区域 */
/* Chainlit 使用 flex/grid 双栏布局，第二个子元素是品牌插画 */
.auth-page-right-panel,
[class*="login"] > div:last-child:not(:only-child),
/* 针对 Chainlit login page — 右侧面板 */
#root > div > div > div:last-child > svg,
#root > div > div > div:last-child > img {
  display: none !important;
}

/* 如果登录页使用了固定绝对定位的右侧背景图，也隐藏 */
[class*="auth"] [class*="background"],
[class*="login"] [class*="background"],
[class*="auth"] [class*="illustration"],
[class*="login"] [class*="illustration"] {
  display: none !important;
}

/* 隐藏可能独立存在的 Chainlit logo 图片 */
img[alt="Chainlit"],
img[src*="chainlit"],
svg[class*="chainlit"] {
  display: none !important;
}

/* 登录页整体居中 */
body #root {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 100vh !important;
}

/* 缩小左上角 Logo（Chainlit 默认太大了） */
img[src*="/logo"],
header img {
  width: 80px !important;
  height: 80px !important;
}

/* ── Agent 功能介绍卡片（由 JS 注入，位于登录按钮上方）── */
#birding-feature-showcase {
  margin: 0 0 24px 0;
  padding: 0;
  width: 100%;
}

#birding-feature-showcase .feature-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 10px;
  opacity: 0.7;
  text-align: center;
  letter-spacing: 0.02em;
}

#birding-feature-showcase .feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

#birding-feature-showcase .feature-item {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0,0,0,0.03);
  transition: background 0.2s ease, transform 0.2s ease;
}

/* 奇数个条目时，最后一个独占整行并居中 */
#birding-feature-showcase .feature-item-last {
  grid-column: 1 / -1;
  max-width: 340px;
  justify-self: center;
  width: 100%;
}

.dark #birding-feature-showcase .feature-item {
  background: rgba(255,255,255,0.04);
}

#birding-feature-showcase .feature-item:hover {
  background: rgba(34,139,34,0.06);
  transform: translateY(-1px);
}

.dark #birding-feature-showcase .feature-item:hover {
  background: rgba(34,139,34,0.12);
}

#birding-feature-showcase .feature-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 1px;
}

#birding-feature-showcase .feature-text {
  display: flex;
  flex-direction: column;
}

#birding-feature-showcase .feature-label {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
}

#birding-feature-showcase .feature-desc {
  font-size: 0.72rem;
  opacity: 0.55;
  line-height: 1.3;
  margin-top: 1px;
}

/* ================================================================
   🖊️ 输入框间距修复 — 历史会话消息区域与输入框间距过紧
   Chainlit 用 CSS Modules (hashed class names) + flex 布局，
   纯 CSS 选择器难以匹配。主修复逻辑在 custom.js 中通过 JS 操作 DOM。
   这里保留最基本的 fallback。
   ================================================================ */

/* Fallback：直接给输入框顶部加间距 */
#message-composer {
  padding-top: 24px !important;
}

/* 响应式：移动端单列 */
@media (max-width: 480px) {
  #birding-feature-showcase .feature-grid {
    grid-template-columns: 1fr;
  }
  #birding-feature-showcase .feature-item-last {
    grid-column: auto;
    max-width: none;
  }
}

/* chainlit.md 中的图片 — 去掉容器灰色背景 */
img[src*="admin_wechat"],
[class*="markdown"] img,
[class*="prose"] img,
[class*="welcome"] img,
[class*="message"] p img {
  background: transparent !important;
  mix-blend-mode: normal !important;
  box-shadow: none !important;
}

/* 也去掉图片外层容器的背景 */
a[href*="admin_wechat"],
[class*="markdown"] p:has(img[src*="admin_wechat"]),
[class*="prose"] p:has(img[src*="admin_wechat"]) {
  background: transparent !important;
}
