/* ========================================
   Obsidian Callouts / Admonitions
   适配 highlight 主题配色
   ======================================== */

/* ========================================
   Mermaid 流程图 / 图表
   ======================================== */

.mermaid {
  margin: 1.8rem auto;
  padding: 0.5rem;
  max-width: 100%;
  text-align: center;
}

.mermaid svg {
  max-width: 100%;
  height: auto !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif !important;
}

/* 深色主题下 mermaid 文字可读性 */
.mermaid .nodeLabel,
.mermaid .edgeLabel,
.mermaid .label {
  color: var(--text-primary) !important;
  font-size: 0.88rem !important;
}

.mermaid .edgePath path {
  stroke: #bbb !important;
}

.mermaid .node rect,
.mermaid .node circle,
.mermaid .node polygon {
  stroke: #999 !important;
  filter: none !important;
}

/* 响应式：小屏幕缩放 */
@media (max-width: 600px) {
  .mermaid {
    transform: scale(0.85);
    transform-origin: center top;
  }
}

.callout {
  --callout-color: var(--accent, #b74e4e);
  
  margin: 1.5rem 0;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  border-left: 4px solid var(--callout-color);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.callout-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  color: #333;
  margin-bottom: 0.5rem;
  letter-spacing: 0.01em;
}

.callout-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  font-size: 16px;
}

.callout-content {
  font-size: 0.92rem;
  color: var(--text-secondary, #555);
  line-height: 1.7;
}

.callout-content > p:first-child {
  margin-top: 0;
}
.callout-content > p:last-child {
  margin-bottom: 0;
}

/* ---- Callout 类型色彩 ---- */
/* note / abstract - 蓝色 */
.callout[data-callout="note"],
.callout[data-callout="abstract"] {
  --callout-color: #5b8fd9;
}

/* info / todo - 青色 */
.callout[data-callout="info"],
.callout[data-callout="todo"] {
  --callout-color: #3ba3c9;
}

/* tip / hint / success - 绿色 */
.callout[data-callout="tip"],
.callout[data-callout="hint"],
.callout[data-callout="success"] {
  --callout-color: #50a85a;
}

/* question / help / faq - 紫色 */
.callout[data-callout="question"],
.callout[data-callout="help"],
.callout[data-callout="faq"] {
  --callout-color: #9b72cf;
}

/* warning / caution / important - 橙色 */
.callout[data-callout="warning"],
.callout[data-callout="caution"],
.callout[data-callout="important"] {
  --callout-color: #d4982a;
}

/* failure / fail / danger / error / bug - 红色 */
.callout[data-callout="failure"],
.callout[data-callout="fail"],
.callout[data-callout="danger"],
.callout[data-callout="error"],
.callout[data-callout="bug"] {
  --callout-color: #d94f4f;
}

/* example - 粉色 */
.callout[data-callout="example"] {
  --callout-color: #c77da8;
}

/* quote / cite - 灰色 */
.callout[data-callout="quote"],
.callout[data-callout="cite"] {
  --callout-color: #888;
}

/* ========================================
   Wiki-link 双向链接样式
   [[link]] 或 [[link|alias]]
   ======================================== */

.wiki-link,
a[data-wiki] {
  color: var(--accent, #b74e4e) !important;
  text-decoration: none !important;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}

.wiki-link:hover,
a[data-wiki]:hover {
  border-bottom-color: currentColor;
}

/* 未找到的链接（虚线） */
.wiki-link.is-broken,
a[data-wiki].is-broken {
  opacity: 0.55;
  border-bottom: 1px dashed currentColor;
}

/* ========================================
   Obsidian 图片尺寸语法
   ![name|widthxheight](path)
   ======================================== */

.obsidian-img-size img {
  max-width: 100%;
  height: auto;
}

/* ========================================
   响应式适配
   ======================================== */

@media (max-width: 600px) {
  .callout {
    padding: 0.65rem 0.85rem;
    margin: 1.2rem 0;
    border-radius: 6px;
  }
  
  .callout-title {
    font-size: 0.88rem;
  }
  
  .callout-content {
    font-size: 0.87rem;
  }
}
