header {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 120px;
  background: rgb(255, 255, 255, .85);
  z-index: 1000;
  transition: all 0.4s ease-in-out;
  animation-duration: 750ms;
}

body.no-scroll {
  position: fixed;
  width: 100%;
  overflow: hidden;
}

header.bg {
  position: sticky;
  background: rgb(255, 255, 255, .85);
}

.add_cnt header {
  position: relative;
}

header .content {
  width: 100%;
  /* height: 100%; */
  margin: 0 auto;
  transition: all 0.3s;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 2.5vw;
}

header .logo {
  transition: all 0.3s;
  z-index: 100;
}

header .logo img {
  width: 100%;
  max-width: 326px;
}

header #memu_mask {
  position: fixed;
  display: none;
  top: 100px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
}

header #menu {
  position: relative;
  display: flex;
  height: 100%;
  align-items: center;
}

header ul.menu {
  display: flex;
  width: auto;
  height: 100%;
  font-size: 1.06rem;
  justify-content: flex-end;
  gap: 4px;
}

header ul.menu::after {
  content: "";
  position: relative;
}

header ul.menu>li {
  flex: none;
  text-align: center;
  cursor: pointer;
}

header ul.menu>li:last-child::after {
  display: none;
}

header ul.menu>li>a {
  display: flex;
  cursor: pointer;
  height: 100%;
  align-items: center;
  transition: color 0.3s;
  font-weight: 400;
  cursor: pointer;
  padding: 2px 12px;
  font-size: 1.16rem;
}

header ul.menu>li>a:hover,
header ul.menu>li.active>a {
  color: #f0e8a5;
  background: #493137;
  border-radius: 6px 6px 0 0;
}

header ul.menu>li>span {
  display: flex;
  cursor: pointer;
  height: 100%;
  align-items: center;
  transition: color 0.3s;
  color: #181c62;
}

header ul.menu>li>span:hover,
header ul.menu>li>span.on {
  color: #000;
}

header ul.menu>li>span>label {
  position: relative;
  display: block;
  cursor: pointer;
  font-weight: 500;
}

header ul.menu>li>span input {
  display: none;
}

header #menu-ck {
  display: none;
}

header #menu-ck:checked~#memu_mask {
  opacity: 1;
  pointer-events: auto;
}

header #menu-ck:checked~label i,
header #menu-ck:checked~label o,
header #menu-ck:checked~label u {
  transition: top 0.2s, opacity 0.1s 0.2s, transform 0.2s 0.2s;
}

header #menu-ck:checked~label i {
  top: 50%;
  opacity: 1;
  transform: rotate(45deg);
}

header #menu-ck:checked~label o {
  top: 50%;
  opacity: 0;
}

header #menu-ck:checked~label u {
  top: 50%;
  opacity: 1;
  transform: rotate(-45deg);
}

header #menu-ck~label {
  position: relative;
  display: none;
  width: 20px;
  height: 20px;
  right: 0;
  z-index: 3;
  cursor: pointer;
}

header #menu-ck~label i,
header #menu-ck~label o,
header #menu-ck~label u {
  position: absolute;
  width: 20px;
  height: 2px;
  background: #493137;
  opacity: 1;
  transform: rotate(0deg);
  transition: top 0.2s 0.2s, opacity 0.1s 0.2s, transform 0.2s;
}

header #menu-ck~label i {
  top: 2px;
}

header #menu-ck~label o {
  top: 10px;
}

header #menu-ck~label u {
  top: 18px;
}

header ul.menu>li:last-child a {
  position: relative;
}

/* top-nav */
.top-nav {
  height: auto;
  display: flex;
  align-items: center;
  margin: 0 auto;
}

.top-nav .block {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin: 0 auto;
}

.top-nav ul {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  padding: 2px 40px 4px 24px;
  background: #f0e8a5;
  border-radius: 0 0 0 50px;
}

.top-nav ul li {
  display: flex;
  align-items: center;
}

.top-nav ul li:last-child {
  border-right: 0px solid;
}

.top-nav ul li a {
  color: #493137;
  font-size: .91rem;
  transition-duration: .5s;
}

.top-nav ul li a:hover {
  color: #ffd000;
}

.top-nav ul li a.lan {
  font-family: "Roboto";
  font-size: .75rem;
  line-height: 13px;
  border-radius: 2px;
  width: 26px;
  height: 16px;
  border: 1px solid #D6AE00;
  background: #D6AE00;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.top-nav ul li a.lan:hover {
  background: unset;
}

.top-nav ul li a.search {
  width: 14px;
  transform: scale(1);
}

.top-nav ul li a.search:hover {
  width: 14px;
  transform: scale(1.1);
}

/* 滑鼠滑入展開次選單*/
ul ul.sec-menu {
  position: absolute;
  z-index: 100;
  width: 100%;
  visibility: hidden;
  opacity: 0;
  transition: all .3s;
  top: 100%;
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 20px 14px;
  background-color: #f6f6f6;
  box-shadow: 0 .2rem 0.25rem 0 rgb(4 0 0 / 15%);
}

ul ul.sec-menu li.select a {
  position: relative;
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  border-bottom: 1px solid #ccc;
  gap: 8px;
  padding-bottom: 4px;
  color: #493137;
  font-weight: 400;
}

