@use '../variables' as *;
@use 'sass:color';

// ==================== 定制简历编辑面板（折叠手风琴式） ====================
.job-resume-edit {
  font-size: 14px;
  line-height: 1.5;
  overflow-y: auto;
  flex: 1;
  padding: 0.12rem 0;

  // 单个折叠模块
  &__section {
    margin-bottom: 0.08rem;
  }

  // 模块标题栏（可点击展开/收起）
  &__section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.14rem 0.16rem;
    background: $bg-main;
    border-radius: 0.08rem;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;

    &:hover {
      background: color.adjust($bg-main, $lightness: -2%);
    }
  }

  &__section-title {
    font-size: 0.14rem;
    font-weight: 600;
    color: $text-dark;
  }

  // 展开/收起箭头
  &__section-arrow {
    width: 0.14rem;
    height: 0.14rem;
    color: $text-middle;
    transition: transform 0.25s ease;
    flex-shrink: 0;
  }

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

  // 模块内容区（展开时显示）
  &__section-body {
    padding: 0.16rem 0.12rem 0.08rem;
  }

  // 字段容器
  &__field {
    margin-bottom: 0.14rem;
  }

  // 字段标签
  &__label {
    display: block;
    font-size: 0.12rem;
    font-weight: 600;
    color: $text-dark;
    margin-bottom: 0.04rem;
  }

  // 输入框
  &__input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.08rem 0.12rem;
    font-size: 0.12rem;
    color: $text-dark;
    background: $bg-main;
    border: 1px solid transparent;
    border-radius: 0.06rem;
    outline: none;
    transition: all 0.2s;

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

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

  // 多行文本
  &__textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.08rem 0.12rem;
    font-size: 0.12rem;
    color: $text-dark;
    background: $bg-main;
    border: 1px solid transparent;
    border-radius: 0.06rem;
    outline: none;
    transition: all 0.2s;
    resize: vertical;
    font-family: inherit;
    line-height: 1.6;

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

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

    // 带删除按钮时右侧留空
    &--with-remove {
      padding-right: 0.3rem;
    }
  }

  // 横排字段
  &__row {
    display: flex;
    gap: 0.1rem;
  }

  &__field--half {
    flex: 1;
    min-width: 0;
  }

  // 经历卡片
  &__card {
    padding-bottom: 0.14rem;
    margin-bottom: 0.14rem;
    border-bottom: 1px solid $border-color;

    &:last-of-type {
      border-bottom: none;
    }
  }

  // 经历卡片头部
  &__card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.1rem;
  }

  &__card-index {
    display: flex;
    align-items: center;
    font-size: 0.14rem;
    color: $accent;
  }

  &__card-index-dot {
    width: 0.0rem;
    height: 0.0rem;
    color: $accent;
  }

  // 删除按钮
  &__card-delete {
    background: none;
    border: none;
    padding: 0.03rem;
    cursor: pointer;
    color: $accent;
    display: flex;
    align-items: center;
    border-radius: 0.04rem;
    transition: all 0.2s;

    &:hover {
      color: $danger;
      background: rgba($danger, 0.06);
    }
  }

  &__card-delete-icon {
    width: 0.13rem;
    height: 0.13rem;
  }

  // 描述段落容器
  &__desc-item {
    position: relative;
    margin-bottom: 0.06rem;
  }

  // 描述段落删除按钮
  &__desc-remove {
    position: absolute;
    right: 0.06rem;
    top: 0.06rem;
    background: none;
    border: none;
    padding: 0.02rem;
    cursor: pointer;
    color: $text-light;
    display: flex;
    align-items: center;
    border-radius: 0.03rem;
    transition: all 0.2s;

    &:hover {
      color: $danger;
    }
  }

  &__desc-remove-icon {
    width: 0.1rem;
    height: 0.1rem;
  }

  // 新增按钮
  &__add-btn {
    text-align: center;
    background: none;
    border: 1px solid $border-color;
    border-radius: 0.16rem;
    padding: 0.04rem 0.12rem;
    font-size: 0.11rem;
    color: $text-dark;
    cursor: pointer;
    transition: all 0.2s;

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

  &__add-btn--full {
    width: 100%;
    margin-top: 0.06rem;
    margin-bottom: 0.1rem;
  }

  &__add-icon {
    font-size: 0.12rem;
    font-weight: 600;
  }

  // 技能/证书标签列表
  &__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.06rem;
    margin-bottom: 0.1rem;
    min-height: 0.3rem;
  }

  &__tag {
    display: inline-flex;
    align-items: center;
    gap: 0.04rem;
    padding: 0.04rem 0.08rem 0.04rem 0.1rem;
    background: $bg-main;
    border-radius: 0.12rem;
    font-size: 0.11rem;
    color: $text-dark;
    transition: all 0.2s;

    &:hover {
      background: color.adjust($bg-main, $lightness: -3%);
    }
  }

  &__tag-remove {
    background: none;
    border: none;
    padding: 0.01rem;
    cursor: pointer;
    color: $text-light;
    display: flex;
    align-items: center;
    border-radius: 50%;
    transition: all 0.2s;

    &:hover {
      color: $danger;
    }
  }

  &__tag-remove-icon {
    width: 0.1rem;
    height: 0.1rem;
  }

  // 日期选择器样式覆盖
  &__date-picker {
    width: 100% !important;

    .el-input__wrapper {
      background: $bg-main !important;
      border: 1px solid transparent !important;
      border-radius: 6px !important;
      box-shadow: none !important;
      padding: 3px 10px !important;
      font-size: 12px !important;
      line-height: 1.5 !important;
      height: auto !important;

      &:hover {
        border-color: $border-color !important;
      }

      &.is-focus {
        border-color: $accent !important;
        background: $bg-white !important;
      }
    }

    .el-input__inner {
      font-size: 12px !important;
      color: $text-dark !important;
      height: auto !important;
      line-height: 1.5 !important;

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

    .el-input__prefix,
    .el-input__suffix {
      font-size: 12px !important;
    }

    .el-input__icon {
      width: 12px !important;
      height: 12px !important;
      font-size: 12px !important;
    }
  }

  // 下拉选择器
  &__select {
    width: 100%;
    box-sizing: border-box;
    padding: 0.08rem 0.12rem;
    font-size: 0.12rem;
    color: $text-dark;
    background: $bg-main;
    border: 1px solid transparent;
    border-radius: 0.06rem;
    outline: none;
    transition: all 0.2s;
    cursor: pointer;

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