/* Mermaid 图表点击提示 */
.mermaid {
  cursor: pointer;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}

.mermaid:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 模态框样式 */
.mermaid-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  padding: 40px;
  box-sizing: border-box;
}

.mermaid-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mermaid-modal-content {
  position: relative;
  width: 90vw;
  height: 90vh;
  overflow: hidden;
  background: white;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

.mermaid-modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 32px;
  font-weight: bold;
  color: #333;
  background: rgba(255, 255, 255, 0.8);
  border: none;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
  z-index: 10;
}

.mermaid-modal-close:hover {
  background: #f0f0f0;
}

.mermaid-modal-body {
  flex: 1;
  overflow: auto;
  padding: 40px;
  padding-top: 60px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

/* 模态框中的 mermaid 放大 */
.mermaid-modal-body .mermaid {
  transform: scale(1.0);
  transform-origin: top left;
  width: 100%;
}

/* 暗色模式适配 */
html.dark .mermaid-modal-content {
  background: #1e1e1e;
}

html.dark .mermaid-modal-close {
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
}

html.dark .mermaid-modal-close:hover {
  background: #333;
}
