header {
  position: relative;
  width: 100%;
  height: auto;
  background: rgb(255, 255, 255, 1);
  z-index: 1000;
  transition: all 0.4s ease-in-out;
  animation-duration: 750ms;
  padding: 20px 2.5vw;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

header .content {
  width: 100%;
  /* height: 100%; */
  margin: 0 auto;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

header .logo img {
  width: 100%;
  max-width: 400px;
  min-width: 360px;
}

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;
  flex-wrap: wrap;
  gap: 6px;
}

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

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

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 6px;
  font-size: 1.06rem;
}

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

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: #003399;
  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 {
  position: relative;
  height: auto;
  display: flex;
  align-items: center;
  margin: 0;
}

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

.top-nav ul {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.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: #003399;
  font-size: .91rem;
  transition-duration: .5s;
}

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

.top-nav ul li a.lan {
  font-family: "Roboto condensed", sans-serif;
  font-size: .875rem;
  border-radius: 4px;
  width: 48px;
  height: 24px;
  color: #fff;
  background: #006FFF;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

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

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

/* 滑鼠滑入展開次選單*/
ul ul.sec-menu {
  position: absolute;
  z-index: 100;
  width: auto;
  min-width: 166px;
  visibility: hidden;
  opacity: 0;
  transition: all .3s;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 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: 12px;
  padding-bottom: 4px;
  color: #003399;
  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: #000;
  font-size: 1rem;
  padding: 4px 0px;
}

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: #003399;
}

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

@media (max-width:1200px) {
  header {
    position: relative;
    height: 100px;
    padding: 10px 2.5vw;
    gap: 0;
  }

  header .logo img {
    max-width: 320px;
    height: auto;
  }

  header .content {
    padding: 1vw 0vw;
    align-items: center;
  }

  header #menu {
    position: fixed;
    width: 100%;
    height: calc(100vh - 100px);
    max-height: calc(100vh - 100px);
    top: 100px;
    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: 100px;
  }

  header .logo {
    margin: 0 auto;
  }

  /* 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 .block {
    right: auto;
  }

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

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

@media (max-width: 767px) {
  header ul.menu {
    font-size: 1rem !important;
    overflow-y: scroll;
  }

}

@media (max-width: 768px) {
  .top-nav .block {
    max-width: 100%;
    overflow-x: auto;
  }

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

  header .logo img {
    min-width: 300px;
    max-width: 300px;
    height: auto;
  }
}