/* ========================================
   mmguo — Prompt Code Block Component Styles
   Reusable terminal-style prompt display block
   ======================================== */

/* Code block container */
.code-container {
  background: var(--code-bg);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #c8c3b8;
  box-shadow: 0 12px 40px rgba(0,0,0,0.06);
}

/* Code toolbar */
.code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #ddd9cf;
  border-bottom: 1px solid #c8c3b8;
  gap: 8px;
}
.toolbar-left {
  display: flex;
  align-items: center;
  gap: 6px;
}
.toolbar-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.toolbar-dot:nth-child(1) { background: #ff5f57; }
.toolbar-dot:nth-child(2) { background: #febc2e; }
.toolbar-dot:nth-child(3) { background: #28c840; }
.toolbar-label {
  font-size: 12px;
  color: #6b665c;
  margin-left: 10px;
}
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.toolbar-btn {
  font-family: inherit;
  font-size: 11px;
  padding: 4px 10px;
  border: 1px solid #b5b0a6;
  background: transparent;
  color: #6b665c;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.toolbar-btn:hover {
  background: #d0cbc0;
  color: #2a2825;
  border-color: #9a9588;
}
.toolbar-btn.active {
  background: #d0cbc0;
  color: #2a2825;
  border-color: #9a9588;
}
.copy-btn.copied {
  color: #4a8c6f;
  border-color: #4a8c6f;
  background: rgba(74,140,111,0.1);
}

/* Copy toast */
.copy-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  background: #2a2825;
  color: #e8e4db;
  font-family: inherit;
  font-size: 13px;
  padding: 12px 28px;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 999;
  letter-spacing: 0.03em;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}
.copy-toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Code content */
.code-body {
  padding: 24px;
  overflow-x: auto;
  max-height: 70vh;
  overflow-y: auto;
}
.code-body::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.code-body::-webkit-scrollbar-track { background: transparent; }
.code-body::-webkit-scrollbar-thumb {
  background: #c8c3b8;
  border-radius: 3px;
}

/* Rendered markdown view */
.rendered-view {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--code-fg);
}
.rendered-view .section-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #2a2825;
  background: #57c5c8;
  padding: 2px 8px;
  border-radius: 3px;
  margin: 24px 0 12px;
  letter-spacing: 0.04em;
}
.rendered-view .section-tag:first-child {
  margin-top: 0;
}
.rendered-view .section-body {
  color: #4a4640;
  margin-bottom: 8px;
}
.rendered-view .phase-title {
  font-size: 14px;
  font-weight: 600;
  color: #1d1b1b;
  margin: 20px 0 10px;
  border-bottom: 1px solid #c8c3b8;
  padding-bottom: 6px;
}
.rendered-view .sub-item {
  margin-left: 16px;
  margin-bottom: 6px;
  color: #5a5650;
}
.rendered-view .sub-item strong,
.rendered-view .section-body strong {
  color: #1d1b1b;
  font-weight: 600;
}
.rendered-view .sub-item em,
.rendered-view .section-body em {
  color: #8a6540;
  font-style: italic;
}
.rendered-view .analysis-goal {
  color: #4a8c6f;
  font-size: 12px;
  font-style: italic;
  margin-left: 16px;
  margin-top: 4px;
}
.rendered-view .output-structure {
  margin-left: 16px;
  color: #3a6b8a;
  font-size: 12.5px;
  line-height: 1.8;
}
.rendered-view .user-input-placeholder {
  display: block;
  margin: 10px 0;
  padding: 12px 16px;
  background: rgba(0,0,0,0.03);
  border: 1px dashed #b5b0a6;
  border-radius: 6px;
  color: #8a857b;
  font-style: italic;
  font-size: 13px;
}
.rendered-view .emoji {
  margin-right: 4px;
}

/* Raw view */
.raw-view {
  font-size: 13px;
  line-height: 1.65;
  color: #5a5650;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 600px) {
  .code-body { padding: 16px; }
}
