/* Toolbox View v1.0 — 工具庫唯讀總覽 */
main.tbv-on > :not(#tbv-root) { display: none !important; }
#tbv-root { --tbv-accent: var(--accent, #5b5bd6); --tbv-tint: var(--accent-tint, #f1f1fd); --tbv-border: var(--border-default, #e7e7ea); --tbv-muted: var(--text-muted, #71717a); --tbv-text: var(--text-primary, #18181b); --tbv-sub: var(--text-secondary, #52525b); color: var(--tbv-text); }
.tbv-wrap { max-width: 1240px; margin: 0 auto; padding: 28px 28px 80px; box-sizing: border-box; }
.tbv-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.tbv-title { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: .01em; }
.tbv-head p { margin: 6px 0 0; font-size: 14px; line-height: 1.7; color: var(--tbv-sub); max-width: 760px; }
.tbv-ask { flex: none; border: 0; border-radius: 10px; background: var(--tbv-accent); color: #fff; font: inherit; font-size: 14px; font-weight: 600; padding: 10px 16px; cursor: pointer; white-space: nowrap; }
.tbv-ask:hover { filter: brightness(.95); }
.tbv-examples { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0 22px; padding: 12px 14px; border-radius: 12px; background: var(--tbv-tint); border: 1px solid rgba(91, 91, 214, .15); }
.tbv-examples__label { font-size: 13px; font-weight: 600; color: var(--tbv-accent); margin-right: 2px; }
.tbv-example { border: 1px solid rgba(91, 91, 214, .25); background: #fff; color: var(--tbv-sub); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.tbv-example:hover { border-color: var(--tbv-accent); color: var(--tbv-accent); }
.tbv-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.tbv-search { flex: 0 1 340px; min-width: 200px; height: 38px; border: 1px solid var(--tbv-border); border-radius: 10px; padding: 0 12px; font: inherit; font-size: 14px; background: #fff; box-sizing: border-box; }
.tbv-search:focus { outline: none; border-color: var(--tbv-accent); box-shadow: 0 0 0 3px rgba(91, 91, 214, .12); }
.tbv-bar__meta { font-size: 13px; color: var(--tbv-muted); }
.tbv-sec { margin-bottom: 26px; }
.tbv-sec h2 { margin: 0 0 12px; font-size: 16px; font-weight: 700; display: flex; align-items: baseline; gap: 10px; }
.tbv-sec h2 small, .tbv-fold small { font-size: 12.5px; font-weight: 400; color: var(--tbv-muted); }
.tbv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.tbv-card { display: flex; flex-direction: column; gap: 8px; text-align: left; border: 1px solid var(--tbv-border); border-radius: 14px; background: #fff; padding: 16px; font: inherit; color: inherit; cursor: pointer; box-sizing: border-box; min-width: 0; transition: border-color .12s, box-shadow .12s; }
.tbv-card:hover { border-color: rgba(91, 91, 214, .45); box-shadow: 0 4px 14px rgba(24, 24, 27, .06); }
.tbv-card--static { cursor: default; }
.tbv-card--static:hover { border-color: var(--tbv-border); box-shadow: none; }
.tbv-card__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.tbv-card__name { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbv-card__desc { font-size: 13px; line-height: 1.6; color: var(--tbv-sub); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: 3.2em; }
.tbv-card__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: auto; }
.tbv-card__count { font-size: 12.5px; color: var(--tbv-muted); margin-right: 2px; }
.tbv-card__date { font-size: 12px; color: var(--tbv-muted); }
.tbv-chip { display: inline-block; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #f4f4f5; color: var(--tbv-sub); }
.tbv-chip--more { background: var(--tbv-tint); color: var(--tbv-accent); }
.tbv-badge { flex: none; font-size: 11.5px; padding: 2px 8px; border-radius: 6px; background: var(--tbv-tint); color: var(--tbv-accent); white-space: nowrap; }
.tbv-badge--ok { background: #e7f6ee; color: #18794e; }
.tbv-muted { font-size: 12.5px; color: var(--tbv-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbv-fold { display: flex; align-items: center; gap: 8px; border: 0; background: none; font: inherit; font-size: 16px; font-weight: 700; padding: 4px 0; cursor: pointer; color: inherit; }
.tbv-fold__arrow { display: inline-block; transition: transform .15s; color: var(--tbv-muted); }
.tbv-fold.is-open .tbv-fold__arrow { transform: rotate(90deg); }
.tbv-list { margin-top: 10px; border: 1px solid var(--tbv-border); border-radius: 12px; background: #fff; overflow: hidden; }
.tbv-row { display: grid; grid-template-columns: 220px 1fr auto auto; gap: 14px; align-items: center; width: 100%; text-align: left; border: 0; border-bottom: 1px solid #f0f0f2; background: none; font: inherit; padding: 9px 14px; cursor: pointer; color: inherit; }
.tbv-row:last-child { border-bottom: 0; }
.tbv-row:hover { background: #fafafb; }
.tbv-row__name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbv-row__desc { font-size: 12.5px; color: var(--tbv-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbv-row__count { font-size: 12px; color: var(--tbv-muted); white-space: nowrap; }
.tbv-empty { border: 1px dashed var(--tbv-border); border-radius: 14px; padding: 28px; text-align: center; background: #fff; }
.tbv-empty b { font-size: 15px; }
.tbv-empty p { margin: 6px auto 0; font-size: 13.5px; line-height: 1.7; color: var(--tbv-sub); max-width: 560px; }
.tbv-empty--sm { padding: 16px; text-align: left; }
.tbv-empty--sm p { margin: 0; max-width: none; }
.tbv-loading { padding: 40px; text-align: center; color: var(--tbv-muted); font-size: 14px; }
.tbv-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.tbv-stats div { display: flex; flex-direction: column; gap: 2px; }
.tbv-stats b { font-size: 18px; }
.tbv-stats span { font-size: 12px; color: var(--tbv-muted); }
.tbv-endpoint { font-size: 12px; color: var(--tbv-muted); background: #f8f8fa; border-radius: 8px; padding: 6px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.tbv-ov { position: fixed; inset: 0; z-index: 2060; background: rgba(15, 15, 20, .45); display: grid; place-items: center; padding: 16px; }
.tbv-modal { width: min(860px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: #fff; border-radius: 16px; box-shadow: 0 24px 70px rgba(0, 0, 0, .28); padding: 22px 24px 20px; box-sizing: border-box; }
.tbv-modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tbv-modal__head h3 { margin: 0 0 4px; font-size: 19px; }
.tbv-x { border: 0; background: none; font-size: 26px; line-height: 1; color: var(--tbv-muted); cursor: pointer; width: 34px; height: 34px; border-radius: 8px; }
.tbv-x:hover { background: #f4f4f5; }
.tbv-modal__desc { margin: 12px 0; font-size: 14px; line-height: 1.7; color: var(--tbv-sub); }
.tbv-modal__agents { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 14px; }
.tbv-modal__agents b { margin-right: 4px; }
.tbv-modal__label { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.tbv-md { margin: 0; max-height: 46vh; overflow: auto; white-space: pre-wrap; word-break: break-word; font-size: 12.5px; line-height: 1.6; background: #f8f8fa; border: 1px solid #efeff2; border-radius: 10px; padding: 12px 14px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.tbv-modal__foot { display: flex; justify-content: flex-end; margin-top: 14px; }
@media (max-width: 720px) {
  .tbv-wrap { padding: 18px 16px 70px; }
  .tbv-head { flex-direction: column; }
  .tbv-row { grid-template-columns: 1fr auto; }
  .tbv-row__desc { display: none; }
}
#tbv-root .lph-bar, #tbv-root .lph-hbtn { display: none !important; }
.tbv-stats b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* v1.0.3：「請 AI 幫我」固定在右下角；工具庫頁不顯示「建立 Agent 團隊」浮動鈕，避免兩顆疊在一起 */
.tbv-head .tbv-ask { position: fixed; right: 24px; bottom: 24px; z-index: 66; border-radius: 999px; padding: 12px 20px; font-size: 15px; box-shadow: 0 8px 24px rgba(91, 91, 214, .35); }
body:has(main.tbv-on) [class*="_fab_"] { display: none !important; }
/* v1.3 連結工具 */
.lnk-promise { margin: 0 0 22px; padding: 12px 16px; border-radius: 12px; background: #f6faf7; border: 1px solid #d6eedd; font-size: 13.5px; line-height: 1.7; color: var(--tbv-sub); }
.lnk-promise b { color: #18794e; margin-right: 8px; }
.lnk-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: #f4f4f5; margin-bottom: 14px; }
.lnk-tab { border: 0; background: none; font: inherit; font-size: 13.5px; padding: 7px 14px; border-radius: 9px; cursor: pointer; color: var(--tbv-sub); display: inline-flex; align-items: center; gap: 6px; }
.lnk-tab.is-on { background: #fff; color: var(--tbv-text); font-weight: 600; box-shadow: 0 1px 3px rgba(24, 24, 27, .1); }
.lnk-tab__n { font-size: 11.5px; color: var(--tbv-muted); }
.lnk-note { margin: 14px 0 0; font-size: 13px; color: #8a5a00; background: #fff8e6; border: 1px solid #f5e1ad; border-radius: 10px; padding: 8px 12px; }
.lnk-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.lnk-card { gap: 10px; }
.lnk-card.is-on { border-color: #bfe5cd; }
.lnk-tag { font-size: 13px; color: var(--tbv-muted); margin-top: -4px; }
.lnk-list b { display: block; font-size: 12.5px; font-weight: 600; color: var(--tbv-text); margin-bottom: 4px; }
.lnk-list ul, .lnk-list ol { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.65; color: var(--tbv-sub); }
.lnk-steps { background: #f8f8fa; border-radius: 10px; padding: 10px 12px; }
.lnk-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; padding-top: 4px; }
.lnk-how { border: 0; background: none; font: inherit; font-size: 13px; color: var(--tbv-accent); cursor: pointer; padding: 6px 0; }
.lnk-how:hover { text-decoration: underline; }
.lnk-go { border: 1px solid var(--tbv-accent); background: #fff; color: var(--tbv-accent); font: inherit; font-size: 13px; font-weight: 600; border-radius: 9px; padding: 7px 12px; cursor: pointer; }
.lnk-go:hover { background: var(--tbv-accent); color: #fff; }
.lnk-badge--off { background: #f4f4f5; color: var(--tbv-muted); }
.lnk-badge--local { background: #fff4e0; color: #8a5a00; }
/* v1.3.2 已連結 Agent 細節 */
.lnk-agents { align-items: center; }
.lnk-agent { border: 1px solid #bfe5cd; background: #f3fbf6; color: #18794e; font: inherit; font-size: 12px; cursor: pointer; }
.lnk-agent:hover { background: #e7f6ee; border-color: #18794e; }
.lnk-modal { width: min(600px, 100%); }
.lnk-rows { margin: 16px 0 4px; border: 1px solid var(--tbv-border); border-radius: 12px; overflow: hidden; }
.lnk-row { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 10px 14px; border-bottom: 1px solid #f0f0f2; font-size: 13.5px; line-height: 1.6; }
.lnk-row:last-child { border-bottom: 0; }
.lnk-row > span { color: var(--tbv-muted); }
.lnk-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #a1a1aa; margin-right: 6px; vertical-align: 1px; }
.lnk-dot.is-on { background: #18a058; }
.lnk-warn { color: #b45309; }
.lnk-modal__foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 16px; }
a.lnk-go { text-decoration: none; display: inline-flex; align-items: center; }
.lnk-off { border: 1px solid #f1c4c4; background: #fff; color: #c2410c; font: inherit; font-size: 13px; font-weight: 600; border-radius: 9px; padding: 7px 12px; cursor: pointer; }
.lnk-off:hover { background: #fff4f2; }
