.headmenu {
  width: 100%;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 999;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0rem 2.2rem 0rem;
  background: linear-gradient(to bottom, rgba(10, 7, 5, 0.7) 0%, rgba(10, 7, 5, 0.4) 45%, rgba(10, 7, 5, 0) 100%);
  transform: translateY(0) scale(1);
  transform-origin: top center;
  transition:
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.42s ease,
    background 0.35s ease,
    filter 0.45s ease;
  will-change: transform, opacity, filter;
  pointer-events: auto;
  
  transition:
    transform 1.5s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.5s ease !important;
  will-change: transform;
}

.headmenu.menu-hidden {
  transform: translateY(-85%) scale(0.98);
  opacity: 0;
  filter: blur(4px);
  pointer-events: none;
}

.menu_flex01 {
  width: auto;
  min-width: 180px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  position: relative;
  z-index: 1000;
}

.btn_logo {
  width: 14rem;
  position: relative;
  top: 0;
  left: 0;
}

.btn_logo a {
  display: block;
  transition:
    transform 0.25s ease,
    filter 0.25s ease,
    opacity 0.25s ease;
}

.btn_logo a:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.btn_logo img {
  width: 100%;
  height: auto;
  display: block;
  opacity: 1;
}

@keyframes btntogglesure {
  from {
    filter: brightness(1);
    transform: scale(1);
  }
  to {
    filter: brightness(1.12);
    transform: scale(1.03);
  }
}

.menu_flex02 {
  width: auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  position: relative;
  z-index: 999;
}

.menu {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu li {
  margin: 0;
  padding: 0;
  list-style: none;
  position: relative;
  background: none !important;
}

.lang-ch .menu li,
.lang-ch .menu li:hover,
.lang-ch .menu li.active {
  background-image: none !important;
}

.menu li img {
  display: none !important;
}

.menu li a {
  position: relative;
  display: inline-block;
  padding: 0.25rem 0;
  font-family: 'Times New Roman', 'Noto Serif TC', 'PMingLiU', serif;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  color: #d8c08a;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow:
    0 0 1px rgba(255, 241, 204, 0.18),
    0 1px 0 #6a4720,
    0 2px 8px rgba(15, 8, 4, 0.92);
  transition:
    color 0.25s ease,
    transform 0.25s ease,
    text-shadow 0.25s ease,
    opacity 0.25s ease;
  margin-top: 1rem;
}
.menu li a::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 0;
  height: 2px;
  transform: translateX(-50%);
  
  background: radial-gradient(circle, #f2dfaa 0%, rgba(216, 192, 138, 0) 80%);
  filter: blur(0.5px);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.menu li a:hover,
.menu li.active a,
.menu li a.active {
  color: #f2dfaa;
  
  filter: drop-shadow(0 0 5px rgba(242, 223, 170, 0.8));
}

.menu li a:hover::after,
.menu li.active a::after,
.menu li a.active::after {
  width: 120%; 
}

.btn_click {
  display: none;
}

.menu_flex04 {
  width: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  z-index: 999;
  margin-top: 0.05rem;
}

.menu_flex04 .social {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.social li,
.social_mb li {
  list-style: none;
}

.social li {
  width: 2.6rem;
  height: 2.6rem;
  margin: 0;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  background-color: rgba(45, 27, 12, 0.42);
  border: 1px solid rgba(214, 182, 116, 0.62);
  box-shadow:
    inset 0 0 0 1px rgba(255, 238, 196, 0.15),
    0 2px 10px rgba(0, 0, 0, 0.38);
  transition:
    transform 0.25s ease,
    filter 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
  margin-top: 1rem;
}

.social li:hover {
  transform: translateY(-2px) scale(1.04);
  filter: brightness(1.08);
  border-color: rgba(244, 220, 162, 0.92);
  box-shadow:
    inset 0 0 0 1px rgba(255, 240, 204, 0.28),
    0 0 14px rgba(255, 214, 120, 0.18),
    0 4px 12px rgba(0, 0, 0, 0.45);
}

.social li a,
.social_mb li a {
  width: 100%;
  height: 100%;
  display: block;
}

.social li img,
.social_mb li img {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0.01;
}

.social li:nth-of-type(1),
.social_mb li:nth-of-type(1) {
  background: url(../images/btn_top_01_yt.png) no-repeat center center;
  background-size: 100% auto;
}

.social li:nth-of-type(2),
.social_mb li:nth-of-type(2) {
  background: url(../images/btn_top_05_line.png) no-repeat center center;
  background-size: 100% auto;
}

.social li:nth-of-type(3),
.social_mb li:nth-of-type(3) {
  background: url(../images/btn_top_04_ba.png) no-repeat center center;
  background-size: 100% auto;
}

.social li:nth-of-type(4),
.social_mb li:nth-of-type(4) {
  background: url(../images/btn_top_03_fb.png) no-repeat center center;
  background-size: 100% auto;
}

.social_mb {
  display: none;
  margin: 0;
  padding: 0;
  list-style: none;
}

.btn_toggle {
  margin: 0;
  position: relative;
  display: none;
  z-index: 1001;
}

.btn_toggle a,
.btn_toggle.close a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  overflow: hidden;
  border-radius: 50%;

  background-repeat: no-repeat;
  background-position: center center;
  background-size: 70% auto;
  
  transition:
    transform 0.25s ease,
    filter 0.25s ease,
    box-shadow 0.25s ease,
    opacity 0.25s ease,
    background-color 0.25s ease,
    border-color 0.25s ease;
}

.btn_toggle a {
  background-image: url(../images/btn_toggle.webp);
}

.btn_toggle.close a {
  background-image: url(../images/btn_toggle_ov.webp);
}

.btn_toggle a img {
  display: none;
}

.btn_toggle a:hover,
.btn_toggle.close a:hover {
  transform: translateY(-1px) scale(1.04);
  filter: brightness(1.08);
  
}

@keyframes fat {
  0% {
    opacity: 0;
    transform: translateY(-100%);
  }
  100% {
    opacity: 1;
    transform: translateY(0%);
  }
}

@keyframes close_menu_anim {
  0% {
    opacity: 1;
    transform: translateY(0%);
  }
  100% {
    opacity: 0;
    transform: translateY(20%);
  }
}

@keyframes toggleFloat {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
  100% {
    transform: translateY(0);
  }
}

@media screen and (min-width: 1001px) {
  .btn_toggle {
    display: block;
    position: fixed;
    right: 1.2rem;
    top: 5%;
    transform: translateY(-50%) translateX(18px) scale(0.92);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 2005;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0));
    transition:
      opacity 0.35s ease,
      transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0.35s ease,
      filter 0.35s ease;
  }}

