@use '../variables' as *;

/* 投递任务抽屉 — 从浏览器右侧弹出 */

/* 遮罩层 */
.agent-task-drawer-mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: var(--app-height, 100vh);
  background: rgba(0, 0, 0, 0.3);
  z-index: 2000;
  display: flex;
  justify-content: flex-end;
}

/* 抽屉主体 */
.agent-task-drawer {
  width: 6.4rem;
  height: var(--app-height, 100vh);
  background: $bg-white;
  display: flex;
  flex-direction: column;
  font-size: 0.14rem;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.08);

  /* 顶部标题栏 */
  &__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.2rem 0.24rem;
    height: 0.64rem;
    box-sizing: border-box;
  }

  &__header-left {
    display: flex;
    align-items: center;
    gap: 0.16rem;
  }

  /* 关闭按钮 */
  &__close {
    width: 0.24rem;
    height: 0.24rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  &__close-icon {
    width: 0.24rem;
    height: 0.24rem;
    color: $text-middle;
  }

  /* 标题文字 */
  &__title {
    font-size: 0.18rem;
    font-weight: 620;
    color: $text-dark;
    line-height: 0.24rem;
  }

  /* Tab 切换按钮区域 */
  &__tabs {
    display: flex;
    align-items: flex-start;
    gap: 0.16rem;
    padding: 0 0.24rem 0.2rem;
  }

  &__tab {
    display: flex;
    align-items: center;
    padding: 0.08rem 0.12rem;
    gap: 0.04rem;
    border-radius: 0.08rem;
    font-size: 0.14rem;
    font-weight: 450;
    line-height: 0.19rem;
    cursor: pointer;
    border: 1px solid #F0F0F0;
    background: $bg-white;
    color: $text-middle;
    transition: all 0.2s;

    &--active {
      background: $accent;
      color: $bg-white;
      border-color: $accent;
    }
  }

  /* 列表内容区域 */
  &__body {
    flex: 1;
    overflow-y: auto;
    padding: 0 0.24rem 0.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.16rem;
  }

  /* 空状态 */
  &__empty {
    text-align: center;
    color: $text-light;
    font-size: 0.14rem;
    padding: 0.4rem 0;
  }

  /* 岗位卡片 */
  &__card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.16rem 0.2rem;
    background: $bg-white;
    border: 1px solid #F0F0F0;
    border-radius: 0.08rem;
    box-sizing: border-box;
  }

  &__card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
  }

  /* 岗位标题 */
  &__card-title {
    font-size: 0.18rem;
    font-weight: 620;
    color: $text-dark;
    line-height: 0.27rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* 公司信息行 */
  &__card-company {
    display: flex;
    align-items: center;
    gap: 0.08rem;
    font-size: 0.18rem;
    font-weight: 330;
    color: $text-dark;
    line-height: 0.27rem;
  }

  &__card-logo {
    width: 0.24rem;
    height: 0.24rem;
    border-radius: 0.04rem;
    object-fit: cover;
    flex-shrink: 0;
  }

  &__card-logo-placeholder {
    width: 0.24rem;
    height: 0.24rem;
    color: $text-light;
    flex-shrink: 0;
  }

  /* 移出任务按钮 */
  &__remove-btn {
    display: flex;
    align-items: center;
    padding: 0.08rem 0.12rem;
    gap: 0.04rem;
    border: 1px solid $accent;
    border-radius: 0.08rem;
    background: $bg-white;
    font-size: 0.14rem;
    font-weight: 450;
    color: $accent;
    line-height: 0.19rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    flex-shrink: 0;

    &:hover {
      background: $accent;
      color: $bg-white;
    }

    &:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }
  }
}

/* 抽屉动画 */
.agent-task-drawer-enter-active,
.agent-task-drawer-leave-active {
  transition: opacity 0.3s ease;

  .agent-task-drawer {
    transition: transform 0.3s ease;
  }
}

.agent-task-drawer-enter-from,
.agent-task-drawer-leave-to {
  opacity: 0;

  .agent-task-drawer {
    transform: translateX(100%);
  }
}
