.aside-area {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  padding: 28px 20px;
  z-index: 5;
  box-sizing: border-box;
  background: var(--lg);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.aside-area::-webkit-scrollbar,
.aside-area::-webkit-scrollbar-thumb,
.aside-area::-webkit-scrollbar-track {
  display: none;
}
.aside-area .logo img {
  width: 100%;
  height: auto;
}

.aside-area .menu ul {
  display: flex;
  flex-flow: column;
  gap: 2px;
  width: 100%;
}
.aside-area .menu ul li {
  width: 100%;
  height: auto;
}
.aside-area .menu ul li .child-box {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
}
.aside-area .menu ul li.arrow .child-box:before {
  position: absolute;
  top: 15.5px;
  right: 12px;
  transform: rotate(-180deg);
  content: '';
  display: block;
  width: 18px;
  height: auto;
  aspect-ratio: 18 / 18;
  background: url(./../img/chevron-down.png) no-repeat 50% 50%;
  background-size: cover;
  transition: all 0.3s;
}
.aside-area .menu ul li.arrow .child-box.on:before {
  transform: rotate(0deg);
}
.aside-area .menu ul li .child-box .tit {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 49px;
  padding: 0 12px;
  font-size: 16px;
  font-weight: bold;
  line-height: 1;
  color: var(--wt);
  cursor: pointer;
  box-sizing: border-box;
  border-radius: 10px;
}
.aside-area .menu ul li.active .child-box .tit {
  background: var(--pr);
  color: #fff;
}
.aside-area .menu ul li .child-box .tit img {
  width: 20px;
  height: auto;
}

.aside-area .menu ul li .child-box .toggle_wt {
  display: none;
}

.aside-area .menu ul li .child-box .toggle-box {
  position: relative;
  display: flex;
  flex-flow: column;
  gap: 22px;
  padding: 10px 0px 10px 30px;
  box-sizing: border-box;
}
.aside-area .menu ul li .child-box .toggle-box:before {
  position: absolute;
  top: 50%;
  left: 8px;
  transform: translateY(-50%);
  content: '';
  display: block;
  width: 1px;
  height: calc(100% - 10px);
  background: var(--wt);
  opacity: 0.2;
}
.aside-area .menu ul li .child-box .toggle-box a {
  font-size: 15px;
  font-weight: bold;
  line-height: 1;
  color: var(--wt);
}

/* 활성 하위 메뉴 링크 스타일 수정 (보라색 글씨) */
.aside-area .menu ul li .child-box .toggle-box a.toggle-link.active {
  color: var(--pr); /* 글씨 색상을 보라색으로 변경 */
  /* 배경색, 패딩, radius 등은 제거하여 기본 링크 스타일과 유사하게 만듦 */
  /* font-weight: bold; */ /* 필요시 굵게 표시 */
}

/* 기존 링크 스타일과 구분하기 위해 조금 더 구체적인 선택자 사용 */
.aside-area .menu ul li .child-box .toggle-box a.toggle-link {
  text-decoration: none; /* 밑줄 제거 (기본값) */
  transition: color 0.2s; /* 부드러운 색상 전환 효과 (background-color -> color) */
}

.aside-area .language {
  width: 100%;
  height: auto;
  margin-top: 10px;
  padding-top: 30px;
}
.aside-area .language .lang_btn {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 42px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  padding: 11px 12px;
  box-sizing: border-box;
  margin-top: 20px;
}
.aside-area .language .lang_btn img {
  position: absolute;
  top: 50%;
  right: 9px;
  transform: translateY(-50%);
  width: 18px;
  height: auto;
}
.aside-area .language .lang_btn span {
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: bold;
  line-height: 1;
  color: var(--wt);
}
.aside-area .language .lang_btn span:after {
  content: '';
  display: block;
  width: 1px;
  height: 12px;
  margin: 0 10px;
  background: #bbb;
}
.aside-area .language .lang_btn span:last-of-type:after {
  display: none;
}

/* advert-area2 */
.advert-area2 {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: auto;
  aspect-ratio: 240 / 240;
  /* border: 1px solid rgba(255, 255, 255, 0.2); */
  box-sizing: border-box;
  border-radius: 10px;
}

.advert-area2 img {
  border-radius: 10px;
}

.advert-area2 p {
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  color: #ffffff;
}

/* advert-area */
.advert-area {
  position: fixed;
  top: 0;
  right: 0;
  display: flex;
  box-sizing: border-box;
  padding: 28px 8px 0;
  align-items: center;
  justify-content: center;
  max-width: 280px;
  width: 100%;
  height: 100vh;
  background-image: var(--lg);
  z-index: 3;
}
.advert-area .txt {
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  color: var(--wt);
}

/* Data 메뉴 항목의 화살표 숨기기 */
.aside-area .menu ul li:nth-child(2).arrow .child-box::before {
  display: none !important;
}

/* Mobile specific styles */
@media screen and (max-width: 600px) {
  .aside-area {
    padding-bottom: 20px;
  }
  .aside-area .language {
    padding-top: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 20px !important;
  }
  .aside-area .language .lang_btn {
    height: 38px;
    padding: 9px 10px;
  }
  .advert-area2 {
    aspect-ratio: 240 / 150;
    margin-top: 0;
  }
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  border-radius: 10px;
  margin: 24px 0 0 0;
  padding: 6px 0;
}
.theme-btn {
  background: none;
  border: none;
  color: #bbb;
  font-weight: bold;
  font-size: 15px;
  padding: 6px 10px;
  border-radius: 8px;
  transition:
    color 0.2s,
    background 0.2s,
    opacity 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 1;
}
.theme-btn .icon {
  font-size: 16px;
  color: inherit;
}
.theme-btn.active {
  color: var(--wt);
  background: none;
}
.theme-sep {
  color: #bbb;
  font-size: 15px;
  opacity: 1;
}

.language {
  margin: 0 !important;
  padding: 0 !important;
}

body.light .aside-area,
.light .aside-area {
  background: var(--black_0f);
}
body.light .aside-area .active,
body.light .aside-area .theme-btn.active {
  color: #fff;
}
/* 라이트 모드 버튼 배경 */
body.light .aside-area .theme-toggle {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

body.light .aside-area .language .lang_btn {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* 라이트 모드 테마 버튼 글자 색상 */
body.light .aside-area .theme-btn {
  color: #888;
}

body.light .aside-area .theme-btn .icon {
  filter: brightness(0) saturate(100%) invert(53%) sepia(0%) saturate(0%) hue-rotate(0deg)
    brightness(88%) contrast(88%);
}

body.light .aside-area .theme-btn.active,
body.light .aside-area .theme-btn.active .icon {
  color: #000;
}

body.light .aside-area .theme-btn.active .icon {
  filter: brightness(0) saturate(100%) invert(0%) sepia(0%) saturate(0%) hue-rotate(0deg)
    brightness(0%) contrast(100%);
}
body.light .aside-area img.logo-img {
  filter: none;
}
body.light .aside-area img.forum-icon {
  filter: brightness(0) saturate(0%) invert(0.3) sepia(1) hue-rotate(0deg) brightness(0.7);
}
body.light .aside-area .forum-count {
  color: #4e4e4e;
}

/* 라이트 모드에서 비활성 메뉴 아이콘 반전 */
body.light .aside-area .menu ul li .child-box .tit img {
  filter: invert(1);
}
/* 라이트 모드에서 활성 메뉴 아이콘 원본 */
body.light .aside-area .menu ul li.active .child-box .tit img {
  filter: none;
}
/* 나이트 모드에서 모든 메뉴 아이콘 원본 */
body.night .aside-area .menu ul li .child-box .tit img {
  filter: none !important;
}

/* 사이드바 로고 테마 관리 */
.aside-area .logo {
  position: relative;
  width: 180px;
  height: auto;
  margin: 0 auto 30px;
}
.aside-area .logo .logo-night,
.aside-area .logo .logo-day {
  width: 100%;
  height: auto;
  position: absolute;
  top: 0;
  left: 0;
}
/* 높이 확보를 위한 더미 요소 */
.aside-area .logo::before {
  content: '';
  display: block;
  width: 100%;
  padding-bottom: 20%; /* 로고 비율에 맞게 조정 */
}

/* 기본값: 나이트 모드 로고 표시 */
.aside-area .logo .logo-night {
  display: block !important;
}
.aside-area .logo .logo-day {
  display: none !important;
}

/* 데이 모드: 데이 로고 표시 */
body.light .aside-area .logo .logo-night,
body.day .aside-area .logo .logo-night {
  display: none !important;
}
body.light .aside-area .logo .logo-day,
body.day .aside-area .logo .logo-day {
  display: block !important;
}
