/* Tool Maker demo — 草稿区 / 我的工具 */

.ext-panel {
  display: none;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.ext-panel.is-visible {
  display: flex;
}

.my-tools-panel {
  flex: 1;
  overflow-y: auto;
  padding: 4px 10px 12px;
}

.my-tools-actions {
  display: flex;
  gap: 8px;
  padding: 6px 2px 10px;
}

.my-tools-actions .btn-mini {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 6px;
  border: none;
  border-radius: 6px;
  background: var(--accent-blue);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  cursor: default;
}

.staging-card {
  margin: 4px 0 10px;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(245, 158, 11, 0.45);
  background: linear-gradient(135deg, #fffbeb 0%, #fff7ed 100%);
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  max-height: 0;
  overflow: hidden;
  pointer-events: none;
  transition:
    opacity 0.45s ease,
    transform 0.45s ease,
    max-height 0.5s ease,
    margin 0.4s ease;
}

.staging-card.is-revealed {
  opacity: 1;
  transform: none;
  max-height: 200px;
  pointer-events: auto;
}

.staging-card.is-promoted {
  opacity: 0;
  transform: translateY(-6px) scale(0.96);
  max-height: 0;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
}

.staging-card__head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.staging-card__logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--accent-blue);
  flex-shrink: 0;
}

.staging-card__meta {
  flex: 1;
  min-width: 0;
}

.staging-card__title {
  font-size: 12px;
  font-weight: 600;
  color: var(--title-text);
}

.staging-card__desc {
  font-size: 11px;
  color: var(--muted-text);
  margin-top: 2px;
}

.staging-card__badge {
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  color: #b45309;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.25);
  white-space: nowrap;
}

.staging-card__actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.btn-promote-staging {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid rgba(245, 158, 11, 0.55);
  background: rgba(255, 255, 255, 0.65);
  color: var(--title-text);
  font-size: 11px;
  font-weight: 500;
  cursor: default;
  transition:
    box-shadow 0.25s,
    border-color 0.25s;
}

.btn-promote-staging.is-highlight {
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.28);
  border-color: #f59e0b;
}

.market-card.is-pick-highlight {
  box-shadow:
    0 0 0 2px rgba(21, 101, 192, 0.45),
    0 8px 24px rgba(37, 99, 235, 0.15);
  background: rgba(239, 246, 255, 0.85);
  animation: pick-pulse 1.2s ease infinite;
}

@keyframes pick-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 2px rgba(21, 101, 192, 0.35);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(21, 101, 192, 0.12);
  }
}

.ext-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.saved-tool-row {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  pointer-events: none;
  transition:
    opacity 0.45s ease,
    max-height 0.5s ease;
}

.saved-tool-row.is-revealed {
  opacity: 1;
  max-height: 120px;
  pointer-events: auto;
}

.saved-tool-row .market-card {
  border: 1px solid rgba(21, 101, 192, 0.2);
  background: rgba(239, 246, 255, 0.5);
}

/* Demo act switching */
body.demo-act-toolmaker .extract-overlay {
  display: none;
}

body.demo-act-watermark [data-demo-act="toolmaker"],
body.demo-act-toolmaker [data-demo-act="watermark"] {
  display: none !important;
}

body.demo-act-toolmaker .session-item--watermark {
  display: none;
}

body.demo-act-toolmaker .session-item--toolmaker {
  display: flex;
}

.session-item--toolmaker {
  display: none;
}

/* Tool maker staged messages */
body.demo-act-toolmaker.promo-staged [data-tm-reveal]:not(.is-revealed) {
  opacity: 0;
  transform: translateY(10px);
  max-height: 0;
  overflow: hidden;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  pointer-events: none;
}

body.demo-act-toolmaker.promo-staged [data-tm-reveal].is-revealed {
  opacity: 1;
  transform: none;
  max-height: 4000px;
  overflow: visible;
  pointer-events: auto;
}

.tm-code-block {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  line-height: 1.45;
  padding: 8px 10px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  white-space: pre-wrap;
  min-height: 3.2em;
}

.tm-code-block.is-typing::after {
  content: "▋";
  animation: tm-cursor-blink 0.8s step-end infinite;
  color: #2563eb;
}

@keyframes tm-cursor-blink {
  50% {
    opacity: 0;
  }
}

.trace-tile.is-lit {
  border-color: rgba(21, 101, 192, 0.35);
  background: rgba(239, 246, 255, 0.65);
}

.promo-toast {
  position: absolute;
  top: 44px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  z-index: 100;
  max-width: calc(100% - 28px);
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  color: #1f2937;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(148, 163, 184, 0.32);
  box-shadow:
    0 8px 24px rgba(96, 165, 250, 0.12),
    0 2px 8px rgba(15, 23, 42, 0.06);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
}

.promo-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
