/********** Template CSS **********/

/********** Font Definitions **********/
@font-face {
  font-family: "Open Sans";
  src: url("../fonts/open-sans-v44-latin/open-sans-v44-latin-regular.woff2")
    format("woff2");
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: "Open Sans";
  src: url("../fonts/open-sans-v44-latin/open-sans-v44-latin-700.woff2")
    format("woff2");
  font-weight: 700;
  font-style: normal;
}
@font-face {
  font-family: "Noto Sans TC";
  src: url("../fonts/noto-sans-tc-v39-latin/noto-sans-tc-v39-latin-regular.woff2")
    format("woff2");
  font-weight: 400;
}
@font-face {
  font-family: "Noto Sans TC";
  src: url("../fonts/noto-sans-tc-v39-latin/noto-sans-tc-v39-latin-700.woff2")
    format("woff2");
  font-weight: 700;
}
@font-face {
  font-family: "Noto Sans SC";
  src: url("../fonts/noto-sans-sc-v40-latin/noto-sans-sc-v40-latin-regular.woff2")
    format("woff2");
  font-weight: 400;
}
@font-face {
  font-family: "Noto Sans SC";
  src: url("../fonts/noto-sans-sc-v40-latin/noto-sans-sc-v40-latin-700.woff2")
    format("woff2");
  font-weight: 700;
}

body.lang-en {
  font-family: "Open Sans", sans-serif !important;
}
body.lang-zh-hant {
  font-family: "Noto Sans TC", sans-serif !important;
}
body.lang-zh-hans {
  font-family: "Noto Sans SC", sans-serif !important;
}
h1,
h2,
h3,
h4,
h5,
h6,
.navbar-brand {
  font-family: inherit !important;
}
body {
  font-family: "Open Sans", sans-serif; /* 預設英文 */
  -webkit-font-smoothing: antialiased;
}

:root {
  --primary: #1363c6;
  --secondary: #15ace1;
  --light: #f4f7fe;
  --dark: #14183e;
}

/*** Spinner ***/
#spinner {
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.5s ease-out,
    visibility 0s linear 0.5s;
  z-index: 99999;
}

#spinner.show {
  transition:
    opacity 0.5s ease-out,
    visibility 0s linear 0s;
  visibility: visible;
  opacity: 1;
}

.back-to-top {
  position: fixed;
  display: none;
  right: 45px;
  bottom: 45px;
  z-index: 99;
}

/*** Heading ***/
h1,
h2,
h3,
.fw-bold {
  font-weight: 700 !important;
}

h4,
h5,
h6,
.fw-medium {
  font-weight: 500 !important;
}

/*** Button ***/
.btn {
  font-weight: 500;
  transition: 0.5s;
}

.btn-square {
  width: 38px;
  height: 38px;
}

.btn-sm-square {
  width: 32px;
  height: 32px;
}

.btn-lg-square {
  width: 48px;
  height: 48px;
}

.btn-square,
.btn-sm-square,
.btn-lg-square {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: normal;
  border-radius: 50px;
}

/*** Navbar ***/
.sticky-top {
  top: -150px;
  transition: 0.5s;
}

.navbar {
  padding: 11px 0 !important;
  height: 75px;
}

.navbar .navbar-nav .nav-link {
  margin-right: 35px;
  padding: 0;
  color: rgba(255, 255, 255, 0.7);
  outline: none;
}

.navbar .navbar-nav .nav-link:hover,
.navbar .navbar-nav .nav-link.active {
  color: rgba(255, 255, 255, 1);
}

.navbar .dropdown-toggle::after {
  border: none;
  content: "\f107";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  vertical-align: middle;
  margin-left: 8px;
}

.navbar .dropdown-menu {
  background: var(--primary);
}

