
  :root {
    --db-bg: #ffffff;
    --db-sidebar-bg: #fafafa;
    --db-border: #e8e8e8;
    --db-user-bubble: #f3f4f6;
    --db-text: #1f2329;
    --db-text-2: #6b7280;
    --db-text-3: #9ca3af;
    --db-hover: #f0f0f0;
  }
  html, body { background: var(--db-bg); color: var(--db-text); font-family: var(--body-base-font-family), "Microsoft YaHei", "PingFang SC", -apple-system, sans-serif; margin: 0; padding: 0; height: 100%; overflow: hidden; }
  body { display: flex; flex-direction: column; }

  /* navbar（与全站一致，见 /static/navbar.js） */
  .navbar {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; justify-content: space-between;
    height: 56px; padding: 0 var(--spacer-24);
    background: var(--bg-base-secondary); border-bottom: 1px solid var(--border-neutral-l1);
    flex-shrink: 0;
  }
  .navbar__brand {
    display: inline-flex; align-items: center; gap: var(--spacer-8);
    font-family: var(--heading-sm-font-family); font-size: var(--heading-sm-font-size);
    font-weight: var(--heading-sm-font-weight); color: var(--text-default); text-decoration: none;
  }
  .navbar__brand-icon { width: 36px; height: 36px; object-fit: contain; }
  .navbar__nav { display: inline-flex; align-items: center; gap: var(--spacer-4); }
  .navbar__link {
    display: inline-flex; align-items: center; gap: var(--spacer-6);
    height: 32px; padding: 0 var(--spacer-12); border-radius: var(--radius-8);
    font-size: var(--body-base-font-size); color: var(--text-secondary); text-decoration: none;
    transition: background .12s ease, color .12s ease;
  }
  .navbar__link:hover { background: var(--bg-overlay-l2); color: var(--text-default); }
  .navbar__link.is-active { background: var(--bg-overlay-l1); color: var(--text-default); font-weight: var(--font-weight-medium); }
  .navbar__divider { width: 1px; height: 20px; background: var(--border-neutral-l1); margin: 0 var(--spacer-8); }
  .navbar__user { display: inline-flex; align-items: center; gap: var(--spacer-8); font-size: var(--body-sm-font-size); color: var(--text-secondary); }
  .navbar__brand img { width: 36px; height: 36px; object-fit: contain; }

  /* ===== 布局 ===== */
  .db-layout { flex: 1; display: flex; min-height: 0; }

  /* 左侧栏 */
  .db-sidebar { width: 260px; flex-shrink: 0; background: var(--db-sidebar-bg); border-right: 1px solid var(--db-border); display: flex; flex-direction: column; overflow: hidden; transition: width .2s ease, padding .2s ease, border .2s ease; min-height: 0; }
  .db-sidebar.is-collapsed { width: 0; overflow: hidden; border-right: none; padding: 0; }
  .db-sidebar.is-collapsed .db-sidebar__top,
  .db-sidebar.is-collapsed .db-sidebar__label,
  .db-sidebar.is-collapsed .db-history,
  .db-sidebar.is-collapsed .db-sidebar__bottom { display: none; }
  .db-sidebar__top { padding: 16px 12px 8px; display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; }
  .db-brand { display: flex; align-items: center; gap: 8px; padding: 6px 8px; margin-bottom: 8px; font-weight: 600; font-size: 15px; }
  .db-brand img { width: 22px; height: 22px; border-radius: 6px; }
  .db-nav-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; font-size: 14px; color: var(--db-text); cursor: pointer; border: none; background: none; width: 100%; text-align: left; transition: background .1s; }
  a.db-nav-item { text-decoration: none; color: var(--db-text); }
  a.db-nav-item:hover { color: var(--db-text); }
  .db-nav-item:hover { background: var(--db-hover); }
  .db-nav-item img, .db-nav-item svg { flex-shrink: 0; }
  .db-nav-item.is-primary { font-weight: 500; }
  .db-sidebar__label { font-size: 11px; color: var(--db-text-3); padding: 16px 10px 8px; letter-spacing: .02em; }
  .db-history { display: flex; flex-direction: column; gap: 2px; flex: 1; padding: 4px 12px 16px; overflow-y: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: rgba(0,0,0,.15) transparent; }
  .db-history::-webkit-scrollbar { width: 6px; }
  .db-history::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 3px; }
  .db-history::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.25); }
