@use '../variables' as *;

// ========================================
// 首页-求职辅导Tab样式
// ========================================
.home-mentor {
  font-size: 0.14rem;
  width: 100%;

  // 第一部分容器
  &__section {
    width: 12rem;
    margin: 0 auto;
    padding: 0.6rem 0;
  }

  // 标题区域
  &__header {
    text-align: center;
    margin-bottom: 0.4rem;
  }

  &__title {
    font-size: 0.36rem;
    line-height: 0.48rem;
    font-weight: 700;
    color: $text-dark;
    margin-bottom: 0.12rem;
  }

  &__subtitle {
    font-size: 0.14rem;
    line-height: 0.2rem;
    color: $text-middle;
  }

  // ==================== 行业分类Tab ====================
  &__tabs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.08rem;
    margin-bottom: 0.32rem;
  }

  &__tab {
    padding: 0.08rem 0.20rem;
    border-radius: 999px;
    font-size: 0.14rem;
    line-height: 0.19rem;
    font-weight: 400;
    color: $text-dark;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    border: 1px solid transparent;

    &:hover {
      background: #F0FAFB;
      color: $accent;
    }

    // 选中态
    &--active {
      background: $accent;
      color: #FFFFFF;
      font-weight: 500;

      &:hover {
        background: $accent-hover;
        color: #FFFFFF;
      }
    }
  }

  // ==================== 导师列表 ====================
  &__list-wrap {
    height: 11rem;
    overflow-y: auto;
  }

  &__list {
    // 无需额外样式
  }

  &__no-more {
    text-align: center;
    padding: 0.24rem 0;
    font-size: 0.14rem;
    color: $text-light;
  }

  // 导师卡片
  &__card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.24rem 0.32rem;
    background: $bg-white;
    border: 1px solid #F0F0F0;
    border-radius: 0.12rem;
    margin-bottom: 0.12rem;
    cursor: pointer;
    transition: box-shadow 0.2s, border-color 0.2s;

    &:hover {
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
      border-color: #E0E8E8;
    }

    &:last-child {
      margin-bottom: 0;
    }
  }

  // 卡片左侧 — 限制最大宽度让右侧话题纵向对齐
  &__card-left {
    display: flex;
    align-items: center;
    gap: 0.14rem;
    flex: 1 1 0;
    max-width: 50%;
    min-width: 0;
  }

  // 头像
  &__avatar-wrap {
    flex-shrink: 0;
  }

  &__avatar {
    width: 0.56rem;
    height: 0.56rem;
    border-radius: 50%;
    object-fit: cover;
  }

  &__avatar-placeholder {
    width: 0.56rem;
    height: 0.56rem;
    border-radius: 50%;
    background: #EDF9FA;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.2rem;
    font-weight: 600;
    color: $accent;
  }

  // 导师信息
  &__card-info {
    flex: 1;
    min-width: 0;
  }

  &__card-name-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.10rem;
    margin-bottom: 0.08rem;
  }

  &__card-name {
    font-size: 0.18rem;
    line-height: 0.24rem;
    font-weight: 600;
    color: $text-dark;
  }

  &__card-meta {
    display: flex;
    align-items: center;
    gap: 0.04rem;
    font-size: 0.13rem;
    line-height: 0.18rem;
    font-weight: 400;
    color: $text-middle;
  }

  &__card-agency-logo {
    width: 0.18rem;
    height: 0.18rem;
    border-radius: 50%;
    object-fit: cover;
  }

  // 标签列表
  &__card-labels {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.06rem;
  }

  &__card-label {
    display: inline-flex;
    align-items: center;
    padding: 0.02rem 0.08rem;
    background: #F0FAFB;
    border-radius: 0.04rem;
    font-size: 0.12rem;
    line-height: 0.16rem;
    font-weight: 330;
    color: $accent;
    white-space: nowrap;
  }

  // 卡片右侧 — flex:1 让话题区自适应剩余空间
  &__card-right {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    gap: 0.12rem;
    min-width: 0;
  }

  // 话题列表 — 占据右侧剩余空间，自动截断
  &__card-topics {
    flex: 1;
    min-width: 0;
  }

  &__card-topic {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.12rem;
    line-height: 1.6;
    color: $text-middle;
  }

  // 查看详情按钮
  &__detail-btn {
    display: flex;
    align-items: center;
    gap: 0.04rem;
    padding: 0;
    border: none;
    background: none;
    font-size: 0.14rem;
    line-height: 0.19rem;
    font-weight: 450;
    color: $accent;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s;

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

  // ==================== 加载中 ====================
  &__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0;
    gap: 0.08rem;
    color: $text-light;
    font-size: 0.14rem;
  }

  &__spinner {
    width: 0.2rem;
    height: 0.2rem;
    border: 2px solid #e5e7eb;
    border-top-color: $accent;
    border-radius: 50%;
    animation: home-mentor-spin 0.8s linear infinite;
  }

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

  // ==================== 查看更多按钮 ====================
  &__more {
    display: flex;
    justify-content: center;
    margin-top: 0.32rem;
  }

  &__more-btn {
    padding: 0.10rem 0.40rem;
    border-radius: 0.08rem;
    background: $text-dark;
    color: #FFFFFF;
    font-size: 0.14rem;
    line-height: 0.2rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background 0.2s;

    &:hover {
      background: #333;
    }
  }
}

@keyframes home-mentor-spin {
  to { transform: rotate(360deg); }
}