.navbar .dropdown-menu .dropdown-item {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

.navbar .dropdown-menu .dropdown-item:hover,
.navbar .dropdown-menu .dropdown-item:focus {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

/* 覆蓋手機端選單展開時的藍色背景，強制改成白色底 */
@media (max-width: 991.98px) {
    .navbar .navbar-nav {
        background: #ffffff !important; /* 將原本的 var(--primary) 改為白色 */
        padding: 10px 15px !important;
        border-radius: 8px; /* 選擇性：讓下拉選單加點圓角，看起來更精緻 */
        box-shadow: 0 4px 12px rgba(0,0,0,0.05); /* 選擇性：給懸浮的手機選單加點陰影 */
    }

  .navbar .navbar-nav .nav-link {
    margin-right: 0;
    padding: 10px 0;
  }
}

@media (min-width: 992px) {
  .navbar .nav-item .dropdown-menu {
    display: block;
    border: none;
    margin-top: 0;
    top: 150%;
    opacity: 0;
    visibility: hidden;
    transition: 0.5s;
  }

  .navbar .nav-item:hover .dropdown-menu {
    top: 100%;
    visibility: visible;
    transition: 0.5s;
    opacity: 1;
  }
}

/*** Hero Header ***/
.hero-header {
  margin-top: -75px;
  background: url(../img/bg-hero.png) center center no-repeat;
  background-size: cover;
}

.hero-header .breadcrumb-item + .breadcrumb-item::before {
  color: var(--light);
}

/*** Section Title ***/

.section-title::before {
  display: none;
  position: absolute;
  content: "";
  width: 45px;
  height: 4px;
  bottom: 0;
  left: 0;
  background: var(--dark);
}

.section-title::after {
  display: none;
  position: absolute;
  content: "";
  width: 4px;
  height: 4px;
  bottom: 0;
  left: 50px;
  background: var(--dark);
}

.section-title.text-center::before {
  left: 50%;
  margin-left: -25px;
}

.section-title.text-center::after {
  left: 50%;
  margin-left: 25px;
}

.section-title h6::before,
.section-title h6::after {
  position: absolute;
  content: "";
  width: 10px;
  height: 10px;
  top: 2px;
  left: 0;
  background: rgba(33, 66, 177, 0.5);
}

.section-title h6::after {
  top: 5px;
  left: 3px;
}

/*** About ***/
.about-img {
  position: relative;
  overflow: hidden;
}

.about-img::after {
  position: absolute;
  content: "";
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background: url(../img/bg-about-img.png) top left no-repeat;
  background-size: contain;
}

/*** Service ***/
.service-item {
  position: relative;
  padding: 45px 30px;
  background: #ffffff;
  transition: 0.5s;
}

.service-item:hover {
  background: var(--primary);
  transform: scale(1.05);
}

.service-item .service-icon {
  margin: 0 auto 20px auto;
  width: 90px;
  height: 90px;
  color: var(--primary);
  background: var(--light);
  transition: 0.5s;
}

.service-item h5,
.service-item p {
  transition: 0.5s;
}

.service-item:hover h5,
.service-item:hover p {
  color: #000000;
}

.service-item a.btn {
  position: relative;
  display: flex;
  color: var(--primary);
  transition: 0.5s;
  z-index: 1;
}

.service-item:hover a.btn {
  color: var(--primary);
}

.service-item a.btn::before {
  position: absolute;
  content: "";
  width: 35px;
  height: 35px;
  top: 0;
  left: 0;
  border-radius: 35px;
  background: var(--light);
  transition: 0.5s;
  z-index: -1;
}

.service-item:hover {
  width: 100%;
  background: var(--light);
}

.service-item .service-cta.btn {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: none;
}

.service-item .service-cta.btn::before {
  display: none;
}

.service-item .service-cta.btn:hover,
.service-item .service-cta.btn:focus {
  color: #fff;
}

.service-item:hover .service-cta.btn {
  color: #fff;
}

.consultation-card {
  border: 1px solid rgba(20, 24, 62, 0.08);
  transition: 0.3s ease;
}

.consultation-card .btn-square {
  transition: 0.3s ease;
}

.consultation-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(20, 24, 62, 0.12);
}

.consultation-card:hover .btn-square {
  background: var(--primary);
}

.consultation-card:hover .btn-square i {
  color: #fff;
}

/*** Feature ***/
.feature {
  background: url(../img/bg-hero.png) center center no-repeat;
  background-size: cover;
}

/*** Newsletter ***/
.newsletter {
  background: url(../img/bg-hero.png) center center no-repeat;
  background-size: cover;
}

@media (min-width: 992px) {
  .newsletter .container {
    max-width: 100% !important;
  }

  .newsletter .newsletter-text {
    padding-right: calc(((100% - 960px) / 2) + 0.75rem);
  }
}

@media (min-width: 1200px) {
  .newsletter .newsletter-text {
    padding-right: calc(((100% - 1140px) / 2) + 0.75rem);
  }
}

@media (min-width: 1400px) {
  .newsletter .newsletter-text {
    padding-right: calc(((100% - 1320px) / 2) + 0.75rem);
  }
}

/*** Case Study ***/
.case-item img {
  transition: 0.5s;
}

.case-item:hover img {
  transform: scale(1.2);
}

.case-overlay {
  position: absolute;
  padding: 30px;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  background: linear-gradient(rgba(20, 24, 62, 0), var(--dark));
  z-index: 1;
}

.case-overlay small {
  display: inline-block;
  padding: 3px 15px;
  color: #ffffff;
  background: rgba(20, 24, 62, 0.7);
  border-radius: 25px;
  margin-bottom: 15px;
}

.case-overlay span.btn:hover {
  color: var(--primary);
  background: #ffffff;
  border-color: #ffffff;
}

/*** FAQs ***/
.accordion .accordion-item {
  border: none;
  margin-bottom: 15px;
}

.accordion .accordion-button {
  background: var(--light);
  border-radius: 2px;
}

.accordion .accordion-button:not(.collapsed) {
  color: #ffffff;
  background: var(--primary);
  box-shadow: none;
}

.accordion .accordion-button:not(.collapsed)::after {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

.accordion .accordion-body {
  padding: 15px 0 0 0;
}

/*** Testimonial ***/
.testimonial-carousel {
  position: relative;
}

.testimonial-carousel .owl-nav {
  position: absolute;
  width: 40px;
  height: 100%;
  top: calc(50% - 50px);
  left: -21px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.testimonial-carousel .owl-nav .owl-prev,
.testimonial-carousel .owl-nav .owl-next {
  margin: 5px 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  background: #ffffff;
  border: 1px solid var(--primary);
  border-radius: 40px;
  font-size: 18px;
  transition: 0.5s;
}

.testimonial-carousel .owl-nav .owl-prev:hover,
.testimonial-carousel .owl-nav .owl-next:hover {
  background: var(--primary);
  color: #ffffff;
}

.testimonial-carousel .owl-dots {
  margin-top: 35px;
  margin-left: 3rem;
}

.testimonial-carousel .owl-dot {
  position: relative;
  display: inline-block;
  margin-right: 10px;
  width: 15px;
  height: 15px;
  background: #ffffff;
  border: 1px solid var(--primary);
  border-radius: 15px;
  transition: 0.5s;
}

.testimonial-carousel .owl-dot.active {
  width: 30px;
  background: var(--primary);
}

/*** Team ***/
.team-item {
  transition: 0.5s;
  border: 1px solid transparent;
  transition: 0.5s;
}

.team-item:hover {
  border-color: var(--primary);
}

/*** Footer ***/
.footer {
  background: url(../img/footer.png) center center no-repeat;
  background-size: contain;
}

.footer .btn.btn-social {
  margin-right: 5px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(256, 256, 256, 0.1);
  border-radius: 40px;
  transition: 0.3s;
}

.footer .btn.btn-social:hover {
  color: var(--primary);
}

.footer .btn.btn-link {
  display: block;
  margin-bottom: 10px;
  padding: 0;
  text-align: left;
  color: rgba(255, 255, 255, 0.5);
  font-weight: normal;
  transition: 0.3s;
}

.footer .btn.btn-link:hover {
  color: #ffffff;
}

/* .footer .btn.btn-link::before {
    position: relative;
    content: "\f105";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    margin-right: 10px;
} */

.footer .btn.btn-link:hover {
  letter-spacing: 1px;
  box-shadow: none;
}

.footer .copyright {
  padding: 25px 0;
  font-size: 14px;
  border-top: 1px solid rgba(256, 256, 256, 0.1);
}

.footer .copyright a {
  color: rgba(255, 255, 255, 0.5);
}

.footer .copyright a:hover {
  color: #ffffff;
}

.footer .footer-menu a {
  margin-right: 15px;
  padding-right: 15px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.footer .footer-menu a:last-child {
  margin-right: 0;
  padding-right: 0;
  border-right: none;
}

/** Login **/
.login-form-container {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  padding: 3rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  max-width: 450px;
  width: 100%;
}

.login-form .form-control {
  border-radius: 25px;
  padding: 15px 20px;
  border: 2px solid #e9ecef;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.login-form .form-control:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.login-btn {
  border-radius: 25px;
  padding: 15px 30px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #667eea 0%, #1363c6 100%);
  border: none;
  transition: all 0.3s ease;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.brand-logo {
  color: #1363c6;
  font-weight: 700;
  font-size: 2rem;
  margin-bottom: 1rem;
}

.welcome-text {
  color: #6c757d;
  margin-bottom: 2rem;
}

/* Search */

.search-result-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgb(0, 0, 0);
  transition: 0.3s;
}
.search-result-item:hover {
  background: rgba(102, 126, 234, 0.25);
  border-color: var(--primary);
}
.search-highlight,
mark {
  background: none;
  color: rgb(249, 46, 46);
  padding: 0;
}

/* ============================================================
   終極全站簡體字體修復 (解決全頁面筆畫粗細不一)
   ============================================================ */

/* 1. 全站字體（排除 icon） */
:is(html, body).lang-zh-hans *:not(i):not([class*="bi-"]):not([class*="fa-"]):not([class*="icon"]) {
    font-family: "Noto Sans SC", "Microsoft YaHei", "SimHei", sans-serif !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
}

/* 2. 終極保護 icon - 確保不被中文字體污染且能正確載入 */

/* 首先，確保所有的 i 標籤在簡體下不使用中文字體 */
:is(html, body).lang-zh-hans i {
    font-family: inherit; /* 暫時繼承，下方會精確覆蓋 */
}

/* 針對 Bootstrap Icons 的精確覆蓋 */
:is(html, body).lang-zh-hans .bi,
:is(html, body).lang-zh-hans [class*="bi-"] {
    font-family: "bootstrap-icons" !important;
}

/* 針對 Font Awesome 的全能覆蓋 (相容 fab, fas, far) */
:is(html, body).lang-zh-hans .fa,
:is(html, body).lang-zh-hans .fab,
:is(html, body).lang-zh-hans .fas,
:is(html, body).lang-zh-hans .far,
:is(html, body).lang-zh-hans [class*="fa-"] {
    /* 這裡列出所有可能的 Font Awesome 家族名稱 */
    font-family: "Font Awesome 5 Brands", "Font Awesome 5 Free", "FontAwesome" !important;
    font-weight: 900 !important; /* 這是讓圖示顯示的關鍵 */
    font-style: normal !important;
}

/* 額外豁免：消除簡體微調的副作用 */
:is(html, body).lang-zh-hans i {
    letter-spacing: normal !important;
    text-transform: none !important;
    direction: ltr !important;
}

/* 3. 標題加固 */
body.lang-zh-hans h1, body.lang-zh-hans h2, body.lang-zh-hans h3,
body.lang-zh-hans strong, body.lang-zh-hans b {
    font-weight: 700 !important;
}

/* ============================================================
   手機與平板端（自適應優化加固）
   ============================================================ */

/* ============================================================
   雙端導航欄 (Navbar) 手機點擊下拉終極修正
   ============================================================ */

@media (max-width: 991.98px) {
    /* 1. 強制讓手機端展開的選單大底板變成清爽的白色 */
    .navbar .navbar-nav {
        background: #ffffff !important; 
        padding: 15px !important;
        border-radius: 8px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    }

    /* 2. 讓手機端的下拉選單 (Dropdown Menu) 變成「內嵌向下推開」，而不是懸浮遮擋文字 */
    .navbar .dropdown-menu {
        position: static !important; /* 關鍵：取消懸浮，改為普通塊級元素 */
        float: none !important;
        width: 100% !important;
        background-color: #f8f9fa !important; /* 淡淡的灰色底，做出二級菜單的層級感 */
        border: none !important;
        box-shadow: none !important;
        padding-left: 15px !important; /* 向右縮排，方便辨識 */
        margin-top: 5px !important;
        margin-bottom: 5px !important;
        display: none; /* 預設隱藏，由 Bootstrap 控制展開 */
    }

    /* 3. 當手機端點擊展開後，Bootstrap 會自動加上 .show，這時將其顯示 */
    .navbar .dropdown-menu.show {
        display: block !important;
    }

    /* 4. 修正手機端下拉子項目的文字顏色與間距，確保是黑字 */
    .navbar .dropdown-menu .dropdown-item {
        color: #010101 !important;
        padding: 10px 0 !important;
        background: transparent !important;
    }

    /* 5. 手機端子項目被點擊或碰觸時的視覺反饋 */
    .navbar .dropdown-menu .dropdown-item:hover,
    .navbar .dropdown-menu .dropdown-item:focus {
        color: var(--primary) !important; /* 變成主色藍字 */
    }
}

/* 1. 當螢幕小於 992px（Bootstrap 的 lg 斷點，通常是手機和平板） */
@media (max-width: 991.98px) {
    /* 修正頂部導覽列 Navbar 的高度，因為手機版展開選單需要自動彈性高度 */
    .navbar {
        height: auto !important;
        padding: 15px 0 !important;
    }
    
    /* 讓 Hero Header 在手機上的背景圖能完美收縮顯示，且縮減內邊距避免太高 */
    .hero-header {
        margin-top: 0; /* 取消負邊距，避免蓋到導覽列 */
        background-position: center center;
        background-size: cover;
        padding: 40px 0 !important;
    }

    /* 讓服務項目（Service Item）和諮詢卡片在手機上不要橫向爆開 */
    .service-item, .consultation-card {
        width: 100% !important;
        margin-bottom: 20px;
        transform: none !important; /* 手機端取消 hover 放大效果，避免觸控時卡住 */
    }
}

/* 2. 當螢幕小於 768px（標準手機端斷點） */
@media (max-width: 767.98px) {
    /* 全域手機端字體微調與安全邊距 */
    body {
        font-size: 15px;
    }
    
    h1 { font-size: 1.8rem !important; }
    h2 { font-size: 1.5rem !important; }
    h3 { font-size: 1.3rem !important; }
    
    /* 確保所有圖片在手機上不會超出容器寬度 */
    img {
        max-width: 100%;
        height: auto !important;
    }

    /* 修正登入表單（Login Form）在手機上過寬或爆開的問題 */
    .login-form-container {
        padding: 1.5rem !important;
        margin: 10px auto;
        max-width: 100% !important;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    }
    
    /* 修正頁尾 Footer 背景圖在手機上的顯示，並調整邊距 */
    .footer {
        background-size: cover;
        padding-top: 40px !important;
    }
    
    .footer .footer-menu a {
        display: block;
        margin-right: 0;
        padding-right: 0;
        border-right: none;
        margin-bottom: 10px;
    }

    /* 修正 FAQ 摺疊面板在手機上的內邊距 */
    .accordion .accordion-button {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    /* 返回頂部按鈕在手機上調小並靠邊一點，避免擋到內容 */
    .back-to-top {
        right: 20px;
        bottom: 20px;
    }
}
