#header {
  z-index: 999;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #fff;
  color: #202020;
  transition: all 0.4s;
}
#header:before {
  content: "";
  height: 100%;
  background: rgba(35, 41, 60, 0.7);
  backdrop-filter: blur(25px);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  pointer-events: none;
}
#header .fixed-menu-wrap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  pointer-events: none;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s;
}
#header .fixed-menu-wrap .fixed-menu {
  width: 100%;
}
/* 모바일(≤768): 스택 + 섹션별 아코디언 */
@media (max-width: 768px) {
  #header .fixed-menu-wrap .fixed-menu.fixed-menu--mega .fixed-menu__stack .menu-item + .menu-item {
    border-top: 1px solid hsla(0, 0%, 73%, 0.55);
  }

  #header .fixed-menu-wrap .fixed-menu .fixed-menu__stack .menu-item ul {
    display: none;
  }

  #header .fixed-menu-wrap .fixed-menu .menu-item ul li a.disabled {
    opacity: 0.3;
    cursor: no-drop;
  }
}

#header .inner {
  max-width: 1920px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  min-height: 60px;
  margin: 0 auto;
  padding: 0 40px;
  box-sizing: border-box;
}

/* 서브페이지(.active만, 메인 .main 제외)에서만 하단 구분선 */
#header.active:not(.main) .inner {
  border-bottom: 1px solid #e8e8e8;
}
@media (max-width: 1600px) {
  #header .inner {
    gap: 4.17vw;
    padding: 0 30px;
  }
}
@media (max-width: 768px) {
  #header .inner {
    padding: 0 20px;
    gap: 0;
    min-height: 60px;
    align-items: center;
  }
}
#header .inner .left {
  display: flex;
  align-items: center;
  height: 85px;
  gap: 40px;
}
@media (max-width: 1440px) {
  #header .inner .left {
    gap: 20px;
  }
}
@media (max-width: 768px) {
  #header .inner .left {
    height: 60px;
  }
}
#header .inner .left .logo {
  width: 160px;
  aspect-ratio: 160/36;
  background: url("/assets/icons/logo.png") no-repeat 50%/contain;
  display: block;
}
@media (max-width: 768px) {
  #header .inner .left .logo {
    width: 100px;
  }
}
#header .inner .right {
  display: flex;
  align-items: flex-start;
  min-height: 85px;
  flex: 1;
}
@media (max-width: 1440px) {
  #header .inner .right {
    flex: none;
  }
}
@media (max-width: 768px) {
  #header .inner .right {
    min-height: 60px;
    flex: 1;
    min-width: 0;
    justify-content: flex-end;
  }
}
#header .inner .right .menu-list {
  display: flex;
  align-items: flex-start;
  min-height: 85px;
  font-size: 19px;
  gap: 60px;
  margin: 0 auto;
  padding: 0 30px;
  font-weight: 500;
  transition: opacity 0.3s;
}
@media (max-width: 1600px) {
  #header .inner .right .menu-list {
    font-size: 18px;
    gap: 40px;
    padding: 0;
  }
}
@media (max-width: 1440px) {
  #header .inner .right .menu-list {
    display: none;
  }
}
@media (max-width: 768px) {
  #header .inner .right .menu-list {
    min-height: 85px;
  }
}
#header .inner .right .menu-list > li > ul {
  transition: all 0.3s;
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}
#header .inner .right .menu-list > li > ul li {
  position: relative;
  height: 40px;
}
#header .inner .right .menu-list > li > ul li a {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  font-size: 15px;
  white-space: nowrap;
}
@media (max-width: 1600px) {
  #header .inner .right .menu-list > li > ul li a {
    font-size: 13px;
  }
}
#header .inner .right .menu-list a {
  display: flex;
  align-items: center;
  height: 85px;
  padding: 0 12px;
}
#header .inner .right .btn-info-wrap {
  display: flex;
  align-items: center;
  height: 85px;
  gap: 27px;
  padding-left: 100px;
}
@media (max-width: 1600px) {
  #header .inner .right .btn-info-wrap {
    padding-left: 80px;
  }
}
#header .inner .right .btn-info-wrap .btn-info {
  display: flex;
  align-items: center;
  font-size: 15px;
}
/* 모바일(≤768): 닫힌 헤더 = KR + 햄버거만 / GNB 열림(#header.fixed) = 언어 숨김 + 회원·담당 한 줄 */
@media (max-width: 768px) {
  #header .inner .right .btn-info-wrap {
    height: 60px;
    min-height: 60px;
    padding-left: 8px;
    gap: 4px;
    flex: 1;
    min-width: 0;
    justify-content: flex-end;
    align-items: center;
  }

  #header:not(.fixed) .inner .right .btn-info-wrap .btn-info > #header-auth-guest,
  #header:not(.fixed) .inner .right .btn-info-wrap .btn-info > #header-auth-user,
  #header:not(.fixed) .inner .right .btn-info-wrap .btn-info > a#header-partner-link,
  #header:not(.fixed) .inner .right .btn-info-wrap .btn-info > a.header-admin-link,
  #header:not(.fixed) .inner .right .btn-info-wrap .btn-info > a.header-conference-link,
  #header:not(.fixed) .inner .right .btn-info-wrap .btn-info > a.header-bod-link {
    display: none !important;
  }

  #header.fixed .inner .right .btn-info-wrap .btn-info .dropdown-box {
    display: none !important;
  }

  #header.fixed .inner .right .btn-info-wrap {
    position: relative;
    overflow: visible;
  }

  #header.fixed .inner .right .btn-info-wrap .btn-info {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    left: auto;
    z-index: 5;
    display: flex;
    flex-flow: row wrap;
    align-items: center;
    justify-content: end;
    gap: 4px 6px;
    max-width: calc(100vw - 40px);
    min-width: 0;
    overflow: visible;
    font-size: 12px;
    line-height: 1.45;
    word-break: keep-all;
    overflow-wrap: anywhere;
  }

  #header.fixed .inner .right .btn-info-wrap .btn-info > #header-auth-guest,
  #header.fixed .inner .right .btn-info-wrap .btn-info > #header-auth-user {
    display: inline-flex;
    flex-flow: row wrap;
    align-items: center;
    flex-shrink: 0;
    min-width: 0;
    max-width: 100%;
  }

  #header.fixed .inner .right .btn-info-wrap .btn-info #header-user-name {
    white-space: normal;
  }

  #header.fixed .inner .right .btn-info-wrap .btn-info > a#header-partner-link,
  #header.fixed .inner .right .btn-info-wrap .btn-info > a.header-admin-link,
  #header.fixed .inner .right .btn-info-wrap .btn-info > a.header-conference-link,
  #header.fixed .inner .right .btn-info-wrap .btn-info > a.header-bod-link {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    white-space: normal;
    text-align: center;
  }

  #header.fixed .inner .right .btn-info-wrap .btn-info > a[hidden],
  #header.fixed .inner .right .btn-info-wrap .btn-info > a#header-partner-link[hidden] {
    display: none !important;
  }

  #header .inner .right .btn-info-wrap .btn-gnb {
    flex-shrink: 0;
  }

  #header.main:not(.fixed) .inner .right .btn-info-wrap .btn-info > a:not(:first-child):before,
  #header.main:not(.fixed) .inner .right .btn-info-wrap .btn-info > span > a:not(:first-child):before {
    background: rgba(255, 255, 255, 0.45);
  }

  #header.fixed .inner .right .btn-info-wrap .btn-info > a,
  #header.fixed .inner .right .btn-info-wrap .btn-info > span > a {
    color: #fff;
  }

  #header.fixed .inner .right .btn-info-wrap .btn-info > a:not(:first-child):before,
  #header.fixed .inner .right .btn-info-wrap .btn-info > span > a:not(:first-child):before {
    background: rgba(255, 255, 255, 0.45);
  }

  #header.fixed .inner .right .btn-info-wrap .btn-info > a.header-bod-link {
    color: #c4b5fd;
  }

  #header.main .inner .right .btn-info-wrap .btn-info > a,
  #header.main .inner .right .btn-info-wrap .btn-info > span > a {
    color: #fff;
  }

  #header.main .inner .right .btn-info-wrap .btn-info > a.header-bod-link {
    color: #c4b5fd;
  }
}
#header .inner .right .btn-info-wrap .btn-info > a,
#header .inner .right .btn-info-wrap .btn-info > span > a {
  position: relative;
  padding: 0 16px;
  transition: all 0.3s;
}