ul ul.sec-menu li.select a::before {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  background-repeat: no-repeat;
  background-position: center left;
  background-size: contain;
  background-image: url("../images/icon-selectarrow.png");
  transition: all .2s;
  left: -20px;
}

/* ul ul.sec-menu li.rotate a::after {
  transform: rotate(0deg);
  background-image: url("../images/icon-selectarrow-hover.svg");
}*/

ul li:hover>ul.sec-menu {
  visibility: visible;
  opacity: 1;
}

ul ul.sec-menu li a {
  width: 100%;
  display: flex;
  justify-content: center;
  text-align: left;
  color: #493137;
  font-size: 1rem;
}

ul ul.sec-menu li:hover a {
  color: #333;
}

/* 滑鼠滑入展開第三層選單 */
.show {
  display: grid !important;
}

ul ul.sec-menu ul.third-menu {
  margin-top: 6px;
  transition: all .3s;
  text-align: left;
  padding-left: 22px;
  display: none;
}

ul ul.sec-menu li.select ul.third-menu li a {
  font-size: 1rem;
  color: #6b7572;
  background-image: unset;
  line-height: 1.5;
  padding: 4px 0;
  border-bottom: 0px;
}

ul ul.sec-menu li.select ul.third-menu li a::before {
  display: none;
}

ul ul.sec-menu li ul.third-menu li:hover a {
  color: #493137;
}

ul ul.sec-menu li.select ul.third-menu li a::after {
  background-image: unset;
}

@media (max-width: 1200px) {
  header {
    position: relative;
    height: auto;
  }

  header .content {
    flex-wrap: wrap;
    gap: 2vw;
    padding: 2vw;
  }

  header .logo img {
    max-width: 246px;
  }

  header ul.menu>li>a {
    font-size: 1.06rem;
  }
}

/* @media (max-width: 1100px) {
  header .content {
    justify-content: center;
  }
} */

@media (max-width:768px) {
  header {
    position: relative;
    height: 106px;
  }

  header .content {
    gap: 2.5vw;
    padding: 2.5vw;
    align-items: center;
    justify-content: flex-start;
  }

  header .logo img {
    max-width: 206px;
  }

  header .logo {
    margin: 0;
  }

  /* mobile menu container */
  header #menu {
    position: fixed;
    width: 100%;
    height: calc(100vh - 106px);
    max-height: calc(100vh - 106px);
    top: 106px;
    left: 0;
    right: 0;
    padding: 1vw;
    background: rgb(245, 245, 245, 1);
    border-top: 2px solid #000;
    flex-direction: column-reverse;
    overflow: auto;
    pointer-events: none;
    opacity: 0;
    transform: translateX(-50%);
    transition: opacity 0.3s, -webkit-transform 0.3s;
  }

  header #menu {
    top: 106px;
  }

  /* menu list layout */
  header ul.menu {
    flex: none;
    font-size: 1.2rem !important;
    display: block;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  header ul.menu>li::after {
    display: none;
  }

  header ul.menu>li {
    display: block;
    padding: 0;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
  }

  header ul.menu>li:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
  }

  header ul.menu>li>a {
    display: block;
    padding: 8px 0;
    color: #333;
    height: auto;
  }

  header ul.menu>li>a:hover,
  header ul.menu>li.active>a {
    color: #fff;
  }

  header ul.menu>li>span {
    display: block;
    margin: 12px 0;
  }

  header ul.menu>li>span>label:after {
    content: "";
    position: absolute;
    top: 50%;
    right: 2rem;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0.5rem 0.5rem 0 0.5rem;
    border-color: #787878 transparent transparent transparent;
    transform: translateY(-50%) rotate(0deg);
    transition: all 0.3s;
  }

  header ul.menu>li>span input:checked~ol.sub {
    display: flex !important;
  }

  header ul.menu>li>span input:checked~label:after {
    transform: translateY(-50%) rotate(180deg);
  }

  /* menu checkbox interactions */
  header #menu-ck:checked~#menu {
    display: flex;
    pointer-events: auto;
    opacity: 1;
    transform: translateX(0);
  }

  header #menu-ck~label {
    display: block;
  }

  header #menu-ck~label {
    display: block;
  }

  /* sec-menu adjustments for mobile */
  header ul.menu ul.sec-menu {
    visibility: visible;
    opacity: 1;
    position: relative;
    grid-template-columns: 1fr 1fr;
    background: #ececec;
    padding: 4px 2px;
    top: auto;
    box-shadow: unset;
  }

  header ul.menu ul.sec-menu ul.third-menu {
    padding: 12px 8px;
    border-radius: 4px;
  }

  header ul.menu ul.sec-menu li a {
    font-size: .93rem;
  }

  header ul.menu ul.sec-menu ul.third-menu li a {
    font-size: .875rem;
  }

  /* top-nav horizontal overflow on mobile */
  .top-nav .block {
    max-width: 100%;
    overflow-x: auto;
    background: #f0e8a5;
  }

  .top-nav ul li {
    white-space: nowrap;
  }

  .top-nav ul {
    flex-wrap: nowrap;
    justify-content: flex-start;
    width: 100%;
  }

  header ul.menu {
    font-size: 1rem !important;
    overflow-y: scroll;
  }
}