@use '../variables' as *;

.side-nav {
  display: flex;
  flex-direction: column;
  width: 2rem;
  height: 100vh;
  background: #1a1a2e;
  color: #fff;
  padding: 0.2rem 0.12rem;
  box-sizing: border-box;
  position: fixed;
  left: 0;
  top: 0;

  &__header {
    display: flex;
    align-items: center;
    gap: 0.08rem;
    padding: 0.1rem 0.08rem;
    margin-bottom: 0.2rem;
  }

  &__avatar {
    width: 0.36rem;
    height: 0.36rem;
    border-radius: 50%;
    background: #2e3142;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.18rem;
  }

  &__logo-text {
    font-size: 0.16rem;
    font-weight: 600;
    color: #fff;
  }

  // Logo 图片
  &__logo-img {
    width: 1.32rem;
    height: 0.34rem;
    display: block;
  }

  &__menu {
    display: flex;
    flex-direction: column;
    gap: 0.04rem;
    flex: 1;
  }

  &__item {
    display: flex;
    align-items: center;
    gap: 0.08rem;
    padding: 0.1rem 0.12rem;
    border-radius: 0.14rem;
    color: #9598ab;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-size: 0.14rem;

    &:hover {
      background: rgba(255, 255, 255, 0.05);
      color: #fff;
    }

    &--active {
      background: #1F2937;
      color: #fff;
    }
  }

  &__item-icon {
    width: 0.2rem;
    height: 0.2rem;
    object-fit: contain;
  }

  &__item-label {
    flex: 1;
  }

  &__badge {
    background: #e85635;
    color: #fff;
    font-size: 0.1rem;
    padding: 0.02rem 0.06rem;
    border-radius: 0.2rem;
    font-weight: 600;
  }

  &__footer {
    display: flex;
    flex-direction: column;
    gap: 0.04rem;
    border-top: 1px solid #2e3142;
    padding-top: 0.12rem;
  }
}

.side-nav__dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: $overlay-bg;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.side-nav__dialog {
  background: $bg-white;
  border-radius: 0.12rem;
  width: 4rem;
  max-width: 90vw;
  box-shadow: 0 0.04rem 0.2rem rgba(0, 0, 0, 0.15);
}

.side-nav__dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.16rem 0.2rem;
  border-bottom: 1px solid $border-color;
  font-size: 0.16rem;
  font-weight: 600;
  color: $text-dark;
}

.side-nav__dialog-close {
  cursor: pointer;
  color: $text-light;
  font-size: 0.16rem;

  &:hover {
    color: $text-dark;
  }
}

.side-nav__dialog-body {
  padding: 0.2rem;
  font-size: 0.14rem;
  color: $text-dark;
}

// ==================== 消息通知弹窗（左右分栏） ====================
.side-nav__message-dialog {
  background: $bg-white;
  border-radius: 0.12rem;
  width: 8rem;
  height: 6rem;
  max-width: 90vw;
  max-height: 90vh;
  box-shadow: 0 0.04rem 0.2rem rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
}

.side-nav__message-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.16rem 0.2rem;
  border-bottom: 1px solid $border-color;
  font-size: 0.16rem;
  font-weight: 600;
  color: $text-dark;
  flex-shrink: 0;
}

.side-nav__message-dialog-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

// 左侧消息列表
.side-nav__message-list {
  width: 2rem;
  border-right: 1px solid $border-color;
  overflow-y: auto;
  flex-shrink: 0;
}

.side-nav__message-list-item {
  display: flex;
  align-items: center;
  padding: 0.12rem 0.14rem;
  cursor: pointer;
  border-bottom: 1px solid $border-color;
  transition: background 0.2s;

  &:hover {
    background: $bg-main;
  }

  &--active {
    background: $theme-color;
  }
}

.side-nav__message-list-title {
  flex: 1;
  font-size: 0.13rem;
  color: $text-dark;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-nav__message-unread-dot {
  width: 0.08rem;
  height: 0.08rem;
  border-radius: 50%;
  background: $danger;
  margin-left: 0.06rem;
  flex-shrink: 0;
}

.side-nav__message-list-loading,
.side-nav__message-list-empty {
  padding: 0.16rem;
  text-align: center;
  font-size: 0.12rem;
  color: $text-light;
}

// 右侧消息详情
.side-nav__message-detail {
  flex: 1;
  padding: 0.2rem;
  overflow-y: auto;
}

.side-nav__message-detail-title {
  font-size: 0.16rem;
  font-weight: 600;
  color: $text-dark;
  margin-bottom: 0.16rem;
}

.side-nav__message-detail-content {
  font-size: 0.14rem;
  color: $text-dark;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.side-nav__message-detail-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 0.14rem;
  color: $text-light;
}

// 反馈弹窗
.feedback-dialog {
  padding: 0.28rem 0.24rem;
  width: 4.83rem;

  &__title {
    font-size: 0.2rem;
    font-weight: 700;
    color: $text-dark;
    margin-bottom: 0.24rem;
  }

  &__section {
    margin-bottom: 0.2rem;
  }

  &__label {
    font-size: 0.14rem;
    font-weight: 600;
    color: $text-dark;
    margin-bottom: 0.12rem;
  }

  &__options {
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
  }

  &__option {
    padding: 0.08rem 0.16rem;
    background: $bg-main;
    border-radius: 0.08rem;
    font-size: 0.14rem;
    color: $text-dark;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;

    &:hover {
      background: $theme-color;
      border-color: $accent;
    }

    &--active {
      background: $theme-color;
      border-color: $accent;
      color: $accent-hover;
    }
  }

  &__textarea {
    width: 100%;
    padding: 0.12rem 0.14rem;
    background: $bg-main;
    border: 1px solid transparent;
    border-radius: 0.08rem;
    font-size: 0.13rem;
    color: $text-dark;
    resize: none;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.2s;

    &::placeholder {
      color: $text-light;
    }

    &:focus {
      border-color: $accent;
    }
  }

  &__actions {
    display: flex;
    gap: 0.12rem;
    margin-top: 0.24rem;
  }

  &__btn {
    flex: 1;
    padding: 0.12rem 0;
    border-radius: 0.24rem;
    font-size: 0.14rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid $border-color;

    &--cancel {
      background: $bg-white;
      color: $text-dark;

      &:hover {
        background: $bg-main;
      }
    }

    &--submit {
      background: $btn-dark;
      color: $bg-white;
      border-color: $btn-dark;

      &:hover {
        background: $btn-dark-hover;
        border-color: $btn-dark-hover;
      }
    }
  }
}