@media (max-width: 768px) {
  #header .inner .right .btn-info-wrap .btn-info > a,
  #header .inner .right .btn-info-wrap .btn-info > span > a {
    padding: 0 6px;
    font-size: 12px;
  }
}

#header .inner .right .btn-info-wrap .btn-info > a:not(:first-child):before,
#header .inner .right .btn-info-wrap .btn-info > span > a:not(:first-child):before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 1px;
  height: 8px;
  background: #202020;
  transform: translateY(-50%);
}

.header-username {
  font-weight: 500;
}

/* 관리자·학술대회 담당 링크: 기업회원·로그아웃과 동일 계열(상속 색·크기), 기업회원 바로 뒤에 배치 */
#header .inner .right .btn-info-wrap .btn-info > a.header-admin-link,
#header .inner .right .btn-info-wrap .btn-info > a.header-conference-link {
  color: inherit;
  font-weight: 400;
  font-size: inherit;
}
#header .inner .right .btn-info-wrap .btn-info > a.header-bod-link {
  color: #a78bfa;
  font-weight: 700;
  font-size: inherit;
}
#header .inner .right .btn-info-wrap .btn-info .dropdown-box {
  position: relative;
  padding: 0;
}
#header .inner .right .btn-info-wrap .btn-info .dropdown-box .btn-dropdown {
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 8px;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
}
#header .inner .right .btn-info-wrap .btn-info .dropdown-box .btn-dropdown:after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-left: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(-45deg);
  margin-bottom: 4px;
  transition: transform 0.2s;
}
#header .inner .right .btn-info-wrap .btn-info .dropdown-box .btn-dropdown.active:after {
  transform: rotate(135deg);
  margin-bottom: 0;
}
#header .inner .right .btn-info-wrap .btn-info .dropdown-box .dropdown-list {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  min-width: 80px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}
#header .inner .right .btn-info-wrap .btn-info .dropdown-box .dropdown-list ul {
  margin: 0;
  padding: 6px 0;
  list-style: none;
}
#header .inner .right .btn-info-wrap .btn-info .dropdown-box .dropdown-list a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 20px;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
#header .inner .right .btn-info-wrap .btn-info .dropdown-box .dropdown-list a:hover {
  background: #f5f5f5;
  color: #202020;
}
#header .inner .right .btn-info-wrap .btn-info .dropdown-box .dropdown-list a.active {
  color: #202020;
  font-weight: 700;
}
#header .inner .right .btn-info-wrap .btn-gnb {
  background: transparent;
  border: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 28px;
  padding: 3px 1px;
  gap: 7px;
  cursor: pointer;
}
#header .inner .right .btn-info-wrap .btn-gnb span {
  display: block;
  width: 100%;
  height: 2px;
  background: #202020;
  border-radius: 10px;
  transition: all 0.3s;
}
#header .inner .right .btn-info-wrap .btn-gnb:before {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: #202020;
  margin-right: auto;
  transition: all 0.3s;
}
#header .inner .right .btn-info-wrap .btn-gnb:after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: #202020;
  margin-left: auto;
  transition: all 0.3s;
}
#header .inner .right .btn-info-wrap .btn-gnb:hover:after, #header .inner .right .btn-info-wrap .btn-gnb:hover:before {
  width: 100%;
}
#header.main {
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid hsla(0, 0%, 100%, 0.2);
  color: #fff;
  transition: border-bottom-color 0.2s ease 0.32s;
}
#header.main:has(.menu-list:hover) {
  border-bottom-color: transparent;
  transition: border-bottom-color 0.15s ease 0s;
}
#header.main .inner .left .logo {
  background: url("/assets/icons/logo_W.png") no-repeat 50%/contain;
}
#header.main .inner .right .btn-info-wrap .btn-info .btn-dropdown:after {
  border-color: #fff;
}
#header.main .inner .right .btn-gnb:after,
#header.main .inner .right .btn-gnb:before,
#header.main .inner .right .btn-gnb span,
#header.main .inner .right .btn-info-wrap .btn-info > :not(:first-child):before,
#header.main .inner .right .btn-info-wrap .btn-info > span > a:not(:first-child):before,
#header.main .inner .right .btn-info-wrap .btn-info > span:before {
  background: #fff;
}
#header.main.active {
}
#header.fixed {
  height: 100%;
  background: transparent !important;
  color: #fff;
  z-index: 1001;
}
#header.fixed:before {
  opacity: 1;
}
#header.fixed .inner {
  z-index: 1;
  position: relative;
}
/* GNB 열림: absolute .btn-info가 헤더 밖으로 나와도 잘리지 않도록 */
#header.fixed,
#header.fixed .inner,
#header.fixed .inner .right,
#header.fixed .inner .right .btn-info-wrap {
  overflow: visible;
}
#header.fixed .inner .left .logo {
  background: url("/assets/icons/logo_W.png") no-repeat 50%/contain;
}
#header.fixed .inner .right .menu-list {
  opacity: 0;
  pointer-events: none;
}
#header.fixed .inner .right .btn-info-wrap .btn-info > :not(:first-child):before,
#header.fixed .inner .right .btn-info-wrap .btn-info > a:not(:first-child):before,
#header.fixed .inner .right .btn-info-wrap .btn-info > span > a:not(:first-child):before {
  background: #fff;
}
#header.fixed .inner .right .btn-info-wrap .btn-info .btn-dropdown:after {
  border-color: #fff;
}
#header.fixed .inner .right .btn-info-wrap .btn-gnb {
  position: relative;
  padding: 14px;
}
#header.fixed .inner .right .btn-info-wrap .btn-gnb:before {
  position: absolute;
  width: 100%;
  top: 50%;
  left: 0;
  transform: rotate(45deg);
  background: #fff;
}
#header.fixed .inner .right .btn-info-wrap .btn-gnb:after {
  position: absolute;
  width: 100%;
  top: 50%;
  left: 0;
  transform: rotate(-45deg);
  background: #fff;
}
#header.fixed .inner .right .btn-info-wrap .btn-gnb span {
  opacity: 0;
}
#header.fixed .fixed-menu-wrap {
  opacity: 1;
  pointer-events: auto;
}
@media (max-width: 768px) {
  #header.fixed .fixed-menu-wrap {
    height: calc(100vh - 145px);
    overflow: auto;
    top: 150px;
    align-items: flex-start;
  }
  #header.fixed .fixed-menu-wrap .fixed-menu .menu-item {
    padding: 15px 5px;
  }
  #header.fixed .fixed-menu-wrap .fixed-menu .menu-item .menu-title {
    position: relative;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
  }
  #header.fixed .fixed-menu-wrap .fixed-menu .menu-item .menu-title:after {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    border-left: 1px solid #fff;
    border-bottom: 1px solid #fff;
    transform: rotate(-45deg);
    margin-bottom: 5px;
    background: none;
  }
  #header.fixed .fixed-menu-wrap .fixed-menu .menu-item.active .menu-title:after {
    transform: rotate(-225deg);
    margin-bottom: 0;
  }
  #header.fixed .fixed-menu-wrap .fixed-menu .menu-item.active ul {
    display: block;
    margin-top: 10px;
  }
  #header.fixed .fixed-menu-wrap .fixed-menu .menu-item.active ul li a {
    display: block;
    padding: 6px 0;
  }
}
#header .inner .right .menu-list:hover > li > ul {
  max-height: 60vh;
  opacity: 1;
  pointer-events: auto;
  padding: 17px 0;
}
#header .inner .right .menu-list:hover > li > ul a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
  opacity: 1;
}

