/* CSS Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* 預設使用 Noto Sans TC */
  --main-font-family: 'Noto Sans TC', sans-serif;
}

/* 當父層（如 body 或 html）具備 .lang-en 類別時，切換變數 */
.lang-en {
  --main-font-family: 'Roboto', sans-serif;
}

body {
  font-family: var(--main-font-family);
  color: #333333;
  overflow-x: hidden;
  background-color: #ffffff;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

header {
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(238, 238, 238, 0.5);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo { display: flex; align-items: center; }
.logo img { height: 35px; }

/* Mobile Menu Button */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 32px;
  color: #bb162b;
  cursor: pointer;
}
.mobile-toggle img{
  width: 40px;  
}

/* Desktop Nav */
.nav-links {
  display: flex;
  align-items: center;
}
.nav-links li { position: relative; }
.nav-m {
  display: none;
}

.loading_box{
	background-image: url(/images/pc/loading2.gif);
	background-position: center center;
	width: 100%;
	height: 100%;
	position: fixed;
  z-index: 1100;
  background-color: hsla(0,0%,100%,0.70);
	background-repeat: no-repeat;
	top: 0px;
	left: 0px;
	display: none;
}
#box {
  width: 100%;
  height: 100%;
  position: fixed;
  z-index: 1100;
  display: none;
  background-color: hsla(0,0%,0%,0.50);
}

/* 選單 Hover 動態底線 */
.nav-links li a {
  padding: 5px 15px;
  font-size: 17px;
  color: #444;
  transition: color 0.3s;
  position: relative;
  display: block;
}
.nav-links li a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background-color: #bb162b;
  transition: width 0.3s ease;
}
.nav-links li a:hover { color: #bb162b; }
.nav-links li a.active { color: #bb162b !important; }
.nav-links li a:hover::after { width: calc(100% - 30px); }
.nav-links li a.active::after { width: calc(100% - 30px); }

/* Dropdown Styles */
.nav-links li.has-dropdown:hover .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown {
  opacity: 0;
  visibility: hidden;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background-color: #bb162b;
  min-width: 180px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
  padding: 10px 0;
  z-index: 1001;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.dropdown li {
  width: 100%;
}

.dropdown li::before {
  display: none !important;
}

.dropdown li a {
  color: #ffffff !important;
  padding: 12px 20px !important;
  font-size: 15px !important;
  text-align: center;
  transition: background 0.3s;
}

.dropdown li a::after {
  display: none !important;
}

.dropdown li a:hover {
  background-color: #9d1224;
}

.nav-links li:not(:last-child)::before {
  content: '|';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  color: #939393;
  font-size: 12px;
}

.text-center { text-align: center; }
.bg-red { background-color: #b80d2d; color: #ffffff; }

@media (max-width: 900px) {
  .nav-links li a {
      padding: 5px 10px;
      font-size: 15px;
  }
}

@media (max-width: 768px) {
/* Mobile Header & Menu */
.header-inner { position: relative; }
.mobile-toggle { display: block; }

/* 手機版無卡頓滿版選單 */
.nav-links-bg {
  position: fixed;
  top: 0px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgb(250 250 250);
  /* Transform 與 Opacity 確保平滑不卡頓 */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-20px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  z-index: 999;
  height: 100%;
}
.nav-links-bg.active { 
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.nav-links {
  position: fixed;
  top: 50px;
  left: 0;
  right: 0;
  bottom: 0;
  backdrop-filter: blur(15px);
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-20px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  z-index: 999;
  height: 100%;
}
.nav-links.active { 
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.nav-links li {
  width: 100%;
  text-align: center;
  padding-top: 0px;
  padding-bottom: 0px;
  border-bottom: 1px solid #e7e7e7;
}
.nav-links li:not(:last-child)::before { display: none; }
.nav-links li a { padding: 20px 0; font-size: 18px; font-weight: 500;}
.nav-links li a::after { display: none; } 

/* Mobile Dropdown */
.nav-links li.has-dropdown .dropdown,
.nav-links li.has-dropdown:hover .dropdown,
.nav-links li.has-dropdown:active .dropdown {
  display: block;
  opacity: 1;
  visibility: visible;
  position: static;
  transform: none !important;
  left: auto;
  width: 100%;
  background-color: transparent;
  box-shadow: none;
  padding: 0;
  margin-top: 0;
  margin-bottom: 0;
  transition: none;
}

.nav-links li.has-dropdown .dropdown li {
  padding: 0;
  background-color: #bb162b;
  margin: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-links li.has-dropdown .dropdown li a {
  display: block;
  padding: 15px 0;
  font-size: 16px;
  color: #fff !important;
  font-weight: normal;
}

.logo img { height: 30px; }
.header-inner {
    height: 50px;
}

}
