/* oncal.ai · 工程师值班训练场 · 样式 */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  background: #010409;
  color: #f0f6fc;
  overflow: hidden;
  height: 100vh;
}

/* Top bar */
.topbar {
  height: 56px;
  background: #0d1117;
  border-bottom: 1px solid #30363d;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding-right: 18px;
  border-right: 1px solid #30363d;
}
.logo-mark {
  font-size: 20px;
  color: #a78bfa;
}
.logo-text {
  font-size: 14px;
  font-weight: bold;
  color: #f0f6fc;
}
.logo-dim {
  color: #7d8590;
  font-weight: normal;
}

.incident-info { flex: 1; }
.incident-title { font-size: 13px; font-weight: bold; }
.incident-title::before {
  content: '●';
  color: #f85149;
  margin-right: 8px;
  animation: pulse 1.5s infinite;
}
@keyframes pulse { 50% { opacity: 0.3; } }
.incident-meta { font-size: 10px; color: #7d8590; margin-top: 4px; }

.budget-display {
  display: flex; align-items: center; gap: 10px;
}
.budget-bar-container {
  width: 240px;
  height: 14px;
  background: #374151;
  border-radius: 2px;
  overflow: hidden;
}
.budget-bar {
  height: 100%;
  background: #fbbf24;
  transition: width 0.3s ease;
}
.budget-bar.danger { background: #f85149; }
.budget-text { font-size: 11px; font-weight: bold; color: #fbbf24; min-width: 32px; }
.budget-text.danger { color: #f85149; }
.budget-meta { font-size: 9px; color: #7d8590; min-width: 110px; }

.submit-btn {
  background: #7f1d1d;
  border: 1px solid #f85149;
  color: #fca5a5;
  padding: 7px 14px;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  font-weight: bold;
}
.submit-btn:hover { background: #991b1b; }

/* Main 3-column layout */
.main {
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  height: calc(100vh - 56px - 28px); /* topbar + footer */
}

/* Panels */
.panel {
  background: #0d1117;
  border-right: 1px solid #30363d;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.panel:last-child { border-right: none; }

.panel-header {
  padding: 12px 16px;
  background: #161b22;
  font-size: 11px;
  font-weight: bold;
  color: #7d8590;
  border-bottom: 1px solid #30363d;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.panel-hint { font-size: 9px; font-weight: normal; }
.panel-body { padding: 12px; flex: 1; overflow-y: auto; }
.error-text { color: #f87171; }

/* Command palette */
.cmd-category {
  font-size: 10px;
  font-weight: bold;
  color: #a78bfa;
  margin: 16px 4px 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cmd-category:first-child { margin-top: 0; }
.cmd-category.mitigation { color: #fbbf24; }
.cmd-category.remediation { color: #58a6ff; }

.cmd-item {
  background: #1f2937;
  border: 1px solid #30363d;
  border-radius: 3px;
  padding: 8px 10px;
  margin-bottom: 6px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.15s;
}
.cmd-item:hover {
  background: #2d3748;
  border-color: #58a6ff;
}
.cmd-item.recommended {
  border-color: #a78bfa;
  border-width: 2px;
}
.cmd-item.locked {
  opacity: 0.5;
  cursor: not-allowed;
}
.cmd-item.locked:hover {
  background: #1f2937;
  border-color: #30363d;
}
.cmd-name { color: #f0f6fc; }
.cmd-name.recommended { color: #a78bfa; font-weight: bold; }
.cmd-desc { font-size: 9px; color: #7d8590; margin-top: 2px; }
.cmd-cost { color: #7d8590; font-size: 9px; flex-shrink: 0; margin-left: 8px; }
.cmd-cost.warning { color: #fbbf24; }
.cmd-cost.danger { color: #f87171; }

/* Center: terminal + symptoms */
.center {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.terminal-area {
  flex: 1;
  background: #010409;
  overflow-y: auto;
  padding: 16px 20px;
  font-size: 12px;
  line-height: 1.6;
}
.terminal-line { margin-bottom: 2px; word-break: break-word; }
.term-prompt { color: #3fb950; }
.term-host { color: #58a6ff; }
.term-cmd { color: #f0f6fc; }
.term-info { color: #7d8590; }
.term-warn { color: #fbbf24; }
.term-error { color: #f87171; }
.term-success { color: #3fb950; }
.term-highlight { color: #a78bfa; font-weight: bold; }
.term-section {
  margin: 12px 0;
  padding: 10px;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 3px;
}
.term-section.danger { border-color: #7f1d1d; }
.term-section.warning { border-color: #fbbf24; }

.bar-row { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.bar-label { width: 110px; font-size: 11px; }
.bar-track { width: 220px; height: 12px; background: #374151; border-radius: 2px; overflow: hidden; }
.bar-fill { height: 100%; }
.bar-value { font-size: 11px; min-width: 100px; }

.ascii-chart {
  font-family: monospace;
  font-size: 11px;
  line-height: 1.2;
  color: #3fb950;
  white-space: pre;
  margin: 8px 0;
}

/* Symptom panel */
.symptoms-area {
  height: 220px;
  background: #0d1117;
  border-top: 1px solid #30363d;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.symptom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px;
  overflow-y: auto;
  flex: 1;
}
.symptom-card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 3px;
  padding: 10px 12px;
  font-size: 10px;
}
.symptom-card.error { border-color: #7f1d1d; }
.symptom-card.warn { border-color: #fbbf24; }
.symptom-title { font-size: 11px; font-weight: bold; margin-bottom: 4px; }
.symptom-detail { color: #d1d5db; line-height: 1.4; }

/* Right: hypothesis notebook */
.hypothesis-board {
  padding: 12px;
  overflow-y: auto;
  flex: 1;
}
.hyp-card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 10px;
}
.hyp-card.investigating { border: 2px solid #fbbf24; }
.hyp-card.confirmed { border: 2px solid #3fb950; }
.hyp-card.rejected { opacity: 0.5; }
.hyp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.hyp-id { font-size: 10px; font-weight: bold; color: #fbbf24; }
.hyp-id.rejected { color: #7d8590; text-decoration: line-through; }
.hyp-confidence { font-size: 11px; font-weight: bold; }
.hyp-bar-bg { width: 80px; height: 6px; background: #374151; border-radius: 1px; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 6px; }
.hyp-bar-fill { height: 100%; background: #fbbf24; }
.hyp-bar-fill.high { background: #3fb950; }
.hyp-text { font-size: 11px; line-height: 1.4; margin-bottom: 6px; }
.hyp-text.rejected { text-decoration: line-through; color: #7d8590; }
.hyp-evidence { font-size: 9px; color: #7d8590; margin-top: 6px; padding-top: 6px; border-top: 1px solid #30363d; }
.hyp-evidence-item { color: #3fb950; margin: 2px 0; font-size: 10px; }
.hyp-evidence-item.against { color: #f87171; }

/* Maya overlay */
.maya-overlay {
  position: fixed;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  max-width: 90vw;
  background: #0d1117;
  border: 2px solid #a78bfa;
  border-radius: 6px;
  padding: 14px 18px;
  z-index: 100;
  display: none;
  box-shadow: 0 10px 40px rgba(167, 139, 250, 0.2);
}
.maya-overlay.show {
  display: block;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}
.maya-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.maya-avatar {
  width: 24px; height: 24px;
  background: #a78bfa;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0d1117;
  font-weight: bold;
  font-size: 12px;
}
.maya-name { font-size: 11px; font-weight: bold; color: #a78bfa; }
.maya-text { font-size: 12px; line-height: 1.6; color: #d1d5db; }
.maya-close {
  position: absolute;
  top: 10px;
  right: 14px;
  color: #7d8590;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.maya-close:hover { color: #f0f6fc; }

/* Modal */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(4px);
}
.modal-bg.show { display: flex; }
.modal {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 24px;
  width: 600px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
}
.modal h2 { font-size: 16px; margin-bottom: 16px; }
.modal-desc { font-size: 11px; color: #d1d5db; margin-bottom: 12px; line-height: 1.5; }
.modal-options { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.modal-option {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 4px;
  padding: 12px;
  cursor: pointer;
  font-size: 12px;
}
.modal-option:hover { border-color: #58a6ff; }
.modal-option.selected { border-color: #fbbf24; border-width: 2px; }
.modal-warning { font-size: 10px; color: #fbbf24; margin-top: 8px; min-height: 14px; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; justify-content: flex-end; }

.btn {
  padding: 8px 16px;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  border: 1px solid #30363d;
  background: #1f2937;
  color: #f0f6fc;
}
.btn:hover { background: #2d3748; }
.btn.primary { background: #1f6feb; border-color: #1f6feb; }
.btn.primary:hover { background: #388bfd; }
.btn.large { padding: 12px 28px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Welcome modal */
.welcome-modal {
  text-align: center;
  width: 540px;
}
.welcome-logo {
  font-size: 32px;
  font-weight: bold;
  color: #a78bfa;
  margin-bottom: 8px;
}
.welcome-tagline {
  font-size: 13px;
  color: #7d8590;
  margin-bottom: 24px;
}
.welcome-content {
  text-align: left;
  font-size: 12px;
  line-height: 1.7;
  color: #d1d5db;
  margin-bottom: 24px;
}
.welcome-content p { margin-bottom: 12px; }
.welcome-hint {
  margin-top: 16px;
  padding: 12px;
  background: #161b22;
  border-radius: 4px;
  border-left: 3px solid #fbbf24;
}

/* Postmortem screen */
.postmortem {
  position: fixed;
  inset: 0;
  background: #010409;
  z-index: 300;
  display: none;
  overflow-y: auto;
  padding: 40px;
}
.postmortem.show { display: block; }
.pm-header { text-align: center; margin-bottom: 30px; }
.pm-subtitle { font-size: 12px; color: #7d8590; }
.pm-summary { font-size: 14px; color: #d1d5db; }
.pm-grade {
  font-size: 80px;
  font-weight: bold;
  margin: 20px 0;
}
.pm-grade.A { color: #3fb950; }
.pm-grade.B { color: #58a6ff; }
.pm-grade.C { color: #fbbf24; }
.pm-grade.D { color: #f85149; }

.pm-scores {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
}
.pm-score-card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 4px;
  padding: 16px;
}
.pm-score-label { font-size: 10px; color: #7d8590; margin-bottom: 6px; }
.pm-score-value { font-size: 28px; font-weight: bold; }
.pm-score-detail { font-size: 10px; color: #d1d5db; margin-top: 8px; line-height: 1.5; }

.pm-maya {
  max-width: 1100px;
  margin: 30px auto;
  background: #161b22;
  border: 2px solid #a78bfa;
  border-radius: 6px;
  padding: 20px;
}
.pm-maya h3 { color: #a78bfa; font-size: 14px; margin-bottom: 12px; }
.pm-maya p { font-size: 12px; line-height: 1.7; margin-bottom: 10px; color: #d1d5db; }

.pm-actions {
  text-align: center;
  margin-top: 30px;
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* Footer */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 28px;
  background: #0d1117;
  border-top: 1px solid #30363d;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 10px;
  color: #7d8590;
}
.footer a {
  color: #7d8590;
  text-decoration: none;
}
.footer a:hover { color: #58a6ff; }
.footer-sep { color: #30363d; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #0d1117; }
::-webkit-scrollbar-thumb { background: #30363d; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #484f58; }

/* Mobile warning */
@media (max-width: 1100px) {
  body::before {
    content: "⚠ oncal.ai 当前为桌面端体验设计。请在 1200px+ 宽度的屏幕上访问以获得最佳体验。";
    position: fixed;
    inset: 0;
    background: #0d1117;
    color: #fbbf24;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
    font-size: 14px;
    line-height: 1.6;
    z-index: 9999;
  }
  body > * { display: none; }
}
