/* Force white background on all Mermaid diagrams and fix sizing */
.mermaid {
    background-color: #ffffff !important;
    padding: 10px !important;
    border-radius: 8px !important;
    margin: 10px 0 !important;
    display: flex !important;
    justify-content: center !important;
}

.mermaid svg {
    background-color: #ffffff !important;
    height: auto !important;
    max-height: 300px !important;
}

/* Tighter fit for flowcharts */
.mermaid[data-processed="true"] {
    overflow: visible !important;
}

.mermaid svg[id^="flowchart"] {
    max-height: 250px !important;
}

/* Hide extra buttons if multiple are showing */
div.highlight button.copybtn + button.copybtn {
    display: none;
  }

  /* Remove unwanted "Copy code" text from clipboard (for older versions) */
  .copybtn::before {
    content: none !important;
  }

  /* Style the copy button */
  button.copybtn {
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    padding: 4px 8px;
    cursor: pointer;
    position: absolute;
    top: 0.4em;
    right: 0.6em;
    opacity: 0.8;
    transition: opacity 0.2s ease-in-out;
    z-index: 3;
  }

  button.copybtn:hover {
    opacity: 1;
  }

  /* Optional: Hide the copied tooltip or style it */
  .copybtn:after {
    content: "Copied!";
    display: none;
    position: absolute;
    top: -1.5em;
    right: 0;
    background: #333;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
  }

/* Language switcher (中文 | Eng) — lives in the top nav bar,
   or floats at top-right if the nav bar isn't found. */
.lmcache-language-switcher {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 6px;
    padding: 4px 10px;
    white-space: nowrap;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    color: var(--foreground);
    border-radius: 8px;
}

/* When there's no nav bar, float at top-right instead */
.lmcache-language-switcher--fallback {
    position: fixed;
    top: 10px;
    right: 72px;
    z-index: 60;
}

.lmcache-language-switcher a {
    color: inherit;
    opacity: 0.72;
    text-decoration: none;
}

.lmcache-language-switcher a:hover,
.lmcache-language-switcher a:focus-visible,
.lmcache-language-switcher a[aria-current="page"] {
    opacity: 1;
}

.lmcache-language-switcher__divider {
    opacity: 0.38;
}