.db-history__inner { padding: 0 12px 16px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
  .db-history__item { position: relative; padding: 8px 32px 8px 20px; border-radius: 8px; font-size: 13px; color: var(--db-text-2); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: background .1s, color .1s; flex-shrink: 0; display: flex; align-items: center; gap: 6px; }
  .db-history__item:hover { background: var(--db-hover); color: var(--db-text); }
  .db-history__item.is-active { background: #e8e8e8; color: var(--db-text); font-weight: 500; }
  .db-history__title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-history__item.is-pinned { }
.db-history__more { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: none; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px; border: none; background: none; color: var(--db-text-3); cursor: pointer; }
.db-history__item:hover .db-history__more { display: flex; }
.db-history__more:hover { background: var(--db-hover); color: var(--db-text); }
.db-history__pin { flex-shrink: 0; margin-right: 4px; vertical-align: middle; position: relative; top: -1px; color: var(--db-text-3); }
.db-history__run { flex-shrink: 0; vertical-align: middle; color: #60a5fa; animation: db-spin 1s linear infinite; filter: drop-shadow(0 0 3px rgba(96,165,250,.5)); }
@keyframes db-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.db-history__section { font-size: 11px; color: var(--db-text-3); padding: 8px 8px 4px 8px; letter-spacing: .02em; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.db-history__section > span:first-child { white-space: nowrap; flex-shrink: 0; }
.db-history__section-actions { display: flex; align-items: center; gap: 4px; min-width: 0; flex-wrap: nowrap; }
.db-history__section-actions .db-history__section-btn, .db-history__section-actions .db-history__section-count { white-space: nowrap; flex-shrink: 0; }
.db-history__ws-toggle.is-hidden { display: none; }
/* 历史侧栏：工作空间分组 */
.db-history__ws-toggle { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--db-border); background: transparent; color: var(--db-text-3); font-size: 11px; line-height: 1.4; padding: 2px 8px; border-radius: 999px; cursor: pointer; transition: all .12s; font-family: inherit; }
.db-history__ws-toggle:hover { color: var(--db-text); border-color: var(--db-text-3); }
.db-history__ws-toggle.is-active { background: var(--bg-brand); border-color: var(--bg-brand); color: #fff; }
.db-history__ws-head { display: flex; align-items: center; gap: 6px; padding: 9px 8px 3px 8px; font-size: 11.5px; font-weight: 600; color: var(--db-text-2); cursor: pointer; user-select: none; flex-shrink: 0; min-width: 0; border-radius: 6px; }
.db-history__ws-head:hover { color: var(--db-text); }
.db-history__ws-head svg { color: var(--db-text-3); flex-shrink: 0; }
.db-history__ws-chev { transition: transform .15s; }
.db-history__ws-chev.is-collapsed { transform: rotate(-90deg); }
.db-history__ws-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-history__ws-count { flex-shrink: 0; font-size: 10.5px; font-weight: 400; color: var(--db-text-3); }
.db-history__time { flex-shrink: 0; font-size: 10.5px; color: var(--db-text-3); }
.db-history__item:hover .db-history__time { display: none; }
.db-history__section-actions { display: flex; align-items: center; gap: 4px; }
.db-history__section-count { font-size: 11px; color: var(--db-text-3); }
.db-history__section-btn { border: none; background: none; color: var(--db-text-3); font-size: 11px; cursor: pointer; padding: 2px 6px; border-radius: 4px; transition: background .1s, color .1s; line-height: 1.4; }
.db-history__section-btn:hover { background: var(--db-hover); color: var(--db-text); }
.db-history__section-btn--del { color: #dc2626; font-weight: 500; }
.db-history__section-btn--del:hover { background: rgba(220,38,38,.08); color: #b91c1c; }
.db-history__section-btn--del[disabled] { color: var(--db-text-3); pointer-events: none; opacity: .4; }
.db-history__section--top { padding-top: 12px; }
  .db-history__empty { padding: 16px 10px; font-size: 12px; color: var(--db-text-3); text-align: center; }
  .db-history.is-manage .db-history__item { padding-left: 8px; cursor: default; }
  .db-history.is-manage .db-history__item:hover { background: transparent; color: var(--db-text-2); }
  .db-history.is-manage .db-history__item.is-selected { background: rgba(83,104,255,.08); color: var(--db-text); }
  .db-history.is-manage .db-history__more { display: none !important; }
  .db-history-check { width: 16px; height: 16px; accent-color: #5368ff; cursor: pointer; flex-shrink: 0; margin-right: 4px; }
  .db-sidebar__bottom { padding: 12px; border-top: 1px solid var(--db-border); flex-shrink: 0; }
  .db-user { position: relative; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; font-size: 14px; color: var(--db-text); cursor: pointer; }
  .db-user:hover { background: var(--db-hover); }
  .db-user img { width: 26px; height: 26px; border-radius: 50%; }
  .db-user__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .db-user__arrow { flex-shrink: 0; color: var(--db-text-3); transition: transform .15s; }
  .db-user.is-open .db-user__arrow { transform: rotate(180deg); }
  .db-user-menu { position: absolute; bottom: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid var(--db-border); border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.08); padding: 6px; display: none; z-index: 50; }
  .db-user.is-open .db-user-menu { display: block; }
  .db-user-menu__item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; font-size: 13px; color: var(--db-text); cursor: pointer; transition: background .1s; }
  .db-user-menu__item:hover { background: var(--db-hover); }
  .db-user-menu__item svg { flex-shrink: 0; color: var(--db-text-2); }
  .db-user-menu__item--danger { color: #ef4444; }
  .db-user-menu__item--danger svg { color: #ef4444; }
  .db-user-menu__divider { height: 1px; background: var(--db-border); margin: 4px 0; }

  /* 主内容 */
  .db-main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--db-bg); position: relative; overflow: hidden; }
  .db-topbar { height: 52px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; position: relative; border-bottom: 1px solid transparent; }
  .db-topbar__menu { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; border: none; background: none; color: var(--db-text-2); cursor: pointer; transition: background .1s, color .1s; z-index: 1; }
  .db-topbar__menu:hover { background: var(--db-hover); color: var(--db-text); }
  .db-topbar__center { text-align: center; }
  .db-topbar__title { font-size: 14px; font-weight: 600; color: var(--db-text); }
  .db-topbar__sub { font-size: 11px; color: var(--db-text-3); margin-top: 2px; }
  .db-topbar__actions { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); display: flex; gap: 12px; align-items: center; }
  .db-topbar__actions a { color: var(--db-text-3); display: inline-flex; }
  .db-topbar__actions a:hover { color: var(--db-text); }
  .db-topbar__action-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; border: none; background: none; color: var(--db-text-2); cursor: pointer; transition: background .1s, color .1s; padding: 0; }
  .db-topbar__action-btn:hover { background: var(--db-hover); color: var(--db-text); }

  .db-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }

  /* 空态 */
  .db-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 32px; overflow-y: auto; margin-top: -25px; }
  .db-empty__logo { width: 400px; height: 270px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; opacity: .95; overflow: visible; }
  .db-empty__logo canvas { display: block; width: 400px !important; height: 270px !important; }
  .db-empty__title { position: relative; z-index: 1; font-size: 32px; font-weight: 700; color: var(--db-text); margin: 0; letter-spacing: -.02em; margin-top: -20px; line-height: 1.35; padding: 4px 2px; animation: db-fadein .4s ease-out both; }
  .db-empty__sub { position: relative; z-index: 1; font-size: 14px; color: var(--db-text-2); margin: 15px 0 28px; animation: db-fadein .4s ease-out .05s both; }
  .db-empty__globe-wrap { position: relative; width: 100%; display: flex; justify-content: center; margin-bottom: -90px; z-index: 0; pointer-events: none; overflow: visible; animation: db-fadein .45s ease-out both; }
  .db-empty__grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; max-width: 780px; width: 100%; animation: db-fadein .45s ease-out .1s both; }
  @keyframes db-fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
  .db-empty__col { background: #fff; border: 1px solid var(--db-border); border-radius: 14px; padding: 20px; text-align: left; display: flex; flex-direction: column; min-width: 0; }
  .db-empty__col-head { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--db-text); margin-bottom: 14px; }
  .db-empty__col-head .ico { font-size: 18px; }
  .db-empty__list { flex: 1; display: flex; flex-direction: column; justify-content: flex-start; gap: 4px; min-width: 0; }
  .db-empty__topic { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px; cursor: pointer; transition: background .12s; font-size: 13.5px; color: var(--db-text); min-width: 0; overflow: hidden; }
  .db-empty__topic:hover { background: var(--db-hover); }
  .db-empty__topic-num { width: 20px; flex-shrink: 0; color: var(--bg-brand); font-weight: 600; font-size: 13px; }
  .db-empty__topic-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
  .db-empty__cap { display: flex; gap: 12px; padding: 10px; border-radius: 10px; transition: background .12s; cursor: pointer; }
  .db-empty__cap > div:last-child { flex: 1; min-width: 0; }
  .db-empty__cap:hover { background: #fafbfc; }
  .db-empty__cap-ico { flex-shrink: 0; width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: #f1f5f9; color: #475569; }
  .db-empty__cap-title { font-size: 13.5px; font-weight: 600; color: var(--db-text); margin-bottom: 2px; }
  .db-empty__cap-desc { font-size: 12px; color: var(--db-text-2); line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  @media (max-width: 720px) { .db-empty__grid { grid-template-columns: 1fr; } }
  .db-empty__cards { display: none; }
  .db-card { display: none; }

  /* 消息 */
  .db-msg { max-width: 840px; width: 100%; margin: 0 auto; padding: 14px 24px; }
  .db-msg--user { display: flex; justify-content: flex-end; }
  .db-msg__user-bubble { background: var(--db-user-bubble); border-radius: 18px; padding: 10px 16px; font-size: 15px; line-height: 1.6; max-width: 80%; white-space: pre-wrap; word-break: break-word; position: relative; }
  .db-msg--assistant .db-msg__content { font-size: 15px; line-height: 1.8; word-break: break-word; }
.db-msg--assistant .db-msg__content p { margin: 0.5em 0; }
.db-msg--assistant .db-msg__content h1, .db-msg--assistant .db-msg__content h2, .db-msg--assistant .db-msg__content h3, .db-msg--assistant .db-msg__content h4 { margin: 0.8em 0 0.4em; font-weight: 600; line-height: 1.4; }
.db-msg--assistant .db-msg__content h1 { font-size: 1.4em; }
.db-msg--assistant .db-msg__content h2 { font-size: 1.25em; }
.db-msg--assistant .db-msg__content h3 { font-size: 1.1em; }
.db-msg--assistant .db-msg__content h4 { font-size: 1em; }
.db-msg--assistant .db-msg__content ul, .db-msg--assistant .db-msg__content ol { margin: 0.4em 0; padding-left: 1.6em; }
.db-msg--assistant .db-msg__content li { margin: 0.2em 0; line-height: 1.7; }
.db-msg--assistant .db-msg__content strong { font-weight: 600; }
.db-msg--assistant .db-msg__content em { font-style: italic; }
.db-msg--assistant .db-msg__content .math-block { overflow-x: auto; max-width: 100%; }
  .db-msg--assistant pre { background: #f8f9fa; border: 1px solid var(--db-border); border-radius: 8px; padding: 12px 14px; overflow-x: auto; font-family: var(--code-editor-font-family); font-size: 13px; line-height: 1.6; margin: 10px 0; }
  .db-msg--assistant code { font-family: var(--code-editor-font-family); font-size: .9em; background: rgba(0,0,0,.06); padding: 1px 4px; border-radius: 3px; }
  .db-msg--assistant pre code { background: none; padding: 0; }
  .db-msg--assistant blockquote { border-left: 3px solid var(--db-border); margin: 10px 0; padding: 6px 12px; color: var(--db-text-2); }
  .db-msg--assistant table { border-collapse: collapse; width: 100%; margin: 10px 0; }
  .db-msg--assistant th, .db-msg--assistant td { border: 1px solid var(--db-border); padding: 6px 10px; text-align: left; font-size: 13px; }
  .db-msg--assistant th { background: #f8f9fa; font-weight: 600; }
  .db-msg--assistant hr { border: none; border-top: 1px solid var(--db-border); margin: 14px 0; }

/* highlightjs-line-numbers 样式 */
.hljs-ln-numbers { -webkit-user-select: none; user-select: none; text-align: right; color: #999; border-right: 1px solid #ddd; padding-right: 10px; margin-right: 10px; }
.hljs-ln-code { padding-left: 10px; }
pre .hljs-ln { border: none !important; margin: 0 !important; width: auto !important; }
pre .hljs-ln td { border: none !important; padding: 1px 0 !important; vertical-align: top; background: none !important; }

  /* 思考过程 */
  .db-think { margin-bottom: 12px; }
  .db-think__toggle { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--db-text-3); cursor: pointer; background: none; border: none; padding: 0; }
  .db-think__toggle:hover { color: var(--db-text-2); }
  .db-think__toggle svg { transition: transform .15s; flex-shrink: 0; }
  .db-think__toggle.is-open svg { transform: rotate(90deg); }  .db-think__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--bg-brand); animation: dbPulse 1s ease-in-out infinite; flex-shrink: 0; }
  .db-think__content { display: none; margin-top: 10px; padding: 12px 14px; background: #f8f9fa; border-left: 2px solid var(--db-border); border-radius: 0 8px 8px 0; font-size: 13px; line-height: 1.7; color: var(--db-text-2); white-space: pre-wrap; }
  .db-think__content.is-open { display: block; }
  @keyframes dbPulse { 0%,100%{opacity:.35} 50%{opacity:1} }

  /* 流式输出：最新到达的字符逐个由浅入深（拖尾渐变） */
  @keyframes dbFadeChar { from { opacity: .25; color: #9ca3af; } to { opacity: 1; } }
  .db-fade-char { animation: dbFadeChar .6s ease-out both; }
  /* token 流式输出时在末尾追加细光标；Working 占位阶段隐藏 */
  .db-msg--assistant.is-streaming > .db-msg__body > .db-msg__content::after,
  .db-msg--assistant.is-streaming > .db-msg__body > .db-msg__timeline::after {
    content: ''; display: inline-block; width: 1.5px; height: 1.1em; background: var(--bg-brand); margin-left: 2px; vertical-align: text-bottom; animation: dbBlink 1s steps(2) infinite;
  }
  .db-msg--assistant.is-streaming > .db-msg__body > .db-msg__content:has(.db-working)::after,
  .db-msg--assistant.is-streaming > .db-msg__body > .db-msg__timeline:has(.db-working)::after {
    content: none;
  }

  /* Working... 等待动画（收到首个 token 前显示） */
  .db-working { display: inline-flex; align-items: center; gap: 10px; color: #1a1a1a; font-size: 15px; line-height: 1.5; padding: 4px 0; user-select: none; }
  .db-working__icon { flex-shrink: 0; width: 22px; height: 22px; color: var(--bg-brand); animation: dbWorkingBreath 1.6s ease-in-out infinite; filter: drop-shadow(0 0 4px rgba(83,104,255,.25)); }
  @keyframes dbWorkingBreath {
    0%, 100% { transform: scale(.85); opacity: .55; }
    50% { transform: scale(1.12); opacity: 1; }
  }
  .db-working__text { position: relative; min-width: 80px; font-weight: 600; letter-spacing: .3px; color: #1a1a1a; }
  .db-working__text::after { content: '...'; }
  .db-working__dots { display: inline-flex; gap: 2px; margin-left: 2px; vertical-align: baseline; }
  .db-working__dots i { display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: var(--bg-brand); animation: dbWorkingDot 1.2s ease-in-out infinite; font-style: normal; }
  .db-working__dots i:nth-child(2){ animation-delay: .15s }
  .db-working__dots i:nth-child(3){ animation-delay: .3s }
  @keyframes dbWorkingDot { 0%,60%,100%{opacity:.25;transform:translateY(0)} 30%{opacity:1;transform:translateY(-2px)} }

  /* 加载 */
  .db-typing { display: inline-flex; gap: 4px; align-items: center; }
  .db-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--db-text-3); animation: dbBlink 1.2s ease-in-out infinite; }
  .db-typing span:nth-child(2){animation-delay:.2s} .db-typing span:nth-child(3){animation-delay:.4s}
  @keyframes dbBlink { 0%,60%,100%{opacity:.3} 30%{opacity:1} }
  @keyframes dbSpin { to { transform: rotate(360deg); } }
  .db-rot { animation: dbSpin 1s linear infinite; transform-origin: center; display: inline-block; }

  /* 引用分片 */
  .db-chunks { margin-top: 12px; }
  .db-chunks__toggle { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--db-text-3); cursor: pointer; background: none; border: none; padding: 0; }
  .db-chunks__toggle:hover { color: var(--db-text-2); }
  .db-chunks__toggle svg { transition: transform .15s; transform: rotate(-90deg); flex-shrink: 0; }
  .db-chunks__toggle.is-open svg { transform: rotate(0deg); }
  .db-chunks__list { display: none; margin-top: 10px; flex-direction: column; gap: 8px; }
  .db-chunks__list.is-open { display: flex; }
  .db-tool-args-toggle { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--db-text-3); cursor: pointer; background: none; border: none; padding: 0; font-family: inherit; }
  .db-tool-args-toggle:hover { color: var(--db-text-2); }
  .db-tool-args-toggle svg { width: 10px; height: 10px; transition: transform .15s; opacity: .6; }
  .db-tool-args-toggle.is-open svg { transform: rotate(90deg); }
  .db-tool-args-body { display: none; margin-top: 6px; }
  .db-tool-args-body.is-open { display: block; }
  .db-tool-result-toggle { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--db-text-3); cursor: pointer; background: none; border: none; padding: 0; font-family: inherit; margin-top: 10px; }
  .db-tool-result-toggle:hover { color: var(--db-text-2); }
  .db-tool-result-toggle svg { width: 10px; height: 10px; transition: transform .15s; opacity: .6; }
  .db-tool-result-toggle.is-open svg { transform: rotate(90deg); }
  .db-tool-result-body { display: none; }
  .db-tool-result-body.is-open { display: block; }
  .db-chunk { background: #fff; border: 1px solid var(--db-border); border-radius: 10px; padding: 0; overflow: hidden; flex-shrink: 0; transition: box-shadow .15s, border-color .15s; }
  .db-chunk:hover { box-shadow: 0 2px 8px rgba(0,0,0,.06); border-color: var(--bg-brand-light, rgba(83,104,255,.3)); }
  /* 工具卡片：头部可点击折叠/展开 */
  .db-tool-card .db-chunk__head { cursor: pointer; user-select: none; transition: background .15s; }
  .db-tool-card .db-chunk__head:hover { background: #f3f4ff; }
  .db-tool-card__chevron { margin-left: auto; width: 14px; height: 14px; color: var(--db-text-3); transition: transform .2s; flex-shrink: 0; }
  .db-tool-card.is-open .db-tool-card__chevron { transform: rotate(90deg); }
  .db-tool-card__body { display: none; }
  .db-tool-card.is-open .db-tool-card__body { display: block; }

  /* 工具调用 */
  .db-tools { margin-bottom: 10px; display: flex; flex-direction: row; gap: 6px; flex-wrap: wrap; align-items: center; }
  .db-tools__toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #5368ff; cursor: pointer; background: rgba(83,104,255,.08); border: none; padding: 5px 12px; border-radius: 999px; font-family: inherit; transition: background .15s; max-width: min(280px, 100%); min-width: 0; }
  .db-tools__toggle > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .db-tools__toggle svg { width: 13px; height: 13px; opacity: .9; flex-shrink: 0; display: inline-block; }
  .db-tools__toggle:hover { background: rgba(83,104,255,.15); }
  .db-tools__toggle.is-running { background: rgba(83,104,255,.14); }
  .db-tools__seq { background: rgba(83,104,255,.2); color: #5368ff; padding: 0 6px; border-radius: 999px; font-size: 10px; font-weight: 600; min-width: 18px; text-align: center; line-height: 16px; display: inline-block; font-family: 'JetBrains Mono', Consolas, monospace; }
  /* timeline：文本段 + 工具 chip 垂直堆叠，每段之间留间距形成时间线感 */
  .db-msg__timeline { display: flex; flex-direction: column; gap: 8px; }
  .db-msg__timeline .db-tools { margin-bottom: 0; }
  .db-seg-text { line-height: 1.7; color: var(--db-text); }
  .db-seg-text p { margin: 0 0 0.6em; }
  .db-seg-text p:last-child { margin-bottom: 0; }
  /* 流式增量渲染容器：稳定区 + 尾部区垂直堆叠，接缝处不出现双倍段距 */
  .db-seg-stable, .db-seg-tail { display: block; }
  .db-seg-stable > :last-child { margin-bottom: 0; }
  .db-seg-tail > :first-child { margin-top: 0; }
  .db-tools__count { background: rgba(83,104,255,.2); color: #5368ff; padding: 0 7px; border-radius: 999px; font-size: 11px; font-weight: 600; min-width: 20px; text-align: center; line-height: 18px; display: inline-block; }
  .db-tools__count { color: var(--db-text-3); font-size: 11px; margin-left: 2px; }
  .db-tools__body { display: none; margin-top: 6px; flex-direction: column; gap: 6px; }
  .db-tools__body.is-open { display: flex; }
  .db-tools__item { background: #f9fafb; border: 1px solid var(--db-border); border-radius: 8px; padding: 8px 10px; font-size: 12px; }
  .db-tools__item.is-running { background: #eef2ff; border-color: #c7d2fe; }
  .db-tools__head { display: flex; align-items: center; gap: 8px; color: var(--db-text-2); }
  .db-tools__spinner { width: 12px; height: 12px; border: 2px solid #c7d2fe; border-top-color: #5368ff; border-radius: 50%; animation: db-spin .8s linear infinite; flex-shrink: 0; }
  .db-tools__ok { color: #10b981; font-weight: 600; flex-shrink: 0; font-size: 12px; }
  .db-tools__name { color: var(--db-text); font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
  .db-tools__name svg { width: 12px; height: 12px; opacity: .55; }
  .db-tools__detail { color: var(--db-text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
  .db-tools__detail code { font-family: 'JetBrains Mono', Consolas, monospace; font-size: 11px; background: #fff; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--db-border); }
  .db-tools__result { margin: 6px 0 0; padding: 8px 10px; background: #fff; border: 1px solid var(--db-border); border-radius: 6px; font-family: 'JetBrains Mono', Consolas, monospace; font-size: 11px; color: var(--db-text-2); white-space: pre-wrap; word-break: break-all; max-height: 240px; overflow: auto; line-height: 1.6; }

  /* 生成的文件卡片 */
  .db-outfiles { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
  .db-outfile { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #f0f4ff; border: 1px solid #dde5ff; border-radius: 10px; max-width: 320px; min-width: 220px; transition: all .12s; text-decoration: none; color: inherit; }
  .db-outfile:hover { background: #e6edff; border-color: #b8c8ff; }
  .db-outfile__icon { width: 36px; height: 36px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; font-weight: 700; flex-shrink: 0; letter-spacing: .3px; }
  .db-outfile__icon.ext-pdf { background: #ef4444; }
  .db-outfile__icon.ext-docx, .db-outfile__icon.ext-doc { background: #2563eb; }
  .db-outfile__icon.ext-xlsx, .db-outfile__icon.ext-xls, .db-outfile__icon.ext-csv { background: #16a34a; }
  .db-outfile__icon.ext-pptx, .db-outfile__icon.ext-ppt { background: #ea580c; }
  .db-outfile__icon.ext-py { background: #3776ab; }
  .db-outfile__icon.ext-js, .db-outfile__icon.ext-ts { background: #f7df1e; color: #000; }
  .db-outfile__icon.ext-html { background: #e34c26; }
  .db-outfile__icon.ext-json { background: #6b7280; }
  .db-outfile__icon.ext-txt, .db-outfile__icon.ext-md { background: #6b7280; }
  .db-outfile__icon.ext-png, .db-outfile__icon.ext-jpg, .db-outfile__icon.ext-jpeg, .db-outfile__icon.ext-gif, .db-outfile__icon.ext-webp { background: #8b5cf6; }
  .db-outfile__main { min-width: 0; flex: 1; }
  .db-outfile__name { font-size: 13px; font-weight: 500; color: var(--db-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .db-outfile__meta { font-size: 11px; color: var(--db-text-3); margin-top: 2px; }
  .db-outfile__dl { flex-shrink: 0; width: 24px; height: 24px; border-radius: 6px; background: #fff; border: 1px solid #dde5ff; display: flex; align-items: center; justify-content: center; color: #5368ff; }
  .db-outfile__dl:hover { background: #5368ff; color: #fff; border-color: #5368ff; }
  /* 图片类型卡片 */
  .db-outfile--img { display: block; padding: 8px; width: 100%; max-width: 420px; }
  .db-outfile__img-wrap { position: relative; border-radius: 8px; overflow: hidden; background: #f3f4f6; cursor: zoom-in; }
  .db-outfile__img { width: 100%; max-height: 240px; object-fit: contain; display: block; }
  .db-outfile__img-bar { display: flex; align-items: center; gap: 8px; padding: 8px 4px 2px; }
  .db-outfile__img-bar .db-outfile__name { flex: 1; font-size: 12px; }
  .db-outfile__dl { flex-shrink: 0; width: 24px; height: 24px; border-radius: 6px; background: #fff; border: 1px solid #dde5ff; display: flex; align-items: center; justify-content: center; color: #5368ff; cursor: pointer; text-decoration: none; }

  /* 图片灯箱（全屏放大） */
  .db-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 99999; display: none; align-items: center; justify-content: center; padding: 30px; cursor: zoom-out; }
  .db-lightbox.is-open { display: flex; }
  .db-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
  .db-lightbox__close { position: absolute; top: 20px; right: 24px; width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.15); color: #fff; border: none; font-size: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center; line-height: 1; }
  .db-lightbox__close:hover { background: rgba(255,255,255,.3); }
  .db-lightbox__download { position: absolute; top: 20px; right: 70px; padding: 8px 14px; border-radius: 8px; background: rgba(255,255,255,.15); color: #fff; border: none; font-size: 13px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
  .db-lightbox__download:hover { background: rgba(255,255,255,.3); }
  .db-chunk__head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--db-border); background: #fafbfc; }
  .db-chunk__idx { flex-shrink: 0; width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; border-radius: 5px; background: rgba(83,104,255,.1); color: var(--bg-brand); font-size: 11px; font-weight: 600; font-family: var(--code-editor-font-family); }
  .db-chunk__meta { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; }
  .db-chunk__site-icon { flex-shrink: 0; width: 14px; height: 14px; border-radius: 3px; object-fit: contain; background: #fff; }
  .db-chunk__site-name { font-size: 11px; color: var(--db-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .db-chunk__date { font-size: 11px; color: var(--db-text-3); flex-shrink: 0; font-family: var(--code-editor-font-family); }
  .db-chunk__score { color: var(--db-text-3); font-family: var(--code-editor-font-family); font-size: 11px; flex-shrink: 0; }
  .db-chunk__title { display: block; padding: 10px 12px 6px; font-size: 13px; font-weight: 600; line-height: 1.45; color: var(--bg-brand); text-decoration: none; word-break: break-word; }
  .db-chunk__title:hover { text-decoration: underline; }
  .db-chunk__content { font-size: 12.5px; line-height: 1.65; color: var(--db-text); padding: 0 12px 10px; word-break: break-word; }
  .db-chunk__url { display: block; padding: 8px 12px; border-top: 1px solid var(--db-border); font-size: 11px; color: var(--db-text-3); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: #fafbfc; transition: color .1s, background .1s; }
  .db-chunk__url:hover { color: var(--bg-brand); background: rgba(83,104,255,.04); }
  /* RAG 知识库片段样式（无 siteName/url 的老格式） */
  .db-chunk--kb .db-chunk__head { background: transparent; border-bottom: none; padding: 8px 12px 4px; }
  .db-chunk--kb .db-chunk__title { display: none; }
  .db-chunk--kb .db-chunk__content { padding: 4px 12px 10px; }
  .db-chunk--kb .db-chunk__url { display: none; }
  /* 图片卡片 */
  .db-chunk--image { background: #fff; }
  .db-chunk--image .db-chunk__head { padding: 8px 10px; }
  .db-chunk__img-wrap { display: block; padding: 8px; background: #f5f6f8; text-align: center; }
  .db-chunk__img { max-width: 100%; max-height: 200px; border-radius: 6px; display: inline-block; object-fit: contain; cursor: zoom-in; transition: transform .15s; }
  .db-chunk__img:hover { transform: scale(1.02); }

  /* 输入框 */
  .db-input { flex-shrink: 0; padding: 12px 24px 16px; background: var(--db-bg); }
  .db-input__inner { max-width: 840px; margin: 0 auto; }
  .db-input__box { background: var(--db-bg); border: 1px solid var(--db-border); border-radius: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.04); transition: border-color .15s, box-shadow .15s; }
  .db-input__box:focus-within { border-color: #d0d0d0; box-shadow: 0 2px 12px rgba(0,0,0,.08); }
  .db-input__text { display: block; width: 100%; border: none; background: transparent; padding: 14px 16px 4px; font-size: 15px; color: var(--db-text); resize: none; max-height: 140px; outline: none; font-family: inherit; line-height: 1.5; }
  .db-input__text::placeholder { color: var(--db-text-3); }
  .db-input__bar { display: flex; align-items: center; gap: 4px; padding: 8px 12px; }
  .db-input__kb { flex-shrink: 0; padding: 5px 10px; border: 1px solid var(--db-border); border-radius: 8px; font-size: 12px; background: var(--db-bg); color: var(--db-text-2); cursor: pointer; }
  .db-input__kb:focus { outline: none; border-color: #d0d0d0; }
  .db-input__kb-btn { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border: none; border-radius: 6px; font-size: 12px; font-family: var(--body-base-font-family), "Microsoft YaHei", "PingFang SC", -apple-system, sans-serif; background: transparent; color: var(--db-text-2); cursor: pointer; transition: color .12s, background .12s; }
  .db-input__kb-btn:hover { color: var(--db-text); background: var(--db-hover); }
  .db-input__kb-btn.is-active { color: var(--bg-brand); background: transparent; }

  .db-input__kb-count { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--bg-brand); color: #fff; font-size: 11px; line-height: 16px; text-align: center; }
  .db-input__sep { display: inline-flex; align-items: center; font-size: 14px; color: var(--db-border); user-select: none; padding: 0 2px; }
  .db-ctx-ring { position: relative; width: 20px; height: 20px; flex-shrink: 0; cursor: help; }
  .db-ctx-ring svg { transform: rotate(-90deg); width: 100%; height: 100%; display: block; }
  .db-ctx-ring__track { fill: none; stroke: var(--db-hover, #eef0f4); stroke-width: 3; }
  .db-ctx-ring__fill { fill: none; stroke-width: 3; stroke-linecap: round; transition: stroke-dashoffset .3s, stroke .3s; }
  .db-ctx-ring.is-warn .db-ctx-ring__fill { stroke: #f59e0b; }
  .db-ctx-ring.is-danger .db-ctx-ring__fill { stroke: #ef4444; }
  .db-ctx-ring__tip { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); background: #1f2937; color: #fff; font-size: 12px; padding: 6px 10px; border-radius: 6px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .15s; z-index: 100; line-height: 1.5; }
  .db-ctx-ring__tip::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 5px solid transparent; border-top-color: #1f2937; }
  .db-ctx-ring:hover .db-ctx-ring__tip { opacity: 1; }
  .db-input__send { flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; border: none; background: #5368ff; color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background .12s, opacity .12s; margin-left: auto; }
  .db-input__send:hover:not(:disabled) { background: #4458e8; }
  .db-input__send:disabled { opacity: .4; cursor: not-allowed; background: #e0e0e0; color: #6b7280; }
  .db-input__send.is-generating {
    background: #fff;
    color: #5368ff;
    border: none;
    position: relative;
    padding: 0;
  }
  .db-input__send.is-generating::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(83,104,255,.18);
    border-top-color: #5368ff;
    animation: sendSpin .9s linear infinite;
  }
  .db-input__send.is-generating svg { position: relative; z-index: 1; }
  .db-input__send.is-generating:hover { background: #fff; }
  @keyframes sendSpin { to { transform: rotate(360deg); } }

  /* 附件预览区 */
  .db-input__attachments { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px 0; max-height: 260px; overflow-y: auto; align-content: flex-start; }
  .db-input__attachments.Empty { display: none; }
  .db-att { position: relative; display: flex; align-items: flex-start; gap: 8px; padding: 8px 28px 8px 8px; background: var(--db-hover); border-radius: 10px; max-width: 340px; font-size: 12px; color: var(--db-text-2); line-height: 1.4; }
  .db-att--img { padding: 4px; }
  .db-att__thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; flex-shrink: 0; background: #ddd; }
  .db-att__icon { width: 36px; height: 36px; border-radius: 6px; background: #5368ff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; -webkit-mask: url('/trae-work/assets/icons/DocFile.svg') center / 20px 20px no-repeat; mask: url('/trae-work/assets/icons/DocFile.svg') center / 20px 20px no-repeat; }
  .db-att__icon.ext-pdf { background: #ef4444; }
  .db-att__icon.ext-docx, .db-att__icon.ext-doc { background: #2563eb; }
  .db-att__icon.ext-xlsx, .db-att__icon.ext-xls { background: #16a34a; }
  .db-att__icon.ext-pptx, .db-att__icon.ext-ppt { background: #ea580c; }
  .db-att__icon.ext-txt, .db-att__icon.ext-md { background: #6b7280; }
  .db-att__icon.ext-png, .db-att__icon.ext-jpg, .db-att__icon.ext-jpeg, .db-att__icon.ext-gif, .db-att__icon.ext-webp, .db-att__icon.ext-bmp { background: #8b5cf6; }
  .db-att__main { min-width: 0; }
  .db-att__name { font-size: 12px; color: var(--db-text); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
  .db-att__meta { font-size: 11px; color: var(--db-text-3); margin-top: 2px; display: flex; align-items: center; gap: 6px; }
  .db-att__status { display: inline-flex; align-items: center; gap: 4px; }
  .db-att__status.is-parsing { color: #5368ff; }
  .db-att__status.is-failed { color: #ef4444; }
.redact-picker-row { display:flex; width:100%; text-align:left; align-items:center; gap:10px; padding:9px 12px; border:0; background:transparent; border-radius:8px; cursor:pointer; font:13px/18px var(--body-base-font-family); color:var(--db-text,#1f2329); }
  .redact-picker-row:hover { background:var(--db-hover,#f5f6f8); }
  .redact-picker-row.is-selected { background:rgba(83,104,255,.08); }
  .redact-picker-row input { accent-color:#5368ff; margin:0; }
  .redact-picker-row__name { flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .redact-picker-row__pv { flex:0 0 auto; width:26px; height:26px; display:inline-flex; align-items:center; justify-content:center; border-radius:6px; color:var(--db-text-3,#8a8f99); opacity:0; transition:opacity .15s, background .15s; }
  .redact-picker-row:hover .redact-picker-row__pv { opacity:1; }
  .redact-picker-row__pv:hover { background:var(--db-hover,#f0f2f5); color:var(--db-text-2,#4b5563); }
  .redact-picker-row__time { flex:0 0 auto; color:var(--db-text-3,#8a8f99); font-size:12px; }
  .db-att__badge-redacted { display:inline-block; margin-left:6px; padding:1px 6px; border-radius:4px; background:rgba(0,180,66,.1); color:#00b42a; font-size:11px; line-height:16px; }
  .db-att__status.is-ready { color: #10b981; }
  .db-att__spinner { width: 10px; height: 10px; border: 2px solid #e0e7ff; border-top-color: #5368ff; border-radius: 50%; animation: db-spin .8s linear infinite; }
  @keyframes db-spin { to { transform: rotate(360deg); } }
  .db-att__chips { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
  .db-att__chip { padding: 3px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--db-border); font-size: 11px; color: var(--db-text-2); cursor: pointer; white-space: nowrap; transition: all .12s; }
  .db-att__chip:hover { border-color: #5368ff; color: #5368ff; background: rgba(83,104,255,.06); }
  .db-att__del { position: absolute; top: -4px; right: -4px; width: 18px; height: 18px; border-radius: 50%; background: #6b7280; color: #fff; border: 2px solid var(--db-bg); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 12px; line-height: 1; }
  .db-att__del:hover { background: #ef4444; }

  .db-input__hint { text-align: center; font-size: 11px; color: var(--db-text-3); margin-top: 10px; }
  .db-input__quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; padding: 0 2px; }
  .db-input__quick:empty { display: none; }
  .db-quick-chip { padding: 4px 12px; border-radius: 999px; background: var(--db-hover); border: 1px solid var(--db-border); font-size: 12px; color: var(--db-text-2); cursor: pointer; white-space: nowrap; transition: all .12s; font-family: inherit; }
  .db-quick-chip:hover { border-color: var(--bg-brand, #5368ff); color: var(--bg-brand, #5368ff); background: rgba(83,104,255,.06); }

  /* 已激活技能徽章 */
  .db-skill-active { display: none !important; }
  .db-skill-active__icon { font-size: 18px; line-height: 1; }
  .db-skill-active__name { font-weight: 600; color: var(--bg-brand); }
  .db-skill-active__desc { color: var(--db-text-2); font-size: 12px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .db-skill-active__close { width: 22px; height: 22px; border: none; background: transparent; color: var(--db-text-3); border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; line-height: 1; transition: all .12s; flex-shrink: 0; }
  .db-skill-active__close:hover { background: rgba(83,104,255,.15); color: var(--bg-brand); }

  /* 知识库选择弹窗 */
  .db-picker-mask { position: absolute; inset: 0; background: rgba(0,0,0,.15); z-index: 1000; display: none; border-radius: 0; }
  .db-picker-mask.is-open { display: block; }
  .db-picker { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 480px; max-width: 94%; max-height: 70vh; background: var(--db-bg); border-radius: 16px; box-shadow: 0 12px 48px rgba(0,0,0,.18); z-index: 1001; display: none; flex-direction: column; overflow: hidden; opacity: 0; transition: opacity .15s; }
  .db-picker.is-open { display: flex; opacity: 1; }
  .db-picker__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--db-border); }
  .db-picker__title { font-size: 14px; font-weight: 600; color: var(--db-text); }
  .db-picker__close { background: none; border: none; font-size: 22px; color: var(--db-text-3); cursor: pointer; line-height: 1; padding: 0 4px; }
  .db-picker__close:hover { color: var(--db-text); }
  .db-picker__body { flex: 1; overflow-y: auto; padding: 8px; }
  .db-picker__item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; cursor: pointer; transition: background .1s; }
  .db-picker__item:hover { background: var(--db-hover); }
  .db-picker__check { width: 18px; height: 18px; border-radius: 4px; border: 1.5px solid var(--db-border); flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: background .12s, border-color .12s; }
  .db-picker__item.is-checked .db-picker__check { background: var(--bg-brand); border-color: var(--bg-brand); }
  .db-picker__check svg { display: none; color: #fff; }
  .db-picker__item.is-checked .db-picker__check svg { display: block; }
  .db-picker__item-info { flex: 1; min-width: 0; }
  .db-picker__item-name { font-size: 14px; color: var(--db-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .db-picker__item-meta { font-size: 12px; color: var(--db-text-3); margin-top: 2px; }
  .db-picker__foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-top: 1px solid var(--db-border); }
  .db-picker__tip { font-size: 12px; color: var(--db-text-3); }
  .db-btn-primary { padding: 6px 16px; border-radius: 8px; border: none; background: var(--bg-brand); color: #fff; font-size: 13px; cursor: pointer; }
  .db-btn-primary:hover { background: var(--bg-brand-hover, #4250e0); }
  .db-picker__empty { padding: 24px; text-align: center; font-size: 13px; color: var(--db-text-3); }

/* 历史对话菜单 */
.db-chat-menu { position: fixed; background: var(--db-bg); border: 1px solid var(--db-border); border-radius: 10px; box-shadow: 0 4px 20px rgba(0,0,0,.14); padding: 4px; z-index: 3001; display: none; min-width: 130px; white-space: nowrap; }
.db-chat-menu.is-open { display: block; }
.db-chat-menu__item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 6px; font-size: 13px; color: var(--db-text); cursor: pointer; background: none; border: none; width: 100%; text-align: left; }
.db-chat-menu__item:hover { background: var(--db-hover); }
.db-chat-menu__item--danger { color: #e53e3e; }

/* 模型选择菜单 — 独立样式，与 chat-menu 区分 */
.db-model-menu { position: fixed; background: var(--db-bg); border: 1px solid var(--db-border); border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.14); padding: 6px; z-index: 9999; display: none; min-width: 140px; }
.db-model-menu.is-open { display: block; }
/* 工作空间选择器（输入框工具栏弹出，向上展开） */
.db-ws-picker { position: fixed; background: var(--db-bg); border: 1px solid var(--db-border); border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.14); padding: 6px; z-index: 9999; width: 320px; }
.db-ws-picker__list { max-height: 260px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.db-ws-picker__item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; font-size: 13px; color: var(--db-text); cursor: pointer; transition: background .1s; min-width: 0; }
.db-ws-picker__item:hover { background: var(--db-hover); }
.db-ws-picker__item.is-active { background: color-mix(in srgb, var(--bg-brand) 10%, transparent); }
.db-ws-picker__ico { display: inline-flex; color: var(--db-text-3); flex-shrink: 0; }
.db-ws-picker__item.is-active .db-ws-picker__ico { color: var(--bg-brand); }
.db-ws-picker__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-ws-picker__count { flex-shrink: 0; font-size: 11px; color: var(--db-text-3); background: var(--db-hover); border-radius: 999px; padding: 1px 7px; }
.db-ws-picker__acts { display: none; flex-shrink: 0; gap: 2px; }
.db-ws-picker__item:hover .db-ws-picker__acts { display: inline-flex; }
.db-ws-picker__item:hover .db-ws-picker__count { display: none; }
.db-ws-picker__acts button { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: none; background: none; border-radius: 6px; color: var(--db-text-3); cursor: pointer; }
.db-ws-picker__acts button:hover { background: var(--db-hover); color: var(--db-text); }
.db-ws-picker__empty { padding: 12px 10px; font-size: 12px; color: var(--db-text-3); text-align: center; }
.db-ws-picker__new { display: flex; gap: 6px; border-top: 1px solid var(--db-border); margin-top: 6px; padding: 8px 4px 2px; }
.db-ws-picker__new-input { flex: 1; min-width: 0; border: 1px solid var(--db-border); border-radius: 8px; padding: 7px 10px; font-size: 13px; font-family: inherit; outline: none; background: var(--bg-overlay-l1, #fff); color: var(--db-text); }
.db-ws-picker__new-input:focus { border-color: var(--bg-brand); }
.db-ws-picker__new-btn { border: none; background: var(--bg-brand); color: #fff; border-radius: 8px; padding: 0 14px; font-size: 13px; cursor: pointer; font-family: inherit; flex-shrink: 0; }
.db-model-menu__item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; font-size: 13px; font-family: var(--body-base-font-family), "Microsoft YaHei", "PingFang SC", -apple-system, sans-serif; color: var(--db-text); cursor: pointer; background: none; border: none; width: 100%; text-align: left; transition: background .1s; }
.db-model-menu__item:hover { background: var(--db-hover); }
.db-model-menu__item.is-active { background: rgba(83,104,255,.08); color: var(--bg-brand); font-weight: 500; }

/* 分割线 */
.db-input__sep { display: inline-flex; align-items: center; font-size: 14px; color: var(--db-border); user-select: none; padding: 0 2px; }

  /* AI 消息底部操作栏 */
  .db-msg__actions { display: flex; align-items: center; gap: 16px; margin-top: 12px; padding-top: 4px; flex-wrap: wrap; }
  /* 猜你想问（纵向排列） */
  .db-suggest { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--db-border); }
  .db-suggest__chip {
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    border: 1px solid var(--db-border); background: #fff; color: var(--db-text-2);
    border-radius: 14px; padding: 6px 14px; font-size: 13px; font-family: inherit;
    cursor: pointer; transition: border-color .12s, color .12s, background .12s;
  }
  .db-suggest__chip:hover { border-color: var(--db-brand, #5368ff); color: var(--db-brand, #5368ff); background: rgba(83,104,255,.04); }
  .db-msg__action { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--db-text-3); cursor: pointer; background: none; border: none; padding: 2px 0; transition: color .12s; }
  .db-msg__action:hover { color: var(--db-text); }
  .db-msg__stat { font-size: 11px; color: var(--db-text-3, #9ca3af); display: inline-flex; align-items: center; gap: 3px; }
  .db-msg__stat svg { opacity: .6; }
  .db-msg__time { font-size: 11px; color: var(--db-text-3); margin-left: auto; }
.db-msg__edit-btn { display: none; align-items: center; justify-content: center; margin-left: 6px; vertical-align: middle; background: none; border: none; color: var(--db-text-3); cursor: pointer; padding: 2px; border-radius: 4px; }
.db-msg__edit-btn:hover { background: rgba(0,0,0,.08); color: var(--db-text); }
.db-msg__user-bubble { position: relative; }

/* 右侧分片信息面板 */
.db-chunk-panel { position: relative; flex-shrink: 0; width: 0; background: var(--db-bg); border-left: 1px solid var(--db-border); display: flex; flex-direction: column; overflow: hidden; transition: width .25s ease; }
.db-chunk-panel.is-open { transition: width .25s ease; }
.db-chunk-panel.is-open.w-1-3 { width: 33.333%; max-width: 520px; min-width: 320px; }
.db-chunk-panel.is-open.w-1-2 { width: 50%; min-width: 420px; }
.db-chunk-panel.is-open.w-2-3 { width: 66.666%; min-width: 520px; }
/* kind-specific body 背景（旧 is-term/is-pty 兼容；多页签下由 data-kind 驱动） */
.db-chunk-panel[data-kind="ssh"] .db-chunk-panel__body { padding: 0; display: flex; flex-direction: column; background: #fff; }
.db-chunk-panel[data-kind="pty"] .db-chunk-panel__body { padding: 0; display: flex; flex-direction: column; background: #1e1e1e; }
.db-chunk-panel[data-kind="browser"] .db-chunk-panel__body { padding: 0; display: flex; flex-direction: column; background: #1e1e1e; }
.db-chunk-panel[data-kind="html"] .db-chunk-panel__body,
.db-chunk-panel[data-kind="md"] .db-chunk-panel__body,
.db-chunk-panel[data-kind="pdf"] .db-chunk-panel__body { padding: 0; display: flex; flex-direction: column; }
/* 兼容旧 class（保留一段时间） */
.db-chunk-panel.is-open.is-html { width: 50%; min-width: 480px; }
.db-chunk-panel.is-open.is-html .db-chunk-panel__body { padding: 0; display: flex; flex-direction: column; }

/* Markdown 预览内容样式 */
.db-md-preview {
  line-height: 1.75; color: #1f2937; font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  max-width: 100%; word-wrap: break-word;
}
.db-md-preview > *:first-child { margin-top: 0; }
.db-md-preview h1 { font-size: 26px; font-weight: 700; margin: 32px 0 18px; padding-bottom: 10px;
  border-bottom: 2px solid #e5e7eb; color: #111827; letter-spacing: -0.01em; }
.db-md-preview h2 { font-size: 21px; font-weight: 700; margin: 28px 0 14px; padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb; color: #111827; position: relative; padding-left: 12px; }
.db-md-preview h2::before { content:''; position:absolute; left:0; top:4px; bottom:6px; width:4px;
  border-radius:2px; background: linear-gradient(180deg, #5368ff, #818cf8); }
.db-md-preview h3 { font-size: 17px; font-weight: 600; margin: 22px 0 10px; color: #1f2937; }
.db-md-preview h4 { font-size: 15px; font-weight: 600; margin: 16px 0 8px; color: #374151; }
.db-md-preview p { margin: 0 0 14px; }
.db-md-preview ul, .db-md-preview ol { padding-left: 24px; margin: 0 0 14px; }
.db-md-preview li { margin: 5px 0; }
.db-md-preview li > input[type=checkbox] { margin-right: 6px; transform: translateY(1px); }
.db-md-preview ul li::marker { color: #9ca3af; }
.db-md-preview ol li::marker { color: #5368ff; font-weight: 600; }
.db-md-preview blockquote { border-left: 4px solid #818cf8; padding: 10px 16px; margin: 0 0 14px;
  color: #4b5563; background: linear-gradient(90deg, rgba(99,102,241,.08), rgba(99,102,241,.02));
  border-radius: 0 8px 8px 0; }
.db-md-preview blockquote p { margin: 0; }
.db-md-preview code { background: #f3f4f6; padding: 2px 7px; border-radius: 5px;
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace; font-size: 12.8px; color: #db2777;
  border: 1px solid #e5e7eb; }
.db-md-preview pre { background: #1e293b; padding: 16px 18px; border-radius: 10px; overflow-x: auto;
  margin: 0 0 16px; box-shadow: 0 2px 8px rgba(0,0,0,.08); position: relative; }
.db-md-preview pre::before { content: attr(data-lang); position: absolute; top: 6px; right: 12px;
  font-size: 10px; color: #94a3b8; text-transform: uppercase; letter-spacing: .05em; }
.db-md-preview pre code { background: transparent; padding: 0; color: #e2e8f0; border: none; font-size: 13px; }
.db-md-preview pre .pre-lang { position: absolute; top: 8px; right: 12px; font-size: 10.5px;
  color: #94a3b8; text-transform: uppercase; letter-spacing: .06em; font-family: inherit;
  background: rgba(255,255,255,.06); padding: 2px 8px; border-radius: 4px; pointer-events: none; }
.db-md-preview table { border-collapse: separate; border-spacing: 0; margin: 0 0 16px;
  font-size: 13px; width: 100%; border-radius: 10px; overflow: hidden;
  border: 1px solid #e5e7eb; box-shadow: 0 1px 3px rgba(0,0,0,.03); }
.db-md-preview th, .db-md-preview td { padding: 9px 14px; text-align: left; border-bottom: 1px solid #f1f5f9; }
.db-md-preview th { background: linear-gradient(180deg, #f8fafc, #f1f5f9); font-weight: 600;
  color: #334155; border-bottom: 1px solid #e5e7eb; }
.db-md-preview tbody tr:nth-child(even) td { background: #fafbfc; }
.db-md-preview tbody tr:hover td { background: #eef2ff; }
.db-md-preview tbody tr:last-child td { border-bottom: none; }
.db-md-preview hr { border: none; border-top: 1px dashed #d1d5db; margin: 24px 0; position: relative; }
.db-md-preview hr::before { content: '✦'; position: absolute; left: 50%; top: -9px;
  transform: translateX(-50%); background: #fff; padding: 0 8px; color: #c7d2fe; font-size: 12px; }
.db-md-preview a { color: #5368ff; text-decoration: none; border-bottom: 1px solid rgba(83,104,255,.25);
  transition: all .15s; }
.db-md-preview a:hover { color: #4338ca; border-bottom-color: #4338ca; }
.db-md-preview strong { font-weight: 700; color: #111827; }
.db-md-preview em { color: #4b5563; }
.db-md-preview del { color: #9ca3af; }
.db-md-preview kbd { display: inline-block; padding: 2px 7px; font-size: 11.5px;
  font-family: "JetBrains Mono", Consolas, monospace; color: #374151;
  background: linear-gradient(180deg, #fff, #f3f4f6); border: 1px solid #d1d5db;
  border-bottom-width: 2px; border-radius: 5px; box-shadow: 0 1px 0 rgba(0,0,0,.05); }
.db-md-preview img { max-width: 100%; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.06);
  display: block; margin: 10px 0; }
.db-md-preview .math-block { margin: 14px 0; text-align: center; overflow-x: auto; padding: 6px 0; }
.db-md-preview .math-inline { color: #4338ca; font-style: italic; }
.db-md-preview .task-list-item { list-style: none; margin-left: -20px; }
.db-md-preview details { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px;
  padding: 8px 14px; margin: 0 0 12px; }
.db-md-preview details summary { cursor: pointer; font-weight: 600; color: #374151; outline: none; }
.db-md-preview details[open] summary { margin-bottom: 8px; }
.db-md-preview .md-toc { background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border: 1px solid #e2e8f0; border-radius: 12px; padding: 14px 20px 14px 28px; margin: 12px 0 20px; }
.db-md-preview .md-toc li { margin: 6px 0; font-size: 14px; }
.db-md-preview .md-toc li::marker { color: #5368ff; }
.db-md-preview .md-toc a { border-bottom: none; color: #334155; }
.db-md-preview .md-toc a:hover { color: #5368ff; }
.db-md-preview .mermaid { display: flex; justify-content: center; margin: 16px 0;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px; overflow-x: auto; }


/* 技能详情 */
.db-skill-detail { display: flex; flex-direction: column; gap: 16px; }
.db-skill-detail__head { display: flex; gap: 12px; align-items: flex-start; }
.db-skill-detail__icon { width: 48px; height: 48px; border-radius: 12px; background: linear-gradient(135deg, rgba(83,104,255,.12), rgba(83,104,255,.05)); display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; padding: 6px; box-sizing: border-box; }
.db-skill-detail__icon-img { width: 100%; height: 100%; object-fit: contain; }
.db-skill-detail__name { font-size: 17px; font-weight: 600; color: var(--db-text); margin: 0 0 4px; }
.db-skill-detail__desc { font-size: 13px; color: var(--db-text-2); line-height: 1.6; }
.db-skill-detail__section { background: #f8f9fb; border: 1px solid var(--db-border); border-radius: 10px; padding: 12px 14px; }
.db-skill-detail__label { font-size: 12px; font-weight: 600; color: var(--db-text-3); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.db-skill-detail__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.db-skill-detail__tools { display: flex; flex-wrap: wrap; gap: 6px; }
.db-skill-detail__trigger { display: inline-block; padding: 3px 9px; background: rgba(83,104,255,.08); color: var(--bg-brand); border-radius: 6px; font-family: JetBrains Mono, Consolas, monospace; font-size: 12px; }
.db-skill-detail__prompt { font-size: 13px; line-height: 1.7; color: var(--db-text-2); white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow-y: auto; }
.db-skill-detail__btn-row { display: flex; gap: 8px; margin-top: 4px; }
.db-skill-detail__btn { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--db-border); background: #fff; color: var(--db-text); font-size: 13px; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: 6px; transition: all .12s; }
.db-skill-detail__btn:hover { border-color: var(--bg-brand); color: var(--bg-brand); }
.db-skill-detail__btn.primary { background: var(--bg-brand); color: #fff; border-color: var(--bg-brand); }
.db-skill-detail__btn.primary:hover { background: #4458e8; color: #fff; }
.db-skill-detail__btn.danger:hover { border-color: #ef4444; color: #ef4444; }

/* SSH 终端面板 */
.db-xterm { flex: 1; padding: 6px 0; overflow: hidden; }
.db-xterm .xterm { padding: 4px 8px; height: 100%; }
.db-xterm .xterm-viewport { overflow-y: auto !important; }

/* 浏览器实时页签 */
.db-browser { display: flex; flex-direction: column; height: 100%; background: #1e1e1e; }
.db-browser__bar { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: #2d2d2d; border-bottom: 1px solid #404040; flex-shrink: 0; }
.db-browser__dot { width: 8px; height: 8px; border-radius: 50%; background: #666; flex-shrink: 0; }
.db-browser__dot.is-on { background: #4ec9b0; box-shadow: 0 0 6px rgba(78,201,176,.5); }
.db-browser__url { font-size: 12px; color: #9cdcfe; font-family: 'JetBrains Mono', Consolas, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.db-browser__canvas { flex: 1; width: 100%; background: #000; cursor: crosshair; outline: none; display: block; }
.db-browser__canvas:focus { box-shadow: inset 0 0 0 2px rgba(83,104,255,.5); }
.db-browser__hint { padding: 6px 14px; background: #252526; border-top: 1px solid #404040; font-size: 11px; color: #858585; flex-shrink: 0; }

/* 知识库模式切换 */
.kb-mode-switch { display: flex; gap: 6px; padding: 10px 16px 4px; border-bottom: 1px solid var(--db-border, #e5e7eb); }
.kb-mode-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 7px 8px; border: 1px solid var(--db-border, #e5e7eb); background: #fff; border-radius: 8px; font-size: 12px; color: var(--db-text-2, #6b7280); cursor: pointer; font-family: inherit; transition: all .15s; }
.kb-mode-btn:hover { border-color: var(--bg-brand, #5368ff); color: var(--bg-brand, #5368ff); }
.kb-mode-btn.is-active { background: var(--bg-brand, #5368ff); border-color: var(--bg-brand, #5368ff); color: #fff; }
.kb-mode-btn.is-active svg { color: #fff; }
.db-term { display: flex; flex-direction: column; height: 100%; background: #fff; color: #1f2328; font-family: 'JetBrains Mono', 'Cascadia Code', Consolas, 'Courier New', monospace; font-size: 13px; line-height: 1.5; }
.db-term__bar { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: #f6f8fa; border-bottom: 1px solid #d0d7de; flex-shrink: 0; font-family: inherit; }
.db-term__status { width: 8px; height: 8px; border-radius: 50%; background: #cf222e; flex-shrink: 0; }
.db-term__status.is-on { background: #1a7f37; box-shadow: 0 0 6px rgba(26,127,55,.4); }
.db-term__target { font-size: 12px; color: #6e7781; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-term__cwd { font-size: 11px; color: #0969da; }
.db-term__out { flex: 1; overflow-y: auto; padding: 12px 14px; white-space: pre-wrap; word-break: break-all; background: #fff; }
.db-term__line { margin: 0; }
.db-term__prompt { color: #1a7f37; }
.db-term__cmd { color: #1f2328; font-weight: 600; }
.db-term__output { color: #24292f; }
.db-term__err { color: #cf222e; }
.db-term__sys { color: #6e7781; font-style: italic; }
.db-term__input-row { display: flex; align-items: center; gap: 6px; padding: 8px 14px; background: #f6f8fa; border-top: 1px solid #d0d7de; flex-shrink: 0; }
.db-term__prompt-label { color: #1a7f37; font-size: 12px; white-space: nowrap; flex-shrink: 0; }
.db-term__input { flex: 1; background: transparent; border: none; outline: none; color: #1f2328; font-family: inherit; font-size: 13px; caret-color: #0969da; }
.db-term__input::placeholder { color: #8c959f; }
.db-term__send { background: #1f883d; border: none; color: #fff; border-radius: 6px; padding: 4px 12px; font-size: 12px; cursor: pointer; font-family: inherit; flex-shrink: 0; }
.db-term__send:hover { background: #1a7f37; }
.db-term__send:disabled { background: #8c959f; cursor: not-allowed; }



  /* 技能管理 */
  .db-skillview { position: absolute; left: 0; right: 0; top: 52px; bottom: 0; background: var(--db-bg); z-index: 20; display: flex; flex-direction: column; overflow: hidden; }
  .db-skillview__head { flex-shrink: 0; padding: 14px 24px; border-bottom: 1px solid var(--db-border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .db-skillview__back { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--db-border); background: #fff; font-size: 13px; cursor: pointer; color: var(--db-text-2); font-family: inherit; }
  .db-skillview__back:hover { background: var(--db-hover); color: var(--db-text); }
  .db-skillview__title { font-size: 18px; font-weight: 600; margin: 0; }
  .db-skillview__count { background: rgba(83,104,255,.1); color: #5368ff; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
  .db-skillview__search { padding: 7px 12px; border-radius: 8px; border: 1px solid var(--db-border); font-size: 13px; width: 220px; outline: none; background: #fff; font-family: inherit; }
  .db-skillview__search:focus { border-color: #5368ff; }
  .db-skillview__add { padding: 7px 16px; border-radius: 8px; background: #5368ff; color: #fff; border: none; font-size: 13px; cursor: pointer; font-family: inherit; }
  .db-skillview__add:hover { background: #4458e8; }
  .db-skillview__body { flex: 1; overflow-y: auto; padding: 20px 24px; }
  /* 技能管理内页签 */
  .db-skilltabs { display: inline-flex; gap: 2px; margin-left: 8px; background: var(--db-hover); border-radius: 8px; padding: 3px; }
  .db-skilltab { padding: 5px 14px; border: none; background: transparent; border-radius: 6px; font-size: 13px; color: var(--db-text-2); cursor: pointer; font-family: inherit; }
  .db-skilltab.is-active { background: #fff; color: var(--db-text); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
  /* SkillHub 商店 */
  .hub-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
  .hub-cat { padding: 6px 14px; border: 1px solid var(--db-border); border-radius: 999px; background: #fff; font-size: 12px; color: var(--db-text-2); cursor: pointer; font-family: inherit; }
  .hub-cat.is-active { background: #5368ff; color: #fff; border-color: #5368ff; }
  .hub-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; font-size: 12px; color: var(--db-text-3); }
  .hub-sort { padding: 5px 10px; border: 1px solid var(--db-border); border-radius: 6px; background: #fff; font-size: 12px; font-family: inherit; color: var(--db-text-2); }
  .hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
  .hub-card { background: #fff; border: 1px solid var(--db-border); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; position: relative; }
  .hub-card__head { display: flex; align-items: flex-start; gap: 12px; }
  .hub-card__icon { width: 40px; height: 40px; border-radius: 10px; background: var(--db-hover); object-fit: cover; flex-shrink: 0; font-size: 22px; overflow: hidden; }
  .hub-card__icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
  div.hub-card__icon { display:flex; align-items:center; justify-content:center; }
  .hub-card__title { font-size: 14px; font-weight: 600; color: var(--db-text); line-height: 1.3; word-break: break-word; }
  .hub-card__author { font-size: 11px; color: var(--db-text-3); margin-top: 2px; }
  .hub-card__desc { font-size: 12px; color: var(--db-text-2); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .hub-card__meta { display: flex; align-items: center; gap: 12px; font-size: 11px; color: var(--db-text-3); margin-top: auto; }
  .hub-card__meta span { display: inline-flex; align-items: center; gap: 3px; }
  .hub-card__btn { margin-top: 8px; padding: 6px 14px; border-radius: 6px; border: 1px solid var(--db-border); background: #fff; color: var(--db-text-2); font-size: 12px; cursor: pointer; font-family: inherit; align-self: flex-start; white-space: nowrap; }
  .hub-card__btn:hover { background: var(--db-hover); }
  .hub-card__btn.is-primary { background: #5368ff; border-color: #5368ff; color: #fff; }
  .hub-card__btn.is-primary:hover { background: #4458e8; }
  .hub-card__btn.is-installed { background: #f1f5f9; color: var(--db-text-3); cursor: default; border-color: transparent; }
  .hub-card__btn.is-installing { background: #94a3b8; color: #fff; cursor: wait; border-color: transparent; }
  .hub-card__btns { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; }
  .hub-source { position: absolute; top: 12px; right: 12px; font-size: 10px; padding: 2px 6px; border-radius: 4px; background: var(--db-hover); color: var(--db-text-3); }
  .hub-source.is-official { background: rgba(83,104,255,.1); color: #5368ff; }
  .hub-loading { text-align: center; padding: 60px 0; color: var(--db-text-3); font-size: 13px; }
  .hub-empty { text-align: center; padding: 60px 0; color: var(--db-text-3); font-size: 13px; }
  .hub-detail { position: absolute; inset: 0; background: var(--db-bg); z-index: 30; display: flex; flex-direction: column; overflow: hidden; }
  .hub-detail__head { flex-shrink: 0; padding: 14px 24px; border-bottom: 1px solid var(--db-border); display: flex; align-items: center; gap: 12px; }
  .hub-detail__back { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--db-border); background: #fff; font-size: 13px; cursor: pointer; color: var(--db-text-2); font-family: inherit; }
  .hub-detail__body { flex: 1; overflow-y: auto; padding: 24px; }
  .hub-detail__icon { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; }
  .hub-detail__title { font-size: 20px; font-weight: 600; margin: 0; }
  .hub-detail__meta { font-size: 12px; color: var(--db-text-3); margin-top: 6px; display: flex; gap: 16px; flex-wrap: wrap; }
  .hub-detail__desc { font-size: 13px; color: var(--db-text-2); line-height: 1.7; margin: 16px 0; padding: 12px 16px; background: #fff; border: 1px solid var(--db-border); border-radius: 10px; }
  .hub-detail__files { background: #fff; border: 1px solid var(--db-border); border-radius: 10px; padding: 14px 16px; margin-top: 14px; }
  .hub-detail__files h4 { margin: 0 0 8px; font-size: 13px; }
  .hub-detail__filelist { list-style: none; padding: 0; margin: 0; font-family: var(--code-editor-font-family); font-size: 12px; color: var(--db-text-2); }
  .hub-detail__filelist li { padding: 3px 0; display: flex; justify-content: space-between; }
  .hub-detail__filelist li span:first-child { word-break: break-all; }
  .hub-detail__filelist li span:last-child { color: var(--db-text-3); flex-shrink: 0; margin-left: 10px; }
  .hub-detail__install { margin-left: auto; padding: 8px 20px; border-radius: 8px; border: none; background: #5368ff; color: #fff; font-size: 13px; cursor: pointer; font-family: inherit; }
  .hub-detail__install.is-installed { background: #f1f5f9; color: var(--db-text-3); cursor: default; }
  .hub-detail__install:disabled { opacity: .6; cursor: wait; }
  .hub-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 24px; font-size: 13px; color: var(--db-text-2); }
  .hub-pager button { padding: 6px 14px; border-radius: 6px; border: 1px solid var(--db-border); background: #fff; cursor: pointer; font-family: inherit; font-size: 13px; color: var(--db-text-2); }
  .hub-pager button:hover:not(:disabled) { border-color: #5368ff; color: #5368ff; }
  .hub-pager button:disabled { opacity: .4; cursor: not-allowed; }
  .db-skillgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
  .db-skillcard { background: #fff; border: 1px solid var(--db-border); border-radius: 12px; padding: 16px; transition: all .15s; position: relative; cursor: pointer; text-align: left; }
  .db-skillcard:hover { box-shadow: 0 4px 14px rgba(0,0,0,.06); border-color: #c7d2fe; transform: translateY(-1px); }
  .db-skillcard__icon { font-size: 28px; margin-bottom: 10px; display: inline-block; }
  .db-skillcard__name { font-size: 15px; font-weight: 600; margin-bottom: 4px; color: var(--db-text); }
  .db-skillcard__desc { font-size: 12px; color: var(--db-text-2); line-height: 1.6; min-height: 32px; }
  .db-skillcard__tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 10px; }
  .db-skillcard__tag { font-size: 10px; padding: 2px 8px; border-radius: 999px; background: var(--db-hover); color: var(--db-text-2); }
  .db-skillcard__actions { display: flex; gap: 6px; margin-top: 12px; }
  .db-skillcard__btn { flex: 1; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--db-border); background: #fff; font-size: 12px; cursor: pointer; color: var(--db-text); font-family: inherit; }
  .db-skillcard__btn:hover { background: var(--db-hover); }
  .db-skillcard__btn.primary { background: #5368ff; color: #fff; border-color: #5368ff; }
  .db-skillcard__btn.danger { color: #ef4444; }
  .db-skillcard__builtin { position: absolute; top: 10px; right: 10px; font-size: 10px; color: var(--db-text-3); background: var(--db-hover); padding: 1px 6px; border-radius: 4px; }
  .db-chunk-panel__handle { position: absolute; left: 0; top: 0; bottom: 0; width: 5px; cursor: col-resize; z-index: 2; background: transparent; transition: background .1s; }
.db-chunk-panel__handle:hover { background: var(--bg-brand); opacity: .3; }
.db-side { display: flex; flex-direction: column; height: 100%; width: 100%; min-width: 0; }
.db-side__head { display: flex; align-items: center; border-bottom: 1px solid var(--db-border); flex-shrink: 0; padding: 0 8px 0 12px; height: 42px; gap: 8px; min-width: 0; }
.db-side__tabs { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; height: 100%; align-items: center; }
.db-side__tabs::-webkit-scrollbar { display: none; }
.db-side__tab { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; font-size: 12px; color: var(--db-text-2); background: transparent; border: none; border-radius: 6px; cursor: pointer; white-space: nowrap; flex-shrink: 0; max-width: 180px; height: 28px; font-family: inherit; }
.db-side__tab span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-side__tab:hover { background: var(--db-hover); }
.db-side__tab.is-active { background: rgba(83,104,255,.1); color: var(--bg-brand); font-weight: 500; }
.db-side__tab-close { width: 16px; height: 16px; border-radius: 50%; border: none; background: transparent; color: inherit; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; line-height: 1; padding: 0; flex-shrink: 0; opacity: .5; margin-left: 2px; }
.db-side__tab-close:hover { background: rgba(0,0,0,.1); opacity: 1; }
.db-side__actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.db-side__width { display: inline-flex; background: rgba(0,0,0,.05); border-radius: 6px; padding: 2px; height: 26px; align-items: center; }
.db-side__width button { width: 22px; height: 20px; border: none; background: transparent; cursor: pointer; border-radius: 4px; padding: 0; position: relative; display: inline-flex; align-items: flex-end; justify-content: center; }
.db-side__width button::before { content: ''; display: block; background: var(--db-text-3); border-radius: 1px; }
.db-side__width button[data-w="1/3"]::before { width: 5px; height: 10px; }
.db-side__width button[data-w="1/2"]::before { width: 9px; height: 10px; }
.db-side__width button[data-w="2/3"]::before { width: 13px; height: 10px; }
.db-side__width button.is-active::before { background: var(--bg-brand); }
.db-side__width button:hover::before { background: var(--db-text); }
.db-side__width button.is-active:hover::before { background: var(--bg-brand); }
.db-chunk-panel__head { display: none; }
.db-chunk-panel__title { font-size: 15px; font-weight: 600; color: var(--db-text); }
.db-chunk-panel__close { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px; border: none; background: none; color: var(--db-text-2); cursor: pointer; transition: background .1s; }
.db-chunk-panel__close:hover { background: var(--db-hover); color: var(--db-text); }
.db-chunk-panel__body { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }

/* ============ 自动化任务（内嵌面板，复用 skillview 视觉） ============ */
.db-autoview { position: absolute; left: 0; right: 0; top: 52px; bottom: 0; background: var(--db-bg); z-index: 20; display: none; flex-direction: column; overflow: hidden; }
.db-autoview__head { flex-shrink: 0; padding: 14px 24px; border-bottom: 1px solid var(--db-border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.db-autoview__title { font-size: 18px; font-weight: 600; margin: 0; }
.db-autoview__count { background: rgba(83,104,255,.1); color: #5368ff; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.db-autoview__body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.db-autoview__add { padding: 7px 16px; border-radius: 8px; background: #5368ff; color: #fff; border: none; font-size: 13px; cursor: pointer; font-family: inherit; }
.db-autoview__add:hover { background: #4458e8; }
.db-autoview__back { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--db-border); background: #fff; font-size: 13px; cursor: pointer; color: var(--db-text-2); font-family: inherit; }
.db-autoview__back:hover { background: var(--db-hover); color: var(--db-text); }

.db-autotabs { display: flex; gap: 4px; border-bottom: 1px solid var(--db-border); padding: 0 24px; flex-shrink: 0; background: var(--db-bg); }
.db-autotab { padding: 10px 4px; margin-right: 24px; font-size: 14px; color: var(--db-text-2); cursor: pointer; border: none; background: none; border-bottom: 2px solid transparent; font-family: inherit; }
.db-autotab:hover { color: var(--db-text); }
.db-autotab.is-active { color: var(--db-text); font-weight: 500; border-bottom-color: #5368ff; }

.db-autoempty { text-align: center; color: var(--db-text-3); padding: 80px 20px; }
.db-autoempty svg { width: 56px; height: 56px; opacity: .4; margin-bottom: 14px; }
.db-autoempty__title { font-size: 14px; color: var(--db-text-2); margin-bottom: 4px; }
.db-autoempty__desc { font-size: 12px; color: var(--db-text-3); margin-bottom: 18px; }

.db-autotable { background: #fff; border: 1px solid var(--db-border); border-radius: 10px; overflow: hidden; }
.db-autorow { display: grid; grid-template-columns: 36px 1fr 130px 90px 180px 150px; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--db-border); }
.db-autorow:last-child { border-bottom: none; }
.db-autorow.is-head { background: #fafbfc; font-size: 12px; color: var(--db-text-3); font-weight: 500; }
.db-autorow__name { font-size: 13px; font-weight: 500; color: var(--db-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-autorow__prompt { font-size: 12px; color: var(--db-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.db-autorow__sched { font-size: 12px; color: var(--db-text-2); }
.db-autorow__time { font-size: 12px; color: var(--db-text-3); }
.db-autoid { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; background: rgba(83,104,255,.1); color: #5368ff; border-radius: 6px; font-size: 11px; font-weight: 600; font-family: var(--code-editor-font-family); }
.db-autobadge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 500; }
.db-autobadge--on { background: rgba(16,185,129,.1); color: #10b981; }
.db-autobadge--off { background: var(--db-hover); color: var(--db-text-3); }
.db-autobadge--success { background: rgba(16,185,129,.1); color: #10b981; }
.db-autobadge--failed { background: rgba(239,68,68,.1); color: #ef4444; }
.db-autobadge--running { background: rgba(83,104,255,.1); color: #5368ff; }
.db-autobadge--dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.db-autoactions { display: flex; gap: 2px; justify-content: flex-end; }
.db-autoiconbtn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px; border: none; background: transparent; color: var(--db-text-3); cursor: pointer; }
.db-autoiconbtn:hover { background: var(--db-hover); color: var(--db-text); }
.db-autoiconbtn svg { width: 14px; height: 14px; }

.db-autosection { margin-bottom: 28px; }
.db-autosection__title { font-size: 14px; font-weight: 600; margin: 0 0 6px; color: var(--db-text); }
.db-autosection__desc { font-size: 12px; color: var(--db-text-3); margin: 0 0 12px; }
.db-autotplgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.db-autotpl { background: #fff; border: 1px solid var(--db-border); border-radius: 10px; padding: 14px 16px; cursor: pointer; display: flex; gap: 12px; align-items: flex-start; transition: all .15s; }
.db-autotpl:hover { border-color: #c7d2fe; box-shadow: 0 2px 8px rgba(0,0,0,.04); transform: translateY(-1px); }
.db-autotpl__icon { width: 32px; height: 32px; border-radius: 8px; background: rgba(83,104,255,.1); color: #5368ff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.db-autotpl__icon svg { width: 16px; height: 16px; }
.db-autotpl__title { font-size: 13px; font-weight: 600; color: var(--db-text); margin-bottom: 4px; }
.db-autotpl__desc { font-size: 12px; color: var(--db-text-2); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 表单 */
.db-autoform { max-width: 720px; margin: 0 auto; }
.db-autofield { margin-bottom: 18px; }
.db-autolabel { display: block; font-size: 13px; font-weight: 500; color: var(--db-text); margin-bottom: 6px; }
.db-autoinput, .db-autoselect, .db-autotextarea { width: 100%; padding: 8px 12px; border: 1px solid var(--db-border); border-radius: 8px; font-size: 13px; font-family: inherit; color: var(--db-text); background: #fff; outline: none; box-sizing: border-box; }
.db-autoinput:focus, .db-autoselect:focus, .db-autotextarea:focus { border-color: #5368ff; }
.db-autotextarea { resize: vertical; min-height: 110px; line-height: 1.6; }
.db-autochips { display: flex; gap: 6px; padding-top: 8px; flex-wrap: wrap; }
.db-autochip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 6px; background: var(--db-hover); color: var(--db-text-2); font-size: 12px; border: 1px solid transparent; }
.db-autochip.is-active { background: rgba(83,104,255,.1); color: #5368ff; border-color: rgba(83,104,255,.2); }
.db-autochip svg { width: 12px; height: 12px; }

.db-autoseg { display: inline-flex; background: var(--db-hover); border-radius: 8px; padding: 2px; gap: 2px; }
.db-autoseg__btn { padding: 6px 14px; border: none; background: transparent; border-radius: 6px; font-size: 12px; color: var(--db-text-2); cursor: pointer; font-family: inherit; }
.db-autoseg__btn.is-active { background: #fff; color: var(--db-text); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.db-autorow2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.db-autoswitch { position: relative; display: inline-block; width: 36px; height: 20px; flex-shrink: 0; }
.db-autoswitch input { display: none; }
.db-autoswitch__slider { position: absolute; cursor: pointer; inset: 0; background: #d1d5db; border-radius: 999px; transition: .2s; }
.db-autoswitch__slider::before { content: ''; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.db-autoswitch input:checked + .db-autoswitch__slider { background: #5368ff; }
.db-autoswitch input:checked + .db-autoswitch__slider::before { transform: translateX(16px); }
.db-autohint { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; background: #fafbfc; border: 1px solid var(--db-border); border-radius: 8px; font-size: 12px; color: var(--db-text-2); margin-top: 8px; }
.db-autofoot { display: flex; gap: 10px; justify-content: flex-end; padding-top: 20px; border-top: 1px solid var(--db-border); margin-top: 20px; }
.db-autobtn { padding: 7px 14px; border-radius: 8px; font-size: 13px; cursor: pointer; border: 1px solid var(--db-border); background: #fff; color: var(--db-text); font-family: inherit; }
.db-autobtn:hover { border-color: #5368ff; color: #5368ff; }
.db-autobtn--primary { background: #5368ff; border-color: #5368ff; color: #fff; }
.db-autobtn--primary:hover { background: #4458e8; border-color: #4458e8; color: #fff; }
.db-autobtn--ghost { border-color: transparent; color: var(--db-text-2); }
.db-autobtn--ghost:hover { background: var(--db-hover); color: var(--db-text); border-color: transparent; }

.db-autorunrow { display: grid; grid-template-columns: 160px minmax(0,1fr) 90px 90px; gap: 12px; align-items: start; padding: 12px 16px; border-bottom: 1px solid var(--db-border); font-size: 13px; cursor: pointer; transition: background .12s; }
.db-autorunrow:hover { background: var(--db-hover); }
.db-autorunrow:last-child { border-bottom: none; }
.db-autorunrow.is-head { background: #fafbfc; font-size: 12px; color: var(--db-text-3); font-weight: 500; align-items: center; cursor: default; }
.db-autorunrow.is-head:hover { background: #fafbfc; }
.db-autorunrow__time { font-size: 12px; color: var(--db-text-3); white-space: nowrap; }
.db-autorunrow__out { font-size: 12px; color: var(--db-text-2); line-height: 1.6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-autorunrow__dur { font-size: 12px; color: var(--db-text-3); }

/* 表单内联选择器（模型/技能下拉，对齐截图样式） */
.db-autopick { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--db-border); border-radius: 8px; background: #fff; font-size: 13px; color: var(--db-text); cursor: pointer; font-family: inherit; min-width: 160px; justify-content: space-between; }
.db-autopick:hover { border-color: #5368ff; }
.db-autopick__icon { width: 16px; height: 16px; object-fit: contain; flex-shrink: 0; }
.db-autopick__caret { width: 12px; height: 12px; color: var(--db-text-3); flex-shrink: 0; }
.db-autopick--ghost { background: transparent; border-color: transparent; color: var(--db-text-2); min-width: 0; padding: 6px 8px; }
.db-autopick--ghost:hover { background: var(--db-hover); color: var(--db-text); border-color: transparent; }

.db-autodrop { position: absolute; z-index: 30; background: #fff; border: 1px solid var(--db-border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.1); min-width: 260px; max-height: 320px; overflow-y: auto; padding: 6px; margin-top: 4px; }
.db-autodrop__search { width: 100%; box-sizing: border-box; padding: 8px 30px 8px 12px; border: 1px solid var(--db-border); border-radius: 8px; font-size: 13px; font-family: inherit; outline: none; background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none'><circle cx='11' cy='11' r='7' stroke='%239ca3af' stroke-width='2'/><path d='m20 20-3-3' stroke='%239ca3af' stroke-width='2' stroke-linecap='round'/></svg>") no-repeat right 10px center; }
.db-autodrop__search:focus { border-color: #5368ff; }
.db-autodrop__item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--db-text); }
.db-autodrop__item:hover { background: var(--db-hover); }
.db-autodrop__item.is-active { background: rgba(83,104,255,.08); color: #5368ff; font-weight: 500; }
.db-autodrop__item-icon { width: 18px; height: 18px; object-fit: contain; flex-shrink: 0; }
.db-autodrop__item-sub { font-size: 11px; color: var(--db-text-3); margin-left: auto; font-family: var(--code-editor-font-family); }
.db-autodrop__foot { padding: 6px 10px; font-size: 12px; color: var(--db-text-3); border-top: 1px solid var(--db-border); margin-top: 4px; cursor: pointer; }
.db-autodrop__foot:hover { color: #5368ff; }
.db-autodrop__empty { padding: 18px; text-align: center; font-size: 12px; color: var(--db-text-3); }

/* 输入框内技能 chip */
.db-input__chips { display: flex; flex-wrap: wrap; gap: 2px; padding: 10px 12px 0; align-items: center; }
  .db-input__chips > * { margin: 0 !important; box-sizing: border-box !important; }
.db-input-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 8px; background: rgba(83,104,255,.1); color: var(--bg-brand); border-radius: 8px; font-size: 12px; font-weight: 500; }
.db-input-chip svg { flex-shrink: 0; }
.db-input-chip__icon { width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.db-input-chip__icon img { width: 16px; height: 16px; object-fit: contain; border-radius: 3px; display: block; }
.db-input-chip__icon svg { width: 14px; height: 14px; display: block; }
.db-input-chip__name { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-input-chip__close { width: 18px; height: 18px; border: none; background: transparent; color: var(--bg-brand); border-radius: 50%; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; line-height: 1; padding: 0; }
.db-input-chip__close:hover { background: rgba(83,104,255,.15); }
  .db-conn-chip { display: inline-flex; align-items: stretch; gap: 0; background: rgba(83,104,255,.08); color: var(--bg-brand); border-radius: 8px; font-size: 12px; font-weight: 500; padding: 0; box-sizing: border-box; overflow: hidden; height: 28px; }
  .db-conn-chip__label { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; flex-shrink: 0; }
  .db-conn-chip__label svg { width: 13px; height: 13px; flex-shrink: 0; }
  .db-conn-chip__label span { font-size: 11px; white-space: nowrap; line-height: 1; }
  .db-conn-chip__sep { width: 1px; align-self: center; height: 14px; background: rgba(83,104,255,.2); flex-shrink: 0; }
  .db-conn-chip__icon { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 24px; flex-shrink: 0; cursor: default; }
  .db-conn-chip__icon img { width: 16px; height: 16px; object-fit: contain; display: block; border-radius: 3px; }
  .db-conn-chip__icon-emoji { font-size: 13px; line-height: 1; }
  .db-conn-chip__icon::after { content: ''; position: absolute; inset: 0; background: rgba(83,104,255,0); transition: background .15s; }
  .db-conn-chip__icon:hover::after { background: rgba(83,104,255,.1); }
  .db-conn-chip__tip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: #1f2937; color: #fff; font-size: 12px; line-height: 1.5; padding: 6px 10px; border-radius: 6px; white-space: normal; width: max-content; max-width: 240px; z-index: 100; pointer-events: none; opacity: 0; box-shadow: 0 4px 12px rgba(0,0,0,.15); transition: opacity .15s; }
  .db-conn-chip__tip::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 5px solid transparent; border-top-color: #1f2937; }
  .db-conn-chip__tip b { display: block; font-weight: 600; font-size: 12px; margin-bottom: 2px; }
  .db-conn-chip__tip span { color: #d1d5db; font-size: 11px; display: block; }
  .db-conn-chip__icon:hover .db-conn-chip__tip { opacity: 1; }
  .db-conn-chip__close { position: absolute; top: 50%; left: 50%; width: 16px; height: 16px; margin-top: -8px; margin-left: -8px; border-radius: 50%; background: #ef4444; color: #fff; border: none; cursor: pointer; font-size: 12px; line-height: 1; display: none; align-items: center; justify-content: center; padding: 0; z-index: 2; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
  .db-conn-chip__icon:hover .db-conn-chip__close { display: inline-flex; }

/* 输入框旁技能选择按钮激活态（已废弃，保留给旧引用） */
.db-input__kb-btn.is-skill { color: var(--bg-brand); }

/* + 按钮一级菜单 */
.db-plus-menu { position: fixed; background: #fff; border: 1px solid var(--db-border); border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.14); padding: 6px; z-index: 9999; display: none; min-width: 180px; }
.db-plus-menu.is-open { display: block; }
.db-plus-menu__item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; border: none; background: transparent; border-radius: 8px; font-size: 13px; color: var(--db-text); cursor: pointer; font-family: inherit; text-align: left; }
.db-plus-menu__item:hover { background: var(--db-hover); }
.db-plus-menu__item.has-sub { position: relative; }
.db-plus-menu__caret { margin-left: auto; color: var(--db-text-3); }

/* 技能选择下拉 */
.db-skill-picker { position: fixed; background: #fff; border: 1px solid var(--db-border); border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.14); padding: 8px; z-index: 9999; display: none; width: 320px; max-height: 380px; flex-direction: column; }
.db-skill-picker.is-open { display: flex; }
.db-skill-picker__search { width: 100%; box-sizing: border-box; padding: 8px 30px 8px 12px; border: 1px solid var(--db-border); border-radius: 8px; font-size: 13px; font-family: inherit; outline: none; background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none'><circle cx='11' cy='11' r='7' stroke='%239ca3af' stroke-width='2'/><path d='m20 20-3-3' stroke='%239ca3af' stroke-width='2' stroke-linecap='round'/></svg>") no-repeat right 10px center; }
.db-skill-picker__search:focus { border-color: #5368ff; }
.db-skill-picker__list { flex: 1; overflow-y: auto; margin-top: 6px; }
.db-skill-picker__item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--db-text); }
.db-skill-picker__item:hover { background: var(--db-hover); }
.db-skill-picker__item.is-active { background: rgba(83,104,255,.08); color: var(--bg-brand); font-weight: 500; }
.db-skill-picker__item-icon { width: 20px; height: 20px; font-size: 16px; line-height: 1; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.db-skill-picker__item-body { flex: 1; min-width: 0; }
.db-skill-picker__item-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-skill-picker__item-desc { font-size: 11px; color: var(--db-text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-skill-picker__foot { padding: 8px 10px 2px; font-size: 12px; color: var(--db-text-3); border-top: 1px solid var(--db-border); margin-top: 4px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.db-skill-picker__foot:hover { color: #5368ff; }
.db-skill-picker__empty { padding: 20px; text-align: center; font-size: 12px; color: var(--db-text-3); }

/* 周几选择 chip */
.db-autoweekdays { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.db-autoweekday { padding: 6px 14px; border: 1px solid var(--db-border); border-radius: 8px; background: #fff; font-size: 12px; color: var(--db-text-2); cursor: pointer; font-family: inherit; }
.db-autoweekday:hover { border-color: #c7d2fe; color: var(--db-text); }
.db-autoweekday.is-active { background: var(--db-hover); border-color: var(--db-border); color: var(--db-text); font-weight: 500; }

/* 自动化运行记录详情弹层 */
.db-rundetail { position: absolute; inset: 0; background: var(--db-bg); z-index: 40; display: none; flex-direction: column; }
.db-rundetail.is-open { display: flex; }
.db-rundetail__head { flex-shrink: 0; padding: 14px 24px; border-bottom: 1px solid var(--db-border); display: flex; align-items: center; gap: 12px; }
.db-rundetail__back { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--db-border); background: #fff; font-size: 13px; cursor: pointer; color: var(--db-text-2); font-family: inherit; }
.db-rundetail__back:hover { background: var(--db-hover); color: var(--db-text); }
.db-rundetail__title { font-size: 16px; font-weight: 600; margin: 0; flex: 1; min-width: 0; }
.db-rundetail__meta { font-size: 12px; color: var(--db-text-3); display: flex; gap: 16px; flex-shrink: 0; }
.db-rundetail__body { flex: 1; overflow-y: auto; padding: 24px; max-width: 920px; margin: 0 auto; width: 100%; box-sizing: border-box; }
.db-rundetail__body .db-msg__content { font-size: 14px; }

/* ===== 云盘面板 ===== */
.db-cloudview {
  position: absolute; inset: 0; background: var(--db-bg); z-index: 30;
  display: none; flex-direction: column;
}
.db-cloudview.is-open { display: flex; }
.db-cloudview__head {
  display: flex; align-items: center; gap: 12px; padding: 14px 20px;
  border-bottom: 1px solid var(--db-border); background: var(--db-bg);
  flex-shrink: 0;
}
.db-cloudview__back {
  border: 1px solid var(--db-border); background: #fff; border-radius: 8px;
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--db-text-2);
}
.db-cloudview__back:hover { border-color: #5368ff; color: #5368ff; }
.db-cloudview__title { font-size: 18px; font-weight: 700; margin: 0; }
.db-cloudview__search { flex: 1; max-width: 360px; margin-left: auto; }
.db-cloudview__search input {
  width: 100%; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--db-border);
  font-size: 13px; outline: none; background: #fff;
}
.db-cloudview__search input:focus { border-color: #5368ff; }
.db-cloudview__new {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 8px;
  background: #fff; color: var(--db-text-2); border: 1px solid var(--db-border); cursor: pointer; font-size: 13px; font-weight: 500;
}
.db-cloudview__new:hover { background: var(--db-hover); color: var(--db-text); }
.db-cloudview__new--primary { background: #5368ff; color: #fff; border-color: #5368ff; }
.db-cloudview__new--primary:hover { background: #4358ef; color: #fff; }
/* KB 状态徽章 */
.db-kbstatus { display:inline-flex; align-items:center; gap:4px; font-size:12px; padding:2px 8px; border-radius:10px; }
.db-kbstatus--ok { background:rgba(34,197,94,.1); color:#16a34a; }
.db-kbstatus--run { background:rgba(83,104,255,.1); color:#5368ff; }
.db-kbstatus--err { background:rgba(220,38,38,.1); color:#dc2626; }
.db-kbstatus--none { color:var(--db-text-3); }
.db-kbstatus__spin { width:10px; height:10px; border:1.5px solid currentColor; border-right-color:transparent; border-radius:50%; animation:db-spin .8s linear infinite; }
/* 对话框 */
.db-dialog-mask { position:fixed; inset:0; background:rgba(0,0,0,.35); z-index:9000; display:flex; align-items:center; justify-content:center; }
.db-dialog { background:#fff; border-radius:12px; box-shadow:0 12px 40px rgba(0,0,0,.18); overflow:hidden; }
.db-dialog__head { display:flex; align-items:center; justify-content:space-between; padding:14px 18px; font-size:14px; font-weight:600; border-bottom:1px solid var(--db-border); }
.db-dialog__x { border:none; background:none; font-size:14px; color:var(--db-text-3); cursor:pointer; line-height:1; padding:4px; }
.db-dialog__body { padding:18px; font-size:13px; color:var(--db-text-2); }
.db-dialog__foot { padding:12px 18px; display:flex; justify-content:flex-end; gap:8px; border-top:1px solid var(--db-border); background:#fafafa; }
.db-field__label { display:block; font-size:12px; color:var(--db-text-2); margin-bottom:6px; }
.db-dialog select { width:100%; padding:7px 10px; border:1px solid var(--db-border); border-radius:6px; font-size:13px; background:#fff; color:var(--db-text); outline:none; }
.db-dialog select:focus { border-color:#5368ff; }
.db-dialog .ds-btn { padding:7px 16px; border-radius:6px; font-size:13px; cursor:pointer; border:1px solid var(--db-border); background:#fff; color:var(--db-text-2); }
.db-dialog .ds-btn:hover { background:var(--db-hover); color:var(--db-text); }
.db-dialog .ds-btn--primary { background:#5368ff; color:#fff; border-color:#5368ff; }
.db-dialog .ds-btn--primary:hover { background:#4358ef; color:#fff; }
.db-dialog .ds-btn--ghost { background:#fff; }
.db-cloudview__crumbs { padding: 10px 20px; font-size: 13px; color: var(--db-text-3); border-bottom: 1px solid var(--db-border); flex-shrink: 0; }
.db-cloudview__crumbs a { color: #5368ff; cursor: pointer; text-decoration: none; }
.db-cloudview__crumbs a:hover { text-decoration: underline; }
.db-cloudview__body { flex: 1; display: flex; min-height: 0; }
.db-cloudview__side {
  width: 220px; border-right: 1px solid var(--db-border); padding: 12px; overflow-y: auto; flex-shrink: 0;
}
.db-cloudview__side h4 { font-size: 12px; color: var(--db-text-3); margin: 8px 6px; text-transform: uppercase; letter-spacing: .05em; }
.db-cloudfolder-item {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 6px;
  font-size: 13px; cursor: pointer; color: var(--db-text-2);
}
.db-cloudfolder-item:hover { background: var(--db-hover); }
.db-cloudfolder-item.active { background: rgba(83,104,255,.1); color: #5368ff; font-weight: 500; }
.db-folder-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.db-folder-caret {
  width: 14px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--db-text-3); line-height: 1;
}
.db-folder-caret.is-open { color: var(--db-text-3); }
.db-folder-caret.is-leaf { visibility: hidden; }
.db-folder-caret.is-root { visibility: hidden; width: 0; }
.db-folder-tree .db-folder-children {
  position: relative;
  margin-left: 10px;
  padding-left: 12px;
}
.db-folder-tree .db-folder-children::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 10px;
  border-left: 1px solid #e5e7eb;
}
.db-folder-tree .db-folder-node { position: relative; }
.db-folder-tree .db-folder-children > .db-folder-node::before {
  content: '';
  position: absolute;
  left: -12px; top: 14px;
  width: 10px; height: 0;
  border-top: 1px solid #e5e7eb;
}
.db-folder-tree .db-folder-children .db-cloudfolder-item { padding-left: 4px; }
.db-cloudview__list { flex: 1; overflow-y: auto; padding: 0; }
.db-cloudrow {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) 90px 80px 110px 120px 230px; gap: 12px;
  padding: 10px 20px; align-items: center; font-size: 13px; border-bottom: 1px solid var(--db-border);
}
.db-cloudrow.is-head span, .db-cloudrow.is-head div { white-space: nowrap; }
/* 右侧预览面板展开时按列表宽度（JS data-band）自动隐藏次要列（列序：勾选/名称/来源/大小/知识库/时间/操作）
   每个 band 的轨道数必须等于「可见子元素数」：隐藏列的同时要为剩余列保留轨道，否则操作列掉进隐式轨道会被挤扁 */
#cloudList[data-band="lg"] .db-cloudrow { grid-template-columns: 28px minmax(0, 1fr) 80px 80px 180px 170px; gap: 10px; }
#cloudList[data-band="lg"] .db-cloudrow > :nth-child(5) { display: none; }
#cloudList[data-band="md"] .db-cloudrow { grid-template-columns: 28px minmax(0, 1fr) 70px 80px 170px 150px; gap: 10px; }
#cloudList[data-band="md"] .db-cloudrow > :nth-child(6) { display: none; }
#cloudList[data-band="xs"] .db-cloudrow { grid-template-columns: 28px minmax(0, 1fr) 130px; gap: 10px; }
#cloudList[data-band="xs"] .db-cloudrow > :nth-child(3), #cloudList[data-band="xs"] .db-cloudrow > :nth-child(4), #cloudList[data-band="xs"] .db-cloudrow > :nth-child(5), #cloudList[data-band="xs"] .db-cloudrow > :nth-child(6) { display: none; }
#cloudList[data-band="xs"] .db-cloudrow__actions { gap: 4px; }
#cloudList[data-band="xs"] .db-cloudrow__actions button { padding: 4px 8px; }
.db-cloudrow__actions button { white-space: nowrap; }
.db-cloudrow.is-head { background: #fafbfc; font-size: 12px; color: var(--db-text-3); font-weight: 500; }
.db-cloudrow:not(.is-head):hover { background: var(--db-hover); cursor: pointer; }
.cloud-ic { display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; color: var(--db-text-2); flex-shrink: 0; }
.cloud-ic svg { width: 20px; height: 20px; display: block; }
.cloud-ic.folder { color: #d97706; }
.db-cloudrow__name { min-width: 0; }
.db-cloudrow__name .name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--db-text); }
.db-cloudrow__source { font-size: 12px; color: var(--db-text-3); }
.db-cloudrow__source .src-badge {
  display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 11px;
  background: rgba(83,104,255,.1); color: #5368ff;
}
.db-cloudrow__size { color: var(--db-text-3); font-size: 12px; }
.db-cloudrow__time { color: var(--db-text-3); font-size: 12px; }
.db-cloudrow__conv { color: var(--db-text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-cloudrow__actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.db-cloudrow__actions button {
  border: 1px solid var(--db-border); background: #fff; color: var(--db-text-2);
  border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer;
}
.db-cloudrow__actions button:hover { border-color: #5368ff; color: #5368ff; }
.db-cloudrow__actions .add { background: #5368ff; color: #fff; border-color: #5368ff; }
.db-cloudrow__actions .add:hover { background: #4358ef; }
.db-cloudrow__actions .more { padding: 4px 8px; line-height: 1; }
.db-cloudrow__actions .more:hover { border-color: var(--db-border); color: var(--db-text-2); background: var(--db-hover); }
.db-cloudrow-menu { position: fixed; z-index: 9050; background: #fff; border: 1px solid var(--db-border); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.12); padding: 4px; min-width: 130px; }
.db-cloudrow-menu__item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: none; background: none; font-size: 13px; color: var(--db-text-2); cursor: pointer; border-radius: 6px; text-align: left; }
.db-cloudrow-menu__item:hover { background: var(--db-hover); color: var(--db-text); }
.db-cloudrow-menu__item--danger { color: #dc2626; }
.db-cloudrow-menu__item--danger:hover { background: rgba(220,38,38,.07); color: #b91c1c; }
.db-cloudempty { padding: 80px 20px; text-align: center; color: var(--db-text-3); }
.db-att.is-adding { opacity: .75; }
.db-cloudview__pager { padding: 12px 20px; border-top: 1px solid var(--db-border); flex-shrink: 0; }
.db-cloudview__batch { display:flex; align-items:center; gap:10px; margin-left:auto; }
.db-cloudview__batch-count { font-size:13px; color:var(--db-text-2); }
.db-cloudview__batch-count b { color:#5368ff; font-weight:600; }
.db-cloudview__batch-add { display:inline-flex; align-items:center; gap:6px; padding:6px 14px; border:none; border-radius:6px; background:#5368ff; color:#fff; font-size:13px; cursor:pointer; }
.db-cloudview__batch-add:hover { background:#4358ef; }
.db-cloudview__batch-cancel { padding:6px 12px; border:1px solid var(--db-border); background:#fff; border-radius:6px; font-size:13px; cursor:pointer; color:var(--db-text-2); }
.db-cloudrow.is-selected { background: rgba(83,104,255,.06); }
.cloud-check { width:16px; height:16px; accent-color:#5368ff; cursor:pointer; flex-shrink:0; }
.db-toast { position: fixed; left: 50%; top: 60px; transform: translateX(-50%) translateY(-10px);
  background: #1f2937; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13px;
  z-index: 9999; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  box-shadow: 0 6px 20px rgba(0,0,0,.18); max-width: 80%;
}
.db-toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.db-toast.is-error { background: #dc2626; }

/* ===== 上下文容量明细面板（圆环悬停/点击） ===== */
.db-ctx-ring .db-ctx-ring__tip { display: none !important; }
.ctx-pop {
  position: fixed; z-index: 320; width: 320px; display: none;
  background: #fff; border: 1px solid var(--border-neutral-l1); border-radius: 14px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16); padding: var(--spacer-16);
  font-family: var(--body-base-font-family), "Microsoft YaHei", sans-serif;
  box-sizing: border-box;
}
.ctx-pop__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--spacer-8); margin-bottom: var(--spacer-10); }
.ctx-pop__title { font: 600 13px/18px var(--body-base-font-family); color: var(--text-default); }
.ctx-pop__total { font: 500 12px/16px var(--body-base-font-family); color: var(--text-secondary); }
.ctx-pop__bar { height: 8px; border-radius: 999px; background: var(--bg-overlay-l2); overflow: hidden; margin-bottom: var(--spacer-14); }
.ctx-pop__bar span { display: block; height: 100%; min-width: 6px; border-radius: 999px; background: var(--bg-brand, #3370ff); transition: width .25s ease; }
.ctx-pop__rows { border-top: 1px solid var(--border-neutral-l1); padding-top: var(--spacer-6); }
.ctx-pop__row { display: flex; align-items: center; gap: var(--spacer-10); padding: 6px 0; font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.ctx-pop__dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.ctx-pop__label { flex: 1; color: var(--text-default); }
.ctx-pop__val { font-family: var(--font-family-metric, var(--code-editor-font-family)); color: var(--text-default); font-weight: 500; }
.ctx-pop__hint { margin-top: var(--spacer-10); padding-top: var(--spacer-8); border-top: 1px dashed var(--border-neutral-l1); font-size: 11px; color: var(--text-tertiary); }

/* ==================================================================
   Agent 集群（右侧「集群」页签 + 消息流横幅）
   全部为新类名，不影响既有元素渲染；颜色走 TRAE Work token（--bg-brand /
   --status-success-default / --status-error-default），fallback 对齐本页既有色板。
   ================================================================== */
.db-cluster { display: flex; flex-direction: column; gap: 10px; }
.db-cluster__summary { border: 1px solid var(--db-border); background: var(--bg-overlay-l1, #fff); border-radius: 12px; padding: 12px 14px; }
.db-cluster__summary-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.db-cluster__summary-title { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--db-text); min-width: 0; }
.db-cluster__summary-title b { font-weight: 600; }
.db-cluster__summary-title svg { color: var(--bg-brand); flex-shrink: 0; }
.db-cluster__live-dot { width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--bg-brand); animation: dbPulse 1s ease-in-out infinite; flex-shrink: 0; }
.db-cluster__pct { font-size: 15px; font-weight: 700; color: var(--bg-brand); font-family: var(--code-editor-font-family, monospace); flex-shrink: 0; }
.db-cluster__bar { height: 6px; border-radius: 999px; background: var(--db-hover); overflow: hidden; }
.db-cluster__bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--bg-brand); transition: width .5s ease; }
.db-cluster__bar-fill.is-end { background: var(--status-success-default, #15A877); }
.db-cluster__badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.db-cluster__badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 11px; background: var(--db-hover); color: var(--db-text-2); white-space: nowrap; }
.db-cluster__badge.is-running { background: rgba(83,104,255,.1); color: var(--bg-brand); }
.db-cluster__badge.is-done { background: rgba(21,168,119,.12); color: var(--status-success-default, #15A877); }
.db-cluster__badge.is-error { background: rgba(232,70,58,.1); color: var(--status-error-default, #E8463A); }
.db-cluster__empty { padding: 32px 12px; text-align: center; font-size: 13px; color: var(--db-text-3); }

.db-cluster__agent { border: 1px solid var(--db-border); background: var(--bg-overlay-l1, #fff); border-radius: 12px; padding: 10px 12px; flex-shrink: 0; }
.db-cluster__agent-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.db-cluster__agent.is-expandable .db-cluster__agent-head { cursor: pointer; }
.db-cluster__agent-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--db-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-cluster__agent-status { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; padding: 1px 8px; border-radius: 999px; font-size: 11px; background: var(--db-hover); color: var(--db-text-2); white-space: nowrap; }
.db-cluster__agent-status svg { flex-shrink: 0; }
.db-cluster__agent-status.is-running { background: rgba(83,104,255,.1); color: var(--bg-brand); }
.db-cluster__agent-status.is-done { background: rgba(21,168,119,.12); color: var(--status-success-default, #15A877); }
.db-cluster__agent-status.is-error { background: rgba(232,70,58,.1); color: var(--status-error-default, #E8463A); }
.db-cluster__spinner { width: 10px; height: 10px; border: 2px solid rgba(83,104,255,.25); border-top-color: var(--bg-brand); border-radius: 50%; animation: db-spin .8s linear infinite; flex-shrink: 0; }
.db-cluster__agent-elapsed { flex-shrink: 0; font-size: 11px; color: var(--db-text-3); font-family: var(--code-editor-font-family, monospace); }
.db-cluster__chev { width: 14px; height: 14px; flex-shrink: 0; color: var(--db-text-3); transition: transform .2s; }
.db-cluster__agent.is-open .db-cluster__chev { transform: rotate(90deg); }
.db-cluster__agent-bar { height: 4px; margin-top: 8px; border-radius: 999px; background: var(--db-hover); overflow: hidden; }
.db-cluster__agent-bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--bg-brand); transition: width .5s ease; }
.db-cluster__agent.is-done .db-cluster__agent-bar-fill { background: var(--status-success-default, #15A877); }
.db-cluster__agent.is-error .db-cluster__agent-bar-fill { background: var(--status-error-default, #E8463A); }
.db-cluster__agent-msg { margin-top: 8px; font-size: 12px; line-height: 1.6; color: var(--db-text-2); word-break: break-word; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.db-cluster__agent.is-open .db-cluster__agent-msg { display: block; -webkit-line-clamp: unset; }

/* 消息流「集群横幅」摘要卡 */
.db-cluster-banner-wrap { max-width: 840px; width: 100%; margin: 0 auto; padding: 2px 24px 10px; box-sizing: border-box; flex-shrink: 0; }
.db-cluster-banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--db-border); border-radius: 12px; background: var(--bg-overlay-l1, #fff); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.db-cluster-banner:hover { border-color: var(--bg-brand); box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.db-cluster-banner__icon { display: inline-flex; color: var(--bg-brand); flex-shrink: 0; }
.db-cluster-banner__text { flex: 1; min-width: 0; font-size: 13px; color: var(--db-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-cluster-banner__bar { flex-shrink: 0; width: 90px; height: 5px; border-radius: 999px; background: var(--db-hover); overflow: hidden; }
.db-cluster-banner__bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--bg-brand); transition: width .5s ease; }
.db-cluster-banner__bar-fill.is-end { background: var(--status-success-default, #15A877); }
.db-cluster-banner.is-end .db-cluster-banner__icon { color: var(--status-success-default, #15A877); }
.db-cluster-banner__pct { flex-shrink: 0; min-width: 34px; text-align: right; font-size: 12px; font-weight: 600; color: var(--bg-brand); font-family: var(--code-editor-font-family, monospace); }
.db-cluster-banner.is-end .db-cluster-banner__pct { color: var(--status-success-default, #15A877); }
.db-cluster-banner__chev { flex-shrink: 0; width: 14px; height: 14px; color: var(--db-text-3); }

/* ==================================================================
   移动端适配（kb_search 页）
   所有规则限定在 html.is-mobile 作用域（mobile-core.js 或本页兜底逻辑在
   innerWidth<=768 时打类；PC 宽度永不命中 → 不加移动规则时渲染零差异）。
   ================================================================== */

/* 侧栏抽屉遮罩（元素仅移动端由 JS 创建，样式同限定作用域） */
html.is-mobile .db-sidebar-mask { position: fixed; inset: 0; z-index: 440; background: rgba(0,0,0,.35); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
html.is-mobile .db-sidebar-mask.is-open { opacity: 1; pointer-events: auto; }

/* 布局：左侧栏 → off-canvas 抽屉（顶栏汉堡按钮开合，遮罩点击关闭） */
html.is-mobile .db-sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 450;
  width: min(80vw, 300px) !important;
  transform: translateX(-100%);
  transition: transform .25s ease;
  border-right: 1px solid var(--db-border);
  padding-top: env(safe-area-inset-top, 0px);
  box-sizing: border-box;
}
html.is-mobile .db-sidebar.is-collapsed { width: min(80vw, 300px) !important; overflow: visible; padding: 0; border-right: 1px solid var(--db-border); }
html.is-mobile .db-sidebar.is-collapsed .db-sidebar__top { display: flex; }
html.is-mobile .db-sidebar.is-collapsed .db-sidebar__label { display: block; }
html.is-mobile .db-sidebar.is-collapsed .db-history { display: flex; }
html.is-mobile .db-sidebar.is-collapsed .db-sidebar__bottom { display: block; }
html.is-mobile .db-sidebar.is-drawer-open { transform: translateX(0); box-shadow: 0 10px 40px rgba(0,0,0,.18); }

/* 主区全宽；输入区贴底 + iOS 安全区；textarea 16px 防 iOS 聚焦缩放 */
html.is-mobile .db-input { padding: 8px 12px calc(10px + env(safe-area-inset-bottom, 0px)); }
html.is-mobile .db-input__text { font-size: 16px; }
html.is-mobile .db-input__inner { max-width: 100%; }

/* 连接器/技能 chips 横向滚动不换行 */
html.is-mobile .db-input__chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
html.is-mobile .db-input__chips::-webkit-scrollbar { display: none; }
html.is-mobile .db-input__chips > * { flex-shrink: 0; }
html.is-mobile #inputConnectorChips { display: inline-flex; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
html.is-mobile #inputConnectorChips::-webkit-scrollbar { display: none; }

/* 右侧面板 → 全屏覆盖层（自带头部关闭按钮）；PC 拖拽宽度手柄与宽度档位禁用 */
html.is-mobile .db-chunk-panel.is-open,
html.is-mobile .db-chunk-panel.is-open.w-1-3,
html.is-mobile .db-chunk-panel.is-open.w-1-2,
html.is-mobile .db-chunk-panel.is-open.w-2-3,
html.is-mobile .db-chunk-panel.is-open.is-html {
  position: fixed; inset: 0; z-index: 430;
  width: 100% !important; min-width: 0 !important; max-width: none !important;
  border-left: none;
}
html.is-mobile .db-chunk-panel__handle { display: none; }
html.is-mobile .db-side__width { display: none; }

/* 弹层近全屏 / 贴底：知识库选择弹窗 */
html.is-mobile .db-picker { position: fixed; top: 10px; left: 10px; right: 10px; bottom: 10px; width: auto; max-width: none; max-height: none; transform: none; }
html.is-mobile .db-picker-mask { position: fixed; }
/* 工作空间选择器（JS 设内联 left/top，用 !important 覆盖并贴底弹出） */
html.is-mobile .db-ws-picker { left: 8px !important; right: 8px !important; top: auto !important; bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important; width: auto !important; max-width: none !important; }
/* 技能选择器 / + 菜单 / 模型菜单 / 会话菜单：贴底铺开、不出屏 */
html.is-mobile .db-skill-picker { left: 8px !important; right: 8px !important; top: auto !important; bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important; width: auto !important; max-height: 46vh !important; }
html.is-mobile .db-plus-menu { left: 8px !important; }
html.is-mobile .db-model-menu { max-width: calc(100vw - 16px); }
html.is-mobile .db-chat-menu { max-width: calc(100vw - 16px); }
html.is-mobile .db-dialog { max-width: calc(100vw - 24px); }
html.is-mobile .db-toast { max-width: calc(100vw - 24px); }

/* 会话项「⋯」按钮移动端常显（触屏无 hover；点击仍走既有 openChatMenu 菜单逻辑） */
html.is-mobile .db-history__more { display: flex; }
html.is-mobile .db-history__item { padding-right: 34px; }

/* 顶栏窄屏收纳：标题省略号、副标题隐藏 */
html.is-mobile .db-topbar__title { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.is-mobile .db-topbar__sub { display: none; }

/* 欢迎页地球：仅容器尺寸自适应（three.js 渲染分辨率与加载方式不变） */
html.is-mobile .db-empty { padding: 20px 14px; margin-top: 0; justify-content: flex-start; }
html.is-mobile .db-empty__globe-wrap { margin-bottom: -48px; }
html.is-mobile .db-empty__logo { width: 100%; max-width: 400px; height: auto; aspect-ratio: 400 / 270; }
html.is-mobile .db-empty__logo canvas { width: 100% !important; height: auto !important; aspect-ratio: 400 / 270; }
html.is-mobile .db-empty__title { font-size: 24px; margin-top: -8px; }
html.is-mobile .db-empty__cap-desc { white-space: normal; }
/* 内容高于容器时 flex 居中会把顶部（地球）顶出不可达区域：单列化降低高度并顶端对齐 */
html.is-mobile .db-empty__grid { grid-template-columns: 1fr; }

/* 消息/横幅/内嵌视图窄屏留边 */
html.is-mobile .db-msg { padding: 12px 14px; }
html.is-mobile .db-cluster-banner-wrap { padding: 2px 14px 10px; }
html.is-mobile .db-skillview__head, html.is-mobile .db-autoview__head, html.is-mobile .db-cloudview__head { flex-wrap: wrap; padding: 10px 14px; }
html.is-mobile .db-skillview__search { width: 100%; min-width: 0; }
html.is-mobile .db-skillview__body, html.is-mobile .db-autoview__body { padding: 12px 14px; }
html.is-mobile .db-rundetail__body { padding: 14px; }
html.is-mobile .db-autoview__body { overflow-x: auto; }
html.is-mobile .db-autotable { min-width: 560px; }
html.is-mobile .db-cloudview__body { flex-direction: column; }
html.is-mobile .db-cloudview__side { width: auto; max-height: 150px; border-right: none; border-bottom: 1px solid var(--db-border); }

/* 输入工具栏：允许换行但按钮不压缩——防模型名多行换行/筹码单字竖排，同时保证行尾发送键始终可见（不可横滑出屏） */
html.is-mobile .db-input__bar { flex-wrap: wrap; row-gap: 2px; overflow: visible; }
html.is-mobile .db-input__kb-btn { flex-shrink: 0; white-space: nowrap; }
html.is-mobile .db-input__kb-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.is-mobile .db-input__kb-btn[id="modelPickerBtn"] span { max-width: 34vw; }
html.is-mobile .db-input__plus-btn, html.is-mobile .db-input__sep, html.is-mobile .db-ctx-ring { flex-shrink: 0; }
html.is-mobile .db-input__send-btn, html.is-mobile #sendBtn { flex-shrink: 0; margin-left: auto; }
html.is-mobile .db-cloudview__crumbs { padding: 8px 14px; }
html.is-mobile .db-autotabs { padding: 0 14px; }

/* ===== 资源市场（并入 #connectorView / #skillView，复用 .db-skillview 骨架与 .hub-card 卡片体系） ===== */
.db-mkt-tools { align-items: center; min-width: 0; }
.db-mkt-source { width: 170px; min-width: 120px; appearance: auto; }
.db-mkt-badge { display: inline-block; font-size: 10px; line-height: 1.5; padding: 1px 6px; border-radius: 4px; margin-right: 6px; vertical-align: 1px; white-space: nowrap; }
.db-mkt-badge--install { background: rgba(83,104,255,.1); color: var(--bg-brand); }
.db-mkt-badge--manual, .db-mkt-badge--link { background: var(--db-hover); color: var(--db-text-3); }
.db-mkt-status { display: inline-block; font-size: 11px; line-height: 1.6; padding: 1px 8px; border-radius: 999px; background: var(--db-hover); color: var(--db-text-3); }
.db-mkt-group { margin-bottom: 24px; }
.db-mkt-group__head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.db-mkt-group__name { font-size: 13px; font-weight: 600; color: var(--db-text); }
.db-mkt-group__count { font-size: 11px; color: var(--db-text-3); }
.db-mkt-more { font-size: 11px; color: var(--db-text-3); margin-top: 8px; }
/* 市场结果宿主容器：与原 #marketList 同为 .db-skillview__body，仅需覆盖切换显示 */
.db-mkt-hostbody { display: none; }
/* 市场卡片字母占位头像：token 底色 + 品牌色首字符；img 绝对定位盖在其上，onerror 移除即降级 */
.db-mkt-avatar { position: relative; display: flex; align-items: center; justify-content: center; color: var(--bg-brand); font-weight: 700; background: color-mix(in srgb, var(--bg-brand) 10%, var(--db-bg)); overflow: hidden; }
.db-mkt-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.db-mkt-cli-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.db-mkt-cli-card .hub-card__title { font-size: 15px; }
.db-mkt-cli-url { font-size: 11px; color: var(--db-text-3); font-family: var(--code-editor-font-family, ui-monospace, SFMono-Regular, Menlo, monospace); word-break: break-all; }
.db-mkt-tips { max-width: 860px; }
.db-mkt-tip { background: var(--db-bg); border: 1px solid var(--db-border); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.db-mkt-tip__title { font-size: 14px; font-weight: 600; color: var(--db-text); margin-bottom: 4px; }
.db-mkt-tip__desc { font-size: 12px; color: var(--db-text-2); line-height: 1.6; }
.db-mkt-tip__cmds { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.db-mkt-cmd { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--bg-overlay-l1, var(--db-hover)); border: 1px solid var(--db-border); border-radius: 8px; padding: 8px 10px; }
.db-mkt-cmd code { font-family: var(--code-editor-font-family, ui-monospace, SFMono-Regular, Menlo, monospace); font-size: 12px; color: var(--db-text); word-break: break-all; white-space: pre-wrap; }
.db-mkt-cmd__copy { flex-shrink: 0; padding: 3px 10px; border-radius: 6px; border: 1px solid var(--db-border); background: var(--db-bg); color: var(--db-text-2); font-size: 12px; cursor: pointer; font-family: inherit; }
.db-mkt-cmd__copy:hover { border-color: var(--bg-brand); color: var(--bg-brand); }
.db-mkt-tip__links { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.db-mkt-link { font-size: 12px; color: var(--bg-brand); text-decoration: none; word-break: break-all; }
.db-mkt-link:hover { text-decoration: underline; }
.db-mkt-error { text-align: center; padding: 48px 0; color: var(--db-text-2); font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
/* 骨架屏：6 张灰条动画卡片 */
.db-mkt-skl-wrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.db-mkt-skl { background: var(--db-bg); border: 1px solid var(--db-border); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.db-mkt-skl__bar { height: 12px; border-radius: 6px; background: var(--db-hover); animation: db-mkt-pulse 1.4s ease-in-out infinite; }
.db-mkt-skl__bar--t { width: 55%; height: 14px; }
.db-mkt-skl__bar--s { width: 40%; opacity: .6; }
@keyframes db-mkt-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

/* 移动端：连接器管理 / 技能管理 的市场页签（对齐原 #marketView 页签移动样式） */
html.is-mobile .db-skillview__head > div { min-width: 0; }   /* 头部行可收缩，防 [返回|标题|页签] 行把视图撑出横向滚动 */
html.is-mobile .db-skilltabs { min-width: 0; max-width: 100%; overflow-x: auto; scrollbar-width: none; flex-shrink: 1; }
html.is-mobile .db-skilltabs::-webkit-scrollbar { display: none; }
html.is-mobile .db-skilltab { white-space: nowrap; flex-shrink: 0; }
html.is-mobile .db-skillview__back, html.is-mobile .db-skillview__count { flex-shrink: 0; }
html.is-mobile .db-skillview__title { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.is-mobile #mktTools { width: 100%; flex-wrap: wrap; }
html.is-mobile #marketSearchInput { flex: 1 1 160px; width: auto; min-width: 0; }
html.is-mobile .db-mkt-source { flex: 0 0 auto; width: auto; max-width: 46vw; }
html.is-mobile #connectorMarketList, html.is-mobile #skillMarketList { padding: 12px 14px; }
html.is-mobile .db-mkt-skl-wrap, html.is-mobile .db-mkt-cli-grid { grid-template-columns: 1fr; }
html.is-mobile .db-mkt-tips { max-width: 100%; }

/* ===== 工作空间文件浏览（右侧「工作空间文件」页签 + pick-ws 顶部入口） ===== */
.db-ws-picker__files-entry { color: var(--bg-brand); font-weight: 600; }
/* 工作空间列表加载骨架 / 失败重试（_wsPickerReload 用） */
.db-ws-picker__loading { padding: 28px 12px; text-align: center; color: var(--db-text-3); font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.db-ws-picker__retry { padding: 5px 16px; border-radius: 6px; border: 1px solid var(--db-border); background: var(--bg-overlay-l1, #fff); color: var(--db-text-2); font-size: 12px; cursor: pointer; font-family: inherit; }
.db-ws-picker__retry:hover { border-color: var(--bg-brand); color: var(--bg-brand); }
.db-ws-picker__files-entry .db-ws-picker__ico { color: var(--bg-brand); }
.db-ws-picker__files-entry:hover { background: color-mix(in srgb, var(--bg-brand) 8%, transparent); }
.db-ws-picker__entry-arrow { flex-shrink: 0; color: var(--bg-brand); font-size: 15px; line-height: 1; }
.db-ws-picker__sep { height: 1px; background: var(--db-border); margin: 4px 2px; flex-shrink: 0; }
.db-wsfiles { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--db-bg); }
.db-wsfiles__head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--db-border); flex-shrink: 0; min-width: 0; }
.db-wsfiles__ws { display: inline-flex; align-items: center; gap: 6px; color: var(--db-text-2); font-size: 12px; font-weight: 600; min-width: 0; flex: 1; }
.db-wsfiles__ws svg { flex-shrink: 0; }
.db-wsfiles__ws-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.db-wsfiles__count { flex-shrink: 0; font-size: 11px; color: var(--db-text-3); background: var(--db-hover); border-radius: 999px; padding: 1px 8px; }
.db-wsfiles__refresh { flex-shrink: 0; border: 1px solid var(--db-border); background: var(--bg-overlay-l1, transparent); color: var(--db-text-2); font-size: 11px; border-radius: 6px; padding: 3px 10px; cursor: pointer; font-family: inherit; line-height: 1.4; }
.db-wsfiles__refresh:hover { border-color: var(--bg-brand); color: var(--bg-brand); }
.db-wsfiles__list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 8px calc(12px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 2px; }
.db-wsfiles__row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; min-width: 0; }
.db-wsfiles__row:hover { background: var(--db-hover); }
.db-wsfiles__ico { flex-shrink: 0; min-width: 34px; height: 20px; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; background: var(--db-hover); color: var(--db-text-3); font-size: 9px; font-weight: 700; letter-spacing: .4px; padding: 0 5px; }
.db-wsfiles__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.db-wsfiles__name { font-size: 13px; color: var(--db-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-wsfiles__meta { font-size: 11px; color: var(--db-text-3); }
.db-wsfiles__acts { display: none; flex-shrink: 0; gap: 4px; align-items: center; }
.db-wsfiles__row:hover .db-wsfiles__acts { display: inline-flex; }
.db-wsfiles__act { border: 1px solid var(--db-border); background: var(--bg-overlay-l1, var(--db-bg)); color: var(--db-text-2); font-size: 11px; border-radius: 6px; padding: 3px 9px; cursor: pointer; text-decoration: none; font-family: inherit; line-height: 1.4; white-space: nowrap; }
.db-wsfiles__act:hover { border-color: var(--bg-brand); color: var(--bg-brand); }
.db-wsfiles__act.is-disabled { opacity: .45; cursor: not-allowed; }
.db-wsfiles__empty { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; padding: 32px 20px; font-size: 13px; color: var(--db-text-3); text-align: center; line-height: 1.7; }
/* 移动端：触屏无 hover，操作常显；行高加大保证触控目标 */
html.is-mobile .db-wsfiles__row { padding: 11px 8px; }
html.is-mobile .db-wsfiles__acts { display: inline-flex; }
html.is-mobile .db-wsfiles__act { padding: 6px 12px; font-size: 12px; }

/* Agent 集群页签：四周留白 + 卡片白底浮起（与面板底色区分） */
.db-chunk-panel[data-kind="cluster"] .db-chunk-panel__body {
  padding: 14px;
  background: var(--db-hover, #f7f8fa);
}
.db-chunk-panel[data-kind="cluster"] .db-cluster__summary,
.db-chunk-panel[data-kind="cluster"] .db-cluster__agent {
  background: #fff;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
}

/* 上下文容量面板：整体圆环 + 分类进度条 */
.ctx-pop__top { display: flex; align-items: center; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border-neutral-l1); margin-bottom: 8px; }
.ctx-pop__ring { flex: none; width: 84px; height: 84px; }
.ctx-pop__ring svg { display: block; width: 100%; height: 100%; }
.ctx-pop__meta { min-width: 0; }
.ctx-pop__pct { font-size: 24px; font-weight: 700; font-family: var(--font-family-metric, inherit); line-height: 1.1; }
.ctx-pop__num { font-size: 12px; color: var(--text-secondary); margin-top: 6px; }
.ctx-pop__warn { font-size: 11px; color: #E8463A; margin-top: 6px; }
.ctx-pop__row { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.ctx-pop__track { flex: 1; height: 6px; border-radius: 999px; background: var(--db-hover, #f2f3f6); overflow: hidden; }
.ctx-pop__fill { display: block; height: 100%; border-radius: 999px; }
.ctx-pop__val { flex: none; min-width: 44px; text-align: right; font-size: 12px; color: var(--text-default); font-variant-numeric: tabular-nums; }

/* MCP 市场卡片统一徽标（上游无图标时的插头 glyph，替代字母头像） */
.db-mkt-glyph {
  position: relative; width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 10px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #4F63F0, #7B5CF0);
  color: #fff;
}
.db-mkt-glyph svg { opacity: .95; }
/* 徽标/图链以 icon 盒为定位上下文，避免相对卡片定位盖住标题 */
.db-mkt-avatar { position: relative; overflow: hidden; }

/* 语音输入录音中脉冲 + 朗读开启高亮 */
.db-input__kb-btn.is-recording { color: #e02d3c; animation: db-voice-pulse 1.1s ease-in-out infinite; }
.db-input__kb-btn.is-recording svg { animation: none; }
@keyframes db-voice-pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ===== 语音输入：激活蓝色 + 音波动画 ===== */
.db-input__kb-btn.is-recording { color: #5368ff; }
.db-input__kb-btn .db-voice-wave { display: none; align-items: flex-end; gap: 2px; height: 14px; }
.db-input__kb-btn.is-recording .db-voice-mic { display: none; }
.db-input__kb-btn.is-recording .db-voice-wave { display: inline-flex; }
.db-voice-wave i {
  width: 3px; border-radius: 2px; background: #5368ff;
  animation: db-voice-wave 0.9s ease-in-out infinite;
}
.db-voice-wave i:nth-child(1) { height: 6px; animation-delay: 0s; }
.db-voice-wave i:nth-child(2) { height: 10px; animation-delay: 0.15s; }
.db-voice-wave i:nth-child(3) { height: 14px; animation-delay: 0.3s; }
.db-voice-wave i:nth-child(4) { height: 10px; animation-delay: 0.45s; }
.db-voice-wave i:nth-child(5) { height: 6px; animation-delay: 0.6s; }
@keyframes db-voice-wave { 0%,100% { transform: scaleY(0.4); } 50% { transform: scaleY(1); } }
.db-msg__action.is-playing { color: #5368ff; font-weight: 600; }

/* ---- 链接附件卡片 + 拖拽链接高亮 ---- */
.db-att__icon.ext-url {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none'%3E%3Ccircle cx='12' cy='12' r='9' stroke='%235368ff' stroke-width='1.8'/%3E%3Cpath d='M3.5 12h17M12 3.3c2.6 2.3 4 5.4 4 8.7s-1.4 6.4-4 8.7c-2.6-2.3-4-5.4-4-8.7s1.4-6.4 4-8.7z' stroke='%235368ff' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 20px;
}
.db-input__box.is-dragover { border: 1.5px dashed #5368ff !important; background: rgba(83,104,255,.05); }
.db-input__box.is-dragover::after {
  content: "松开以添加网页链接";
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.86); color: #5368ff; font-size: 14px; font-weight: 600;
  border-radius: 20px; pointer-events: none; z-index: 5;
}
.db-input__box { position: relative; }
