@use '../variables' as *;

// ========================================
// 首页-岗位雷达Tab样式
// ========================================
.home-job-radar {
  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-light;
  }

  // ==================== 筛选面板 ====================
  &__filters {
    background: $bg-white;
    border: 1px solid #F0F0F0;
    box-shadow: 0px 2px 6px rgba(15, 23, 42, 0.025);
    border-radius: 0.14rem;
    padding: 0.24rem 0.40rem;
    margin-bottom: 0.32rem;
  }

  // 筛选行
  &__filter-row {
    display: flex;
    align-items: center;
    margin-bottom: 0.16rem;

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

  // 筛选标签文字
  &__filter-label {
    width: 0.28rem;
    font-size: 0.14rem;
    line-height: 0.19rem;
    font-weight: 450;
    color: $text-light;
    flex-shrink: 0;
    margin-right: 0.24rem;
  }

  // 筛选chip容器
  &__filter-chips {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.14rem;
  }

  // 筛选chip
  &__chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.06rem 0.12rem;
    border-radius: 999px;
    background: #F5F8F8;
    font-size: 0.14rem;
    line-height: 0.19rem;
    font-weight: 330;
    color: $text-middle;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;

    &:hover {
      background: #E8F7F8;
    }

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

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

  // ==================== 岗位卡片网格 ====================
  &__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.16rem;
  }

  // 岗位卡片
  &__card {
    background: $bg-white;
    border: 1px solid #F0F0F0;
    border-radius: 0.08rem;
    padding: 0.16rem;
    cursor: pointer;
    transition: box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 1.33rem;
    box-sizing: border-box;

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

  // 卡片上半部分
  &__card-top {
    // 无需额外样式
  }

  // 岗位标题
  &__card-title {
    font-size: 0.16rem;
    line-height: 0.21rem;
    font-weight: 520;
    color: $text-dark;
    margin-bottom: 0.08rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  // 标签行
  &__card-tags {
    display: flex;
    align-items: center;
    gap: 0.08rem;
  }

  // 单个标签
  &__card-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.03rem 0.06rem;
    background: #F3F4F6;
    border-radius: 0.04rem;
    font-size: 0.12rem;
    line-height: 0.16rem;
    font-weight: 380;
    color: $text-middle;
  }

  // 卡片下半部分
  &__card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  // 公司信息
  &__card-company {
    display: flex;
    align-items: center;
    gap: 0.04rem;
  }

  // 公司logo
  &__card-logo {
    width: 0.24rem;
    height: 0.24rem;
    border-radius: 50%;
    border: 1px solid #F4F4F4;
    object-fit: cover;
    flex-shrink: 0;

    &--default {
      display: flex;
      align-items: center;
      justify-content: center;
      background: $bg-white;
    }
  }

  // 公司名称
  &__card-company-name {
    font-size: 0.14rem;
    line-height: 0.19rem;
    font-weight: 450;
    color: $text-dark;
    max-width: 1.69rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  // 公司类型标签
  &__card-company-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.03rem 0.06rem;
    background: #ECFDF3;
    border-radius: 0.04rem;
    font-size: 0.12rem;
    line-height: 0.16rem;
    font-weight: 380;
    color: #067647;
  }

  // 发布时间
  &__card-time {
    font-size: 0.12rem;
    line-height: 0.16rem;
    font-weight: 330;
    color: $text-light;
    text-align: right;
  }

  // ==================== 加载中 ====================
  &__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: spin 0.8s linear infinite;
  }

  // ==================== 查看更多按钮 ====================
  &__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 spin {
  to { transform: rotate(360deg); }
}
