/* 工具箱：右下角悬浮小窗，状态存 sessionStorage，不依赖 URL。 */

.toolkit-toggle {
  background: transparent;
  border: none;
  color: #cbd5e1;
  cursor: pointer;
  font: inherit;
  padding: 0;
}
.toolkit-toggle:hover { color: #ffffff; }

.toolkit {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 280px;
  max-width: calc(100vw - 2rem);
  max-height: 72vh;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.22);
  z-index: 900;
  overflow: hidden;
}
.toolkit[hidden] { display: none; }

.toolkit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.85rem;
  background: #0f172a;
  color: #ffffff;
  flex: 0 0 auto;
}
.toolkit-title { font-weight: 600; font-size: 0.85rem; }
.toolkit-close {
  background: transparent;
  border: none;
  color: #cbd5e1;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0 0.2rem;
}
.toolkit-close:hover { color: #ffffff; }

.toolkit-tabs {
  display: flex;
  gap: 0.4rem;
  padding: 0.5rem 0.7rem 0;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.toolkit-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  padding: 0.2rem 0.5rem 0.4rem;
}
.toolkit-tab.active {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--primary);
}

.toolkit-body {
  padding: 0.85rem;
  overflow-y: auto;
}

/* 工具通用字段 */
.tool-field { margin-bottom: 0.6rem; }
.tool-field label { display: block; margin-bottom: 0.25rem; font-weight: 600; }
.tool-input {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  font: inherit;
}
.tool-output {
  min-height: 3rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafc;
  word-break: break-all;
  margin-bottom: 0.6rem;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
.tool-output.tool-error { color: #dc2626; }
.tool-actions { display: flex; gap: 0.5rem; }

@media (max-width: 480px) {
  .toolkit {
    right: 0.5rem;
    left: 0.5rem;
    bottom: 0.5rem;
    width: auto;
  }
}