.menu li.menu_go {
  flex: 0 0 auto;
}

.menu li.menu_go a {
  display: block;
  width: 190px; 
  height: 64px; 
  margin: auto;
  margin-top: 0.4rem;
  padding: 0;
  background: url(../images/btn_go.png) no-repeat center center;
  background-size: contain;
  text-indent: -9999px;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  filter: drop-shadow(0 0 5px rgba(255, 210, 90, 0.35));
  animation: menuGoBreath 2.2s ease-in-out infinite;
}

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

.menu li.menu_go a::before {
  content: '';
  position: absolute;
  inset: 2px 5px;
  border-radius: 999px;

  filter: blur(16px);
  z-index: -1;
  animation: menuGoGlow 2.2s ease-in-out infinite;
}

.menu li.menu_go a:hover {
  transform: translateY(-2px) scale(1.04);
  filter: drop-shadow(0 0 2px rgba(255, 225, 130, 0.25)) drop-shadow(0 0 12px rgba(255, 185, 60, 0.35));
}

.menu li.menu_go a:hover::before {
  opacity: 1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes menuGoBreath {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 8px rgba(255, 210, 90, 0.35));
  }
  50% {
    transform: scale(1.05);
    filter: drop-shadow(0 0 2px rgba(255, 228, 140, 0.25)) drop-shadow(0 0 12px rgba(255, 184, 72, 0.28));
  }
}

