/* ============================================================
   BlockTerminal 公開側 — 疑似ターミナル窓＋タイプライター演出
   テーマ非依存で自己完結（ThemeModern等の tm-* には一切依存しない）
   ============================================================ */
.bkterm-root{ max-width:100%; box-sizing:border-box; margin:0 0 20px; }
.bkterm-root *{ box-sizing:border-box; }

.bkterm-window{
  --bkterm-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", "Courier New", monospace;
  border-radius:12px;
  overflow:hidden;
  box-shadow:0 14px 34px rgba(0,0,0,.28), 0 2px 8px rgba(0,0,0,.16);
  max-width:720px;
  margin:0 auto;
  font-family:var(--bkterm-mono);
}

/* ---- タイトルバー ---- */
.bkterm-titlebar{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  min-height:20px;
}
.bkterm-dots{ display:inline-flex; gap:7px; flex:0 0 auto; }
.bkterm-dot{ width:11px; height:11px; border-radius:50%; display:inline-block; }
.bkterm-dot-r{ background:#ff5f57; }
.bkterm-dot-y{ background:#febc2e; }
.bkterm-dot-g{ background:#28c840; }
.bkterm-titletext{
  flex:1 1 auto;
  text-align:center;
  font-size:12.5px;
  font-weight:600;
  letter-spacing:.02em;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  margin-right:38px; /* ドット分だけ左に寄っている見た目を中央寄せで相殺 */
}

/* ---- 本文 ---- */
.bkterm-body{
  padding:16px 18px 20px;
  font-size:14px;
  line-height:1.85;
  overflow-x:auto;
  /* fix: ページ/テーマ側が .bk-block-content を text-align:center(!important) で中央寄せするテーマがあり、
     それに勝つため !important で左寄せを強制（ターミナルは左寄せが必須） */
  text-align:left !important;
}
.bkterm-body .bkterm-line{ text-align:left !important; }
.bkterm-line{
  /* fix: pre-wrap を line に置くと block.ctp のソース字下げ(改行+空白)がそのまま
     巨大な左余白として描画されてしまう。行はnormalにし、内部空白の保持は
     実テキストの .bkterm-text 側だけに限定する。 */
  white-space:normal;
  word-break:break-word;
  min-height:1.85em;
}
.bkterm-prompt{ font-weight:700; margin-right:.6em; user-select:none; }
.bkterm-hash{ margin-right:.5em; user-select:none; }
.bkterm-text{ font-variant-ligatures:none; white-space:pre-wrap; }

/* タイプ中の点滅カーソル（JSが行末に付与） */
.bkterm-caret{
  display:inline-block;
  width:.5em;
  height:1em;
  margin-left:1px;
  background:currentColor;
  vertical-align:text-bottom;
  animation:bkterm-blink 1s steps(1,end) infinite;
}
@keyframes bkterm-blink{ 50%{ opacity:0; } }

/* ---- テーマ: dark（既定） ---- */
.bkterm-theme-dark{ background:#1a1b26; }
.bkterm-theme-dark .bkterm-titlebar{ background:#26283a; border-bottom:1px solid #33354a; }
.bkterm-theme-dark .bkterm-titletext{ color:#9a9db3; }
.bkterm-theme-dark .bkterm-body{ background:#1a1b26; color:#c6c9dd; }
.bkterm-theme-dark .bkterm-kind-command .bkterm-prompt{ color:#7ee787; }
.bkterm-theme-dark .bkterm-kind-command .bkterm-text{ color:#eef0fa; }
.bkterm-theme-dark .bkterm-kind-output .bkterm-text{ color:#b6b9cf; }
.bkterm-theme-dark .bkterm-kind-comment{ color:#666a84; font-style:italic; }
.bkterm-theme-dark .bkterm-kind-comment .bkterm-hash,
.bkterm-theme-dark .bkterm-kind-comment .bkterm-text{ color:#666a84; }

/* ---- テーマ: matrix（黒地に緑の等幅） ---- */
.bkterm-theme-matrix{ background:#000; }
.bkterm-theme-matrix .bkterm-titlebar{ background:#050805; border-bottom:1px solid #0e3a17; }
.bkterm-theme-matrix .bkterm-titletext{ color:#3ddc63; }
.bkterm-theme-matrix .bkterm-body{ background:#000; color:#33ff66; text-shadow:0 0 6px rgba(51,255,102,.28); }
.bkterm-theme-matrix .bkterm-kind-command .bkterm-prompt{ color:#7dffa0; font-weight:800; }
.bkterm-theme-matrix .bkterm-kind-command .bkterm-text{ color:#8dffab; }
.bkterm-theme-matrix .bkterm-kind-output .bkterm-text{ color:#33ff66; }
.bkterm-theme-matrix .bkterm-kind-comment{ color:#1f7a34; font-style:italic; text-shadow:none; }
.bkterm-theme-matrix .bkterm-kind-comment .bkterm-hash,
.bkterm-theme-matrix .bkterm-kind-comment .bkterm-text{ color:#1f7a34; }

/* ---- テーマ: light ---- */
.bkterm-theme-light{ background:#fff; border:1px solid #e2e4ea; }
.bkterm-theme-light .bkterm-titlebar{ background:#f1f2f6; border-bottom:1px solid #e2e4ea; }
.bkterm-theme-light .bkterm-titletext{ color:#5c5f70; }
.bkterm-theme-light .bkterm-body{ background:#fbfbfd; color:#26272f; }
.bkterm-theme-light .bkterm-kind-command .bkterm-prompt{ color:#0f766e; font-weight:800; }
.bkterm-theme-light .bkterm-kind-command .bkterm-text{ color:#1c1d24; }
.bkterm-theme-light .bkterm-kind-output .bkterm-text{ color:#454754; }
.bkterm-theme-light .bkterm-kind-comment{ color:#9497a6; font-style:italic; }
.bkterm-theme-light .bkterm-kind-comment .bkterm-hash,
.bkterm-theme-light .bkterm-kind-comment .bkterm-text{ color:#9497a6; }

/* ---- 空データ時のヒント（編集モードのみ表示される想定） ---- */
.bkterm-hint{ border:2px dashed #c7ced4; border-radius:12px; background:#f7f8fa; padding:18px 16px; text-align:center; color:#5f6b76; font-size:13px; font-weight:700; line-height:1.8; }

@media (max-width:480px){
  .bkterm-body{ padding:13px 14px 16px; font-size:12.5px; }
  .bkterm-titlebar{ padding:9px 12px; }
}

@media (prefers-reduced-motion: reduce){
  .bkterm-caret{ animation:none; opacity:1; }
}
