.nav .dropdown-menu.nav-account-menu {
  width: 320px;
  padding: 10px;
  border-color: #eee3e8;
  border-radius: 16px;
  box-shadow: 0 18px 45px rgba(61, 42, 51, 0.16);
}

.nav-account-menu,
.nav-mobile-menu {
  font-family: "Noto Sans TC", sans-serif;
}

.nav-user-card-wrap {
  padding: 0 !important;
  margin: 0 0 8px !important;
  line-height: normal !important;
}

.nav-user-card {
  display: flex !important;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 10px;
  color: #414a53;
  border: 1px solid #f0e3e8;
  border-radius: 13px;
  background: linear-gradient(135deg, #fff7fa, #fff);
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.nav-user-card:hover {
  color: #414a53;
  border-color: #edc4d3;
  box-shadow: 0 6px 16px rgba(197, 74, 103, 0.1);
  transform: translateY(-1px);
}

.nav-user-avatar {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  object-fit: cover;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(62, 45, 53, 0.12);
}

.nav-user-copy {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.nav-user-name {
  overflow: hidden;
  color: #303842;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-user-copy small {
  margin-top: 2px;
  color: #979fa7;
  font-size: 11px;
  line-height: 1.3;
}

.nav-user-role {
  flex: 0 0 auto;
  padding: 3px 7px;
  color: #cc4773;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  border-radius: 999px;
  background: #ffe9f1;
}

.nav-user-arrow {
  flex: 0 0 auto;
  color: #b3bac0;
  font-size: 11px;
}

.nav-account-menu .tag,
.nav-mobile-menu .tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 4px 8px 8px;
  padding: 0 10px;
  color: #cf4774;
  font-family: "Noto Sans TC", sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.02em;
  border-radius: 999px;
  background: #fff0f5;
}

.menu-backdrop {
  display: none;
}

.nav .dropdown-menu.nav-account-menu > .nav-menu-entry,
.offset-menu .offset-menu-list.nav-mobile-menu > .nav-menu-entry {
  padding: 0;
  margin: 0;
  line-height: normal;
}

.nav-menu-entry {
  position: relative;
  list-style: none;
}

.nav-menu-entry > a {
  display: flex !important;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  color: #59636d;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  border-radius: 10px;
  text-decoration: none;
  transition: color 0.2s, background-color 0.2s, transform 0.2s;
}

.nav-menu-entry > a > i {
  flex: 0 0 20px;
  width: 20px;
  color: #9aa3ab;
  text-align: center;
}

.nav-menu-entry > a:hover {
  color: #c93669;
  background: #fff2f6;
  transform: translateX(2px);
}

.nav-menu-entry.is-active > a {
  color: #c93669;
  background: linear-gradient(90deg, #ffeaf1, #fff7fa);
}

.nav-menu-entry.is-active > a > i {
  color: #e34f7f;
}

.nav-menu-entry > .badge {
  position: absolute !important;
  top: 50% !important;
  right: 10px !important;
  transform: translateY(-50%) !important;
}

.nav-menu-entry.has-badge > a {
  padding-right: 48px;
}

.nav-menu-entry.divided {
  margin-bottom: 6px !important;
  padding-bottom: 6px !important;
  border-bottom: 1px solid #f0e8ec !important;
}

.nav-menu-entry.is-logout {
  margin-top: 8px !important;
  padding-top: 8px !important;
  border-top: 1px solid #f0e8ec;
}

.nav-menu-entry.is-logout > a,
.nav-menu-entry.is-logout > a > i {
  color: #c54a58;
}

@media (max-width: 959px) {
  .menu-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    background: rgba(39, 29, 34, 0.28);
    transition: opacity 0.2s, visibility 0s linear 0.2s;
    z-index: 2;
  }

  .menu-backdrop.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition-delay: 0s;
  }

  .offset-menu {
    right: auto;
    display: flex;
    flex-direction: column;
    width: min(88vw, 360px);
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    padding: 76px 14px 24px;
    box-sizing: border-box;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    box-shadow: none;
    transition: transform 0.3s, opacity 0.2s, visibility 0s linear 0.3s;
  }

  .offset-menu > .hamburger.active {
    top: 10px;
    left: 10px;
    width: 44px;
    height: 44px;
    padding: 8px 10px;
    box-sizing: border-box;
    border-radius: 12px;
    background: #fff4f7;
    box-shadow: 0 5px 14px rgba(197, 74, 103, 0.12);
  }

  .offset-menu > .hamburger.active .line {
    position: absolute;
    top: 21px;
    left: 10px;
    margin: 0;
  }

  .offset-menu > .hamburger.active .line:nth-child(1) {
    transform: rotate(45deg);
  }

  .offset-menu > .hamburger.active .line:nth-child(2) {
    opacity: 0;
  }

  .offset-menu > .hamburger.active .line:nth-child(3) {
    transform: rotate(-45deg);
  }

  .offset-menu.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    box-shadow: 18px 0 38px rgba(45, 31, 37, 0.12);
    transition-delay: 0s;
  }

  .offset-menu .avatar {
    margin-bottom: 12px;
  }

  .offset-menu .nav-user-card-wrap {
    margin-bottom: 12px !important;
  }

  .offset-menu .nav-user-card {
    min-height: 58px;
    padding: 10px 12px;
  }

  .offset-menu .nav-user-avatar {
    flex-basis: 54px;
    width: 54px;
    height: 54px;
  }

  .offset-menu .nav-user-name {
    font-size: 17px;
  }

  .offset-menu .offset-menu-list.nav-mobile-menu {
    flex: 1 1 0% !important;
    height: 0;
    max-height: 100%;
    min-height: 0;
    width: 100%;
    margin: 12px 0 0;
    padding: 0 0 16px;
    padding: 0 0 calc(16px + env(safe-area-inset-bottom));
    font-size: 16px;
    overflow-x: hidden;
    overflow-y: scroll !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  .offset-menu .nav-menu-entry > a {
    min-height: 48px;
    font-size: 15px;
  }

  .offset-menu .nav-mobile-menu .nav-menu-entry.is-logout {
    margin-top: 8px !important;
    padding-top: 8px !important;
  }
}

@media (max-width: 380px) {
  .nav .dropdown-menu.nav-account-menu {
    width: calc(100vw - 24px);
  }
}
