/* 頁面切換時的順暢體驗 */
[data-md-component="skip"] {
  opacity: 0;
  transition: opacity 0.125s;
}

[data-md-component="skip"]:focus-within {
  opacity: 1;
}

/* 頁面載入進度條樣式 */
.md-progress {
  background-color: var(--md-accent-fg-color, #616c82);
  height: 2px;
  left: 0;
  position: fixed;
  top: 0;
  transition: transform 0.25s cubic-bezier(0.1, 0.7, 0.1, 1), opacity 0.25s;
  width: 100%;
  z-index: 5;
}

/* 防止內容在載入時跳動 */
.md-content__inner {
  min-height: 100vh;
}

/* 預載入動畫優化 */
.md-nav__link[data-md-state="blur"] {
  color: var(--md-default-fg-color--light);
}

/* 防止頁面切換時的閃爍效果 */
html {
  scroll-behavior: smooth;
}

body {
  transition: none !important;
}

.md-main {
  transition: none !important;
}

.md-content {
  transition: none !important;
  animation: none !important;
}

/* 改善導航的視覺效果 */
.md-nav__link {
  transition: color 0.2s ease, background-color 0.2s ease;
}

.md-nav__link:hover {
  color: #616c82 !important;
  background-color: rgba(97, 108, 130, 0.1) !important;
}

@media screen and (min-width: 76.25em) {
  .md-grid {
    max-width: 75rem;
  }
  .md-nav--primary .md-nav__title,
  .md-nav__title--primary,
  .md-nav--primary > .md-nav__list > .md-nav__item > .md-nav__title {
    background-color: #616c82 !important;
    color: #fff !important;
  }
}


@media screen {
  .md-nav--primary .md-nav__title {
    background-color: #fff !important;
    color: #616c82 !important;
  }
}

@media screen {
  .md-header,
  .md-header--shadow,
  .md-header--lifted {
    background: #616c82;
    box-shadow: 0 2px 8px rgba(192, 96, 20, 0.10);
    border-bottom: 2px solid #bdbdbd;
  }
  .md-main__inner {
    margin-top: 0;
  }

  .md-typeset h1 {
    font-weight: 600;
  }

  .md-typeset h2 {
    font-weight: 500;
    padding: 0.2em 0em;
    border-bottom: solid 3px rgba(0, 82, 153, 0.728);
  }

  .md-typeset h3 {
    font-weight: 500;
    position: relative;
    padding-left: 1.3em;
    line-height: 1.4;
  }

  .md-typeset h3:before {
    font-family: "FontAwesome";
    content: "\f00c";
    font-weight: 900;
    position: absolute;
    font-size: 1em;
    left: 0;
    top: 0;
    color: rgba(0, 61, 153, 0.776);
    font-weight: 900;
  }

  /* Tabs  */
  .md-tabs {
    background: #fff;
  }
  .md-tabs__link,
  .md-tabs__item {
    color: #333 !important;
    font-weight: 600;
  }
  .md-tabs__item--active,
  .md-tabs__item:focus,
  .md-tabs__item:hover {
    background: #ededed;
    color: #c06014 !important;
  }

  /* Footer  */
  .md-footer {
    background: #d1d7e7;
    color: #fff;
    border-top: 2px solid #bdbdbd;
  }
  .md-footer a {
    color: #fff;
    text-decoration: underline;
  }
  [data-md-color-scheme="slate"] .md-tabs {
    background: #333;
  }
  [data-md-color-scheme="slate"] .md-tabs__link,
  [data-md-color-scheme="slate"] .md-tabs__item {
    color: #fff !important;
    font-weight: 600;
  }
  [data-md-color-scheme="slate"] .md-tabs__item--active,
  [data-md-color-scheme="slate"] .md-tabs__item:focus,
  [data-md-color-scheme="slate"] .md-tabs__item:hover {
    background: #727171;
    color: #e07a1f !important;
  }
  /*
   .md-typeset h1 {    
    font-weight: bold;
    color: #000;
    border-bottom: solid 2px #f18b21;
    padding-bottom: 5px;
  }
  .md-typeset h2 {
    border-bottom: 1px dotted #888;
  }

  .md-typeset h3:before {
    font-family: "FontAwesome";
    font-weight: 900;
    content: "\f0a9";
    margin-right: 5px;
  } */

}

.md-sidebar__scrollwrap:focus-within,
.md-sidebar__scrollwrap:hover,
.md-typeset pre>code:hover {
  scrollbar-color: #999 #f8f8f8;
}

/* 頁面載入狀態優化 */
body:not(.page-loaded) .md-content {
  opacity: 0.95;
}

body.page-loaded .md-content {
  opacity: 1;
  transition: opacity 0.2s ease-in-out;
}

/* 載入動畫優化 */
@keyframes fadeInContent {
  from {
    opacity: 0.9;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.md-content__inner {
  animation: fadeInContent 0.3s ease-out;
}

/* 導航載入狀態 */
.md-nav__link[aria-current="page"] {
  font-weight: 700;
  color: var(--md-accent-fg-color, #616c82);
}