@use '../variables' as *;

// ==================== 简历列表页（卡片视图） ====================
.resume-page {
  min-width: 12.8rem;

  &__content {
    flex: 1;
    height: var(--app-height, 100vh);
    box-sizing: border-box;
    overflow: hidden;
    background: $bg-main;
    display: flex;
    flex-direction: column;
    font-size: 0.14rem;
  }

  &__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    padding: 0.19rem 0.24rem;
  }

  &__title {
    font-size: 0.18rem;
    font-weight: 700;
    color: $text-dark;
    margin: 0;
  }

  // 卡片网格容器
  &__card-grid {
    flex: 1;
    overflow-y: auto;
    padding: 0.24rem;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 0.24rem;
  }

  // ==================== 简历卡片 ====================
  &__card {
    width: 2.10rem;
    height: 2.97rem;
    border-radius: 0.12rem;
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease;
    position: relative;

    &:hover {
      transform: translateY(-0.08rem);
      filter: drop-shadow(0px 4px 12px rgba(0, 0, 0, 0.06));
    }
  }

  // hover嵌套选择器
  &__card:hover &__card-more-btn {
    opacity: 1;
  }
  &__card:hover &__card-edit-time {
    opacity: 1;
    height: 0.16rem;
    margin-top: 0.04rem;
  }
  // hover时info向上扩展（absolute定位，卡片总高度不变）
  &__card:hover &__card-info {
    height: 0.86rem;
  }

  // 卡片预览图区域
  &__card-preview {
    width: 100%;
    height: 100%;
    border-radius: 0.12rem;
    background: $bg-white;
    overflow: hidden;
    position: relative;

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      border-radius: 0.12rem;
    }
  }

  // 默认标记（左上角）
  &__card-default-tag {
    position: absolute;
    top: 0;
    left: 0;
    background: $accent;
    color: #fff;
    font-size: 0.12rem;
    font-weight: 520;
    padding: 0.02rem 0.08rem;
    border-radius: 0.12rem 0 0.12rem 0;
    z-index: 2;
    line-height: 0.16rem;
  }

  // 更多按钮（右上角圆形）
  &__card-more-btn {
    position: absolute;
    top: 0.12rem;
    right: 0.16rem;
    width: 0.32rem;
    height: 0.32rem;
    background: $bg-white;
    border-radius: 50%;
    box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 3;
    border: none;

    &:hover {
      background: #f5f5f5;
    }

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

  // 更多菜单弹出层
  &__card-menu {
    position: absolute;
    top: 0.44rem;
    right: 0.08rem;
    width: 1.04rem;
    background: $bg-white;
    box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.1);
    border-radius: 0.08rem;
    padding: 0.06rem 0;
    z-index: 10;
  }

  &__card-menu-item {
    display: flex;
    align-items: center;
    padding: 0.06rem 0.08rem;
    gap: 0.04rem;
    cursor: pointer;
    font-size: 0.14rem;
    font-weight: 380;
    color: $text-middle;
    transition: background 0.15s;
    white-space: nowrap;

    &:hover {
      background: #f9f9f9;
    }

    // 设为默认特殊样式
    &--default {
      background: #EDF9FA;
      border-radius: 0.04rem;
      margin: 0 0.06rem;
      padding: 0.06rem 0.08rem;
      color: $accent;

      &:hover {
        background: #ddf3f5;
      }
    }

    // 删除按钮特殊样式
    &--delete {
      svg {
        color: $text-middle;
      }
    }

    svg {
      width: 0.16rem;
      height: 0.16rem;
      flex-shrink: 0;
    }
  }

  // 卡片底部信息区域（absolute定位在卡片底部，hover时向上扩展，卡片总高度不变）
  &__card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: $bg-white;
    box-shadow: 0px -2px 12px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 0.12rem 0.12rem;
    padding: 0.12rem;
    height: 0.66rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: height 0.3s ease;
    z-index: 2;
  }

  // 卡片信息头部（名称 + 编辑按钮）
  &__card-info-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  // 简历名称
  &__card-name {
    font-size: 0.14rem;
    font-weight: 450;
    color: #000;
    max-width: 1.50rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 0.19rem;
  }

  // 编辑图标按钮
  &__card-edit-btn {
    width: 0.20rem;
    height: 0.20rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;

    &:hover {
      opacity: 0.7;
    }

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

  // 目标岗位
  &__card-target {
    font-size: 0.14rem;
    font-weight: 330;
    color: $text-middle;
    line-height: 0.19rem;
    margin-top: 0.04rem;
    max-width: 1.80rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  // 最后编辑时间（hover 时显示）
  &__card-edit-time {
    font-size: 0.12rem;
    font-weight: 330;
    color: $text-light;
    line-height: 0.16rem;
    opacity: 0;
    height: 0;
    margin-top: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, height 0.3s ease, margin-top 0.3s ease;
  }

  // ==================== 新建卡片 ====================
  &__card-new {
    width: 2.10rem;
    height: 2.97rem;
    border-radius: 0.12rem;
    background: $bg-white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    gap: 0.08rem;

    &:hover {
      transform: translateY(-0.08rem);
      box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.06);
    }

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

    span {
      font-size: 0.18rem;
      font-weight: 520;
      color: $accent;
      line-height: 0.24rem;
    }
  }

  // 空状态提示
  &__empty {
    padding: 0.6rem 0.2rem;
    text-align: center;
    color: $text-light;
    font-size: 0.14rem;
  }

  // 加载中
  &__loading-box {
    width: 100%;
    padding: 0.2rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.08rem;
    color: $text-light;
    font-size: 0.12rem;
  }
}

// ==================== 上传简历加载提示 ====================
.resume-upload-loading {
  .el-loading-spinner {
    .circular .path {
      stroke: $accent;
    }

    .el-loading-text {
      color: $accent;
    }
  }
}

// ==================== 导出简历弹窗样式修正 ====================
.resume-export-dialog {
  font-size: 0.14rem;
  .el-dialog__title {
    font-size: 16px;
    font-weight: 600;
  }

  .el-dialog__body {
    padding: 0.2rem 0.3rem 0.1rem;
  }

  /* 修正 radio 组件在 100px 基准下的尺寸 */
  &__radio-group {
    display: flex;
    gap: 0.16rem;

    .el-radio {
      font-size: 14px;
      height: auto;
      line-height: normal;

      .el-radio__inner {
        width: 14px;
        height: 14px;
      }

      .el-radio__label {
        font-size: 14px;
        padding-left: 8px;
      }
    }
  }

  .el-dialog__footer {
    padding: 0.12rem 0.3rem 0.24rem;

    .el-button {
      font-size: 13px;
      padding: 8px 20px;
      border-radius: 6px;
    }

    .el-button--primary {
      background: $btn-dark;
      border-color: $btn-dark;

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