@keyframes menuGoGlow {
  0%,
  100% {
    opacity: 0.65;
    transform: scale(0.96);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

.head_go {
  display: none;
  flex: 0 0 auto;
  position: relative;
  z-index: 1002;
}

.head_go a {
  display: block;
  width: 180px;
  height: 42px;
  top: -16px;
  background: url('../images/btn_go.png') center center / contain no-repeat;
  text-indent: -9999px;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  filter: drop-shadow(rgba(255, 210, 90, 0.35) 0px 0px 8px);
  animation: 2.2s ease-in-out 0s infinite normal none running menuGoBreath;
}

.head_go a::before {
  content: '';
  position: absolute;
  inset: 2px 5px;
  border-radius: 999px;
  filter: blur(16px);
  z-index: -1;
  animation: menuGoGlow 2.2s ease-in-out infinite;
}

.head_go a:hover {
  transform: translateY(-2px) scale(1.04);
  filter: drop-shadow(0 0 2px rgba(255, 225, 130, 0.25)) drop-shadow(0 0 12px rgba(255, 185, 60, 0.35));
}

.head_go {
  display: none;
}

@media screen and (max-width: 1600px) {

  .menu {
    gap: 5rem;
  }

  .menu li a {
    font-size: 1.12rem;
  }

  .menu li.menu_go a {
    width: 170px;
    height: 58px;
  }}

@media screen and (max-width: 1280px) {
  .headmenu {
    padding: 0.8rem 1.4rem 0.7rem;
  }

  .menu {
    gap: 1rem;
  }

  .menu li a {
    font-size: 1.04rem;
    letter-spacing: 0.06em;
  }

  .menu_flex04 .social {
    gap: 0.55rem;
  }

  .social li {
    width: 2.35rem;
    height: 2.35rem;
  }

  .menu li.menu_go a {
    width: 150px;
    height: 52px;
  }}

@media screen and (max-width: 1040px) {
  .menu_flex01 {
    min-width: auto;
  }

  .btn_logo {
    width: 8.2rem;
  }

  .menu_flex01 {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }

  .btn_logo {
    margin-right: 0;
  }}

@media screen and (max-width: 1000px) {
  .headmenu {
    width: 100%;
    display: block;
    height: 60px;
    padding: 0.35rem 0.8rem;
    background: linear-gradient(to bottom, rgba(18, 12, 8, 0.94) 0%, rgba(18, 12, 8, 0.82) 100%);
    
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transform: translateY(0) scale(1);
    opacity: 1;
    filter: none;
    transition:
      transform 0.4s ease,
      opacity 0.3s ease !important;
    will-change: transform;
  }

  .headmenu.menu-hidden {
    transform: translateY(-100%) !important;
    opacity: 1;
    pointer-events: auto;
    filter: none;
  }

  .menu_flex01 {
    width: 90%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.7rem;
  }

  .btn_logo {
    width: 9.5rem;
    margin-right: auto;
  }
  .btn_toggle {
    display: block;
    right: 2%;
    margin-top: 1%;
  }

  .btn_toggle {
    position: fixed;

    height: 60px;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    filter: none !important;
    z-index: 1003;
    
  }

  .btn_toggle a,
  .btn_toggle.close a {
    width: 3rem;
    height: 3rem;
    animation: none;
  }

  .menu_flex04 .social {
    display: none;
  }

  .menu_flex02 {
    width: 280px;
    height: auto;
    position: absolute;
    top: 0;
    right: 0;
    padding-top: 4.3rem;
    display: none;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    transition: none;
  }

  .menu_show .menu_flex02 {
    display: flex;
    animation: fat 0.5s ease;
  }

  .menu_flex02::after {
    content: '';
    width: 100%;
    height: 100vh;
    background: linear-gradient(to bottom, rgba(20, 13, 9, 0.97) 0%, rgba(28, 17, 10, 0.93) 55%, rgba(28, 17, 10, 0.78) 100%);
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
    border-left: 1px solid rgba(180, 140, 86, 0.16);
    box-shadow: -12px 0 30px rgba(0, 0, 0, 0.24);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .menu {
    width: 86%;
    margin: 0 auto;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.4rem;
  }

  .menu li {
    width: 100%;
    margin: 0;
    padding: 0;
    opacity: 1;
    transform: none;
  }

  .menu li a {
    width: 100%;
    display: block;
    text-align: center;
    font-size: 1.08rem;
    letter-spacing: 0.08em;
    padding: 0.75rem 0;
    
  }

  .menu li a::after {
    bottom: 0.45rem;
  }

  .btn_click {
    display: none;
  }

  .social_mb {
    padding: 0.8rem 1rem 1.2rem !important;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.8rem;
  }

  .social_mb li {
    width: 2.8rem;
    height: 2.8rem;
    margin: 0;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(214, 182, 116, 0.4);
    background-color: rgba(45, 27, 12, 0.38);
    box-shadow:
      inset 0 0 0 1px rgba(255, 238, 196, 0.08),
      0 2px 10px rgba(0, 0, 0, 0.18);
    opacity: 1;
    transform: none;
  }

  .social_mb li a {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }}

@media screen and (max-width: 769px) {
  .menu_flex02 {
    width: 300px;
  }

  .menu li a::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -4px;
    width: 0;
    height: 2px;
    transform: translateX(-50%);
    
    background: none;
    filter: blur(0.5px);
    transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .menu li a:hover,
  .menu li.active a,
  .menu li a.active {
    color: #f2dfaa;
    
    filter: none;
  }

  .menu li a:hover::after,
  .menu li.active a::after,
  .menu li a.active::after {
    width: 120%; 
  }

  .head_go {
    display: block;
    margin-left: auto;
    margin-right: 1rem; 
  }

  .head_go {
    display: block;
  }

  .menu li.menu_go {
    display: none;
  }}

@media screen and (max-width: 640px) {
  .btn_toggle a,
  .btn_toggle.close a {
    width: 3.5rem;
    height: 3.5rem;
  }

  .btn_logo {
    width: 8.8rem;
  }
  .btn_toggle {
    display: block;
    right: 2%;
    margin-top: 2%;
  }}

@media screen and (max-width: 550px) {
  .menu_flex02 {
    
    width: 100%;
  }

  .head_go a {
    display: block;
    width: 140px;
    height: 42px;
    top: -10px;
  }}

@media screen and (max-width: 400px) {
  .btn_logo{
    max-width: 10.2rem;
  }}

@media screen and (max-width: 370px) {
  .btn_logo {
    width: 8.8rem;
  }}
