

/* ── Python 실행기 ── */
.code-run-btn {
  background: linear-gradient(135deg,#6c63ff,#48cfad);
  color:#fff; border:none; border-radius:6px;
  padding:4px 12px; font-size:.78rem; font-weight:700;
  cursor:pointer; display:inline-flex; align-items:center; gap:5px;
  transition:opacity .2s, transform .15s;
}
.code-run-btn:hover { opacity:.85; transform:translateY(-1px); }
.code-run-btn:disabled { opacity:.5; cursor:not-allowed; transform:none; }
.code-run-btn.running { background:linear-gradient(135deg,#f39c12,#e74c3c); }

.code-output-box {
  display:none;
  margin-top:8px;
  border-radius:10px;
  overflow:hidden;
  border:1px solid rgba(108,99,255,.2);
  font-family:'JetBrains Mono','Fira Code','Consolas',monospace;
  font-size:.82rem;
}
.code-output-header {
  background:rgba(108,99,255,.1);
  padding:6px 14px;
  display:flex; align-items:center; justify-content:space-between;
  border-bottom:1px solid rgba(108,99,255,.15);
  font-size:.75rem; font-weight:700; color:#6c63ff;
}
.code-output-header .gpu-badge {
  font-size:.65rem; padding:2px 8px; border-radius:99px;
  background:linear-gradient(135deg,#11998e,#38ef7d);
  color:#fff; font-weight:700;
}
.code-output-content {
  padding:12px 16px;
  background:var(--card-bg,#1e1e2e);
  color:#e0e0e0;
  min-height:40px;
  max-height:320px;
  overflow-y:auto;
  white-space:pre-wrap;
  word-break:break-all;
}
.code-output-content.has-error { color:#ff6b6b; }
.code-output-content.has-success { color:#6bffb8; }
.output-spinner {
  display:inline-block; width:12px; height:12px;
  border:2px solid rgba(108,99,255,.3); border-top-color:#6c63ff;
  border-radius:50%; animation:spin .8s linear infinite; margin-right:6px;
}
@keyframes spin { to { transform:rotate(360deg); } }

/* 패키지 설치 로그 */
.pkg-install-log {
  font-size:.75rem; color:#48cfad; padding:4px 16px 8px;
  background:rgba(72,207,173,.06); border-top:1px solid rgba(72,207,173,.1);
}
/* GPU 상태 인디케이터 */
.gpu-status-bar {
  display:none; align-items:center; gap:8px;
  padding:6px 14px; font-size:.75rem;
  background:rgba(17,153,142,.08);
  border-bottom:1px solid rgba(17,153,142,.15);
  color:#11998e; font-weight:600;
}
.gpu-dot { width:8px; height:8px; border-radius:50%; background:#38ef7d;
  box-shadow:0 0 6px #38ef7d; animation:pulse-glow 1.5s ease-in-out infinite; }
@keyframes pulse-glow { 0%,100%{opacity:1;} 50%{opacity:.4;} }

/* ── Prism 코드블록 래퍼 ── */
.code-block-wrapper {
  position: relative;
  margin: 1.4em 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,.18);
}
/* 언어 배지 */
.code-lang-badge {
  position: absolute;
  top: 0; left: 0;
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.7);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-bottom-right-radius: 8px;
  z-index: 11;
  pointer-events: none;
}
.code-block-wrapper pre {
  margin: 0 !important;
  border-radius: 0 !important;
  padding-top: 2.2rem !important;
}
/* 버튼 영역 */
.code-block-actions {
  position: absolute;
  top: 6px;
  right: 8px;
  display: flex;
  gap: 5px;
  z-index: 12;
}
.code-btn {
  background: rgba(255,255,255,.13);
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.85);
  border-radius: 6px;
  padding: 3px 9px;
  font-size: .7rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0s, color 0s;
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1.4;
}
.code-btn:hover { background: rgba(255,255,255,.28); color:#fff; }
.code-btn.copied { background: #48cfad !important; color:#fff !important; border-color:#48cfad; }
.code-run-btn { background: rgba(108,99,255,.6) !important; border-color:rgba(108,99,255,.4) !important; }
.code-run-btn:hover { background: rgba(108,99,255,.85) !important; }
.code-run-btn.running { background: rgba(243,156,18,.7) !important; border-color:rgba(243,156,18,.5) !important; cursor:not-allowed; }
/* 출력 박스 */
.code-output-box {
  background: #1a1b26;
  border-top: 1px solid rgba(255,255,255,.08);
}
.code-output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 14px;
  font-size: .75rem;
  color: rgba(255,255,255,.5);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.pkg-install-log {
  padding: 4px 14px;
  font-size: .71rem;
  color: #aaa;
  white-space: pre;
  max-height: 100px;
  overflow-y: auto;
}
.code-output-content {
  padding: 10px 16px;
  font-family: 'Fira Mono', 'Consolas', monospace;
  font-size: .82rem;
  white-space: pre-wrap;
  color: #c0caf5;
  min-height: 30px;
  max-height: 400px;
  overflow-y: auto;
  line-height: 1.6;
}
.code-output-content.has-success { color: #9ece6a; }
.code-output-content.has-error   { color: #f7768e; }
@keyframes spin { to { transform: rotate(360deg); } }