/* PHP: 언어 드롭다운 기본 숨김 */
#header .dropdown-box:not(.is-open) .dropdown-list {
  display: none;
}
#header .inner .right .menu-list > li > a {
  color: inherit;
  text-decoration: none;
}
#header .inner .right .menu-list > li > ul a {
  color: inherit;
  text-decoration: none;
}
#header.fixed .fixed-menu-wrap .fixed-menu .menu-item ul li a {
  color: #fff;
  text-decoration: none;
}

/* 데스크톱(769px+): 2열(학회소개·커뮤니티 | 학술대회·마이페이지), 세로 구분선 */
@media (min-width: 769px) {
  #header.fixed {
    min-height: 100vh;
    min-height: 100dvh;
  }

  #header.fixed:before {
    background: #1a1630;
    backdrop-filter: none;
  }

  #header.fixed .fixed-menu-wrap {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #header .fixed-menu-wrap {
    padding: 0 clamp(16px, 2vw, 36px);
    box-sizing: border-box;
  }

  #header .fixed-menu-wrap .fixed-menu.fixed-menu--mega {
    display: block;
    max-width: 1520px;
    margin: 0 auto;
    padding: clamp(28px, 4vh, 52px) clamp(12px, 1.8vw, 32px);
    box-sizing: border-box;
  }

  #header .fixed-menu-wrap .fixed-menu.fixed-menu--mega .fixed-menu__stack {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: 0;
    align-items: stretch;
    width: 100%;
    min-height: 0;
    padding-top: clamp(0.25rem, 1vh, 0.75rem);
    padding-bottom: clamp(0.25rem, 1vh, 0.75rem);
    box-sizing: border-box;
  }

  #header .fixed-menu-wrap .fixed-menu.fixed-menu--mega .fixed-menu__stack .menu-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    min-height: 100%;
    padding: 0 clamp(0.75rem, 1.5vw, 1.25rem);
    border-top: none;
    min-width: 0;
    box-sizing: border-box;
  }

  #header .fixed-menu-wrap .fixed-menu.fixed-menu--mega .fixed-menu__stack .menu-item:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255, 255, 255, 0.22);
  }

  #header .fixed-menu-wrap .fixed-menu.fixed-menu--mega .fixed-menu__stack .menu-item .menu-title {
    position: static;
    margin: 0 0 clamp(0.75rem, 1.4vh, 1.1rem);
    font-size: clamp(1.15rem, 1.35vw, 1.45rem);
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.03em;
    line-height: 1.25;
    pointer-events: none;
  }

  #header .fixed-menu-wrap .fixed-menu.fixed-menu--mega .fixed-menu__stack .menu-item ul {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: clamp(0.35rem, 0.9vh, 0.55rem);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  #header .fixed-menu-wrap .fixed-menu.fixed-menu--mega .fixed-menu__stack .menu-item ul li {
    width: 100%;
  }

  #header .fixed-menu-wrap .fixed-menu.fixed-menu--mega .fixed-menu__stack .menu-item ul li a {
    font-size: clamp(0.9rem, 1.02vw, 1.05rem);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.55;
    display: inline-block;
    padding: 3px 0;
    transition: color 0.15s ease, opacity 0.15s ease;
  }

  #header .fixed-menu-wrap .fixed-menu.fixed-menu--mega .fixed-menu__stack .menu-item ul li a:hover {
    color: #fff;
    opacity: 1;
  }
}
