@use '../variables' as *;

// ==================== Agent设置面板样式（重新设计） ====================
.agent-setting-panel {
  position: relative;
  width: 3.60rem;
  height: var(--app-height, 100vh);
  background: #FFFFFF;
  font-size: 0.14rem;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  &::-webkit-scrollbar { display: none; }

  // 头部标题区
  &__header {
    padding: 0.24rem 0.24rem 0;
  }

  &__title {
    font-size: 0.20rem;
    font-weight: 630;
    line-height: 0.27rem;
    color: #1A1A1A;
  }

  &__subtitle {
    margin-top: 0.04rem;
    font-size: 0.14rem;
    font-weight: 330;
    line-height: 0.19rem;
    color: #6B7280;
  }

  // 分隔线
  &__divider {
    width: 3.12rem;
    height: 1px;
    margin: 0.24rem auto;
    background: #F0F0F0;
  }

  // 通用区块
  &__section {
    padding: 0 0.24rem;
    margin-bottom: 0.08rem;
  }

  // 区块头部
  &__section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.08rem;
  }

  // 区块标题
  &__section-title {
    font-size: 0.16rem;
    font-weight: 620;
    line-height: 0.21rem;
    color: #1A1A1A;
  }

  // 编辑按钮
  &__edit-btn {
    display: flex;
    align-items: center;
    gap: 0.04rem;
    font-size: 0.14rem;
    font-weight: 450;
    color: $accent;
    cursor: pointer;

    svg {
      width: 0.14rem;
      height: 0.14rem;
    }

    &:hover {
      opacity: 0.7;
    }
  }

  // 个人信息文字
  &__info-text {
    font-size: 0.14rem;
    font-weight: 330;
    line-height: 0.19rem;
    color: $text-middle;
  }

  // 求职偏好内容
  &__goal-content {
    font-size: 0.14rem;
    font-weight: 330;
    line-height: 0.24rem;
    color: $text-middle;

    p {
      margin: 0;
    }
  }

  // 空状态
  &__empty-text {
    font-size: 0.14rem;
    color: $text-light;
  }

  // 简历下拉
  &__resume-dropdown {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.08rem 0.12rem;
    margin-top: 0.08rem;
    background: #F3F4F6;
    border-radius: 0.08rem;
    cursor: pointer;
  }

  &__resume-name {
    font-size: 0.14rem;
    font-weight: 450;
    color: $text-middle;
  }

  &__resume-arrow {
    width: 0.14rem;
    height: 0.14rem;
    transition: transform 0.2s;

    &--open {
      transform: rotate(180deg);
    }
  }

  &__resume-options {
    margin-top: 0.04rem;
    background: #FFFFFF;
    border: 1px solid #F0F0F0;
    border-radius: 0.08rem;
    box-shadow: 0 0.02rem 0.08rem rgba(0, 0, 0, 0.06);
    overflow: hidden;
  }

  &__resume-option {
    padding: 0.08rem 0.12rem;
    font-size: 0.14rem;
    color: $text-dark;
    cursor: pointer;

    &:hover {
      background: #F6FCFC;
    }

    &--active {
      color: $accent;
      background: #F6FCFC;
    }
  }

  // 开关项
  &__switch-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.16rem 0;
  }

  &__switch-text {
    display: flex;
    flex-direction: column;
    gap: 0.04rem;
  }

  &__switch-label {
    font-size: 0.14rem;
    font-weight: 450;
    line-height: 0.19rem;
    color: #1A1A1A;
  }

  &__switch-desc {
    font-size: 0.12rem;
    font-weight: 330;
    line-height: 0.16rem;
    color: $text-middle;
  }

  // 自定义开关
  &__toggle {
    position: relative;
    width: 0.42rem;
    height: 0.24rem;
    background: #F3F4F6;
    border-radius: 0.12rem;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;

    &--on {
      background: $accent;

      .agent-setting-panel__toggle-dot {
        left: 0.20rem;
      }
    }
  }

  &__toggle-dot {
    position: absolute;
    width: 0.18rem;
    height: 0.18rem;
    left: 0.04rem;
    top: 0.03rem;
    background: #FFFFFF;
    border-radius: 50%;
    transition: left 0.2s;
  }

  // 浏览器插件按钮
  &__browser-btns {
    display: flex;
    gap: 0.16rem;
    margin-top: 0.12rem;
  }

  &__browser-btn {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 0.04rem;
    padding: 0.12rem 0.16rem;
    background: #FFFFFF;
    border: 1px solid #F0F0F0;
    border-radius: 0.08rem;
    font-size: 0.14rem;
    font-weight: 450;
    color: $text-middle;
    cursor: pointer;
    transition: border-color 0.2s;

    svg {
      width: 0.16rem;
      height: 0.16rem;
    }

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

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


  // ==================== 编辑弹窗 ====================
  &__edit-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding-top: 1.20rem;
    padding-right: 0.30rem;
  }

  &__edit-dialog {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.24rem 0.32rem;
    gap: 0.24rem;
    width: 4.80rem;
    background: linear-gradient(180deg, #EDF9FA 0%, #FFFFFF 20.63%);
    border: 1px solid #F0F0F0;
    box-shadow: 0 0 0.16rem rgba(0, 0, 0, 0.05);
    border-radius: 0.12rem;
    font-size: 0.14rem;
  }

  &__edit-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  &__edit-dialog-title {
    font-size: 0.18rem;
    font-weight: 620;
    line-height: 0.24rem;
    color: #1A1A1A;
  }

  &__edit-dialog-close {
    width: 0.24rem;
    height: 0.24rem;
    cursor: pointer;

    &:hover {
      opacity: 0.6;
    }
  }

  &__edit-dialog-body {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.16rem;
  }

  &__edit-row {
    display: flex;
    gap: 0.08rem;
  }

  &__edit-field {
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
    flex: 1;

    &--full {
      width: 100%;
    }
  }

  &__edit-label {
    font-size: 0.14rem;
    font-weight: 330;
    line-height: 0.19rem;
    color: $text-middle;
  }

  &__edit-input {
    box-sizing: border-box;
    width: 100%;
    padding: 0.08rem 0.16rem;
    background: #FFFFFF;
    border: 1px solid #AEE6EA;
    border-radius: 0.08rem;
    font-size: 0.14rem;
    font-weight: 330;
    line-height: 0.19rem;
    color: #1A1A1A;
    outline: none;
    transition: border-color 0.2s;

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

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

  &__edit-city {
    width: 100%;
  }

  &__edit-dialog-save {
    width: 100%;
    padding: 0.12rem 0.16rem;
    background: $accent;
    border: none;
    border-radius: 0.08rem;
    font-size: 0.14rem;
    font-weight: 450;
    line-height: 0.19rem;
    color: #FFFFFF;
    cursor: pointer;
    transition: opacity 0.2s;

    &:hover {
      opacity: 0.85;
    }

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

// ==================== 浏览器插件安装教程抽屉 ====================

/* 遮罩层 */
.agent-browser-guide-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-browser-guide-drawer {
  width: 9.6rem;
  max-width: 9.6rem;
  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;
    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;
  }

  /* 内容区域 */
  &__body {
    flex: 1;
    overflow-y: auto;
    padding: 0 0.32rem 0.32rem;
    display: flex;
    flex-direction: column;
    gap: 0.16rem;
    font-size: 0.14rem;
  }

  /* 步骤卡片 */
  &__card {
    border: 1px solid #F0F0F0;
    border-radius: 0.12rem;
    padding: 0.16rem 0.2rem;
    display: flex;
    flex-wrap: wrap;
  }

  &__step-row {
    display: flex;
    align-items: flex-start;
    gap: 0.12rem;
    margin-bottom: 0.16rem;
    margin-right: 1rem;
  }

  &__step-num {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 0.32rem;
    height: 0.32rem;
    background: #EDF9FA;
    border-radius: 0.08rem;
    font-size: 0.18rem;
    font-weight: 620;
    color: $accent;
    flex-shrink: 0;
  }

  &__step-info {
    flex: 1;
  }

  &__step-title {
    font-size: 0.18rem;
    font-weight: 620;
    color: $text-dark;
    line-height: 0.24rem;
    margin: 0 0 0.04rem;
  }

  &__step-desc {
    font-size: 0.14rem;
    font-weight: 330;
    color: $text-middle;
    line-height: 0.19rem;
    margin: 0;
  }

  /* 下载按钮区域 */
  &__download-box {
    display: flex;
    align-items: center;
    gap: 0.16rem;
    padding: 0.04rem 0.04rem 0.04rem 0.16rem;
    background: $bg-main;
    border-radius: 0.12rem;
    height: 0.44rem;
    margin-left: 0.4rem;
  }

  &__download-name {
    font-size: 0.14rem;
    font-weight: 450;
    color: $text-dark;
    line-height: 0.19rem;
  }

  &__download-btn {
    display: flex;
    align-items: center;
    gap: 0.04rem;
    padding: 0.08rem 0.12rem;
    background: $accent;
    border: none;
    border-radius: 0.08rem;
    color: $bg-white;
    font-size: 0.14rem;
    font-weight: 620;
    cursor: pointer;
    transition: background 0.2s;

    &:hover {
      background: $accent-hover;
    }
  }

  /* 浏览器链接区域 */
  &__browser-links {
    display: flex;
    align-items: flex-start;
    gap: 0.24rem;
    margin-bottom: 0.16rem;
    margin-left: 0.4rem;
  }

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

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

    svg {
      flex-shrink: 0;
    }

    span {
      white-space: nowrap;
    }
  }

  &__copy-btn {
    display: flex;
    align-items: center;
    gap: 0.04rem;
    color: $accent;
    font-size: 0.14rem;
    font-weight: 450;
    margin-left: 0.12rem;
  }

  /* 步骤示意图 */
  &__step-img {
    width: 100%;
    max-width: 3.52rem;
    border-radius: 0.08rem;
    margin-top: 0.12rem;
    margin-left: 0.4rem;
  }
}

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

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

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

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